aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/menus
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2002-11-14 06:53:58 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2002-11-14 06:53:58 +0800
commitd023f5d548b85095292e2491eda6c9b0a5f83aae (patch)
treec27e2528ea7e3a47cd27a0b5144bd64ed6637ddb /widgets/menus
parent5bf1afd678c6407c7018ae8addda74e0c4040811 (diff)
downloadgsoc2013-evolution-d023f5d548b85095292e2491eda6c9b0a5f83aae.tar
gsoc2013-evolution-d023f5d548b85095292e2491eda6c9b0a5f83aae.tar.gz
gsoc2013-evolution-d023f5d548b85095292e2491eda6c9b0a5f83aae.tar.bz2
gsoc2013-evolution-d023f5d548b85095292e2491eda6c9b0a5f83aae.tar.lz
gsoc2013-evolution-d023f5d548b85095292e2491eda6c9b0a5f83aae.tar.xz
gsoc2013-evolution-d023f5d548b85095292e2491eda6c9b0a5f83aae.tar.zst
gsoc2013-evolution-d023f5d548b85095292e2491eda6c9b0a5f83aae.zip
menus/gal-view-menus.h GObjectified.
* menus/gal-view-menus.h * menus/gal-view-menus.c: GObjectified. * e-timezone-dialog/e-timezone-dialog.h * e-timezone-dialog/e-timezone-dialog.c: GObjectified. svn path=/trunk/; revision=18747
Diffstat (limited to 'widgets/menus')
-rw-r--r--widgets/menus/gal-view-menus.c66
-rw-r--r--widgets/menus/gal-view-menus.h7
2 files changed, 33 insertions, 40 deletions
diff --git a/widgets/menus/gal-view-menus.c b/widgets/menus/gal-view-menus.c
index 2be45363cb..0652131f3c 100644
--- a/widgets/menus/gal-view-menus.c
+++ b/widgets/menus/gal-view-menus.c
@@ -42,9 +42,9 @@ typedef struct {
int ref_count;
} ListenerClosure;
-#define PARENT_TYPE (gtk_object_get_type())
+#define PARENT_TYPE G_TYPE_OBJECT
-static GtkObjectClass *gvm_parent_class;
+static GObjectClass *gvm_parent_class;
static void collection_changed (GalViewCollection *collection,
GalViewMenus *gvm);
static void instance_changed (GalViewInstance *instance,
@@ -61,7 +61,7 @@ closure_free (void *data, void *user_data)
closure->ref_count --;
if (closure->ref_count == 0) {
- gtk_object_unref(GTK_OBJECT(closure->instance));
+ g_object_unref (closure->instance);
bonobo_ui_component_remove_listener (gvm->priv->component, closure->id);
g_free (closure);
@@ -80,9 +80,9 @@ closure_copy (const void *data, void *user_data)
static void
remove_listeners (GalViewMenus *gvm)
{
- if (gvm->priv->listenerClosures) {
- gtk_object_unref (GTK_OBJECT(gvm->priv->listenerClosures));
- }
+ if (gvm->priv->listenerClosures)
+ g_object_unref (gvm->priv->listenerClosures);
+
gvm->priv->listenerClosures = NULL;
}
@@ -96,17 +96,17 @@ remove_instance (GalViewMenus *gvm)
{
if (gvm->priv->instance) {
if (gvm->priv->instance_changed_id != 0)
- gtk_signal_disconnect(GTK_OBJECT(gvm->priv->instance), gvm->priv->instance_changed_id);
+ g_signal_handler_disconnect (gvm->priv->instance, gvm->priv->instance_changed_id);
if (gvm->priv->instance->collection && gvm->priv->collection_changed_id != 0)
- gtk_signal_disconnect(GTK_OBJECT(gvm->priv->instance->collection), gvm->priv->collection_changed_id);
+ g_signal_handler_disconnect (gvm->priv->instance->collection, gvm->priv->collection_changed_id);
}
gvm->priv->instance_changed_id = 0;
gvm->priv->collection_changed_id = 0;
if (gvm->priv->instance)
- gtk_object_unref(GTK_OBJECT(gvm->priv->instance));
+ g_object_unref (gvm->priv->instance);
remove_listeners(gvm);
remove_xml(gvm);
@@ -116,7 +116,7 @@ static void
add_instance (GalViewMenus *gvm,
GalViewInstance *instance)
{
- gtk_object_ref(GTK_OBJECT(instance));
+ g_object_ref (instance);
if (gvm->priv->instance != NULL)
remove_instance (gvm);
@@ -125,24 +125,22 @@ add_instance (GalViewMenus *gvm,
gal_view_instance_load (gvm->priv->instance);
- gvm->priv->instance_changed_id = gtk_signal_connect
- (GTK_OBJECT(instance), "changed",
- GTK_SIGNAL_FUNC(instance_changed), gvm);
- gvm->priv->collection_changed_id = gtk_signal_connect
- (GTK_OBJECT(instance->collection), "changed",
- GTK_SIGNAL_FUNC(collection_changed), gvm);
-
+ gvm->priv->instance_changed_id = g_signal_connect (instance, "changed",
+ G_CALLBACK (instance_changed), gvm);
+ gvm->priv->collection_changed_id = g_signal_connect (instance->collection, "changed",
+ G_CALLBACK (collection_changed), gvm);
}
static void
-clear_define_views_dialog (gpointer data)
+clear_define_views_dialog (gpointer data,
+ GObject *where_the_object_was)
{
GalViewMenus *gvm = GAL_VIEW_MENUS (data);
gvm->priv->define_views_dialog = NULL;
}
static void
-gvm_destroy (GtkObject *object)
+gvm_finalize (GObject *object)
{
GalViewMenus *gvm = GAL_VIEW_MENUS (object);
@@ -150,23 +148,20 @@ gvm_destroy (GtkObject *object)
gal_view_menus_unmerge (gvm, NULL);
- if (gvm->priv->define_views_dialog) {
- gtk_object_weakunref (GTK_OBJECT (gvm->priv->define_views_dialog),
- clear_define_views_dialog,
- gvm);
- }
+ if (gvm->priv->define_views_dialog)
+ g_object_weak_unref (gvm->priv->define_views_dialog, clear_define_views_dialog, gvm);
+
g_free(gvm->priv);
- gvm->priv = NULL;
- GTK_OBJECT_CLASS (gvm_parent_class)->destroy (object);
+ (* G_OBJECT_CLASS (gvm_parent_class)->finalize) (object);
}
static void
-gvm_class_init (GtkObjectClass *klass)
+gvm_class_init (GObjectClass *klass)
{
gvm_parent_class = gtk_type_class (PARENT_TYPE);
- klass->destroy = gvm_destroy;
+ klass->finalize = gvm_finalize;
}
static void
@@ -192,7 +187,7 @@ gal_view_menus_new (GalViewInstance *instance)
g_return_val_if_fail (instance != NULL, NULL);
g_return_val_if_fail (GAL_IS_VIEW_INSTANCE (instance), NULL);
- gvm = gtk_type_new (GAL_VIEW_MENUS_TYPE);
+ gvm = g_object_new (GAL_VIEW_MENUS_TYPE, NULL);
gal_view_menus_construct(gvm, instance);
return gvm;
@@ -231,12 +226,9 @@ define_views(BonoboUIComponent *component,
} else {
GtkWidget *dialog = gal_define_views_dialog_new(menus->priv->instance->collection);
- gtk_signal_connect(GTK_OBJECT(dialog), "clicked",
- GTK_SIGNAL_FUNC(dialog_clicked), menus);
+ g_signal_connect (dialog, "clicked", G_CALLBACK (dialog_clicked), menus);
menus->priv->define_views_dialog = dialog;
- gtk_object_weakref (GTK_OBJECT (dialog),
- clear_define_views_dialog,
- menus);
+ g_object_weak_ref (G_OBJECT (dialog), clear_define_views_dialog, menus);
gtk_widget_show(dialog);
}
}
@@ -332,7 +324,7 @@ build_menus(GalViewMenus *menus)
found = TRUE;
}
- gtk_object_ref (GTK_OBJECT(closure->instance));
+ g_object_ref (closure->instance);
bonobo_ui_component_add_listener (menus->priv->component, item->id, toggled_cb, closure);
e_list_append (menus->priv->listenerClosures, closure);
@@ -433,7 +425,7 @@ build_stuff (GalViewMenus *gvm,
{
char *xml;
- gtk_object_ref (GTK_OBJECT (gvm));
+ g_object_ref (gvm);
gal_view_menus_unmerge (gvm, ev);
@@ -447,7 +439,7 @@ build_stuff (GalViewMenus *gvm,
set_radio (gvm, ev);
- gtk_object_unref (GTK_OBJECT (gvm));
+ g_object_unref (gvm);
}
void
diff --git a/widgets/menus/gal-view-menus.h b/widgets/menus/gal-view-menus.h
index 2f113975ac..e4de898187 100644
--- a/widgets/menus/gal-view-menus.h
+++ b/widgets/menus/gal-view-menus.h
@@ -2,11 +2,12 @@
#ifndef _GAL_VIEW_MENUS_H_
#define _GAL_VIEW_MENUS_H_
-#include <gtk/gtkobject.h>
#include <libxml/tree.h>
#include <bonobo/bonobo-ui-component.h>
#include <gal/menus/gal-view-instance.h>
+#include <glib-object.h>
+
#define GAL_VIEW_MENUS_TYPE (gal_view_menus_get_type ())
#define GAL_VIEW_MENUS(o) (GTK_CHECK_CAST ((o), GAL_VIEW_MENUS_TYPE, GalViewMenus))
#define GAL_VIEW_MENUS_CLASS(k) (GTK_CHECK_CLASS_CAST((k), GAL_VIEW_MENUS_TYPE, GalViewMenusClass))
@@ -16,12 +17,12 @@
typedef struct _GalViewMenusPrivate GalViewMenusPrivate;
typedef struct {
- GtkObject base;
+ GObject base;
GalViewMenusPrivate *priv;
} GalViewMenus;
typedef struct {
- GtkObjectClass parent_class;
+ GObjectClass parent_class;
} GalViewMenusClass;
GtkType gal_view_menus_get_type (void);