[Xfce4-commits] <thunar:master> First flow of using G_DEFINE_ macros.
Nick Schermer
nick at xfce.org
Fri Aug 21 23:42:01 CEST 2009
Updating branch refs/heads/master
to 445810287e9b0842920d6d421208ef70a6dad455 (commit)
from f074d6cc730ca77617b94723a9bf7d3793554c19 (commit)
commit 445810287e9b0842920d6d421208ef70a6dad455
Author: Nick Schermer <nick at xfce.org>
Date: Fri Aug 21 23:22:55 2009 +0200
First flow of using G_DEFINE_ macros.
thunar/thunar-abstract-dialog.c | 35 ++++-------------
thunar/thunar-abstract-icon-view.c | 36 +-----------------
thunar/thunar-application.c | 37 +-----------------
thunar/thunar-browser.c | 2 +-
thunar/thunar-chooser-button.c | 36 +-----------------
thunar/thunar-chooser-dialog.c | 36 +-----------------
thunar/thunar-chooser-model.c | 37 +-----------------
thunar/thunar-clipboard-manager.c | 37 +-----------------
thunar/thunar-column-editor.c | 36 +-----------------
thunar/thunar-column-model.c | 44 +--------------------
thunar/thunar-compact-view.c | 36 +-----------------
thunar/thunar-create-dialog.c | 28 +-------------
thunar/thunar-dbus-service.c | 36 +-----------------
thunar/thunar-deep-count-job.c | 27 +------------
thunar/thunar-details-view.c | 34 +----------------
thunar/thunar-emblem-chooser.c | 36 +-----------------
thunar/thunar-file-monitor.c | 38 ++++---------------
thunar/thunar-file.c | 45 ++++------------------
thunar/thunar-folder.c | 37 +-----------------
thunar/thunar-history-action.c | 35 ++++-------------
thunar/thunar-history.c | 45 +---------------------
thunar/thunar-icon-factory.c | 41 ++------------------
thunar/thunar-icon-renderer.c | 36 +-----------------
thunar/thunar-icon-view.c | 36 +-----------------
thunar/thunar-job.c | 24 +-----------
thunar/thunar-launcher.c | 62 ++----------------------------
thunar/thunar-list-model.c | 62 ++----------------------------
thunar/thunar-location-button.c | 35 +----------------
thunar/thunar-location-buttons.c | 61 ++----------------------------
thunar/thunar-location-dialog.c | 38 ++++---------------
thunar/thunar-location-entry.c | 72 ++---------------------------------
31 files changed, 99 insertions(+), 1101 deletions(-)
diff --git a/thunar/thunar-abstract-dialog.c b/thunar/thunar-abstract-dialog.c
index bf0279f..ee0e51d 100644
--- a/thunar/thunar-abstract-dialog.c
+++ b/thunar/thunar-abstract-dialog.c
@@ -27,37 +27,11 @@
-static void thunar_abstract_dialog_class_init (ThunarAbstractDialogClass *klass);
static void thunar_abstract_dialog_close (GtkDialog *dialog);
-GType
-thunar_abstract_dialog_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarAbstractDialogClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_abstract_dialog_class_init,
- NULL,
- NULL,
- sizeof (ThunarAbstractDialog),
- 0,
- NULL,
- NULL,
- };
-
- type = g_type_register_static (GTK_TYPE_DIALOG, I_("ThunarAbstractDialog"), &info, G_TYPE_FLAG_ABSTRACT);
- }
-
- return type;
-}
+G_DEFINE_ABSTRACT_TYPE (ThunarAbstractDialog, thunar_abstract_dialog, GTK_TYPE_DIALOG)
@@ -79,6 +53,13 @@ thunar_abstract_dialog_class_init (ThunarAbstractDialogClass *klass)
static void
+thunar_abstract_dialog_init (ThunarAbstractDialog *dialog)
+{
+}
+
+
+
+static void
thunar_abstract_dialog_close (GtkDialog *dialog)
{
GdkEvent *event;
diff --git a/thunar/thunar-abstract-icon-view.c b/thunar/thunar-abstract-icon-view.c
index 7c42375..b2f3164 100644
--- a/thunar/thunar-abstract-icon-view.c
+++ b/thunar/thunar-abstract-icon-view.c
@@ -35,8 +35,6 @@
-static void thunar_abstract_icon_view_class_init (ThunarAbstractIconViewClass *klass);
-static void thunar_abstract_icon_view_init (ThunarAbstractIconView *abstract_icon_view);
static void thunar_abstract_icon_view_style_set (GtkWidget *widget,
GtkStyle *previous_style);
static void thunar_abstract_icon_view_connect_ui_manager (ThunarStandardView *standard_view,
@@ -133,36 +131,7 @@ static const GtkRadioActionEntry order_action_entries[] =
-static GObjectClass *thunar_abstract_icon_view_parent_class;
-
-
-
-GType
-thunar_abstract_icon_view_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarAbstractIconViewClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_abstract_icon_view_class_init,
- NULL,
- NULL,
- sizeof (ThunarAbstractIconView),
- 0,
- (GInstanceInitFunc) thunar_abstract_icon_view_init,
- NULL,
- };
-
- type = g_type_register_static (THUNAR_TYPE_STANDARD_VIEW, I_("ThunarAbstractIconView"), &info, G_TYPE_FLAG_ABSTRACT);
- }
-
- return type;
-}
+G_DEFINE_ABSTRACT_TYPE (ThunarAbstractIconView, thunar_abstract_icon_view, THUNAR_TYPE_STANDARD_VIEW)
@@ -175,9 +144,6 @@ thunar_abstract_icon_view_class_init (ThunarAbstractIconViewClass *klass)
/* add private data to the instance type */
g_type_class_add_private (klass, sizeof (ThunarAbstractIconViewPrivate));
- /* determine the parent type class */
- thunar_abstract_icon_view_parent_class = g_type_class_peek_parent (klass);
-
gtkwidget_class = GTK_WIDGET_CLASS (klass);
gtkwidget_class->style_set = thunar_abstract_icon_view_style_set;
diff --git a/thunar/thunar-application.c b/thunar/thunar-application.c
index 239f4da..2d0daf3 100644
--- a/thunar/thunar-application.c
+++ b/thunar/thunar-application.c
@@ -64,8 +64,6 @@ enum
-static void thunar_application_class_init (ThunarApplicationClass *klass);
-static void thunar_application_init (ThunarApplication *application);
static void thunar_application_finalize (GObject *object);
static void thunar_application_get_property (GObject *object,
guint prop_id,
@@ -141,38 +139,12 @@ struct _ThunarApplication
-static GObjectClass *thunar_application_parent_class;
-static GQuark thunar_application_screen_quark;
-static GQuark thunar_application_startup_id_quark;
+static GQuark thunar_application_screen_quark;
+static GQuark thunar_application_startup_id_quark;
-GType
-thunar_application_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarApplicationClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_application_class_init,
- NULL,
- NULL,
- sizeof (ThunarApplication),
- 0,
- (GInstanceInitFunc) thunar_application_init,
- NULL,
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, I_("ThunarApplication"), &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (ThunarApplication, thunar_application, G_TYPE_OBJECT)
@@ -187,9 +159,6 @@ thunar_application_class_init (ThunarApplicationClass *klass)
thunar_application_startup_id_quark =
g_quark_from_static_string ("thunar-application-startup-id");
- /* determine the parent type class */
- thunar_application_parent_class = g_type_class_peek_parent (klass);
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunar_application_finalize;
gobject_class->get_property = thunar_application_get_property;
diff --git a/thunar/thunar-browser.c b/thunar/thunar-browser.c
index 75ea0b7..12ae250 100644
--- a/thunar/thunar-browser.c
+++ b/thunar/thunar-browser.c
@@ -62,7 +62,7 @@ thunar_browser_get_type (void)
if (G_UNLIKELY (type == G_TYPE_INVALID))
{
type = g_type_register_static_simple (G_TYPE_INTERFACE,
- "ThunarBrowser",
+ I_("ThunarBrowser"),
sizeof (ThunarBrowserIface),
NULL,
0,
diff --git a/thunar/thunar-chooser-button.c b/thunar/thunar-chooser-button.c
index 92e7661..ab8db20 100644
--- a/thunar/thunar-chooser-button.c
+++ b/thunar/thunar-chooser-button.c
@@ -42,8 +42,6 @@ enum
-static void thunar_chooser_button_class_init (ThunarChooserButtonClass *klass);
-static void thunar_chooser_button_init (ThunarChooserButton *chooser_button);
static void thunar_chooser_button_finalize (GObject *object);
static void thunar_chooser_button_get_property (GObject *object,
guint prop_id,
@@ -81,36 +79,7 @@ struct _ThunarChooserButton
-static GObjectClass *thunar_chooser_button_parent_class;
-
-
-
-GType
-thunar_chooser_button_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarChooserButtonClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_chooser_button_class_init,
- NULL,
- NULL,
- sizeof (ThunarChooserButton),
- 0,
- (GInstanceInitFunc) thunar_chooser_button_init,
- NULL,
- };
-
- type = g_type_register_static (GTK_TYPE_HBOX, I_("ThunarChooserButton"), &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (ThunarChooserButton, thunar_chooser_button, GTK_TYPE_HBOX)
@@ -119,9 +88,6 @@ thunar_chooser_button_class_init (ThunarChooserButtonClass *klass)
{
GObjectClass *gobject_class;
- /* determine the parent type class */
- thunar_chooser_button_parent_class = g_type_class_peek_parent (klass);
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunar_chooser_button_finalize;
gobject_class->get_property = thunar_chooser_button_get_property;
diff --git a/thunar/thunar-chooser-dialog.c b/thunar/thunar-chooser-dialog.c
index d1a29b8..fda109d 100644
--- a/thunar/thunar-chooser-dialog.c
+++ b/thunar/thunar-chooser-dialog.c
@@ -51,8 +51,6 @@ enum
-static void thunar_chooser_dialog_class_init (ThunarChooserDialogClass *klass);
-static void thunar_chooser_dialog_init (ThunarChooserDialog *dialog);
static void thunar_chooser_dialog_dispose (GObject *object);
static void thunar_chooser_dialog_get_property (GObject *object,
guint prop_id,
@@ -121,36 +119,7 @@ struct _ThunarChooserDialog
-static GObjectClass *thunar_chooser_dialog_parent_class;
-
-
-
-GType
-thunar_chooser_dialog_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarChooserDialogClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_chooser_dialog_class_init,
- NULL,
- NULL,
- sizeof (ThunarChooserDialog),
- 0,
- (GInstanceInitFunc) thunar_chooser_dialog_init,
- NULL,
- };
-
- type = g_type_register_static (THUNAR_TYPE_ABSTRACT_DIALOG, I_("ThunarChooserDialog"), &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (ThunarChooserDialog, thunar_chooser_dialog, THUNAR_TYPE_ABSTRACT_DIALOG)
@@ -161,9 +130,6 @@ thunar_chooser_dialog_class_init (ThunarChooserDialogClass *klass)
GtkWidgetClass *gtkwidget_class;
GObjectClass *gobject_class;
- /* determine the parent type class */
- thunar_chooser_dialog_parent_class = g_type_class_peek_parent (klass);
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->dispose = thunar_chooser_dialog_dispose;
gobject_class->get_property = thunar_chooser_dialog_get_property;
diff --git a/thunar/thunar-chooser-model.c b/thunar/thunar-chooser-model.c
index 14f789f..ad9b37a 100644
--- a/thunar/thunar-chooser-model.c
+++ b/thunar/thunar-chooser-model.c
@@ -45,8 +45,7 @@ enum
-static void thunar_chooser_model_class_init (ThunarChooserModelClass *klass);
-static void thunar_chooser_model_init (ThunarChooserModel *model);
+
static void thunar_chooser_model_constructed (GObject *object);
static void thunar_chooser_model_finalize (GObject *object);
static void thunar_chooser_model_get_property (GObject *object,
@@ -75,36 +74,7 @@ struct _ThunarChooserModel
-static GObjectClass *thunar_chooser_model_parent_class;
-
-
-
-GType
-thunar_chooser_model_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarChooserModelClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_chooser_model_class_init,
- NULL,
- NULL,
- sizeof (ThunarChooserModel),
- 0,
- (GInstanceInitFunc) thunar_chooser_model_init,
- NULL,
- };
-
- type = g_type_register_static (GTK_TYPE_TREE_STORE, I_("ThunarChooserModel"), &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (ThunarChooserModel, thunar_chooser_model, GTK_TYPE_TREE_STORE)
@@ -113,9 +83,6 @@ thunar_chooser_model_class_init (ThunarChooserModelClass *klass)
{
GObjectClass *gobject_class;
- /* determine the parent type class */
- thunar_chooser_model_parent_class = g_type_class_peek_parent (klass);
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunar_chooser_model_finalize;
gobject_class->constructed = thunar_chooser_model_constructed;
diff --git a/thunar/thunar-clipboard-manager.c b/thunar/thunar-clipboard-manager.c
index adc9dc6..ee91391 100644
--- a/thunar/thunar-clipboard-manager.c
+++ b/thunar/thunar-clipboard-manager.c
@@ -57,8 +57,6 @@ enum
-static void thunar_clipboard_manager_class_init (ThunarClipboardManagerClass *klass);
-static void thunar_clipboard_manager_init (ThunarClipboardManager *manager);
static void thunar_clipboard_manager_finalize (GObject *object);
static void thunar_clipboard_manager_get_property (GObject *object,
guint prop_id,
@@ -122,38 +120,12 @@ static const GtkTargetEntry clipboard_targets[] =
{ "UTF8_STRING", 0, TARGET_UTF8_STRING }
};
-static GObjectClass *thunar_clipboard_manager_parent_class;
-static GQuark thunar_clipboard_manager_quark = 0;
-static guint manager_signals[LAST_SIGNAL];
+static GQuark thunar_clipboard_manager_quark = 0;
+static guint manager_signals[LAST_SIGNAL];
-GType
-thunar_clipboard_manager_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarClipboardManagerClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_clipboard_manager_class_init,
- NULL,
- NULL,
- sizeof (ThunarClipboardManager),
- 0,
- (GInstanceInitFunc) thunar_clipboard_manager_init,
- NULL,
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, I_("ThunarClipboardManager"), &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (ThunarClipboardManager, thunar_clipboard_manager, G_TYPE_OBJECT)
@@ -162,9 +134,6 @@ thunar_clipboard_manager_class_init (ThunarClipboardManagerClass *klass)
{
GObjectClass *gobject_class;
- /* determine the parent type class */
- thunar_clipboard_manager_parent_class = g_type_class_peek_parent (klass);
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunar_clipboard_manager_finalize;
gobject_class->get_property = thunar_clipboard_manager_get_property;
diff --git a/thunar/thunar-column-editor.c b/thunar/thunar-column-editor.c
index 3b6fa0a..9c53d4d 100644
--- a/thunar/thunar-column-editor.c
+++ b/thunar/thunar-column-editor.c
@@ -31,8 +31,6 @@
-static void thunar_column_editor_class_init (ThunarColumnEditorClass *klass);
-static void thunar_column_editor_init (ThunarColumnEditor *column_editor);
static void thunar_column_editor_finalize (GObject *object);
static void thunar_column_editor_help_clicked (GtkWidget *button,
ThunarColumnEditor *column_editor);
@@ -73,36 +71,7 @@ struct _ThunarColumnEditor
-static GObjectClass *thunar_column_editor_parent_class;
-
-
-
-GType
-thunar_column_editor_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarColumnEditorClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_column_editor_class_init,
- NULL,
- NULL,
- sizeof (ThunarColumnEditor),
- 0,
- (GInstanceInitFunc) thunar_column_editor_init,
- NULL,
- };
-
- type = g_type_register_static (THUNAR_TYPE_ABSTRACT_DIALOG, I_("ThunarColumnEditor"), &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (ThunarColumnEditor, thunar_column_editor, THUNAR_TYPE_ABSTRACT_DIALOG)
@@ -111,9 +80,6 @@ thunar_column_editor_class_init (ThunarColumnEditorClass *klass)
{
GObjectClass *gobject_class;
- /* determine the parent type class */
- thunar_column_editor_parent_class = g_type_class_peek_parent (klass);
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunar_column_editor_finalize;
}
diff --git a/thunar/thunar-column-model.c b/thunar/thunar-column-model.c
index 3961ce4..7eb4724 100644
--- a/thunar/thunar-column-model.c
+++ b/thunar/thunar-column-model.c
@@ -40,9 +40,7 @@ enum
-static void thunar_column_model_class_init (ThunarColumnModelClass *klass);
static void thunar_column_model_tree_model_init (GtkTreeModelIface *iface);
-static void thunar_column_model_init (ThunarColumnModel *column_model);
static void thunar_column_model_finalize (GObject *object);
static GtkTreeModelFlags thunar_column_model_get_flags (GtkTreeModel *tree_model);
static gint thunar_column_model_get_n_columns (GtkTreeModel *tree_model);
@@ -119,45 +117,12 @@ struct _ThunarColumnModel
-static GObjectClass *thunar_column_model_parent_class;
-static guint column_model_signals[LAST_SIGNAL];
+static guint column_model_signals[LAST_SIGNAL];
-GType
-thunar_column_model_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarColumnModelClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_column_model_class_init,
- NULL,
- NULL,
- sizeof (ThunarColumnModel),
- 0,
- (GInstanceInitFunc) thunar_column_model_init,
- NULL,
- };
-
- static const GInterfaceInfo tree_model_info =
- {
- (GInterfaceInitFunc) thunar_column_model_tree_model_init,
- NULL,
- NULL,
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, I_("ThunarColumnModel"), &info, 0);
- g_type_add_interface_static (type, GTK_TYPE_TREE_MODEL, &tree_model_info);
- }
-
- return type;
-}
+G_DEFINE_TYPE_WITH_CODE (ThunarColumnModel, thunar_column_model, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL, thunar_column_model_tree_model_init))
@@ -166,9 +131,6 @@ thunar_column_model_class_init (ThunarColumnModelClass *klass)
{
GObjectClass *gobject_class;
- /* determine the parent type class */
- thunar_column_model_parent_class = g_type_class_peek_parent (klass);
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunar_column_model_finalize;
diff --git a/thunar/thunar-compact-view.c b/thunar/thunar-compact-view.c
index 7e95f4a..68d1473 100644
--- a/thunar/thunar-compact-view.c
+++ b/thunar/thunar-compact-view.c
@@ -25,8 +25,6 @@
-static void thunar_compact_view_class_init (ThunarCompactViewClass *klass);
-static void thunar_compact_view_init (ThunarCompactView *compact_view);
static AtkObject *thunar_compact_view_get_accessible (GtkWidget *widget);
@@ -43,36 +41,7 @@ struct _ThunarCompactView
-static GObjectClass *thunar_compact_view_parent_class;
-
-
-
-GType
-thunar_compact_view_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarCompactViewClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_compact_view_class_init,
- NULL,
- NULL,
- sizeof (ThunarCompactView),
- 0,
- (GInstanceInitFunc) thunar_compact_view_init,
- NULL,
- };
-
- type = g_type_register_static (THUNAR_TYPE_ABSTRACT_ICON_VIEW, I_("ThunarCompactView"), &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (ThunarCompactView, thunar_compact_view, THUNAR_TYPE_ABSTRACT_ICON_VIEW)
@@ -82,9 +51,6 @@ thunar_compact_view_class_init (ThunarCompactViewClass *klass)
ThunarStandardViewClass *thunarstandard_view_class;
GtkWidgetClass *gtkwidget_class;
- /* determine the parent type class */
- thunar_compact_view_parent_class = g_type_class_peek_parent (klass);
-
gtkwidget_class = GTK_WIDGET_CLASS (klass);
gtkwidget_class->get_accessible = thunar_compact_view_get_accessible;
diff --git a/thunar/thunar-create-dialog.c b/thunar/thunar-create-dialog.c
index 591f792..8698e80 100644
--- a/thunar/thunar-create-dialog.c
+++ b/thunar/thunar-create-dialog.c
@@ -42,8 +42,6 @@ enum
-static void thunar_create_dialog_class_init (ThunarCreateDialogClass *klass);
-static void thunar_create_dialog_init (ThunarCreateDialog *dialog);
static void thunar_create_dialog_dispose (GObject *object);
static void thunar_create_dialog_get_property (GObject *object,
guint prop_id,
@@ -77,28 +75,7 @@ struct _ThunarCreateDialog
-static GObjectClass *thunar_create_dialog_parent_class;
-
-
-
-GType
-thunar_create_dialog_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- type = g_type_register_static_simple (THUNAR_TYPE_ABSTRACT_DIALOG,
- I_("ThunarCreateDialog"),
- sizeof (ThunarCreateDialogClass),
- (GClassInitFunc) thunar_create_dialog_class_init,
- sizeof (ThunarCreateDialog),
- (GInstanceInitFunc) thunar_create_dialog_init,
- 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (ThunarCreateDialog, thunar_create_dialog, THUNAR_TYPE_ABSTRACT_DIALOG)
@@ -108,9 +85,6 @@ thunar_create_dialog_class_init (ThunarCreateDialogClass *klass)
GtkWidgetClass *gtkwidget_class;
GObjectClass *gobject_class;
- /* determine the parent type class */
- thunar_create_dialog_parent_class = g_type_class_peek_parent (klass);
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->dispose = thunar_create_dialog_dispose;
gobject_class->get_property = thunar_create_dialog_get_property;
diff --git a/thunar/thunar-dbus-service.c b/thunar/thunar-dbus-service.c
index 7841330..4e164f2 100644
--- a/thunar/thunar-dbus-service.c
+++ b/thunar/thunar-dbus-service.c
@@ -46,8 +46,6 @@
-static void thunar_dbus_service_class_init (ThunarDBusServiceClass *klass);
-static void thunar_dbus_service_init (ThunarDBusService *dbus_service);
static void thunar_dbus_service_finalize (GObject *object);
static gboolean thunar_dbus_service_connect_trash_bin (ThunarDBusService *dbus_service,
GError **error);
@@ -135,36 +133,7 @@ struct _ThunarDBusService
-static GObjectClass *thunar_dbus_service_parent_class;
-
-
-
-GType
-thunar_dbus_service_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarDBusServiceClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_dbus_service_class_init,
- NULL,
- NULL,
- sizeof (ThunarDBusService),
- 0,
- (GInstanceInitFunc) thunar_dbus_service_init,
- NULL,
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, I_("ThunarDBusService"), &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (ThunarDBusService, thunar_dbus_service, G_TYPE_OBJECT)
@@ -173,9 +142,6 @@ thunar_dbus_service_class_init (ThunarDBusServiceClass *klass)
{
GObjectClass *gobject_class;
- /* determine the parent type class */
- thunar_dbus_service_parent_class = g_type_class_peek_parent (klass);
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunar_dbus_service_finalize;
diff --git a/thunar/thunar-deep-count-job.c b/thunar/thunar-deep-count-job.c
index 8d519de..93688c8 100644
--- a/thunar/thunar-deep-count-job.c
+++ b/thunar/thunar-deep-count-job.c
@@ -42,8 +42,6 @@ enum
-static void thunar_deep_count_job_class_init (ThunarDeepCountJobClass *klass);
-static void thunar_deep_count_job_init (ThunarDeepCountJob *job);
static void thunar_deep_count_job_finalize (GObject *object);
static gboolean thunar_deep_count_job_execute (ExoJob *job,
GError **error);
@@ -81,29 +79,11 @@ struct _ThunarDeepCountJob
-static GObjectClass *thunar_deep_count_job_parent_class = NULL;
-static guint deep_count_signals[LAST_SIGNAL];
+static guint deep_count_signals[LAST_SIGNAL];
-GType
-thunar_deep_count_job_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- type = g_type_register_static_simple (THUNAR_TYPE_JOB,
- "ThunarDeepCountJob",
- sizeof (ThunarDeepCountJobClass),
- (GClassInitFunc) thunar_deep_count_job_class_init,
- sizeof (ThunarDeepCountJob),
- (GInstanceInitFunc) thunar_deep_count_job_init,
- 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (ThunarDeepCountJob, thunar_deep_count_job, THUNAR_TYPE_JOB)
@@ -113,9 +93,6 @@ thunar_deep_count_job_class_init (ThunarDeepCountJobClass *klass)
ExoJobClass *job_class;
GObjectClass *gobject_class;
- /* Determine the parent type class */
- thunar_deep_count_job_parent_class = g_type_class_peek_parent (klass);
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunar_deep_count_job_finalize;
diff --git a/thunar/thunar-details-view.c b/thunar/thunar-details-view.c
index 7a30871..09b9429 100644
--- a/thunar/thunar-details-view.c
+++ b/thunar/thunar-details-view.c
@@ -41,8 +41,6 @@ enum
-static void thunar_details_view_class_init (ThunarDetailsViewClass *klass);
-static void thunar_details_view_init (ThunarDetailsView *details_view);
static void thunar_details_view_finalize (GObject *object);
static void thunar_details_view_get_property (GObject *object,
guint prop_id,
@@ -131,36 +129,9 @@ static const GtkActionEntry action_entries[] =
{ "setup-columns", NULL, N_ ("Configure _Columns..."), NULL, N_ ("Configure the columns in the detailed list view"), G_CALLBACK (thunar_details_view_action_setup_columns), },
};
-static GObjectClass *thunar_details_view_parent_class;
-
-GType
-thunar_details_view_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarDetailsViewClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_details_view_class_init,
- NULL,
- NULL,
- sizeof (ThunarDetailsView),
- 0,
- (GInstanceInitFunc) thunar_details_view_init,
- NULL,
- };
-
- type = g_type_register_static (THUNAR_TYPE_STANDARD_VIEW, I_("ThunarDetailsView"), &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (ThunarDetailsView, thunar_details_view, THUNAR_TYPE_STANDARD_VIEW)
@@ -171,9 +142,6 @@ thunar_details_view_class_init (ThunarDetailsViewClass *klass)
GtkWidgetClass *gtkwidget_class;
GObjectClass *gobject_class;
- /* determine the parent type class */
- thunar_details_view_parent_class = g_type_class_peek_parent (klass);
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunar_details_view_finalize;
gobject_class->get_property = thunar_details_view_get_property;
diff --git a/thunar/thunar-emblem-chooser.c b/thunar/thunar-emblem-chooser.c
index 90dbeaa..186a6d0 100644
--- a/thunar/thunar-emblem-chooser.c
+++ b/thunar/thunar-emblem-chooser.c
@@ -43,8 +43,6 @@ enum
-static void thunar_emblem_chooser_class_init (ThunarEmblemChooserClass *klass);
-static void thunar_emblem_chooser_init (ThunarEmblemChooser *chooser);
static void thunar_emblem_chooser_dispose (GObject *object);
static void thunar_emblem_chooser_finalize (GObject *object);
static void thunar_emblem_chooser_get_property (GObject *object,
@@ -86,36 +84,7 @@ struct _ThunarEmblemChooser
-static GObjectClass *thunar_emblem_chooser_parent_class;
-
-
-
-GType
-thunar_emblem_chooser_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarEmblemChooserClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_emblem_chooser_class_init,
- NULL,
- NULL,
- sizeof (ThunarEmblemChooser),
- 0,
- (GInstanceInitFunc) thunar_emblem_chooser_init,
- NULL,
- };
-
- type = g_type_register_static (GTK_TYPE_SCROLLED_WINDOW, I_("ThunarEmblemChooser"), &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (ThunarEmblemChooser, thunar_emblem_chooser, GTK_TYPE_SCROLLED_WINDOW)
@@ -125,9 +94,6 @@ thunar_emblem_chooser_class_init (ThunarEmblemChooserClass *klass)
GtkWidgetClass *gtkwidget_class;
GObjectClass *gobject_class;
- /* determine the parent type class */
- thunar_emblem_chooser_parent_class = g_type_class_peek_parent (klass);
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->dispose = thunar_emblem_chooser_dispose;
gobject_class->finalize = thunar_emblem_chooser_finalize;
diff --git a/thunar/thunar-file-monitor.c b/thunar/thunar-file-monitor.c
index 0385701..9c885c6 100644
--- a/thunar/thunar-file-monitor.c
+++ b/thunar/thunar-file-monitor.c
@@ -36,10 +36,6 @@ enum
-static void thunar_file_monitor_class_init (ThunarFileMonitorClass *klass);
-
-
-
struct _ThunarFileMonitorClass
{
GObjectClass __parent__;
@@ -57,32 +53,7 @@ static guint file_monitor_signals[LAST_SIGNAL];
-GType
-thunar_file_monitor_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarFileMonitorClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_file_monitor_class_init,
- NULL,
- NULL,
- sizeof (ThunarFileMonitor),
- 0,
- NULL,
- NULL,
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, I_("ThunarFileMonitor"), &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (ThunarFileMonitor, thunar_file_monitor, G_TYPE_OBJECT)
@@ -130,6 +101,13 @@ thunar_file_monitor_class_init (ThunarFileMonitorClass *klass)
+static void
+thunar_file_monitor_init (ThunarFileMonitor *monitor)
+{
+}
+
+
+
/**
* thunar_file_monitor_get_default:
*
diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c
index cdd2efb..fe1819d 100644
--- a/thunar/thunar-file.c
+++ b/thunar/thunar-file.c
@@ -90,7 +90,6 @@ enum
-static void thunar_file_class_init (ThunarFileClass *klass);
static void thunar_file_info_init (ThunarxFileInfoIface *iface);
static void thunar_file_dispose (GObject *object);
static void thunar_file_finalize (GObject *object);
@@ -125,7 +124,6 @@ G_LOCK_DEFINE_STATIC (file_cache_mutex);
static ThunarUserManager *user_manager;
static ThunarMetafile *metafile;
-static GObjectClass *thunar_file_parent_class;
static GHashTable *file_cache;
static guint32 effective_user_id;
static GQuark thunar_file_thumb_path_quark;
@@ -135,40 +133,8 @@ static guint file_signals[LAST_SIGNAL];
-GType
-thunar_file_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarFileClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_file_class_init,
- NULL,
- NULL,
- sizeof (ThunarFile),
- 0,
- NULL,
- NULL,
- };
-
- static const GInterfaceInfo file_info_info =
- {
- (GInterfaceInitFunc) thunar_file_info_init,
- NULL,
- NULL,
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, I_("ThunarFile"), &info, 0);
- g_type_add_interface_static (type, THUNARX_TYPE_FILE_INFO, &file_info_info);
- }
-
- return type;
-}
+G_DEFINE_TYPE_WITH_CODE (ThunarFile, thunar_file, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (THUNARX_TYPE_FILE_INFO, thunar_file_info_init))
@@ -262,6 +228,13 @@ thunar_file_class_init (ThunarFileClass *klass)
static void
+thunar_file_init (ThunarFile *file)
+{
+}
+
+
+
+static void
thunar_file_info_init (ThunarxFileInfoIface *iface)
{
iface->get_name = thunar_file_info_get_name;
diff --git a/thunar/thunar-folder.c b/thunar/thunar-folder.c
index fef3b23..62015fe 100644
--- a/thunar/thunar-folder.c
+++ b/thunar/thunar-folder.c
@@ -50,8 +50,6 @@ enum
-static void thunar_folder_class_init (ThunarFolderClass *klass);
-static void thunar_folder_init (ThunarFolder *folder);
static void thunar_folder_finalize (GObject *object);
static void thunar_folder_get_property (GObject *object,
guint prop_id,
@@ -113,38 +111,12 @@ struct _ThunarFolder
-static GObjectClass *thunar_folder_parent_class;
-static guint folder_signals[LAST_SIGNAL];
-static GQuark thunar_folder_quark;
+static guint folder_signals[LAST_SIGNAL];
+static GQuark thunar_folder_quark;
-GType
-thunar_folder_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarFolderClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_folder_class_init,
- NULL,
- NULL,
- sizeof (ThunarFolder),
- 0,
- (GInstanceInitFunc) thunar_folder_init,
- NULL,
- };
-
- type = g_type_register_static (GTK_TYPE_OBJECT, I_("ThunarFolder"), &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (ThunarFolder, thunar_folder, GTK_TYPE_OBJECT)
@@ -153,9 +125,6 @@ thunar_folder_class_init (ThunarFolderClass *klass)
{
GObjectClass *gobject_class;
- /* determine the parent type class */
- thunar_folder_parent_class = g_type_class_peek_parent (klass);
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunar_folder_finalize;
gobject_class->get_property = thunar_folder_get_property;
diff --git a/thunar/thunar-history-action.c b/thunar/thunar-history-action.c
index 1cba336..f4a613e 100644
--- a/thunar/thunar-history-action.c
+++ b/thunar/thunar-history-action.c
@@ -26,7 +26,6 @@
-static void thunar_history_action_class_init (ThunarHistoryActionClass *klass);
static GtkWidget *thunar_history_action_create_tool_item (GtkAction *action);
static void thunar_history_action_show_menu (GtkWidget *tool_item,
ThunarHistoryAction *history_action);
@@ -45,32 +44,7 @@ struct _ThunarHistoryAction
-GType
-thunar_history_action_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarHistoryActionClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_history_action_class_init,
- NULL,
- NULL,
- sizeof (ThunarHistoryAction),
- 0,
- NULL,
- NULL,
- };
-
- type = g_type_register_static (GTK_TYPE_ACTION, I_("ThunarHistoryAction"), &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (ThunarHistoryAction, thunar_history_action, GTK_TYPE_ACTION)
@@ -98,6 +72,13 @@ thunar_history_action_class_init (ThunarHistoryActionClass *klass)
+static void
+thunar_history_action_init (ThunarHistoryAction *actions_changed)
+{
+}
+
+
+
static GtkWidget*
thunar_history_action_create_tool_item (GtkAction *action)
{
diff --git a/thunar/thunar-history.c b/thunar/thunar-history.c
index 7cba6ed..90a9499 100644
--- a/thunar/thunar-history.c
+++ b/thunar/thunar-history.c
@@ -40,9 +40,7 @@ enum
-static void thunar_history_class_init (ThunarHistoryClass *klass);
static void thunar_history_navigator_init (ThunarNavigatorIface *iface);
-static void thunar_history_init (ThunarHistory *history);
static void thunar_history_dispose (GObject *object);
static void thunar_history_finalize (GObject *object);
static void thunar_history_get_property (GObject *object,
@@ -96,44 +94,8 @@ struct _ThunarHistory
-static GObjectClass *thunar_history_parent_class;
-
-
-
-GType
-thunar_history_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarHistoryClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_history_class_init,
- NULL,
- NULL,
- sizeof (ThunarHistory),
- 0,
- (GInstanceInitFunc) thunar_history_init,
- NULL,
- };
-
- static const GInterfaceInfo navigator_info =
- {
- (GInterfaceInitFunc) thunar_history_navigator_init,
- NULL,
- NULL,
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, I_("ThunarHistory"), &info, 0);
- g_type_add_interface_static (type, THUNAR_TYPE_NAVIGATOR, &navigator_info);
- }
-
- return type;
-}
+G_DEFINE_TYPE_WITH_CODE (ThunarHistory, thunar_history, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (THUNAR_TYPE_NAVIGATOR, thunar_history_navigator_init))
@@ -142,9 +104,6 @@ thunar_history_class_init (ThunarHistoryClass *klass)
{
GObjectClass *gobject_class;
- /* determine the parent type class */
- thunar_history_parent_class = g_type_class_peek_parent (klass);
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->dispose = thunar_history_dispose;
gobject_class->finalize = thunar_history_finalize;
diff --git a/thunar/thunar-icon-factory.c b/thunar/thunar-icon-factory.c
index 12f60b1..cd2a003 100644
--- a/thunar/thunar-icon-factory.c
+++ b/thunar/thunar-icon-factory.c
@@ -64,8 +64,6 @@ typedef struct _ThunarIconKey ThunarIconKey;
-static void thunar_icon_factory_class_init (ThunarIconFactoryClass *klass);
-static void thunar_icon_factory_init (ThunarIconFactory *factory);
static void thunar_icon_factory_dispose (GObject *object);
static void thunar_icon_factory_finalize (GObject *object);
static void thunar_icon_factory_get_property (GObject *object,
@@ -134,40 +132,14 @@ struct _ThunarIconKey
-static GObjectClass *thunar_icon_factory_parent_class = NULL;
-static GQuark thunar_icon_factory_quark = 0;
-static GQuark thunar_icon_thumb_uri_quark = 0;
-static GQuark thunar_icon_thumb_time_quark = 0;
-static GQuark thunar_file_thumb_uri_quark = 0;
+static GQuark thunar_icon_factory_quark = 0;
+static GQuark thunar_icon_thumb_uri_quark = 0;
+static GQuark thunar_icon_thumb_time_quark = 0;
+static GQuark thunar_file_thumb_uri_quark = 0;
-GType
-thunar_icon_factory_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarIconFactoryClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_icon_factory_class_init,
- NULL,
- NULL,
- sizeof (ThunarIconFactory),
- 0,
- (GInstanceInitFunc) thunar_icon_factory_init,
- NULL,
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, I_("ThunarIconFactory"), &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (ThunarIconFactory, thunar_icon_factory, G_TYPE_OBJECT)
@@ -176,9 +148,6 @@ thunar_icon_factory_class_init (ThunarIconFactoryClass *klass)
{
GObjectClass *gobject_class;
- /* determine the parent type class */
- thunar_icon_factory_parent_class = g_type_class_peek_parent (klass);
-
/* setup the thunar-icon-thumb-{path,time} quarks */
thunar_icon_thumb_uri_quark = g_quark_from_static_string ("thunar-icon-thumb-path");
thunar_icon_thumb_time_quark = g_quark_from_static_string ("thunar-icon-thumb-time");
diff --git a/thunar/thunar-icon-renderer.c b/thunar/thunar-icon-renderer.c
index c4995d5..d3fed33 100644
--- a/thunar/thunar-icon-renderer.c
+++ b/thunar/thunar-icon-renderer.c
@@ -41,8 +41,6 @@ enum
-static void thunar_icon_renderer_class_init (ThunarIconRendererClass *klass);
-static void thunar_icon_renderer_init (ThunarIconRenderer *icon_renderer);
static void thunar_icon_renderer_finalize (GObject *object);
static void thunar_icon_renderer_get_property (GObject *object,
guint prop_id,
@@ -69,36 +67,7 @@ static void thunar_icon_renderer_render (GtkCellRenderer *rendere
-static GObjectClass *thunar_icon_renderer_parent_class;
-
-
-
-GType
-thunar_icon_renderer_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarIconRendererClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_icon_renderer_class_init,
- NULL,
- NULL,
- sizeof (ThunarIconRenderer),
- 0,
- (GInstanceInitFunc) thunar_icon_renderer_init,
- NULL,
- };
-
- type = g_type_register_static (GTK_TYPE_CELL_RENDERER, I_("ThunarIconRenderer"), &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (ThunarIconRenderer, thunar_icon_renderer, GTK_TYPE_CELL_RENDERER)
@@ -108,9 +77,6 @@ thunar_icon_renderer_class_init (ThunarIconRendererClass *klass)
GtkCellRendererClass *gtkcell_renderer_class;
GObjectClass *gobject_class;
- /* determine the parent type class */
- thunar_icon_renderer_parent_class = g_type_class_peek_parent (klass);
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunar_icon_renderer_finalize;
gobject_class->get_property = thunar_icon_renderer_get_property;
diff --git a/thunar/thunar-icon-view.c b/thunar/thunar-icon-view.c
index 887dfb5..b54dee7 100644
--- a/thunar/thunar-icon-view.c
+++ b/thunar/thunar-icon-view.c
@@ -35,8 +35,6 @@ enum
-static void thunar_icon_view_class_init (ThunarIconViewClass *klass);
-static void thunar_icon_view_init (ThunarIconView *icon_view);
static void thunar_icon_view_set_property (GObject *object,
guint prop_id,
const GValue *value,
@@ -58,36 +56,7 @@ struct _ThunarIconView
-static GObjectClass *thunar_icon_view_parent_class;
-
-
-
-GType
-thunar_icon_view_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarIconViewClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_icon_view_class_init,
- NULL,
- NULL,
- sizeof (ThunarIconView),
- 0,
- (GInstanceInitFunc) thunar_icon_view_init,
- NULL,
- };
-
- type = g_type_register_static (THUNAR_TYPE_ABSTRACT_ICON_VIEW, I_("ThunarIconView"), &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (ThunarIconView, thunar_icon_view, THUNAR_TYPE_ABSTRACT_ICON_VIEW)
@@ -98,9 +67,6 @@ thunar_icon_view_class_init (ThunarIconViewClass *klass)
GtkWidgetClass *gtkwidget_class;
GObjectClass *gobject_class;
- /* determine the parent type class */
- thunar_icon_view_parent_class = g_type_class_peek_parent (klass);
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->set_property = thunar_icon_view_set_property;
diff --git a/thunar/thunar-job.c b/thunar/thunar-job.c
index 8707bfa..aa68fa9 100644
--- a/thunar/thunar-job.c
+++ b/thunar/thunar-job.c
@@ -54,8 +54,6 @@ enum
-static void thunar_job_class_init (ThunarJobClass *klass);
-static void thunar_job_init (ThunarJob *job);
static void thunar_job_finalize (GObject *object);
static ThunarJobResponse thunar_job_real_ask (ThunarJob *job,
const gchar *message,
@@ -76,29 +74,11 @@ struct _ThunarJobPrivate
-static ExoJobClass *thunar_job_parent_class;
-static guint job_signals[LAST_SIGNAL];
+static guint job_signals[LAST_SIGNAL];
-GType
-thunar_job_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- type = g_type_register_static_simple (EXO_TYPE_JOB,
- "ThunarJob",
- sizeof (ThunarJobClass),
- (GClassInitFunc) thunar_job_class_init,
- sizeof (ThunarJob),
- (GInstanceInitFunc) thunar_job_init,
- G_TYPE_FLAG_ABSTRACT);
- }
-
- return type;
-}
+G_DEFINE_ABSTRACT_TYPE (ThunarJob, thunar_job, EXO_TYPE_JOB)
diff --git a/thunar/thunar-launcher.c b/thunar/thunar-launcher.c
index ac167f9..8482060 100644
--- a/thunar/thunar-launcher.c
+++ b/thunar/thunar-launcher.c
@@ -61,10 +61,8 @@ enum
-static void thunar_launcher_class_init (ThunarLauncherClass *klass);
static void thunar_launcher_component_init (ThunarComponentIface *iface);
static void thunar_launcher_navigator_init (ThunarNavigatorIface *iface);
-static void thunar_launcher_init (ThunarLauncher *launcher);
static void thunar_launcher_dispose (GObject *object);
static void thunar_launcher_finalize (GObject *object);
static void thunar_launcher_get_property (GObject *object,
@@ -175,61 +173,14 @@ static const GtkActionEntry action_entries[] =
{ "sendto-desktop", THUNAR_STOCK_DESKTOP, "", NULL, NULL, G_CALLBACK (thunar_launcher_action_sendto_desktop), },
};
-static GObjectClass *thunar_launcher_parent_class;
-static GQuark thunar_launcher_handler_quark;
+static GQuark thunar_launcher_handler_quark;
-GType
-thunar_launcher_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarLauncherClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_launcher_class_init,
- NULL,
- NULL,
- sizeof (ThunarLauncher),
- 0,
- (GInstanceInitFunc) thunar_launcher_init,
- NULL,
- };
-
- static const GInterfaceInfo browser_info =
- {
- NULL,
- NULL,
- NULL
- };
-
- static const GInterfaceInfo component_info =
- {
- (GInterfaceInitFunc) thunar_launcher_component_init,
- NULL,
- NULL,
- };
-
- static const GInterfaceInfo navigator_info =
- {
- (GInterfaceInitFunc) thunar_launcher_navigator_init,
- NULL,
- NULL,
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, I_("ThunarLauncher"), &info, 0);
- g_type_add_interface_static (type, THUNAR_TYPE_BROWSER, &browser_info);
- g_type_add_interface_static (type, THUNAR_TYPE_NAVIGATOR, &navigator_info);
- g_type_add_interface_static (type, THUNAR_TYPE_COMPONENT, &component_info);
- }
-
- return type;
-}
+G_DEFINE_TYPE_WITH_CODE (ThunarLauncher, thunar_launcher, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (THUNAR_TYPE_BROWSER, NULL)
+ G_IMPLEMENT_INTERFACE (THUNAR_TYPE_NAVIGATOR, thunar_launcher_navigator_init)
+ G_IMPLEMENT_INTERFACE (THUNAR_TYPE_COMPONENT, thunar_launcher_component_init))
@@ -240,9 +191,6 @@ thunar_launcher_class_init (ThunarLauncherClass *klass)
/* determine the "thunar-launcher-handler" quark */
thunar_launcher_handler_quark = g_quark_from_static_string ("thunar-launcher-handler");
-
- /* determine the parent type class */
- thunar_launcher_parent_class = g_type_class_peek_parent (klass);
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->dispose = thunar_launcher_dispose;
diff --git a/thunar/thunar-list-model.c b/thunar/thunar-list-model.c
index c9d55a1..c6e4f80 100644
--- a/thunar/thunar-list-model.c
+++ b/thunar/thunar-list-model.c
@@ -68,11 +68,9 @@ typedef struct _SortTuple SortTuple;
-static void thunar_list_model_class_init (ThunarListModelClass *klass);
static void thunar_list_model_tree_model_init (GtkTreeModelIface *iface);
static void thunar_list_model_drag_dest_init (GtkTreeDragDestIface *iface);
static void thunar_list_model_sortable_init (GtkTreeSortableIface *iface);
-static void thunar_list_model_init (ThunarListModel *store);
static void thunar_list_model_finalize (GObject *object);
static void thunar_list_model_get_property (GObject *object,
guint prop_id,
@@ -250,61 +248,14 @@ struct _SortTuple
-static GObjectClass *thunar_list_model_parent_class;
-static guint list_model_signals[LAST_SIGNAL];
+static guint list_model_signals[LAST_SIGNAL];
-GType
-thunar_list_model_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarListModelClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_list_model_class_init,
- NULL,
- NULL,
- sizeof (ThunarListModel),
- 0,
- (GInstanceInitFunc) thunar_list_model_init,
- NULL,
- };
-
- static const GInterfaceInfo tree_model_info =
- {
- (GInterfaceInitFunc) thunar_list_model_tree_model_init,
- NULL,
- NULL,
- };
-
- static const GInterfaceInfo drag_dest_info =
- {
- (GInterfaceInitFunc) thunar_list_model_drag_dest_init,
- NULL,
- NULL,
- };
-
- static const GInterfaceInfo sortable_info =
- {
- (GInterfaceInitFunc) thunar_list_model_sortable_init,
- NULL,
- NULL,
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, I_("ThunarListModel"), &info, 0);
- g_type_add_interface_static (type, GTK_TYPE_TREE_MODEL, &tree_model_info);
- g_type_add_interface_static (type, GTK_TYPE_TREE_DRAG_DEST, &drag_dest_info);
- g_type_add_interface_static (type, GTK_TYPE_TREE_SORTABLE, &sortable_info);
- }
-
- return type;
-}
+G_DEFINE_TYPE_WITH_CODE (ThunarListModel, thunar_list_model, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL, thunar_list_model_tree_model_init)
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_DRAG_DEST, thunar_list_model_drag_dest_init)
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_SORTABLE, thunar_list_model_sortable_init))
@@ -313,9 +264,6 @@ thunar_list_model_class_init (ThunarListModelClass *klass)
{
GObjectClass *gobject_class;
- /* determine the parent type class */
- thunar_list_model_parent_class = g_type_class_peek_parent (klass);
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunar_list_model_finalize;
gobject_class->get_property = thunar_list_model_get_property;
diff --git a/thunar/thunar-location-button.c b/thunar/thunar-location-button.c
index b34663d..9d35793 100644
--- a/thunar/thunar-location-button.c
+++ b/thunar/thunar-location-button.c
@@ -58,8 +58,6 @@ enum
-static void thunar_location_button_class_init (ThunarLocationButtonClass *klass);
-static void thunar_location_button_init (ThunarLocationButton *location_button);
static void thunar_location_button_finalize (GObject *object);
static void thunar_location_button_get_property (GObject *object,
guint prop_id,
@@ -158,37 +156,11 @@ static const GtkTargetEntry drag_targets[] =
{ "text/uri-list", 0, 0 },
};
-static GObjectClass *thunar_location_button_parent_class;
-static guint location_button_signals[LAST_SIGNAL];
+static guint location_button_signals[LAST_SIGNAL];
-GType
-thunar_location_button_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarLocationButtonClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_location_button_class_init,
- NULL,
- NULL,
- sizeof (ThunarLocationButton),
- 0,
- (GInstanceInitFunc) thunar_location_button_init,
- NULL,
- };
-
- type = g_type_register_static (GTK_TYPE_ALIGNMENT, I_("ThunarLocationButton"), &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (ThunarLocationButton, thunar_location_button, GTK_TYPE_ALIGNMENT)
@@ -198,9 +170,6 @@ thunar_location_button_class_init (ThunarLocationButtonClass *klass)
GtkWidgetClass *gtkwidget_class;
GObjectClass *gobject_class;
- /* determine the parent type class */
- thunar_location_button_parent_class = g_type_class_peek_parent (klass);
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunar_location_button_finalize;
gobject_class->get_property = thunar_location_button_get_property;
diff --git a/thunar/thunar-location-buttons.c b/thunar/thunar-location-buttons.c
index 5a62c76..25225a7 100644
--- a/thunar/thunar-location-buttons.c
+++ b/thunar/thunar-location-buttons.c
@@ -54,11 +54,9 @@ enum
-static void thunar_location_buttons_class_init (ThunarLocationButtonsClass *klass);
static void thunar_location_buttons_component_init (ThunarComponentIface *iface);
static void thunar_location_buttons_navigator_init (ThunarNavigatorIface *iface);
static void thunar_location_buttons_location_bar_init (ThunarLocationBarIface *iface);
-static void thunar_location_buttons_init (ThunarLocationButtons *buttons);
static void thunar_location_buttons_finalize (GObject *object);
static void thunar_location_buttons_get_property (GObject *object,
guint prop_id,
@@ -175,60 +173,12 @@ static const GtkActionEntry action_entries[] =
{ "location-buttons-properties", GTK_STOCK_PROPERTIES, N_("_Properties..."), NULL, NULL, G_CALLBACK (thunar_location_buttons_action_properties), },
};
-static GObjectClass *thunar_location_buttons_parent_class;
-
-GType
-thunar_location_buttons_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarLocationButtonsClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_location_buttons_class_init,
- NULL,
- NULL,
- sizeof (ThunarLocationButtons),
- 0,
- (GInstanceInitFunc) thunar_location_buttons_init,
- NULL,
- };
-
- static const GInterfaceInfo component_info =
- {
- (GInterfaceInitFunc) thunar_location_buttons_component_init,
- NULL,
- NULL,
- };
-
- static const GInterfaceInfo navigator_info =
- {
- (GInterfaceInitFunc) thunar_location_buttons_navigator_init,
- NULL,
- NULL,
- };
-
- static const GInterfaceInfo location_bar_info =
- {
- (GInterfaceInitFunc) thunar_location_buttons_location_bar_init,
- NULL,
- NULL,
- };
-
- type = g_type_register_static (GTK_TYPE_CONTAINER, I_("ThunarLocationButtons"), &info, 0);
- g_type_add_interface_static (type, THUNAR_TYPE_NAVIGATOR, &navigator_info);
- g_type_add_interface_static (type, THUNAR_TYPE_COMPONENT, &component_info);
- g_type_add_interface_static (type, THUNAR_TYPE_LOCATION_BAR, &location_bar_info);
- }
-
- return type;
-}
+G_DEFINE_TYPE_WITH_CODE (ThunarLocationButtons, thunar_location_buttons, GTK_TYPE_CONTAINER,
+ G_IMPLEMENT_INTERFACE (THUNAR_TYPE_NAVIGATOR, thunar_location_buttons_navigator_init)
+ G_IMPLEMENT_INTERFACE (THUNAR_TYPE_COMPONENT, thunar_location_buttons_component_init)
+ G_IMPLEMENT_INTERFACE (THUNAR_TYPE_LOCATION_BAR, thunar_location_buttons_location_bar_init))
@@ -239,9 +189,6 @@ thunar_location_buttons_class_init (ThunarLocationButtonsClass *klass)
GtkWidgetClass *gtkwidget_class;
GObjectClass *gobject_class;
- /* determine the parent type class */
- thunar_location_buttons_parent_class = g_type_class_peek_parent (klass);
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunar_location_buttons_finalize;
gobject_class->get_property = thunar_location_buttons_get_property;
diff --git a/thunar/thunar-location-dialog.c b/thunar/thunar-location-dialog.c
index 6f7ac21..6e58b91 100644
--- a/thunar/thunar-location-dialog.c
+++ b/thunar/thunar-location-dialog.c
@@ -28,36 +28,7 @@
-static void thunar_location_dialog_init (ThunarLocationDialog *location_dialog);
-
-
-
-GType
-thunar_location_dialog_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarLocationDialogClass),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- sizeof (ThunarLocationDialog),
- 0,
- (GInstanceInitFunc) thunar_location_dialog_init,
- NULL,
- };
-
- type = g_type_register_static (THUNAR_TYPE_ABSTRACT_DIALOG, I_("ThunarLocationDialog"), &info, 0);
- }
-
- return type;
-}
+G_DEFINE_TYPE (ThunarLocationDialog, thunar_location_dialog, THUNAR_TYPE_ABSTRACT_DIALOG)
@@ -73,6 +44,13 @@ transform_object_to_boolean (const GValue *src_value,
static void
+thunar_location_dialog_class_init (ThunarLocationDialogClass *klass)
+{
+}
+
+
+
+static void
thunar_location_dialog_init (ThunarLocationDialog *location_dialog)
{
GtkWidget *cancel_button;
diff --git a/thunar/thunar-location-entry.c b/thunar/thunar-location-entry.c
index 03af3fc..51b3777 100644
--- a/thunar/thunar-location-entry.c
+++ b/thunar/thunar-location-entry.c
@@ -55,11 +55,9 @@ enum
-static void thunar_location_entry_class_init (ThunarLocationEntryClass *klass);
static void thunar_location_entry_component_init (ThunarComponentIface *iface);
static void thunar_location_entry_navigator_init (ThunarNavigatorIface *iface);
static void thunar_location_entry_location_bar_init (ThunarLocationBarIface *iface);
-static void thunar_location_entry_init (ThunarLocationEntry *location_entry);
static void thunar_location_entry_finalize (GObject *object);
static void thunar_location_entry_get_property (GObject *object,
guint prop_id,
@@ -102,68 +100,11 @@ struct _ThunarLocationEntry
-static GObjectClass *thunar_location_entry_parent_class;
-
-
-
-GType
-thunar_location_entry_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- static const GTypeInfo info =
- {
- sizeof (ThunarLocationEntryClass),
- NULL,
- NULL,
- (GClassInitFunc) thunar_location_entry_class_init,
- NULL,
- NULL,
- sizeof (ThunarLocationEntry),
- 0,
- (GInstanceInitFunc) thunar_location_entry_init,
- NULL,
- };
-
- static const GInterfaceInfo browser_info =
- {
- NULL,
- NULL,
- NULL,
- };
-
- static const GInterfaceInfo component_info =
- {
- (GInterfaceInitFunc) thunar_location_entry_component_init,
- NULL,
- NULL,
- };
-
- static const GInterfaceInfo navigator_info =
- {
- (GInterfaceInitFunc) thunar_location_entry_navigator_init,
- NULL,
- NULL,
- };
-
- static const GInterfaceInfo location_bar_info =
- {
- (GInterfaceInitFunc) thunar_location_entry_location_bar_init,
- NULL,
- NULL,
- };
-
- type = g_type_register_static (GTK_TYPE_HBOX, I_("ThunarLocationEntry"), &info, 0);
- g_type_add_interface_static (type, THUNAR_TYPE_BROWSER, &browser_info);
- g_type_add_interface_static (type, THUNAR_TYPE_NAVIGATOR, &navigator_info);
- g_type_add_interface_static (type, THUNAR_TYPE_COMPONENT, &component_info);
- g_type_add_interface_static (type, THUNAR_TYPE_LOCATION_BAR, &location_bar_info);
- }
-
- return type;
-}
+G_DEFINE_TYPE_WITH_CODE (ThunarLocationEntry, thunar_location_entry, GTK_TYPE_HBOX,
+ G_IMPLEMENT_INTERFACE (THUNAR_TYPE_BROWSER, NULL)
+ G_IMPLEMENT_INTERFACE (THUNAR_TYPE_NAVIGATOR, thunar_location_entry_navigator_init)
+ G_IMPLEMENT_INTERFACE (THUNAR_TYPE_COMPONENT, thunar_location_entry_component_init)
+ G_IMPLEMENT_INTERFACE (THUNAR_TYPE_LOCATION_BAR, thunar_location_entry_location_bar_init))
@@ -173,9 +114,6 @@ thunar_location_entry_class_init (ThunarLocationEntryClass *klass)
GtkBindingSet *binding_set;
GObjectClass *gobject_class;
- /* determine the parent type class */
- thunar_location_entry_parent_class = g_type_class_peek_parent (klass);
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunar_location_entry_finalize;
gobject_class->get_property = thunar_location_entry_get_property;
More information about the Xfce4-commits
mailing list