diff options
author | Chris Toshok <toshok@ximian.com> | 2002-11-06 16:17:14 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2002-11-06 16:17:14 +0800 |
commit | d73b3bb496a3738d12442386231f3b2fa18967a6 (patch) | |
tree | 19e3144a5bd31fa137eabf81d575f1a5503d7448 /addressbook | |
parent | 4e57b96f83fb8d0f79b10d1b219062973a095e56 (diff) | |
download | gsoc2013-evolution-d73b3bb496a3738d12442386231f3b2fa18967a6.tar.gz gsoc2013-evolution-d73b3bb496a3738d12442386231f3b2fa18967a6.tar.zst gsoc2013-evolution-d73b3bb496a3738d12442386231f3b2fa18967a6.zip |
Port to GObject/gnome2.
2002-11-05 Chris Toshok <toshok@ximian.com>
* gui/widgets/e-addressbook-model.[ch]: Port to GObject/gnome2.
* gui/widgets/e-addressbook-reflow-adapter.c: Port to
GObject/gnome2.
* gui/widgets/e-addressbook-table-adapter.c: Port to
GObject/gnome2.
* gui/widgets/e-addressbook-util.c: Port to GObject/gnome2.
* gui/widgets/e-addressbook-view.[ch]: Port to GObject/gnome2.
* gui/widgets/e-minicard-control.c: Port to GObject/gnome2.
* gui/widgets/e-minicard-label.[ch]: Port to GObject/gnome2.
* gui/widgets/e-minicard-view-widget.[ch]: Port to GObject/gnome2.
* gui/widgets/e-minicard-view.[ch]: Port to GObject/gnome2.
* gui/widgets/e-minicard-widget-test.c: Port to GObject/gnome2.
* gui/widgets/e-minicard-widget.c: Port to GObject/gnome2.
* gui/widgets/e-minicard.[ch]: Port to GObject/gnome2.
* gui/widgets/gal-view-factory-minicard.c: Port to GObject/gnome2.
* gui/widgets/gal-view-minicard.c: Port to GObject/gnome2.
* gui/widgets/test-minicard-label.c: Port to GObject/gnome2.
* gui/widgets/test-minicard-view.c: Port to GObject/gnome2.
* gui/widgets/test-minicard.c: Port to GObject/gnome2.
* gui/widgets/test-reflow.c: Port to GObject/gnome2.
* gui/widgets/Makefile.am: typical port stuff. add marshaller
generation foo, dist it...
* gui/widgets/.cvsignore: ignore the marshaller stuff.
svn path=/trunk/; revision=18588
Diffstat (limited to 'addressbook')
28 files changed, 1110 insertions, 923 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index e4ab346549..e34b4e0109 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,5 +1,50 @@ 2002-11-05 Chris Toshok <toshok@ximian.com> + * gui/widgets/e-addressbook-model.[ch]: Port to GObject/gnome2. + + * gui/widgets/e-addressbook-reflow-adapter.c: Port to + GObject/gnome2. + + * gui/widgets/e-addressbook-table-adapter.c: Port to + GObject/gnome2. + + * gui/widgets/e-addressbook-util.c: Port to GObject/gnome2. + + * gui/widgets/e-addressbook-view.[ch]: Port to GObject/gnome2. + + * gui/widgets/e-minicard-control.c: Port to GObject/gnome2. + + * gui/widgets/e-minicard-label.[ch]: Port to GObject/gnome2. + + * gui/widgets/e-minicard-view-widget.[ch]: Port to GObject/gnome2. + + * gui/widgets/e-minicard-view.[ch]: Port to GObject/gnome2. + + * gui/widgets/e-minicard-widget-test.c: Port to GObject/gnome2. + + * gui/widgets/e-minicard-widget.c: Port to GObject/gnome2. + + * gui/widgets/e-minicard.[ch]: Port to GObject/gnome2. + + * gui/widgets/gal-view-factory-minicard.c: Port to GObject/gnome2. + + * gui/widgets/gal-view-minicard.c: Port to GObject/gnome2. + + * gui/widgets/test-minicard-label.c: Port to GObject/gnome2. + + * gui/widgets/test-minicard-view.c: Port to GObject/gnome2. + + * gui/widgets/test-minicard.c: Port to GObject/gnome2. + + * gui/widgets/test-reflow.c: Port to GObject/gnome2. + + * gui/widgets/Makefile.am: typical port stuff. add marshaller + generation foo, dist it... + + * gui/widgets/.cvsignore: ignore the marshaller stuff. + +2002-11-05 Chris Toshok <toshok@ximian.com> + * gui/component/select-names/e-simple-card-bonobo.[ch]: Port to GObject/gnome2. @@ -35,7 +80,7 @@ * gui/component/select-names/.cvsignore: ignore the marshaller stuff. -< + 2002-11-05 Chris Toshok <toshok@ximian.com> * backend/ebook/.cvsignore: ignore the generated marshaller files. diff --git a/addressbook/gui/widgets/.cvsignore b/addressbook/gui/widgets/.cvsignore index 472fd2593f..8f18401976 100644 --- a/addressbook/gui/widgets/.cvsignore +++ b/addressbook/gui/widgets/.cvsignore @@ -10,3 +10,5 @@ minicard-test minicard-view-test minicard-widget-test reflow-test +e-addressbook-marshal.c +e-addressbook-marshal.h diff --git a/addressbook/gui/widgets/Makefile.am b/addressbook/gui/widgets/Makefile.am index e262e18f5c..eed44c04a2 100644 --- a/addressbook/gui/widgets/Makefile.am +++ b/addressbook/gui/widgets/Makefile.am @@ -18,6 +18,7 @@ noinst_LIBRARIES = \ libeminicard.a libeminicard_a_SOURCES = \ + e-addressbook-marshal.c \ e-addressbook-reflow-adapter.c \ e-addressbook-reflow-adapter.h \ e-addressbook-table-adapter.c \ @@ -45,6 +46,20 @@ libeminicard_a_SOURCES = \ gal-view-minicard.c \ gal-view-minicard.h +# GLib marshalling cruft + +e-addressbook-marshal.h: e-addressbook-marshal.list + ( @GLIB_GENMARSHAL@ --prefix=e_addressbook_marshal e-addressbook-marshal.list --header > e-addressbook-marshal.tmp \ + && mv e-addressbook-marshal.tmp e-addressbook-marshal.h ) \ + || ( rm -f e-addressbook-marshal.tmp && exit 1 ) + +e-addressbook-marshal.c: e-addressbook-marshal.h + ( @GLIB_GENMARSHAL@ --prefix=e_addressbook_marshal e-addressbook-marshal.list --body > e-addressbook-marshal.tmp \ + && mv e-addressbook-marshal.tmp e-addressbook-marshal.c ) \ + || ( rm -f e-addressbook-marshal.tmp && exit 1 ) + +MARSHAL_GENERATED = e-addressbook-marshal.c e-addressbook-marshal.h + #noinst_PROGRAMS = \ # minicard-widget-test \ # minicard-label-test \ @@ -135,5 +150,5 @@ etspec_DATA= e-addressbook-view.etspec EXTRA_DIST = \ $(glade_DATA) \ - $(etspec_DATA) -
\ No newline at end of file + $(etspec_DATA) \ + e-addressbook-marshal.list diff --git a/addressbook/gui/widgets/e-addressbook-marshal.list b/addressbook/gui/widgets/e-addressbook-marshal.list new file mode 100644 index 0000000000..8f97e48e86 --- /dev/null +++ b/addressbook/gui/widgets/e-addressbook-marshal.list @@ -0,0 +1,10 @@ +INT:POINTER +NONE:NONE +NONE:BOOL +NONE:POINTER +NONE:ENUM +NONE:INT,INT +NONE:INT +NONE:UINT +NONE:DOUBLE +INT:POINTER diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c index d93c7c0f86..1937b33116 100644 --- a/addressbook/gui/widgets/e-addressbook-model.c +++ b/addressbook/gui/widgets/e-addressbook-model.c @@ -8,6 +8,7 @@ */ #include <config.h> +#include "e-addressbook-marshal.h" #include "e-addressbook-model.h" #include <gnome-xml/tree.h> #include <gnome-xml/parser.h> @@ -15,6 +16,7 @@ #include <gnome.h> #include <gal/widgets/e-gui-utils.h> #include "e-addressbook-util.h" +#include "e-addressbook-marshal.h" #define PARENT_TYPE gtk_object_get_type() GtkObjectClass *parent_class; @@ -23,15 +25,15 @@ GtkObjectClass *parent_class; * EAddressbookModel callbacks * These are the callbacks that define the behavior of our custom model. */ -static void e_addressbook_model_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); -static void e_addressbook_model_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); +static void e_addressbook_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); +static void e_addressbook_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); enum { - ARG_0, - ARG_BOOK, - ARG_QUERY, - ARG_EDITABLE, + PROP_0, + PROP_BOOK, + PROP_QUERY, + PROP_EDITABLE, }; enum { @@ -58,7 +60,7 @@ free_data (EAddressbookModel *model) int i; for ( i = 0; i < model->data_count; i++ ) { - gtk_object_unref(GTK_OBJECT(model->data[i])); + g_object_unref (model->data[i]); } g_free(model->data); @@ -71,20 +73,20 @@ static void remove_book_view(EAddressbookModel *model) { if (model->book_view && model->create_card_id) - gtk_signal_disconnect(GTK_OBJECT (model->book_view), - model->create_card_id); + g_signal_handler_disconnect (model->book_view, + model->create_card_id); if (model->book_view && model->remove_card_id) - gtk_signal_disconnect(GTK_OBJECT (model->book_view), - model->remove_card_id); + g_signal_handler_disconnect (model->book_view, + model->remove_card_id); if (model->book_view && model->modify_card_id) - gtk_signal_disconnect(GTK_OBJECT (model->book_view), - model->modify_card_id); + g_signal_handler_disconnect (model->book_view, + model->modify_card_id); if (model->book_view && model->status_message_id) - gtk_signal_disconnect(GTK_OBJECT (model->book_view), - model->status_message_id); + g_signal_handler_disconnect (model->book_view, + model->status_message_id); if (model->book_view && model->sequence_complete_id) - gtk_signal_disconnect(GTK_OBJECT (model->book_view), - model->sequence_complete_id); + g_signal_handler_disconnect (model->book_view, + model->sequence_complete_id); model->create_card_id = 0; model->remove_card_id = 0; @@ -96,14 +98,14 @@ remove_book_view(EAddressbookModel *model) if (model->book_view) { e_book_view_stop (model->book_view); - gtk_object_unref(GTK_OBJECT(model->book_view)); + g_object_unref (model->book_view); } model->book_view = NULL; } static void -addressbook_destroy(GtkObject *object) +addressbook_dispose(GObject *object) { EAddressbookModel *model = E_ADDRESSBOOK_MODEL(object); @@ -117,16 +119,16 @@ addressbook_destroy(GtkObject *object) if (model->book) { if (model->writable_status_id) - gtk_signal_disconnect(GTK_OBJECT (model->book), - model->writable_status_id); + g_signal_handler_disconnect (model->book, + model->writable_status_id); model->writable_status_id = 0; if (model->backend_died_id) - gtk_signal_disconnect(GTK_OBJECT (model->book), - model->backend_died_id); + g_signal_handler_disconnect (model->book, + model->backend_died_id); model->backend_died_id = 0; - gtk_object_unref(GTK_OBJECT(model->book)); + g_object_unref (model->book); model->book = NULL; } @@ -153,9 +155,9 @@ update_folder_bar_message (EAddressbookModel *model) break; } - gtk_signal_emit (GTK_OBJECT (model), - e_addressbook_model_signals [FOLDER_BAR_MESSAGE], - message); + g_signal_emit (model, + e_addressbook_model_signals [FOLDER_BAR_MESSAGE], 0, + message); g_free (message); } @@ -176,12 +178,12 @@ create_card(EBookView *book_view, for ( ; cards; cards = cards->next) { model->data[model->data_count++] = cards->data; - gtk_object_ref (cards->data); + g_object_ref (cards->data); } - gtk_signal_emit (GTK_OBJECT (model), - e_addressbook_model_signals [CARD_ADDED], - old_count, model->data_count - old_count); + g_signal_emit (model, + e_addressbook_model_signals [CARD_ADDED], 0, + old_count, model->data_count - old_count); update_folder_bar_message (model); } @@ -195,13 +197,13 @@ remove_card(EBookView *book_view, for ( i = 0; i < model->data_count; i++) { if ( !strcmp(e_card_get_id(model->data[i]), id) ) { - gtk_object_unref(GTK_OBJECT(model->data[i])); + g_object_unref (model->data[i]); memmove(model->data + i, model->data + i + 1, (model->data_count - i - 1) * sizeof (ECard *)); model->data_count--; - gtk_signal_emit (GTK_OBJECT (model), - e_addressbook_model_signals [CARD_REMOVED], - i); + g_signal_emit (model, + e_addressbook_model_signals [CARD_REMOVED], 0, + i); update_folder_bar_message (model); break; } @@ -217,11 +219,11 @@ modify_card(EBookView *book_view, int i; for ( i = 0; i < model->data_count; i++) { if ( !strcmp(e_card_get_id(model->data[i]), e_card_get_id(E_CARD(cards->data))) ) { - gtk_object_unref(GTK_OBJECT(model->data[i])); + g_object_unref (model->data[i]); model->data[i] = e_card_duplicate(E_CARD(cards->data)); - gtk_signal_emit (GTK_OBJECT (model), - e_addressbook_model_signals [CARD_CHANGED], - i); + g_signal_emit (model, + e_addressbook_model_signals [CARD_CHANGED], 0, + i); break; } } @@ -233,9 +235,9 @@ status_message (EBookView *book_view, char* status, EAddressbookModel *model) { - gtk_signal_emit (GTK_OBJECT (model), - e_addressbook_model_signals [STATUS_MESSAGE], - status); + g_signal_emit (model, + e_addressbook_model_signals [STATUS_MESSAGE], 0, + status); } static void @@ -245,11 +247,11 @@ sequence_complete (EBookView *book_view, { model->search_in_progress = FALSE; status_message (book_view, NULL, model); - gtk_signal_emit (GTK_OBJECT (model), - e_addressbook_model_signals [SEARCH_RESULT], - status); - gtk_signal_emit (GTK_OBJECT (model), - e_addressbook_model_signals [STOP_STATE_CHANGED]); + g_signal_emit (model, + e_addressbook_model_signals [SEARCH_RESULT], 0, + status); + g_signal_emit (model, + e_addressbook_model_signals [STOP_STATE_CHANGED], 0); } static void @@ -260,9 +262,9 @@ writable_status (EBook *book, if (!model->editable_set) { model->editable = writable; - gtk_signal_emit (GTK_OBJECT (model), - e_addressbook_model_signals [WRITABLE_STATUS], - writable); + g_signal_emit (model, + e_addressbook_model_signals [WRITABLE_STATUS], 0, + writable); } } @@ -270,107 +272,131 @@ static void backend_died (EBook *book, EAddressbookModel *model) { - gtk_signal_emit (GTK_OBJECT (model), - e_addressbook_model_signals [BACKEND_DIED]); + g_signal_emit (model, + e_addressbook_model_signals [BACKEND_DIED], 0); } static void -e_addressbook_model_class_init (GtkObjectClass *object_class) +e_addressbook_model_class_init (GObjectClass *object_class) { parent_class = gtk_type_class (PARENT_TYPE); - object_class->destroy = addressbook_destroy; - object_class->set_arg = e_addressbook_model_set_arg; - object_class->get_arg = e_addressbook_model_get_arg; - - gtk_object_add_arg_type ("EAddressbookModel::book", GTK_TYPE_OBJECT, - GTK_ARG_READWRITE, ARG_BOOK); - gtk_object_add_arg_type ("EAddressbookModel::query", GTK_TYPE_STRING, - GTK_ARG_READWRITE, ARG_QUERY); - gtk_object_add_arg_type ("EAddressbookModel::editable", GTK_TYPE_BOOL, - GTK_ARG_READWRITE, ARG_EDITABLE); + object_class->dispose = addressbook_dispose; + object_class->set_property = e_addressbook_model_set_property; + object_class->get_property = e_addressbook_model_get_property; + + g_object_class_install_property (object_class, PROP_BOOK, + g_param_spec_object ("book", + _("Book"), + /*_( */"XXX blurb" /*)*/, + E_TYPE_BOOK, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_QUERY, + g_param_spec_string ("query", + _("Query"), + /*_( */"XXX blurb" /*)*/, + NULL, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_EDITABLE, + g_param_spec_boolean ("editable", + _("Editable"), + /*_( */"XXX blurb" /*)*/, + FALSE, + G_PARAM_READWRITE)); e_addressbook_model_signals [WRITABLE_STATUS] = - gtk_signal_new ("writable_status", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (EAddressbookModelClass, writable_status), - gtk_marshal_NONE__BOOL, - GTK_TYPE_NONE, 1, GTK_TYPE_BOOL); + g_signal_new ("writable_status", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookModelClass, writable_status), + NULL, NULL, + e_addressbook_marshal_NONE__BOOL, + G_TYPE_NONE, + 1, G_TYPE_BOOLEAN); e_addressbook_model_signals [STATUS_MESSAGE] = - gtk_signal_new ("status_message", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (EAddressbookModelClass, status_message), - gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); + g_signal_new ("status_message", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookModelClass, status_message), + NULL, NULL, + e_addressbook_marshal_NONE__POINTER, + G_TYPE_NONE, + 1, G_TYPE_POINTER); e_addressbook_model_signals [SEARCH_RESULT] = - gtk_signal_new ("search_result", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (EAddressbookModelClass, search_result), - gtk_marshal_NONE__ENUM, - GTK_TYPE_NONE, 1, GTK_TYPE_ENUM); - + g_signal_new ("search_result", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookModelClass, search_result), + NULL, NULL, + e_addressbook_marshal_NONE__ENUM, + G_TYPE_NONE, 1, G_TYPE_ENUM); + e_addressbook_model_signals [FOLDER_BAR_MESSAGE] = - gtk_signal_new ("folder_bar_message", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (EAddressbookModelClass, folder_bar_message), - gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); + g_signal_new ("folder_bar_message", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookModelClass, folder_bar_message), + NULL, NULL, + e_addressbook_marshal_NONE__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); e_addressbook_model_signals [CARD_ADDED] = - gtk_signal_new ("card_added", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (EAddressbookModelClass, card_added), - gtk_marshal_NONE__INT_INT, - GTK_TYPE_NONE, 2, GTK_TYPE_INT, GTK_TYPE_INT); + g_signal_new ("card_added", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookModelClass, card_added), + NULL, NULL, + e_addressbook_marshal_NONE__INT_INT, + G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT); e_addressbook_model_signals [CARD_REMOVED] = - gtk_signal_new ("card_removed", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (EAddressbookModelClass, card_removed), - gtk_marshal_NONE__INT, - GTK_TYPE_NONE, 1, GTK_TYPE_INT); + g_signal_new ("card_removed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookModelClass, card_removed), + NULL, NULL, + e_addressbook_marshal_NONE__INT, + G_TYPE_NONE, 1, G_TYPE_INT); e_addressbook_model_signals [CARD_CHANGED] = - gtk_signal_new ("card_changed", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (EAddressbookModelClass, card_changed), - gtk_marshal_NONE__INT, - GTK_TYPE_NONE, 1, GTK_TYPE_INT); + g_signal_new ("card_changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookModelClass, card_changed), + NULL, NULL, + e_addressbook_marshal_NONE__INT, + G_TYPE_NONE, 1, G_TYPE_INT); e_addressbook_model_signals [MODEL_CHANGED] = - gtk_signal_new ("model_changed", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (EAddressbookModelClass, model_changed), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + g_signal_new ("model_changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookModelClass, model_changed), + NULL, NULL, + e_addressbook_marshal_NONE__NONE, + G_TYPE_NONE, 0); e_addressbook_model_signals [STOP_STATE_CHANGED] = - gtk_signal_new ("stop_state_changed", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (EAddressbookModelClass, stop_state_changed), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + g_signal_new ("stop_state_changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookModelClass, stop_state_changed), + NULL, NULL, + e_addressbook_marshal_NONE__NONE, + GTK_TYPE_NONE, 0); e_addressbook_model_signals [BACKEND_DIED] = - gtk_signal_new ("backend_died", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (EAddressbookModelClass, backend_died), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); - - gtk_object_class_add_signals (object_class, e_addressbook_model_signals, LAST_SIGNAL); + g_signal_new ("backend_died", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookModelClass, backend_died), + NULL, NULL, + e_addressbook_marshal_NONE__NONE, + G_TYPE_NONE, 0); } static void @@ -411,35 +437,35 @@ book_view_loaded (EBook *book, EBookStatus status, EBookView *book_view, gpointe model->book_view = book_view; if (model->book_view) - gtk_object_ref(GTK_OBJECT(model->book_view)); - model->create_card_id = gtk_signal_connect(GTK_OBJECT(model->book_view), - "card_added", - GTK_SIGNAL_FUNC(create_card), - model); - model->remove_card_id = gtk_signal_connect(GTK_OBJECT(model->book_view), - "card_removed", - GTK_SIGNAL_FUNC(remove_card), - model); - model->modify_card_id = gtk_signal_connect(GTK_OBJECT(model->book_view), - "card_changed", - GTK_SIGNAL_FUNC(modify_card), - model); - model->status_message_id = gtk_signal_connect(GTK_OBJECT(model->book_view), - "status_message", - GTK_SIGNAL_FUNC(status_message), - model); - model->sequence_complete_id = gtk_signal_connect(GTK_OBJECT(model->book_view), - "sequence_complete", - GTK_SIGNAL_FUNC(sequence_complete), - model); + g_object_ref (model->book_view); + model->create_card_id = g_signal_connect(model->book_view, + "card_added", + G_CALLBACK (create_card), + model); + model->remove_card_id = g_signal_connect(model->book_view, + "card_removed", + G_CALLBACK (remove_card), + model); + model->modify_card_id = g_signal_connect(model->book_view, + "card_changed", + G_CALLBACK(modify_card), + model); + model->status_message_id = g_signal_connect(model->book_view, + "status_message", + G_CALLBACK(status_message), + model); + model->sequence_complete_id = g_signal_connect(model->book_view, + "sequence_complete", + G_CALLBACK(sequence_complete), + model); free_data (model); model->search_in_progress = TRUE; - gtk_signal_emit (GTK_OBJECT (model), - e_addressbook_model_signals [MODEL_CHANGED]); - gtk_signal_emit (GTK_OBJECT (model), - e_addressbook_model_signals [STOP_STATE_CHANGED]); + g_signal_emit (model, + e_addressbook_model_signals [MODEL_CHANGED], 0); + g_signal_emit (model, + e_addressbook_model_signals [STOP_STATE_CHANGED], 0); } static gboolean @@ -454,10 +480,10 @@ get_view (EAddressbookModel *model) } else { remove_book_view(model); free_data (model); - gtk_signal_emit (GTK_OBJECT (model), - e_addressbook_model_signals [MODEL_CHANGED]); - gtk_signal_emit (GTK_OBJECT (model), - e_addressbook_model_signals [STOP_STATE_CHANGED]); + g_signal_emit (model, + e_addressbook_model_signals [MODEL_CHANGED], 0); + g_signal_emit (model, + e_addressbook_model_signals [STOP_STATE_CHANGED], 0); } model->first_get_view = FALSE; g_free (capabilities); @@ -493,74 +519,77 @@ e_addressbook_model_peek_card(EAddressbookModel *model, } static void -e_addressbook_model_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) +e_addressbook_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { EAddressbookModel *model; - model = E_ADDRESSBOOK_MODEL (o); + model = E_ADDRESSBOOK_MODEL (object); - switch (arg_id){ - case ARG_BOOK: + switch (prop_id){ + case PROP_BOOK: if (model->book) { if (model->writable_status_id) - gtk_signal_disconnect(GTK_OBJECT (model->book), - model->writable_status_id); + g_signal_handler_disconnect (model->book, + model->writable_status_id); model->writable_status_id = 0; if (model->backend_died_id) - gtk_signal_disconnect(GTK_OBJECT (model->book), - model->backend_died_id); + g_signal_handler_disconnect (model->book, + model->backend_died_id); model->backend_died_id = 0; - gtk_object_unref(GTK_OBJECT(model->book)); + g_object_unref (model->book); } - model->book = E_BOOK(GTK_VALUE_OBJECT (*arg)); + model->book = E_BOOK(g_value_get_object (value)); if (model->book) { model->first_get_view = TRUE; - gtk_object_ref(GTK_OBJECT(model->book)); + g_object_ref (model->book); if (model->get_view_idle == 0) model->get_view_idle = g_idle_add((GSourceFunc)get_view, model); - gtk_signal_connect (GTK_OBJECT(model->book), - "writable_status", - writable_status, model); - gtk_signal_connect (GTK_OBJECT(model->book), - "backend_died", - backend_died, model); + g_signal_connect (model->book, + "writable_status", + G_CALLBACK (writable_status), model); + g_signal_connect (model->book, + "backend_died", + G_CALLBACK (backend_died), model); } break; - case ARG_QUERY: + case PROP_QUERY: if (model->query) g_free(model->query); - model->query = g_strdup(GTK_VALUE_STRING (*arg)); + model->query = g_strdup(g_value_get_string (value)); if (model->get_view_idle == 0) model->get_view_idle = g_idle_add((GSourceFunc)get_view, model); break; - case ARG_EDITABLE: - model->editable = GTK_VALUE_BOOL (*arg); + case PROP_EDITABLE: + model->editable = g_value_get_boolean (value); model->editable_set = TRUE; break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; } } static void -e_addressbook_model_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) +e_addressbook_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { EAddressbookModel *e_addressbook_model; e_addressbook_model = E_ADDRESSBOOK_MODEL (object); - switch (arg_id) { - case ARG_BOOK: - GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(e_addressbook_model->book); + switch (prop_id) { + case PROP_BOOK: + g_value_set_object (value, e_addressbook_model->book); break; - case ARG_QUERY: - GTK_VALUE_STRING (*arg) = g_strdup(e_addressbook_model->query); + case PROP_QUERY: + g_value_set_string (value, g_strdup(e_addressbook_model->query)); break; - case ARG_EDITABLE: - GTK_VALUE_BOOL (*arg) = e_addressbook_model->editable; + case PROP_EDITABLE: + g_value_set_boolean (value, e_addressbook_model->editable); break; default: - arg->type = GTK_TYPE_INVALID; + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } @@ -601,11 +630,11 @@ e_addressbook_model_new (void) void e_addressbook_model_stop (EAddressbookModel *model) { remove_book_view(model); - gtk_signal_emit (GTK_OBJECT (model), - e_addressbook_model_signals [STOP_STATE_CHANGED]); - gtk_signal_emit (GTK_OBJECT (model), - e_addressbook_model_signals [STATUS_MESSAGE], - "Search Interrupted."); + g_signal_emit (model, + e_addressbook_model_signals [STOP_STATE_CHANGED], 0); + g_signal_emit (model, + e_addressbook_model_signals [STATUS_MESSAGE], 0, + "Search Interrupted."); } gboolean diff --git a/addressbook/gui/widgets/e-addressbook-model.h b/addressbook/gui/widgets/e-addressbook-model.h index eb1004499a..7cc97ba2ad 100644 --- a/addressbook/gui/widgets/e-addressbook-model.h +++ b/addressbook/gui/widgets/e-addressbook-model.h @@ -2,15 +2,16 @@ #ifndef _E_ADDRESSBOOK_MODEL_H_ #define _E_ADDRESSBOOK_MODEL_H_ +#include <gtk/gtk.h> #include "addressbook/backend/ebook/e-book.h" #include "addressbook/backend/ebook/e-book-view.h" #include "addressbook/backend/ebook/e-card-simple.h" -#define E_ADDRESSBOOK_MODEL_TYPE (e_addressbook_model_get_type ()) -#define E_ADDRESSBOOK_MODEL(o) (GTK_CHECK_CAST ((o), E_ADDRESSBOOK_MODEL_TYPE, EAddressbookModel)) -#define E_ADDRESSBOOK_MODEL_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_ADDRESSBOOK_MODEL_TYPE, EAddressbookModelClass)) -#define E_IS_ADDRESSBOOK_MODEL(o) (GTK_CHECK_TYPE ((o), E_ADDRESSBOOK_MODEL_TYPE)) -#define E_IS_ADDRESSBOOK_MODEL_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_ADDRESSBOOK_MODEL_TYPE)) +#define E_TYPE_ADDRESSBOOK_MODEL (e_addressbook_model_get_type ()) +#define E_ADDRESSBOOK_MODEL(o) (GTK_CHECK_CAST ((o), E_TYPE_ADDRESSBOOK_MODEL, EAddressbookModel)) +#define E_ADDRESSBOOK_MODEL_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TYPE_ADDRESSBOOK_MODEL, EAddressbookModelClass)) +#define E_IS_ADDRESSBOOK_MODEL(o) (GTK_CHECK_TYPE ((o), E_TYPE_ADDRESSBOOK_MODEL)) +#define E_IS_ADDRESSBOOK_MODEL_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TYPE_ADDRESSBOOK_MODEL)) typedef struct _EAddressbookModel EAddressbookModel; typedef struct _EAddressbookModelClass EAddressbookModelClass; diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c index 16e61a2d89..140a09facd 100644 --- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c @@ -3,19 +3,18 @@ #include <config.h> +#include <libgnome/gnome-i18n.h> +#include "e-addressbook-marshal.h" #include "e-addressbook-reflow-adapter.h" #include "e-addressbook-model.h" #include "e-addressbook-view.h" #include "e-addressbook-util.h" -#include <gal/util/e-i18n.h> - #include "e-minicard.h" #include <gal/widgets/e-unicode.h> #include <gal/widgets/e-font.h> #include <gal/widgets/e-popup-menu.h> #include <gal/widgets/e-gui-utils.h> -#include <gal/unicode/gunicode.h> #include "e-contact-save-as.h" #include "addressbook/printing/e-contact-print.h" #include "addressbook/printing/e-contact-print-envelope.h" @@ -33,11 +32,11 @@ EReflowModel *parent_class; #define d(x) enum { - ARG_0, - ARG_BOOK, - ARG_QUERY, - ARG_EDITABLE, - ARG_MODEL, + PROP_0, + PROP_BOOK, + PROP_QUERY, + PROP_EDITABLE, + PROP_MODEL, }; enum { @@ -52,18 +51,18 @@ unlink_model(EAddressbookReflowAdapter *adapter) { EAddressbookReflowAdapterPrivate *priv = adapter->priv; - gtk_signal_disconnect(GTK_OBJECT (priv->model), - priv->create_card_id); - gtk_signal_disconnect(GTK_OBJECT (priv->model), - priv->remove_card_id); - gtk_signal_disconnect(GTK_OBJECT (priv->model), - priv->modify_card_id); + g_signal_handler_disconnect (priv->model, + priv->create_card_id); + g_signal_handler_disconnect (priv->model, + priv->remove_card_id); + g_signal_handler_disconnect (priv->model, + priv->modify_card_id); priv->create_card_id = 0; priv->remove_card_id = 0; priv->modify_card_id = 0; - gtk_object_unref(GTK_OBJECT(priv->model)); + g_object_unref (priv->model); priv->model = NULL; } @@ -87,7 +86,7 @@ count_lines (const gchar *text) static int text_height (GnomeCanvas *canvas, const gchar *text) { - EFont *font = e_font_from_gdk_font (((GtkWidget *) canvas)->style->font); + EFont *font = e_font_from_gdk_font (gtk_style_get_font (gtk_widget_get_style (GTK_WIDGET (canvas)))); gint height = e_font_height (font) * count_lines (text) / canvas->pixels_per_unit; e_font_unref (font); @@ -95,7 +94,7 @@ text_height (GnomeCanvas *canvas, const gchar *text) } static void -addressbook_finalize(GtkObject *object) +addressbook_finalize(GObject *object) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(object); @@ -159,7 +158,7 @@ addressbook_height (EReflowModel *erm, int i, GnomeCanvasGroup *parent) } height += 2; - gtk_object_unref (GTK_OBJECT (simple)); + g_object_unref (simple); return height; } @@ -198,9 +197,9 @@ adapter_drag_begin (EMinicard *card, GdkEvent *event, EAddressbookReflowAdapter { gint ret_val = 0; - gtk_signal_emit (GTK_OBJECT(adapter), - e_addressbook_reflow_adapter_signals[DRAG_BEGIN], - event, &ret_val); + g_signal_emit (adapter, + e_addressbook_reflow_adapter_signals[DRAG_BEGIN], 0, + event, &ret_val); return ret_val; } @@ -219,13 +218,13 @@ addressbook_incarnate (EReflowModel *erm, int i, GnomeCanvasGroup *parent) NULL); #if 0 - gtk_signal_connect (GTK_OBJECT (item), "selected", - GTK_SIGNAL_FUNC(card_selected), emvm); + g_signal_connect (item, "selected", + G_CALLBACK(card_selected), 0, emvm); #endif - gtk_signal_connect (GTK_OBJECT (item), "drag_begin", - GTK_SIGNAL_FUNC(adapter_drag_begin), adapter); - + g_signal_connect (item, "drag_begin", + G_CALLBACK(adapter_drag_begin), adapter); + return item; } @@ -276,106 +275,121 @@ model_changed(EAddressbookModel *model, } static void -addressbook_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) +addressbook_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { - EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(o); + EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(object); EAddressbookReflowAdapterPrivate *priv = adapter->priv; - switch (arg_id){ - case ARG_BOOK: - gtk_object_set (GTK_OBJECT (priv->model), - "book", GTK_VALUE_OBJECT (*arg), - NULL); + switch (prop_id) { + case PROP_BOOK: + g_object_set (priv->model, + "book", g_value_get_object (value), + NULL); break; - case ARG_QUERY: - gtk_object_set (GTK_OBJECT (priv->model), - "query", GTK_VALUE_STRING (*arg), - NULL); + case PROP_QUERY: + g_object_set (priv->model, + "query", g_value_get_string (value), + NULL); break; - case ARG_EDITABLE: - gtk_object_set (GTK_OBJECT (priv->model), - "editable", GTK_VALUE_BOOL (*arg), - NULL); + case PROP_EDITABLE: + g_object_set (priv->model, + "editable", g_value_get_boolean (value), + NULL); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void -addressbook_get_arg (GtkObject *o, GtkArg *arg, guint arg_id) +addressbook_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { - EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(o); + EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(object); EAddressbookReflowAdapterPrivate *priv = adapter->priv; - switch (arg_id) { - case ARG_BOOK: { + switch (prop_id) { + case PROP_BOOK: { EBook *book; - gtk_object_get (GTK_OBJECT (priv->model), - "book", &book, - NULL); - if (book) - GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(book); - else - GTK_VALUE_OBJECT (*arg) = NULL; + g_object_get (GTK_OBJECT (priv->model), + "book", &book, + NULL); + + g_value_set_object (value, book); break; } - case ARG_QUERY: { + case PROP_QUERY: { char *query; - gtk_object_get (GTK_OBJECT (priv->model), - "query", &query, - NULL); - GTK_VALUE_STRING (*arg) = query; + g_object_get (priv->model, + "query", &query, + NULL); + g_value_set_string (value, query); break; } - case ARG_EDITABLE: { + case PROP_EDITABLE: { gboolean editable; - gtk_object_get (GTK_OBJECT (priv->model), - "editable", &editable, - NULL); - GTK_VALUE_BOOL (*arg) = editable; + g_object_get (priv->model, + "editable", &editable, + NULL); + g_value_set_boolean (value, editable); break; } - case ARG_MODEL: - if (priv->model) - GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (priv->model); - else - GTK_VALUE_OBJECT (*arg) = NULL; + case PROP_MODEL: + g_value_set_object (value, priv->model); break; default: - arg->type = GTK_TYPE_INVALID; + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void -e_addressbook_reflow_adapter_class_init (GtkObjectClass *object_class) +e_addressbook_reflow_adapter_class_init (GObjectClass *object_class) { EReflowModelClass *model_class = (EReflowModelClass *) object_class; parent_class = gtk_type_class (PARENT_TYPE); - object_class->set_arg = addressbook_set_arg; - object_class->get_arg = addressbook_get_arg; + object_class->set_property = addressbook_set_property; + object_class->get_property = addressbook_get_property; object_class->finalize = addressbook_finalize; - gtk_object_add_arg_type ("EAddressbookReflowAdapter::book", GTK_TYPE_OBJECT, - GTK_ARG_READWRITE, ARG_BOOK); - gtk_object_add_arg_type ("EAddressbookReflowAdapter::query", GTK_TYPE_STRING, - GTK_ARG_READWRITE, ARG_QUERY); - gtk_object_add_arg_type ("EAddressbookReflowAdapter::editable", GTK_TYPE_BOOL, - GTK_ARG_READWRITE, ARG_EDITABLE); - gtk_object_add_arg_type ("EAddressbookReflowAdapter::model", E_ADDRESSBOOK_MODEL_TYPE, - GTK_ARG_READABLE, ARG_MODEL); + g_object_class_install_property (object_class, PROP_BOOK, + g_param_spec_object ("book", + _("Book"), + /*_( */"XXX blurb" /*)*/, + E_TYPE_BOOK, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_QUERY, + g_param_spec_string ("query", + _("Query"), + /*_( */"XXX blurb" /*)*/, + NULL, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_EDITABLE, + g_param_spec_boolean ("editable", + _("Editable"), + /*_( */"XXX blurb" /*)*/, + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_MODEL, + g_param_spec_object ("model", + _("Model"), + /*_( */"XXX blurb" /*)*/, + E_TYPE_ADDRESSBOOK_MODEL, + G_PARAM_READABLE)); e_addressbook_reflow_adapter_signals [DRAG_BEGIN] = - gtk_signal_new ("drag_begin", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (EAddressbookReflowAdapterClass, drag_begin), - gtk_marshal_INT__POINTER, - GTK_TYPE_INT, 1, GTK_TYPE_POINTER); - - - gtk_object_class_add_signals (object_class, e_addressbook_reflow_adapter_signals, LAST_SIGNAL); + g_signal_new ("drag_begin", + G_OBJECT_CLASS_TYPE(object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookReflowAdapterClass, drag_begin), + NULL, NULL, + e_addressbook_marshal_INT__POINTER, + G_TYPE_INT, 1, G_TYPE_POINTER); model_class->set_width = addressbook_set_width; model_class->count = addressbook_count; @@ -429,24 +443,24 @@ e_addressbook_reflow_adapter_construct (EAddressbookReflowAdapter *adapter, EAddressbookReflowAdapterPrivate *priv = adapter->priv; priv->model = model; - gtk_object_ref (GTK_OBJECT (priv->model)); - - priv->create_card_id = gtk_signal_connect(GTK_OBJECT(priv->model), - "card_added", - GTK_SIGNAL_FUNC(create_card), - adapter); - priv->remove_card_id = gtk_signal_connect(GTK_OBJECT(priv->model), - "card_removed", - GTK_SIGNAL_FUNC(remove_card), - adapter); - priv->modify_card_id = gtk_signal_connect(GTK_OBJECT(priv->model), - "card_changed", - GTK_SIGNAL_FUNC(modify_card), + g_object_ref (priv->model); + + priv->create_card_id = g_signal_connect(priv->model, + "card_added", + G_CALLBACK(create_card), + adapter); + priv->remove_card_id = g_signal_connect(priv->model, + "card_removed", + G_CALLBACK(remove_card), + adapter); + priv->modify_card_id = g_signal_connect(priv->model, + "card_changed", + G_CALLBACK(modify_card), + adapter); + priv->model_changed_id = g_signal_connect(priv->model, + "model_changed", + G_CALLBACK(model_changed), adapter); - priv->model_changed_id = gtk_signal_connect(GTK_OBJECT(priv->model), - "model_changed", - GTK_SIGNAL_FUNC(model_changed), - adapter); } EReflowModel * diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c b/addressbook/gui/widgets/e-addressbook-table-adapter.c index abcaf6e6b0..7fc3a8ddd2 100644 --- a/addressbook/gui/widgets/e-addressbook-table-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-table-adapter.c @@ -30,14 +30,14 @@ unlink_model(EAddressbookTableAdapter *adapter) EAddressbookTableAdapterPrivate *priv = adapter->priv; int i; - gtk_signal_disconnect(GTK_OBJECT (priv->model), - priv->create_card_id); - gtk_signal_disconnect(GTK_OBJECT (priv->model), - priv->remove_card_id); - gtk_signal_disconnect(GTK_OBJECT (priv->model), - priv->modify_card_id); - gtk_signal_disconnect(GTK_OBJECT (priv->model), - priv->model_changed_id); + g_signal_handler_disconnect (priv->model, + priv->create_card_id); + g_signal_handler_disconnect (priv->model, + priv->remove_card_id); + g_signal_handler_disconnect (priv->model, + priv->modify_card_id); + g_signal_handler_disconnect (priv->model, + priv->model_changed_id); priv->create_card_id = 0; priv->remove_card_id = 0; @@ -47,12 +47,12 @@ unlink_model(EAddressbookTableAdapter *adapter) /* free up the existing mapping if there is one */ if (priv->simples) { for (i = 0; i < priv->count; i ++) - gtk_object_unref (GTK_OBJECT (priv->simples[i])); + g_object_unref (priv->simples[i]); g_free (priv->simples); priv->simples = NULL; } - gtk_object_unref(GTK_OBJECT(priv->model)); + g_object_unref (priv->model); priv->model = NULL; } @@ -66,7 +66,7 @@ build_simple_mapping(EAddressbookTableAdapter *adapter) /* free up the existing mapping if there is one */ if (priv->simples) { for (i = 0; i < priv->count; i ++) - gtk_object_unref (GTK_OBJECT (priv->simples[i])); + g_object_unref (priv->simples[i]); g_free (priv->simples); } @@ -75,7 +75,7 @@ build_simple_mapping(EAddressbookTableAdapter *adapter) priv->simples = g_new (ECardSimple*, priv->count); for (i = 0; i < priv->count; i ++) { priv->simples[i] = e_card_simple_new (e_addressbook_model_card_at (priv->model, i)); - gtk_object_ref (GTK_OBJECT (priv->simples[i])); + g_object_ref (priv->simples[i]); } } @@ -124,7 +124,7 @@ addressbook_value_at (ETableModel *etc, int col, int row) if (dest) { g_free ((gchar *) value); value = g_strdup (e_destination_get_address (dest)); - gtk_object_unref (GTK_OBJECT (dest)); + g_object_unref (dest); } } @@ -210,8 +210,8 @@ addressbook_append_row (ETableModel *etm, ETableModel *source, gint row) } e_card_simple_sync_card(simple); e_card_merging_book_add_card (e_addressbook_model_get_ebook (priv->model), card, NULL, NULL); - gtk_object_unref(GTK_OBJECT(simple)); - gtk_object_unref(GTK_OBJECT(card)); + g_object_unref (simple); + g_object_unref (card); } /* This function duplicates the value passed to it. */ @@ -313,7 +313,7 @@ remove_card (EAddressbookModel *model, e_table_model_pre_change (E_TABLE_MODEL (adapter)); - gtk_object_unref (GTK_OBJECT (priv->simples[index])); + g_object_unref (priv->simples[index]); memmove (priv->simples + index, priv->simples + index + 1, (priv->count - index - 1) * sizeof (ECardSimple *)); priv->count --; e_table_model_rows_deleted (E_TABLE_MODEL (adapter), index, 1); @@ -328,9 +328,9 @@ modify_card (EAddressbookModel *model, e_table_model_pre_change (E_TABLE_MODEL (adapter)); - gtk_object_unref (GTK_OBJECT (priv->simples[index])); + g_object_unref (priv->simples[index]); priv->simples[index] = e_card_simple_new (e_addressbook_model_card_at (priv->model, index)); - gtk_object_ref (GTK_OBJECT (priv->simples[index])); + g_object_ref (priv->simples[index]); e_table_model_row_changed (E_TABLE_MODEL (adapter), index); } @@ -373,24 +373,24 @@ e_addressbook_table_adapter_construct (EAddressbookTableAdapter *adapter, EAddressbookTableAdapterPrivate *priv = adapter->priv; priv->model = model; - gtk_object_ref (GTK_OBJECT (priv->model)); - - priv->create_card_id = gtk_signal_connect(GTK_OBJECT(priv->model), - "card_added", - GTK_SIGNAL_FUNC(create_card), - adapter); - priv->remove_card_id = gtk_signal_connect(GTK_OBJECT(priv->model), - "card_removed", - GTK_SIGNAL_FUNC(remove_card), - adapter); - priv->modify_card_id = gtk_signal_connect(GTK_OBJECT(priv->model), - "card_changed", - GTK_SIGNAL_FUNC(modify_card), + g_object_ref (priv->model); + + priv->create_card_id = g_signal_connect(priv->model, + "card_added", + G_CALLBACK(create_card), + adapter); + priv->remove_card_id = g_signal_connect(priv->model, + "card_removed", + G_CALLBACK(remove_card), + adapter); + priv->modify_card_id = g_signal_connect(priv->model, + "card_changed", + G_CALLBACK(modify_card), + adapter); + priv->model_changed_id = g_signal_connect(priv->model, + "model_changed", + G_CALLBACK(model_changed), adapter); - priv->model_changed_id = gtk_signal_connect(GTK_OBJECT(priv->model), - "model_changed", - GTK_SIGNAL_FUNC(model_changed), - adapter); build_simple_mapping (adapter); } diff --git a/addressbook/gui/widgets/e-addressbook-util.c b/addressbook/gui/widgets/e-addressbook-util.c index 04f4238fbd..d9c336c648 100644 --- a/addressbook/gui/widgets/e-addressbook-util.c +++ b/addressbook/gui/widgets/e-addressbook-util.c @@ -106,7 +106,7 @@ deleted_cb (EBook* book, EBookStatus status, static void editor_closed_cb (GtkObject *editor, gpointer data) { - gtk_object_unref (editor); + g_object_unref (editor); } EContactEditor * @@ -118,14 +118,14 @@ e_addressbook_show_contact_editor (EBook *book, ECard *card, ce = e_contact_editor_new (book, card, is_new_card, editable); - gtk_signal_connect (GTK_OBJECT (ce), "card_added", - GTK_SIGNAL_FUNC (added_cb), GINT_TO_POINTER (FALSE)); - gtk_signal_connect (GTK_OBJECT (ce), "card_modified", - GTK_SIGNAL_FUNC (modified_cb), GINT_TO_POINTER (FALSE)); - gtk_signal_connect (GTK_OBJECT (ce), "card_deleted", - GTK_SIGNAL_FUNC (deleted_cb), GINT_TO_POINTER (FALSE)); - gtk_signal_connect (GTK_OBJECT (ce), "editor_closed", - GTK_SIGNAL_FUNC (editor_closed_cb), NULL); + g_signal_connect (ce, "card_added", + G_CALLBACK (added_cb), GINT_TO_POINTER (FALSE)); + g_signal_connect (ce, "card_modified", + G_CALLBACK (modified_cb), GINT_TO_POINTER (FALSE)); + g_signal_connect (ce, "card_deleted", + G_CALLBACK (deleted_cb), GINT_TO_POINTER (FALSE)); + g_signal_connect (ce, "editor_closed", + G_CALLBACK (editor_closed_cb), NULL); return ce; } @@ -139,14 +139,14 @@ e_addressbook_show_contact_list_editor (EBook *book, ECard *card, ce = e_contact_list_editor_new (book, card, is_new_card, editable); - gtk_signal_connect (GTK_OBJECT (ce), "list_added", - GTK_SIGNAL_FUNC (added_cb), GINT_TO_POINTER (TRUE)); - gtk_signal_connect (GTK_OBJECT (ce), "list_modified", - GTK_SIGNAL_FUNC (modified_cb), GINT_TO_POINTER (TRUE)); - gtk_signal_connect (GTK_OBJECT (ce), "list_deleted", - GTK_SIGNAL_FUNC (deleted_cb), GINT_TO_POINTER (TRUE)); - gtk_signal_connect (GTK_OBJECT (ce), "editor_closed", - GTK_SIGNAL_FUNC (editor_closed_cb), GINT_TO_POINTER (TRUE)); + g_signal_connect (ce, "list_added", + G_CALLBACK (added_cb), GINT_TO_POINTER (TRUE)); + g_signal_connect (ce, "list_modified", + G_CALLBACK (modified_cb), GINT_TO_POINTER (TRUE)); + g_signal_connect (ce, "list_deleted", + G_CALLBACK (deleted_cb), GINT_TO_POINTER (TRUE)); + g_signal_connect (ce, "editor_closed", + G_CALLBACK (editor_closed_cb), GINT_TO_POINTER (TRUE)); e_contact_list_editor_show (ce); @@ -215,10 +215,10 @@ e_addressbook_show_multiple_cards (EBook *book, gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), gtk_label_new (string), FALSE, FALSE, 0); g_free (string); - gtk_signal_connect (GTK_OBJECT (dialog), "destroy", - GTK_SIGNAL_FUNC (view_question_destroyed), &bnl); - gtk_signal_connect (GTK_OBJECT (dialog), "clicked", - GTK_SIGNAL_FUNC (view_question_clicked), &bnl); + g_signal_connect (dialog, "destroy", + G_CALLBACK (view_question_destroyed), &bnl); + g_signal_connect (dialog, "clicked", + G_CALLBACK (view_question_clicked), &bnl); gtk_widget_show_all (dialog); @@ -277,8 +277,8 @@ process_unref (CardCopyProcess *process) process->done_cb (process); } e_free_object_list(process->cards); - gtk_object_unref (GTK_OBJECT (process->source)); - gtk_object_unref (GTK_OBJECT (process->destination)); + g_object_unref (process->source); + g_object_unref (process->destination); g_free (process); } } @@ -318,7 +318,7 @@ got_book_cb (EBook *book, gpointer closure) process = closure; if (book) { process->destination = book; - gtk_object_ref (GTK_OBJECT (book)); + g_object_ref (book); g_list_foreach (process->cards, do_copy, process); @@ -370,7 +370,7 @@ e_addressbook_transfer_cards (EBook *source, GList *cards /* adopted */, gboolea process = g_new (CardCopyProcess, 1); process->count = 1; process->source = source; - gtk_object_ref (GTK_OBJECT (source)); + g_object_ref (source); process->cards = cards; process->destination = NULL; diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index f7565b581b..a4a7830219 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -23,7 +23,6 @@ #include <gtk/gtkinvisible.h> -#include <libgnome/gnome-paper.h> #include <libgnome/gnome-i18n.h> #include <libgnome/gnome-util.h> #include <gal/e-table/e-table-scrolled.h> @@ -34,16 +33,13 @@ #include <gal/widgets/e-unicode.h> #include <gal/menus/gal-view-factory-etable.h> #include <gal/menus/gal-view-etable.h> -#include <gal/util/e-unicode-i18n.h> #include <gal/util/e-xml-utils.h> -#include <gal/unicode/gunicode.h> #include <libgnomeui/gnome-dialog-util.h> -#include <libgnomeui/gnome-stock.h> #include <libgnomeprint/gnome-print.h> -#include <libgnomeprint/gnome-print-dialog.h> #include <libgnomeprint/gnome-print-master.h> -#include <libgnomeprint/gnome-print-master-preview.h> +#include <libgnomeprintui/gnome-print-dialog.h> +#include <libgnomeprintui/gnome-print-master-preview.h> #include "addressbook/printing/e-contact-print.h" #include "addressbook/printing/e-contact-print-envelope.h" @@ -51,6 +47,7 @@ #include "gal-view-factory-minicard.h" #include "gal-view-minicard.h" +#include "e-addressbook-marshal.h" #include "e-addressbook-view.h" #include "e-addressbook-model.h" #include "e-addressbook-util.h" @@ -176,46 +173,50 @@ e_addressbook_view_class_init (EAddressbookViewClass *klass) GTK_ARG_READWRITE, ARG_TYPE); e_addressbook_view_signals [STATUS_MESSAGE] = - gtk_signal_new ("status_message", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (EAddressbookViewClass, status_message), - gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); + g_signal_new ("status_message", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookViewClass, status_message), + NULL, NULL, + e_addressbook_marshal_NONE__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); e_addressbook_view_signals [SEARCH_RESULT] = - gtk_signal_new ("search_result", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (EAddressbookViewClass, search_result), - gtk_marshal_NONE__ENUM, - GTK_TYPE_NONE, 1, GTK_TYPE_ENUM); + g_signal_new ("search_result", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookViewClass, search_result), + NULL, NULL, + e_addressbook_marshal_NONE__ENUM, + G_TYPE_NONE, 1, G_TYPE_ENUM); e_addressbook_view_signals [FOLDER_BAR_MESSAGE] = - gtk_signal_new ("folder_bar_message", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (EAddressbookViewClass, folder_bar_message), - gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); + g_signal_new ("folder_bar_message", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookViewClass, folder_bar_message), + NULL, NULL, + e_addressbook_marshal_NONE__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); e_addressbook_view_signals [COMMAND_STATE_CHANGE] = - gtk_signal_new ("command_state_change", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (EAddressbookViewClass, command_state_change), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + g_signal_new ("command_state_change", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookViewClass, command_state_change), + NULL, NULL, + e_addressbook_marshal_NONE__NONE, + G_TYPE_NONE, 0); e_addressbook_view_signals [ALPHABET_STATE_CHANGE] = - gtk_signal_new ("alphabet_state_change", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (EAddressbookViewClass, alphabet_state_change), - gtk_marshal_NONE__UINT, - GTK_TYPE_NONE, 1, GTK_TYPE_UINT); + g_signal_new ("alphabet_state_change", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAddressbookViewClass, alphabet_state_change), + NULL, NULL, + e_addressbook_marshal_NONE__UINT, + G_TYPE_NONE, 1, G_TYPE_UINT); - gtk_object_class_add_signals (object_class, e_addressbook_view_signals, LAST_SIGNAL); if (!clipboard_atom) clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE); @@ -228,35 +229,35 @@ e_addressbook_view_init (EAddressbookView *eav) eav->model = e_addressbook_model_new (); - gtk_signal_connect (GTK_OBJECT(eav->model), - "status_message", - GTK_SIGNAL_FUNC (status_message), - eav); + g_signal_connect (eav->model, + "status_message", + G_CALLBACK (status_message), + eav); - gtk_signal_connect (GTK_OBJECT(eav->model), - "search_result", - GTK_SIGNAL_FUNC (search_result), - eav); + g_signal_connect (eav->model, + "search_result", + G_CALLBACK (search_result), + eav); - gtk_signal_connect (GTK_OBJECT(eav->model), - "folder_bar_message", - GTK_SIGNAL_FUNC (folder_bar_message), - eav); + g_signal_connect (eav->model, + "folder_bar_message", + G_CALLBACK (folder_bar_message), + eav); - gtk_signal_connect (GTK_OBJECT(eav->model), - "stop_state_changed", - GTK_SIGNAL_FUNC (stop_state_changed), - eav); + g_signal_connect (eav->model, + "stop_state_changed", + G_CALLBACK (stop_state_changed), + eav); - gtk_signal_connect (GTK_OBJECT(eav->model), - "writable_status", - GTK_SIGNAL_FUNC (writable_status), - eav); + g_signal_connect (eav->model, + "writable_status", + G_CALLBACK (writable_status), + eav); - gtk_signal_connect (GTK_OBJECT(eav->model), - "backend_died", - GTK_SIGNAL_FUNC (backend_died), - eav); + g_signal_connect (eav->model, + "backend_died", + G_CALLBACK (backend_died), + eav); eav->editable = FALSE; eav->book = NULL; @@ -277,18 +278,18 @@ e_addressbook_view_init (EAddressbookView *eav) GDK_SELECTION_TYPE_STRING, 0); - gtk_signal_connect (GTK_OBJECT(eav->invisible), "selection_get", - GTK_SIGNAL_FUNC (selection_get), - eav); - gtk_signal_connect (GTK_OBJECT(eav->invisible), "selection_clear_event", - GTK_SIGNAL_FUNC (selection_clear_event), - eav); - gtk_signal_connect (GTK_OBJECT(eav->invisible), "selection_received", - GTK_SIGNAL_FUNC (selection_received), - eav); - gtk_signal_connect (GTK_OBJECT(eav->invisible), "destroy", - GTK_SIGNAL_FUNC (invisible_destroyed), - eav); + g_signal_connect (eav->invisible, "selection_get", + G_CALLBACK (selection_get), + eav); + g_signal_connect (eav->invisible, "selection_clear_event", + G_CALLBACK (selection_clear_event), + eav); + g_signal_connect (eav->invisible, "selection_received", + G_CALLBACK (selection_received), + eav); + g_signal_connect (eav->invisible, "destroy", + G_CALLBACK (invisible_destroyed), + eav); } static void @@ -297,12 +298,12 @@ e_addressbook_view_destroy (GtkObject *object) EAddressbookView *eav = E_ADDRESSBOOK_VIEW(object); if (eav->model) { - gtk_object_unref(GTK_OBJECT(eav->model)); + g_object_unref (eav->model); eav->model = NULL; } if (eav->book) { - gtk_object_unref(GTK_OBJECT(eav->book)); + g_object_unref (eav->book); eav->book = NULL; } @@ -312,17 +313,17 @@ e_addressbook_view_destroy (GtkObject *object) eav->uic = NULL; if (eav->view_instance) { - gtk_object_unref (GTK_OBJECT (eav->view_instance)); + g_object_unref (eav->view_instance); eav->view_instance = NULL; } if (eav->view_menus) { - gtk_object_unref (GTK_OBJECT (eav->view_menus)); + g_object_unref (eav->view_menus); eav->view_menus = NULL; } if (eav->clipboard_cards) { - g_list_foreach (eav->clipboard_cards, (GFunc)gtk_object_unref, NULL); + g_list_foreach (eav->clipboard_cards, (GFunc)g_object_unref, NULL); g_list_free (eav->clipboard_cards); eav->clipboard_cards = NULL; } @@ -373,13 +374,13 @@ init_collection (void) e_table_specification_load_from_file (spec, EVOLUTION_ETSPECDIR "/e-addressbook-view.etspec"); factory = gal_view_factory_etable_new (spec); - gtk_object_unref (GTK_OBJECT (spec)); + g_object_unref (spec); gal_view_collection_add_factory (collection, factory); - gtk_object_unref (GTK_OBJECT (factory)); + g_object_unref (factory); factory = gal_view_factory_minicard_new (); gal_view_collection_add_factory (collection, factory); - gtk_object_unref (GTK_OBJECT (factory)); + g_object_unref (factory); gal_view_collection_load(collection); } @@ -415,8 +416,8 @@ setup_menus (EAddressbookView *view) display_view (view->view_instance, gal_view_instance_get_current_view (view->view_instance), view); - gtk_signal_connect(GTK_OBJECT(view->view_instance), "display_view", - display_view, view); + g_signal_connect(view->view_instance, "display_view", + G_CALLBACK (display_view), view); } } @@ -428,23 +429,23 @@ e_addressbook_view_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) switch (arg_id){ case ARG_BOOK: if (eav->book) { - gtk_object_unref(GTK_OBJECT(eav->book)); + g_object_unref (eav->book); } if (GTK_VALUE_OBJECT(*arg)) { eav->book = E_BOOK(GTK_VALUE_OBJECT(*arg)); - gtk_object_ref(GTK_OBJECT(eav->book)); + g_object_ref (eav->book); } else eav->book = NULL; if (eav->view_instance) { - gtk_object_unref (GTK_OBJECT (eav->view_instance)); + g_object_unref (eav->view_instance); eav->view_instance = NULL; } - gtk_object_set(GTK_OBJECT(eav->model), - "book", eav->book, - NULL); + g_object_set(eav->model, + "book", eav->book, + NULL); setup_menus (eav); @@ -459,9 +460,9 @@ e_addressbook_view_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) eav->query = g_strdup(GTK_VALUE_STRING(*arg)); if (!eav->query) eav->query = g_strdup (SHOW_ALL_SEARCH); - gtk_object_set(GTK_OBJECT(eav->model), - "query", eav->query, - NULL); + g_object_set(eav->model, + "query", eav->query, + NULL); if (eav->current_alphabet_widget != NULL) { GtkWidget *current = eav->current_alphabet_widget; @@ -537,7 +538,7 @@ card_and_book_free (CardAndBook *card_and_book) if (selection) e_selection_model_right_click_up(selection); - gtk_object_unref(GTK_OBJECT(view)); + g_object_unref (view); } static void @@ -651,6 +652,7 @@ send_to (GtkWidget *widget, CardAndBook *card_and_book) static void print (GtkWidget *widget, CardAndBook *card_and_book) { +#ifdef PENDING_PORT_WORK GList *cards = get_card_list (card_and_book); if (cards) { if (cards->next) @@ -659,6 +661,7 @@ print (GtkWidget *widget, CardAndBook *card_and_book) gtk_widget_show(e_contact_print_card_dialog_new(cards->data)); e_free_object_list(cards); } +#endif } #if 0 /* Envelope printing is disabled for Evolution 1.0. */ @@ -797,36 +800,36 @@ do_popup_menu(EAddressbookView *view, GdkEvent *event) gboolean selection = FALSE; EPopupMenu menu[] = { - E_POPUP_ITEM (N_("New Contact..."), GTK_SIGNAL_FUNC(new_card), POPUP_READONLY_MASK), - E_POPUP_ITEM (N_("New Contact List..."), GTK_SIGNAL_FUNC(new_list), POPUP_READONLY_MASK), + E_POPUP_ITEM (N_("New Contact..."), G_CALLBACK(new_card), POPUP_READONLY_MASK), + E_POPUP_ITEM (N_("New Contact List..."), G_CALLBACK(new_list), POPUP_READONLY_MASK), E_POPUP_SEPARATOR, #if 0 - E_POPUP_ITEM (N_("Go to Folder..."), GTK_SIGNAL_FUNC (goto_folder), 0), - E_POPUP_ITEM (N_("Import..."), GTK_SIGNAL_FUNC (import), POPUP_READONLY_MASK), + E_POPUP_ITEM (N_("Go to Folder..."), G_CALLBACK (goto_folder), 0), + E_POPUP_ITEM (N_("Import..."), G_CALLBACK (import), POPUP_READONLY_MASK), E_POPUP_SEPARATOR, - E_POPUP_ITEM (N_("Search for Contacts..."), GTK_SIGNAL_FUNC (search), 0), - E_POPUP_ITEM (N_("Addressbook Sources..."), GTK_SIGNAL_FUNC (sources), 0), + E_POPUP_ITEM (N_("Search for Contacts..."), G_CALLBACK (search), 0), + E_POPUP_ITEM (N_("Addressbook Sources..."), G_CALLBACK (sources), 0), E_POPUP_SEPARATOR, - E_POPUP_ITEM (N_("Pilot Settings..."), GTK_SIGNAL_FUNC (pilot_settings), 0), + E_POPUP_ITEM (N_("Pilot Settings..."), G_CALLBACK (pilot_settings), 0), #endif E_POPUP_SEPARATOR, - E_POPUP_ITEM (N_("Save as VCard"), GTK_SIGNAL_FUNC(save_as), POPUP_NOSELECTION_MASK), - E_POPUP_ITEM (N_("Forward Contact"), GTK_SIGNAL_FUNC(send_as), POPUP_NOSELECTION_MASK), - E_POPUP_ITEM (N_("Send Message to Contact"), GTK_SIGNAL_FUNC(send_to), POPUP_NOSELECTION_MASK | POPUP_NOEMAIL_MASK), - E_POPUP_ITEM (N_("Print"), GTK_SIGNAL_FUNC(print), POPUP_NOSELECTION_MASK), + E_POPUP_ITEM (N_("Save as VCard"), G_CALLBACK(save_as), POPUP_NOSELECTION_MASK), + E_POPUP_ITEM (N_("Forward Contact"), G_CALLBACK(send_as), POPUP_NOSELECTION_MASK), + E_POPUP_ITEM (N_("Send Message to Contact"), G_CALLBACK(send_to), POPUP_NOSELECTION_MASK | POPUP_NOEMAIL_MASK), + E_POPUP_ITEM (N_("Print"), G_CALLBACK(print), POPUP_NOSELECTION_MASK), #if 0 /* Envelope printing is disabled for Evolution 1.0. */ - E_POPUP_ITEM (N_("Print Envelope"), GTK_SIGNAL_FUNC(print_envelope), POPUP_NOSELECTION_MASK), + E_POPUP_ITEM (N_("Print Envelope"), G_CALLBACK(print_envelope), POPUP_NOSELECTION_MASK), #endif E_POPUP_SEPARATOR, - E_POPUP_ITEM (N_("Copy to folder..."), GTK_SIGNAL_FUNC(copy_to_folder), POPUP_NOSELECTION_MASK), - E_POPUP_ITEM (N_("Move to folder..."), GTK_SIGNAL_FUNC(move_to_folder), POPUP_READONLY_MASK | POPUP_NOSELECTION_MASK), + E_POPUP_ITEM (N_("Copy to folder..."), G_CALLBACK(copy_to_folder), POPUP_NOSELECTION_MASK), + E_POPUP_ITEM (N_("Move to folder..."), G_CALLBACK(move_to_folder), POPUP_READONLY_MASK | POPUP_NOSELECTION_MASK), E_POPUP_SEPARATOR, - E_POPUP_ITEM (N_("Cut"), GTK_SIGNAL_FUNC (cut), POPUP_READONLY_MASK | POPUP_NOSELECTION_MASK), - E_POPUP_ITEM (N_("Copy"), GTK_SIGNAL_FUNC (copy), POPUP_NOSELECTION_MASK), - E_POPUP_ITEM (N_("Paste"), GTK_SIGNAL_FUNC (paste), POPUP_READONLY_MASK), - E_POPUP_ITEM (N_("Delete"), GTK_SIGNAL_FUNC(delete), POPUP_READONLY_MASK | POPUP_NOSELECTION_MASK), + E_POPUP_ITEM (N_("Cut"), G_CALLBACK (cut), POPUP_READONLY_MASK | POPUP_NOSELECTION_MASK), + E_POPUP_ITEM (N_("Copy"), G_CALLBACK (copy), POPUP_NOSELECTION_MASK), + E_POPUP_ITEM (N_("Paste"), G_CALLBACK (paste), POPUP_READONLY_MASK), + E_POPUP_ITEM (N_("Delete"), G_CALLBACK(delete), POPUP_READONLY_MASK | POPUP_NOSELECTION_MASK), E_POPUP_SEPARATOR, #if 0 @@ -839,7 +842,7 @@ do_popup_menu(EAddressbookView *view, GdkEvent *event) card_and_book->view = view; card_and_book->submenu = submenu; - gtk_object_ref(GTK_OBJECT(card_and_book->view)); + g_object_ref (card_and_book->view); selection_model = card_and_book_get_selection_model (card_and_book); if (selection_model) @@ -852,8 +855,8 @@ do_popup_menu(EAddressbookView *view, GdkEvent *event) (get_has_email_address (card_and_book) ? 0 : POPUP_NOEMAIL_MASK), card_and_book); - gtk_signal_connect (GTK_OBJECT (popup), "selection-done", - GTK_SIGNAL_FUNC (free_popup_info), card_and_book); + g_signal_connect (popup, "selection-done", + G_CALLBACK (free_popup_info), card_and_book); e_popup_menu (popup, event); } @@ -928,7 +931,7 @@ jump_to_letters (EAddressbookView *view, gchar* l) char buf[6 + 1]; if (g_unichar_isdigit (g_utf8_get_char(l))) { - const char *letters = U_(button_letters); + const char *letters = _(button_letters); char **letter_v; GString *gstr; char **p; @@ -961,9 +964,9 @@ jump_to_letters (EAddressbookView *view, gchar* l) query = gstr->str; g_string_free (gstr, FALSE); } - gtk_object_set (GTK_OBJECT (view), - "query", query, - NULL); + g_object_set (view, + "query", query, + NULL); g_free (query); } @@ -985,9 +988,9 @@ button_toggled(GtkWidget *button, LetterClosure *closure) if (view->current_alphabet_widget != NULL && view->current_alphabet_widget == button) { view->current_alphabet_widget = NULL; - gtk_object_set (GTK_OBJECT (view), - "query", NULL, - NULL); + g_object_set (view, + "query", NULL, + NULL); alphabet_state_change (view, 0); } } @@ -1026,10 +1029,10 @@ create_alphabet (EAddressbookView *view) gtk_container_add (GTK_CONTAINER (viewport), vbox); gtk_widget_set_usize (vbox, 27, 0); - labels = U_(button_labels); + labels = _(button_labels); sep = g_utf8_get_char (labels); label_v = e_utf8_split (g_utf8_next_char (labels), sep); - letters = U_(button_letters); + letters = _(button_letters); sep = g_utf8_get_char (letters); letter_v = e_utf8_split (g_utf8_next_char (letters), sep); g_assert (label_v != NULL && letter_v != NULL); @@ -1048,10 +1051,10 @@ create_alphabet (EAddressbookView *view) closure->letters = g_strdup (*pc); closure->button = button; closure->vbox = vbox; - gtk_signal_connect(GTK_OBJECT(button), "toggled", - GTK_SIGNAL_FUNC (button_toggled), closure); - gtk_signal_connect(GTK_OBJECT(button), "destroy", - GTK_SIGNAL_FUNC (free_closure), closure); + g_signal_connect(button, "toggled", + G_CALLBACK (button_toggled), closure); + g_signal_connect(button, "destroy", + G_CALLBACK (free_closure), closure); } g_strfreev (label_v); @@ -1098,16 +1101,16 @@ create_minicard_view (EAddressbookView *view) minicard_view = e_minicard_view_widget_new(adapter); /* A hack */ - gtk_object_set_data (GTK_OBJECT (adapter), "view", view); + g_object_set_data (G_OBJECT (adapter), "view", view); - gtk_signal_connect(GTK_OBJECT(minicard_view), "selection_change", - GTK_SIGNAL_FUNC(minicard_selection_change), view); + g_signal_connect(minicard_view, "selection_change", + G_CALLBACK(minicard_selection_change), view); - gtk_signal_connect(GTK_OBJECT(minicard_view), "button_press_event", - GTK_SIGNAL_FUNC(minicard_button_press), view); + g_signal_connect(minicard_view, "button_press_event", + G_CALLBACK(minicard_button_press), view); - gtk_signal_connect(GTK_OBJECT(minicard_view), "right_click", - GTK_SIGNAL_FUNC(minicard_right_click), view); + g_signal_connect(minicard_view, "right_click", + G_CALLBACK(minicard_right_click), view); view->object = GTK_OBJECT(minicard_view); @@ -1125,10 +1128,10 @@ create_minicard_view (EAddressbookView *view) alphabet = create_alphabet(view); if (alphabet) { - gtk_object_ref(GTK_OBJECT(alphabet)); + g_object_ref (alphabet); gtk_widget_unparent(alphabet); gtk_box_pack_start(GTK_BOX(minicard_hbox), alphabet, FALSE, FALSE, 0); - gtk_object_unref(GTK_OBJECT(alphabet)); + g_object_unref (alphabet); } gtk_table_attach(GTK_TABLE(view), minicard_hbox, @@ -1144,7 +1147,7 @@ create_minicard_view (EAddressbookView *view) e_reflow_model_changed (E_REFLOW_MODEL (adapter)); - gtk_object_unref (GTK_OBJECT (adapter)); + g_object_unref (adapter); } static void @@ -1226,25 +1229,25 @@ table_drag_data_get (ETable *table, static void emit_status_message (EAddressbookView *eav, const gchar *status) { - gtk_signal_emit (GTK_OBJECT (eav), - e_addressbook_view_signals [STATUS_MESSAGE], - status); + g_signal_emit (eav, + e_addressbook_view_signals [STATUS_MESSAGE], 0, + status); } static void emit_search_result (EAddressbookView *eav, EBookViewStatus status) { - gtk_signal_emit (GTK_OBJECT (eav), - e_addressbook_view_signals [SEARCH_RESULT], - status); + g_signal_emit (eav, + e_addressbook_view_signals [SEARCH_RESULT], 0, + status); } static void emit_folder_bar_message (EAddressbookView *eav, const gchar *message) { - gtk_signal_emit (GTK_OBJECT (eav), - e_addressbook_view_signals [FOLDER_BAR_MESSAGE], - message); + g_signal_emit (eav, + e_addressbook_view_signals [FOLDER_BAR_MESSAGE], 0, + message); } static void @@ -1275,13 +1278,13 @@ static void command_state_change (EAddressbookView *eav) { /* Reffing during emission is unnecessary. Gtk automatically refs during an emission. */ - gtk_signal_emit (GTK_OBJECT (eav), e_addressbook_view_signals [COMMAND_STATE_CHANGE]); + g_signal_emit (eav, e_addressbook_view_signals [COMMAND_STATE_CHANGE], 0); } static void alphabet_state_change (EAddressbookView *eav, gunichar letter) { - gtk_signal_emit (GTK_OBJECT (eav), e_addressbook_view_signals [ALPHABET_STATE_CHANGE], letter); + g_signal_emit (eav, e_addressbook_view_signals [ALPHABET_STATE_CHANGE], 0, letter); } static void @@ -1314,23 +1317,23 @@ create_table_view (EAddressbookView *view) view->object = GTK_OBJECT(adapter); view->widget = table; - gtk_signal_connect(GTK_OBJECT(e_table_scrolled_get_table(E_TABLE_SCROLLED(table))), "double_click", - GTK_SIGNAL_FUNC(table_double_click), view); - gtk_signal_connect(GTK_OBJECT(e_table_scrolled_get_table(E_TABLE_SCROLLED(table))), "right_click", - GTK_SIGNAL_FUNC(table_right_click), view); - gtk_signal_connect(GTK_OBJECT(e_table_scrolled_get_table(E_TABLE_SCROLLED(table))), "white_space_event", - GTK_SIGNAL_FUNC(table_white_space_event), view); - gtk_signal_connect(GTK_OBJECT(e_table_scrolled_get_table(E_TABLE_SCROLLED(table))), "selection_change", - GTK_SIGNAL_FUNC(table_selection_change), view); + g_signal_connect(e_table_scrolled_get_table(E_TABLE_SCROLLED(table)), "double_click", + G_CALLBACK(table_double_click), view); + g_signal_connect(e_table_scrolled_get_table(E_TABLE_SCROLLED(table)), "right_click", + G_CALLBACK(table_right_click), view); + g_signal_connect(e_table_scrolled_get_table(E_TABLE_SCROLLED(table)), "white_space_event", + G_CALLBACK(table_white_space_event), view); + g_signal_connect(e_table_scrolled_get_table(E_TABLE_SCROLLED(table)), "selection_change", + G_CALLBACK(table_selection_change), view); /* drag & drop signals */ e_table_drag_source_set (E_TABLE(E_TABLE_SCROLLED(table)->table), GDK_BUTTON1_MASK, drag_types, num_drag_types, GDK_ACTION_MOVE); - gtk_signal_connect (GTK_OBJECT (E_TABLE_SCROLLED(table)->table), - "table_drag_data_get", - GTK_SIGNAL_FUNC (table_drag_data_get), - view); + g_signal_connect (E_TABLE_SCROLLED(table)->table, + "table_drag_data_get", + G_CALLBACK (table_drag_data_get), + view); gtk_table_attach(GTK_TABLE(view), table, 0, 1, @@ -1340,7 +1343,7 @@ create_table_view (EAddressbookView *view) gtk_widget_show( GTK_WIDGET(table) ); - gtk_object_unref(GTK_OBJECT(simple)); + g_object_unref (simple); } @@ -1378,8 +1381,8 @@ e_contact_print_destroy(GnomeDialog *dialog, gpointer data) { ETableScrolled *table = gtk_object_get_data(GTK_OBJECT(dialog), "table"); EPrintable *printable = gtk_object_get_data(GTK_OBJECT(dialog), "printable"); - gtk_object_unref(GTK_OBJECT(printable)); - gtk_object_unref(GTK_OBJECT(table)); + g_object_unref (printable); + g_object_unref (table); } static void @@ -1390,8 +1393,8 @@ e_contact_print_button(GnomeDialog *dialog, gint button, gpointer data) EPrintable *printable = gtk_object_get_data(GTK_OBJECT(dialog), "printable"); GtkWidget *preview; switch( button ) { - case GNOME_PRINT_PRINT: - master = gnome_print_master_new_from_dialog( GNOME_PRINT_DIALOG(dialog) ); + case GNOME_PRINT_DIALOG_RESPONSE_PRINT: + master = gnome_print_master_new_from_config (gnome_print_dialog_get_config ( GNOME_PRINT_DIALOG(dialog) )); pc = gnome_print_master_get_context( master ); e_printable_reset(printable); while (e_printable_data_left(printable)) { @@ -1411,11 +1414,11 @@ e_contact_print_button(GnomeDialog *dialog, gint button, gpointer data) } gnome_print_master_close(master); gnome_print_master_print(master); - gtk_object_unref(GTK_OBJECT(master)); + g_object_unref (master); gnome_dialog_close(dialog); break; - case GNOME_PRINT_PREVIEW: - master = gnome_print_master_new_from_dialog( GNOME_PRINT_DIALOG(dialog) ); + case GNOME_PRINT_DIALOG_RESPONSE_PREVIEW: + master = gnome_print_master_new_from_config (gnome_print_dialog_get_config ( GNOME_PRINT_DIALOG(dialog) )); pc = gnome_print_master_get_context( master ); e_printable_reset(printable); while (e_printable_data_left(printable)) { @@ -1436,9 +1439,9 @@ e_contact_print_button(GnomeDialog *dialog, gint button, gpointer data) gnome_print_master_close(master); preview = GTK_WIDGET(gnome_print_master_preview_new(master, "Print Preview")); gtk_widget_show_all(preview); - gtk_object_unref(GTK_OBJECT(master)); + g_object_unref (master); break; - case GNOME_PRINT_CANCEL: + case GNOME_PRINT_DIALOG_RESPONSE_CANCEL: gnome_dialog_close(dialog); break; } @@ -1479,12 +1482,12 @@ e_addressbook_view_discard_menus (EAddressbookView *view) if (view->view_menus) { gal_view_menus_unmerge (view->view_menus, NULL); - gtk_object_unref (GTK_OBJECT (view->view_menus)); + g_object_unref (view->view_menus); view->view_menus = NULL; } if (view->view_instance) { - gtk_object_unref (GTK_OBJECT (view->view_instance)); + g_object_unref (view->view_instance); view->view_instance = NULL; } @@ -1494,6 +1497,7 @@ e_addressbook_view_discard_menus (EAddressbookView *view) void e_addressbook_view_print(EAddressbookView *view) { +#ifdef PENDING_PORT_WORK if (view->view_type == E_ADDRESSBOOK_VIEW_MINICARD) { char *query; EBook *book; @@ -1518,22 +1522,24 @@ e_addressbook_view_print(EAddressbookView *view) gtk_object_get(GTK_OBJECT(view->widget), "table", &etable, NULL); printable = e_table_get_printable(etable); - gtk_object_ref(GTK_OBJECT(view->widget)); + g_object_ref (view->widget); - gtk_object_set_data(GTK_OBJECT(dialog), "table", view->widget); - gtk_object_set_data(GTK_OBJECT(dialog), "printable", printable); + g_object_set_data (G_OBJECT (dialog), "table", view->widget); + g_object_set_data (G_OBJECT (dialog), "printable", printable); - gtk_signal_connect(GTK_OBJECT(dialog), - "clicked", GTK_SIGNAL_FUNC(e_contact_print_button), NULL); - gtk_signal_connect(GTK_OBJECT(dialog), - "destroy", GTK_SIGNAL_FUNC(e_contact_print_destroy), NULL); - gtk_widget_show(dialog); + g_signal_connect(dialog, + "clicked", G_CALLBACK(e_contact_print_button), NULL); + g_signal_connect(dialog, + "destroy", G_CALLBACK(e_contact_print_destroy), NULL); + g_widget_show(dialog); } +#endif } void e_addressbook_view_print_preview(EAddressbookView *view) { +#ifdef PENDING_PORT_WORK if (view->view_type == E_ADDRESSBOOK_VIEW_MINICARD) { char *query; EBook *book; @@ -1576,9 +1582,10 @@ e_addressbook_view_print_preview(EAddressbookView *view) gnome_print_master_close(master); preview = GTK_WIDGET(gnome_print_master_preview_new(master, "Print Preview")); gtk_widget_show_all(preview); - gtk_object_unref(GTK_OBJECT(master)); - gtk_object_unref(GTK_OBJECT(printable)); + g_object_unref (master); + g_object_unref (printable); } +#endif } static void @@ -1604,7 +1611,7 @@ do_remove (int i, gpointer user_data) e_book_remove_card(book, card, card_deleted_cb, view); - gtk_object_unref (GTK_OBJECT (card)); + g_object_unref (card); } void @@ -1647,7 +1654,7 @@ selection_clear_event (GtkWidget *invisible, EAddressbookView *view) { if (view->clipboard_cards) { - g_list_foreach (view->clipboard_cards, (GFunc)gtk_object_unref, NULL); + g_list_foreach (view->clipboard_cards, (GFunc)g_object_unref, NULL); g_list_free (view->clipboard_cards); view->clipboard_cards = NULL; } @@ -1676,7 +1683,7 @@ selection_received (GtkWidget *invisible, e_card_merging_book_add_card (view->book, card, NULL /* XXX */, NULL); } - g_list_foreach (card_list, (GFunc)gtk_object_unref, NULL); + g_list_foreach (card_list, (GFunc)g_object_unref, NULL); g_list_free (card_list); } } @@ -1701,7 +1708,7 @@ get_selected_cards (EAddressbookView *view) for (iterator = list; iterator; iterator = iterator->next) { iterator->data = e_addressbook_model_card_at (view->model, GPOINTER_TO_INT (iterator->data)); if (iterator->data) - gtk_object_ref (iterator->data); + g_object_ref (iterator->data); } list = g_list_reverse (list); return list; @@ -1734,7 +1741,7 @@ e_addressbook_view_save_state (EAddressbookView *view, const char *filename) e_xml_set_string_prop_by_name (node, "style", "table"); e_table_state_save_to_node (state, node); - gtk_object_unref (GTK_OBJECT (state)); + g_object_unref (state); break; } default: @@ -1764,9 +1771,9 @@ e_addressbook_view_load_state (EAddressbookView *view, const char *filename) change_view_type (view, E_ADDRESSBOOK_VIEW_MINICARD); column_width = e_xml_get_integer_prop_by_name (node, "column-width"); - gtk_object_set (GTK_OBJECT (view->object), - "column_width", column_width, - NULL); + g_object_set (view->object, + "column_width", column_width, + NULL); } else if (!strcmp (type, "table")) { ETableState *state; @@ -1775,7 +1782,7 @@ e_addressbook_view_load_state (EAddressbookView *view, const char *filename) state = e_table_state_new(); e_table_state_load_from_node (state, node->xmlChildrenNode); e_table_set_state_object (E_TABLE (view->widget), state); - gtk_object_unref (GTK_OBJECT (state)); + g_object_unref (state); } xmlFreeDoc(doc); } @@ -1853,9 +1860,9 @@ e_addressbook_view_select_all (EAddressbookView *view) void e_addressbook_view_show_all(EAddressbookView *view) { - gtk_object_set(GTK_OBJECT(view), - "query", NULL, - NULL); + g_object_set(view, + "query", NULL, + NULL); } void diff --git a/addressbook/gui/widgets/e-addressbook-view.h b/addressbook/gui/widgets/e-addressbook-view.h index 897c37d420..305092ff35 100644 --- a/addressbook/gui/widgets/e-addressbook-view.h +++ b/addressbook/gui/widgets/e-addressbook-view.h @@ -26,7 +26,6 @@ #include "e-addressbook-model.h" #include "widgets/menus/gal-view-menus.h" #include "addressbook/backend/ebook/e-book.h" -#include <gal/unicode/gunicode.h> #ifdef __cplusplus extern "C" { diff --git a/addressbook/gui/widgets/e-minicard-control.c b/addressbook/gui/widgets/e-minicard-control.c index 73417af78c..1aeba789e2 100644 --- a/addressbook/gui/widgets/e-minicard-control.c +++ b/addressbook/gui/widgets/e-minicard-control.c @@ -10,16 +10,17 @@ #include <config.h> +#include <gtk/gtk.h> #include <bonobo/bonobo-generic-factory.h> #include <bonobo/bonobo-persist.h> #include <bonobo/bonobo-persist-stream.h> #include <bonobo/bonobo-stream-client.h> -#include <addressbook/backend/ebook/e-book.h> -#include <addressbook/backend/ebook/e-book-util.h> -#include <addressbook/backend/ebook/e-card.h> #include <gal/util/e-util.h> #include <addressbook/gui/component/addressbook.h> +#include <addressbook/backend/ebook/e-book.h> +#include <addressbook/backend/ebook/e-book-util.h> +#include <addressbook/backend/ebook/e-card.h> #include "e-minicard-control.h" #include "e-minicard-widget.h" @@ -84,8 +85,8 @@ set_prop (BonoboPropertyBag *bag, else gtk_clock_stop (clock); - gtk_object_set_data (GTK_OBJECT (clock), RUNNING_KEY, - GUINT_TO_POINTER (i)); + g_object_set_data (clock, RUNNING_KEY, + GUINT_TO_POINTER (i)); break; } @@ -175,9 +176,9 @@ pstream_load (BonoboPersistStream *ps, const Bonobo_Stream stream, g_free(vcard); minicard_control->card_list = list; if (list) - gtk_object_set(GTK_OBJECT(minicard_control->minicard), - "card", list->data, - NULL); + g_object_set(minicard_control->minicard, + "card", list->data, + NULL); if (list && list->next) { char *message; int length = g_list_length (list) - 1; @@ -250,7 +251,7 @@ book_open_cb (EBook *book, EBookStatus status, gpointer closure) for (p = list; p; p = p->next) { e_card_merging_book_add_card(book, p->data, NULL, NULL); } - gtk_object_unref (GTK_OBJECT (book)); + g_object_unref (book); } e_free_object_list (list); } @@ -267,10 +268,10 @@ save_in_addressbook(GtkWidget *button, gpointer data) list = g_list_copy (minicard_control->card_list); for (p = list; p; p = p->next) - gtk_object_ref (GTK_OBJECT (p->data)); + g_object_ref (p->data); if (!addressbook_load_default_book (book, book_open_cb, list)) { - gtk_object_unref (GTK_OBJECT (book)); + g_object_unref (book); book_open_cb (NULL, E_BOOK_STATUS_OTHER_ERROR, list); } } @@ -284,7 +285,9 @@ free_struct (GtkWidget *control, gpointer data) } static BonoboObject * -e_minicard_control_factory (BonoboGenericFactory *Factory, void *closure) +e_minicard_control_factory (BonoboGenericFactory *Factory, + const char *component_id, + void *closure) { #if 0 BonoboPropertyBag *pb; @@ -314,8 +317,8 @@ e_minicard_control_factory (BonoboGenericFactory *Factory, void *closure) minicard_control->label = label; button = gtk_button_new_with_label(_("Save in addressbook")); - gtk_signal_connect(GTK_OBJECT(button), "clicked", - save_in_addressbook, minicard_control); + g_signal_connect (button, "clicked", + G_CALLBACK (save_in_addressbook), minicard_control); gtk_widget_show (button); vbox = gtk_vbox_new(FALSE, 0); @@ -326,8 +329,8 @@ e_minicard_control_factory (BonoboGenericFactory *Factory, void *closure) control = bonobo_control_new (vbox); - gtk_signal_connect (GTK_OBJECT (control), "destroy", - free_struct, minicard_control); + g_signal_connect (control, "destroy", + G_CALLBACK (free_struct), minicard_control); stream = bonobo_persist_stream_new (pstream_load, pstream_save, pstream_get_max_size, diff --git a/addressbook/gui/widgets/e-minicard-label.c b/addressbook/gui/widgets/e-minicard-label.c index b59ff46ae3..1dbbe22dad 100644 --- a/addressbook/gui/widgets/e-minicard-label.c +++ b/addressbook/gui/widgets/e-minicard-label.c @@ -24,7 +24,7 @@ #include "e-minicard-label.h" #include <gtk/gtksignal.h> -#include <libgnomeui/gnome-canvas-rect-ellipse.h> +#include <libgnomecanvas/gnome-canvas-rect-ellipse.h> #include <gal/util/e-util.h> #include <gal/e-text/e-text.h> #include <gal/widgets/e-canvas.h> @@ -167,7 +167,7 @@ e_minicard_label_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) break; case ARG_EDITABLE: e_minicard_label->editable = GTK_VALUE_BOOL (*arg); - gtk_object_set (GTK_OBJECT (e_minicard_label->field), "editable", e_minicard_label->editable, NULL); + g_object_set (e_minicard_label->field, "editable", e_minicard_label->editable, NULL); break; } } @@ -235,7 +235,7 @@ e_minicard_label_construct (GnomeCanvasItem *item) GnomeCanvasGroup *group; GdkFont *font; - font = ((GtkWidget *) item->canvas)->style->font; + font = gtk_style_get_font (gtk_widget_get_style (GTK_WIDGET (item->canvas))); e_minicard_label = E_MINICARD_LABEL (item); group = GNOME_CANVAS_GROUP( item ); @@ -387,7 +387,7 @@ e_minicard_label_event (GnomeCanvasItem *item, GdkEvent *event) break; } #endif - gtk_signal_emit_by_name(GTK_OBJECT(e_minicard_label->field), "event", event, &return_val); + g_signal_emit_by_name(e_minicard_label->field, "event", event, &return_val); return return_val; break; } diff --git a/addressbook/gui/widgets/e-minicard-label.h b/addressbook/gui/widgets/e-minicard-label.h index 32792991a7..3e1044defd 100644 --- a/addressbook/gui/widgets/e-minicard-label.h +++ b/addressbook/gui/widgets/e-minicard-label.h @@ -21,7 +21,7 @@ #define __E_MINICARD_LABEL_H__ #include <glib.h> -#include <libgnomeui/gnome-canvas.h> +#include <libgnomecanvas/gnome-canvas.h> #ifdef __cplusplus extern "C" { diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c b/addressbook/gui/widgets/e-minicard-view-widget.c index 1f6e1bd26b..626ceea5c3 100644 --- a/addressbook/gui/widgets/e-minicard-view-widget.c +++ b/addressbook/gui/widgets/e-minicard-view-widget.c @@ -24,14 +24,16 @@ #include <gtk/gtksignal.h> #include <gal/widgets/e-canvas-background.h> #include <gal/widgets/e-canvas.h> +#include <libgnome/gnome-i18n.h> +#include "e-addressbook-marshal.h" #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_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); -static void e_minicard_view_widget_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void e_minicard_view_widget_destroy (GtkObject *object); +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); static void e_minicard_view_widget_reflow (ECanvas *canvas); static void e_minicard_view_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static void e_minicard_view_widget_realize (GtkWidget *widget); @@ -40,11 +42,11 @@ static ECanvasClass *parent_class = NULL; /* The arguments we take */ enum { - ARG_0, - ARG_BOOK, - ARG_QUERY, - ARG_EDITABLE, - ARG_COLUMN_WIDTH + PROP_0, + PROP_BOOK, + PROP_QUERY, + PROP_EDITABLE, + PROP_COLUMN_WIDTH }; enum { @@ -84,54 +86,74 @@ e_minicard_view_widget_get_type (void) static void e_minicard_view_widget_class_init (EMinicardViewWidgetClass *klass) { - GtkObjectClass *object_class; + GObjectClass *object_class; GtkWidgetClass *widget_class; ECanvasClass *canvas_class; - object_class = (GtkObjectClass*) klass; + object_class = (GObjectClass*) klass; widget_class = GTK_WIDGET_CLASS (klass); canvas_class = E_CANVAS_CLASS (klass); parent_class = gtk_type_class (e_canvas_get_type ()); - gtk_object_add_arg_type ("EMinicardViewWidget::book", GTK_TYPE_OBJECT, - GTK_ARG_READWRITE, ARG_BOOK); - gtk_object_add_arg_type ("EMinicardViewWidget::query", GTK_TYPE_STRING, - GTK_ARG_READWRITE, ARG_QUERY); - gtk_object_add_arg_type ("EMinicardViewWidget::editable", GTK_TYPE_BOOL, - GTK_ARG_READWRITE, ARG_EDITABLE); - gtk_object_add_arg_type ("EMinicardViewWidget::column_width", GTK_TYPE_INT, - GTK_ARG_READWRITE, ARG_COLUMN_WIDTH); + 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; + + g_object_class_install_property (object_class, PROP_BOOK, + g_param_spec_object ("book", + _("Book"), + /*_( */"XXX blurb" /*)*/, + E_TYPE_BOOK, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_QUERY, + g_param_spec_string ("query", + _("Query"), + /*_( */"XXX blurb" /*)*/, + NULL, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_EDITABLE, + g_param_spec_boolean ("editable", + _("Editable"), + /*_( */"XXX blurb" /*)*/, + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_COLUMN_WIDTH, + g_param_spec_int ("column_width", + _("Column Width"), + /*_( */"XXX blurb" /*)*/, + 0, 0, 0, + G_PARAM_READWRITE | G_PARAM_LAX_VALIDATION)); signals [SELECTION_CHANGE] = - gtk_signal_new ("selection_change", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (EMinicardViewWidgetClass, selection_change), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); + g_signal_new ("selection_change", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EMinicardViewWidgetClass, selection_change), + NULL, NULL, + e_addressbook_marshal_NONE__NONE, + G_TYPE_NONE, 0); signals [COLUMN_WIDTH_CHANGED] = - gtk_signal_new ("column_width_changed", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (EMinicardViewWidgetClass, column_width_changed), - e_marshal_NONE__DOUBLE, - GTK_TYPE_NONE, 1, GTK_TYPE_DOUBLE); + g_signal_new ("column_width_changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EMinicardViewWidgetClass, column_width_changed), + NULL, NULL, + e_addressbook_marshal_NONE__DOUBLE, + G_TYPE_NONE, 1, G_TYPE_DOUBLE); signals [RIGHT_CLICK] = - gtk_signal_new ("right_click", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (EMinicardViewWidgetClass, right_click), - gtk_marshal_INT__POINTER, - GTK_TYPE_INT, 1, GTK_TYPE_GDK_EVENT); - - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); - - object_class->set_arg = e_minicard_view_widget_set_arg; - object_class->get_arg = e_minicard_view_widget_get_arg; - object_class->destroy = e_minicard_view_widget_destroy; + g_signal_new ("right_click", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EMinicardViewWidgetClass, right_click), + NULL, NULL, + e_addressbook_marshal_INT__POINTER, + G_TYPE_INT, 1, G_TYPE_POINTER); widget_class->realize = e_minicard_view_widget_realize; widget_class->size_allocate = e_minicard_view_widget_size_allocate; @@ -160,119 +182,128 @@ e_minicard_view_widget_new (EAddressbookReflowAdapter *adapter) EMinicardViewWidget *widget = E_MINICARD_VIEW_WIDGET (gtk_type_new (e_minicard_view_widget_get_type ())); widget->adapter = adapter; - gtk_object_ref (GTK_OBJECT (widget->adapter)); + g_object_ref (widget->adapter); return GTK_WIDGET (widget); } static void -e_minicard_view_widget_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) +e_minicard_view_widget_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) { EMinicardViewWidget *emvw; - emvw = E_MINICARD_VIEW_WIDGET (o); + emvw = E_MINICARD_VIEW_WIDGET (object); - switch (arg_id){ - case ARG_BOOK: + switch (prop_id){ + case PROP_BOOK: if (emvw->book) - gtk_object_unref(GTK_OBJECT(emvw->book)); - if (GTK_VALUE_OBJECT (*arg)) { - emvw->book = E_BOOK(GTK_VALUE_OBJECT (*arg)); + g_object_unref (emvw->book); + if (g_value_get_object (value)) { + emvw->book = E_BOOK(g_value_get_object (value)); if (emvw->book) - gtk_object_ref(GTK_OBJECT(emvw->book)); + g_object_ref(emvw->book); } else emvw->book = NULL; if (emvw->emv) - gtk_object_set(GTK_OBJECT(emvw->emv), - "book", emvw->book, + g_object_set(emvw->emv, + "book", emvw->book, NULL); break; - case ARG_QUERY: - emvw->query = g_strdup(GTK_VALUE_STRING (*arg)); + case PROP_QUERY: + emvw->query = g_strdup(g_value_get_string (value)); if (emvw->emv) - gtk_object_set(GTK_OBJECT(emvw->emv), - "query", emvw->query, - NULL); + g_object_set(emvw->emv, + "query", emvw->query, + NULL); break; - case ARG_EDITABLE: - emvw->editable = GTK_VALUE_BOOL(*arg); + case PROP_EDITABLE: + emvw->editable = g_value_get_boolean (value); if (emvw->emv) - gtk_object_set (GTK_OBJECT(emvw->emv), - "editable", emvw->editable, - NULL); + g_object_set (emvw->emv, + "editable", emvw->editable, + NULL); break; - case ARG_COLUMN_WIDTH: - emvw->column_width = GTK_VALUE_INT (*arg); + case PROP_COLUMN_WIDTH: + emvw->column_width = g_value_get_int (value); if (emvw->emv) { - gtk_object_set (GTK_OBJECT(emvw->emv), - "column_width", (int) emvw->column_width, - NULL); + g_object_set (emvw->emv, + "column_width", (int) emvw->column_width, + NULL); } break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; } } static void -e_minicard_view_widget_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) +e_minicard_view_widget_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) { EMinicardViewWidget *emvw; emvw = E_MINICARD_VIEW_WIDGET (object); - switch (arg_id) { - case ARG_BOOK: - GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(emvw->book); + switch (prop_id) { + case PROP_BOOK: + g_value_set_object (value, emvw->book); break; - case ARG_QUERY: - GTK_VALUE_STRING (*arg) = g_strdup(emvw->query); + case PROP_QUERY: + g_value_set_string (value, emvw->query); break; - case ARG_EDITABLE: - GTK_VALUE_BOOL (*arg) = emvw->editable; + case PROP_EDITABLE: + g_value_set_boolean (value, emvw->editable); break; - case ARG_COLUMN_WIDTH: - GTK_VALUE_INT (*arg) = emvw->column_width; + case PROP_COLUMN_WIDTH: + g_value_set_int (value, emvw->column_width); break; default: - arg->type = GTK_TYPE_INVALID; + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void -e_minicard_view_widget_destroy (GtkObject *object) +e_minicard_view_widget_dispose (GObject *object) { EMinicardViewWidget *view = E_MINICARD_VIEW_WIDGET(object); if (view->book) - gtk_object_unref(GTK_OBJECT(view->book)); + g_object_unref (view->book); g_free(view->query); - gtk_object_unref (GTK_OBJECT (view->adapter)); + g_object_unref (view->adapter); - GTK_OBJECT_CLASS(parent_class)->destroy (object); + G_OBJECT_CLASS(parent_class)->dispose (object); } static void selection_change (ESelectionModel *esm, EMinicardViewWidget *widget) { - gtk_signal_emit (GTK_OBJECT(widget), - signals [SELECTION_CHANGE]); + g_signal_emit (widget, + signals [SELECTION_CHANGE], 0); } static void column_width_changed (ESelectionModel *esm, double width, EMinicardViewWidget *widget) { - gtk_signal_emit (GTK_OBJECT(widget), - signals [COLUMN_WIDTH_CHANGED], width); + g_signal_emit (widget, + signals [COLUMN_WIDTH_CHANGED], width, 0); } static guint right_click (EMinicardView *view, GdkEvent *event, EMinicardViewWidget *widget) { guint ret_val; - gtk_signal_emit (GTK_OBJECT(widget), - signals [RIGHT_CLICK], - event, &ret_val); + g_signal_emit (widget, + signals [RIGHT_CLICK], 0, + event, &ret_val); return ret_val; } @@ -295,15 +326,15 @@ e_minicard_view_widget_realize (GtkWidget *widget) "column_width", (int) view->column_width, NULL ); - gtk_signal_connect (GTK_OBJECT (E_REFLOW(view->emv)->selection), - "selection_changed", - selection_change, view); - gtk_signal_connect (GTK_OBJECT (view->emv), - "column_width_changed", - column_width_changed, view); - gtk_signal_connect (GTK_OBJECT (view->emv), - "right_click", - GTK_SIGNAL_FUNC (right_click), view); + g_signal_connect (E_REFLOW(view->emv)->selection, + "selection_changed", + G_CALLBACK (selection_change), view); + g_signal_connect (view->emv, + "column_width_changed", + G_CALLBACK (column_width_changed), view); + g_signal_connect (view->emv, + "right_click", + G_CALLBACK (right_click), view); if (GTK_WIDGET_CLASS(parent_class)->realize) GTK_WIDGET_CLASS(parent_class)->realize (widget); diff --git a/addressbook/gui/widgets/e-minicard-view-widget.h b/addressbook/gui/widgets/e-minicard-view-widget.h index c55bb6e636..96e3b9e465 100644 --- a/addressbook/gui/widgets/e-minicard-view-widget.h +++ b/addressbook/gui/widgets/e-minicard-view-widget.h @@ -21,7 +21,6 @@ #define __E_MINICARD_VIEW_WIDGET_H__ #include <gal/widgets/e-canvas.h> -#include <gal/unicode/gunicode.h> #include "addressbook/backend/ebook/e-book.h" #include "e-minicard-view.h" diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c index 6b596bb754..28f7cfe497 100644 --- a/addressbook/gui/widgets/e-minicard-view.c +++ b/addressbook/gui/widgets/e-minicard-view.c @@ -25,6 +25,7 @@ #include "e-addressbook-util.h" +#include "e-addressbook-marshal.h" #include <gtk/gtkselection.h> #include <gtk/gtkdnd.h> #include <gal/widgets/e-canvas.h> @@ -92,7 +93,7 @@ e_minicard_view_drag_data_get(GtkWidget *widget, } } - g_list_foreach (view->drag_list, (GFunc)gtk_object_unref, NULL); + g_list_foreach (view->drag_list, (GFunc)g_object_unref, NULL); g_list_free (view->drag_list); view->drag_list = NULL; } @@ -114,10 +115,10 @@ e_minicard_view_drag_begin (EAddressbookReflowAdapter *adapter, GdkEvent *event, target_list, actions, 1/*XXX*/, event); if (!view->canvas_drag_data_get_id) - view->canvas_drag_data_get_id = gtk_signal_connect (GTK_OBJECT (GNOME_CANVAS_ITEM (view)->canvas), - "drag_data_get", - GTK_SIGNAL_FUNC (e_minicard_view_drag_data_get), - view); + view->canvas_drag_data_get_id = g_signal_connect (GNOME_CANVAS_ITEM (view)->canvas, + "drag_data_get", + G_CALLBACK (e_minicard_view_drag_data_get), + view); gtk_drag_set_icon_default (context); @@ -142,9 +143,9 @@ set_empty_message (EMinicardView *view) else empty_message = e_utf8_from_locale_string(_("\n\nThere are no items to show in this view.")); - gtk_object_set (GTK_OBJECT(view), - "empty_message", empty_message, - NULL); + g_object_set (view, + "empty_message", empty_message, + NULL); g_free (empty_message); } @@ -160,8 +161,8 @@ adapter_changed (EMinicardView *view) { set_empty_message (view); - gtk_signal_connect (GTK_OBJECT (view->adapter), "drag_begin", - GTK_SIGNAL_FUNC (e_minicard_view_drag_begin), view); + g_signal_connect (view->adapter, "drag_begin", + G_CALLBACK (e_minicard_view_drag_begin), view); } static void @@ -182,19 +183,19 @@ e_minicard_view_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) "model", &model, NULL); if (model) { - gtk_signal_disconnect (GTK_OBJECT (model), view->writable_status_id); + g_signal_handler_disconnect (model, view->writable_status_id); } } - gtk_object_unref (GTK_OBJECT(view->adapter)); + g_object_unref (view->adapter); } view->writable_status_id = 0; view->adapter = GTK_VALUE_POINTER (*arg); - gtk_object_ref (GTK_OBJECT (view->adapter)); + g_object_ref (view->adapter); adapter_changed (view); - gtk_object_set (GTK_OBJECT (view), - "model", view->adapter, - NULL); + g_object_set (view, + "model", view->adapter, + NULL); if (view->adapter) { EAddressbookModel *model; gtk_object_get (GTK_OBJECT (view->adapter), @@ -202,27 +203,27 @@ e_minicard_view_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) NULL); if (model) { view->writable_status_id = - gtk_signal_connect (GTK_OBJECT (model), "writable_status", - GTK_SIGNAL_FUNC (writable_status_change), view); + g_signal_connect (model, "writable_status", + G_CALLBACK (writable_status_change), view); } } break; case ARG_BOOK: - gtk_object_set (GTK_OBJECT (view->adapter), - "book", GTK_VALUE_OBJECT (*arg), - NULL); + g_object_set (view->adapter, + "book", GTK_VALUE_OBJECT (*arg), + NULL); set_empty_message (view); break; case ARG_QUERY: - gtk_object_set (GTK_OBJECT (view->adapter), - "query", GTK_VALUE_STRING (*arg), - NULL); + g_object_set (view->adapter, + "query", GTK_VALUE_STRING (*arg), + NULL); break; case ARG_EDITABLE: - gtk_object_set (GTK_OBJECT (view->adapter), - "editable", GTK_VALUE_BOOL (*arg), - NULL); + g_object_set (view->adapter, + "editable", GTK_VALUE_BOOL (*arg), + NULL); set_empty_message (view); break; } @@ -266,8 +267,8 @@ e_minicard_view_destroy (GtkObject *object) EMinicardView *view = E_MINICARD_VIEW(object); if (view->canvas_drag_data_get_id) { - gtk_signal_disconnect (GTK_OBJECT (GNOME_CANVAS_ITEM (view)->canvas), - view->canvas_drag_data_get_id); + g_signal_handler_disconnect (GNOME_CANVAS_ITEM (view)->canvas, + view->canvas_drag_data_get_id); } if (view->adapter) { @@ -277,11 +278,11 @@ e_minicard_view_destroy (GtkObject *object) "model", &model, NULL); if (model) { - gtk_signal_disconnect (GTK_OBJECT (model), view->writable_status_id); + g_signal_handler_disconnect (model, view->writable_status_id); } } - gtk_object_unref (GTK_OBJECT(view->adapter)); + g_object_unref (view->adapter); } view->writable_status_id = 0; view->adapter = NULL; @@ -293,8 +294,8 @@ static guint e_minicard_view_right_click (EMinicardView *view, GdkEvent *event) { guint ret_val = 0; - gtk_signal_emit (GTK_OBJECT (view), signals[RIGHT_CLICK], - event, &ret_val); + g_signal_emit (view, signals[RIGHT_CLICK], 0, + event, &ret_val); return ret_val; } @@ -396,7 +397,7 @@ do_remove (int i, gpointer user_data) e_book_remove_card(book, card, cb, closure); - gtk_object_unref (GTK_OBJECT (card)); + g_object_unref (card); } #if 0 @@ -438,6 +439,10 @@ e_minicard_view_class_init (EMinicardViewClass *klass) parent_class = gtk_type_class (PARENT_TYPE); + object_class->set_arg = e_minicard_view_set_arg; + object_class->get_arg = e_minicard_view_get_arg; + object_class->destroy = e_minicard_view_destroy; + gtk_object_add_arg_type ("EMinicardView::adapter", GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_ADAPTER); gtk_object_add_arg_type ("EMinicardView::book", GTK_TYPE_OBJECT, @@ -448,18 +453,13 @@ e_minicard_view_class_init (EMinicardViewClass *klass) GTK_ARG_READWRITE, ARG_EDITABLE); signals [RIGHT_CLICK] = - gtk_signal_new ("right_click", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (EMinicardViewClass, right_click), - gtk_marshal_INT__POINTER, - GTK_TYPE_INT, 1, GTK_TYPE_GDK_EVENT); - - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); - - object_class->set_arg = e_minicard_view_set_arg; - object_class->get_arg = e_minicard_view_get_arg; - object_class->destroy = e_minicard_view_destroy; + g_signal_new ("right_click", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EMinicardViewClass, right_click), + NULL, NULL, + e_addressbook_marshal_INT__POINTER, + G_TYPE_INT, 1, G_TYPE_POINTER); item_class->event = e_minicard_view_event; diff --git a/addressbook/gui/widgets/e-minicard-view.h b/addressbook/gui/widgets/e-minicard-view.h index 1f23c62754..361cb3c628 100644 --- a/addressbook/gui/widgets/e-minicard-view.h +++ b/addressbook/gui/widgets/e-minicard-view.h @@ -24,7 +24,6 @@ #include <gal/widgets/e-reflow.h> #include <gal/widgets/e-selection-model-simple.h> -#include <gal/unicode/gunicode.h> #include "addressbook/backend/ebook/e-book.h" #include "e-addressbook-reflow-adapter.h" diff --git a/addressbook/gui/widgets/e-minicard-widget-test.c b/addressbook/gui/widgets/e-minicard-widget-test.c index 04ef2f0823..b768ff9e74 100644 --- a/addressbook/gui/widgets/e-minicard-widget-test.c +++ b/addressbook/gui/widgets/e-minicard-widget-test.c @@ -99,16 +99,16 @@ int main( int argc, char *argv[] ) minicard = e_minicard_widget_new(); card = e_card_new(TEST_VCARD); - gtk_object_set(GTK_OBJECT(minicard), - "card", card, - NULL); + g_object_set(minicard, + "card", card, + NULL); gnome_app_set_contents( GNOME_APP( app ), minicard ); /* Connect the signals */ - gtk_signal_connect( GTK_OBJECT( app ), "destroy", - GTK_SIGNAL_FUNC( destroy_callback ), - ( gpointer ) app ); + g_signal_connect( app, "destroy", + G_CALLBACK( destroy_callback ), + ( gpointer ) app ); gtk_widget_show_all( app ); diff --git a/addressbook/gui/widgets/e-minicard-widget.c b/addressbook/gui/widgets/e-minicard-widget.c index 566a43b087..4c9d7b0f30 100644 --- a/addressbook/gui/widgets/e-minicard-widget.c +++ b/addressbook/gui/widgets/e-minicard-widget.c @@ -20,7 +20,7 @@ */ #include <config.h> -#include <libgnomeui/gnome-canvas-rect-ellipse.h> +#include <libgnomecanvas/gnome-canvas-rect-ellipse.h> #include "e-minicard-widget.h" #include "e-minicard.h" @@ -178,7 +178,7 @@ e_minicard_widget_destroy (GtkObject *object) EMinicardWidget *emw = E_MINICARD_WIDGET(object); if (emw->card) - gtk_object_unref(GTK_OBJECT(emw->card)); + g_object_unref (emw->card); if (GTK_OBJECT_CLASS(parent_class)->destroy) GTK_OBJECT_CLASS(parent_class)->destroy(object); @@ -234,16 +234,16 @@ e_minicard_widget_set_card (EMinicardWidget *emw, ECard *card) if (card != emw->card) { if (emw->card) - gtk_object_unref (GTK_OBJECT (emw->card)); + g_object_unref (emw->card); emw->card = card; if (emw->card) - gtk_object_ref (GTK_OBJECT (emw->card)); + g_object_ref (emw->card); if (emw->item) - gtk_object_set (GTK_OBJECT (emw->item), - "card", emw->card, - NULL); + g_object_set (emw->item, + "card", emw->card, + NULL); } } diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index 99e1d524fa..f932661eb6 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -23,16 +23,14 @@ #include <glib.h> #include <gtk/gtkdnd.h> #include <gdk/gdkkeysyms.h> -#include <libgnome/gnome-defs.h> #include <libgnome/gnome-i18n.h> -#include <libgnomeui/gnome-canvas-rect-ellipse.h> -#include <gdk-pixbuf/gnome-canvas-pixbuf.h> +#include <libgnomecanvas/gnome-canvas-rect-ellipse.h> #include <gal/e-text/e-text.h> #include <gal/util/e-util.h> #include <gal/widgets/e-canvas-utils.h> #include <gal/widgets/e-canvas.h> -#include <gal/unicode/gunicode.h> #include "addressbook/backend/ebook/e-book.h" +#include "e-addressbook-marshal.h" #include "e-addressbook-util.h" #include "e-minicard.h" #include "e-minicard-label.h" @@ -42,10 +40,10 @@ static void e_minicard_init (EMinicard *card); static void e_minicard_class_init (EMinicardClass *klass); -static void e_minicard_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); -static void e_minicard_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); +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_destroy (GtkObject *object); -static void e_minicard_finalize (GtkObject *object); +static void e_minicard_finalize (GObject *object); static gboolean e_minicard_event (GnomeCanvasItem *item, GdkEvent *event); static void e_minicard_realize (GnomeCanvasItem *item); static void e_minicard_unrealize (GnomeCanvasItem *item); @@ -80,14 +78,14 @@ e_minicard_field_destroy(EMinicardField *field) /* The arguments we take */ enum { - ARG_0, - ARG_WIDTH, - ARG_HEIGHT, - ARG_HAS_FOCUS, - ARG_SELECTED, - ARG_HAS_CURSOR, - ARG_EDITABLE, - ARG_CARD + PROP_0, + PROP_WIDTH, + PROP_HEIGHT, + PROP_HAS_FOCUS, + PROP_SELECTED, + PROP_HAS_CURSOR, + PROP_EDITABLE, + PROP_CARD }; enum { @@ -126,52 +124,86 @@ e_minicard_get_type (void) static void e_minicard_class_init (EMinicardClass *klass) { - GtkObjectClass *object_class; - GnomeCanvasItemClass *item_class; + GObjectClass *object_class = (GObjectClass*) klass; + GtkObjectClass *gtkobject_class = (GtkObjectClass*) klass; + GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) klass; - object_class = (GtkObjectClass*) klass; - item_class = (GnomeCanvasItemClass *) klass; + object_class->set_property = e_minicard_set_property; + object_class->get_property = e_minicard_get_property; + gtkobject_class->destroy = e_minicard_destroy; + object_class->finalize = e_minicard_finalize; parent_class = gtk_type_class (gnome_canvas_group_get_type ()); - - gtk_object_add_arg_type ("EMinicard::width", GTK_TYPE_DOUBLE, - GTK_ARG_READWRITE, ARG_WIDTH); - gtk_object_add_arg_type ("EMinicard::height", GTK_TYPE_DOUBLE, - GTK_ARG_READABLE, ARG_HEIGHT); - gtk_object_add_arg_type ("EMinicard::has_focus", GTK_TYPE_ENUM, - GTK_ARG_READWRITE, ARG_HAS_FOCUS); - gtk_object_add_arg_type ("EMinicard::selected", GTK_TYPE_BOOL, - GTK_ARG_READWRITE, ARG_SELECTED); - gtk_object_add_arg_type ("EMinicard::has_cursor", GTK_TYPE_BOOL, - GTK_ARG_READWRITE, ARG_HAS_CURSOR); - gtk_object_add_arg_type ("EMinicard::editable", GTK_TYPE_BOOL, - GTK_ARG_READWRITE, ARG_EDITABLE); - gtk_object_add_arg_type ("EMinicard::card", GTK_TYPE_OBJECT, - GTK_ARG_READWRITE, ARG_CARD); + g_object_class_install_property (object_class, PROP_WIDTH, + g_param_spec_double ("width", + _("Width"), + /*_( */"XXX blurb" /*)*/, + 0.0, 0.0, 0.0, + G_PARAM_READWRITE | G_PARAM_LAX_VALIDATION)); + + g_object_class_install_property (object_class, PROP_HEIGHT, + g_param_spec_double ("height", + _("Height"), + /*_( */"XXX blurb" /*)*/, + 0.0, 0.0, 0.0, + G_PARAM_READWRITE | G_PARAM_LAX_VALIDATION)); + + g_object_class_install_property (object_class, PROP_HAS_FOCUS, + /* XXX should be _enum */ + g_param_spec_int ("has_focus", + _("Has Focus"), + /*_( */"XXX blurb" /*)*/, + E_MINICARD_FOCUS_TYPE_START, E_MINICARD_FOCUS_TYPE_END, + E_MINICARD_FOCUS_TYPE_START, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_SELECTED, + g_param_spec_boolean ("selected", + _("Selected"), + /*_( */"XXX blurb" /*)*/, + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_HAS_CURSOR, + g_param_spec_boolean ("has_cursor", + _("Has Cursor"), + /*_( */"XXX blurb" /*)*/, + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_EDITABLE, + g_param_spec_boolean ("editable", + _("Editable"), + /*_( */"XXX blurb" /*)*/, + FALSE, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, PROP_CARD, + g_param_spec_object ("card", + _("Card"), + /*_( */"XXX blurb" /*)*/, + E_TYPE_CARD, + G_PARAM_READWRITE)); + e_minicard_signals [SELECTED] = - gtk_signal_new ("selected", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (EMinicardClass, selected), - gtk_marshal_INT__POINTER, - GTK_TYPE_INT, 1, GTK_TYPE_POINTER); + g_signal_new ("selected", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EMinicardClass, selected), + NULL, NULL, + e_addressbook_marshal_INT__POINTER, + G_TYPE_INT, 1, G_TYPE_POINTER); e_minicard_signals [DRAG_BEGIN] = - gtk_signal_new ("drag_begin", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (EMinicardClass, drag_begin), - gtk_marshal_INT__POINTER, - GTK_TYPE_INT, 1, GTK_TYPE_POINTER); - - gtk_object_class_add_signals (object_class, e_minicard_signals, LAST_SIGNAL); - - object_class->set_arg = e_minicard_set_arg; - object_class->get_arg = e_minicard_get_arg; - object_class->destroy = e_minicard_destroy; - object_class->finalize = e_minicard_finalize; - + g_signal_new ("drag_begin", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EMinicardClass, drag_begin), + NULL, NULL, + e_addressbook_marshal_INT__POINTER, + G_TYPE_INT, 1, G_TYPE_POINTER); + /* GnomeCanvasItem method overrides */ item_class->realize = e_minicard_realize; item_class->unrealize = e_minicard_unrealize; @@ -196,7 +228,7 @@ e_minicard_init (EMinicard *minicard) minicard->card = NULL; minicard->simple = e_card_simple_new(NULL); - minicard->list_icon_pixbuf = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" LIST_ICON_FILENAME); + minicard->list_icon_pixbuf = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" LIST_ICON_FILENAME, NULL); minicard->list_icon_size = gdk_pixbuf_get_height (minicard->list_icon_pixbuf); minicard->editor = NULL; @@ -244,34 +276,34 @@ set_has_cursor (EMinicard *minicard, gboolean has_cursor) static void -e_minicard_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) +e_minicard_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GnomeCanvasItem *item; EMinicard *e_minicard; GList *l; - item = GNOME_CANVAS_ITEM (o); - e_minicard = E_MINICARD (o); + item = GNOME_CANVAS_ITEM (object); + e_minicard = E_MINICARD (object); - switch (arg_id){ - case ARG_WIDTH: - if (e_minicard->width != GTK_VALUE_DOUBLE (*arg)) { - e_minicard->width = GTK_VALUE_DOUBLE (*arg); + switch (prop_id){ + case PROP_WIDTH: + if (e_minicard->width != g_value_get_double (value)) { + e_minicard->width = g_value_get_double (value); e_minicard_resize_children(e_minicard); if ( GTK_OBJECT_FLAGS( e_minicard ) & GNOME_CANVAS_ITEM_REALIZED ) e_canvas_item_request_reflow(item); } break; - case ARG_HAS_FOCUS: + case PROP_HAS_FOCUS: if (e_minicard->fields) { - if ( GTK_VALUE_ENUM(*arg) == E_FOCUS_START || - GTK_VALUE_ENUM(*arg) == E_FOCUS_CURRENT) { + if ( g_value_get_int(value) == E_FOCUS_START || + g_value_get_int(value) == E_FOCUS_CURRENT) { gnome_canvas_item_set(E_MINICARD_FIELD(e_minicard->fields->data)->label, - "has_focus", GTK_VALUE_ENUM(*arg), + "has_focus", g_value_get_int (value), NULL); - } else if ( GTK_VALUE_ENUM(*arg) == E_FOCUS_END ) { + } else if ( g_value_get_int (value) == E_FOCUS_END ) { gnome_canvas_item_set(E_MINICARD_FIELD(g_list_last(e_minicard->fields)->data)->label, - "has_focus", GTK_VALUE_ENUM(*arg), + "has_focus", g_value_get_int (value), NULL); } } @@ -280,71 +312,74 @@ e_minicard_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) e_canvas_item_grab_focus(item, FALSE); } break; - case ARG_SELECTED: - if (e_minicard->selected != GTK_VALUE_BOOL(*arg)) - set_selected (e_minicard, GTK_VALUE_BOOL(*arg)); + case PROP_SELECTED: + if (e_minicard->selected != g_value_get_boolean (value)) + set_selected (e_minicard, g_value_get_boolean (value)); break; - case ARG_EDITABLE: - e_minicard->editable = GTK_VALUE_BOOL(*arg); + case PROP_EDITABLE: + e_minicard->editable = g_value_get_boolean (value); for (l = e_minicard->fields; l; l = l->next) - gtk_object_set (GTK_OBJECT (E_MINICARD_FIELD (l->data)->label), - "editable", e_minicard->editable, - NULL); + g_object_set (E_MINICARD_FIELD (l->data)->label, + "editable", e_minicard->editable, + NULL); break; - case ARG_HAS_CURSOR: - d(g_print("%s: ARG_HAS_CURSOR\n", __FUNCTION__)); - if (e_minicard->has_cursor != GTK_VALUE_BOOL(*arg)) - set_has_cursor (e_minicard, GTK_VALUE_BOOL(*arg)); + case PROP_HAS_CURSOR: + d(g_print("%s: PROP_HAS_CURSOR\n", __FUNCTION__)); + if (e_minicard->has_cursor != g_value_get_boolean (value)) + set_has_cursor (e_minicard, g_value_get_boolean (value)); break; - case ARG_CARD: + case PROP_CARD: if (e_minicard->card) - gtk_object_unref (GTK_OBJECT(e_minicard->card)); - e_minicard->card = E_CARD(GTK_VALUE_OBJECT (*arg)); + g_object_unref (e_minicard->card); + e_minicard->card = E_CARD(g_value_get_object (value)); if (e_minicard->card) - gtk_object_ref (GTK_OBJECT(e_minicard->card)); - gtk_object_set(GTK_OBJECT(e_minicard->simple), - "card", e_minicard->card, - NULL); + g_object_ref (e_minicard->card); + g_object_set(e_minicard->simple, + "card", e_minicard->card, + NULL); remodel(e_minicard); e_canvas_item_request_reflow(item); e_minicard->changed = FALSE; break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; } } static void -e_minicard_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) +e_minicard_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { EMinicard *e_minicard; e_minicard = E_MINICARD (object); - switch (arg_id) { - case ARG_WIDTH: - GTK_VALUE_DOUBLE (*arg) = e_minicard->width; - break; - case ARG_HEIGHT: - GTK_VALUE_DOUBLE (*arg) = e_minicard->height; - break; - case ARG_HAS_FOCUS: - GTK_VALUE_ENUM (*arg) = e_minicard->has_focus ? E_FOCUS_CURRENT : E_FOCUS_NONE; + switch (prop_id) { + case PROP_WIDTH: + g_value_set_double (value, e_minicard->width); + break; + case PROP_HEIGHT: + g_value_set_double (value, e_minicard->height); + break; + case PROP_HAS_FOCUS: + g_value_set_int (value, e_minicard->has_focus ? E_FOCUS_CURRENT : E_FOCUS_NONE); break; - case ARG_SELECTED: - GTK_VALUE_BOOL (*arg) = e_minicard->selected; + case PROP_SELECTED: + g_value_set_boolean (value, e_minicard->selected); break; - case ARG_HAS_CURSOR: - GTK_VALUE_BOOL (*arg) = e_minicard->has_cursor; + case PROP_HAS_CURSOR: + g_value_set_boolean (value, e_minicard->has_cursor); break; - case ARG_EDITABLE: - GTK_VALUE_BOOL (*arg) = e_minicard->editable; + case PROP_EDITABLE: + g_value_set_boolean (value, e_minicard->editable); break; - case ARG_CARD: + case PROP_CARD: e_card_simple_sync_card(e_minicard->simple); - GTK_VALUE_OBJECT (*arg) = GTK_OBJECT(e_minicard->card); + g_value_set_object (value, e_minicard->card); break; default: - arg->type = GTK_TYPE_INVALID; - break; + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; } } @@ -370,7 +405,7 @@ e_minicard_destroy (GtkObject *object) static void -e_minicard_finalize (GtkObject *object) +e_minicard_finalize (GObject *object) { EMinicard *e_minicard; @@ -380,12 +415,12 @@ e_minicard_finalize (GtkObject *object) e_minicard = E_MINICARD (object); if (e_minicard->card) - gtk_object_unref (GTK_OBJECT(e_minicard->card)); + g_object_unref (e_minicard->card); if (e_minicard->simple) - gtk_object_unref (GTK_OBJECT(e_minicard->simple)); + g_object_unref (e_minicard->simple); - if (GTK_OBJECT_CLASS (parent_class)->finalize) - (* GTK_OBJECT_CLASS (parent_class)->finalize) (object); + if (G_OBJECT_CLASS (parent_class)->finalize) + (* G_OBJECT_CLASS (parent_class)->finalize) (object); } static void @@ -480,7 +515,7 @@ static void editor_closed_cb (GtkObject *editor, gpointer data) { EMinicard *minicard = data; - gtk_object_unref (GTK_OBJECT (editor)); + g_object_unref (editor); minicard->editor = NULL; } @@ -617,10 +652,10 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) FALSE, e_minicard->editable); e_minicard->editor = GTK_OBJECT (editor); } - gtk_object_ref (e_minicard->editor); + g_object_ref (e_minicard->editor); - gtk_signal_connect (e_minicard->editor, "editor_closed", - GTK_SIGNAL_FUNC (editor_closed_cb), e_minicard); + g_signal_connect (e_minicard->editor, "editor_closed", + G_CALLBACK (editor_closed_cb), e_minicard); } } @@ -739,7 +774,7 @@ add_field (EMinicard *e_minicard, ECardSimpleField field, gdouble left_width) gchar *new_string = g_strdup (e_destination_get_address (dest)); g_free (string); string = new_string; - gtk_object_unref (GTK_OBJECT (dest)); + g_object_unref (dest); } } @@ -751,16 +786,16 @@ add_field (EMinicard *e_minicard, ECardSimpleField field, gdouble left_width) "max_field_name_length", left_width, "editable", e_minicard->editable, NULL ); - gtk_signal_connect(GTK_OBJECT(E_MINICARD_LABEL(new_item)->field), - "changed", GTK_SIGNAL_FUNC(field_changed), e_minicard); - gtk_signal_connect(GTK_OBJECT(E_MINICARD_LABEL(new_item)->field), - "activate", GTK_SIGNAL_FUNC(field_activated), e_minicard); - gtk_object_set(GTK_OBJECT(E_MINICARD_LABEL(new_item)->field), - "allow_newlines", e_card_simple_get_allow_newlines (e_minicard->simple, field), - NULL); - gtk_object_set_data(GTK_OBJECT(E_MINICARD_LABEL(new_item)->field), - "EMinicard:field", - GINT_TO_POINTER(field)); + g_signal_connect(E_MINICARD_LABEL(new_item)->field, + "changed", GTK_SIGNAL_FUNC(field_changed), e_minicard); + g_signal_connect(E_MINICARD_LABEL(new_item)->field, + "activate", GTK_SIGNAL_FUNC(field_activated), e_minicard); + g_object_set(E_MINICARD_LABEL(new_item)->field, + "allow_newlines", e_card_simple_get_allow_newlines (e_minicard->simple, field), + NULL); + g_object_set_data(G_OBJECT (E_MINICARD_LABEL(new_item)->field), + "EMinicard:field", + GINT_TO_POINTER(field)); minicard_field = g_new(EMinicardField, 1); minicard_field->field = field; @@ -780,7 +815,7 @@ get_left_width(EMinicard *e_minicard) gdouble width = -1; GdkFont *font; - font = ((GtkWidget *) ((GnomeCanvasItem *) e_minicard)->canvas)->style->font; + font = gtk_style_get_font (gtk_widget_get_style ((GtkWidget *) ((GnomeCanvasItem *) e_minicard)->canvas)); for(field = E_CARD_SIMPLE_FIELD_FULL_NAME; field != E_CARD_SIMPLE_FIELD_LAST; field++) { gdouble this_width; @@ -841,14 +876,14 @@ remodel( EMinicard *e_minicard ) gchar *new_string = g_strdup (e_destination_get_address (dest)); g_free (string); string = new_string; - gtk_object_unref (GTK_OBJECT (dest)); + g_object_unref (dest); } } e_minicard->fields = g_list_append(e_minicard->fields, minicard_field); - gtk_object_set(GTK_OBJECT(minicard_field->label), - "field", string, - NULL); + g_object_set(minicard_field->label, + "field", string, + NULL); count ++; } else { e_minicard_field_destroy(minicard_field); @@ -972,15 +1007,15 @@ e_minicard_selected (EMinicard *minicard, GdkEvent *event) gint ret_val = 0; GnomeCanvasItem *item = GNOME_CANVAS_ITEM (minicard); if (item->parent) { - guint signal_id = gtk_signal_lookup ("selection_event", GTK_OBJECT_TYPE (item->parent)); + guint signal_id = g_signal_lookup ("selection_event", G_OBJECT_TYPE (item->parent)); /* We should probably check the signature here, but I * don't think it's worth the time required to code * it. */ if (signal_id != 0) { - gtk_signal_emit(GTK_OBJECT(item->parent), - signal_id, - item, event, &ret_val); + g_signal_emit(item->parent, + signal_id, 0, + item, event, &ret_val); } } return ret_val; @@ -991,9 +1026,9 @@ e_minicard_drag_begin (EMinicard *minicard, GdkEvent *event) { gint ret_val = 0; GnomeCanvasItem *parent; - gtk_signal_emit (GTK_OBJECT(minicard), - e_minicard_signals[DRAG_BEGIN], - event, &ret_val); + g_signal_emit (minicard, + e_minicard_signals[DRAG_BEGIN], 0, + event, &ret_val); parent = GNOME_CANVAS_ITEM (minicard)->parent; if (parent && E_IS_REFLOW (parent)) { diff --git a/addressbook/gui/widgets/e-minicard.h b/addressbook/gui/widgets/e-minicard.h index bb6a3c072e..674d709e4b 100644 --- a/addressbook/gui/widgets/e-minicard.h +++ b/addressbook/gui/widgets/e-minicard.h @@ -20,7 +20,6 @@ #ifndef __E_MINICARD_H__ #define __E_MINICARD_H__ -#include <libgnomeui/gnome-canvas.h> #include <gdk-pixbuf/gdk-pixbuf.h> #include "addressbook/gui/contact-editor/e-contact-editor.h" #include "addressbook/backend/ebook/e-card.h" diff --git a/addressbook/gui/widgets/gal-view-factory-minicard.c b/addressbook/gui/widgets/gal-view-factory-minicard.c index 10e13d9bdf..7e6767ce20 100644 --- a/addressbook/gui/widgets/gal-view-factory-minicard.c +++ b/addressbook/gui/widgets/gal-view-factory-minicard.c @@ -9,7 +9,6 @@ */ #include <config.h> #include <glib.h> -#include <libgnome/gnome-defs.h> #include <libgnome/gnome-i18n.h> #include "gal-view-factory-minicard.h" #include "gal-view-minicard.h" diff --git a/addressbook/gui/widgets/gal-view-minicard.c b/addressbook/gui/widgets/gal-view-minicard.c index b3162e51d1..e685defdbe 100644 --- a/addressbook/gui/widgets/gal-view-minicard.c +++ b/addressbook/gui/widgets/gal-view-minicard.c @@ -195,15 +195,15 @@ gal_view_minicard_attach (GalViewMinicard *view, EMinicardViewWidget *emvw) view->emvw = emvw; - gtk_object_ref (GTK_OBJECT (view->emvw)); + g_object_ref (view->emvw); - gtk_object_set (GTK_OBJECT (view->emvw), - "column_width", (int) view->column_width, - NULL); + g_object_set (view->emvw, + "column_width", (int) view->column_width, + NULL); view->emvw_column_width_changed_id = - gtk_signal_connect(GTK_OBJECT(view->emvw), "column_width_changed", - GTK_SIGNAL_FUNC (column_width_changed), view); + g_signal_connect(view->emvw, "column_width_changed", + G_CALLBACK (column_width_changed), view); } void @@ -212,10 +212,10 @@ gal_view_minicard_detach (GalViewMinicard *view) if (view->emvw == NULL) return; if (view->emvw_column_width_changed_id) { - gtk_signal_disconnect (GTK_OBJECT (view->emvw), - view->emvw_column_width_changed_id); + g_signal_handler_disconnect (view->emvw, + view->emvw_column_width_changed_id); view->emvw_column_width_changed_id = 0; } - gtk_object_unref (GTK_OBJECT (view->emvw)); + g_object_unref (view->emvw); view->emvw = NULL; } diff --git a/addressbook/gui/widgets/test-minicard-label.c b/addressbook/gui/widgets/test-minicard-label.c index 7b1919aef4..cdbebe3160 100644 --- a/addressbook/gui/widgets/test-minicard-label.c +++ b/addressbook/gui/widgets/test-minicard-label.c @@ -110,17 +110,17 @@ int main( int argc, char *argv[] ) /* Connect the signals */ - gtk_signal_connect( GTK_OBJECT( app ), "destroy", - GTK_SIGNAL_FUNC( destroy_callback ), - ( gpointer ) app ); + g_signal_connect( app, "destroy", + G_CALLBACK( destroy_callback ), + ( gpointer ) app ); - gtk_signal_connect( GTK_OBJECT( canvas ), "size_allocate", - GTK_SIGNAL_FUNC( allocate_callback ), - ( gpointer ) app ); + g_signal_connect( canvas , "size_allocate", + G_CALLBACK ( allocate_callback ), + ( gpointer ) app ); - gtk_signal_connect( GTK_OBJECT( canvas ), "button_press_event", - GTK_SIGNAL_FUNC( button_press_callback ), - ( gpointer ) app ); + g_signal_connect( canvas , "button_press_event", + G_CALLBACK ( button_press_callback ), + ( gpointer ) app ); gtk_widget_show_all( app ); diff --git a/addressbook/gui/widgets/test-minicard-view.c b/addressbook/gui/widgets/test-minicard-view.c index caa9dac270..4626d5e205 100644 --- a/addressbook/gui/widgets/test-minicard-view.c +++ b/addressbook/gui/widgets/test-minicard-view.c @@ -171,9 +171,9 @@ int main( int argc, char *argv[] ) "height", (double) 100, "minimum_width", (double) 100, NULL ); - gtk_signal_connect( GTK_OBJECT( canvas ), "reflow", - GTK_SIGNAL_FUNC( resize ), - ( gpointer ) app); + g_signal_connect( canvas, "reflow", + G_CALLBACK ( resize ), + ( gpointer ) app); gnome_canvas_set_scroll_region ( GNOME_CANVAS( canvas ), 0, 0, @@ -188,13 +188,13 @@ int main( int argc, char *argv[] ) gnome_app_set_contents( GNOME_APP( app ), vbox ); /* Connect the signals */ - gtk_signal_connect( GTK_OBJECT( app ), "destroy", - GTK_SIGNAL_FUNC( destroy_callback ), - ( gpointer ) app ); + g_signal_connect( app, "destroy", + G_CALLBACK ( destroy_callback ), + ( gpointer ) app ); - gtk_signal_connect( GTK_OBJECT( canvas ), "size_allocate", - GTK_SIGNAL_FUNC( allocate_callback ), - ( gpointer ) app ); + g_signal_connect( canvas, "size_allocate", + G_CALLBACK ( allocate_callback ), + ( gpointer ) app ); gtk_widget_show_all( app ); gdk_window_set_back_pixmap( GTK_LAYOUT(canvas)->bin_window, NULL, FALSE); diff --git a/addressbook/gui/widgets/test-minicard.c b/addressbook/gui/widgets/test-minicard.c index b84a591bbb..77cc2975cb 100644 --- a/addressbook/gui/widgets/test-minicard.c +++ b/addressbook/gui/widgets/test-minicard.c @@ -105,13 +105,13 @@ int main( int argc, char *argv[] ) gnome_app_set_contents( GNOME_APP( app ), canvas ); /* Connect the signals */ - gtk_signal_connect( GTK_OBJECT( app ), "destroy", - GTK_SIGNAL_FUNC( destroy_callback ), - ( gpointer ) app ); - - gtk_signal_connect( GTK_OBJECT( canvas ), "size_allocate", - GTK_SIGNAL_FUNC( allocate_callback ), - ( gpointer ) app ); + g_signal_connect( app, "destroy", + G_CALLBACK( destroy_callback ), + ( gpointer ) app ); + + g_signal_connect( canvas, "size_allocate", + G_CALLBACK( allocate_callback ), + ( gpointer ) app ); gtk_widget_show_all( app ); diff --git a/addressbook/gui/widgets/test-reflow.c b/addressbook/gui/widgets/test-reflow.c index 14066c4cd0..79d00cdd82 100644 --- a/addressbook/gui/widgets/test-reflow.c +++ b/addressbook/gui/widgets/test-reflow.c @@ -155,9 +155,9 @@ int main( int argc, char *argv[] ) "height", (double) 100, "minimum_width", (double) 100, NULL ); - gtk_signal_connect( GTK_OBJECT( canvas ), "reflow", - GTK_SIGNAL_FUNC( resize ), - ( gpointer ) app); + g_signal_connect( canvas, "reflow", + G_CALLBACK ( resize ), + ( gpointer ) app); for ( i = 0; i < 200; i++ ) { GnomeCanvasItem *item; @@ -183,13 +183,13 @@ int main( int argc, char *argv[] ) gnome_app_set_contents( GNOME_APP( app ), scrollframe ); /* Connect the signals */ - gtk_signal_connect( GTK_OBJECT( app ), "destroy", - GTK_SIGNAL_FUNC( destroy_callback ), - ( gpointer ) app ); + g_signal_connect( app, "destroy", + G_CALLBACK ( destroy_callback ), + ( gpointer ) app ); - gtk_signal_connect( GTK_OBJECT( canvas ), "size_allocate", - GTK_SIGNAL_FUNC( allocate_callback ), - ( gpointer ) app ); + g_signal_connect( canvas, "size_allocate", + G_CALLBACK ( allocate_callback ), + ( gpointer ) app ); gtk_widget_show_all( app ); gdk_window_set_back_pixmap( GTK_LAYOUT(canvas)->bin_window, NULL, FALSE); |