gconf-editor r1369 - in trunk: . src



Author: chpe
Date: Mon Aug 18 19:47:20 2008
New Revision: 1369
URL: http://svn.gnome.org/viewvc/gconf-editor?rev=1369&view=rev

Log:
Bug 341288 â move to G_DEFINE_TYPE reduces code
Patch by Kristof Vansant.

Modified:
   trunk/ChangeLog
   trunk/src/gconf-bookmarks-dialog.c
   trunk/src/gconf-bookmarks-dialog.h
   trunk/src/gconf-cell-renderer.c
   trunk/src/gconf-cell-renderer.h
   trunk/src/gconf-editor-window.c
   trunk/src/gconf-editor-window.h
   trunk/src/gconf-key-editor.c
   trunk/src/gconf-key-editor.h
   trunk/src/gconf-list-model.h
   trunk/src/gconf-search-dialog.c
   trunk/src/gconf-search-dialog.h
   trunk/src/gconf-tree-model.c
   trunk/src/gconf-tree-model.h
   trunk/src/gedit-output-window.c
   trunk/src/gedit-output-window.h

Modified: trunk/src/gconf-bookmarks-dialog.c
==============================================================================
--- trunk/src/gconf-bookmarks-dialog.c	(original)
+++ trunk/src/gconf-bookmarks-dialog.c	Mon Aug 18 19:47:20 2008
@@ -18,6 +18,7 @@
  */
 #include "gconf-bookmarks-dialog.h"
 #include <gconf/gconf-client.h>
+#include <glib/gi18n.h>
 #include <gtk/gtkbutton.h>
 #include <gtk/gtkcellrendererpixbuf.h>
 #include <gtk/gtkcellrenderertext.h>
@@ -33,12 +34,9 @@
 
 #include "gconf-stock-icons.h"
 
-#define _(x) gettext (x)
-#define N_(x) (x)
-
 #define BOOKMARKS_KEY "/apps/gconf-editor/bookmarks"
 
-static GtkDialogClass *parent_class;
+G_DEFINE_TYPE(GConfBookmarksDialog, gconf_bookmarks_dialog, GTK_TYPE_DIALOG)
 
 static void
 gconf_bookmarks_dialog_response (GtkDialog *dialog, gint response_id)
@@ -61,8 +59,8 @@
 		dialog->notify_id = 0;
 	}
 	
-	if (GTK_OBJECT_CLASS (parent_class)->destroy) {
-		(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+	if (GTK_OBJECT_CLASS (gconf_bookmarks_dialog_parent_class)->destroy) {
+		(* GTK_OBJECT_CLASS (gconf_bookmarks_dialog_parent_class)->destroy) (object);
 	}
 }
 
@@ -74,8 +72,6 @@
 
 	object_class = (GtkObjectClass *)klass;
 	dialog_class = (GtkDialogClass *)klass;
-	
-	parent_class = g_type_class_peek_parent (klass);
 
 	object_class->destroy = gconf_bookmarks_dialog_destroy;
 	dialog_class->response = gconf_bookmarks_dialog_response;
@@ -266,29 +262,6 @@
 						     NULL);
 }
 
-GType
-gconf_bookmarks_dialog_get_type (void)
-{
-	static GType object_type = 0;
-
-	if (!object_type) {
-		static const GTypeInfo object_info = {
-			sizeof (GConfBookmarksDialogClass),
-			NULL,		/* base_init */
-			NULL,		/* base_finalize */
-			(GClassInitFunc) gconf_bookmarks_dialog_class_init,
-			NULL,		/* class_finalize */
-			NULL,		/* class_data */
-			sizeof (GConfBookmarksDialog),
-			0,              /* n_preallocs */
-			(GInstanceInitFunc) gconf_bookmarks_dialog_init
-		};
-
-		object_type = g_type_register_static (GTK_TYPE_DIALOG, "GConfBookmarksDialog", &object_info, 0);
-	}
-
-	return object_type;
-}
 
 GtkWidget *
 gconf_bookmarks_dialog_new (GtkWindow *parent)

