diff options
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/ChangeLog | 14 | ||||
-rw-r--r-- | addressbook/conduit/address-conduit.c | 46 | ||||
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-editor.c | 2 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-view.c | 17 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard-view-widget.c | 43 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard.c | 36 | ||||
-rw-r--r-- | addressbook/gui/widgets/eab-contact-display.h | 2 | ||||
-rw-r--r-- | addressbook/printing/e-contact-print-style-editor.c | 95 | ||||
-rw-r--r-- | addressbook/printing/e-contact-print-style-editor.h | 10 |
9 files changed, 122 insertions, 143 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index fada560f7b..6d065289c4 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,17 @@ +2008-05-22 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes part of bug #534360 + + * conduit/address-conduit.c: + * gui/contact-editor/e-contact-editor.c: + * gui/widgets/e-addressbook-view.c: + * gui/widgets/e-minicard-view-widget.c: + * gui/widgets/e-minicard.c: + * gui/widgets/eab-contact-display.h: + * printing/e-contact-print-style-editor.c: + * printing/e-contact-print-style-editor.h: + Migrate from deprecated GtkObject symbols to GObject equivalents. + 2008-04-30 Milan Crha <mcrha@redhat.com> ** Fix for bug #316390 diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c index 24fe81d644..7da481846b 100644 --- a/addressbook/conduit/address-conduit.c +++ b/addressbook/conduit/address-conduit.c @@ -173,8 +173,8 @@ addrconduit_load_configuration (guint32 pilot_id) g_object_ref_sink (config); if (!gnome_pilot_conduit_config_is_enabled (config, &c->sync_type)) c->sync_type = GnomePilotConduitSyncTypeNotSet; - gtk_object_unref (GTK_OBJECT (config)); - gtk_object_unref (GTK_OBJECT (management)); + g_object_unref (config); + g_object_unref (management); /* Custom settings */ gnome_config_push_prefix (prefix); @@ -1870,33 +1870,33 @@ conduit_get_gpilot_conduit (guint32 pilot_id) g_assert (retval != NULL); ctxt = e_addr_context_new (pilot_id); - gtk_object_set_data (GTK_OBJECT (retval), "addrconduit_context", ctxt); + g_object_set_data (G_OBJECT (retval), "addrconduit_context", ctxt); - gtk_signal_connect (retval, "pre_sync", (GtkSignalFunc) pre_sync, ctxt); - gtk_signal_connect (retval, "post_sync", (GtkSignalFunc) post_sync, ctxt); + g_signal_connect (retval, "pre_sync", G_CALLBACK (pre_sync), ctxt); + g_signal_connect (retval, "post_sync", G_CALLBACK (post_sync), ctxt); - gtk_signal_connect (retval, "set_pilot_id", (GtkSignalFunc) set_pilot_id, ctxt); - gtk_signal_connect (retval, "set_status_cleared", (GtkSignalFunc) set_status_cleared, ctxt); + g_signal_connect (retval, "set_pilot_id", G_CALLBACK (set_pilot_id), ctxt); + g_signal_connect (retval, "set_status_cleared", G_CALLBACK (set_status_cleared), ctxt); - gtk_signal_connect (retval, "for_each", (GtkSignalFunc) for_each, ctxt); - gtk_signal_connect (retval, "for_each_modified", (GtkSignalFunc) for_each_modified, ctxt); - gtk_signal_connect (retval, "compare", (GtkSignalFunc) compare, ctxt); + g_signal_connect (retval, "for_each", G_CALLBACK (for_each), ctxt); + g_signal_connect (retval, "for_each_modified", G_CALLBACK (for_each_modified), ctxt); + g_signal_connect (retval, "compare", G_CALLBACK (compare), ctxt); - gtk_signal_connect (retval, "add_record", (GtkSignalFunc) add_record, ctxt); - gtk_signal_connect (retval, "replace_record", (GtkSignalFunc) replace_record, ctxt); - gtk_signal_connect (retval, "delete_record", (GtkSignalFunc) delete_record, ctxt); - gtk_signal_connect (retval, "archive_record", (GtkSignalFunc) archive_record, ctxt); + g_signal_connect (retval, "add_record", G_CALLBACK (add_record), ctxt); + g_signal_connect (retval, "replace_record", G_CALLBACK (replace_record), ctxt); + g_signal_connect (retval, "delete_record", G_CALLBACK (delete_record), ctxt); + g_signal_connect (retval, "archive_record", G_CALLBACK (archive_record), ctxt); - gtk_signal_connect (retval, "match", (GtkSignalFunc) match, ctxt); - gtk_signal_connect (retval, "free_match", (GtkSignalFunc) free_match, ctxt); + g_signal_connect (retval, "match", G_CALLBACK (match), ctxt); + g_signal_connect (retval, "free_match", G_CALLBACK (free_match), ctxt); - gtk_signal_connect (retval, "prepare", (GtkSignalFunc) prepare, ctxt); + g_signal_connect (retval, "prepare", G_CALLBACK (prepare), ctxt); /* Gui Settings */ - gtk_signal_connect (retval, "create_settings_window", (GtkSignalFunc) create_settings_window, ctxt); - gtk_signal_connect (retval, "display_settings", (GtkSignalFunc) display_settings, ctxt); - gtk_signal_connect (retval, "save_settings", (GtkSignalFunc) save_settings, ctxt); - gtk_signal_connect (retval, "revert_settings", (GtkSignalFunc) revert_settings, ctxt); + g_signal_connect (retval, "create_settings_window", G_CALLBACK (create_settings_window), ctxt); + g_signal_connect (retval, "display_settings", G_CALLBACK (display_settings), ctxt); + g_signal_connect (retval, "save_settings", G_CALLBACK (save_settings), ctxt); + g_signal_connect (retval, "revert_settings", G_CALLBACK (revert_settings), ctxt); return GNOME_PILOT_CONDUIT (retval); } @@ -1906,8 +1906,8 @@ conduit_destroy_gpilot_conduit (GnomePilotConduit *conduit) { EAddrConduitContext *ctxt; - ctxt = gtk_object_get_data (GTK_OBJECT (conduit), - "addrconduit_context"); + ctxt = g_object_get_data (G_OBJECT (conduit), + "addrconduit_context"); e_addr_context_destroy (ctxt); diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index ab96508435..01561f3a89 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -3385,7 +3385,7 @@ e_contact_editor_init (EContactEditor *e_contact_editor) /* Connect to the deletion of the dialog */ g_signal_connect (e_contact_editor->app, "delete_event", - GTK_SIGNAL_FUNC (app_delete_event_cb), e_contact_editor); + G_CALLBACK (app_delete_event_cb), e_contact_editor); /* set the icon */ icon_path = g_build_filename (EVOLUTION_IMAGESDIR, "evolution-contacts-mini.png", NULL); diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 98576a9c2f..eb4c2a6a4a 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -74,7 +74,7 @@ #define d(x) static void eab_view_init (EABView *card); -static void eab_view_class_init (EABViewClass *klass); +static void eab_view_class_init (EABViewClass *class); static void eab_view_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void eab_view_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); @@ -109,8 +109,7 @@ static void search_activated (ESearchBar *esb, EABView *view); static void search_menu_activated (ESearchBar *esb, int id, EABView *view); static GList *get_master_list (gboolean force_rebuild); -#define PARENT_TYPE GTK_TYPE_VBOX -static GtkVBoxClass *parent_class = NULL; +static gpointer parent_class; /* The arguments we take */ enum { @@ -194,21 +193,20 @@ eab_view_get_type (void) (GInstanceInitFunc) eab_view_init, }; - type = g_type_register_static (PARENT_TYPE, "EABView", &info, 0); + type = g_type_register_static (GTK_TYPE_VBOX, "EABView", &info, 0); } return type; } static void -eab_view_class_init (EABViewClass *klass) +eab_view_class_init (EABViewClass *class) { GObjectClass *object_class; - object_class = G_OBJECT_CLASS(klass); - - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_peek_parent (class); + object_class = G_OBJECT_CLASS(class); object_class->set_property = eab_view_set_property; object_class->get_property = eab_view_get_property; object_class->dispose = eab_view_dispose; @@ -377,8 +375,7 @@ eab_view_dispose (GObject *object) eav->search_rule = NULL; } - if (G_OBJECT_CLASS(parent_class)->dispose) - G_OBJECT_CLASS(parent_class)->dispose(object); + G_OBJECT_CLASS (parent_class)->dispose (object); } static void diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c b/addressbook/gui/widgets/e-minicard-view-widget.c index 60f76d6edc..9ad2fe2a60 100644 --- a/addressbook/gui/widgets/e-minicard-view-widget.c +++ b/addressbook/gui/widgets/e-minicard-view-widget.c @@ -30,7 +30,7 @@ #include "e-minicard-view-widget.h" static void e_minicard_view_widget_init (EMinicardViewWidget *widget); -static void e_minicard_view_widget_class_init (EMinicardViewWidgetClass *klass); +static void e_minicard_view_widget_class_init (EMinicardViewWidgetClass *class); static void e_minicard_view_widget_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void e_minicard_view_widget_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void e_minicard_view_widget_dispose (GObject *object); @@ -40,8 +40,7 @@ static void e_minicard_view_widget_style_set (GtkWidget *widget, GtkStyle *p static void e_minicard_view_widget_realize (GtkWidget *widget); static gboolean e_minicard_view_widget_real_focus_in_event (GtkWidget *widget, GdkEventFocus *event); - -static ECanvasClass *parent_class = NULL; +static gpointer parent_class; /* The arguments we take */ enum { @@ -86,21 +85,31 @@ e_minicard_view_widget_get_type (void) } static void -e_minicard_view_widget_class_init (EMinicardViewWidgetClass *klass) +e_minicard_view_widget_class_init (EMinicardViewWidgetClass *class) { GObjectClass *object_class; GtkWidgetClass *widget_class; ECanvasClass *canvas_class; - object_class = (GObjectClass*) klass; - widget_class = GTK_WIDGET_CLASS (klass); - canvas_class = E_CANVAS_CLASS (klass); + parent_class = g_type_class_peek_parent (class); + + object_class = G_OBJECT_CLASS (class); + object_class->set_property = e_minicard_view_widget_set_property; + object_class->get_property = e_minicard_view_widget_get_property; + object_class->dispose = e_minicard_view_widget_dispose; + + widget_class = GTK_WIDGET_CLASS (class); + widget_class->style_set = e_minicard_view_widget_style_set; + widget_class->realize = e_minicard_view_widget_realize; + widget_class->size_allocate = e_minicard_view_widget_size_allocate; + widget_class->focus_in_event = e_minicard_view_widget_real_focus_in_event; - parent_class = gtk_type_class (e_canvas_get_type ()); + canvas_class = E_CANVAS_CLASS (class); + canvas_class->reflow = e_minicard_view_widget_reflow; - object_class->set_property = e_minicard_view_widget_set_property; - object_class->get_property = e_minicard_view_widget_get_property; - object_class->dispose = e_minicard_view_widget_dispose; + class->selection_change = NULL; + class->column_width_changed = NULL; + class->right_click = NULL; g_object_class_install_property (object_class, PROP_BOOK, g_param_spec_object ("book", @@ -156,18 +165,6 @@ e_minicard_view_widget_class_init (EMinicardViewWidgetClass *klass) NULL, NULL, eab_marshal_INT__POINTER, G_TYPE_INT, 1, G_TYPE_POINTER); - - widget_class->style_set = e_minicard_view_widget_style_set; - widget_class->realize = e_minicard_view_widget_realize; - widget_class->size_allocate = e_minicard_view_widget_size_allocate; - widget_class->focus_in_event = e_minicard_view_widget_real_focus_in_event; - - - canvas_class->reflow = e_minicard_view_widget_reflow; - - klass->selection_change = NULL; - klass->column_width_changed = NULL; - klass->right_click = NULL; } static void diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index f32674d55e..e35b9fb52f 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -45,7 +45,7 @@ #include "a11y/addressbook/ea-addressbook.h" static void e_minicard_init (EMinicard *card); -static void e_minicard_class_init (EMinicardClass *klass); +static void e_minicard_class_init (EMinicardClass *class); static void e_minicard_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void e_minicard_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void e_minicard_dispose (GObject *object); @@ -61,7 +61,7 @@ static void remodel( EMinicard *e_minicard ); static gint e_minicard_drag_begin (EMinicard *minicard, GdkEvent *event); -static GnomeCanvasGroupClass *parent_class = NULL; +static gpointer parent_class; #define d(x) @@ -131,19 +131,26 @@ e_minicard_get_type (void) } static void -e_minicard_class_init (EMinicardClass *klass) +e_minicard_class_init (EMinicardClass *class) { - GObjectClass *object_class = (GObjectClass*) klass; - GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) klass; + GObjectClass *object_class; + GnomeCanvasItemClass *item_class; - object_class->set_property = e_minicard_set_property; - object_class->get_property = e_minicard_get_property; - object_class->dispose = e_minicard_dispose; - object_class->finalize = e_minicard_finalize; + parent_class = g_type_class_peek_parent (class); - klass->style_set = e_minicard_style_set; + object_class = G_OBJECT_CLASS (class); + object_class->set_property = e_minicard_set_property; + object_class->get_property = e_minicard_get_property; + object_class->dispose = e_minicard_dispose; + object_class->finalize = e_minicard_finalize; - parent_class = gtk_type_class (gnome_canvas_group_get_type ()); + item_class = GNOME_CANVAS_ITEM_CLASS (class); + item_class->realize = e_minicard_realize; + item_class->unrealize = e_minicard_unrealize; + item_class->event = e_minicard_event; + + class->style_set = e_minicard_style_set; + class->selected = NULL; g_object_class_install_property (object_class, PROP_WIDTH, g_param_spec_double ("width", @@ -224,13 +231,6 @@ e_minicard_class_init (EMinicardClass *klass) G_TYPE_NONE, 1, GTK_TYPE_STYLE); - /* GnomeCanvasItem method overrides */ - item_class->realize = e_minicard_realize; - item_class->unrealize = e_minicard_unrealize; - item_class->event = e_minicard_event; - - klass->selected = NULL; - /* init the accessibility support for e_minicard */ e_minicard_a11y_init(); } diff --git a/addressbook/gui/widgets/eab-contact-display.h b/addressbook/gui/widgets/eab-contact-display.h index e1b84346e7..3661cb7034 100644 --- a/addressbook/gui/widgets/eab-contact-display.h +++ b/addressbook/gui/widgets/eab-contact-display.h @@ -51,7 +51,7 @@ struct _EABContactDisplayClass { GtkHTMLClass parent_class; }; -GtkType eab_contact_display_get_type (void); +GType eab_contact_display_get_type (void); GtkWidget * eab_contact_display_new (void); void eab_contact_display_render (EABContactDisplay *display, EContact *contact, diff --git a/addressbook/printing/e-contact-print-style-editor.c b/addressbook/printing/e-contact-print-style-editor.c index 7ae6111e06..295cbbb6f6 100644 --- a/addressbook/printing/e-contact-print-style-editor.c +++ b/addressbook/printing/e-contact-print-style-editor.c @@ -23,57 +23,47 @@ #include "e-util/e-util-private.h" static void e_contact_print_style_editor_init (EContactPrintStyleEditor *card); -static void e_contact_print_style_editor_class_init (EContactPrintStyleEditorClass *klass); -static void e_contact_print_style_editor_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); -static void e_contact_print_style_editor_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void e_contact_print_style_editor_destroy (GtkObject *object); +static void e_contact_print_style_editor_class_init (EContactPrintStyleEditorClass *class); +static void e_contact_print_style_editor_finalize (GObject *object); -static GtkVBoxClass *parent_class = NULL; +static gpointer parent_class; - -/* The arguments we take */ -enum { - ARG_0, - ARG_CARD -}; - -GtkType +GType e_contact_print_style_editor_get_type (void) { - static GtkType contact_print_style_editor_type = 0; - - if (!contact_print_style_editor_type) - { - static const GtkTypeInfo contact_print_style_editor_info = - { - "EContactPrintStyleEditor", - sizeof (EContactPrintStyleEditor), - sizeof (EContactPrintStyleEditorClass), - (GtkClassInitFunc) e_contact_print_style_editor_class_init, - (GtkObjectInitFunc) e_contact_print_style_editor_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - contact_print_style_editor_type = gtk_type_unique (gtk_vbox_get_type (), &contact_print_style_editor_info); - } - - return contact_print_style_editor_type; + static GType type = 0; + + if (G_UNLIKELY (type == 0)) { + static const GTypeInfo type_info = { + sizeof (EContactPrintStyleEditorClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) e_contact_print_style_editor_class_init, + (GClassFinalizeFunc) NULL, + NULL, /* class_data */ + sizeof (EContactPrintStyleEditor), + 0, /* n_preallocs */ + (GInstanceInitFunc) e_contact_print_style_editor_init, + NULL /* value_table */ + }; + + type = g_type_register_static ( + GTK_TYPE_VBOX, "EContactPrintStyleEditor", + &type_info, 0); + } + + return type; } static void -e_contact_print_style_editor_class_init (EContactPrintStyleEditorClass *klass) +e_contact_print_style_editor_class_init (EContactPrintStyleEditorClass *class) { - GtkObjectClass *object_class; + GObjectClass *object_class; - object_class = (GtkObjectClass*) klass; + parent_class = g_type_class_peek_parent (class); - parent_class = gtk_type_class (gtk_vbox_get_type ()); - - object_class->set_arg = e_contact_print_style_editor_set_arg; - object_class->get_arg = e_contact_print_style_editor_get_arg; - object_class->destroy = e_contact_print_style_editor_destroy; + object_class = G_OBJECT_CLASS (class); + object_class->finalize = e_contact_print_style_editor_finalize; } #if 0 @@ -113,7 +103,7 @@ e_contact_print_style_editor_init (EContactPrintStyleEditor *e_contact_print_sty } static void -e_contact_print_style_editor_destroy (GtkObject *object) +e_contact_print_style_editor_finalize (GObject *object) { EContactPrintStyleEditor *e_contact_print_style_editor = E_CONTACT_PRINT_STYLE_EDITOR(object); @@ -122,7 +112,7 @@ e_contact_print_style_editor_destroy (GtkObject *object) e_contact_print_style_editor->gui = NULL; } - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + G_OBJECT_CLASS (parent_class)->finalize (object); } GtkWidget* @@ -130,22 +120,3 @@ e_contact_print_style_editor_new (char *filename) { return g_object_new (e_contact_print_style_editor_get_type (), NULL); } - -static void -e_contact_print_style_editor_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) -{ - switch (arg_id){ - default: - break; - } -} - -static void -e_contact_print_style_editor_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) -{ - switch (arg_id) { - default: - arg->type = GTK_TYPE_INVALID; - break; - } -} diff --git a/addressbook/printing/e-contact-print-style-editor.h b/addressbook/printing/e-contact-print-style-editor.h index 0041c518da..69998dde10 100644 --- a/addressbook/printing/e-contact-print-style-editor.h +++ b/addressbook/printing/e-contact-print-style-editor.h @@ -39,10 +39,10 @@ extern "C" { */ #define E_CONTACT_PRINT_STYLE_EDITOR_TYPE (e_contact_print_style_editor_get_type ()) -#define E_CONTACT_PRINT_STYLE_EDITOR(obj) (GTK_CHECK_CAST ((obj), E_CONTACT_PRINT_STYLE_EDITOR_TYPE, EContactPrintStyleEditor)) -#define E_CONTACT_PRINT_STYLE_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_CONTACT_PRINT_STYLE_EDITOR_TYPE, EContactPrintStyleEditorClass)) -#define E_IS_MINICARD(obj) (GTK_CHECK_TYPE ((obj), E_CONTACT_PRINT_STYLE_EDITOR_TYPE)) -#define E_IS_MINICARD_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_CONTACT_PRINT_STYLE_EDITOR_TYPE)) +#define E_CONTACT_PRINT_STYLE_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_CONTACT_PRINT_STYLE_EDITOR_TYPE, EContactPrintStyleEditor)) +#define E_CONTACT_PRINT_STYLE_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_CONTACT_PRINT_STYLE_EDITOR_TYPE, EContactPrintStyleEditorClass)) +#define E_IS_MINICARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_CONTACT_PRINT_STYLE_EDITOR_TYPE)) +#define E_IS_MINICARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_CONTACT_PRINT_STYLE_EDITOR_TYPE)) typedef struct _EContactPrintStyleEditor EContactPrintStyleEditor; @@ -63,7 +63,7 @@ struct _EContactPrintStyleEditorClass GtkWidget *e_contact_print_style_editor_new(char *filename); -GtkType e_contact_print_style_editor_get_type (void); +GType e_contact_print_style_editor_get_type (void); #ifdef __cplusplus } |