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.
This commit is contained in:
Matthias Clasen 2006-05-03 17:07:09 +00:00 committed by Matthias Clasen
parent 7f399f19f9
commit e272345b5d
7 changed files with 39 additions and 83 deletions

View File

@ -1,5 +1,11 @@
2006-05-03 Matthias Clasen <mclasen@redhat.com> 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. * gtk/gtkwidget.c: Make GtkWidget abstract again.
2006-05-02 Matthias Clasen <mclasen@redhat.com> 2006-05-02 Matthias Clasen <mclasen@redhat.com>

View File

@ -1,5 +1,11 @@
2006-05-03 Matthias Clasen <mclasen@redhat.com> 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. * gtk/gtkwidget.c: Make GtkWidget abstract again.
2006-05-02 Matthias Clasen <mclasen@redhat.com> 2006-05-02 Matthias Clasen <mclasen@redhat.com>

View File

@ -25,23 +25,13 @@
#include "gtkaccessible.h" #include "gtkaccessible.h"
#include "gtkalias.h" #include "gtkalias.h"
static void gtk_accessible_class_init (GtkAccessibleClass *klass);
static void gtk_accessible_real_connect_widget_destroyed (GtkAccessible *accessible); static void gtk_accessible_real_connect_widget_destroyed (GtkAccessible *accessible);
GType G_DEFINE_TYPE (GtkAccessible, gtk_accessible, ATK_TYPE_OBJECT);
gtk_accessible_get_type (void)
static void
gtk_accessible_init (GtkAccessible *object)
{ {
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);
return accessible_type;
} }
static void static void

View File

@ -149,23 +149,13 @@ static GQuark request_contents_key_id = 0;
static const gchar clipboards_owned_key[] = "gtk-clipboards-owned"; static const gchar clipboards_owned_key[] = "gtk-clipboards-owned";
static GQuark clipboards_owned_key_id = 0; static GQuark clipboards_owned_key_id = 0;
static GObjectClass *parent_class;
static guint clipboard_signals[LAST_SIGNAL] = { 0 }; static guint clipboard_signals[LAST_SIGNAL] = { 0 };
GType G_DEFINE_TYPE (GtkClipboard, gtk_clipboard, G_TYPE_OBJECT);
gtk_clipboard_get_type (void)
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 static void
@ -173,8 +163,6 @@ gtk_clipboard_class_init (GtkClipboardClass *class)
{ {
GObjectClass *gobject_class = G_OBJECT_CLASS (class); GObjectClass *gobject_class = G_OBJECT_CLASS (class);
parent_class = g_type_class_peek_parent (class);
gobject_class->finalize = gtk_clipboard_finalize; gobject_class->finalize = gtk_clipboard_finalize;
class->owner_change = gtk_clipboard_owner_change; class->owner_change = gtk_clipboard_owner_change;
@ -226,7 +214,7 @@ gtk_clipboard_finalize (GObject *object)
g_free (clipboard->storable_targets); g_free (clipboard->storable_targets);
G_OBJECT_CLASS (parent_class)->finalize (object); G_OBJECT_CLASS (gtk_clipboard_parent_class)->finalize (object);
} }
static void static void

View File

@ -79,24 +79,14 @@ struct _FilterRule
} u; } u;
}; };
static void gtk_file_filter_class_init (GtkFileFilterClass *class);
static void gtk_file_filter_finalize (GObject *object); static void gtk_file_filter_finalize (GObject *object);
static GObjectClass *parent_class;
GType G_DEFINE_TYPE (GtkFileFilter, gtk_file_filter, GTK_TYPE_OBJECT);
gtk_file_filter_get_type (void)
static void
gtk_file_filter_init (GtkFileFilter *object)
{ {
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);
return file_filter_type;
} }
static void static void
@ -104,8 +94,6 @@ gtk_file_filter_class_init (GtkFileFilterClass *class)
{ {
GObjectClass *gobject_class = G_OBJECT_CLASS (class); GObjectClass *gobject_class = G_OBJECT_CLASS (class);
parent_class = g_type_class_peek_parent (class);
gobject_class->finalize = gtk_file_filter_finalize; gobject_class->finalize = gtk_file_filter_finalize;
} }
@ -145,7 +133,7 @@ gtk_file_filter_finalize (GObject *object)
if (filter->name) if (filter->name)
g_free (filter->name); g_free (filter->name);
parent_class->finalize (object); G_OBJECT_CLASS (gtk_file_filter_parent_class)->finalize (object);
} }
/** /**

View File

@ -154,6 +154,8 @@ gtk_im_module_finalize (GObject *object)
parent_class->finalize (object); parent_class->finalize (object);
} }
G_DEFINE_TYPE (GtkIMModule, gtk_im_module, G_TYPE_TYPE_MODULE);
static void static void
gtk_im_module_class_init (GtkIMModuleClass *class) 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; gobject_class->finalize = gtk_im_module_finalize;
} }
static GType static void
gtk_im_module_get_type (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 static void
@ -260,7 +251,7 @@ correct_libdir_prefix (gchar **path)
static void static void
gtk_im_module_init (void) gtk_im_module_initialize (void)
{ {
GString *line_buf = g_string_new (NULL); GString *line_buf = g_string_new (NULL);
GString *tmp_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) if (!contexts_hash)
gtk_im_module_init (); gtk_im_module_initialize ();
if (n_contexts) if (n_contexts)
*n_contexts = (n_loaded_contexts + 1); *n_contexts = (n_loaded_contexts + 1);
@ -471,7 +462,7 @@ _gtk_im_module_create (const gchar *context_id)
GtkIMContext *context = NULL; GtkIMContext *context = NULL;
if (!contexts_hash) if (!contexts_hash)
gtk_im_module_init (); gtk_im_module_initialize ();
if (strcmp (context_id, SIMPLE_ID) != 0) if (strcmp (context_id, SIMPLE_ID) != 0)
{ {
@ -545,7 +536,7 @@ _gtk_im_module_get_default_context_id (const gchar *locale)
const gchar *envvar; const gchar *envvar;
if (!contexts_hash) if (!contexts_hash)
gtk_im_module_init (); gtk_im_module_initialize ();
envvar = g_getenv ("GTK_IM_MODULE"); envvar = g_getenv ("GTK_IM_MODULE");
if (envvar && if (envvar &&

View File

@ -87,22 +87,11 @@ static void gtk_menu_bar_move_current (GtkMenuShell *menu_shell,
static GtkShadowType get_shadow_type (GtkMenuBar *menubar); static GtkShadowType get_shadow_type (GtkMenuBar *menubar);
static GtkMenuShellClass *parent_class = NULL; G_DEFINE_TYPE (GtkMenuBar, gtk_menu_bar, GTK_TYPE_MENU_SHELL);
GType static void
gtk_menu_bar_get_type (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 static void
@ -114,8 +103,6 @@ gtk_menu_bar_class_init (GtkMenuBarClass *class)
GtkBindingSet *binding_set; GtkBindingSet *binding_set;
parent_class = g_type_class_peek_parent (class);
gobject_class = (GObjectClass*) class; gobject_class = (GObjectClass*) class;
widget_class = (GtkWidgetClass*) class; widget_class = (GtkWidgetClass*) class;
menu_shell_class = (GtkMenuShellClass*) class; menu_shell_class = (GtkMenuShellClass*) class;
@ -551,7 +538,7 @@ gtk_menu_bar_expose (GtkWidget *widget,
{ {
gtk_menu_bar_paint (widget, &event->area); 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; 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);
} }
/** /**