Modified: trunk/src/gconf-bookmarks-dialog.h
==============================================================================
--- trunk/src/gconf-bookmarks-dialog.h	(original)
+++ trunk/src/gconf-bookmarks-dialog.h	Mon Aug 18 19:47:20 2008
@@ -24,11 +24,11 @@
 #include <gtk/gtkdialog.h>
 
 #define GCONF_TYPE_BOOKMARKS_DIALOG		  (gconf_bookmarks_dialog_get_type ())
-#define GCONF_BOOKMARKS_DIALOG(obj)		  (GTK_CHECK_CAST ((obj), GCONF_TYPE_BOOKMARKS_DIALOG, GConfBookmarksDialog))
-#define GCONF_BOOKMARKS_DIALOG_CLASS(klass)	  (GTK_CHECK_CLASS_CAST ((klass), GCONF_TYPE_BOOKMARKS_DIALOG, GConfBookmarksDialogClass))
-#define GCONF_IS_BOOKMARKS_DIALOG(obj)	          (GTK_CHECK_TYPE ((obj), GCONF_TYPE_BOOKMARKS_DIALOG))
-#define GCONF_IS_BOOKMARKS_DIALOG_CLASS(klass)    (GTK_CHECK_CLASS_TYPE ((obj), GCONF_TYPE_BOOKMARKS_DIALOG))
-#define GCONF_BOOKMARKS_DIALOG_GET_CLASS(obj)     (GTK_CHECK_GET_CLASS ((obj), GCONF_TYPE_BOOKMARKS_DIALOG, GConfBookmarksDialogClass))
+#define GCONF_BOOKMARKS_DIALOG(obj)		  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCONF_TYPE_BOOKMARKS_DIALOG, GConfBookmarksDialog))
+#define GCONF_BOOKMARKS_DIALOG_CLASS(klass)	  (G_TYPE_CHECK_CLASS_CAST ((klass), GCONF_TYPE_BOOKMARKS_DIALOG, GConfBookmarksDialogClass))
+#define GCONF_IS_BOOKMARKS_DIALOG(obj)	          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCONF_TYPE_BOOKMARKS_DIALOG))
+#define GCONF_IS_BOOKMARKS_DIALOG_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE ((obj), GCONF_TYPE_BOOKMARKS_DIALOG))
+#define GCONF_BOOKMARKS_DIALOG_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GCONF_TYPE_BOOKMARKS_DIALOG, GConfBookmarksDialogClass))
 
 typedef struct _GConfBookmarksDialog GConfBookmarksDialog;
 typedef struct _GConfBookmarksDialogClass GConfBookmarksDialogClass;

Modified: trunk/src/gconf-cell-renderer.c
==============================================================================
--- trunk/src/gconf-cell-renderer.c	(original)
+++ trunk/src/gconf-cell-renderer.c	Mon Aug 18 19:47:20 2008
@@ -46,7 +46,8 @@
 
 static guint gconf_cell_signals[LAST_SIGNAL] = { 0 };
 
-static GtkCellRendererClass *parent_class;
+G_DEFINE_TYPE(GConfCellRenderer, gconf_cell_renderer, GTK_TYPE_CELL_RENDERER)
+
 
 static void
 gconf_cell_renderer_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec)
@@ -129,7 +130,7 @@
 	g_object_unref (renderer->text_renderer);
 	g_object_unref (renderer->toggle_renderer);
 
-	(* G_OBJECT_CLASS (parent_class)->finalize) (object);
+	(* G_OBJECT_CLASS (gconf_cell_renderer_parent_class)->finalize) (object);
 }
 
 static void
@@ -417,8 +418,6 @@
 	GObjectClass *object_class = (GObjectClass *)klass;
 	GtkCellRendererClass *cell_renderer_class = (GtkCellRendererClass *)klass;
 
-	parent_class = g_type_class_peek_parent (klass);
-
 	object_class->get_property = gconf_cell_renderer_get_property;
 	object_class->set_property = gconf_cell_renderer_set_property;
 	object_class->finalize = gconf_cell_renderer_finalize;
@@ -469,30 +468,7 @@
 	gtk_object_sink (GTK_OBJECT (renderer->toggle_renderer));
 }
 
