[Kazehakase-cvs] CVS update: kazehakase/src/dialogs

Back to archive index

Hiroyuki Ikezoe ikezo****@users*****
Sat Dec 2 22:07:08 JST 2006


Index: kazehakase/src/dialogs/kz-copy-format-dialog.c
diff -u kazehakase/src/dialogs/kz-copy-format-dialog.c:1.7 kazehakase/src/dialogs/kz-copy-format-dialog.c:1.8
--- kazehakase/src/dialogs/kz-copy-format-dialog.c:1.7	Mon Aug  7 00:55:49 2006
+++ kazehakase/src/dialogs/kz-copy-format-dialog.c	Sat Dec  2 22:07:08 2006
@@ -25,7 +25,6 @@
 #include <glib/gi18n.h>
 #include <glib/gprintf.h>
 
-#include "gobject-utils.h"
 #include "utils.h"
 #include "kz-icons.h"
 
@@ -42,22 +41,20 @@
 	N_COLUMNS
 };
 
-static void     kz_copy_format_dialog_class_init         (KzCopyFormatDialogClass *klass);
-static void     kz_copy_format_dialog_init               (KzCopyFormatDialog  *copy_format);
-static GObject *kz_copy_format_dialog_constructor        (GType           type,
-							  guint           n_props,
-							  GObjectConstructParam *props);
-static void     kz_copy_format_dialog_dispose            (GObject        *object);
-static void     kz_copy_format_dialog_set_property       (GObject       *object,
-							  guint          prop_id,
-							  const GValue  *value,
-							  GParamSpec    *pspec);
-static void     kz_copy_format_dialog_get_property       (GObject       *object,
-							  guint          prop_id,
-							  GValue        *value,
-							  GParamSpec    *pspec);
-static void     kz_copy_format_dialog_response           (GtkDialog      *dialog,
-							  gint            arg);
+static GObject *constructor        (GType           type,
+				    guint           n_props,
+				    GObjectConstructParam *props);
+static void     dispose            (GObject        *object);
+static void     set_property       (GObject       *object,
+				    guint          prop_id,
+				    const GValue  *value,
+				    GParamSpec    *pspec);
+static void     get_property       (GObject       *object,
+				    guint          prop_id,
+				    GValue        *value,
+				    GParamSpec    *pspec);
+static void     response           (GtkDialog      *dialog,
+				    gint            arg);
 
 static void     cb_add_button_clicked           	(GtkWidget      *widget,
 						    	 KzCopyFormatDialog  *copy_format);
@@ -79,12 +76,7 @@
 
 static GList*	get_copy_format_prefs(void);
 
-static GtkDialogClass *parent_class = NULL;
-
-
-KZ_OBJECT_GET_TYPE(kz_copy_format_dialog, "KzCopyFormatDialog", KzCopyFormatDialog,
-		   kz_copy_format_dialog_class_init, kz_copy_format_dialog_init,
-		   GTK_TYPE_DIALOG)
+G_DEFINE_TYPE(KzCopyFormatDialog, kz_copy_format_dialog, GTK_TYPE_DIALOG)
 
 static void
 kz_copy_format_dialog_class_init (KzCopyFormatDialogClass *klass)
@@ -92,19 +84,16 @@
 	GObjectClass *gobject_class;
 	GtkDialogClass *dialog_class;
 
-	parent_class = g_type_class_peek_parent (klass);
-
 	gobject_class = (GObjectClass *) klass;
 	dialog_class  = (GtkDialogClass *) klass;
 
-	/* GtkObject signals */
-	gobject_class->constructor  = kz_copy_format_dialog_constructor;
-	gobject_class->dispose      = kz_copy_format_dialog_dispose;
-	gobject_class->set_property = kz_copy_format_dialog_set_property;
-	gobject_class->get_property = kz_copy_format_dialog_get_property;
+	gobject_class->constructor  = constructor;
+	gobject_class->dispose      = dispose;
+	gobject_class->set_property = set_property;
+	gobject_class->get_property = get_property;
 
 	/* GtkDialog signals */
