diff options
author | Matthias Clasen <mclasen@redhat.com> | 2006-05-03 17:07:09 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2006-05-03 17:07:09 +0000 |
commit | e272345b5d41bfe7272f72cccc7073442db49b8d (patch) | |
tree | 9e291c6c4e43d40017560b130607f5d597e66e83 | |
parent | 7f399f19f975dbf667f9df205ca1af3807c80511 (diff) | |
download | gdk-pixbuf-e272345b5d41bfe7272f72cccc7073442db49b8d.tar.gz |
More G_DEFINE_TYPE conversion.
2006-05-03 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkaccessible.c:
* gtk/gtkclipboard.c:
* gtk/gtkfilefilter.c:
* gtk/gtkimmodule.c:
* gtk/gtkmenubar.c: More G_DEFINE_TYPE conversion.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 6 | ||||
-rw-r--r-- | gtk/gtkaccessible.c | 18 | ||||
-rw-r--r-- | gtk/gtkclipboard.c | 22 | ||||
-rw-r--r-- | gtk/gtkfilefilter.c | 22 | ||||
-rw-r--r-- | gtk/gtkimmodule.c | 25 | ||||
-rw-r--r-- | gtk/gtkmenubar.c | 23 |
7 files changed, 39 insertions, 83 deletions
@@ -1,5 +1,11 @@ 2006-05-03 Matthias Clasen <mclasen@redhat.com> + * gtk/gtkaccessible.c: + * gtk/gtkclipboard.c: + * gtk/gtkfilefilter.c: + * gtk/gtkimmodule.c: + * gtk/gtkmenubar.c: More G_DEFINE_TYPE conversion. + * gtk/gtkwidget.c: Make GtkWidget abstract again. 2006-05-02 Matthias Clasen <mclasen@redhat.com> diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 40eb08a47..82cdff6f9 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,11 @@ 2006-05-03 Matthias Clasen <mclasen@redhat.com> + * gtk/gtkaccessible.c: + * gtk/gtkclipboard.c: + * gtk/gtkfilefilter.c: + * gtk/gtkimmodule.c: + * gtk/gtkmenubar.c: More G_DEFINE_TYPE conversion. + * gtk/gtkwidget.c: Make GtkWidget abstract again. 2006-05-02 Matthias Clasen <mclasen@redhat.com> diff --git a/gtk/gtkaccessible.c b/gtk/gtkaccessible.c index 95b022b4d..79a1ad536 100644 --- a/gtk/gtkaccessible.c +++ b/gtk/gtkaccessible.c @@ -25,23 +25,13 @@ #include "gtkaccessible.h" #include "gtkalias.h" -static void gtk_accessible_class_init (GtkAccessibleClass *klass); static void gtk_accessible_real_connect_widget_destroyed (GtkAccessible *accessible); -GType -gtk_accessible_get_type (void) -{ - static GType accessible_type = 0; - - if (!accessible_type) - accessible_type = - g_type_register_static_simple (ATK_TYPE_OBJECT, I_("GtkAccessible"), - sizeof (GtkAccessibleClass), - (GClassInitFunc)gtk_accessible_class_init, - sizeof (GtkAccessible), - NULL, 0); +G_DEFINE_TYPE (GtkAccessible, gtk_accessible, ATK_TYPE_OBJECT); - return accessible_type; +static void +gtk_accessible_init (GtkAccessible *object) +{ } static void diff --git a/gtk/gtkclipboard.c b/gtk/gtkclipboard.c index 3e501294e..ccda4c703 100644 --- a/gtk/gtkclipboard.c +++ b/gtk/gtkclipboard.c @@ -149,23 +149,13 @@ static GQuark request_contents_key_id = 0; static const gchar clipboards_owned_key[] = "gtk-clipboards-owned"; static GQuark clipboards_owned_key_id = 0; -static GObjectClass *parent_class; static guint clipboard_signals[LAST_SIGNAL] = { 0 }; -GType -gtk_clipboard_get_type (void) +G_DEFINE_TYPE (GtkClipboard, gtk_clipboard, G_TYPE_OBJECT); + +static void +gtk_clipboard_init (GtkClipboard *object) { - static GType clipboard_type = 0; - - if (!clipboard_type) - clipboard_type = g_type_register_static_simple (G_TYPE_OBJECT, - I_("GtkClipboard"), - sizeof (GtkClipboardClass), - (GClassInitFunc)gtk_clipboard_class_init, - sizeof (GtkClipboard), - NULL, 0); - - return clipboard_type; } static void @@ -173,8 +163,6 @@ gtk_clipboard_class_init (GtkClipboardClass *class) { GObjectClass *gobject_class = G_OBJECT_CLASS (class); - parent_class = g_type_class_peek_parent (class); - gobject_class->finalize = gtk_clipboard_finalize; class->owner_change = gtk_clipboard_owner_change; @@ -226,7 +214,7 @@ gtk_clipboard_finalize (GObject *object) g_free (clipboard->storable_targets); - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (gtk_clipboard_parent_class)->finalize (object); } static void diff --git a/gtk/gtkfilefilter.c b/gtk/gtkfilefilter.c index 4567da98a..b430a84c3 100644 --- a/gtk/gtkfilefilter.c +++ b/gtk/gtkfilefilter.c @@ -79,24 +79,14 @@ struct _FilterRule } u; }; -static void gtk_file_filter_class_init (GtkFileFilterClass *class); static void gtk_file_filter_finalize (GObject *object); -static GObjectClass *parent_class; -GType -gtk_file_filter_get_type (void) -{ - static GType file_filter_type = 0; - - if (!file_filter_type) - file_filter_type = g_type_register_static_simple (GTK_TYPE_OBJECT, I_("GtkFileFilter"), - sizeof (GtkFileFilterClass), - (GClassInitFunc)gtk_file_filter_class_init, - sizeof (GtkFileFilter), - NULL, 0); +G_DEFINE_TYPE (GtkFileFilter, gtk_file_filter, GTK_TYPE_OBJECT); - return file_filter_type; +static void +gtk_file_filter_init (GtkFileFilter *object) +{ } static void @@ -104,8 +94,6 @@ gtk_file_filter_class_init (GtkFileFilterClass *class) { GObjectClass *gobject_class = G_OBJECT_CLASS (class); - parent_class = g_type_class_peek_parent (class); - gobject_class->finalize = gtk_file_filter_finalize; } @@ -145,7 +133,7 @@ gtk_file_filter_finalize (GObject *object) if (filter->name) g_free (filter->name); - parent_class->finalize (object); + G_OBJECT_CLASS (gtk_file_filter_parent_class)->finalize (object); } /** diff --git a/gtk/gtkimmodule.c b/gtk/gtkimmodule.c index 618e2f949..3b126e8f4 100644 --- a/gtk/gtkimmodule.c +++ b/gtk/gtkimmodule.c @@ -154,6 +154,8 @@ gtk_im_module_finalize (GObject *object) parent_class->finalize (object); } +G_DEFINE_TYPE (GtkIMModule, gtk_im_module, G_TYPE_TYPE_MODULE); + static void gtk_im_module_class_init (GtkIMModuleClass *class) { @@ -168,20 +170,9 @@ gtk_im_module_class_init (GtkIMModuleClass *class) gobject_class->finalize = gtk_im_module_finalize; } -static GType -gtk_im_module_get_type (void) +static void +gtk_im_module_init (GtkIMModule* object) { - static GType im_module_type = 0; - - if (!im_module_type) - im_module_type = - g_type_register_static_simple (G_TYPE_TYPE_MODULE, I_("GtkIMModule"), - sizeof (GtkIMModuleClass), - (GClassInitFunc)gtk_im_module_class_init, - sizeof (GtkIMModule), - NULL, 0); - - return im_module_type; } static void @@ -260,7 +251,7 @@ correct_libdir_prefix (gchar **path) static void -gtk_im_module_init (void) +gtk_im_module_initialize (void) { GString *line_buf = g_string_new (NULL); GString *tmp_buf = g_string_new (NULL); @@ -424,7 +415,7 @@ _gtk_im_module_list (const GtkIMContextInfo ***contexts, }; if (!contexts_hash) - gtk_im_module_init (); + gtk_im_module_initialize (); if (n_contexts) *n_contexts = (n_loaded_contexts + 1); @@ -471,7 +462,7 @@ _gtk_im_module_create (const gchar *context_id) GtkIMContext *context = NULL; if (!contexts_hash) - gtk_im_module_init (); + gtk_im_module_initialize (); if (strcmp (context_id, SIMPLE_ID) != 0) { @@ -545,7 +536,7 @@ _gtk_im_module_get_default_context_id (const gchar *locale) const gchar *envvar; if (!contexts_hash) - gtk_im_module_init (); + gtk_im_module_initialize (); envvar = g_getenv ("GTK_IM_MODULE"); if (envvar && diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c index 5df2c725e..9b6e72553 100644 --- a/gtk/gtkmenubar.c +++ b/gtk/gtkmenubar.c @@ -87,22 +87,11 @@ static void gtk_menu_bar_move_current (GtkMenuShell *menu_shell, static GtkShadowType get_shadow_type (GtkMenuBar *menubar); -static GtkMenuShellClass *parent_class = NULL; +G_DEFINE_TYPE (GtkMenuBar, gtk_menu_bar, GTK_TYPE_MENU_SHELL); -GType -gtk_menu_bar_get_type (void) +static void +gtk_menu_bar_init (GtkMenuBar *object) { - static GType menu_bar_type = 0; - - if (!menu_bar_type) - menu_bar_type = g_type_register_static_simple (GTK_TYPE_MENU_SHELL, - I_("GtkMenuBar"), - sizeof (GtkMenuBarClass), - gtk_menu_bar_class_init, - sizeof (GtkMenuBar), - NULL, 0); - - return menu_bar_type; } static void @@ -114,8 +103,6 @@ gtk_menu_bar_class_init (GtkMenuBarClass *class) GtkBindingSet *binding_set; - parent_class = g_type_class_peek_parent (class); - gobject_class = (GObjectClass*) class; widget_class = (GtkWidgetClass*) class; menu_shell_class = (GtkMenuShellClass*) class; @@ -551,7 +538,7 @@ gtk_menu_bar_expose (GtkWidget *widget, { gtk_menu_bar_paint (widget, &event->area); - (* GTK_WIDGET_CLASS (parent_class)->expose_event) (widget, event); + (* GTK_WIDGET_CLASS (gtk_menu_bar_parent_class)->expose_event) (widget, event); } return FALSE; @@ -839,7 +826,7 @@ gtk_menu_bar_move_current (GtkMenuShell *menu_shell, } } - GTK_MENU_SHELL_CLASS (parent_class)->move_current (menu_shell, direction); + GTK_MENU_SHELL_CLASS (gtk_menu_bar_parent_class)->move_current (menu_shell, direction); } /** |