-GType
-gconf_cell_renderer_get_type (void)
-{
-	static GType object_type = 0;
-
-	if (!object_type) {
-		static const GTypeInfo object_info = {
-			sizeof (GConfCellRendererClass),
-			NULL,		/* base_init */
-			NULL,		/* base_finalize */
-			(GClassInitFunc) gconf_cell_renderer_class_init,
-			NULL,		/* class_finalize */
-			NULL,		/* class_data */
-			sizeof (GConfCellRenderer),
-			0,              /* n_preallocs */
-			(GInstanceInitFunc) gconf_cell_renderer_init
-		};
-		
-		object_type = g_type_register_static (GTK_TYPE_CELL_RENDERER, "GConfCellRenderer", &object_info, 0);
-
-	}
 
-	return object_type;
-}
 
 GtkCellRenderer *
 gconf_cell_renderer_new (void)

Modified: trunk/src/gconf-cell-renderer.h
==============================================================================
--- trunk/src/gconf-cell-renderer.h	(original)
+++ trunk/src/gconf-cell-renderer.h	Mon Aug 18 19:47:20 2008
@@ -24,11 +24,11 @@
 #include <gconf/gconf-value.h>
 
 #define GCONF_TYPE_CELL_RENDERER	    (gconf_cell_renderer_get_type ())
-#define GCONF_CELL_RENDERER(obj)	    (GTK_CHECK_CAST ((obj), GCONF_TYPE_CELL_RENDERER, GConfCellRenderer))
-#define GCONF_CELL_RENDERER_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), GCONF_TYPE_CELL_RENDERER, GConfCellRendererClass))
-#define GCONF_IS_CELL_RENDERER(obj)	    (GTK_CHECK_TYPE ((obj), GCONF_TYPE_CELL_RENDERER))
-#define GCONF_IS_CELL_RENDERER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), GCONF_TYPE_CELL_RENDERER))
-#define GCONF_CELL_RENDERER_GET_CLASS(obj)  (GTK_CHECK_GET_CLASS ((obj), GCONF_TYPE_CELL_RENDERER, GConfCellRendererClass))
+#define GCONF_CELL_RENDERER(obj)	    (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCONF_TYPE_CELL_RENDERER, GConfCellRenderer))
+#define GCONF_CELL_RENDERER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GCONF_TYPE_CELL_RENDERER, GConfCellRendererClass))
+#define GCONF_IS_CELL_RENDERER(obj)	    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCONF_TYPE_CELL_RENDERER))
+#define GCONF_IS_CELL_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), GCONF_TYPE_CELL_RENDERER))
+#define GCONF_CELL_RENDERER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GCONF_TYPE_CELL_RENDERER, GConfCellRendererClass))
 
 typedef struct _GConfCellRenderer GConfCellRenderer;
 typedef struct _GConfCellRendererClass GConfCellRendererClass;

Modified: trunk/src/gconf-editor-window.c
==============================================================================
--- trunk/src/gconf-editor-window.c	(original)
+++ trunk/src/gconf-editor-window.c	Mon Aug 18 19:47:20 2008
@@ -32,11 +32,9 @@
 #include "gedit-output-window.h"
 #include "gconf-search-dialog.h"
 #include <gconf/gconf.h>
-#include <libintl.h>
 #include <string.h>
 
 
-
 /* Property IDs */
 enum
 {
@@ -56,7 +54,7 @@
 
 static GConfClient* 	gconf_editor_window_get_client 		(int type);
 
-static GObjectClass *parent_class;
+G_DEFINE_TYPE(GConfEditorWindow, gconf_editor_window, GTK_TYPE_WINDOW)
 
 void
 gconf_editor_window_popup_error_dialog (GtkWindow   *parent,
@@ -383,9 +381,6 @@
 	gconf_editor_window_go_to (window, key);
 }
 
-
-
-
 static void
 gconf_editor_window_about_window (GtkAction *action, GtkWidget *callback_data)
 {
@@ -1379,7 +1374,7 @@
 static void
 gconf_editor_window_finalize (GObject *object)
 {
-        GConfEditorWindow *window = (GConfEditorWindow *) object;
+	GConfEditorWindow *window = GCONF_EDITOR_WINDOW(object);
 	GConfClient       *client;
 
 	client = gconf_client_get_default ();
@@ -1394,15 +1389,16 @@
 
 	g_object_unref (client);
 
-	/* FIXME: unref client? */
-
-        parent_class->finalize (object);
+	/* FIXME: unref client?*/
+	
+	G_OBJECT_CLASS(gconf_editor_window_parent_class)->finalize (object);
+    
 }
 
 static void
 gconf_editor_window_class_init (GConfEditorWindowClass *klass)
 {
-	GObjectClass *object_class = (GObjectClass *) klass;
+	GObjectClass *object_class = G_OBJECT_CLASS(klass);
 
 	object_class->set_property = gconf_editor_window_set_property;
 	object_class->get_property = gconf_editor_window_get_property;
@@ -1416,9 +1412,6 @@
 					 GCONF_EDITOR_WINDOW_TYPE_NORMAL, 
 					 (G_PARAM_WRITABLE |
 					 G_PARAM_CONSTRUCT_ONLY)));
-
-
-	parent_class = g_type_class_peek_parent (klass);
 }
 
 static void