-	dialog_class->response = kz_copy_format_dialog_response;
+	dialog_class->response = response;
 
 	g_object_class_install_property
 		(gobject_class,
@@ -221,14 +210,14 @@
 
 
 static GObject*
-kz_copy_format_dialog_constructor (GType                  type,
-				   guint                  n_props,
-			     	   GObjectConstructParam *props)
+constructor (GType                  type,
+	     guint                  n_props,
+	     GObjectConstructParam *props)
 {
 	GtkWidget *widget;
 	KzCopyFormatDialog *copy_format;
 	GObject *object;
-	GObjectClass *klass = G_OBJECT_CLASS(parent_class);
+	GObjectClass *klass = G_OBJECT_CLASS(kz_copy_format_dialog_parent_class);
 	GList *list = NULL, *node;
 
 	object = klass->constructor(type, n_props, props);
@@ -268,7 +257,7 @@
 
 
 static void
-kz_copy_format_dialog_dispose (GObject *object)
+dispose (GObject *object)
 {
 	KzCopyFormatDialog *copy_format = KZ_COPY_FORMAT_DIALOG(object);
 
@@ -284,16 +273,16 @@
 		copy_format->list_store = NULL;
 	}
 
-	if (G_OBJECT_CLASS (parent_class)->dispose)
-		G_OBJECT_CLASS (parent_class)->dispose(object);
+	if (G_OBJECT_CLASS (kz_copy_format_dialog_parent_class)->dispose)
+		G_OBJECT_CLASS (kz_copy_format_dialog_parent_class)->dispose(object);
 }
 
 
 static void
-kz_copy_format_dialog_set_property (GObject         *object,
-				    guint            prop_id,
-				    const GValue    *value,
-				    GParamSpec      *pspec)
+set_property (GObject         *object,
+	      guint            prop_id,
+	      const GValue    *value,
+	      GParamSpec      *pspec)
 {
 	KzCopyFormatDialog *copy_format = KZ_COPY_FORMAT_DIALOG(object);
   
@@ -310,10 +299,10 @@
 
 
 static void
-kz_copy_format_dialog_get_property (GObject         *object,
-				    guint            prop_id,
-				    GValue          *value,
-				    GParamSpec      *pspec)
+get_property (GObject         *object,
+	      guint            prop_id,
+	      GValue          *value,
+	      GParamSpec      *pspec)
 {
 	KzCopyFormatDialog *copy_format = KZ_COPY_FORMAT_DIALOG(object);
 
@@ -343,7 +332,7 @@
 
 
 static void
-kz_copy_format_dialog_response (GtkDialog *dialog, gint arg)
+response (GtkDialog *dialog, gint arg)
 {
 	KzCopyFormatDialog *copy_format;
 
Index: kazehakase/src/dialogs/kz-links-dialog.c
diff -u kazehakase/src/dialogs/kz-links-dialog.c:1.8 kazehakase/src/dialogs/kz-links-dialog.c:1.9
--- kazehakase/src/dialogs/kz-links-dialog.c:1.8	Tue May 16 14:03:09 2006
+++ kazehakase/src/dialogs/kz-links-dialog.c	Sat Dec  2 22:07:08 2006
@@ -25,7 +25,6 @@
 #include <glib/gi18n.h>
 #include <glib/gstdio.h>
 
-#include "gobject-utils.h"
 #include "kz-bookmark-filter.h"
 #include "kz-icons.h"
 
@@ -48,22 +47,20 @@
 	N_COLUMNS
 };
 
-static void     kz_links_dialog_class_init         (KzLinksDialogClass *klass);
-static void     kz_links_dialog_init               (KzLinksDialog  *kzlinks);
-static GObject *kz_links_dialog_constructor        (GType           type,
-						    guint           n_props,
-						    GObjectConstructParam *props);
-static void     kz_links_dialog_dispose            (GObject        *object);
-static void     kz_links_dialog_set_property       (GObject       *object,
-						    guint          prop_id,
-						    const GValue  *value,
-						    GParamSpec    *pspec);
-static void     kz_links_dialog_get_property       (GObject       *object,
-						    guint          prop_id,
-						    GValue        *value,
-						    GParamSpec    *pspec);
-static void     kz_links_dialog_response           (GtkDialog      *dialog,
-						    gint            arg);
+static GObject *constructor        (GType           type,
+				    guint           n_props,
+				    GObjectConstructParam *props);
+static void     dispose            (GObject        *object);
+static void     set_property       (GObject       *object,
+				    guint          prop_id,
+				    const GValue  *value,
+				    GParamSpec    *pspec);
+static void     get_property       (GObject       *object,
+				    guint          prop_id,
+				    GValue        *value,
+				    GParamSpec    *pspec);
+static void     response           (GtkDialog      *dialog,
+				    gint            arg);
 
 static void     cb_parent_destroy                  (GtkWidget      *widget,
 						    KzLinksDialog  *kzlinks);
@@ -81,12 +78,7 @@
 						    gchar          *path_str,
 						    KzLinksDialog  *kzlinks);
 
-static GtkDialogClass *parent_class = NULL;
-
-
-KZ_OBJECT_GET_TYPE(kz_links_dialog, "KzLinksDialog", KzLinksDialog,
-		   kz_links_dialog_class_init, kz_links_dialog_init,
-		   GTK_TYPE_DIALOG)
+G_DEFINE_TYPE(KzLinksDialog, kz_links_dialog, GTK_TYPE_DIALOG)
 
 static void
 kz_links_dialog_class_init (KzLinksDialogClass *klass)
@@ -94,19 +86,16 @@
 	GObjectClass *gobject_class;
 	GtkDialogClass *dialog_class;
 
-	parent_class = g_type_class_peek_parent (klass);
-
 	gobject_class = (GObjectClass *) klass;
 	dialog_class  = (GtkDialogClass *) klass;
 
-	/* GtkObject signals */
-	gobject_class->constructor  = kz_links_dialog_constructor;
-	gobject_class->dispose      = kz_links_dialog_dispose;
-	gobject_class->set_property = kz_links_dialog_set_property;
-	gobject_class->get_property = kz_links_dialog_get_property;
+	gobject_class->constructor  = constructor;
+	gobject_class->dispose      = dispose;
+	gobject_class->set_property = set_property;
+	gobject_class->get_property = get_property;
 
 	/* GtkDialog signals */
-	dialog_class->response = kz_links_dialog_response;
+	dialog_class->response = response;
 
 	g_object_class_install_property
 		(gobject_class,
@@ -222,14 +211,14 @@
 
 
 static GObject*
-kz_links_dialog_constructor (GType                  type,
-			     guint                  n_props,
-			     GObjectConstructParam *props)
+constructor (GType                  type,
+	     guint                  n_props,
+	     GObjectConstructParam *props)
 {
 	GtkWidget *widget;
 	KzLinksDialog *kzlinks;
 	GObject *object;
-	GObjectClass *klass = G_OBJECT_CLASS(parent_class);
+	GObjectClass *klass = G_OBJECT_CLASS(kz_links_dialog_parent_class);
 	GList *list = NULL, *node;
 	gboolean result;
 	gchar buf[256];
@@ -279,7 +268,7 @@
 
 
 static void
-kz_links_dialog_dispose (GObject *object)
+dispose (GObject *object)
 {
 	KzLinksDialog *kzlinks = KZ_LINKS_DIALOG(object);
 
@@ -309,16 +298,16 @@
 		kzlinks->list_store= NULL;
 	}
 
-	if (G_OBJECT_CLASS (parent_class)->dispose)
-		G_OBJECT_CLASS (parent_class)->dispose(object);
+	if (G_OBJECT_CLASS (kz_links_dialog_parent_class)->dispose)
+		G_OBJECT_CLASS (kz_links_dialog_parent_class)->dispose(object);
 }
 
 
 static void
-kz_links_dialog_set_property (GObject         *object,
-			      guint            prop_id,
-			      const GValue    *value,
-			      GParamSpec      *pspec)
+set_property (GObject         *object,
+	      guint            prop_id,
+	      const GValue    *value,
+	      GParamSpec      *pspec)
 {
 	KzLinksDialog *kzlinks = KZ_LINKS_DIALOG(object);
   
@@ -341,10 +330,10 @@
 
 
 static void
-kz_links_dialog_get_property (GObject         *object,
-			      guint            prop_id,
-			      GValue          *value,
-			      GParamSpec      *pspec)
+get_property (GObject         *object,
+	      guint            prop_id,
+	      GValue          *value,
+	      GParamSpec      *pspec)
 {
 	KzLinksDialog *kzlinks = KZ_LINKS_DIALOG(object);
 
@@ -495,7 +484,7 @@
 
 
 static void
-kz_links_dialog_response (GtkDialog *dialog, gint arg)
+response (GtkDialog *dialog, gint arg)
 {
 	KzLinksDialog *kzlinks;
 	GtkTreeSelection *selection;
Index: kazehakase/src/dialogs/kz-password-manager-dialog.c
diff -u kazehakase/src/dialogs/kz-password-manager-dialog.c:1.4 kazehakase/src/dialogs/kz-password-manager-dialog.c:1.5
--- kazehakase/src/dialogs/kz-password-manager-dialog.c:1.4	Thu Jul 14 11:52:33 2005
+++ kazehakase/src/dialogs/kz-password-manager-dialog.c	Sat Dec  2 22:07:08 2006
@@ -25,7 +25,6 @@
 #include <gdk/gdkkeysyms.h>
 #include <glib/gi18n.h>
 
-#include "gobject-utils.h"
 #include "mozilla.h"
 #include "kz-icons.h"
 
@@ -41,32 +40,25 @@
 	N_COLUMNS
 };
 
-static void     kz_password_manager_dialog_class_init         (KzPasswordManagerDialogClass *klass);
-static void     kz_password_manager_dialog_init               (KzPasswordManagerDialog  *password_manager);
-static GObject *kz_password_manager_dialog_constructor        (GType           type,
-							       guint           n_props,
-							       GObjectConstructParam *props);
-static void     kz_password_manager_dialog_dispose            (GObject        *object);
-static void     kz_password_manager_dialog_set_property       (GObject       *object,
-							       guint          prop_id,
-							       const GValue  *value,
-							       GParamSpec    *pspec);
-static void     kz_password_manager_dialog_get_property       (GObject       *object,
-							       guint          prop_id,
-							       GValue        *value,
-							       GParamSpec    *pspec);
-static void     kz_password_manager_dialog_response           (GtkDialog      *dialog,
-							       gint            arg);
+static GObject *constructor        (GType           type,
+				    guint           n_props,
+				    GObjectConstructParam *props);
+static void     dispose            (GObject        *object);
+static void     set_property       (GObject       *object,
+				    guint          prop_id,
+				    const GValue  *value,
+				    GParamSpec    *pspec);
+static void     get_property       (GObject       *object,
+				    guint          prop_id,
+				    GValue        *value,
+				    GParamSpec    *pspec);
+static void     response           (GtkDialog      *dialog,
+				    gint            arg);
 
 static void     cb_remove_button_clicked           (GtkWidget      *widget,
 						    KzPasswordManagerDialog  *password_manager);
 
-static GtkDialogClass *parent_class = NULL;
-
-
-KZ_OBJECT_GET_TYPE(kz_password_manager_dialog, "KzPasswordManagerDialog", KzPasswordManagerDialog,
-		   kz_password_manager_dialog_class_init, kz_password_manager_dialog_init,
-		   GTK_TYPE_DIALOG)
+G_DEFINE_TYPE(KzPasswordManagerDialog, kz_password_manager_dialog, GTK_TYPE_DIALOG)
 
 static void
 kz_password_manager_dialog_class_init (KzPasswordManagerDialogClass *klass)
@@ -74,19 +66,16 @@
 	GObjectClass *gobject_class;
 	GtkDialogClass *dialog_class;
 
-	parent_class = g_type_class_peek_parent (klass);
-
 	gobject_class = (GObjectClass *) klass;
 	dialog_class  = (GtkDialogClass *) klass;
 
-	/* GtkObject signals */
-	gobject_class->constructor  = kz_password_manager_dialog_constructor;
-	gobject_class->dispose      = kz_password_manager_dialog_dispose;
-	gobject_class->set_property = kz_password_manager_dialog_set_property;
-	gobject_class->get_property = kz_password_manager_dialog_get_property;
+	gobject_class->constructor  = constructor;
+	gobject_class->dispose      = dispose;
+	gobject_class->set_property = set_property;
+	gobject_class->get_property = get_property;
 
 	/* GtkDialog signals */
-	dialog_class->response = kz_password_manager_dialog_response;
+	dialog_class->response = response;
 
 	g_object_class_install_property
 		(gobject_class,
@@ -182,14 +171,14 @@
 
 
 static GObject*
-kz_password_manager_dialog_constructor (GType                  type,
-			     		guint                  n_props,
-			     		GObjectConstructParam *props)
+constructor (GType                  type,
+	     guint                  n_props,
+	     GObjectConstructParam *props)
 {
 	GtkWidget *widget;
 	KzPasswordManagerDialog *password_manager;
 	GObject *object;
-	GObjectClass *klass = G_OBJECT_CLASS(parent_class);
+	GObjectClass *klass = G_OBJECT_CLASS(kz_password_manager_dialog_parent_class);
 	GList *list = NULL, *node;
 	gboolean result;
 
@@ -228,7 +217,7 @@
 
 
 static void
-kz_password_manager_dialog_dispose (GObject *object)
+dispose (GObject *object)
 {
 	KzPasswordManagerDialog *password_manager = KZ_PASSWORD_MANAGER_DIALOG(object);
 
@@ -244,16 +233,16 @@
 		password_manager->list_store = NULL;
 	}
 
-	if (G_OBJECT_CLASS (parent_class)->dispose)
-		G_OBJECT_CLASS (parent_class)->dispose(object);
+	if (G_OBJECT_CLASS (kz_password_manager_dialog_parent_class)->dispose)
+		G_OBJECT_CLASS (kz_password_manager_dialog_parent_class)->dispose(object);
 }
 
 
 static void
-kz_password_manager_dialog_set_property (GObject         *object,
-					 guint            prop_id,
-					 const GValue    *value,
-					 GParamSpec      *pspec)
+set_property (GObject         *object,
+	      guint            prop_id,
+	      const GValue    *value,
+	      GParamSpec      *pspec)
 {
 	KzPasswordManagerDialog *password_manager = KZ_PASSWORD_MANAGER_DIALOG(object);
   
@@ -270,10 +259,10 @@
 
 
 static void
-kz_password_manager_dialog_get_property (GObject         *object,
-					 guint            prop_id,
-					 GValue          *value,
-					 GParamSpec      *pspec)
+get_property (GObject         *object,
+	      guint            prop_id,
+	      GValue          *value,
+	      GParamSpec      *pspec)
 {
 	KzPasswordManagerDialog *password_manager = KZ_PASSWORD_MANAGER_DIALOG(object);
 
@@ -303,7 +292,7 @@
 
 
 static void
-kz_password_manager_dialog_response (GtkDialog *dialog, gint arg)
+response (GtkDialog *dialog, gint arg)
 {
 	KzPasswordManagerDialog *password_manager;
 
Index: kazehakase/src/dialogs/kz-print-dialog.c
diff -u kazehakase/src/dialogs/kz-print-dialog.c:1.12 kazehakase/src/dialogs/kz-print-dialog.c:1.13
--- kazehakase/src/dialogs/kz-print-dialog.c:1.12	Thu May 11 10:36:59 2006
+++ kazehakase/src/dialogs/kz-print-dialog.c	Sat Dec  2 22:07:08 2006
@@ -22,7 +22,6 @@
 #include "kz-print-dialog.h"
 
 #include <glib/gi18n.h>
-#include "gobject-utils.h"
 #include "kz-icons.h"
 
 enum {
@@ -46,20 +45,18 @@
 };
 #define KZ_PRINT_DIALOG_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), KZ_TYPE_PRINT_DIALOG, KzPrintDialogPrivate))
 
-static void     kz_print_dialog_class_init         (KzPrintDialogClass *klass);
-static void     kz_print_dialog_init               (KzPrintDialog  *print);
-static GObject *kz_print_dialog_constructor        (GType           type,
-						    guint           n_props,
-						    GObjectConstructParam *props);
-static void     kz_print_dialog_dispose            (GObject        *object);
-static void     kz_print_dialog_set_property       (GObject       *object,
-						    guint          prop_id,
-						    const GValue  *value,
-						    GParamSpec    *pspec);
-static void     kz_print_dialog_get_property       (GObject       *object,
-						    guint          prop_id,
-						    GValue        *value,
-						    GParamSpec    *pspec);
+static GObject *constructor        (GType           type,
+				    guint           n_props,
+				    GObjectConstructParam *props);
+static void     dispose            (GObject        *object);
+static void     set_property       (GObject       *object,
+				    guint          prop_id,
+				    const GValue  *value,
+				    GParamSpec    *pspec);
+static void     get_property       (GObject       *object,
+				    guint          prop_id,
+				    GValue        *value,
+				    GParamSpec    *pspec);
 
 static void     cb_print_to_file_toggled           (GtkToggleButton *button,
 						    KzPrintDialog   *print);
@@ -68,12 +65,7 @@
 static void     cb_save_as_button_clicked          (GtkWidget       *widget,
 						    KzPrintDialog   *print);
 
-static GtkDialogClass *parent_class = NULL;
-
-
-KZ_OBJECT_GET_TYPE(kz_print_dialog, "KzPrintDialog", KzPrintDialog,
-		   kz_print_dialog_class_init, kz_print_dialog_init,
-		   GTK_TYPE_DIALOG)
+G_DEFINE_TYPE(KzPrintDialog, kz_print_dialog, GTK_TYPE_DIALOG)
 
 static void
 free_print_info (KzPrintDialog *print)
@@ -94,15 +86,12 @@
 {
 	GObjectClass *gobject_class;
 
-	parent_class = g_type_class_peek_parent (klass);
-
 	gobject_class = (GObjectClass *) klass;
 
-	/* GtkObject signals */
-	gobject_class->constructor  = kz_print_dialog_constructor;
-	gobject_class->dispose      = kz_print_dialog_dispose;
-	gobject_class->set_property = kz_print_dialog_set_property;
-	gobject_class->get_property = kz_print_dialog_get_property;
+	gobject_class->constructor  = constructor;
+	gobject_class->dispose      = dispose;
+	gobject_class->set_property = set_property;
+	gobject_class->get_property = get_property;
 
 	g_object_class_install_property
 		(gobject_class,
@@ -267,14 +256,14 @@
 
 
 static GObject*
-kz_print_dialog_constructor (GType                  type,
-			     guint                  n_props,
-			     GObjectConstructParam *props)
+constructor (GType                  type,
+	     guint                  n_props,
+	     GObjectConstructParam *props)
 {
 	GtkWidget *widget, *embed;
 	KzPrintDialog *print;
 	GObject *object;
-	GObjectClass *klass = G_OBJECT_CLASS(parent_class);
+	GObjectClass *klass = G_OBJECT_CLASS(kz_print_dialog_parent_class);
 	KzPrintDialogPrivate *priv;
 
 	object = klass->constructor(type, n_props, props);
@@ -311,7 +300,7 @@
 
 
 static void
-kz_print_dialog_dispose (GObject *object)
+dispose (GObject *object)
 {
 	KzPrintDialog *print = KZ_PRINT_DIALOG(object);
 
@@ -323,16 +312,16 @@
 
 	free_print_info (print);
 
-	if (G_OBJECT_CLASS (parent_class)->dispose)
-		G_OBJECT_CLASS (parent_class)->dispose(object);
+	if (G_OBJECT_CLASS (kz_print_dialog_parent_class)->dispose)
+		G_OBJECT_CLASS (kz_print_dialog_parent_class)->dispose(object);
 }
 
 
 static void
-kz_print_dialog_set_property (GObject         *object,
-			      guint            prop_id,
-			      const GValue    *value,
-			      GParamSpec      *pspec)
+set_property (GObject         *object,
+	      guint            prop_id,
+	      const GValue    *value,
+	      GParamSpec      *pspec)
 {
 	KzPrintDialog *print = KZ_PRINT_DIALOG(object);
   
@@ -349,10 +338,10 @@
 
 
 static void
-kz_print_dialog_get_property (GObject         *object,
-			      guint            prop_id,
-			      GValue          *value,
-			      GParamSpec      *pspec)
+get_property (GObject         *object,
+	      guint            prop_id,
+	      GValue          *value,
+	      GParamSpec      *pspec)
 {
 	KzPrintDialog *print = KZ_PRINT_DIALOG(object);
 
Index: kazehakase/src/dialogs/kz-prompt-dialog.c
diff -u kazehakase/src/dialogs/kz-prompt-dialog.c:1.10 kazehakase/src/dialogs/kz-prompt-dialog.c:1.11
--- kazehakase/src/dialogs/kz-prompt-dialog.c:1.10	Tue Sep  6 09:51:44 2005
+++ kazehakase/src/dialogs/kz-prompt-dialog.c	Sat Dec  2 22:07:08 2006
@@ -29,7 +29,6 @@
 #include <gdk/gdkkeysyms.h>
 #include <glib/gi18n.h>
 
-#include "gobject-utils.h"
 #include "kz-icons.h"
 
 #define EMBED_MAX_BUTTONS 3
@@ -101,43 +100,33 @@
 	  INCLUDE_CHECKBOX,       GTK_STOCK_DIALOG_QUESTION }   // UNIVERSAL
 };
 
-static void     kz_prompt_dialog_class_init         (KzPromptDialogClass *klass);
-static void     kz_prompt_dialog_init               (KzPromptDialog  *prompt);
-static GObject *kz_prompt_dialog_constructor        (GType           type,
-						     guint           n_props,
-						     GObjectConstructParam *props);
-static void     kz_prompt_dialog_dispose            (GObject        *object);
-static void     kz_prompt_dialog_set_property       (GObject       *object,
-						     guint          prop_id,
-						     const GValue  *value,
-						     GParamSpec    *pspec);
-static void     kz_prompt_dialog_get_property       (GObject       *object,
-						     guint          prop_id,
-						     GValue        *value,
-						     GParamSpec    *pspec);
+static GObject *constructor        (GType           type,
+				    guint           n_props,
+				    GObjectConstructParam *props);
+static void     dispose            (GObject        *object);
+static void     set_property       (GObject       *object,
+				    guint          prop_id,
+				    const GValue  *value,
+				    GParamSpec    *pspec);
+static void     get_property       (GObject       *object,
+				    guint          prop_id,
+				    GValue        *value,
+				    GParamSpec    *pspec);
 static void     kz_prompt_dialog_save_dialog_values (KzPromptDialog *prompt);
 
-static GtkDialogClass *parent_class = NULL;
-
-
-KZ_OBJECT_GET_TYPE(kz_prompt_dialog, "KzPromptDialog", KzPromptDialog,
-		   kz_prompt_dialog_class_init, kz_prompt_dialog_init,
-		   GTK_TYPE_DIALOG)
+G_DEFINE_TYPE(KzPromptDialog, kz_prompt_dialog, GTK_TYPE_DIALOG)
 
 static void
 kz_prompt_dialog_class_init (KzPromptDialogClass *klass)
 {
 	GObjectClass *gobject_class;
 
-	parent_class = g_type_class_peek_parent (klass);
-
 	gobject_class = (GObjectClass *) klass;
 
-	/* GtkObject signals */
-	gobject_class->constructor  = kz_prompt_dialog_constructor;
-	gobject_class->dispose      = kz_prompt_dialog_dispose;
-	gobject_class->set_property = kz_prompt_dialog_set_property;
-	gobject_class->get_property = kz_prompt_dialog_get_property;
+	gobject_class->constructor  = constructor;
+	gobject_class->dispose      = dispose;
+	gobject_class->set_property = set_property;
+	gobject_class->get_property = get_property;
 
 	g_object_class_install_property
 		(gobject_class,
@@ -228,14 +217,14 @@
 
 
 static GObject*
-kz_prompt_dialog_constructor (GType                  type,
-			      guint                  n_props,
-			      GObjectConstructParam *props)
+constructor (GType                  type,
+	     guint                  n_props,
+	     GObjectConstructParam *props)
 {
 	KzPromptDialog *prompt;
 	KzPromptDialogPrivate *priv;
 	GObject *object;
-	GObjectClass *klass = G_OBJECT_CLASS(parent_class);
+	GObjectClass *klass = G_OBJECT_CLASS(kz_prompt_dialog_parent_class);
 	gint prompt_type;
 	int widgetFlags;
 
@@ -308,7 +297,6 @@
 		gtk_box_pack_start(GTK_BOX(priv->content_vbox), priv->text_field, FALSE, FALSE, 0);
 	}
 
-	// Add a checkbox
 	if (widgetFlags & INCLUDE_CHECKBOX)
 	{
 		priv->check_box = gtk_check_button_new_with_label(NULL);
@@ -316,10 +304,8 @@
 		gtk_box_pack_start(GTK_BOX(priv->content_vbox), priv->check_box, FALSE, FALSE, 0);
 	}
 
-	// Add a dropdown menu
 	if (prompt_type == TYPE_SELECT) 
 	{
-		// Build up a GtkMenu containing the items
 		priv->combo_box = gtk_combo_box_new_text();
 
 		gtk_box_pack_start(GTK_BOX(priv->content_vbox), priv->combo_box, FALSE, FALSE, 0);
@@ -332,7 +318,6 @@
 	else 
 	{
 		GtkWidget* okButton;
-		// Create standard ok and cancel buttons
 		if (widgetFlags & INCLUDE_CANCEL)
 			gtk_dialog_add_button(GTK_DIALOG(prompt), GTK_STOCK_CANCEL,
 					GTK_RESPONSE_CANCEL);
@@ -348,7 +333,7 @@
 
 
 static void
-kz_prompt_dialog_dispose (GObject *object)
+dispose (GObject *object)
 {
 	KzPromptDialogPrivate *priv = KZ_PROMPT_DIALOG_GET_PRIVATE (object);
 
@@ -367,16 +352,16 @@
 	priv->pass         = NULL;
 	priv->parent_window = NULL;
 
-	if (G_OBJECT_CLASS (parent_class)->dispose)
-		G_OBJECT_CLASS (parent_class)->dispose(object);
+	if (G_OBJECT_CLASS (kz_prompt_dialog_parent_class)->dispose)
+		G_OBJECT_CLASS (kz_prompt_dialog_parent_class)->dispose(object);
 }
 
 
 static void
-kz_prompt_dialog_set_property (GObject         *object,
-			       guint            prop_id,
-			       const GValue    *value,
-			       GParamSpec      *pspec)
+set_property (GObject         *object,
+	      guint            prop_id,
+	      const GValue    *value,
+	      GParamSpec      *pspec)
 {
 	KzPromptDialogPrivate *priv = KZ_PROMPT_DIALOG_GET_PRIVATE (object);
   
@@ -396,10 +381,10 @@
 
 
 static void
-kz_prompt_dialog_get_property (GObject         *object,
-			       guint            prop_id,
-			       GValue          *value,
-			       GParamSpec      *pspec)
+get_property (GObject         *object,
+	      guint            prop_id,
+	      GValue          *value,
+	      GParamSpec      *pspec)
 {
 	KzPromptDialogPrivate *priv = KZ_PROMPT_DIALOG_GET_PRIVATE (object);
 


More information about the Kazehakase-cvs mailing list
Back to archive index