summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorAndre Klapper <a9016009@gmx.de>2010-06-10 12:49:58 +0200
committerThomas Thurman <tthurman@gnome.org>2010-06-10 23:59:43 -0400
commit6cb379f48e9c9e1b28d461b8ff1eb73ed841fc58 (patch)
tree3b44cb5b625c13c2e671989e0510483db59bb359 /src/ui
parent4a1ef32503a6ed0a378269a22f2d2d7fc90c668e (diff)
downloadmetacity-6cb379f48e9c9e1b28d461b8ff1eb73ed841fc58.tar.gz
metacity-6cb379f48e9c9e1b28d461b8ff1eb73ed841fc58.tar.bz2
More fixes for compiling with GSeal. Requires gtk 2.20.
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/draw-workspace.c16
-rw-r--r--src/ui/fixedtip.c2
-rw-r--r--src/ui/preview-widget.c42
-rw-r--r--src/ui/theme.c34
4 files changed, 54 insertions, 40 deletions
diff --git a/src/ui/draw-workspace.c b/src/ui/draw-workspace.c
index f7c98b6..72daf67 100644
--- a/src/ui/draw-workspace.c
+++ b/src/ui/draw-workspace.c
@@ -77,6 +77,7 @@ draw_window (GtkWidget *widget,
int icon_x, icon_y, icon_w, icon_h;
gboolean is_active;
GdkColor *color;
+ GtkStyle *style;
is_active = win->is_active;
@@ -84,10 +85,11 @@ draw_window (GtkWidget *widget,
cairo_rectangle (cr, winrect->x, winrect->y, winrect->width, winrect->height);
cairo_clip (cr);
+ style = gtk_widget_get_style (widget);
if (is_active)
- color = &widget->style->light[state];
+ color = &style->light[state];
else
- color = &widget->style->bg[state];
+ color = &style->bg[state];
cairo_set_source_rgb (cr,
color->red / 65535.,
color->green / 65535.,
@@ -143,9 +145,9 @@ draw_window (GtkWidget *widget,
}
if (is_active)
- color = &widget->style->fg[state];
+ color = &style->fg[state];
else
- color = &widget->style->fg[state];
+ color = &style->fg[state];
cairo_set_source_rgb (cr,
color->red / 65535.,
@@ -193,7 +195,7 @@ wnck_draw_workspace (GtkWidget *widget,
if (workspace_background)
{
gdk_draw_pixbuf (drawable,
- GTK_WIDGET (widget)->style->dark_gc[state],
+ gtk_widget_get_style (GTK_WIDGET (widget))->dark_gc[state],
workspace_background,
0, 0,
x, y,
@@ -205,8 +207,8 @@ wnck_draw_workspace (GtkWidget *widget,
{
cairo_t *cr;
- cr = gdk_cairo_create (widget->window);
- gdk_cairo_set_source_color (cr, &widget->style->dark[state]);
+ cr = gdk_cairo_create (gtk_widget_get_window (widget));
+ gdk_cairo_set_source_color (cr, &gtk_widget_get_style (widget)->dark[state]);
cairo_rectangle (cr, x, y, width, height);
cairo_fill (cr);
cairo_destroy (cr);
diff --git a/src/ui/fixedtip.c b/src/ui/fixedtip.c
index bffaf99..be25390 100644
--- a/src/ui/fixedtip.c
+++ b/src/ui/fixedtip.c
@@ -53,7 +53,7 @@ static int screen_bottom_edge = 0;
static gint
expose_handler (GtkTooltips *tooltips)
{
- gtk_paint_flat_box (tip->style, tip->window,
+ gtk_paint_flat_box (gtk_widget_get_style (tip), gtk_widget_get_window (tip),
GTK_STATE_NORMAL, GTK_SHADOW_OUT,
NULL, tip, "tooltip",
0, 0, -1, -1);
diff --git a/src/ui/preview-widget.c b/src/ui/preview-widget.c
index a6da36d..26b2756 100644
--- a/src/ui/preview-widget.c
+++ b/src/ui/preview-widget.c
@@ -86,7 +86,7 @@ meta_preview_init (MetaPreview *preview)
{
int i;
- GTK_WIDGET_SET_FLAGS (preview, GTK_NO_WINDOW);
+ gtk_widget_set_has_window (GTK_WIDGET (preview), FALSE);
i = 0;
while (i < MAX_BUTTONS_PER_CORNER)
@@ -216,6 +216,7 @@ meta_preview_expose (GtkWidget *widget,
GdkEventExpose *event)
{
MetaPreview *preview;
+ GtkAllocation allocation;
int border_width;
int client_width;
int client_height;
@@ -234,10 +235,11 @@ meta_preview_expose (GtkWidget *widget,
ensure_info (preview);
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
- client_width = widget->allocation.width - preview->left_width - preview->right_width - border_width * 2;
- client_height = widget->allocation.height - preview->top_height - preview->bottom_height - border_width * 2;
+ gtk_widget_get_allocation (widget, &allocation);
+ client_width = allocation.width - preview->left_width - preview->right_width - border_width * 2;
+ client_height = allocation.height - preview->top_height - preview->bottom_height - border_width * 2;
if (client_width < 0)
client_width = 1;
@@ -246,14 +248,14 @@ meta_preview_expose (GtkWidget *widget,
if (preview->theme)
{
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
meta_theme_draw_frame (preview->theme,
widget,
- widget->window,
+ gtk_widget_get_window (widget),
&event->area,
- widget->allocation.x + border_width,
- widget->allocation.y + border_width,
+ allocation.x + border_width,
+ allocation.y + border_width,
preview->type,
preview->flags,
client_width, client_height,
@@ -274,6 +276,8 @@ meta_preview_size_request (GtkWidget *widget,
GtkRequisition *req)
{
MetaPreview *preview;
+ GtkWidget *child;
+ guint border_width;
preview = META_PREVIEW (widget);
@@ -282,12 +286,13 @@ meta_preview_size_request (GtkWidget *widget,
req->width = preview->left_width + preview->right_width;
req->height = preview->top_height + preview->bottom_height;
- if (GTK_BIN (preview)->child &&
- GTK_WIDGET_VISIBLE (GTK_BIN (preview)->child))
+ child = gtk_bin_get_child (GTK_BIN (preview));
+ if (child &&
+ gtk_widget_get_visible (child))
{
GtkRequisition child_requisition;
- gtk_widget_size_request (GTK_BIN (preview)->child, &child_requisition);
+ gtk_widget_size_request (child, &child_requisition);
req->width += child_requisition.width;
req->height += child_requisition.height;
@@ -300,8 +305,9 @@ meta_preview_size_request (GtkWidget *widget,
req->height += NO_CHILD_HEIGHT;
}
- req->width += GTK_CONTAINER (widget)->border_width * 2;
- req->height += GTK_CONTAINER (widget)->border_width * 2;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ req->width += border_width * 2;
+ req->height += border_width * 2;
}
static void
@@ -311,6 +317,7 @@ meta_preview_size_allocate (GtkWidget *widget,
MetaPreview *preview;
int border_width;
GtkAllocation child_allocation;
+ GtkWidget *child;
preview = META_PREVIEW (widget);
@@ -318,10 +325,11 @@ meta_preview_size_allocate (GtkWidget *widget,
widget->allocation = *allocation;
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
- if (GTK_BIN (widget)->child &&
- GTK_WIDGET_VISIBLE (GTK_BIN (widget)->child))
+ child = gtk_bin_get_child (GTK_BIN (widget));
+ if (child &&
+ gtk_widget_get_visible (child))
{
child_allocation.x = widget->allocation.x + border_width + preview->left_width;
child_allocation.y = widget->allocation.y + border_width + preview->top_height;
@@ -329,7 +337,7 @@ meta_preview_size_allocate (GtkWidget *widget,
child_allocation.width = MAX (1, widget->allocation.width - border_width * 2 - preview->left_width - preview->right_width);
child_allocation.height = MAX (1, widget->allocation.height - border_width * 2 - preview->top_height - preview->bottom_height);
- gtk_widget_size_allocate (GTK_BIN (widget)->child, &child_allocation);
+ gtk_widget_size_allocate (gtk_bin_get_child (GTK_BIN (widget)), &child_allocation);
}
}
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 7e4859d..921a91b 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -1360,9 +1360,13 @@ meta_color_spec_render (MetaColorSpec *spec,
GtkWidget *widget,
GdkColor *color)
{
+ GtkStyle *widget_style;
+
g_return_if_fail (spec != NULL);
g_return_if_fail (GTK_IS_WIDGET (widget));
- g_return_if_fail (widget->style != NULL);
+
+ widget_style = gtk_widget_get_style (widget);
+ g_return_if_fail (widget_style != NULL);
switch (spec->type)
{
@@ -1374,28 +1378,28 @@ meta_color_spec_render (MetaColorSpec *spec,
switch (spec->data.gtk.component)
{
case META_GTK_COLOR_BG:
- *color = widget->style->bg[spec->data.gtk.state];
+ *color = widget_style->bg[spec->data.gtk.state];
break;
case META_GTK_COLOR_FG:
- *color = widget->style->fg[spec->data.gtk.state];
+ *color = widget_style->fg[spec->data.gtk.state];
break;
case META_GTK_COLOR_BASE:
- *color = widget->style->base[spec->data.gtk.state];
+ *color = widget_style->base[spec->data.gtk.state];
break;
case META_GTK_COLOR_TEXT:
- *color = widget->style->text[spec->data.gtk.state];
+ *color = widget_style->text[spec->data.gtk.state];
break;
case META_GTK_COLOR_LIGHT:
- *color = widget->style->light[spec->data.gtk.state];
+ *color = widget_style->light[spec->data.gtk.state];
break;
case META_GTK_COLOR_DARK:
- *color = widget->style->dark[spec->data.gtk.state];
+ *color = widget_style->dark[spec->data.gtk.state];
break;
case META_GTK_COLOR_MID:
- *color = widget->style->mid[spec->data.gtk.state];
+ *color = widget_style->mid[spec->data.gtk.state];
break;
case META_GTK_COLOR_TEXT_AA:
- *color = widget->style->text_aa[spec->data.gtk.state];
+ *color = widget_style->text_aa[spec->data.gtk.state];
break;
case META_GTK_COLOR_LAST:
g_assert_not_reached ();
@@ -3857,7 +3861,7 @@ meta_draw_op_draw (const MetaDrawOp *op,
const MetaDrawInfo *info,
MetaRectangle logical_region)
{
- meta_draw_op_draw_with_style (op, widget->style, widget,
+ meta_draw_op_draw_with_style (op, gtk_widget_get_style (widget), widget,
drawable, clip, info, logical_region);
}
@@ -3987,7 +3991,7 @@ meta_draw_op_list_draw (const MetaDrawOpList *op_list,
MetaRectangle rect)
{
- meta_draw_op_list_draw_with_style (op_list, widget->style, widget,
+ meta_draw_op_list_draw_with_style (op_list, gtk_widget_get_style (widget), widget,
drawable, clip, info, rect);
}
@@ -4559,7 +4563,7 @@ meta_frame_style_draw (MetaFrameStyle *style,
GdkPixbuf *mini_icon,
GdkPixbuf *icon)
{
- meta_frame_style_draw_with_style (style, widget->style, widget,
+ meta_frame_style_draw_with_style (style, gtk_widget_get_style (widget), widget,
drawable, x_offset, y_offset,
clip, fgeom, client_width, client_height,
title_layout, text_height,
@@ -5182,7 +5186,7 @@ meta_theme_draw_frame (MetaTheme *theme,
GdkPixbuf *mini_icon,
GdkPixbuf *icon)
{
- meta_theme_draw_frame_with_style (theme, widget->style, widget,
+ meta_theme_draw_frame_with_style (theme, gtk_widget_get_style (widget), widget,
drawable, clip, x_offset, y_offset, type,flags,
client_width, client_height,
title_layout, text_height,
@@ -5576,9 +5580,9 @@ meta_gtk_widget_get_font_desc (GtkWidget *widget,
{
PangoFontDescription *font_desc;
- g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL);
+ g_return_val_if_fail (gtk_widget_get_realized (widget), NULL);
- font_desc = pango_font_description_copy (widget->style->font_desc);
+ font_desc = pango_font_description_copy (gtk_widget_get_style (widget)->font_desc);
if (override)
pango_font_description_merge (font_desc, override, TRUE);