@@ -1760,27 +1753,3 @@
 	gconf_editor_window_setup_ui_prefs_handler (window);
 }
 
-GType
-gconf_editor_window_get_type (void)
-{
-	static GType object_type = 0;
-
-	if (!object_type) {
-		static const GTypeInfo object_info = {
-			sizeof (GConfEditorWindowClass),
-			NULL,		/* base_init */
-			NULL,		/* base_finalize */
-			(GClassInitFunc) gconf_editor_window_class_init,
-			NULL,		/* class_finalize */
-			NULL,		/* class_data */
-			sizeof (GConfEditorWindow),
-			0,              /* n_preallocs */
-			(GInstanceInitFunc) gconf_editor_window_init
-		};
-
-		object_type = g_type_register_static (GTK_TYPE_WINDOW, "GConfEditorWindow", &object_info, 0);
-	}
-
-	return object_type;
-}
-

Modified: trunk/src/gconf-editor-window.h
==============================================================================
--- trunk/src/gconf-editor-window.h	(original)
+++ trunk/src/gconf-editor-window.h	Mon Aug 18 19:47:20 2008
@@ -29,11 +29,11 @@
 #include <gconf/gconf-client.h>
 
 #define GCONF_TYPE_EDITOR_WINDOW		  (gconf_editor_window_get_type ())
-#define GCONF_EDITOR_WINDOW(obj)		  (GTK_CHECK_CAST ((obj), GCONF_TYPE_EDITOR_WINDOW, GConfEditorWindow))
-#define GCONF_EDITOR_WINDOW_CLASS(klass)	  (GTK_CHECK_CLASS_CAST ((klass), GCONF_TYPE_EDITOR_WINDOW, GConfEditorWindowClass))
-#define GCONF_IS_EDITOR_WINDOW(obj)	  (GTK_CHECK_TYPE ((obj), GCONF_TYPE_EDITOR_WINDOW))
-#define GCONF_IS_EDITOR_WINDOW_CLASS(klass)  (GTK_CHECK_CLASS_TYPE ((obj), GCONF_TYPE_EDITOR_WINDOW))
-#define GCONF_EDITOR_WINDOW_GET_CLASS(obj)   (GTK_CHECK_GET_CLASS ((obj), GCONF_TYPE_EDITOR_WINDOW, GConfEditorWindowClass))
+#define GCONF_EDITOR_WINDOW(obj)		  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCONF_TYPE_EDITOR_WINDOW, GConfEditorWindow))
+#define GCONF_EDITOR_WINDOW_CLASS(klass)	  (G_TYPE_CHECK_CLASS_CAST ((klass), GCONF_TYPE_EDITOR_WINDOW, GConfEditorWindowClass))
+#define GCONF_IS_EDITOR_WINDOW(obj)	  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCONF_TYPE_EDITOR_WINDOW))
+#define GCONF_IS_EDITOR_WINDOW_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((obj), GCONF_TYPE_EDITOR_WINDOW))
+#define GCONF_EDITOR_WINDOW_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GCONF_TYPE_EDITOR_WINDOW, GConfEditorWindowClass))
 
 #define RECENT_LIST_MAX_SIZE 20
 

