summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2000-06-20 21:04:44 +0000
committerHavoc Pennington <hp@src.gnome.org>2000-06-20 21:04:44 +0000
commitdf4fc3672127660c1d47e4225297d00abbee84eb (patch)
tree403962726a72ea66e7efa1b25169c03d7a59d362 /gtk
parent2ad30e9fc1a98635ec329b8ff57a8e7a34968f8e (diff)
downloadgdk-pixbuf-df4fc3672127660c1d47e4225297d00abbee84eb.tar.gz
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtk-boxed.defs15
-rw-r--r--gtk/gtkaccellabel.c4
-rw-r--r--gtk/gtkbutton.c24
-rw-r--r--gtk/gtkcalendar.c53
-rw-r--r--gtk/gtkcheckmenuitem.c2
-rw-r--r--gtk/gtkclist.c47
-rw-r--r--gtk/gtkcombo.c8
-rw-r--r--gtk/gtkcontainer.c3
-rw-r--r--gtk/gtkctree.c13
-rw-r--r--gtk/gtkdnd.c36
-rw-r--r--gtk/gtkentry.c28
-rw-r--r--gtk/gtkfontsel.c2
-rw-r--r--gtk/gtkframe.c24
-rw-r--r--gtk/gtkhandlebox.c4
-rw-r--r--gtk/gtkhruler.c14
-rw-r--r--gtk/gtkhscale.c10
-rw-r--r--gtk/gtkhscrollbar.c24
-rw-r--r--gtk/gtkhseparator.c4
-rw-r--r--gtk/gtklabel.c8
-rw-r--r--gtk/gtklistitem.c4
-rw-r--r--gtk/gtkmenu.c8
-rw-r--r--gtk/gtkmenubar.c8
-rw-r--r--gtk/gtkmenuitem.c8
-rw-r--r--gtk/gtknotebook.c58
-rw-r--r--gtk/gtkoptionmenu.c8
-rw-r--r--gtk/gtkplug.c2
-rw-r--r--gtk/gtkprogressbar.c116
-rw-r--r--gtk/gtkradiomenuitem.c2
-rw-r--r--gtk/gtkrange.c16
-rw-r--r--gtk/gtkrc.c292
-rw-r--r--gtk/gtkrc.h24
-rw-r--r--gtk/gtkscale.c2
-rw-r--r--gtk/gtksocket.c9
-rw-r--r--gtk/gtkspinbutton.c42
-rw-r--r--gtk/gtkstyle.c583
-rw-r--r--gtk/gtkstyle.h21
-rw-r--r--gtk/gtktearoffmenuitem.c8
-rw-r--r--gtk/gtktext.c24
-rw-r--r--gtk/gtktextlayout.c14
-rw-r--r--gtk/gtktexttag.c8
-rw-r--r--gtk/gtktextview.c4
-rw-r--r--gtk/gtktogglebutton.c4
-rw-r--r--gtk/gtktoolbar.c4
-rw-r--r--gtk/gtktreeitem.c4
-rw-r--r--gtk/gtkviewport.c16
-rw-r--r--gtk/gtkvruler.c15
-rw-r--r--gtk/gtkvscale.c8
-rw-r--r--gtk/gtkvscrollbar.c24
-rw-r--r--gtk/gtkvseparator.c4
-rw-r--r--gtk/gtkwidget.c23
50 files changed, 876 insertions, 810 deletions
diff --git a/gtk/gtk-boxed.defs b/gtk/gtk-boxed.defs
index c36b2fdca..23f82b65c 100644
--- a/gtk/gtk-boxed.defs
+++ b/gtk/gtk-boxed.defs
@@ -16,10 +16,6 @@
(define-boxed GtkSelectionData
)
-(define-boxed GtkStyle
- gtk_style_ref
- gtk_style_unref)
-
(define-boxed GtkCTreeNode
)
@@ -29,10 +25,6 @@
; gdk_point_copy
; gdk_point_destroy)
-(define-boxed GdkColormap
- gdk_colormap_ref
- gdk_colormap_unref)
-
(define-boxed GdkVisual
gdk_visual_ref
gdk_visual_unref)
@@ -41,13 +33,6 @@
gdk_font_ref
gdk_font_unref)
-(define-boxed GdkWindow
- gdk_window_ref
- gdk_window_unref)
-
-(define-boxed GdkDragContext
- gdk_drag_context_ref
- gdk_drag_context_unref)
(define-boxed GdkEvent
gdk_event_copy
gdk_event_free
diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c
index 4b82736f9..bfe338181 100644
--- a/gtk/gtkaccellabel.c
+++ b/gtk/gtkaccellabel.c
@@ -247,7 +247,7 @@ gtk_accel_label_size_request (GtkWidget *widget,
pango_layout_get_extents (layout, NULL, &logical_rect);
accel_label->accel_string_width = logical_rect.width / PANGO_SCALE;
- pango_layout_unref (layout);
+ g_object_unref (G_OBJECT (layout));
}
static gint
@@ -304,7 +304,7 @@ gtk_accel_label_expose_event (GtkWidget *widget,
y,
layout);
- pango_layout_unref (layout);
+ g_object_unref (G_OBJECT (layout));
}
else
{
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 2c9113aed..65684e758 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -429,15 +429,15 @@ gtk_button_size_request (GtkWidget *widget,
button = GTK_BUTTON (widget);
requisition->width = (GTK_CONTAINER (widget)->border_width + CHILD_SPACING +
- GTK_WIDGET (widget)->style->klass->xthickness) * 2;
+ GTK_WIDGET (widget)->style->xthickness) * 2;
requisition->height = (GTK_CONTAINER (widget)->border_width + CHILD_SPACING +
- GTK_WIDGET (widget)->style->klass->ythickness) * 2;
+ GTK_WIDGET (widget)->style->ythickness) * 2;
if (GTK_WIDGET_CAN_DEFAULT (widget))
{
- requisition->width += (GTK_WIDGET (widget)->style->klass->xthickness * 2 +
+ requisition->width += (GTK_WIDGET (widget)->style->xthickness * 2 +
DEFAULT_SPACING);
- requisition->height += (GTK_WIDGET (widget)->style->klass->ythickness * 2 +
+ requisition->height += (GTK_WIDGET (widget)->style->ythickness * 2 +
DEFAULT_SPACING);
}
@@ -478,8 +478,8 @@ gtk_button_size_allocate (GtkWidget *widget,
if (GTK_BIN (button)->child && GTK_WIDGET_VISIBLE (GTK_BIN (button)->child))
{
- child_allocation.x = (CHILD_SPACING + GTK_WIDGET (widget)->style->klass->xthickness);
- child_allocation.y = (CHILD_SPACING + GTK_WIDGET (widget)->style->klass->ythickness);
+ child_allocation.x = (CHILD_SPACING + GTK_WIDGET (widget)->style->xthickness);
+ child_allocation.y = (CHILD_SPACING + GTK_WIDGET (widget)->style->ythickness);
child_allocation.width = MAX (1, (gint)widget->allocation.width - child_allocation.x * 2 -
border_width * 2);
@@ -488,14 +488,14 @@ gtk_button_size_allocate (GtkWidget *widget,
if (GTK_WIDGET_CAN_DEFAULT (button))
{
- child_allocation.x += (GTK_WIDGET (widget)->style->klass->xthickness +
+ child_allocation.x += (GTK_WIDGET (widget)->style->xthickness +
DEFAULT_LEFT_POS);
- child_allocation.y += (GTK_WIDGET (widget)->style->klass->ythickness +
+ child_allocation.y += (GTK_WIDGET (widget)->style->ythickness +
DEFAULT_TOP_POS);
child_allocation.width = MAX (1, (gint)child_allocation.width -
- (gint)(GTK_WIDGET (widget)->style->klass->xthickness * 2 + DEFAULT_SPACING));
+ (gint)(GTK_WIDGET (widget)->style->xthickness * 2 + DEFAULT_SPACING));
child_allocation.height = MAX (1, (gint)child_allocation.height -
- (gint)(GTK_WIDGET (widget)->style->klass->xthickness * 2 + DEFAULT_SPACING));
+ (gint)(GTK_WIDGET (widget)->style->xthickness * 2 + DEFAULT_SPACING));
}
gtk_widget_size_allocate (GTK_BIN (button)->child, &child_allocation);
@@ -560,8 +560,8 @@ gtk_button_paint (GtkWidget *widget,
if (GTK_WIDGET_CAN_DEFAULT (widget))
{
- x += widget->style->klass->xthickness;
- y += widget->style->klass->ythickness;
+ x += widget->style->xthickness;
+ y += widget->style->ythickness;
width -= 2 * x + DEFAULT_SPACING;
height -= 2 * y + DEFAULT_SPACING;
x += DEFAULT_LEFT_POS;
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c
index bc5708dfc..341379051 100644
--- a/gtk/gtkcalendar.c
+++ b/gtk/gtkcalendar.c
@@ -962,11 +962,11 @@ gtk_calendar_realize_day_names (GtkWidget *widget)
attributes.colormap = gtk_widget_get_colormap (widget);
attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
- attributes.x = (widget->style->klass->xthickness + INNER_BORDER);
- attributes.y = private_data->header_h + (widget->style->klass->ythickness
+ attributes.x = (widget->style->xthickness + INNER_BORDER);
+ attributes.y = private_data->header_h + (widget->style->ythickness
+ INNER_BORDER);
attributes.width = (widget->allocation.width
- - (widget->style->klass->xthickness + INNER_BORDER)
+ - (widget->style->xthickness + INNER_BORDER)
* 2);
attributes.height = private_data->day_name_h;
private_data->day_name_win = gdk_window_new (widget->window,
@@ -1007,9 +1007,9 @@ gtk_calendar_realize_week_numbers (GtkWidget *widget)
attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
- attributes.x = + (widget->style->klass->xthickness + INNER_BORDER);
+ attributes.x = + (widget->style->xthickness + INNER_BORDER);
attributes.y = (private_data->header_h + private_data->day_name_h
- + (widget->style->klass->ythickness + INNER_BORDER));
+ + (widget->style->ythickness + INNER_BORDER));
attributes.width = private_data->week_width;
attributes.height = private_data->main_h;
private_data->week_win = gdk_window_new (widget->window,
@@ -1075,11 +1075,11 @@ gtk_calendar_realize (GtkWidget *widget)
attributes.x = private_data->week_width;
else
attributes.x = 0;
- attributes.x += (widget->style->klass->xthickness + INNER_BORDER);
+ attributes.x += (widget->style->xthickness + INNER_BORDER);
attributes.y = (private_data->header_h + private_data->day_name_h
- + (widget->style->klass->ythickness + INNER_BORDER));
+ + (widget->style->ythickness + INNER_BORDER));
attributes.width = (widget->allocation.width - attributes.x
- - (widget->style->klass->xthickness + INNER_BORDER));
+ - (widget->style->xthickness + INNER_BORDER));
attributes.height = private_data->main_h;
private_data->main_win = gdk_window_new (widget->window,
&attributes, attributes_mask);
@@ -1262,7 +1262,7 @@ gtk_calendar_size_request (GtkWidget *widget,
: 0));
- requisition->width = MAX (header_width+4, main_width + (widget->style->klass->xthickness + INNER_BORDER) *2);
+ requisition->width = MAX (header_width+4, main_width + (widget->style->xthickness + INNER_BORDER) *2);
/*
* Calculate the requisition height for the widget.
@@ -1312,9 +1312,9 @@ gtk_calendar_size_request (GtkWidget *widget,
height = (private_data->header_h + private_data->day_name_h
+ private_data->main_h);
- requisition->height = height + (widget->style->klass->ythickness + INNER_BORDER) * 2;
+ requisition->height = height + (widget->style->ythickness + INNER_BORDER) * 2;
- pango_layout_unref (layout);
+ g_object_unref (G_OBJECT (layout));
}
static void
@@ -1336,17 +1336,17 @@ gtk_calendar_size_allocate (GtkWidget *widget,
if (calendar->display_flags & GTK_CALENDAR_SHOW_WEEK_NUMBERS)
{
private_data->day_width = (private_data->min_day_width
- * ((allocation->width - (widget->style->klass->xthickness + INNER_BORDER) * 2
+ * ((allocation->width - (widget->style->xthickness + INNER_BORDER) * 2
- (CALENDAR_MARGIN * 2) - (DAY_XSEP * 7) - CALENDAR_XSEP * 2))
/ (7 * private_data->min_day_width + private_data->max_week_char_width * 2));
- private_data->week_width = ((allocation->width - (widget->style->klass->xthickness + INNER_BORDER) * 2
+ private_data->week_width = ((allocation->width - (widget->style->xthickness + INNER_BORDER) * 2
- (CALENDAR_MARGIN * 2) - (DAY_XSEP * 7) - CALENDAR_XSEP * 2 )
- private_data->day_width * 7 + CALENDAR_MARGIN + CALENDAR_XSEP);
}
else
{
private_data->day_width = (allocation->width
- - (widget->style->klass->xthickness + INNER_BORDER) * 2
+ - (widget->style->xthickness + INNER_BORDER) * 2
- (CALENDAR_MARGIN * 2)
- (DAY_XSEP * 7))/7;
private_data->week_width = 0;
@@ -1390,25 +1390,25 @@ gtk_calendar_size_allocate (GtkWidget *widget,
private_data->header_h - 7);
if (private_data->day_name_win)
gdk_window_move_resize (private_data->day_name_win,
- widget->style->klass->xthickness + INNER_BORDER,
- private_data->header_h + (widget->style->klass->ythickness + INNER_BORDER),
- allocation->width - (widget->style->klass->xthickness + INNER_BORDER) * 2,
+ widget->style->xthickness + INNER_BORDER,
+ private_data->header_h + (widget->style->ythickness + INNER_BORDER),
+ allocation->width - (widget->style->xthickness + INNER_BORDER) * 2,
private_data->day_name_h);
if (private_data->week_win)
gdk_window_move_resize (private_data->week_win,
- (widget->style->klass->xthickness + INNER_BORDER),
+ (widget->style->xthickness + INNER_BORDER),
private_data->header_h + private_data->day_name_h
- + (widget->style->klass->ythickness + INNER_BORDER),
+ + (widget->style->ythickness + INNER_BORDER),
private_data->week_width,
private_data->main_h);
gdk_window_move_resize (private_data->main_win,
(private_data->week_width ? private_data->week_width + CALENDAR_XSEP :0)
- + (widget->style->klass->xthickness + INNER_BORDER),
+ + (widget->style->xthickness + INNER_BORDER),
private_data->header_h + private_data->day_name_h
- + (widget->style->klass->ythickness + INNER_BORDER),
+ + (widget->style->ythickness + INNER_BORDER),
allocation->width
- (private_data->week_width ? private_data->week_width + CALENDAR_XSEP :0)
- - (widget->style->klass->xthickness + INNER_BORDER) * 2,
+ - (widget->style->xthickness + INNER_BORDER) * 2,
private_data->main_h);
}
}
@@ -1602,7 +1602,7 @@ gtk_calendar_paint_header (GtkWidget *widget)
gtk_calendar_paint_arrow (widget, ARROW_YEAR_LEFT);
gtk_calendar_paint_arrow (widget, ARROW_YEAR_RIGHT);
- pango_layout_unref (layout);
+ g_object_unref (G_OBJECT (layout));
}
static void
@@ -1690,7 +1690,7 @@ gtk_calendar_paint_day_names (GtkWidget *widget)
layout);
}
- pango_layout_unref (layout);
+ g_object_unref (G_OBJECT (layout));
}
static void
@@ -1779,7 +1779,7 @@ gtk_calendar_paint_week_numbers (GtkWidget *widget)
gdk_draw_layout (private_data->week_win, gc, x_loc, y_loc, layout);
}
- pango_layout_unref (layout);
+ g_object_unref (G_OBJECT (layout));
}
static void
@@ -1924,8 +1924,7 @@ gtk_calendar_paint_day (GtkWidget *widget,
private_data->day_width-1, day_height-1);
}
- pango_layout_unref (layout);
-
+ g_object_unref (G_OBJECT (layout));
}
diff --git a/gtk/gtkcheckmenuitem.c b/gtk/gtkcheckmenuitem.c
index d149fdbc0..74afbf104 100644
--- a/gtk/gtkcheckmenuitem.c
+++ b/gtk/gtkcheckmenuitem.c
@@ -247,7 +247,7 @@ gtk_real_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
width = 8;
height = 8;
x = (GTK_CONTAINER (check_menu_item)->border_width +
- widget->style->klass->xthickness + 2);
+ widget->style->xthickness + 2);
y = (widget->allocation.height - height) / 2;
if (check_menu_item->active ||
diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c
index 84e0b9395..d4f79c012 100644
--- a/gtk/gtkclist.c
+++ b/gtk/gtkclist.c
@@ -2044,7 +2044,7 @@ new_column_width (GtkCList *clist,
gint column,
gint *x)
{
- gint xthickness = GTK_WIDGET (clist)->style->klass->xthickness;
+ gint xthickness = GTK_WIDGET (clist)->style->xthickness;
gint width;
gint cx;
gint dx;
@@ -2530,7 +2530,7 @@ _gtk_clist_create_cell_layout (GtkCList *clist,
GTK_CELL_PIXTEXT (*cell)->text :
GTK_CELL_TEXT (*cell)->text), -1);
- pango_context_unref (context);
+ g_object_unref (G_OBJECT (context));
return layout;
@@ -2562,7 +2562,7 @@ cell_size_request (GtkCList *clist,
requisition->width = logical_rect.width / PANGO_SCALE;
requisition->height = logical_rect.height / PANGO_SCALE;
- pango_layout_unref (layout);
+ g_object_unref (G_OBJECT (layout));
}
else
{
@@ -3028,7 +3028,7 @@ gtk_clist_set_row_height (GtkCList *clist,
g_free (lang);
g_object_unref (G_OBJECT (font));
- pango_context_unref (context);
+ g_object_unref (G_OBJECT (context));
if (!GTK_CLIST_ROW_HEIGHT_SET(clist))
clist->row_height = (metrics.ascent + metrics.descent) / PANGO_SCALE;
@@ -4511,9 +4511,9 @@ gtk_clist_realize (GtkWidget *widget)
/* clist-window */
attributes.x = (clist->internal_allocation.x +
- widget->style->klass->xthickness);
+ widget->style->xthickness);
attributes.y = (clist->internal_allocation.y +
- widget->style->klass->ythickness +
+ widget->style->ythickness +
clist->column_title_area.height);
attributes.width = clist->clist_window_width;
attributes.height = clist->clist_window_height;
@@ -4801,9 +4801,9 @@ gtk_clist_draw (GtkWidget *widget,
GTK_STATE_NORMAL, clist->shadow_type,
0, 0,
clist->clist_window_width +
- (2 * widget->style->klass->xthickness),
+ (2 * widget->style->xthickness),
clist->clist_window_height +
- (2 * widget->style->klass->ythickness) +
+ (2 * widget->style->ythickness) +
clist->column_title_area.height);
gdk_window_clear_area (clist->clist_window, 0, 0, 0, 0);
@@ -4840,9 +4840,9 @@ gtk_clist_expose (GtkWidget *widget,
GTK_STATE_NORMAL, clist->shadow_type,
0, 0,
clist->clist_window_width +
- (2 * widget->style->klass->xthickness),
+ (2 * widget->style->xthickness),
clist->clist_window_height +
- (2 * widget->style->klass->ythickness) +
+ (2 * widget->style->ythickness) +
clist->column_title_area.height);
/* exposure events on the list */
@@ -5441,11 +5441,11 @@ gtk_clist_size_request (GtkWidget *widget,
MAX (clist->column_title_area.height,
child_requisition.height);
}
-
- requisition->width += (widget->style->klass->xthickness +
+
+ requisition->width += (widget->style->xthickness +
GTK_CONTAINER (widget)->border_width) * 2;
requisition->height += (clist->column_title_area.height +
- (widget->style->klass->ythickness +
+ (widget->style->ythickness +
GTK_CONTAINER (widget)->border_width) * 2);
/* if (!clist->hadjustment) */
@@ -5491,14 +5491,14 @@ gtk_clist_size_allocate (GtkWidget *widget,
/* allocate clist window assuming no scrollbars */
clist_allocation.x = (clist->internal_allocation.x +
- widget->style->klass->xthickness);
+ widget->style->xthickness);
clist_allocation.y = (clist->internal_allocation.y +
- widget->style->klass->ythickness +
+ widget->style->ythickness +
clist->column_title_area.height);
clist_allocation.width = MAX (1, (gint)clist->internal_allocation.width -
- (2 * (gint)widget->style->klass->xthickness));
+ (2 * (gint)widget->style->xthickness));
clist_allocation.height = MAX (1, (gint)clist->internal_allocation.height -
- (2 * (gint)widget->style->klass->ythickness) -
+ (2 * (gint)widget->style->ythickness) -
(gint)clist->column_title_area.height);
clist->clist_window_width = clist_allocation.width;
@@ -5514,8 +5514,8 @@ gtk_clist_size_allocate (GtkWidget *widget,
}
/* position the window which holds the column title buttons */
- clist->column_title_area.x = widget->style->klass->xthickness;
- clist->column_title_area.y = widget->style->klass->ythickness;
+ clist->column_title_area.x = widget->style->xthickness;
+ clist->column_title_area.y = widget->style->ythickness;
clist->column_title_area.width = clist_allocation.width;
if (GTK_WIDGET_REALIZED (widget))
@@ -5921,7 +5921,7 @@ draw_row (GtkCList *clist,
offset,
row_rectangle.y + row_center_offset + clist_row->cell[i].vertical,
layout);
- pango_layout_unref (layout);
+ g_object_unref (G_OBJECT (layout));
gdk_gc_set_clip_rectangle (fg_gc, NULL);
}
break;
@@ -6016,7 +6016,7 @@ draw_xor_line (GtkCList *clist)
gdk_draw_line (widget->window, clist->xor_gc,
clist->x_drag,
- widget->style->klass->ythickness,
+ widget->style->ythickness,
clist->x_drag,
clist->column_title_area.height +
clist->clist_window_height + 1);
@@ -7484,7 +7484,7 @@ drag_dest_cell (GtkCList *clist,
dest_info->insert_pos = GTK_CLIST_DRAG_NONE;
y -= (GTK_CONTAINER (clist)->border_width +
- widget->style->klass->ythickness +
+ widget->style->ythickness +
clist->column_title_area.height);
dest_info->cell.row = ROW_FROM_YPIXEL (clist, y);
@@ -7495,8 +7495,9 @@ drag_dest_cell (GtkCList *clist,
}
if (dest_info->cell.row < -1)
dest_info->cell.row = -1;
+
+ x -= GTK_CONTAINER (widget)->border_width + widget->style->xthickness;
- x -= GTK_CONTAINER (widget)->border_width + widget->style->klass->xthickness;
dest_info->cell.column = COLUMN_FROM_XPIXEL (clist, x);
if (dest_info->cell.row >= 0)
diff --git a/gtk/gtkcombo.c b/gtk/gtkcombo.c
index fc0f267b0..32b19ae62 100644
--- a/gtk/gtkcombo.c
+++ b/gtk/gtkcombo.c
@@ -325,17 +325,17 @@ gtk_combo_get_pos (GtkCombo * combo, gint * x, gint * y, gint * height, gint * w
list_requisition.height += EMPTY_LIST_HEIGHT;
alloc_width = (widget->allocation.width -
- 2 * popwin->child->style->klass->xthickness -
+ 2 * popwin->child->style->xthickness -
2 * GTK_CONTAINER (popwin->child)->border_width -
2 * GTK_CONTAINER (combo->popup)->border_width -
2 * GTK_CONTAINER (GTK_BIN (popup)->child)->border_width -
- 2 * GTK_BIN (popup)->child->style->klass->xthickness);
+ 2 * GTK_BIN (popup)->child->style->xthickness);
- work_height = (2 * popwin->child->style->klass->ythickness +
+ work_height = (2 * popwin->child->style->ythickness +
2 * GTK_CONTAINER (popwin->child)->border_width +
2 * GTK_CONTAINER (combo->popup)->border_width +
2 * GTK_CONTAINER (GTK_BIN (popup)->child)->border_width +
- 2 * GTK_BIN (popup)->child->style->klass->xthickness);
+ 2 * GTK_BIN (popup)->child->style->xthickness);
do
{
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index ec2eca973..ab2164c5c 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -59,9 +59,6 @@ struct _GtkChildArgInfo
guint seq_id;
};
-/* The global list of toplevel windows */
-static GList *toplevel_list = NULL;
-
static void gtk_container_base_class_init (GtkContainerClass *klass);
static void gtk_container_class_init (GtkContainerClass *klass);
static void gtk_container_init (GtkContainer *container);
diff --git a/gtk/gtkctree.c b/gtk/gtkctree.c
index 91db6ecd5..619959d4d 100644
--- a/gtk/gtkctree.c
+++ b/gtk/gtkctree.c
@@ -1880,7 +1880,7 @@ draw_row (GtkCList *clist,
row_rectangle.y + row_center_offset + clist_row->cell[i].vertical,
layout);
gdk_gc_set_clip_rectangle (fg_gc, NULL);
- pango_layout_unref (layout);
+ g_object_unref (G_OBJECT (layout));
}
break;
default:
@@ -1901,7 +1901,7 @@ draw_row (GtkCList *clist,
&intersect_rectangle))
{
if (layout)
- pango_layout_unref (layout);
+ g_object_unref (G_OBJECT (layout));
continue;
}
@@ -1955,7 +1955,7 @@ draw_row (GtkCList *clist,
row_rectangle.y + row_center_offset + clist_row->cell[i].vertical,
layout);
- pango_layout_unref (layout);
+ g_object_unref (G_OBJECT (layout));
}
gdk_gc_set_clip_rectangle (fg_gc, NULL);
}
@@ -2820,7 +2820,7 @@ cell_size_request (GtkCList *clist,
requisition->width = logical_rect.width / PANGO_SCALE;
requisition->height = logical_rect.height / PANGO_SCALE;
- pango_layout_unref (layout);
+ g_object_unref (G_OBJECT (layout));
}
else
{
@@ -5879,7 +5879,7 @@ drag_dest_cell (GtkCList *clist,
dest_info->insert_pos = GTK_CLIST_DRAG_NONE;
y -= (GTK_CONTAINER (widget)->border_width +
- widget->style->klass->ythickness + clist->column_title_area.height);
+ widget->style->ythickness + clist->column_title_area.height);
dest_info->cell.row = ROW_FROM_YPIXEL (clist, y);
if (dest_info->cell.row >= clist->rows)
@@ -5889,8 +5889,9 @@ drag_dest_cell (GtkCList *clist,
}
if (dest_info->cell.row < -1)
dest_info->cell.row = -1;
+
+ x -= GTK_CONTAINER (widget)->border_width + widget->style->xthickness;
- x -= GTK_CONTAINER (widget)->border_width + widget->style->klass->xthickness;
dest_info->cell.column = COLUMN_FROM_XPIXEL (clist, x);
if (dest_info->cell.row >= 0)
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 5de66cfa2..0cd1bf863 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -993,8 +993,8 @@ gtk_drag_dest_handle_event (GtkWidget *toplevel,
info->proxy_data = NULL;
info->dropped = FALSE;
info->proxy_drop_wait = FALSE;
- g_dataset_set_data_full (context,
- "gtk-info",
+ g_object_set_qdata_full (G_OBJECT (context),
+ g_quark_from_static_string ("gtk-info"),
info,
gtk_drag_dest_info_destroy);
}
@@ -1127,7 +1127,7 @@ gtk_drag_selection_received (GtkWidget *widget,
drop_widget = data;
context = gtk_object_get_data (GTK_OBJECT (widget), "drag-context");
- info = g_dataset_get_data (context, "gtk-info");
+ info = g_object_get_qdata (G_OBJECT (context), g_quark_from_static_string ("gtk-info"));
if (info->proxy_data &&
info->proxy_data->target == selection_data->target)
@@ -1345,7 +1345,9 @@ gtk_drag_proxy_begin (GtkWidget *widget,
source_info->proxy_dest = dest_info;
- g_dataset_set_data (source_info->context, "gtk-info", source_info);
+ g_object_set_qdata (G_OBJECT (source_info->context),
+ g_quark_from_static_string ("gtk-info"),
+ source_info);
gtk_signal_connect (GTK_OBJECT (source_info->ipc_widget),
"selection_get",
@@ -1396,7 +1398,8 @@ gtk_drag_dest_leave (GtkWidget *widget,
if (site->do_proxy)
{
- GtkDragDestInfo *info = g_dataset_get_data (context, "gtk-info");
+ GtkDragDestInfo *info = g_object_get_qdata (G_OBJECT (context),
+ g_quark_from_static_string ("gtk-info"));
if (info->proxy_source && !info->dropped)
gdk_drag_abort (info->proxy_source->context, time);
@@ -1437,7 +1440,8 @@ gtk_drag_dest_motion (GtkWidget *widget,
GdkWindow *dest_window;
GdkDragProtocol proto;
- GtkDragDestInfo *info = g_dataset_get_data (context, "gtk-info");
+ GtkDragDestInfo *info = g_object_get_qdata (G_OBJECT (context),
+ g_quark_from_static_string ("gtk-info"));
if (!info->proxy_source)
gtk_drag_proxy_begin (widget, info);
@@ -1534,7 +1538,8 @@ gtk_drag_dest_drop (GtkWidget *widget,
site = gtk_object_get_data (GTK_OBJECT (widget), "gtk-drag-dest");
g_return_val_if_fail (site != NULL, FALSE);
- info = g_dataset_get_data (context, "gtk-info");
+ info = g_object_get_qdata (G_OBJECT (context),
+ g_quark_from_static_string ("gtk-info"));
g_return_val_if_fail (info != NULL, FALSE);
info->drop_x = x;
@@ -1677,7 +1682,8 @@ gtk_drag_begin (GtkWidget *widget,
info->context = gdk_drag_begin (info->ipc_widget->window, targets);
g_list_free (targets);
- g_dataset_set_data (info->context, "gtk-info", info);
+ g_object_set_qdata (G_OBJECT (info->context),
+ g_quark_from_static_string ("gtk-info"), info);
info->button = button;
info->target_list = target_list;
@@ -1913,7 +1919,8 @@ gtk_drag_set_icon_window (GdkDragContext *context,
g_return_if_fail (context != NULL);
g_return_if_fail (widget != NULL);
- info = g_dataset_get_data (context, "gtk-info");
+ info = g_object_get_qdata (G_OBJECT (context),
+ g_quark_from_static_string ("gtk-info"));
gtk_drag_remove_icon (info);
info->icon_window = widget;
@@ -2106,7 +2113,8 @@ gtk_drag_source_handle_event (GtkWidget *widget,
g_return_if_fail (event != NULL);
context = event->dnd.context;
- info = g_dataset_get_data (context, "gtk-info");
+ info = g_object_get_qdata (G_OBJECT (context),
+ g_quark_from_static_string ("gtk-info"));
if (!info)
return;
@@ -2285,7 +2293,8 @@ gtk_drag_drop_finished (GtkDragSourceInfo *info,
/* Mark the context as dead, so if the destination decides
* to respond really late, we still are OK.
*/
- g_dataset_set_data (info->context, "gtk-info", NULL);
+ g_object_set_qdata (G_OBJECT (info->context),
+ g_quark_from_static_string ("gtk-info"), NULL);
gtk_timeout_add (ANIM_STEP_TIME, gtk_drag_anim_timeout, anim);
}
}
@@ -2419,7 +2428,8 @@ gtk_drag_source_event_cb (GtkWidget *widget,
i, event);
- info = g_dataset_get_data (context, "gtk-info");
+ info = g_object_get_qdata (G_OBJECT (context),
+ g_quark_from_static_string ("gtk-info"));
if (!info->icon_window)
{
@@ -2594,7 +2604,7 @@ gtk_drag_source_info_destroy (gpointer data)
gtk_target_list_unref (info->target_list);
- g_dataset_set_data (info->context, "gtk-info", NULL);
+ g_object_set_qdata (G_OBJECT (info->context), g_quark_from_static_string ("gtk-info"), NULL);
gdk_drag_context_unref (info->context);
if (info->drop_timeout)
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 9dfe3e3e2..25e2dbdc9 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -510,7 +510,7 @@ gtk_entry_finalize (GObject *object)
entry = GTK_ENTRY (object);
if (entry->layout)
- pango_layout_unref (entry->layout);
+ g_object_unref (G_OBJECT (entry->layout));
gtk_object_unref (GTK_OBJECT (entry->im_context));
@@ -568,8 +568,8 @@ gtk_entry_realize (GtkWidget *widget)
widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
gdk_window_set_user_data (widget->window, entry);
- attributes.x = widget->style->klass->xthickness;
- attributes.y = widget->style->klass->ythickness;
+ attributes.x = widget->style->xthickness;
+ attributes.y = widget->style->ythickness;
attributes.width = widget->allocation.width - attributes.x * 2;
attributes.height = requisition.height - attributes.y * 2;
attributes.cursor = entry->cursor = gdk_cursor_new (GDK_XTERM);
@@ -668,12 +668,12 @@ gtk_entry_size_request (GtkWidget *widget,
g_return_if_fail (requisition != NULL);
entry = GTK_ENTRY (widget);
-
+
/* We do this to deal with direction changes - should that be a signal?
*/
if (entry->layout)
{
- pango_layout_unref (entry->layout);
+ g_object_unref (G_OBJECT (entry->layout));
entry->layout = NULL;
}
@@ -691,9 +691,9 @@ gtk_entry_size_request (GtkWidget *widget,
entry->ascent = metrics.ascent;
- requisition->width = MIN_ENTRY_WIDTH + (widget->style->klass->xthickness + INNER_BORDER) * 2;
+ requisition->width = MIN_ENTRY_WIDTH + (widget->style->xthickness + INNER_BORDER) * 2;
requisition->height = ((metrics.ascent + metrics.descent) / PANGO_SCALE +
- (widget->style->klass->ythickness + INNER_BORDER) * 2);
+ (widget->style->ythickness + INNER_BORDER) * 2);
}
static void
@@ -725,10 +725,10 @@ gtk_entry_size_allocate (GtkWidget *widget,
allocation->y + (allocation->height - requisition.height) / 2,
allocation->width, requisition.height);
gdk_window_move_resize (entry->text_area,
- widget->style->klass->xthickness,
- widget->style->klass->ythickness,
- allocation->width - widget->style->klass->xthickness * 2,
- requisition.height - widget->style->klass->ythickness * 2);
+ widget->style->xthickness,
+ widget->style->ythickness,
+ allocation->width - widget->style->xthickness * 2,
+ requisition.height - widget->style->ythickness * 2);
}
@@ -752,8 +752,8 @@ gtk_entry_draw (GtkWidget *widget,
{
GdkRectangle tmp_area = *area;
- tmp_area.x -= widget->style->klass->xthickness;
- tmp_area.y -= widget->style->klass->xthickness;
+ tmp_area.x -= widget->style->xthickness;
+ tmp_area.y -= widget->style->xthickness;
gdk_window_begin_paint_rect (entry->text_area, &tmp_area);
gtk_widget_draw_focus (widget);
@@ -1377,7 +1377,7 @@ entry_adjust_scroll (GtkEntry *entry)
g_return_if_fail (GTK_IS_ENTRY (entry));
widget = GTK_WIDGET (entry);
- text_area_width = widget->allocation.width - 2 * (widget->style->klass->xthickness + INNER_BORDER);
+ text_area_width = widget->allocation.width - 2 * (widget->style->xthickness + INNER_BORDER);
if (!entry->layout)
return;
diff --git a/gtk/gtkfontsel.c b/gtk/gtkfontsel.c
index 90c249268..34a9f9516 100644
--- a/gtk/gtkfontsel.c
+++ b/gtk/gtkfontsel.c
@@ -348,7 +348,7 @@ gtk_font_selection_finalize (GObject *object)
fontsel = GTK_FONT_SELECTION (object);
- pango_context_unref (fontsel->context);
+ g_object_unref (G_OBJECT (fontsel->context));
pango_font_description_free (fontsel->font_desc);
if (fontsel->font)
diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c
index 03f1be3fb..dc58e68f8 100644
--- a/gtk/gtkframe.c
+++ b/gtk/gtkframe.c
@@ -374,10 +374,10 @@ gtk_frame_paint (GtkWidget *widget,
{
frame = GTK_FRAME (widget);
- x = frame->child_allocation.x - widget->style->klass->xthickness;
- y = frame->child_allocation.y - widget->style->klass->ythickness;
- width = frame->child_allocation.width + 2 * widget->style->klass->xthickness;
- height = frame->child_allocation.height + 2 * widget->style->klass->ythickness;
+ x = frame->child_allocation.x - widget->style->xthickness;
+ y = frame->child_allocation.y - widget->style->ythickness;
+ width = frame->child_allocation.width + 2 * widget->style->xthickness;
+ height = frame->child_allocation.height + 2 * widget->style->ythickness;
if (frame->label_widget)
{
@@ -393,7 +393,7 @@ gtk_frame_paint (GtkWidget *widget,
else
xalign = 1 - frame->label_xalign;
- height_extra = MAX (0, child_requisition.height - widget->style->klass->xthickness);
+ height_extra = MAX (0, child_requisition.height - widget->style->xthickness);
y -= height_extra * (1 - frame->label_yalign);
height += height_extra * (1 - frame->label_yalign);
@@ -478,7 +478,7 @@ gtk_frame_size_request (GtkWidget *widget,
requisition->width = child_requisition.width;
requisition->height =
- MAX (0, child_requisition.height - GTK_WIDGET (widget)->style->klass->xthickness);
+ MAX (0, child_requisition.height - GTK_WIDGET (widget)->style->xthickness);
}
else
{
@@ -495,9 +495,9 @@ gtk_frame_size_request (GtkWidget *widget,
}
requisition->width += (GTK_CONTAINER (widget)->border_width +
- GTK_WIDGET (widget)->style->klass->xthickness) * 2;
+ GTK_WIDGET (widget)->style->xthickness) * 2;
requisition->height += (GTK_CONTAINER (widget)->border_width +
- GTK_WIDGET (widget)->style->klass->xthickness) * 2;
+ GTK_WIDGET (widget)->style->ythickness) * 2;
}
static void
@@ -602,19 +602,19 @@ gtk_frame_real_compute_child_allocation (GtkFrame *frame,
if (frame->label_widget)
{
gtk_widget_get_child_requisition (frame->label_widget, &child_requisition);
- top_margin = MAX (child_requisition.height, widget->style->klass->ythickness);
+ top_margin = MAX (child_requisition.height, widget->style->ythickness);
}
else
- top_margin = widget->style->klass->ythickness;
+ top_margin = widget->style->ythickness;
child_allocation->x = (GTK_CONTAINER (frame)->border_width +
- widget->style->klass->xthickness);
+ widget->style->xthickness);
child_allocation->width = MAX(1, (gint)allocation->width - child_allocation->x * 2);
child_allocation->y = (GTK_CONTAINER (frame)->border_width + top_margin);
child_allocation->height = MAX (1, ((gint)allocation->height - child_allocation->y -
(gint)GTK_CONTAINER (frame)->border_width -
- (gint)widget->style->klass->ythickness));
+ (gint)widget->style->ythickness));
child_allocation->x += allocation->x;
child_allocation->y += allocation->y;
diff --git a/gtk/gtkhandlebox.c b/gtk/gtkhandlebox.c
index ef2d7ad0c..3060dfb53 100644
--- a/gtk/gtkhandlebox.c
+++ b/gtk/gtkhandlebox.c
@@ -515,9 +515,9 @@ gtk_handle_box_size_request (GtkWidget *widget,
{
if (hb->handle_position == GTK_POS_LEFT ||
hb->handle_position == GTK_POS_RIGHT)
- requisition->height += widget->style->klass->ythickness;
+ requisition->height += widget->style->ythickness;
else
- requisition->width += widget->style->klass->xthickness;
+ requisition->width += widget->style->xthickness;
}
}
else
diff --git a/gtk/gtkhruler.c b/gtk/gtkhruler.c
index 701aeb213..8ddc5399b 100644
--- a/gtk/gtkhruler.c
+++ b/gtk/gtkhruler.c
@@ -92,8 +92,8 @@ gtk_hruler_init (GtkHRuler *hruler)
GtkWidget *widget;
widget = GTK_WIDGET (hruler);
- widget->requisition.width = widget->style->klass->xthickness * 2 + 1;
- widget->requisition.height = widget->style->klass->ythickness * 2 + RULER_HEIGHT;
+ widget->requisition.width = widget->style->xthickness * 2 + 1;
+ widget->requisition.height = widget->style->ythickness * 2 + RULER_HEIGHT;
}
@@ -166,8 +166,8 @@ gtk_hruler_draw_ticks (GtkRuler *ruler)
bg_gc = widget->style->bg_gc[GTK_STATE_NORMAL];
font = widget->style->font;
- xthickness = widget->style->klass->xthickness;
- ythickness = widget->style->klass->ythickness;
+ xthickness = widget->style->xthickness;
+ ythickness = widget->style->ythickness;
digit_height = ink_rect.height / PANGO_SCALE + 2;
digit_offset = ink_rect.y;
@@ -269,7 +269,7 @@ gtk_hruler_draw_ticks (GtkRuler *ruler)
}
}
- pango_layout_unref (layout);
+ g_object_unref (G_OBJECT (layout));
}
static void
@@ -293,8 +293,8 @@ gtk_hruler_draw_pos (GtkRuler *ruler)
widget = GTK_WIDGET (ruler);
gc = widget->style->fg_gc[GTK_STATE_NORMAL];
- xthickness = widget->style->klass->xthickness;
- ythickness = widget->style->klass->ythickness;
+ xthickness = widget->style->xthickness;
+ ythickness = widget->style->ythickness;
width = widget->allocation.width;
height = widget->allocation.height - ythickness * 2;
diff --git a/gtk/gtkhscale.c b/gtk/gtkhscale.c
index 30044b8bb..b1e0f8c8f 100644
--- a/gtk/gtkhscale.c
+++ b/gtk/gtkhscale.c
@@ -321,10 +321,10 @@ gtk_hscale_size_request (GtkWidget *widget,
scale = GTK_SCALE (widget);
requisition->width = (SCALE_CLASS (scale)->slider_length +
- widget->style->klass->xthickness) * 2;
+ widget->style->xthickness) * 2;
requisition->height = (RANGE_CLASS (scale)->slider_width +
- widget->style->klass->ythickness * 2);
-
+ widget->style->ythickness * 2);
+
if (scale->draw_value)
{
gint value_width, value_height;
@@ -393,7 +393,7 @@ gtk_hscale_pos_trough (GtkHScale *hscale,
*w = widget->allocation.width;
*h = (RANGE_CLASS (scale)->slider_width +
- widget->style->klass->ythickness * 2);
+ widget->style->ythickness * 2);
if (scale->draw_value)
{
@@ -586,7 +586,7 @@ gtk_hscale_draw_value (GtkScale *scale)
GTK_WIDGET (scale)->style->fg_gc [state_type],
x, y, layout);
- pango_layout_unref (layout);
+ g_object_unref (G_OBJECT (layout));
}
}
diff --git a/gtk/gtkhscrollbar.c b/gtk/gtkhscrollbar.c
index 95eb6eca3..73099b558 100644
--- a/gtk/gtkhscrollbar.c
+++ b/gtk/gtkhscrollbar.c
@@ -165,9 +165,9 @@ gtk_hscrollbar_init (GtkHScrollbar *hscrollbar)
requisition->width = (RANGE_CLASS (widget)->min_slider_size +
RANGE_CLASS (widget)->stepper_size +
RANGE_CLASS (widget)->stepper_slider_spacing +
- widget->style->klass->xthickness) * 2;
+ widget->style->xthickness) * 2;
requisition->height = (RANGE_CLASS (widget)->slider_width +
- widget->style->klass->ythickness * 2);
+ widget->style->ythickness * 2);
}
GtkWidget*
@@ -217,21 +217,21 @@ gtk_hscrollbar_realize (GtkWidget *widget)
range->trough = widget->window;
gdk_window_ref (range->trough);
- attributes.x = widget->style->klass->xthickness;
- attributes.y = widget->style->klass->ythickness;
+ attributes.x = widget->style->xthickness;
+ attributes.y = widget->style->ythickness;
attributes.width = RANGE_CLASS (widget)->stepper_size;
attributes.height = RANGE_CLASS (widget)->stepper_size;
range->step_back = gdk_window_new (range->trough, &attributes, attributes_mask);
attributes.x = (widget->allocation.width -
- widget->style->klass->xthickness -
+ widget->style->xthickness -
RANGE_CLASS (widget)->stepper_size);
range->step_forw = gdk_window_new (range->trough, &attributes, attributes_mask);
attributes.x = 0;
- attributes.y = widget->style->klass->ythickness;
+ attributes.y = widget->style->ythickness;
attributes.width = RANGE_CLASS (widget)->min_slider_size;
attributes.height = RANGE_CLASS (widget)->slider_width;
attributes.event_mask |= (GDK_BUTTON_MOTION_MASK |
@@ -279,16 +279,16 @@ gtk_hscrollbar_size_allocate (GtkWidget *widget,
allocation->y + (allocation->height - widget->requisition.height) / 2,
allocation->width, widget->requisition.height);
gdk_window_move_resize (range->step_back,
- widget->style->klass->xthickness,
- widget->style->klass->ythickness,
+ widget->style->xthickness,
+ widget->style->ythickness,
RANGE_CLASS (widget)->stepper_size,
- widget->requisition.height - widget->style->klass->ythickness * 2);
+ widget->requisition.height - widget->style->ythickness * 2);
gdk_window_move_resize (range->step_forw,
- allocation->width - widget->style->klass->xthickness -
+ allocation->width - widget->style->xthickness -
RANGE_CLASS (widget)->stepper_size,
- widget->style->klass->ythickness,
+ widget->style->ythickness,
RANGE_CLASS (widget)->stepper_size,
- widget->requisition.height - widget->style->klass->ythickness * 2);
+ widget->requisition.height - widget->style->ythickness * 2);
gtk_range_slider_update (GTK_RANGE (widget));
}
diff --git a/gtk/gtkhseparator.c b/gtk/gtkhseparator.c
index 7d2845793..7fc9bafd6 100644
--- a/gtk/gtkhseparator.c
+++ b/gtk/gtkhseparator.c
@@ -72,7 +72,7 @@ static void
gtk_hseparator_init (GtkHSeparator *hseparator)
{
GTK_WIDGET (hseparator)->requisition.width = 1;
- GTK_WIDGET (hseparator)->requisition.height = GTK_WIDGET (hseparator)->style->klass->ythickness;
+ GTK_WIDGET (hseparator)->requisition.height = GTK_WIDGET (hseparator)->style->ythickness;
}
GtkWidget*
@@ -96,7 +96,7 @@ gtk_hseparator_expose (GtkWidget *widget,
widget->allocation.x,
widget->allocation.x + widget->allocation.width,
widget->allocation.y + (widget->allocation.height -
- widget->style->klass->ythickness) / 2);
+ widget->style->ythickness) / 2);
return FALSE;
}
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 823dcb497..47b968063 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -265,7 +265,7 @@ gtk_label_set_justify (GtkLabel *label,
if (label->layout)
{
/* No real need to be this drastic, but easier than duplicating the code */
- pango_layout_unref (label->layout);
+ g_object_unref (G_OBJECT (label->layout));
label->layout = NULL;
}
@@ -313,7 +313,7 @@ gtk_label_finalize (GObject *object)
g_free (label->pattern);
if (label->layout)
- pango_layout_unref (label->layout);
+ g_object_unref (G_OBJECT (label->layout));
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -401,7 +401,7 @@ gtk_label_size_request (GtkWidget *widget,
label->layout)
{
label->rtl = !label->rtl;
- pango_layout_unref (label->layout);
+ g_object_unref (G_OBJECT (label->layout));
label->layout = NULL;
}
@@ -546,7 +546,7 @@ gtk_label_style_set (GtkWidget *widget,
if (previous_style && label->layout)
{
- pango_layout_unref (label->layout);
+ g_object_unref (G_OBJECT (label->layout));
label->layout = NULL;
}
}
diff --git a/gtk/gtklistitem.c b/gtk/gtklistitem.c
index 8482cde21..b06aa32aa 100644
--- a/gtk/gtklistitem.c
+++ b/gtk/gtklistitem.c
@@ -403,7 +403,7 @@ gtk_list_item_size_request (GtkWidget *widget,
bin = GTK_BIN (widget);
requisition->width = (GTK_CONTAINER (widget)->border_width +
- widget->style->klass->xthickness) * 2;
+ widget->style->xthickness) * 2;
requisition->height = GTK_CONTAINER (widget)->border_width * 2;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
@@ -437,7 +437,7 @@ gtk_list_item_size_allocate (GtkWidget *widget,
if (bin->child)
{
child_allocation.x = (GTK_CONTAINER (widget)->border_width +
- widget->style->klass->xthickness);
+ widget->style->xthickness);
child_allocation.y = GTK_CONTAINER (widget)->border_width;
child_allocation.width = allocation->width - child_allocation.x * 2;
child_allocation.height = allocation->height - child_allocation.y * 2;
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 7de4f13f3..336278521 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -862,9 +862,9 @@ gtk_menu_size_request (GtkWidget *widget,
requisition->width += max_toggle_size + max_accel_width;
requisition->width += (GTK_CONTAINER (menu)->border_width +
- widget->style->klass->xthickness) * 2;
+ widget->style->xthickness) * 2;
requisition->height += (GTK_CONTAINER (menu)->border_width +
- widget->style->klass->ythickness) * 2;
+ widget->style->ythickness) * 2;
children = menu_shell->children;
while (children)
@@ -903,9 +903,9 @@ gtk_menu_size_allocate (GtkWidget *widget,
if (menu_shell->children)
{
child_allocation.x = (GTK_CONTAINER (menu)->border_width +
- widget->style->klass->xthickness);
+ widget->style->xthickness);
child_allocation.y = (GTK_CONTAINER (menu)->border_width +
- widget->style->klass->ythickness);
+ widget->style->ythickness);
child_allocation.width = MAX (1, (gint)allocation->width - child_allocation.x * 2);
children = menu_shell->children;
diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c
index ecaeb3a03..78a1e9153 100644
--- a/gtk/gtkmenubar.c
+++ b/gtk/gtkmenubar.c
@@ -257,10 +257,10 @@ gtk_menu_bar_size_request (GtkWidget *widget,
}
requisition->width += (GTK_CONTAINER (menu_bar)->border_width +
- widget->style->klass->xthickness +
+ widget->style->xthickness +
BORDER_SPACING) * 2;
requisition->height += (GTK_CONTAINER (menu_bar)->border_width +
- widget->style->klass->ythickness +
+ widget->style->ythickness +
BORDER_SPACING) * 2;
if (nchildren > 0)
@@ -296,12 +296,12 @@ gtk_menu_bar_size_allocate (GtkWidget *widget,
if (menu_shell->children)
{
child_allocation.x = (GTK_CONTAINER (menu_bar)->border_width +
- widget->style->klass->xthickness +
+ widget->style->xthickness +
BORDER_SPACING);
offset = child_allocation.x; /* Window edge to menubar start */
child_allocation.y = (GTK_CONTAINER (menu_bar)->border_width +
- widget->style->klass->ythickness +
+ widget->style->ythickness +
BORDER_SPACING);
child_allocation.height = MAX (1, (gint)allocation->height - child_allocation.y * 2);
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index c8e0cfd2f..9459a8d1a 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -348,10 +348,10 @@ gtk_menu_item_size_request (GtkWidget *widget,
menu_item = GTK_MENU_ITEM (widget);
requisition->width = (GTK_CONTAINER (widget)->border_width +
- widget->style->klass->xthickness +
+ widget->style->xthickness +
BORDER_SPACING) * 2;
requisition->height = (GTK_CONTAINER (widget)->border_width +
- widget->style->klass->ythickness) * 2;
+ widget->style->ythickness) * 2;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
@@ -393,10 +393,10 @@ gtk_menu_item_size_allocate (GtkWidget *widget,
if (bin->child)
{
child_allocation.x = (GTK_CONTAINER (widget)->border_width +
- widget->style->klass->xthickness +
+ widget->style->xthickness +
BORDER_SPACING);
child_allocation.y = (GTK_CONTAINER (widget)->border_width +
- widget->style->klass->ythickness);
+ widget->style->ythickness);
child_allocation.width = MAX (1, (gint)allocation->width - child_allocation.x * 2);
child_allocation.height = MAX (1, (gint)allocation->height - child_allocation.y * 2);
child_allocation.x += GTK_MENU_ITEM (widget)->toggle_size;
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index be49dc6ea..54819e060 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -647,8 +647,8 @@ gtk_notebook_size_request (GtkWidget *widget,
if (notebook->show_border || notebook->show_tabs)
{
- widget->requisition.width += widget->style->klass->xthickness * 2;
- widget->requisition.height += widget->style->klass->ythickness * 2;
+ widget->requisition.width += widget->style->xthickness * 2;
+ widget->requisition.height += widget->style->ythickness * 2;
if (notebook->show_tabs)
{
@@ -672,10 +672,10 @@ gtk_notebook_size_request (GtkWidget *widget,
page->requisition.width =
child_requisition.width +
- 2 * widget->style->klass->xthickness;
+ 2 * widget->style->xthickness;
page->requisition.height =
child_requisition.height +
- 2 * widget->style->klass->ythickness;
+ 2 * widget->style->ythickness;
switch (notebook->tab_pos)
{
@@ -880,12 +880,12 @@ gtk_notebook_size_allocate (GtkWidget *widget,
if (notebook->show_tabs || notebook->show_border)
{
- child_allocation.x += widget->style->klass->xthickness;
- child_allocation.y += widget->style->klass->ythickness;
+ child_allocation.x += widget->style->xthickness;
+ child_allocation.y += widget->style->ythickness;
child_allocation.width = MAX (1, (gint)child_allocation.width -
- (gint) widget->style->klass->xthickness * 2);
+ (gint) widget->style->xthickness * 2);
child_allocation.height = MAX (1, (gint)child_allocation.height -
- (gint) widget->style->klass->ythickness * 2);
+ (gint) widget->style->ythickness * 2);
if (notebook->show_tabs && notebook->children && notebook->cur_page)
{
@@ -1881,28 +1881,28 @@ gtk_notebook_expose_tabs (GtkNotebook *notebook)
case GTK_POS_BOTTOM:
event.area.y = (widget->allocation.height - border -
page->allocation.height -
- widget->style->klass->ythickness);
+ widget->style->ythickness);
if (page != notebook->cur_page)
- event.area.y -= widget->style->klass->ythickness;
+ event.area.y -= widget->style->ythickness;
case GTK_POS_TOP:
event.area.width = widget->allocation.width - 2 * border;
event.area.height = (page->allocation.height +
- widget->style->klass->ythickness);
+ widget->style->ythickness);
if (page != notebook->cur_page)
- event.area.height += widget->style->klass->ythickness;
+ event.area.height += widget->style->ythickness;
break;
case GTK_POS_RIGHT:
event.area.x = (widget->allocation.width - border -
page->allocation.width -
- widget->style->klass->xthickness);
+ widget->style->xthickness);
if (page != notebook->cur_page)
- event.area.x -= widget->style->klass->xthickness;
+ event.area.x -= widget->style->xthickness;
case GTK_POS_LEFT:
event.area.width = (page->allocation.width +
- widget->style->klass->xthickness);
+ widget->style->xthickness);
event.area.height = widget->allocation.height - 2 * border;
if (page != notebook->cur_page)
- event.area.width += widget->style->klass->xthickness;
+ event.area.width += widget->style->xthickness;
break;
}
gtk_widget_event (widget, (GdkEvent *) &event);
@@ -2238,14 +2238,14 @@ gtk_notebook_paint (GtkWidget *widget,
switch (notebook->tab_pos)
{
case GTK_POS_TOP:
- y += page->allocation.height + widget->style->klass->ythickness;
+ y += page->allocation.height + widget->style->ythickness;
case GTK_POS_BOTTOM:
- height -= page->allocation.height + widget->style->klass->ythickness;
+ height -= page->allocation.height + widget->style->ythickness;
break;
case GTK_POS_LEFT:
- x += page->allocation.width + widget->style->klass->xthickness;
+ x += page->allocation.width + widget->style->xthickness;
case GTK_POS_RIGHT:
- width -= page->allocation.width + widget->style->klass->xthickness;
+ width -= page->allocation.width + widget->style->xthickness;
break;
}
gtk_paint_box (widget->style, widget->window,
@@ -2511,17 +2511,17 @@ gtk_notebook_set_shape (GtkNotebook *notebook)
{
case GTK_POS_TOP:
y += page->allocation.height +
- widget->style->klass->ythickness;
+ widget->style->ythickness;
case GTK_POS_BOTTOM:
height -= page->allocation.height +
- widget->style->klass->ythickness;
+ widget->style->ythickness;
break;
case GTK_POS_LEFT:
x += page->allocation.width +
- widget->style->klass->xthickness;
+ widget->style->xthickness;
case GTK_POS_RIGHT:
width -= page->allocation.width +
- widget->style->klass->xthickness;
+ widget->style->xthickness;
break;
}
}
@@ -2536,11 +2536,11 @@ gtk_notebook_set_shape (GtkNotebook *notebook)
{
if (notebook->tab_pos == GTK_POS_LEFT)
{
- x -= widget->style->klass->xthickness * 2;
- width += widget->style->klass->xthickness * 2;
+ x -= widget->style->xthickness * 2;
+ width += widget->style->xthickness * 2;
}
else if (notebook->tab_pos == GTK_POS_RIGHT)
- width += widget->style->klass->xthickness * 2;
+ width += widget->style->xthickness * 2;
}
switch (notebook->tab_pos)
{
@@ -3061,8 +3061,8 @@ gtk_notebook_page_allocate (GtkNotebook *notebook,
widget = GTK_WIDGET (notebook);
- xthickness = widget->style->klass->xthickness;
- ythickness = widget->style->klass->ythickness;
+ xthickness = widget->style->xthickness;
+ ythickness = widget->style->ythickness;
/* If the size of the notebook tabs change, we need to queue
* a redraw on the tab area
diff --git a/gtk/gtkoptionmenu.c b/gtk/gtkoptionmenu.c
index f5cff3bf4..7bb65919a 100644
--- a/gtk/gtkoptionmenu.c
+++ b/gtk/gtkoptionmenu.c
@@ -296,13 +296,13 @@ gtk_option_menu_size_request (GtkWidget *widget,
option_menu = GTK_OPTION_MENU (widget);
requisition->width = ((GTK_CONTAINER (widget)->border_width +
- GTK_WIDGET (widget)->style->klass->xthickness) * 2 +
+ GTK_WIDGET (widget)->style->xthickness) * 2 +
option_menu->width +
OPTION_INDICATOR_WIDTH +
OPTION_INDICATOR_SPACING * 5 +
CHILD_LEFT_SPACING + CHILD_RIGHT_SPACING + 2);
requisition->height = ((GTK_CONTAINER (widget)->border_width +
- GTK_WIDGET (widget)->style->klass->ythickness) * 2 +
+ GTK_WIDGET (widget)->style->ythickness) * 2 +
option_menu->height +
CHILD_TOP_SPACING + CHILD_BOTTOM_SPACING + 2);
@@ -332,9 +332,9 @@ gtk_option_menu_size_allocate (GtkWidget *widget,
if (child && GTK_WIDGET_VISIBLE (child))
{
child_allocation.x = (GTK_CONTAINER (widget)->border_width +
- GTK_WIDGET (widget)->style->klass->xthickness) + 1;
+ GTK_WIDGET (widget)->style->xthickness) + 1;
child_allocation.y = (GTK_CONTAINER (widget)->border_width +
- GTK_WIDGET (widget)->style->klass->ythickness) + 1;
+ GTK_WIDGET (widget)->style->ythickness) + 1;
child_allocation.width = MAX (1, (gint)allocation->width - child_allocation.x * 2 -
OPTION_INDICATOR_WIDTH - OPTION_INDICATOR_SPACING * 5 -
CHILD_LEFT_SPACING - CHILD_RIGHT_SPACING - 2);
diff --git a/gtk/gtkplug.c b/gtk/gtkplug.c
index ae6397e51..000cf6b94 100644
--- a/gtk/gtkplug.c
+++ b/gtk/gtkplug.c
@@ -212,7 +212,7 @@ gtk_plug_realize (GtkWidget *widget)
widget->window = gdk_window_new (NULL, &attributes, attributes_mask);
}
- GDK_DRAWABLE_TYPE (window) = GDK_WINDOW_TOPLEVEL;
+ GDK_WINDOW_TYPE (window) = GDK_WINDOW_TOPLEVEL;
gdk_window_set_user_data (widget->window, window);
widget->style = gtk_style_attach (widget->style, widget->window);
diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c
index 5fc297137..a6cdade7d 100644
--- a/gtk/gtkprogressbar.c
+++ b/gtk/gtkprogressbar.c
@@ -279,19 +279,19 @@ gtk_progress_bar_real_update (GtkProgress *progress)
pbar->activity_pos += pbar->activity_step;
if (pbar->activity_pos + size >=
widget->allocation.width -
- widget->style->klass->xthickness)
+ widget->style->xthickness)
{
pbar->activity_pos = widget->allocation.width -
- widget->style->klass->xthickness - size;
+ widget->style->xthickness - size;
pbar->activity_dir = 1;
}
}
else
{
pbar->activity_pos -= pbar->activity_step;
- if (pbar->activity_pos <= widget->style->klass->xthickness)
+ if (pbar->activity_pos <= widget->style->xthickness)
{
- pbar->activity_pos = widget->style->klass->xthickness;
+ pbar->activity_pos = widget->style->xthickness;
pbar->activity_dir = 0;
}
}
@@ -305,19 +305,19 @@ gtk_progress_bar_real_update (GtkProgress *progress)
pbar->activity_pos += pbar->activity_step;
if (pbar->activity_pos + size >=
widget->allocation.height -
- widget->style->klass->ythickness)
+ widget->style->ythickness)
{
pbar->activity_pos = widget->allocation.height -
- widget->style->klass->ythickness - size;
+ widget->style->ythickness - size;
pbar->activity_dir = 1;
}
}
else
{
pbar->activity_pos -= pbar->activity_step;
- if (pbar->activity_pos <= widget->style->klass->ythickness)
+ if (pbar->activity_pos <= widget->style->ythickness)
{
- pbar->activity_pos = widget->style->klass->ythickness;
+ pbar->activity_pos = widget->style->ythickness;
pbar->activity_dir = 0;
}
}
@@ -367,7 +367,7 @@ gtk_progress_bar_size_request (GtkWidget *widget,
pango_layout_set_text (layout, buf, -1);
pango_layout_get_extents (layout, NULL, &logical_rect);
- pango_layout_unref (layout);
+ g_object_unref (G_OBJECT (layout));
g_free (buf);
}
@@ -377,11 +377,11 @@ gtk_progress_bar_size_request (GtkWidget *widget,
if (progress->show_text && pbar->bar_style != GTK_PROGRESS_DISCRETE)
{
requisition->width = MAX (MIN_HORIZONTAL_BAR_WIDTH,
- 2 * widget->style->klass->xthickness + 3 +
+ 2 * widget->style->xthickness + 3 +
logical_rect.width / PANGO_SCALE + 2 * TEXT_SPACING);
requisition->height = MAX (MIN_HORIZONTAL_BAR_HEIGHT,
- 2 * widget->style->klass->ythickness + 3 +
+ 2 * widget->style->ythickness + 3 +
logical_rect.height / PANGO_SCALE + 2 * TEXT_SPACING);
}
else
@@ -395,11 +395,11 @@ gtk_progress_bar_size_request (GtkWidget *widget,
if (progress->show_text && pbar->bar_style != GTK_PROGRESS_DISCRETE)
{
requisition->width = MAX (MIN_VERTICAL_BAR_WIDTH,
- 2 * widget->style->klass->xthickness + 3 +
+ 2 * widget->style->xthickness + 3 +
logical_rect.width / PANGO_SCALE + 2 * TEXT_SPACING);
requisition->height = MAX (MIN_VERTICAL_BAR_HEIGHT,
- 2 * widget->style->klass->ythickness + 3 +
+ 2 * widget->style->ythickness + 3 +
logical_rect.height / PANGO_SCALE + 2 * TEXT_SPACING);
}
else
@@ -429,14 +429,14 @@ gtk_progress_bar_act_mode_enter (GtkProgress *progress)
if (pbar->orientation == GTK_PROGRESS_LEFT_TO_RIGHT)
{
- pbar->activity_pos = widget->style->klass->xthickness;
+ pbar->activity_pos = widget->style->xthickness;
pbar->activity_dir = 0;
}
else
{
pbar->activity_pos = widget->allocation.width -
- widget->style->klass->xthickness - (widget->allocation.height -
- widget->style->klass->ythickness * 2);
+ widget->style->xthickness - (widget->allocation.height -
+ widget->style->ythickness * 2);
pbar->activity_dir = 1;
}
}
@@ -446,14 +446,14 @@ gtk_progress_bar_act_mode_enter (GtkProgress *progress)
if (pbar->orientation == GTK_PROGRESS_TOP_TO_BOTTOM)
{
- pbar->activity_pos = widget->style->klass->ythickness;
+ pbar->activity_pos = widget->style->ythickness;
pbar->activity_dir = 0;
}
else
{
pbar->activity_pos = widget->allocation.height -
- widget->style->klass->ythickness - (widget->allocation.width -
- widget->style->klass->xthickness * 2);
+ widget->style->ythickness - (widget->allocation.width -
+ widget->style->xthickness * 2);
pbar->activity_dir = 1;
}
}
@@ -482,10 +482,10 @@ gtk_progress_bar_paint (GtkProgress *progress)
if (pbar->orientation == GTK_PROGRESS_LEFT_TO_RIGHT ||
pbar->orientation == GTK_PROGRESS_RIGHT_TO_LEFT)
space = widget->allocation.width -
- 2 * widget->style->klass->xthickness;
+ 2 * widget->style->xthickness;
else
space = widget->allocation.height -
- 2 * widget->style->klass->ythickness;
+ 2 * widget->style->ythickness;
percentage = gtk_progress_get_current_percentage (progress);
@@ -511,9 +511,9 @@ gtk_progress_bar_paint (GtkProgress *progress)
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
NULL, widget, "bar",
pbar->activity_pos,
- widget->style->klass->ythickness,
+ widget->style->ythickness,
size,
- widget->allocation.height - widget->style->klass->ythickness * 2);
+ widget->allocation.height - widget->style->ythickness * 2);
return;
}
else
@@ -524,9 +524,9 @@ gtk_progress_bar_paint (GtkProgress *progress)
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
NULL, widget, "bar",
- widget->style->klass->xthickness,
+ widget->style->xthickness,
pbar->activity_pos,
- widget->allocation.width - widget->style->klass->xthickness * 2,
+ widget->allocation.width - widget->style->xthickness * 2,
size);
return;
}
@@ -547,14 +547,14 @@ gtk_progress_bar_paint (GtkProgress *progress)
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
NULL, widget, "bar",
- widget->style->klass->xthickness,
- widget->style->klass->ythickness,
+ widget->style->xthickness,
+ widget->style->ythickness,
amount,
- widget->allocation.height - widget->style->klass->ythickness * 2);
+ widget->allocation.height - widget->style->ythickness * 2);
}
else
{
- x = widget->style->klass->xthickness;
+ x = widget->style->xthickness;
for (i = 0; i <= pbar->in_block; i++)
{
@@ -566,9 +566,9 @@ gtk_progress_bar_paint (GtkProgress *progress)
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
NULL, widget, "bar",
x,
- widget->style->klass->ythickness,
+ widget->style->ythickness,
block_delta,
- widget->allocation.height - widget->style->klass->ythickness * 2);
+ widget->allocation.height - widget->style->ythickness * 2);
x += block_delta;
}
@@ -584,16 +584,16 @@ gtk_progress_bar_paint (GtkProgress *progress)
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
NULL, widget, "bar",
widget->allocation.width -
- widget->style->klass->xthickness - amount,
- widget->style->klass->ythickness,
+ widget->style->xthickness - amount,
+ widget->style->ythickness,
amount,
widget->allocation.height -
- widget->style->klass->ythickness * 2);
+ widget->style->ythickness * 2);
}
else
{
x = widget->allocation.width -
- widget->style->klass->xthickness;
+ widget->style->xthickness;
for (i = 0; i <= pbar->in_block; i++)
{
@@ -607,10 +607,10 @@ gtk_progress_bar_paint (GtkProgress *progress)
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
NULL, widget, "bar",
x,
- widget->style->klass->ythickness,
+ widget->style->ythickness,
block_delta,
widget->allocation.height -
- widget->style->klass->ythickness * 2);
+ widget->style->ythickness * 2);
}
}
break;
@@ -623,17 +623,17 @@ gtk_progress_bar_paint (GtkProgress *progress)
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
NULL, widget, "bar",
- widget->style->klass->xthickness,
+ widget->style->xthickness,
widget->allocation.height -
- widget->style->klass->ythickness - amount,
+ widget->style->ythickness - amount,
widget->allocation.width -
- widget->style->klass->xthickness * 2,
+ widget->style->xthickness * 2,
amount);
}
else
{
y = widget->allocation.height -
- widget->style->klass->ythickness;
+ widget->style->ythickness;
for (i = 0; i <= pbar->in_block; i++)
{
@@ -646,10 +646,10 @@ gtk_progress_bar_paint (GtkProgress *progress)
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
NULL, widget, "bar",
- widget->style->klass->xthickness,
+ widget->style->xthickness,
y,
widget->allocation.width -
- widget->style->klass->xthickness * 2,
+ widget->style->xthickness * 2,
block_delta);
}
}
@@ -663,15 +663,15 @@ gtk_progress_bar_paint (GtkProgress *progress)
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
NULL, widget, "bar",
- widget->style->klass->xthickness,
- widget->style->klass->ythickness,
+ widget->style->xthickness,
+ widget->style->ythickness,
widget->allocation.width -
- widget->style->klass->xthickness * 2,
+ widget->style->xthickness * 2,
amount);
}
else
{
- y = widget->style->klass->ythickness;
+ y = widget->style->ythickness;
for (i = 0; i <= pbar->in_block; i++)
{
@@ -683,10 +683,10 @@ gtk_progress_bar_paint (GtkProgress *progress)
progress->offscreen_pixmap,
GTK_STATE_PRELIGHT, GTK_SHADOW_OUT,
NULL, widget, "bar",
- widget->style->klass->xthickness,
+ widget->style->xthickness,
y,
widget->allocation.width -
- widget->style->klass->xthickness * 2,
+ widget->style->xthickness * 2,
block_delta);
y += block_delta;
@@ -714,22 +714,22 @@ gtk_progress_bar_paint (GtkProgress *progress)
pango_layout_set_text (layout, buf, -1);
pango_layout_get_extents (layout, NULL, &logical_rect);
- x = widget->style->klass->xthickness + 1 +
- (widget->allocation.width - 2 * widget->style->klass->xthickness -
+ x = widget->style->xthickness + 1 +
+ (widget->allocation.width - 2 * widget->style->xthickness -
3 - logical_rect.width / PANGO_SCALE)
* progress->x_align;
- y = widget->style->klass->ythickness + 1 +
- (widget->allocation.height - 2 * widget->style->klass->ythickness -
+ y = widget->style->ythickness + 1 +
+ (widget->allocation.height - 2 * widget->style->ythickness -
3 - logical_rect.height / PANGO_SCALE)
* progress->y_align;
- rect.x = widget->style->klass->xthickness + 1;
- rect.y = widget->style->klass->ythickness + 1;
+ rect.x = widget->style->xthickness + 1;
+ rect.y = widget->style->ythickness + 1;
rect.width = widget->allocation.width -
- 2 * widget->style->klass->xthickness - 3;
+ 2 * widget->style->xthickness - 3;
rect.height = widget->allocation.height -
- 2 * widget->style->klass->ythickness - 3;
+ 2 * widget->style->ythickness - 3;
gdk_gc_set_clip_rectangle (widget->style->fg_gc[widget->state],
&rect);
@@ -740,7 +740,7 @@ gtk_progress_bar_paint (GtkProgress *progress)
gdk_gc_set_clip_rectangle (widget->style->fg_gc[widget->state],
NULL);
- pango_layout_unref (layout);
+ g_object_unref (G_OBJECT (layout));
g_free (buf);
}
}
diff --git a/gtk/gtkradiomenuitem.c b/gtk/gtkradiomenuitem.c
index 4d61ead40..ed49696ab 100644
--- a/gtk/gtkradiomenuitem.c
+++ b/gtk/gtkradiomenuitem.c
@@ -284,7 +284,7 @@ gtk_radio_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
width = 8;
height = 8;
x = (GTK_CONTAINER (check_menu_item)->border_width +
- widget->style->klass->xthickness + 2);
+ widget->style->xthickness + 2);
y = (widget->allocation.height - height) / 2;
if (check_menu_item->active ||
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index 42a59fe16..bd3521634 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -427,7 +427,7 @@ gtk_range_default_hslider_update (GtkRange *range)
else if (x > right)
x = right;
- gdk_window_move (range->slider, x, GTK_WIDGET (range)->style->klass->ythickness);
+ gdk_window_move (range->slider, x, GTK_WIDGET (range)->style->ythickness);
}
}
@@ -466,7 +466,7 @@ gtk_range_default_vslider_update (GtkRange *range)
else if (y > bottom)
y = bottom;
- gdk_window_move (range->slider, GTK_WIDGET (range)->style->klass->xthickness, y);
+ gdk_window_move (range->slider, GTK_WIDGET (range)->style->xthickness, y);
}
}
@@ -486,7 +486,7 @@ gtk_range_default_htrough_click (GtkRange *range,
g_return_val_if_fail (range != NULL, GTK_TROUGH_NONE);
g_return_val_if_fail (GTK_IS_RANGE (range), GTK_TROUGH_NONE);
- ythickness = GTK_WIDGET (range)->style->klass->ythickness;
+ ythickness = GTK_WIDGET (range)->style->ythickness;
gtk_range_trough_hdims (range, &left, &right);
gdk_window_get_size (range->slider, &slider_length, NULL);
@@ -532,7 +532,7 @@ gtk_range_default_vtrough_click (GtkRange *range,
g_return_val_if_fail (range != NULL, GTK_TROUGH_NONE);
g_return_val_if_fail (GTK_IS_RANGE (range), GTK_TROUGH_NONE);
- xthickness = GTK_WIDGET (range)->style->klass->xthickness;
+ xthickness = GTK_WIDGET (range)->style->xthickness;
gtk_range_trough_vdims (range, &top, &bottom);
gdk_window_get_size (range->slider, NULL, &slider_length);
@@ -1486,8 +1486,8 @@ gtk_range_trough_hdims (GtkRange *range,
gdk_window_get_size (range->trough, &trough_width, NULL);
gdk_window_get_size (range->slider, &slider_length, NULL);
- tleft = GTK_WIDGET (range)->style->klass->xthickness;
- tright = trough_width - slider_length - GTK_WIDGET (range)->style->klass->xthickness;
+ tleft = GTK_WIDGET (range)->style->xthickness;
+ tright = trough_width - slider_length - GTK_WIDGET (range)->style->xthickness;
if (range->step_back)
{
@@ -1523,8 +1523,8 @@ gtk_range_trough_vdims (GtkRange *range,
gdk_window_get_size (range->trough, NULL, &trough_height);
gdk_window_get_size (range->slider, NULL, &slider_length);
- ttop = GTK_WIDGET (range)->style->klass->ythickness;
- tbottom = trough_height - slider_length - GTK_WIDGET (range)->style->klass->ythickness;
+ ttop = GTK_WIDGET (range)->style->ythickness;
+ tbottom = trough_height - slider_length - GTK_WIDGET (range)->style->ythickness;
if (range->step_back)
{
diff --git a/gtk/gtkrc.c b/gtk/gtkrc.c
index 84b7b1d67..f8b8e3870 100644
--- a/gtk/gtkrc.c
+++ b/gtk/gtkrc.c
@@ -64,7 +64,6 @@
typedef struct _GtkRcSet GtkRcSet;
typedef struct _GtkRcNode GtkRcNode;
typedef struct _GtkRcFile GtkRcFile;
-typedef struct _GtkRcStylePrivate GtkRcStylePrivate;
struct _GtkRcSet
{
@@ -80,68 +79,63 @@ struct _GtkRcFile
gboolean reload;
};
-struct _GtkRcStylePrivate
-{
- GtkRcStyle style;
-
- guint ref_count;
- /* list of RC style lists including this RC style */
- GSList *rc_style_lists;
-};
-
-static guint gtk_rc_style_hash (const char *name);
-static gint gtk_rc_style_compare (const char *a,
- const char *b);
-static guint gtk_rc_styles_hash (const GSList *rc_styles);
-static gint gtk_rc_styles_compare (const GSList *a,
- const GSList *b);
-static GtkRcStyle* gtk_rc_style_find (const char *name);
-static GSList * gtk_rc_styles_match (GSList *rc_styles,
- GSList *sets,
- guint path_length,
- gchar *path,
- gchar *path_reversed);
-static GtkStyle * gtk_rc_style_to_style (GtkRcStyle *rc_style);
-static GtkStyle* gtk_rc_style_init (GSList *rc_styles);
-static void gtk_rc_parse_file (const gchar *filename,
- gboolean reload);
-
-static void gtk_rc_parse_any (const gchar *input_name,
- gint input_fd,
- const gchar *input_string);
-static guint gtk_rc_parse_statement (GScanner *scanner);
-static guint gtk_rc_parse_style (GScanner *scanner);
-static guint gtk_rc_parse_base (GScanner *scanner,
- GtkRcStyle *style);
-static guint gtk_rc_parse_bg (GScanner *scanner,
- GtkRcStyle *style);
-static guint gtk_rc_parse_fg (GScanner *scanner,
- GtkRcStyle *style);
-static guint gtk_rc_parse_text (GScanner *scanner,
- GtkRcStyle *style);
-static guint gtk_rc_parse_bg_pixmap (GScanner *scanner,
- GtkRcStyle *rc_style);
-static guint gtk_rc_parse_font (GScanner *scanner,
- GtkRcStyle *rc_style);
-static guint gtk_rc_parse_fontset (GScanner *scanner,
- GtkRcStyle *rc_style);
-static guint gtk_rc_parse_font_name (GScanner *scanner,
- GtkRcStyle *rc_style);
-static guint gtk_rc_parse_engine (GScanner *scanner,
- GtkRcStyle *rc_style);
-static guint gtk_rc_parse_pixmap_path (GScanner *scanner);
-static void gtk_rc_parse_pixmap_path_string (gchar *pix_path);
-static guint gtk_rc_parse_module_path (GScanner *scanner);
-static void gtk_rc_parse_module_path_string (gchar *mod_path);
-static guint gtk_rc_parse_path_pattern (GScanner *scanner);
-static void gtk_rc_clear_hash_node (gpointer key,
- gpointer data,
- gpointer user_data);
+static guint gtk_rc_style_hash (const char *name);
+static gint gtk_rc_style_compare (const char *a,
+ const char *b);
+static guint gtk_rc_styles_hash (const GSList *rc_styles);
+static gint gtk_rc_styles_compare (const GSList *a,
+ const GSList *b);
+static GtkRcStyle* gtk_rc_style_find (const char *name);
+static GSList * gtk_rc_styles_match (GSList *rc_styles,
+ GSList *sets,
+ guint path_length,
+ gchar *path,
+ gchar *path_reversed);
+static GtkStyle * gtk_rc_style_to_style (GtkRcStyle *rc_style);
+static GtkStyle* gtk_rc_init_style (GSList *rc_styles);
+static void gtk_rc_parse_file (const gchar *filename,
+ gboolean reload);
+static void gtk_rc_parse_any (const gchar *input_name,
+ gint input_fd,
+ const gchar *input_string);
+static guint gtk_rc_parse_statement (GScanner *scanner);
+static guint gtk_rc_parse_style (GScanner *scanner);
+static guint gtk_rc_parse_base (GScanner *scanner,
+ GtkRcStyle *style);
+static guint gtk_rc_parse_bg (GScanner *scanner,
+ GtkRcStyle *style);
+static guint gtk_rc_parse_fg (GScanner *scanner,
+ GtkRcStyle *style);
+static guint gtk_rc_parse_text (GScanner *scanner,
+ GtkRcStyle *style);
+static guint gtk_rc_parse_bg_pixmap (GScanner *scanner,
+ GtkRcStyle *rc_style);
+static guint gtk_rc_parse_font (GScanner *scanner,
+ GtkRcStyle *rc_style);
+static guint gtk_rc_parse_fontset (GScanner *scanner,
+ GtkRcStyle *rc_style);
+static guint gtk_rc_parse_font_name (GScanner *scanner,
+ GtkRcStyle *rc_style);
+static guint gtk_rc_parse_engine (GScanner *scanner,
+ GtkRcStyle *rc_style);
+static guint gtk_rc_parse_pixmap_path (GScanner *scanner);
+static void gtk_rc_parse_pixmap_path_string (gchar *pix_path);
+static guint gtk_rc_parse_module_path (GScanner *scanner);
+static void gtk_rc_parse_module_path_string (gchar *mod_path);
+static guint gtk_rc_parse_path_pattern (GScanner *scanner);
+static void gtk_rc_clear_hash_node (gpointer key,
+ gpointer data,
+ gpointer user_data);
static void gtk_rc_clear_styles (void);
static void gtk_rc_append_default_pixmap_path (void);
static void gtk_rc_append_default_module_path (void);
static void gtk_rc_add_initial_default_files (void);
+static void gtk_rc_style_init (GtkRcStyle *style);
+static void gtk_rc_style_class_init (GtkRcStyleClass *klass);
+static void gtk_rc_style_finalize (GObject *object);
+
+static gpointer parent_class = NULL;
static const GScannerConfig gtk_rc_scanner_config =
{
@@ -726,23 +720,48 @@ gtk_rc_parse (const gchar *filename)
/* Handling of RC styles */
-GtkRcStyle *
-gtk_rc_style_new (void)
+GType
+gtk_rc_style_get_type (void)
{
- GtkRcStylePrivate *new_style;
+ static GType object_type = 0;
- new_style = g_new0 (GtkRcStylePrivate, 1);
- new_style->ref_count = 1;
+ if (!object_type)
+ {
+ static const GTypeInfo object_info =
+ {
+ sizeof (GtkRcStyleClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) gtk_rc_style_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (GtkRcStyle),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) gtk_rc_style_init,
+ };
+
+ object_type = g_type_register_static (G_TYPE_OBJECT,
+ "GtkRcStyle",
+ &object_info);
+ }
+
+ return object_type;
+}
- return (GtkRcStyle *)new_style;
+static void
+gtk_rc_style_init (GtkRcStyle *style)
+{
+
}
-void
-gtk_rc_style_ref (GtkRcStyle *rc_style)
+static void
+gtk_rc_style_class_init (GtkRcStyleClass *klass)
{
- g_return_if_fail (rc_style != NULL);
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ parent_class = g_type_class_peek_parent (klass);
- ((GtkRcStylePrivate *)rc_style)->ref_count++;
+ object_class->finalize = gtk_rc_style_finalize;
}
/* Like g_slist_remove, but remove all copies of data */
@@ -783,72 +802,91 @@ gtk_rc_slist_remove_all (GSList *list,
return list;
}
-void
-gtk_rc_style_unref (GtkRcStyle *rc_style)
+static void
+gtk_rc_style_finalize (GObject *object)
{
- GtkRcStylePrivate *private = (GtkRcStylePrivate *)rc_style;
gint i;
+ GSList *tmp_list1, *tmp_list2;
+ GtkRcStyle *rc_style;
- g_return_if_fail (rc_style != NULL);
- g_return_if_fail (private->ref_count > 0);
-
- private->ref_count--;
-
- if (private->ref_count == 0)
+ rc_style = GTK_RC_STYLE (object);
+
+ if (rc_style->engine)
{
- GSList *tmp_list1, *tmp_list2;
-
- if (rc_style->engine)
- {
- rc_style->engine->destroy_rc_style (rc_style);
- gtk_theme_engine_unref (rc_style->engine);
- }
+ rc_style->engine->destroy_rc_style (rc_style);
+ gtk_theme_engine_unref (rc_style->engine);
+ }
- if (rc_style->name)
- g_free (rc_style->name);
- if (rc_style->font_desc)
- pango_font_description_free (rc_style->font_desc);
-
- for (i=0 ; i<5 ; i++)
- if (rc_style->bg_pixmap_name[i])
- g_free (rc_style->bg_pixmap_name[i]);
+ if (rc_style->name)
+ g_free (rc_style->name);
+ if (rc_style->font_desc)
+ pango_font_description_free (rc_style->font_desc);
- /* Now remove all references to this rc_style from
- * realized_style_ht
+ for (i=0 ; i<5 ; i++)
+ if (rc_style->bg_pixmap_name[i])
+ g_free (rc_style->bg_pixmap_name[i]);
+
+ /* Now remove all references to this rc_style from
+ * realized_style_ht
+ */
+ tmp_list1 = rc_style->rc_style_lists;
+ while (tmp_list1)
+ {
+ GSList *rc_styles = tmp_list1->data;
+ GtkStyle *style = g_hash_table_lookup (realized_style_ht, rc_styles);
+ gtk_style_unref (style);
+
+ /* Remove the list of styles from the other rc_styles
+ * in the list
*/
- tmp_list1 = private->rc_style_lists;
- while (tmp_list1)
- {
- GSList *rc_styles = tmp_list1->data;
- GtkStyle *style = g_hash_table_lookup (realized_style_ht, rc_styles);
- gtk_style_unref (style);
+ tmp_list2 = rc_styles;
+ while (tmp_list2)
+ {
+ GtkRcStyle *other_style = tmp_list2->data;
+
+ if (other_style != rc_style)
+ other_style->rc_style_lists =
+ gtk_rc_slist_remove_all (other_style->rc_style_lists, rc_styles);
+
+ tmp_list2 = tmp_list2->next;
+ }
- /* Remove the list of styles from the other rc_styles
- * in the list
- */
- tmp_list2 = rc_styles;
- while (tmp_list2)
- {
- GtkRcStylePrivate *other_style = tmp_list2->data;
+ /* And from the hash table itself
+ */
+ g_hash_table_remove (realized_style_ht, rc_styles);
+ g_slist_free (rc_styles);
- if (other_style != private)
- other_style->rc_style_lists =
- gtk_rc_slist_remove_all (other_style->rc_style_lists, rc_styles);
-
- tmp_list2 = tmp_list2->next;
- }
+ tmp_list1 = tmp_list1->next;
+ }
+ g_slist_free (rc_style->rc_style_lists);
- /* And from the hash table itself
- */
- g_hash_table_remove (realized_style_ht, rc_styles);
- g_slist_free (rc_styles);
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
- tmp_list1 = tmp_list1->next;
- }
- g_slist_free (private->rc_style_lists);
+GtkRcStyle *
+gtk_rc_style_new (void)
+{
+ GtkRcStyle *style;
+
+ style = GTK_RC_STYLE (g_type_create_instance (gtk_rc_style_get_type ()));
+
+ return style;
+}
- g_free (private);
- }
+void
+gtk_rc_style_ref (GtkRcStyle *rc_style)
+{
+ g_return_if_fail (GTK_IS_RC_STYLE (rc_style));
+
+ g_object_ref (G_OBJECT (rc_style));
+}
+
+void
+gtk_rc_style_unref (GtkRcStyle *rc_style)
+{
+ g_return_if_fail (GTK_IS_RC_STYLE (rc_style));
+
+ g_object_unref (G_OBJECT (rc_style));
}
static void
@@ -1032,7 +1070,7 @@ gtk_rc_get_style (GtkWidget *widget)
}
if (rc_styles)
- return gtk_rc_style_init (rc_styles);
+ return gtk_rc_init_style (rc_styles);
return NULL;
}
@@ -1288,7 +1326,7 @@ gtk_rc_style_to_style (GtkRcStyle *rc_style)
/* Reuses or frees rc_styles */
static GtkStyle *
-gtk_rc_style_init (GSList *rc_styles)
+gtk_rc_init_style (GSList *rc_styles)
{
gint i;
@@ -1311,7 +1349,6 @@ gtk_rc_style_init (GSList *rc_styles)
while (tmp_styles)
{
GtkRcStyle *rc_style = tmp_styles->data;
- GtkRcStylePrivate *rc_style_private;
for (i=0; i<5; i++)
{
@@ -1359,9 +1396,8 @@ gtk_rc_style_init (GSList *rc_styles)
/* Point from each rc_style to the list of styles */
- rc_style_private = (GtkRcStylePrivate *)rc_style;
- if (!g_slist_find (rc_style_private->rc_style_lists, rc_styles))
- rc_style_private->rc_style_lists = g_slist_prepend (rc_style_private->rc_style_lists, rc_styles);
+ if (!g_slist_find (rc_style->rc_style_lists, rc_styles))
+ rc_style->rc_style_lists = g_slist_prepend (rc_style->rc_style_lists, rc_styles);
tmp_styles = tmp_styles->next;
}
diff --git a/gtk/gtkrc.h b/gtk/gtkrc.h
index 30d623cad..2991326ca 100644
--- a/gtk/gtkrc.h
+++ b/gtk/gtkrc.h
@@ -35,6 +35,12 @@
extern "C" {
#endif /* __cplusplus */
+#define GTK_TYPE_RC_STYLE (gtk_rc_style_get_type ())
+#define GTK_RC_STYLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_RC_STYLE, GtkRcStyle))
+#define GTK_RC_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_RC_STYLE, GtkRcStyleClass))
+#define GTK_IS_RC_STYLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GTK_TYPE_RC_STYLE))
+#define GTK_IS_RC_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_RC_STYLE))
+#define GTK_RC_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_RC_STYLE, GtkRcStyleClass))
typedef enum {
GTK_RC_FG = 1 << 0,
@@ -43,8 +49,14 @@ typedef enum {
GTK_RC_BASE = 1 << 3
} GtkRcFlags;
+typedef struct _GtkRcStyleClass GtkRcStyleClass;
+
struct _GtkRcStyle
{
+ GObject parent_instance;
+
+ /*< public >*/
+
gchar *name;
gchar *bg_pixmap_name[5];
PangoFontDescription *font_desc;
@@ -57,6 +69,17 @@ struct _GtkRcStyle
GtkThemeEngine *engine;
gpointer engine_data;
+
+ /*< private >*/
+
+ /* list of RC style lists including this RC style */
+ GSList *rc_style_lists;
+};
+
+struct _GtkRcStyleClass
+{
+ GObjectClass parent_class;
+
};
void gtk_rc_init (void);
@@ -74,6 +97,7 @@ void gtk_rc_add_widget_class_style (GtkRcStyle *rc_style,
void gtk_rc_add_class_style (GtkRcStyle *rc_style,
const gchar *pattern);
+GType gtk_rc_style_get_type (void);
GtkRcStyle* gtk_rc_style_new (void);
void gtk_rc_style_ref (GtkRcStyle *rc_style);
void gtk_rc_style_unref (GtkRcStyle *rc_style);
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index e1099d1ca..dd23790bd 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -332,7 +332,7 @@ gtk_scale_get_value_size (GtkScale *scale,
if (height)
*height = MAX (*height, logical_rect.height / PANGO_SCALE);
- pango_layout_unref (layout);
+ g_object_unref (G_OBJECT (layout));
}
else
{
diff --git a/gtk/gtksocket.c b/gtk/gtksocket.c
index 28ffe4dce..91bd47ec1 100644
--- a/gtk/gtksocket.c
+++ b/gtk/gtksocket.c
@@ -150,14 +150,19 @@ void
gtk_socket_steal (GtkSocket *socket, GdkNativeWindow id)
{
GtkWidget *widget;
-
+ gpointer user_data = NULL;
+
widget = GTK_WIDGET (socket);
socket->plug_window = gdk_window_lookup (id);
gdk_error_trap_push ();
+
+ if (socket->plug_window)
+ gdk_window_get_user_data (socket->plug_window,
+ &user_data);
- if (socket->plug_window && socket->plug_window->user_data)
+ if (user_data)
{
/*
GtkWidget *child_widget;
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 3af3a22d7..5bb44643c 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -427,7 +427,7 @@ gtk_spin_button_realize (GtkWidget *widget)
spin_button = GTK_SPIN_BUTTON (widget);
real_width = widget->allocation.width;
- widget->allocation.width -= ARROW_SIZE + 2 * widget->style->klass->xthickness;
+ widget->allocation.width -= ARROW_SIZE + 2 * widget->style->xthickness;
gtk_widget_set_events (widget, gtk_widget_get_events (widget) |
GDK_KEY_RELEASE_MASK);
GTK_WIDGET_CLASS (parent_class)->realize (widget);
@@ -446,10 +446,10 @@ gtk_spin_button_realize (GtkWidget *widget)
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
attributes.x = (widget->allocation.x + widget->allocation.width - ARROW_SIZE -
- 2 * widget->style->klass->xthickness);
+ 2 * widget->style->xthickness);
attributes.y = widget->allocation.y + (widget->allocation.height -
widget->requisition.height) / 2;
- attributes.width = ARROW_SIZE + 2 * widget->style->klass->xthickness;
+ attributes.width = ARROW_SIZE + 2 * widget->style->xthickness;
attributes.height = widget->requisition.height;
spin_button->panel = gdk_window_new (gtk_widget_get_parent_window (widget),
@@ -496,7 +496,7 @@ gtk_spin_button_size_request (GtkWidget *widget,
GTK_WIDGET_CLASS (parent_class)->size_request (widget, requisition);
requisition->width = MIN_SPIN_BUTTON_WIDTH + ARROW_SIZE
- + 2 * widget->style->klass->xthickness;
+ + 2 * widget->style->xthickness;
}
static void
@@ -510,11 +510,11 @@ gtk_spin_button_size_allocate (GtkWidget *widget,
g_return_if_fail (allocation != NULL);
child_allocation = *allocation;
- if (child_allocation.width > ARROW_SIZE + 2 * widget->style->klass->xthickness)
- child_allocation.width -= ARROW_SIZE + 2 * widget->style->klass->xthickness;
+ if (child_allocation.width > ARROW_SIZE + 2 * widget->style->xthickness)
+ child_allocation.width -= ARROW_SIZE + 2 * widget->style->xthickness;
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
- child_allocation.x += ARROW_SIZE + 2 * widget->style->klass->xthickness;
+ child_allocation.x += ARROW_SIZE + 2 * widget->style->xthickness;
GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, &child_allocation);
@@ -522,15 +522,15 @@ gtk_spin_button_size_allocate (GtkWidget *widget,
if (GTK_WIDGET_REALIZED (widget))
{
- child_allocation.width = ARROW_SIZE + 2 * widget->style->klass->xthickness;
+ child_allocation.width = ARROW_SIZE + 2 * widget->style->xthickness;
child_allocation.height = widget->requisition.height;
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
child_allocation.x = (allocation->x + allocation->width - ARROW_SIZE -
- 2 * widget->style->klass->xthickness);
+ 2 * widget->style->xthickness);
else
- child_allocation.x = allocation->x;
-
+ child_allocation.x = allocation->x;
+
child_allocation.y = allocation->y + (allocation->height - widget->requisition.height) / 2;
gdk_window_move_resize (GTK_SPIN_BUTTON (widget)->panel,
@@ -559,7 +559,7 @@ gtk_spin_button_paint (GtkWidget *widget,
GTK_STATE_NORMAL, spin->shadow_type,
area, widget, "spinbutton",
0, 0,
- ARROW_SIZE + 2 * widget->style->klass->xthickness,
+ ARROW_SIZE + 2 * widget->style->xthickness,
widget->requisition.height);
else
{
@@ -648,31 +648,31 @@ gtk_spin_button_draw_arrow (GtkSpinButton *spin_button,
{
if (spin_button->shadow_type != GTK_SHADOW_NONE)
{
- x = widget->style->klass->xthickness;
- y = widget->style->klass->ythickness;
+ x = widget->style->xthickness;
+ y = widget->style->ythickness;
}
else
{
- x = widget->style->klass->xthickness - 1;
- y = widget->style->klass->ythickness - 1;
+ x = widget->style->xthickness - 1;
+ y = widget->style->ythickness - 1;
}
gtk_paint_arrow (widget->style, spin_button->panel,
state_type, shadow_type,
NULL, widget, "spinbutton",
arrow, TRUE,
x, y, ARROW_SIZE, widget->requisition.height / 2
- - widget->style->klass->ythickness);
+ - widget->style->ythickness);
}
else
{
if (spin_button->shadow_type != GTK_SHADOW_NONE)
{
- x = widget->style->klass->xthickness;
+ x = widget->style->xthickness;
y = widget->requisition.height / 2;
}
else
{
- x = widget->style->klass->xthickness - 1;
+ x = widget->style->xthickness - 1;
y = widget->requisition.height / 2 + 1;
}
gtk_paint_arrow (widget->style, spin_button->panel,
@@ -680,7 +680,7 @@ gtk_spin_button_draw_arrow (GtkSpinButton *spin_button,
NULL, widget, "spinbutton",
arrow, TRUE,
x, y, ARROW_SIZE, widget->requisition.height / 2
- - widget->style->klass->ythickness);
+ - widget->style->ythickness);
}
}
}
@@ -913,7 +913,7 @@ gtk_spin_button_button_release (GtkWidget *widget,
{
if (event->y >= 0 && event->x >= 0 &&
event->y <= widget->requisition.height &&
- event->x <= ARROW_SIZE + 2 * widget->style->klass->xthickness)
+ event->x <= ARROW_SIZE + 2 * widget->style->xthickness)
{
if (spin->click_child == GTK_ARROW_UP &&
event->y <= widget->requisition.height / 2)
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c
index d2fb0f715..e30acffd7 100644
--- a/gtk/gtkstyle.c
+++ b/gtk/gtkstyle.c
@@ -44,10 +44,9 @@
#define M_PI_4 0.78539816339744830962
#endif /* M_PI_4 */
-static void gtk_style_init (GtkStyle *style,
- GdkColormap *colormap,
- gint depth);
-static void gtk_style_destroy (GtkStyle *style);
+static void gtk_style_realize (GtkStyle *style,
+ GdkColormap *colormap,
+ gint depth);
static void gtk_default_draw_hline (GtkStyle *style,
GdkWindow *window,
@@ -299,33 +298,6 @@ static void gtk_style_shade (GdkColor *a, GdkColor *b, gdouble k);
static void rgb_to_hls (gdouble *r, gdouble *g, gdouble *b);
static void hls_to_rgb (gdouble *h, gdouble *l, gdouble *s);
-
-static const GtkStyleClass default_class =
-{
- 2,
- 2,
- gtk_default_draw_hline,
- gtk_default_draw_vline,
- gtk_default_draw_shadow,
- gtk_default_draw_polygon,
- gtk_default_draw_arrow,
- gtk_default_draw_diamond,
- gtk_default_draw_oval,
- gtk_default_draw_string,
- gtk_default_draw_box,
- gtk_default_draw_flat_box,
- gtk_default_draw_check,
- gtk_default_draw_option,
- gtk_default_draw_cross,
- gtk_default_draw_ramp,
- gtk_default_draw_tab,
- gtk_default_draw_shadow_gap,
- gtk_default_draw_box_gap,
- gtk_default_draw_extension,
- gtk_default_draw_focus,
- gtk_default_draw_slider,
- gtk_default_draw_handle
-};
GdkFont *default_font = NULL;
static GdkColor gtk_default_normal_fg = { 0, 0, 0, 0 };
@@ -340,69 +312,45 @@ static GdkColor gtk_default_prelight_bg = { 0, 0xea60, 0xea60, 0xea60 };
static GdkColor gtk_default_selected_bg = { 0, 0, 0, 0x9c40 };
static GdkColor gtk_default_insensitive_bg = { 0, 0xd6d6, 0xd6d6, 0xd6d6 };
-GtkStyle*
-gtk_style_copy (GtkStyle *style)
+static gpointer parent_class = NULL;
+
+static void gtk_style_init (GtkStyle *style);
+static void gtk_style_class_init (GtkStyleClass *klass);
+static void gtk_style_finalize (GObject *object);
+
+GType
+gtk_style_get_type (void)
{
- GtkStyle *new_style;
- guint i;
-
- g_return_val_if_fail (style != NULL, NULL);
-
- new_style = gtk_style_new ();
-
- for (i = 0; i < 5; i++)
- {
- new_style->fg[i] = style->fg[i];
- new_style->bg[i] = style->bg[i];
- new_style->text[i] = style->text[i];
- new_style->base[i] = style->base[i];
-
- new_style->bg_pixmap[i] = style->bg_pixmap[i];
- }
-
- gdk_font_unref (new_style->font);
- new_style->font = style->font;
- gdk_font_ref (new_style->font);
+ static GType object_type = 0;
- if (style->rc_style)
+ if (!object_type)
{
- new_style->rc_style = style->rc_style;
- gtk_rc_style_ref (style->rc_style);
+ static const GTypeInfo object_info =
+ {
+ sizeof (GtkStyleClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) gtk_style_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (GtkStyle),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) gtk_style_init,
+ };
+
+ object_type = g_type_register_static (G_TYPE_OBJECT,
+ "GtkStyle",
+ &object_info);
}
- if (style->engine)
- {
- new_style->engine = style->engine;
- gtk_theme_engine_ref (new_style->engine);
- new_style->engine->duplicate_style (new_style, style);
- }
-
- return new_style;
+ return object_type;
}
-static GtkStyle*
-gtk_style_duplicate (GtkStyle *style)
-{
- GtkStyle *new_style;
-
- g_return_val_if_fail (style != NULL, NULL);
-
- new_style = gtk_style_copy (style);
-
- style->styles = g_slist_append (style->styles, new_style);
- new_style->styles = style->styles;
-
- return new_style;
-}
-
-GtkStyle*
-gtk_style_new (void)
+static void
+gtk_style_init (GtkStyle *style)
{
- GtkStyle *style;
gint i;
- style = g_new0 (GtkStyle, 1);
-
style->font_desc = pango_font_description_from_string ("Sans 10");
if (!default_font)
@@ -416,11 +364,9 @@ gtk_style_new (void)
style->font = default_font;
gdk_font_ref (style->font);
- style->ref_count = 1;
style->attach_count = 0;
style->colormap = NULL;
style->depth = -1;
- style->klass = (GtkStyleClass *)&default_class;
style->black.red = 0;
style->black.green = 0;
@@ -472,6 +418,147 @@ gtk_style_new (void)
style->text_gc[i] = NULL;
style->base_gc[i] = NULL;
}
+
+ style->xthickness = 2;
+ style->ythickness = 2;
+}
+
+static void
+gtk_style_class_init (GtkStyleClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ parent_class = g_type_class_peek_parent (klass);
+
+ object_class->finalize = gtk_style_finalize;
+
+ klass->draw_hline = gtk_default_draw_hline;
+ klass->draw_vline = gtk_default_draw_vline;
+ klass->draw_shadow = gtk_default_draw_shadow;
+ klass->draw_polygon = gtk_default_draw_polygon;
+ klass->draw_arrow = gtk_default_draw_arrow;
+ klass->draw_diamond = gtk_default_draw_diamond;
+ klass->draw_oval = gtk_default_draw_oval;
+ klass->draw_string = gtk_default_draw_string;
+ klass->draw_box = gtk_default_draw_box;
+ klass->draw_flat_box = gtk_default_draw_flat_box;
+ klass->draw_check = gtk_default_draw_check;
+ klass->draw_option = gtk_default_draw_option;
+ klass->draw_cross = gtk_default_draw_cross;
+ klass->draw_ramp = gtk_default_draw_ramp;
+ klass->draw_tab = gtk_default_draw_tab;
+ klass->draw_shadow_gap = gtk_default_draw_shadow_gap;
+ klass->draw_box_gap = gtk_default_draw_box_gap;
+ klass->draw_extension = gtk_default_draw_extension;
+ klass->draw_focus = gtk_default_draw_focus;
+ klass->draw_slider = gtk_default_draw_slider;
+ klass->draw_handle = gtk_default_draw_handle;
+}
+
+static void
+gtk_style_finalize (GObject *object)
+{
+ GtkStyle *style = GTK_STYLE (object);
+
+ g_return_if_fail (style->attach_count == 0);
+
+ if (style->styles)
+ {
+ if (style->styles->data != style)
+ g_slist_remove (style->styles, style);
+ else
+ {
+ GSList *tmp_list = style->styles->next;
+
+ while (tmp_list)
+ {
+ ((GtkStyle*) tmp_list->data)->styles = style->styles->next;
+ tmp_list = tmp_list->next;
+ }
+ g_slist_free_1 (style->styles);
+ }
+ }
+
+ if (style->engine)
+ {
+ style->engine->destroy_style (style);
+ gtk_theme_engine_unref (style->engine);
+ }
+
+ gdk_font_unref (style->font);
+ pango_font_description_free (style->font_desc);
+
+ if (style->rc_style)
+ gtk_rc_style_unref (style->rc_style);
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+
+GtkStyle*
+gtk_style_copy (GtkStyle *style)
+{
+ GtkStyle *new_style;
+ guint i;
+
+ g_return_val_if_fail (style != NULL, NULL);
+
+ new_style = gtk_style_new ();
+
+ for (i = 0; i < 5; i++)
+ {
+ new_style->fg[i] = style->fg[i];
+ new_style->bg[i] = style->bg[i];
+ new_style->text[i] = style->text[i];
+ new_style->base[i] = style->base[i];
+
+ new_style->bg_pixmap[i] = style->bg_pixmap[i];
+ }
+
+ gdk_font_unref (new_style->font);
+ new_style->font = style->font;
+ gdk_font_ref (new_style->font);
+
+ pango_font_description_free (new_style->font_desc);
+ new_style->font_desc = pango_font_description_copy (style->font_desc);
+
+ if (style->rc_style)
+ {
+ new_style->rc_style = style->rc_style;
+ gtk_rc_style_ref (style->rc_style);
+ }
+
+ if (style->engine)
+ {
+ new_style->engine = style->engine;
+ gtk_theme_engine_ref (new_style->engine);
+ new_style->engine->duplicate_style (new_style, style);
+ }
+
+ return new_style;
+}
+
+static GtkStyle*
+gtk_style_duplicate (GtkStyle *style)
+{
+ GtkStyle *new_style;
+
+ g_return_val_if_fail (style != NULL, NULL);
+
+ new_style = gtk_style_copy (style);
+
+ style->styles = g_slist_append (style->styles, new_style);
+ new_style->styles = style->styles;
+
+ return new_style;
+}
+
+GtkStyle*
+gtk_style_new (void)
+{
+ GtkStyle *style;
+
+ style = GTK_STYLE (g_type_create_instance (gtk_style_get_type ()));
return style;
}
@@ -534,7 +621,7 @@ gtk_style_attach (GtkStyle *style,
if (new_style->attach_count == 0)
{
- gtk_style_init (new_style, colormap, depth);
+ gtk_style_realize (new_style, colormap, depth);
break;
}
else if (new_style->colormap == colormap &&
@@ -548,7 +635,7 @@ gtk_style_attach (GtkStyle *style,
if (!new_style)
{
new_style = gtk_style_duplicate (style);
- gtk_style_init (new_style, colormap, depth);
+ gtk_style_realize (new_style, colormap, depth);
}
/* A style gets a refcount from being attached */
@@ -601,28 +688,19 @@ gtk_style_detach (GtkStyle *style)
GtkStyle*
gtk_style_ref (GtkStyle *style)
{
- g_return_val_if_fail (style != NULL, NULL);
- g_return_val_if_fail (style->ref_count > 0, NULL);
-
- style->ref_count += 1;
- return style;
+ return (GtkStyle *) g_object_ref (G_OBJECT (style));
}
void
gtk_style_unref (GtkStyle *style)
{
- g_return_if_fail (style != NULL);
- g_return_if_fail (style->ref_count > 0);
-
- style->ref_count -= 1;
- if (style->ref_count == 0)
- gtk_style_destroy (style);
+ g_object_unref (G_OBJECT (style));
}
static void
-gtk_style_init (GtkStyle *style,
- GdkColormap *colormap,
- gint depth)
+gtk_style_realize (GtkStyle *style,
+ GdkColormap *colormap,
+ gint depth)
{
GdkGCValues gc_values;
GdkGCValuesMask gc_values_mask;
@@ -717,43 +795,6 @@ gtk_style_init (GtkStyle *style,
style->engine->realize_style (style);
}
-static void
-gtk_style_destroy (GtkStyle *style)
-{
- g_return_if_fail (style->attach_count == 0);
-
- if (style->styles)
- {
- if (style->styles->data != style)
- g_slist_remove (style->styles, style);
- else
- {
- GSList *tmp_list = style->styles->next;
-
- while (tmp_list)
- {
- ((GtkStyle*) tmp_list->data)->styles = style->styles->next;
- tmp_list = tmp_list->next;
- }
- g_slist_free_1 (style->styles);
- }
- }
-
- if (style->engine)
- {
- style->engine->destroy_style (style);
- gtk_theme_engine_unref (style->engine);
- }
-
- gdk_font_unref (style->font);
- pango_font_description_free (style->font_desc);
-
- if (style->rc_style)
- gtk_rc_style_unref (style->rc_style);
-
- g_free (style);
-}
-
void
gtk_draw_hline (GtkStyle *style,
GdkWindow *window,
@@ -763,10 +804,9 @@ gtk_draw_hline (GtkStyle *style,
gint y)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_hline != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_hline != NULL);
- style->klass->draw_hline (style, window, state_type, NULL, NULL, NULL, x1, x2, y);
+ GTK_STYLE_GET_CLASS (style)->draw_hline (style, window, state_type, NULL, NULL, NULL, x1, x2, y);
}
@@ -779,10 +819,9 @@ gtk_draw_vline (GtkStyle *style,
gint x)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_vline != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_vline != NULL);
- style->klass->draw_vline (style, window, state_type, NULL, NULL, NULL, y1, y2, x);
+ GTK_STYLE_GET_CLASS (style)->draw_vline (style, window, state_type, NULL, NULL, NULL, y1, y2, x);
}
@@ -797,10 +836,9 @@ gtk_draw_shadow (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_shadow != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_shadow != NULL);
- style->klass->draw_shadow (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_shadow (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
}
void
@@ -813,10 +851,9 @@ gtk_draw_polygon (GtkStyle *style,
gboolean fill)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_polygon != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_polygon != NULL);
- style->klass->draw_polygon (style, window, state_type, shadow_type, NULL, NULL, NULL, points, npoints, fill);
+ GTK_STYLE_GET_CLASS (style)->draw_polygon (style, window, state_type, shadow_type, NULL, NULL, NULL, points, npoints, fill);
}
void
@@ -832,10 +869,9 @@ gtk_draw_arrow (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_arrow != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_arrow != NULL);
- style->klass->draw_arrow (style, window, state_type, shadow_type, NULL, NULL, NULL, arrow_type, fill, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_arrow (style, window, state_type, shadow_type, NULL, NULL, NULL, arrow_type, fill, x, y, width, height);
}
@@ -850,10 +886,9 @@ gtk_draw_diamond (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_diamond != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_diamond != NULL);
- style->klass->draw_diamond (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_diamond (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
}
@@ -868,10 +903,9 @@ gtk_draw_oval (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_oval != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_oval != NULL);
- style->klass->draw_oval (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_oval (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
}
void
@@ -883,10 +917,9 @@ gtk_draw_string (GtkStyle *style,
const gchar *string)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_string != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_string != NULL);
- style->klass->draw_string (style, window, state_type, NULL, NULL, NULL, x, y, string);
+ GTK_STYLE_GET_CLASS (style)->draw_string (style, window, state_type, NULL, NULL, NULL, x, y, string);
}
void
@@ -900,10 +933,9 @@ gtk_draw_box (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_box != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_box != NULL);
- style->klass->draw_box (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_box (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
}
void
@@ -917,10 +949,9 @@ gtk_draw_flat_box (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_flat_box != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_flat_box != NULL);
- style->klass->draw_flat_box (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_flat_box (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
}
void
@@ -934,10 +965,9 @@ gtk_draw_check (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_check != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_check != NULL);
- style->klass->draw_check (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_check (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
}
void
@@ -951,10 +981,9 @@ gtk_draw_option (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_option != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_option != NULL);
- style->klass->draw_option (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_option (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
}
void
@@ -968,10 +997,9 @@ gtk_draw_cross (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_cross != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_cross != NULL);
- style->klass->draw_cross (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_cross (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
}
void
@@ -986,10 +1014,9 @@ gtk_draw_ramp (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_ramp != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_ramp != NULL);
- style->klass->draw_ramp (style, window, state_type, shadow_type, NULL, NULL, NULL, arrow_type, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_ramp (style, window, state_type, shadow_type, NULL, NULL, NULL, arrow_type, x, y, width, height);
}
void
@@ -1003,10 +1030,9 @@ gtk_draw_tab (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_tab != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_tab != NULL);
- style->klass->draw_tab (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_tab (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height);
}
void
@@ -1023,10 +1049,9 @@ gtk_draw_shadow_gap (GtkStyle *style,
gint gap_width)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_shadow_gap != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_shadow_gap != NULL);
- style->klass->draw_shadow_gap (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, gap_side, gap_x, gap_width);
+ GTK_STYLE_GET_CLASS (style)->draw_shadow_gap (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, gap_side, gap_x, gap_width);
}
void
@@ -1043,10 +1068,9 @@ gtk_draw_box_gap (GtkStyle *style,
gint gap_width)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_box_gap != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_box_gap != NULL);
- style->klass->draw_box_gap (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, gap_side, gap_x, gap_width);
+ GTK_STYLE_GET_CLASS (style)->draw_box_gap (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, gap_side, gap_x, gap_width);
}
void
@@ -1061,10 +1085,9 @@ gtk_draw_extension (GtkStyle *style,
GtkPositionType gap_side)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_extension != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_extension != NULL);
- style->klass->draw_extension (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, gap_side);
+ GTK_STYLE_GET_CLASS (style)->draw_extension (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, gap_side);
}
void
@@ -1076,10 +1099,9 @@ gtk_draw_focus (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_focus != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_focus != NULL);
- style->klass->draw_focus (style, window, NULL, NULL, NULL, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_focus (style, window, NULL, NULL, NULL, x, y, width, height);
}
void
@@ -1094,10 +1116,9 @@ gtk_draw_slider (GtkStyle *style,
GtkOrientation orientation)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_slider != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_slider != NULL);
- style->klass->draw_slider (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, orientation);
+ GTK_STYLE_GET_CLASS (style)->draw_slider (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, orientation);
}
void
@@ -1112,10 +1133,9 @@ gtk_draw_handle (GtkStyle *style,
GtkOrientation orientation)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_handle != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_handle != NULL);
- style->klass->draw_handle (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, orientation);
+ GTK_STYLE_GET_CLASS (style)->draw_handle (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, orientation);
}
void
@@ -1189,7 +1209,7 @@ gtk_style_apply_default_background (GtkStyle *style,
}
if (!style->bg_pixmap[state_type] ||
- gdk_window_get_type (window) == GDK_WINDOW_PIXMAP ||
+ GDK_IS_PIXMAP (window) ||
(!set_bg && style->bg_pixmap[state_type] != (GdkPixmap*) GDK_PARENT_RELATIVE))
{
GdkGC *gc = style->bg_gc[state_type];
@@ -1239,8 +1259,8 @@ gtk_default_draw_hline (GtkStyle *style,
g_return_if_fail (style != NULL);
g_return_if_fail (window != NULL);
- thickness_light = style->klass->ythickness / 2;
- thickness_dark = style->klass->ythickness - thickness_light;
+ thickness_light = style->ythickness / 2;
+ thickness_dark = style->ythickness - thickness_light;
if (area)
{
@@ -1296,8 +1316,8 @@ gtk_default_draw_vline (GtkStyle *style,
g_return_if_fail (style != NULL);
g_return_if_fail (window != NULL);
- thickness_light = style->klass->xthickness / 2;
- thickness_dark = style->klass->xthickness - thickness_light;
+ thickness_light = style->xthickness / 2;
+ thickness_dark = style->xthickness - thickness_light;
if (area)
{
@@ -2189,7 +2209,7 @@ gtk_default_draw_box (GtkStyle *style,
gdk_window_get_size (window, NULL, &height);
if (!style->bg_pixmap[state_type] ||
- gdk_window_get_type (window) == GDK_WINDOW_PIXMAP)
+ GDK_IS_PIXMAP (window))
{
if (area)
gdk_gc_set_clip_rectangle (style->bg_gc[state_type], area);
@@ -2248,7 +2268,7 @@ gtk_default_draw_flat_box (GtkStyle *style,
gc1 = style->bg_gc[state_type];
if (!style->bg_pixmap[state_type] || gc1 != style->bg_gc[state_type] ||
- gdk_window_get_type (window) == GDK_WINDOW_PIXMAP)
+ GDK_IS_PIXMAP (window))
{
if (area)
gdk_gc_set_clip_rectangle (gc1, area);
@@ -2893,10 +2913,10 @@ gtk_default_draw_extension (GtkStyle *style,
gtk_style_apply_default_background (style, window,
widget && !GTK_WIDGET_NO_WINDOW (widget),
state_type, area,
- x + style->klass->xthickness,
+ x + style->xthickness,
y,
- width - (2 * style->klass->xthickness),
- height - (style->klass->ythickness));
+ width - (2 * style->xthickness),
+ height - (style->ythickness));
gdk_draw_line (window, gc1,
x, y, x, y + height - 2);
gdk_draw_line (window, gc2,
@@ -2915,10 +2935,10 @@ gtk_default_draw_extension (GtkStyle *style,
gtk_style_apply_default_background (style, window,
widget && !GTK_WIDGET_NO_WINDOW (widget),
state_type, area,
- x + style->klass->xthickness,
- y + style->klass->ythickness,
- width - (2 * style->klass->xthickness),
- height - (style->klass->ythickness));
+ x + style->xthickness,
+ y + style->ythickness,
+ width - (2 * style->xthickness),
+ height - (style->ythickness));
gdk_draw_line (window, gc1,
x + 1, y, x + width - 2, y);
gdk_draw_line (window, gc1,
@@ -2938,9 +2958,9 @@ gtk_default_draw_extension (GtkStyle *style,
widget && !GTK_WIDGET_NO_WINDOW (widget),
state_type, area,
x,
- y + style->klass->ythickness,
- width - (style->klass->xthickness),
- height - (2 * style->klass->ythickness));
+ y + style->ythickness,
+ width - (style->xthickness),
+ height - (2 * style->ythickness));
gdk_draw_line (window, gc1,
x, y, x + width - 2, y);
gdk_draw_line (window, gc2,
@@ -2959,10 +2979,10 @@ gtk_default_draw_extension (GtkStyle *style,
gtk_style_apply_default_background (style, window,
widget && !GTK_WIDGET_NO_WINDOW (widget),
state_type, area,
- x + style->klass->xthickness,
- y + style->klass->ythickness,
- width - (style->klass->xthickness),
- height - (2 * style->klass->ythickness));
+ x + style->xthickness,
+ y + style->ythickness,
+ width - (style->xthickness),
+ height - (2 * style->ythickness));
gdk_draw_line (window, gc1,
x + 1, y, x + width - 1, y);
gdk_draw_line (window, gc1,
@@ -3074,12 +3094,12 @@ gtk_default_draw_slider (GtkStyle *style,
if (orientation == GTK_ORIENTATION_HORIZONTAL)
gtk_paint_vline (style, window, state_type, area, widget, detail,
- style->klass->ythickness,
- height - style->klass->ythickness - 1, width / 2);
+ style->ythickness,
+ height - style->ythickness - 1, width / 2);
else
gtk_paint_hline (style, window, state_type, area, widget, detail,
- style->klass->xthickness,
- width - style->klass->xthickness - 1, height / 2);
+ style->xthickness,
+ width - style->xthickness - 1, height / 2);
}
static void
@@ -3155,8 +3175,8 @@ gtk_default_draw_handle (GtkStyle *style,
}
else
{
- xthick = style->klass->xthickness;
- ythick = style->klass->ythickness;
+ xthick = style->xthickness;
+ ythick = style->ythickness;
light_gc = style->light_gc[state_type];
dark_gc = style->dark_gc[state_type];
@@ -3405,10 +3425,9 @@ gtk_paint_hline (GtkStyle *style,
gint y)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_hline != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_hline != NULL);
- style->klass->draw_hline (style, window, state_type, area, widget, detail, x1, x2, y);
+ GTK_STYLE_GET_CLASS (style)->draw_hline (style, window, state_type, area, widget, detail, x1, x2, y);
}
void
@@ -3423,10 +3442,9 @@ gtk_paint_vline (GtkStyle *style,
gint x)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_vline != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_vline != NULL);
- style->klass->draw_vline (style, window, state_type, area, widget, detail, y1, y2, x);
+ GTK_STYLE_GET_CLASS (style)->draw_vline (style, window, state_type, area, widget, detail, y1, y2, x);
}
void
@@ -3443,10 +3461,9 @@ gtk_paint_shadow (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_shadow != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_shadow != NULL);
- style->klass->draw_shadow (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_shadow (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
}
void
@@ -3462,10 +3479,9 @@ gtk_paint_polygon (GtkStyle *style,
gboolean fill)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_shadow != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_shadow != NULL);
- style->klass->draw_polygon (style, window, state_type, shadow_type, area, widget, detail, points, npoints, fill);
+ GTK_STYLE_GET_CLASS (style)->draw_polygon (style, window, state_type, shadow_type, area, widget, detail, points, npoints, fill);
}
void
@@ -3484,10 +3500,9 @@ gtk_paint_arrow (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_arrow != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_arrow != NULL);
- style->klass->draw_arrow (style, window, state_type, shadow_type, area, widget, detail, arrow_type, fill, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_arrow (style, window, state_type, shadow_type, area, widget, detail, arrow_type, fill, x, y, width, height);
}
void
@@ -3504,10 +3519,9 @@ gtk_paint_diamond (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_diamond != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_diamond != NULL);
- style->klass->draw_diamond (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_diamond (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
}
void
@@ -3524,10 +3538,9 @@ gtk_paint_oval (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_oval != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_oval != NULL);
- style->klass->draw_oval (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_oval (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
}
void
@@ -3542,10 +3555,9 @@ gtk_paint_string (GtkStyle *style,
const gchar *string)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_string != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_string != NULL);
- style->klass->draw_string (style, window, state_type, area, widget, detail, x, y, string);
+ GTK_STYLE_GET_CLASS (style)->draw_string (style, window, state_type, area, widget, detail, x, y, string);
}
void
@@ -3562,10 +3574,9 @@ gtk_paint_box (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_box != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_box != NULL);
- style->klass->draw_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
}
void
@@ -3582,10 +3593,9 @@ gtk_paint_flat_box (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_flat_box != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_flat_box != NULL);
- style->klass->draw_flat_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_flat_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
}
void
@@ -3602,10 +3612,9 @@ gtk_paint_check (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_check != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_check != NULL);
- style->klass->draw_check (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_check (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
}
void
@@ -3622,10 +3631,9 @@ gtk_paint_option (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_option != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_option != NULL);
- style->klass->draw_option (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_option (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
}
void
@@ -3642,10 +3650,9 @@ gtk_paint_cross (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_cross != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_cross != NULL);
- style->klass->draw_cross (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_cross (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
}
void
@@ -3663,10 +3670,9 @@ gtk_paint_ramp (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_ramp != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_ramp != NULL);
- style->klass->draw_ramp (style, window, state_type, shadow_type, area, widget, detail, arrow_type, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_ramp (style, window, state_type, shadow_type, area, widget, detail, arrow_type, x, y, width, height);
}
void
@@ -3683,10 +3689,9 @@ gtk_paint_tab (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_tab != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_tab != NULL);
- style->klass->draw_tab (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_tab (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
}
void
@@ -3706,10 +3711,9 @@ gtk_paint_shadow_gap (GtkStyle *style,
gint gap_width)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_shadow_gap != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_shadow_gap != NULL);
- style->klass->draw_shadow_gap (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, gap_side, gap_x, gap_width);
+ GTK_STYLE_GET_CLASS (style)->draw_shadow_gap (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, gap_side, gap_x, gap_width);
}
@@ -3730,10 +3734,9 @@ gtk_paint_box_gap (GtkStyle *style,
gint gap_width)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_box_gap != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_box_gap != NULL);
- style->klass->draw_box_gap (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, gap_side, gap_x, gap_width);
+ GTK_STYLE_GET_CLASS (style)->draw_box_gap (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, gap_side, gap_x, gap_width);
}
void
@@ -3751,10 +3754,9 @@ gtk_paint_extension (GtkStyle *style,
GtkPositionType gap_side)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_extension != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_extension != NULL);
- style->klass->draw_extension (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, gap_side);
+ GTK_STYLE_GET_CLASS (style)->draw_extension (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, gap_side);
}
void
@@ -3769,10 +3771,9 @@ gtk_paint_focus (GtkStyle *style,
gint height)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_focus != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_focus != NULL);
- style->klass->draw_focus (style, window, area, widget, detail, x, y, width, height);
+ GTK_STYLE_GET_CLASS (style)->draw_focus (style, window, area, widget, detail, x, y, width, height);
}
void
@@ -3790,10 +3791,9 @@ gtk_paint_slider (GtkStyle *style,
GtkOrientation orientation)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_slider != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_slider != NULL);
- style->klass->draw_slider (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, orientation);
+ GTK_STYLE_GET_CLASS (style)->draw_slider (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, orientation);
}
void
@@ -3811,8 +3811,7 @@ gtk_paint_handle (GtkStyle *style,
GtkOrientation orientation)
{
g_return_if_fail (style != NULL);
- g_return_if_fail (style->klass != NULL);
- g_return_if_fail (style->klass->draw_handle != NULL);
+ g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_handle != NULL);
- style->klass->draw_handle (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, orientation);
+ GTK_STYLE_GET_CLASS (style)->draw_handle (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, orientation);
}
diff --git a/gtk/gtkstyle.h b/gtk/gtkstyle.h
index fca8c21ed..45e028eac 100644
--- a/gtk/gtkstyle.h
+++ b/gtk/gtkstyle.h
@@ -39,6 +39,13 @@ extern "C" {
typedef struct _GtkStyle GtkStyle;
typedef struct _GtkStyleClass GtkStyleClass;
+#define GTK_TYPE_STYLE (gtk_style_get_type ())
+#define GTK_STYLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_STYLE, GtkStyle))
+#define GTK_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_STYLE, GtkStyleClass))
+#define GTK_IS_STYLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GTK_TYPE_STYLE))
+#define GTK_IS_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_STYLE))
+#define GTK_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_STYLE, GtkStyleClass))
+
/* Some forward declarations needed to rationalize the header
* files.
*/
@@ -60,8 +67,10 @@ typedef struct _GtkWidget GtkWidget;
struct _GtkStyle
{
- GtkStyleClass *klass;
+ GObject parent_instance;
+ /*< public >*/
+
GdkColor fg[5];
GdkColor bg[5];
GdkColor light[5];
@@ -86,10 +95,12 @@ struct _GtkStyle
GdkGC *white_gc;
GdkPixmap *bg_pixmap[5];
+
+ gint xthickness;
+ gint ythickness;
- /* private */
+ /*< private >*/
- gint ref_count;
gint attach_count;
gint depth;
@@ -107,8 +118,7 @@ struct _GtkStyle
struct _GtkStyleClass
{
- gint xthickness;
- gint ythickness;
+ GObjectClass parent_class;
void (*draw_hline) (GtkStyle *style,
GdkWindow *window,
@@ -346,6 +356,7 @@ struct _GtkStyleClass
GtkOrientation orientation);
};
+GType gtk_style_get_type (void);
GtkStyle* gtk_style_new (void);
GtkStyle* gtk_style_copy (GtkStyle *style);
GtkStyle* gtk_style_attach (GtkStyle *style,
diff --git a/gtk/gtktearoffmenuitem.c b/gtk/gtktearoffmenuitem.c
index ac775cd6c..5af1baf2f 100644
--- a/gtk/gtktearoffmenuitem.c
+++ b/gtk/gtktearoffmenuitem.c
@@ -108,10 +108,10 @@ gtk_tearoff_menu_item_size_request (GtkWidget *widget,
tearoff = GTK_TEAROFF_MENU_ITEM (widget);
requisition->width = (GTK_CONTAINER (widget)->border_width +
- widget->style->klass->xthickness +
+ widget->style->xthickness +
BORDER_SPACING) * 2;
requisition->height = (GTK_CONTAINER (widget)->border_width +
- widget->style->klass->ythickness) * 2;
+ widget->style->ythickness) * 2;
if (tearoff->torn_off)
{
@@ -119,7 +119,7 @@ gtk_tearoff_menu_item_size_request (GtkWidget *widget,
}
else
{
- requisition->height += widget->style->klass->ythickness;
+ requisition->height += widget->style->ythickness;
}
}
@@ -188,7 +188,7 @@ gtk_tearoff_menu_item_paint (GtkWidget *widget,
{
gtk_draw_hline (widget->style, widget->window, GTK_STATE_NORMAL,
x, MIN (x+TEAR_LENGTH, right_max),
- y + (height - widget->style->klass->ythickness)/2);
+ y + (height - widget->style->ythickness)/2);
x += 2 * TEAR_LENGTH;
}
}
diff --git a/gtk/gtktext.c b/gtk/gtktext.c
index 3b6bfd2ae..341e3b0df 100644
--- a/gtk/gtktext.c
+++ b/gtk/gtktext.c
@@ -1309,8 +1309,8 @@ gtk_text_realize (GtkWidget *widget)
widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
gdk_window_set_user_data (widget->window, text);
- attributes.x = (widget->style->klass->xthickness + TEXT_BORDER_ROOM);
- attributes.y = (widget->style->klass->ythickness + TEXT_BORDER_ROOM);
+ attributes.x = (widget->style->xthickness + TEXT_BORDER_ROOM);
+ attributes.y = (widget->style->ythickness + TEXT_BORDER_ROOM);
attributes.width = MAX (1, (gint)widget->allocation.width - (gint)attributes.x * 2);
attributes.height = MAX (1, (gint)widget->allocation.height - (gint)attributes.y * 2);
@@ -1508,8 +1508,8 @@ clear_focus_area (GtkText *text, gint area_x, gint area_y, gint area_width, gint
{
GtkWidget *widget = GTK_WIDGET (text);
- gint ythick = TEXT_BORDER_ROOM + widget->style->klass->ythickness;
- gint xthick = TEXT_BORDER_ROOM + widget->style->klass->xthickness;
+ gint ythick = TEXT_BORDER_ROOM + widget->style->ythickness;
+ gint xthick = TEXT_BORDER_ROOM + widget->style->xthickness;
gint width, height;
@@ -1537,8 +1537,8 @@ gtk_text_draw_focus (GtkWidget *widget)
if (GTK_WIDGET_DRAWABLE (widget))
{
- gint ythick = widget->style->klass->ythickness;
- gint xthick = widget->style->klass->xthickness;
+ gint ythick = widget->style->ythickness;
+ gint xthick = widget->style->xthickness;
gint xextra = TEXT_BORDER_ROOM;
gint yextra = TEXT_BORDER_ROOM;
@@ -1608,8 +1608,8 @@ gtk_text_size_request (GtkWidget *widget,
g_return_if_fail (GTK_IS_TEXT (widget));
g_return_if_fail (requisition != NULL);
- xthickness = widget->style->klass->xthickness + TEXT_BORDER_ROOM;
- ythickness = widget->style->klass->ythickness + TEXT_BORDER_ROOM;
+ xthickness = widget->style->xthickness + TEXT_BORDER_ROOM;
+ ythickness = widget->style->ythickness + TEXT_BORDER_ROOM;
char_height = MIN_TEXT_HEIGHT_LINES * (widget->style->font->ascent +
widget->style->font->descent);
@@ -1645,11 +1645,11 @@ gtk_text_size_allocate (GtkWidget *widget,
allocation->width, allocation->height);
gdk_window_move_resize (text->text_area,
- widget->style->klass->xthickness + TEXT_BORDER_ROOM,
- widget->style->klass->ythickness + TEXT_BORDER_ROOM,
- MAX (1, (gint)widget->allocation.width - (gint)(widget->style->klass->xthickness +
+ widget->style->xthickness + TEXT_BORDER_ROOM,
+ widget->style->ythickness + TEXT_BORDER_ROOM,
+ MAX (1, (gint)widget->allocation.width - (gint)(widget->style->xthickness +
(gint)TEXT_BORDER_ROOM) * 2),
- MAX (1, (gint)widget->allocation.height - (gint)(widget->style->klass->ythickness +
+ MAX (1, (gint)widget->allocation.height - (gint)(widget->style->ythickness +
(gint)TEXT_BORDER_ROOM) * 2));
#ifdef USE_XIM
diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c
index a6bb822c6..82a8e83c5 100644
--- a/gtk/gtktextlayout.c
+++ b/gtk/gtktextlayout.c
@@ -209,12 +209,12 @@ gtk_text_layout_destroy (GtkObject *object)
if (layout->ltr_context)
{
- pango_context_unref (layout->ltr_context);
+ g_object_unref (G_OBJECT (layout->ltr_context));
layout->ltr_context = NULL;
}
if (layout->rtl_context)
{
- pango_context_unref (layout->rtl_context);
+ g_object_unref (G_OBJECT (layout->rtl_context));
layout->rtl_context = NULL;
}
@@ -298,16 +298,16 @@ gtk_text_layout_set_contexts (GtkTextLayout *layout,
g_return_if_fail (GTK_IS_TEXT_LAYOUT (layout));
if (layout->ltr_context)
- pango_context_unref (ltr_context);
+ g_object_unref (G_OBJECT (ltr_context));
layout->ltr_context = ltr_context;
- pango_context_ref (ltr_context);
+ g_object_ref (G_OBJECT (ltr_context));
if (layout->rtl_context)
- pango_context_unref (rtl_context);
+ g_object_unref (G_OBJECT (rtl_context));
layout->rtl_context = rtl_context;
- pango_context_ref (rtl_context);
+ g_object_ref (G_OBJECT (rtl_context));
gtk_text_layout_invalidate_all (layout);
}
@@ -1359,7 +1359,7 @@ gtk_text_layout_free_line_display (GtkTextLayout *layout,
{
if (display != layout->one_display_cache)
{
- pango_layout_unref (display->layout);
+ g_object_unref (G_OBJECT (display->layout));
if (display->cursors)
{
diff --git a/gtk/gtktexttag.c b/gtk/gtktexttag.c
index 0caf021be..e7f89a35f 100644
--- a/gtk/gtktexttag.c
+++ b/gtk/gtktexttag.c
@@ -174,11 +174,11 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
GTK_ARG_READWRITE, ARG_BACKGROUND_GDK);
gtk_object_add_arg_type ("GtkTextTag::foreground_gdk", GTK_TYPE_GDK_COLOR,
GTK_ARG_READWRITE, ARG_FOREGROUND_GDK);
- /* FIXME should be GTK_TYPE_GDK_BITMAP but that doesn't exist? */
- gtk_object_add_arg_type ("GtkTextTag::background_stipple", GTK_TYPE_GDK_WINDOW,
+ gtk_object_add_arg_type ("GtkTextTag::background_stipple",
+ GDK_TYPE_PIXMAP,
GTK_ARG_READWRITE, ARG_BACKGROUND_STIPPLE);
- /* FIXME GDK_BITMAP */
- gtk_object_add_arg_type ("GtkTextTag::foreground_stipple", GTK_TYPE_GDK_WINDOW,
+ gtk_object_add_arg_type ("GtkTextTag::foreground_stipple",
+ GDK_TYPE_PIXMAP,
GTK_ARG_READWRITE, ARG_FOREGROUND_STIPPLE);
gtk_object_add_arg_type ("GtkTextTag::font", GTK_TYPE_STRING,
GTK_ARG_READWRITE, ARG_FONT);
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 96318efc2..778442538 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -2403,8 +2403,8 @@ gtk_text_view_ensure_layout (GtkTextView *text_view)
gtk_text_layout_set_contexts (text_view->layout, ltr_context, rtl_context);
- pango_context_unref (ltr_context);
- pango_context_unref (rtl_context);
+ g_object_unref (G_OBJECT (ltr_context));
+ g_object_unref (G_OBJECT (rtl_context));
style = gtk_text_view_style_values_new ();
diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c
index 788ac6700..9ae77e89c 100644
--- a/gtk/gtktogglebutton.c
+++ b/gtk/gtktogglebutton.c
@@ -344,8 +344,8 @@ gtk_toggle_button_paint (GtkWidget *widget,
if (GTK_WIDGET_CAN_DEFAULT (widget))
{
- x += widget->style->klass->xthickness;
- y += widget->style->klass->ythickness;
+ x += widget->style->xthickness;
+ y += widget->style->ythickness;
width -= 2 * x + DEFAULT_SPACING;
height -= 2 * y + DEFAULT_SPACING;
x += DEFAULT_LEFT_POS;
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index 3001cb57f..d53fbec91 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -391,7 +391,7 @@ gtk_toolbar_paint_space_line (GtkWidget *widget,
SPACE_LINE_END / SPACE_LINE_DIVISION,
child_space->alloc_x +
(toolbar->space_size -
- widget->style->klass->xthickness) / 2);
+ widget->style->xthickness) / 2);
else
gtk_paint_hline (widget->style, widget->window,
GTK_WIDGET_STATE (widget), area, widget,
@@ -402,7 +402,7 @@ gtk_toolbar_paint_space_line (GtkWidget *widget,
SPACE_LINE_END / SPACE_LINE_DIVISION,
child_space->alloc_y +
(toolbar->space_size -
- widget->style->klass->ythickness) / 2);
+ widget->style->ythickness) / 2);
}
static void
diff --git a/gtk/gtktreeitem.c b/gtk/gtktreeitem.c
index 63e2d7720..06900650f 100644
--- a/gtk/gtktreeitem.c
+++ b/gtk/gtktreeitem.c
@@ -499,7 +499,7 @@ gtk_tree_item_size_request (GtkWidget *widget,
item = GTK_TREE_ITEM(widget);
requisition->width = (GTK_CONTAINER (widget)->border_width +
- widget->style->klass->xthickness) * 2;
+ widget->style->xthickness) * 2;
requisition->height = GTK_CONTAINER (widget)->border_width * 2;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
@@ -546,7 +546,7 @@ gtk_tree_item_size_allocate (GtkWidget *widget,
if (bin->child)
{
border_width = (GTK_CONTAINER (widget)->border_width +
- widget->style->klass->xthickness);
+ widget->style->xthickness);
child_allocation.x = border_width + GTK_TREE(widget->parent)->current_indent;
child_allocation.y = GTK_CONTAINER (widget)->border_width;
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index 481f59425..ef18bacc7 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -449,8 +449,8 @@ gtk_viewport_realize (GtkWidget *widget)
if (viewport->shadow_type != GTK_SHADOW_NONE)
{
- attributes.x = widget->style->klass->xthickness;
- attributes.y = widget->style->klass->ythickness;
+ attributes.x = widget->style->xthickness;
+ attributes.y = widget->style->ythickness;
}
else
{
@@ -564,8 +564,8 @@ gtk_viewport_draw (GtkWidget *widget,
gtk_viewport_paint (widget, &tmp_area);
- tmp_area.x += viewport->hadjustment->value - widget->style->klass->xthickness;
- tmp_area.y += viewport->vadjustment->value - widget->style->klass->ythickness;
+ tmp_area.x += viewport->hadjustment->value - widget->style->xthickness;
+ tmp_area.y += viewport->vadjustment->value - widget->style->ythickness;
gtk_paint_flat_box(widget->style, viewport->bin_window,
GTK_STATE_NORMAL, GTK_SHADOW_NONE,
@@ -654,10 +654,10 @@ gtk_viewport_size_request (GtkWidget *widget,
bin = GTK_BIN (widget);
requisition->width = (GTK_CONTAINER (widget)->border_width +
- GTK_WIDGET (widget)->style->klass->xthickness) * 2 + 5;
+ GTK_WIDGET (widget)->style->xthickness) * 2 + 5;
requisition->height = (GTK_CONTAINER (widget)->border_width * 2 +
- GTK_WIDGET (widget)->style->klass->ythickness) * 2 + 5;
+ GTK_WIDGET (widget)->style->ythickness) * 2 + 5;
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
{
@@ -698,8 +698,8 @@ gtk_viewport_size_allocate (GtkWidget *widget,
if (viewport->shadow_type != GTK_SHADOW_NONE)
{
- child_allocation.x = GTK_WIDGET (viewport)->style->klass->xthickness;
- child_allocation.y = GTK_WIDGET (viewport)->style->klass->ythickness;
+ child_allocation.x = GTK_WIDGET (viewport)->style->xthickness;
+ child_allocation.y = GTK_WIDGET (viewport)->style->ythickness;
}
child_allocation.width = MAX (1, allocation->width - child_allocation.x * 2 - border_width * 2);
diff --git a/gtk/gtkvruler.c b/gtk/gtkvruler.c
index 65aa54204..655f71e88 100644
--- a/gtk/gtkvruler.c
+++ b/gtk/gtkvruler.c
@@ -92,8 +92,8 @@ gtk_vruler_init (GtkVRuler *vruler)
GtkWidget *widget;
widget = GTK_WIDGET (vruler);
- widget->requisition.width = widget->style->klass->xthickness * 2 + RULER_WIDTH;
- widget->requisition.height = widget->style->klass->ythickness * 2 + 1;
+ widget->requisition.width = widget->style->xthickness * 2 + RULER_WIDTH;
+ widget->requisition.height = widget->style->ythickness * 2 + 1;
}
GtkWidget*
@@ -163,8 +163,9 @@ gtk_vruler_draw_ticks (GtkRuler *ruler)
gc = widget->style->fg_gc[GTK_STATE_NORMAL];
bg_gc = widget->style->bg_gc[GTK_STATE_NORMAL];
- xthickness = widget->style->klass->xthickness;
- ythickness = widget->style->klass->ythickness;
+
+ xthickness = widget->style->xthickness;
+ ythickness = widget->style->ythickness;
layout = gtk_widget_create_pango_layout (widget);
pango_layout_set_text (layout, "012456789", -1);
@@ -266,7 +267,7 @@ gtk_vruler_draw_ticks (GtkRuler *ruler)
}
}
- pango_layout_unref (layout);
+ g_object_unref (G_OBJECT (layout));
}
@@ -291,8 +292,8 @@ gtk_vruler_draw_pos (GtkRuler *ruler)
widget = GTK_WIDGET (ruler);
gc = widget->style->fg_gc[GTK_STATE_NORMAL];
- xthickness = widget->style->klass->xthickness;
- ythickness = widget->style->klass->ythickness;
+ xthickness = widget->style->xthickness;
+ ythickness = widget->style->ythickness;
width = widget->allocation.width - xthickness * 2;
height = widget->allocation.height;
diff --git a/gtk/gtkvscale.c b/gtk/gtkvscale.c
index 490b383fb..0432e83ee 100644
--- a/gtk/gtkvscale.c
+++ b/gtk/gtkvscale.c
@@ -326,9 +326,9 @@ gtk_vscale_size_request (GtkWidget *widget,
scale = GTK_SCALE (widget);
requisition->width = (RANGE_CLASS (scale)->slider_width +
- widget->style->klass->ythickness * 2);
+ widget->style->ythickness * 2);
requisition->height = (SCALE_CLASS (scale)->slider_length +
- widget->style->klass->xthickness) * 2;
+ widget->style->xthickness) * 2;
if (scale->draw_value)
{
@@ -396,7 +396,7 @@ gtk_vscale_pos_trough (GtkVScale *vscale,
scale = GTK_SCALE (vscale);
*w = (RANGE_CLASS (scale)->slider_width +
- widget->style->klass->xthickness * 2);
+ widget->style->xthickness * 2);
*h = widget->allocation.height;
if (scale->draw_value)
@@ -590,7 +590,7 @@ gtk_vscale_draw_value (GtkScale *scale)
GTK_WIDGET (scale)->style->fg_gc [state_type],
x, y, layout);
- pango_layout_unref (layout);
+ g_object_unref (G_OBJECT (layout));
}
}
diff --git a/gtk/gtkvscrollbar.c b/gtk/gtkvscrollbar.c
index af4824353..ae66d529d 100644
--- a/gtk/gtkvscrollbar.c
+++ b/gtk/gtkvscrollbar.c
@@ -163,11 +163,11 @@ gtk_vscrollbar_init (GtkVScrollbar *vscrollbar)
requisition = &widget->requisition;
requisition->width = (RANGE_CLASS (widget)->slider_width +
- widget->style->klass->xthickness * 2);
+ widget->style->xthickness * 2);
requisition->height = (RANGE_CLASS (widget)->min_slider_size +
RANGE_CLASS (widget)->stepper_size +
RANGE_CLASS (widget)->stepper_slider_spacing +
- widget->style->klass->ythickness) * 2;
+ widget->style->ythickness) * 2;
}
GtkWidget*
@@ -217,20 +217,20 @@ gtk_vscrollbar_realize (GtkWidget *widget)
range->trough = widget->window;
gdk_window_ref (range->trough);
- attributes.x = widget->style->klass->xthickness;
- attributes.y = widget->style->klass->ythickness;
+ attributes.x = widget->style->xthickness;
+ attributes.y = widget->style->ythickness;
attributes.width = RANGE_CLASS (widget)->stepper_size;
attributes.height = RANGE_CLASS (widget)->stepper_size;
range->step_back = gdk_window_new (range->trough, &attributes, attributes_mask);
attributes.y = (widget->allocation.height -
- widget->style->klass->ythickness -
+ widget->style->ythickness -
RANGE_CLASS (widget)->stepper_size);
range->step_forw = gdk_window_new (range->trough, &attributes, attributes_mask);
- attributes.x = widget->style->klass->ythickness;
+ attributes.x = widget->style->ythickness;
attributes.y = 0;
attributes.width = RANGE_CLASS (widget)->slider_width;
attributes.height = RANGE_CLASS (widget)->min_slider_size;
@@ -279,15 +279,15 @@ gtk_vscrollbar_size_allocate (GtkWidget *widget,
allocation->y,
widget->requisition.width, allocation->height);
gdk_window_move_resize (range->step_back,
- widget->style->klass->xthickness,
- widget->style->klass->ythickness,
- widget->requisition.width - widget->style->klass->xthickness * 2,
+ widget->style->xthickness,
+ widget->style->ythickness,
+ widget->requisition.width - widget->style->xthickness * 2,
RANGE_CLASS (widget)->stepper_size);
gdk_window_move_resize (range->step_forw,
- widget->style->klass->xthickness,
- allocation->height - widget->style->klass->ythickness -
+ widget->style->xthickness,
+ allocation->height - widget->style->ythickness -
RANGE_CLASS (widget)->stepper_size,
- widget->requisition.width - widget->style->klass->xthickness * 2,
+ widget->requisition.width - widget->style->xthickness * 2,
RANGE_CLASS (widget)->stepper_size);
gtk_range_slider_update (GTK_RANGE (widget));
diff --git a/gtk/gtkvseparator.c b/gtk/gtkvseparator.c
index f74bdce46..bf537a1bb 100644
--- a/gtk/gtkvseparator.c
+++ b/gtk/gtkvseparator.c
@@ -71,7 +71,7 @@ gtk_vseparator_class_init (GtkVSeparatorClass *klass)
static void
gtk_vseparator_init (GtkVSeparator *vseparator)
{
- GTK_WIDGET (vseparator)->requisition.width = GTK_WIDGET (vseparator)->style->klass->xthickness;
+ GTK_WIDGET (vseparator)->requisition.width = GTK_WIDGET (vseparator)->style->xthickness;
GTK_WIDGET (vseparator)->requisition.height = 1;
}
@@ -96,7 +96,7 @@ gtk_vseparator_expose (GtkWidget *widget,
widget->allocation.y,
widget->allocation.y + widget->allocation.height,
widget->allocation.x + (widget->allocation.width -
- widget->style->klass->xthickness) / 2);
+ widget->style->xthickness) / 2);
return FALSE;
}
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index ab7a9fd62..1e15a26a8 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -679,7 +679,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
GTK_SIGNAL_OFFSET (GtkWidgetClass, drag_leave),
gtk_marshal_NONE__POINTER_UINT,
GTK_TYPE_NONE, 2,
- GTK_TYPE_GDK_DRAG_CONTEXT,
+ GDK_TYPE_DRAG_CONTEXT,
GTK_TYPE_UINT);
widget_signals[DRAG_BEGIN] =
gtk_signal_new ("drag_begin",
@@ -688,7 +688,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
GTK_SIGNAL_OFFSET (GtkWidgetClass, drag_begin),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
- GTK_TYPE_GDK_DRAG_CONTEXT);
+ GDK_TYPE_DRAG_CONTEXT);
widget_signals[DRAG_END] =
gtk_signal_new ("drag_end",
GTK_RUN_LAST,
@@ -696,7 +696,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
GTK_SIGNAL_OFFSET (GtkWidgetClass, drag_end),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
- GTK_TYPE_GDK_DRAG_CONTEXT);
+ GDK_TYPE_DRAG_CONTEXT);
widget_signals[DRAG_DATA_DELETE] =
gtk_signal_new ("drag_data_delete",
GTK_RUN_LAST,
@@ -704,7 +704,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
GTK_SIGNAL_OFFSET (GtkWidgetClass, drag_data_delete),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1,
- GTK_TYPE_GDK_DRAG_CONTEXT);
+ GDK_TYPE_DRAG_CONTEXT);
widget_signals[DRAG_MOTION] =
gtk_signal_new ("drag_motion",
GTK_RUN_LAST,
@@ -712,7 +712,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
GTK_SIGNAL_OFFSET (GtkWidgetClass, drag_motion),
gtk_marshal_BOOL__POINTER_INT_INT_UINT,
GTK_TYPE_BOOL, 4,
- GTK_TYPE_GDK_DRAG_CONTEXT,
+ GDK_TYPE_DRAG_CONTEXT,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_UINT);
@@ -723,7 +723,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
GTK_SIGNAL_OFFSET (GtkWidgetClass, drag_drop),
gtk_marshal_BOOL__POINTER_INT_INT_UINT,
GTK_TYPE_BOOL, 4,
- GTK_TYPE_GDK_DRAG_CONTEXT,
+ GDK_TYPE_DRAG_CONTEXT,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_UINT);
@@ -734,7 +734,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
GTK_SIGNAL_OFFSET (GtkWidgetClass, drag_data_get),
gtk_marshal_NONE__POINTER_POINTER_UINT_UINT,
GTK_TYPE_NONE, 4,
- GTK_TYPE_GDK_DRAG_CONTEXT,
+ GDK_TYPE_DRAG_CONTEXT,
GTK_TYPE_SELECTION_DATA,
GTK_TYPE_UINT,
GTK_TYPE_UINT);
@@ -745,7 +745,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
GTK_SIGNAL_OFFSET (GtkWidgetClass, drag_data_received),
gtk_marshal_NONE__POINTER_INT_INT_POINTER_UINT_UINT,
GTK_TYPE_NONE, 6,
- GTK_TYPE_GDK_DRAG_CONTEXT,
+ GDK_TYPE_DRAG_CONTEXT,
GTK_TYPE_INT,
GTK_TYPE_INT,
GTK_TYPE_SELECTION_DATA,
@@ -3250,7 +3250,7 @@ gtk_widget_create_pango_layout (GtkWidget *widget)
context = gtk_widget_create_pango_context (widget);
layout = pango_layout_new (context);
- pango_context_unref (context);
+ g_object_unref (G_OBJECT (context));
return layout;
}
@@ -4499,18 +4499,15 @@ static void
gtk_reset_shapes_recurse (GtkWidget *widget,
GdkWindow *window)
{
- GdkWindowPrivate *private;
gpointer data;
GList *list;
- private = (GdkWindowPrivate*) window;
-
gdk_window_get_user_data (window, &data);
if (data != widget)
return;
gdk_window_shape_combine_mask (window, NULL, 0, 0);
- for (list = private->children; list; list = list->next)
+ for (list = gdk_window_peek_children (window); list; list = list->next)
gtk_reset_shapes_recurse (widget, list->data);
}