Modified: trunk/src/gconf-key-editor.c
==============================================================================
--- trunk/src/gconf-key-editor.c	(original)
+++ trunk/src/gconf-key-editor.c	Mon Aug 18 19:47:20 2008
@@ -42,11 +42,10 @@
 #include <gtk/gtktreeview.h>
 #include <gtk/gtkvbox.h>
 #include <gtk/gtkvbbox.h>
+#include <glib/gi18n.h>
 #include <libintl.h>
 #include <string.h>
 
-#define _(x) gettext (x)
-
 enum
 {
   EDIT_INTEGER,

Modified: trunk/src/gconf-key-editor.h
==============================================================================
--- trunk/src/gconf-key-editor.h	(original)
+++ trunk/src/gconf-key-editor.h	Mon Aug 18 19:47:20 2008
@@ -25,11 +25,11 @@
 #include <gconf/gconf.h>
 
 #define GCONF_TYPE_KEY_EDITOR		  (gconf_key_editor_get_type ())
-#define GCONF_KEY_EDITOR(obj)		  (GTK_CHECK_CAST ((obj), GCONF_TYPE_KEY_EDITOR, GConfKeyEditor))
-#define GCONF_KEY_EDITOR_CLASS(klass)	  (GTK_CHECK_CLASS_CAST ((klass), GCONF_TYPE_KEY_EDITOR, GConfKeyEditorClass))
-#define GCONF_IS_KEY_EDITOR(obj)	  (GTK_CHECK_TYPE ((obj), GCONF_TYPE_KEY_EDITOR))
-#define GCONF_IS_KEY_EDITOR_CLASS(klass)  (GTK_CHECK_CLASS_TYPE ((obj), GCONF_TYPE_KEY_EDITOR))
-#define GCONF_KEY_EDITOR_GET_CLASS(obj)   (GTK_CHECK_GET_CLASS ((obj), GCONF_TYPE_KEY_EDITOR, GConfKeyEditorClass))
+#define GCONF_KEY_EDITOR(obj)		  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCONF_TYPE_KEY_EDITOR, GConfKeyEditor))
+#define GCONF_KEY_EDITOR_CLASS(klass)	  (G_TYPE_CHECK_CLASS_CAST ((klass), GCONF_TYPE_KEY_EDITOR, GConfKeyEditorClass))
+#define GCONF_IS_KEY_EDITOR(obj)	  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCONF_TYPE_KEY_EDITOR))
+#define GCONF_IS_KEY_EDITOR_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((obj), GCONF_TYPE_KEY_EDITOR))
+#define GCONF_KEY_EDITOR_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GCONF_TYPE_KEY_EDITOR, GConfKeyEditorClass))
 
 typedef enum {
 	GCONF_KEY_EDITOR_NEW_KEY,

Modified: trunk/src/gconf-list-model.h
==============================================================================
--- trunk/src/gconf-list-model.h	(original)
+++ trunk/src/gconf-list-model.h	Mon Aug 18 19:47:20 2008
@@ -24,11 +24,11 @@
 #include <gconf/gconf-client.h>
 
 #define GCONF_TYPE_LIST_MODEL		  (gconf_list_model_get_type ())
-#define GCONF_LIST_MODEL(obj)		  (GTK_CHECK_CAST ((obj), GCONF_TYPE_LIST_MODEL, GConfListModel))
-#define GCONF_LIST_MODEL_CLASS(klass)	  (GTK_CHECK_CLASS_CAST ((klass), GCONF_TYPE_LIST_MODEL, GConfListModelClass))
-#define GCONF_IS_LIST_MODEL(obj)	  (GTK_CHECK_TYPE ((obj), GCONF_TYPE_LIST_MODEL))
-#define GCONF_IS_LIST_MODEL_CLASS(klass)  (GTK_CHECK_CLASS_TYPE ((obj), GCONF_TYPE_LIST_MODEL))
-#define GCONF_LIST_MODEL_GET_CLASS(obj)   (GTK_CHECK_GET_CLASS ((obj), GCONF_TYPE_LIST_MODEL, GConfListModelClass))
+#define GCONF_LIST_MODEL(obj)		  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCONF_TYPE_LIST_MODEL, GConfListModel))
+#define GCONF_LIST_MODEL_CLASS(klass)	  (G_TYPE_CHECK_CLASS_CAST ((klass), GCONF_TYPE_LIST_MODEL, GConfListModelClass))
+#define GCONF_IS_LIST_MODEL(obj)	  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCONF_TYPE_LIST_MODEL))
+#define GCONF_IS_LIST_MODEL_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((obj), GCONF_TYPE_LIST_MODEL))
+#define GCONF_LIST_MODEL_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GCONF_TYPE_LIST_MODEL, GConfListModelClass))
 
 typedef struct _GConfListModel GConfListModel;
 typedef struct _GConfListModelClass GConfListModelClass;

Modified: trunk/src/gconf-search-dialog.c
==============================================================================
--- trunk/src/gconf-search-dialog.c	(original)
+++ trunk/src/gconf-search-dialog.c	Mon Aug 18 19:47:20 2008
@@ -30,6 +30,8 @@
 
 #include "gconf-stock-icons.h"
 
+G_DEFINE_TYPE(GConfSearchDialog, gconf_search_dialog, GTK_TYPE_DIALOG)
+
 static void
 gconf_search_dialog_response (GtkDialog *dialog, gint response_id)
 {
@@ -178,30 +180,6 @@
 	gtk_widget_show_all (hbox);
 }
 
-GType
-gconf_search_dialog_get_type (void)
-{
-	static GType object_type = 0;
-
-	if (!object_type) {
-		static const GTypeInfo object_info = {
-			sizeof (GConfSearchDialogClass),
-			NULL,		/* base_init */
-			NULL,		/* base_finalize */
-			(GClassInitFunc) gconf_search_dialog_class_init,
-			NULL,		/* class_finalize */
-			NULL,		/* class_data */
-			sizeof (GConfSearchDialog),
-			0,              /* n_preallocs */
-			(GInstanceInitFunc) gconf_search_dialog_init
-		};
-
-		object_type = g_type_register_static (GTK_TYPE_DIALOG, "GConfSearchDialog", &object_info, 0);
-	}
-
-	return object_type;
-}
-
 GtkWidget *
 gconf_search_dialog_new (GtkWindow *parent)
 {

Modified: trunk/src/gconf-search-dialog.h
==============================================================================
--- trunk/src/gconf-search-dialog.h	(original)
+++ trunk/src/gconf-search-dialog.h	Mon Aug 18 19:47:20 2008
@@ -25,11 +25,11 @@
 #include <gtk/gtkradiobutton.h>
 
 #define GCONF_TYPE_SEARCH_DIALOG		  (gconf_search_dialog_get_type ())
-#define GCONF_SEARCH_DIALOG(obj)		  (GTK_CHECK_CAST ((obj), GCONF_TYPE_SEARCH_DIALOG, GConfSearchDialog))
-#define GCONF_SEARCH_DIALOG_CLASS(klass)	  (GTK_CHECK_CLASS_CAST ((klass), GCONF_TYPE_SEARCH_DIALOG, GConfSearchDialogClass))
-#define GCONF_IS_SEARCH_DIALOG(obj)	          (GTK_CHECK_TYPE ((obj), GCONF_TYPE_SEARCH_DIALOG))
-#define GCONF_IS_SEARCH_DIALOG_CLASS(klass)    (GTK_CHECK_CLASS_TYPE ((obj), GCONF_TYPE_SEARCH_DIALOG))
-#define GCONF_SEARCH_DIALOG_GET_CLASS(obj)     (GTK_CHECK_GET_CLASS ((obj), GCONF_TYPE_SEARCH_DIALOG, GConfSearchDialogClass))
+#define GCONF_SEARCH_DIALOG(obj)		  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCONF_TYPE_SEARCH_DIALOG, GConfSearchDialog))
+#define GCONF_SEARCH_DIALOG_CLASS(klass)	  (G_TYPE_CHECK_CLASS_CAST ((klass), GCONF_TYPE_SEARCH_DIALOG, GConfSearchDialogClass))
+#define GCONF_IS_SEARCH_DIALOG(obj)	          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCONF_TYPE_SEARCH_DIALOG))
+#define GCONF_IS_SEARCH_DIALOG_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE ((obj), GCONF_TYPE_SEARCH_DIALOG))
+#define GCONF_SEARCH_DIALOG_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GCONF_TYPE_SEARCH_DIALOG, GConfSearchDialogClass))
 
 typedef struct _GConfSearchDialog GConfSearchDialog;
 typedef struct _GConfSearchDialogClass GConfSearchDialogClass;

Modified: trunk/src/gconf-tree-model.c
==============================================================================
--- trunk/src/gconf-tree-model.c	(original)
+++ trunk/src/gconf-tree-model.c	Mon Aug 18 19:47:20 2008
@@ -10,7 +10,7 @@
 static void gconf_tree_model_class_init       (GConfTreeModelClass *klass);
 static void gconf_tree_model_init             (GConfTreeModel *model);
 static void gconf_tree_model_tree_model_init  (GtkTreeModelIface *iface);
-static void gconf_tree_model_clear_node (GtkTreeModel *tree_model, Node *node);
+static void gconf_tree_model_clear_node       (GtkTreeModel *tree_model, Node *node);
 
 G_DEFINE_TYPE_WITH_CODE (GConfTreeModel, gconf_tree_model, G_TYPE_OBJECT,
                          G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL, gconf_tree_model_tree_model_init));
@@ -26,6 +26,7 @@
 	Node *prev;
 };
 
+
 GtkTreePath *
 gconf_tree_model_get_tree_path_from_gconf_path (GConfTreeModel *tree_model, const char *key)
 {

Modified: trunk/src/gconf-tree-model.h
==============================================================================
--- trunk/src/gconf-tree-model.h	(original)
+++ trunk/src/gconf-tree-model.h	Mon Aug 18 19:47:20 2008
@@ -24,11 +24,11 @@
 #include <gconf/gconf-client.h>
 
 #define GCONF_TYPE_TREE_MODEL		  (gconf_tree_model_get_type ())
-#define GCONF_TREE_MODEL(obj)		  (GTK_CHECK_CAST ((obj), GCONF_TYPE_TREE_MODEL, GConfTreeModel))
-#define GCONF_TREE_MODEL_CLASS(klass)	  (GTK_CHECK_CLASS_CAST ((klass), GCONF_TYPE_TREE_MODEL, GConfTreeModelClass))
-#define GCONF_IS_TREE_MODEL(obj)	  (GTK_CHECK_TYPE ((obj), GCONF_TYPE_TREE_MODEL))
-#define GCONF_IS_TREE_MODEL_CLASS(klass)  (GTK_CHECK_CLASS_TYPE ((obj), GCONF_TYPE_TREE_MODEL))
-#define GCONF_TREE_MODEL_GET_CLASS(obj)   (GTK_CHECK_GET_CLASS ((obj), GCONF_TYPE_TREE_MODEL, GConfTreeModelClass))
+#define GCONF_TREE_MODEL(obj)		  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCONF_TYPE_TREE_MODEL, GConfTreeModel))
+#define GCONF_TREE_MODEL_CLASS(klass)	  (G_TYPE_CHECK_CLASS_CAST ((klass), GCONF_TYPE_TREE_MODEL, GConfTreeModelClass))
+#define GCONF_IS_TREE_MODEL(obj)	  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCONF_TYPE_TREE_MODEL))
+#define GCONF_IS_TREE_MODEL_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((obj), GCONF_TYPE_TREE_MODEL))
+#define GCONF_TREE_MODEL_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GCONF_TYPE_TREE_MODEL, GConfTreeModelClass))
 
 typedef struct _GConfTreeModel GConfTreeModel;
 typedef struct _GConfTreeModelClass GConfTreeModelClass;

Modified: trunk/src/gedit-output-window.c
==============================================================================
--- trunk/src/gedit-output-window.c	(original)
+++ trunk/src/gedit-output-window.c	Mon Aug 18 19:47:20 2008
@@ -68,51 +68,18 @@
 	NUM_COLUMNS
 };
 
-static void gedit_output_window_class_init 	(GeditOutputWindowClass	*klass);
-static void gedit_output_window_init 		(GeditOutputWindow 	*output_window);
+
 static void gedit_output_window_finalize 	(GObject 	*object);
 static void gedit_output_window_destroy	 	(GtkObject 	*object);
 
-static GtkHBoxClass *parent_class = NULL;
-
-
-GType
-gedit_output_window_get_type (void)
-{
-	static GType output_window_type = 0;
-
-  	if (output_window_type == 0)
-    	{
-      		static const GTypeInfo our_info =
-      		{
-        		sizeof (GeditOutputWindowClass),
-        		NULL,		/* base_init */
-        		NULL,		/* base_finalize */
-        		(GClassInitFunc) gedit_output_window_class_init,
-        		NULL,           /* class_finalize */
-        		NULL,           /* class_data */
-        		sizeof (GeditOutputWindow),
-        		0,              /* n_preallocs */
-        		(GInstanceInitFunc) gedit_output_window_init
-      		};
-
-      		output_window_type = g_type_register_static (GTK_TYPE_HBOX,
-                				    "GeditOutputWindow",
-                                       	 	    &our_info,
-                                       		    0);
-    	}
-
-	return output_window_type;
-}
+G_DEFINE_TYPE(GeditOutputWindow, gedit_output_window, GTK_TYPE_HBOX)
 
 static void
 gedit_output_window_class_init (GeditOutputWindowClass *klass)
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-  	parent_class = g_type_class_peek_parent (klass);
-
-  	object_class->finalize = gedit_output_window_finalize;
+   	object_class->finalize = gedit_output_window_finalize;
 	
 	GTK_OBJECT_CLASS (klass)->destroy = gedit_output_window_destroy;
 
@@ -538,13 +505,13 @@
 		g_free (ow->priv);
 	}
 
-	G_OBJECT_CLASS (parent_class)->finalize (object);
+	G_OBJECT_CLASS (gedit_output_window_parent_class)->finalize (object);
 }
 
 static void 
 gedit_output_window_destroy (GtkObject *object)
 {
-	GTK_OBJECT_CLASS (parent_class)->destroy (object);
+	GTK_OBJECT_CLASS (gedit_output_window_parent_class)->destroy (object);
 }
 
 GtkWidget *

Modified: trunk/src/gedit-output-window.h
==============================================================================
--- trunk/src/gedit-output-window.h	(original)
+++ trunk/src/gedit-output-window.h	Mon Aug 18 19:47:20 2008
@@ -34,11 +34,11 @@
 #include <gtk/gtkhbox.h>
 
 #define GEDIT_TYPE_OUTPUT_WINDOW		(gedit_output_window_get_type ())
-#define GEDIT_OUTPUT_WINDOW(obj)		(GTK_CHECK_CAST ((obj), GEDIT_TYPE_OUTPUT_WINDOW, GeditOutputWindow))
-#define GEDIT_OUTPUT_WINDOW_CLASS(klass)	(GTK_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_OUTPUT_WINDOW, GeditOutputWindowClass))
-#define GEDIT_IS_OUTPUT_WINDOW(obj)		(GTK_CHECK_TYPE ((obj), GEDIT_TYPE_OUTPUT_WINDOW))
-#define GEDIT_IS_OUTPUT_WINDOW_CLASS(klass)  	(GTK_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_OUTPUT_WINDOW))
-#define GEDIT_OUTPUT_WINDOW_GET_CLASS(obj)  	(GTK_CHECK_GET_CLASS ((obj), GEDIT_TYPE_OUTPUT_WINDOW, GeditOutputWindowClass))
+#define GEDIT_OUTPUT_WINDOW(obj)		(G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_OUTPUT_WINDOW, GeditOutputWindow))
+#define GEDIT_OUTPUT_WINDOW_CLASS(klass)	(G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_OUTPUT_WINDOW, GeditOutputWindowClass))
+#define GEDIT_IS_OUTPUT_WINDOW(obj)		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_OUTPUT_WINDOW))
+#define GEDIT_IS_OUTPUT_WINDOW_CLASS(klass)  	(G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_OUTPUT_WINDOW))
+#define GEDIT_OUTPUT_WINDOW_GET_CLASS(obj)  	(G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_OUTPUT_WINDOW, GeditOutputWindowClass))
 
 
 typedef struct _GeditOutputWindow		GeditOutputWindow;
@@ -62,7 +62,7 @@
 };
 
 
-GtkType        	 gedit_output_window_get_type     	(void) G_GNUC_CONST;
+GType        	 gedit_output_window_get_type     	(void) G_GNUC_CONST;
 
 GtkWidget	*gedit_output_window_new		(void);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]