diff options
author | Chris Toshok <toshok@ximian.com> | 2002-11-08 14:20:11 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2002-11-08 14:20:11 +0800 |
commit | 98a615797554ceab22a641f21c4b364b4af21e4f (patch) | |
tree | 12e56fcfd855b1dadbc83e5d9cf2a949d9721dd3 /addressbook/gui | |
parent | 237e7d2436b9e28f6609b089653068aefea435d7 (diff) | |
download | gsoc2013-evolution-98a615797554ceab22a641f21c4b364b4af21e4f.tar.gz gsoc2013-evolution-98a615797554ceab22a641f21c4b364b4af21e4f.tar.zst gsoc2013-evolution-98a615797554ceab22a641f21c4b364b4af21e4f.zip |
more porting work.
2002-11-07 Chris Toshok <toshok@ximian.com>
* gui/component/select-names/e-select-names-bonobo.[ch]: more
porting work.
* gui/component/select-names/e-select-names-completion.[ch]: more
porting work.
* gui/component/select-names/e-select-names-manager.[ch]: more
porting work.
* gui/component/select-names/e-select-names-model.[ch]: more
porting work.
* gui/component/select-names/e-select-names-popup.c: more
porting work.
* gui/component/select-names/e-select-names-table-model.[ch]: more
porting work.
* gui/component/select-names/e-select-names-text-model.[ch]: more
porting work.
* gui/component/select-names/e-select-names.[ch]: more
porting work.
svn path=/trunk/; revision=18657
Diffstat (limited to 'addressbook/gui')
15 files changed, 312 insertions, 319 deletions
diff --git a/addressbook/gui/component/select-names/e-select-names-bonobo.c b/addressbook/gui/component/select-names/e-select-names-bonobo.c index 200f1c77f4..3d17063622 100644 --- a/addressbook/gui/component/select-names/e-select-names-bonobo.c +++ b/addressbook/gui/component/select-names/e-select-names-bonobo.c @@ -79,7 +79,7 @@ entry_get_property_fn (BonoboPropertyBag *bag, case ENTRY_PROPERTY_ID_TEXT: { ETextModel *text_model; - text_model = E_TEXT_MODEL (gtk_object_get_data (GTK_OBJECT (w), "select_names_text_model")); + text_model = E_TEXT_MODEL (g_object_get_data (G_OBJECT (w), "select_names_text_model")); g_assert (text_model != NULL); BONOBO_ARG_SET_STRING (arg, e_text_model_get_text (text_model)); @@ -91,7 +91,7 @@ entry_get_property_fn (BonoboPropertyBag *bag, ESelectNamesModel *model; char *text; - model = E_SELECT_NAMES_MODEL (gtk_object_get_data (GTK_OBJECT (w), "select_names_model")); + model = E_SELECT_NAMES_MODEL (g_object_get_data (G_OBJECT (w), "select_names_model")); g_assert (model != NULL); text = e_select_names_model_get_address_text (model, ", "); @@ -105,7 +105,7 @@ entry_get_property_fn (BonoboPropertyBag *bag, ESelectNamesModel *model; char *text; - model = E_SELECT_NAMES_MODEL (gtk_object_get_data (GTK_OBJECT (w), "select_names_model")); + model = E_SELECT_NAMES_MODEL (g_object_get_data (G_OBJECT (w), "select_names_model")); g_assert (model != NULL); text = e_select_names_model_export_destinationv (model); @@ -121,7 +121,7 @@ entry_get_property_fn (BonoboPropertyBag *bag, int i; GNOME_Evolution_Addressbook_SimpleCardList *card_list; - model = E_SELECT_NAMES_MODEL (gtk_object_get_data (GTK_OBJECT (w), "select_names_model")); + model = E_SELECT_NAMES_MODEL (g_object_get_data (G_OBJECT (w), "select_names_model")); g_assert (model != NULL); count = e_select_names_model_count (model); @@ -149,7 +149,7 @@ entry_get_property_fn (BonoboPropertyBag *bag, case ENTRY_PROPERTY_ID_ALLOW_CONTACT_LISTS: { ESelectNamesCompletion *comp; - comp = E_SELECT_NAMES_COMPLETION (gtk_object_get_data (GTK_OBJECT (w), "completion_handler")); + comp = E_SELECT_NAMES_COMPLETION (g_object_get_data (G_OBJECT (w), "completion_handler")); g_assert (comp != NULL); BONOBO_ARG_SET_BOOLEAN (arg, e_select_names_completion_get_match_contact_lists (comp)); @@ -183,7 +183,7 @@ entry_set_property_fn (BonoboPropertyBag *bag, case ENTRY_PROPERTY_ID_ADDRESSES: { ESelectNamesModel *model; - model = E_SELECT_NAMES_MODEL (gtk_object_get_data (GTK_OBJECT (w), "select_names_model")); + model = E_SELECT_NAMES_MODEL (g_object_get_data (G_OBJECT (w), "select_names_model")); g_assert (model != NULL); e_entry_set_text (E_ENTRY (w), BONOBO_ARG_GET_STRING (arg)); @@ -194,7 +194,7 @@ entry_set_property_fn (BonoboPropertyBag *bag, case ENTRY_PROPERTY_ID_DESTINATIONS: { ESelectNamesModel *model; - model = E_SELECT_NAMES_MODEL (gtk_object_get_data (GTK_OBJECT (w), "select_names_model")); + model = E_SELECT_NAMES_MODEL (g_object_get_data (G_OBJECT (w), "select_names_model")); g_assert (model != NULL); e_select_names_model_import_destinationv (model, BONOBO_ARG_GET_STRING (arg)); @@ -205,7 +205,7 @@ entry_set_property_fn (BonoboPropertyBag *bag, case ENTRY_PROPERTY_ID_ALLOW_CONTACT_LISTS: { ESelectNamesCompletion *comp; - comp = E_SELECT_NAMES_COMPLETION (gtk_object_get_data (GTK_OBJECT (w), "completion_handler")); + comp = E_SELECT_NAMES_COMPLETION (g_object_get_data (G_OBJECT (w), "completion_handler")); g_assert (comp != NULL); e_select_names_completion_set_match_contact_lists (comp, BONOBO_ARG_GET_BOOLEAN (arg)); @@ -213,7 +213,7 @@ entry_set_property_fn (BonoboPropertyBag *bag, } case ENTRY_PROPERTY_ID_ENTRY_CHANGED: - gtk_object_set_data (GTK_OBJECT (w), "entry_property_id_changed", GUINT_TO_POINTER (1)); + g_object_set_data (G_OBJECT (w), "entry_property_id_changed", GUINT_TO_POINTER (1)); break; default: @@ -255,7 +255,7 @@ impl_SelectNames_add_section_with_limit (PortableServer_Servant servant, static void entry_changed (GtkWidget *widget, BonoboControl *control) { - gboolean changed = GPOINTER_TO_UINT (gtk_object_get_data (GTK_OBJECT (widget), "entry_property_id_changed")); + gboolean changed = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (widget), "entry_property_id_changed")); if (!changed) bonobo_control_set_property (control, NULL, "entry_changed", TRUE); @@ -370,7 +370,7 @@ impl_SelectNames_activate_dialog (PortableServer_Servant servant, /* GtkObject methods. */ static void -impl_destroy (GtkObject *object) +impl_dispose (GObject *object) { ESelectNamesBonobo *select_names; ESelectNamesBonoboPrivate *priv; @@ -392,13 +392,13 @@ impl_destroy (GtkObject *object) static void e_select_names_bonobo_class_init (ESelectNamesBonoboClass *klass) { - GtkObjectClass *object_class; + GObjectClass *object_class; POA_GNOME_Evolution_Addressbook_SelectNames__epv *epv; - object_class = GTK_OBJECT_CLASS (klass); - parent_class = gtk_type_class (bonobo_object_get_type ()); + object_class = G_OBJECT_CLASS (klass); + parent_class = g_type_class_peek_parent (klass); - object_class->destroy = impl_destroy; + object_class->dispose = impl_dispose; epv = &klass->epv; epv->addSection = impl_SelectNames_add_section; diff --git a/addressbook/gui/component/select-names/e-select-names-bonobo.h b/addressbook/gui/component/select-names/e-select-names-bonobo.h index 4d716380b1..5b04ed5b2e 100644 --- a/addressbook/gui/component/select-names/e-select-names-bonobo.h +++ b/addressbook/gui/component/select-names/e-select-names-bonobo.h @@ -33,10 +33,10 @@ extern "C" { #endif /* __cplusplus */ #define E_TYPE_SELECT_NAMES_BONOBO (e_select_names_bonobo_get_type ()) -#define E_SELECT_NAMES_BONOBO(obj) (GTK_CHECK_CAST ((obj), E_TYPE_SELECT_NAMES_BONOBO, ESelectNamesBonobo)) -#define E_SELECT_NAMES_BONOBO_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_BONOBO, ESelectNamesBonoboClass)) -#define E_IS_SELECT_NAMES_BONOBO(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_SELECT_NAMES_BONOBO)) -#define E_IS_SELECT_NAMES_BONOBO_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_BONOBO)) +#define E_SELECT_NAMES_BONOBO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SELECT_NAMES_BONOBO, ESelectNamesBonobo)) +#define E_SELECT_NAMES_BONOBO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_BONOBO, ESelectNamesBonoboClass)) +#define E_IS_SELECT_NAMES_BONOBO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SELECT_NAMES_BONOBO)) +#define E_IS_SELECT_NAMES_BONOBO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_BONOBO)) typedef struct _ESelectNamesBonobo ESelectNamesBonobo; diff --git a/addressbook/gui/component/select-names/e-select-names-completion.c b/addressbook/gui/component/select-names/e-select-names-completion.c index 13a458f788..fdc5b22c37 100644 --- a/addressbook/gui/component/select-names/e-select-names-completion.c +++ b/addressbook/gui/component/select-names/e-select-names-completion.c @@ -76,7 +76,7 @@ struct _ESelectNamesCompletionPrivate { static void e_select_names_completion_class_init (ESelectNamesCompletionClass *); static void e_select_names_completion_init (ESelectNamesCompletion *); -static void e_select_names_completion_destroy (GtkObject *object); +static void e_select_names_completion_dispose (GObject *object); static void e_select_names_completion_got_book_view_cb (EBook *book, EBookStatus status, EBookView *view, gpointer user_data); static void e_select_names_completion_card_added_cb (EBookView *, const GList *cards, gpointer user_data); @@ -87,7 +87,7 @@ static void e_select_names_completion_do_query (ESelectNamesCompletion *, const static void e_select_names_completion_handle_request (ECompletion *, const gchar *txt, gint pos, gint limit); static void e_select_names_completion_end (ECompletion *); -static GtkObjectClass *parent_class; +static GObjectClass *parent_class; static FILE *out; @@ -704,37 +704,39 @@ start_initials_query (ESelectNamesCompletion *comp) */ -GtkType +GType e_select_names_completion_get_type (void) { - static GtkType select_names_complete_type = 0; - - if (!select_names_complete_type) { - GtkTypeInfo select_names_complete_info = { - "ESelectNamesCompletion", - sizeof (ESelectNamesCompletion), + static GType type = 0; + + if (!type) { + static const GTypeInfo info = { sizeof (ESelectNamesCompletionClass), - (GtkClassInitFunc) e_select_names_completion_class_init, - (GtkObjectInitFunc) e_select_names_completion_init, - NULL, NULL, /* reserved */ - (GtkClassInitFunc) NULL + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) e_select_names_completion_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (ESelectNamesCompletion), + 0, /* n_preallocs */ + (GInstanceInitFunc) e_select_names_completion_init, }; - select_names_complete_type = gtk_type_unique (e_completion_get_type (), &select_names_complete_info); + type = g_type_register_static (e_completion_get_type (), "ESelectNamesCompletion", &info, 0); } - return select_names_complete_type; + return type; } static void e_select_names_completion_class_init (ESelectNamesCompletionClass *klass) { - GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); ECompletionClass *completion_class = E_COMPLETION_CLASS (klass); - parent_class = GTK_OBJECT_CLASS (gtk_type_class (e_completion_get_type ())); + parent_class = g_type_class_peek_parent (klass); - object_class->destroy = e_select_names_completion_destroy; + object_class->dispose = e_select_names_completion_dispose; completion_class->request_completion = e_select_names_completion_handle_request; completion_class->end_completion = e_select_names_completion_end; @@ -762,12 +764,12 @@ e_select_names_completion_clear_book_data (ESelectNamesCompletion *comp) ESelectNamesCompletionBookData *book_data = l->data; if (book_data->card_added_tag) { - gtk_signal_disconnect (GTK_OBJECT (book_data->book_view), book_data->card_added_tag); + g_signal_handler_disconnect (book_data->book_view, book_data->card_added_tag); book_data->card_added_tag = 0; } if (book_data->seq_complete_tag) { - gtk_signal_disconnect (GTK_OBJECT (book_data->book_view), book_data->seq_complete_tag); + g_signal_handler_disconnect (book_data->book_view, book_data->seq_complete_tag); book_data->seq_complete_tag = 0; } @@ -785,7 +787,7 @@ e_select_names_completion_clear_book_data (ESelectNamesCompletion *comp) } static void -e_select_names_completion_destroy (GtkObject *object) +e_select_names_completion_dispose (GObject *object) { ESelectNamesCompletion *comp = E_SELECT_NAMES_COMPLETION (object); @@ -803,8 +805,8 @@ e_select_names_completion_destroy (GtkObject *object) g_free (comp->priv); - if (parent_class->destroy) - parent_class->destroy (object); + if (parent_class->dispose) + parent_class->dispose (object); } @@ -860,11 +862,11 @@ e_select_names_completion_got_book_view_cb (EBook *book, EBookStatus status, EBo book_data->book_view_tag = 0; if (book_data->card_added_tag) { - gtk_signal_disconnect (GTK_OBJECT (book_data->book_view), book_data->card_added_tag); + g_signal_handler_disconnect (book_data->book_view, book_data->card_added_tag); book_data->card_added_tag = 0; } if (book_data->seq_complete_tag) { - gtk_signal_disconnect (GTK_OBJECT (book_data->book_view), book_data->seq_complete_tag); + g_signal_handler_disconnect (book_data->book_view, book_data->seq_complete_tag); book_data->seq_complete_tag = 0; } @@ -985,11 +987,11 @@ e_select_names_completion_stop_query (ESelectNamesCompletion *comp) fprintf (out, "disconnecting book view signals\n"); if (book_data->card_added_tag) { - gtk_signal_disconnect (GTK_OBJECT (book_data->book_view), book_data->card_added_tag); + g_signal_handler_disconnect (book_data->book_view, book_data->card_added_tag); book_data->card_added_tag = 0; } if (book_data->seq_complete_tag) { - gtk_signal_disconnect (GTK_OBJECT (book_data->book_view), book_data->seq_complete_tag); + g_signal_handler_disconnect (book_data->book_view, book_data->seq_complete_tag); book_data->seq_complete_tag = 0; } @@ -1274,7 +1276,7 @@ e_select_names_completion_new (ESelectNamesTextModel *text_model) g_return_val_if_fail (E_IS_SELECT_NAMES_TEXT_MODEL (text_model), NULL); - comp = (ESelectNamesCompletion *) gtk_type_new (e_select_names_completion_get_type ()); + comp = g_object_new (E_TYPE_SELECT_NAMES_COMPLETION, NULL); comp->priv->text_model = text_model; g_object_ref (text_model); diff --git a/addressbook/gui/component/select-names/e-select-names-completion.h b/addressbook/gui/component/select-names/e-select-names-completion.h index 957a7fd465..40417841d7 100644 --- a/addressbook/gui/component/select-names/e-select-names-completion.h +++ b/addressbook/gui/component/select-names/e-select-names-completion.h @@ -33,11 +33,11 @@ G_BEGIN_DECLS -#define E_SELECT_NAMES_COMPLETION_TYPE (e_select_names_completion_get_type ()) -#define E_SELECT_NAMES_COMPLETION(o) (GTK_CHECK_CAST ((o), E_SELECT_NAMES_COMPLETION_TYPE, ESelectNamesCompletion)) -#define E_SELECT_NAMES_COMPLETION_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), E_SELECT_NAMES_COMPLETION_TYPE, ESelectNamesCompletionClass)) -#define E_IS_SELECT_NAMES_COMPLETION(o) (GTK_CHECK_TYPE ((o), E_SELECT_NAMES_COMPLETION_TYPE)) -#define E_IS_SELECT_NAMES_COMPLETION_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_SELECT_NAMES_COMPLETION_TYPE)) +#define E_TYPE_SELECT_NAMES_COMPLETION (e_select_names_completion_get_type ()) +#define E_SELECT_NAMES_COMPLETION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_SELECT_NAMES_COMPLETION, ESelectNamesCompletion)) +#define E_SELECT_NAMES_COMPLETION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), E_TYPE_SELECT_NAMES_COMPLETION, ESelectNamesCompletionClass)) +#define E_IS_SELECT_NAMES_COMPLETION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_SELECT_NAMES_COMPLETION)) +#define E_IS_SELECT_NAMES_COMPLETION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_SELECT_NAMES_COMPLETION)) typedef struct _ESelectNamesCompletion ESelectNamesCompletion; typedef struct _ESelectNamesCompletionClass ESelectNamesCompletionClass; @@ -54,7 +54,7 @@ struct _ESelectNamesCompletionClass { }; -GtkType e_select_names_completion_get_type (void); +GType e_select_names_completion_get_type (void); ECompletion *e_select_names_completion_new (ESelectNamesTextModel *); void e_select_names_completion_add_book (ESelectNamesCompletion *, EBook *); diff --git a/addressbook/gui/component/select-names/e-select-names-manager.c b/addressbook/gui/component/select-names/e-select-names-manager.c index 1871ccf1ca..ff142ec45c 100644 --- a/addressbook/gui/component/select-names/e-select-names-manager.c +++ b/addressbook/gui/component/select-names/e-select-names-manager.c @@ -70,10 +70,10 @@ static void section_model_changed_cb (ESelectNamesModel *model, gpointer closure) { ESelectNamesManagerSection *section = closure; - gtk_signal_emit (GTK_OBJECT (section->manager), - e_select_names_manager_signals[CHANGED], - section->id, - FALSE); + g_signal_emit (section->manager, + e_select_names_manager_signals[CHANGED], 0, + section->id, + FALSE); } static ESelectNamesManagerSection * @@ -115,7 +115,7 @@ e_select_names_manager_section_free (ESelectNamesManagerSection *section) g_free (section->title); if (section->model) { - gtk_signal_disconnect (GTK_OBJECT (section->model), section->changed_tag); + g_signal_handler_disconnect (section->model, section->changed_tag); g_object_unref (section->model); } @@ -134,7 +134,7 @@ static ESelectNamesManagerEntry * get_entry_info (EEntry *entry) { g_return_val_if_fail (E_IS_ENTRY (entry), NULL); - return (ESelectNamesManagerEntry *) gtk_object_get_data (GTK_OBJECT (entry), "entry_info"); + return (ESelectNamesManagerEntry *) g_object_get_data (G_OBJECT (entry), "entry_info"); } static void @@ -142,9 +142,9 @@ popup_cb (EEntry *eentry, GdkEventButton *ev, gint pos, gpointer user_data) { ESelectNamesTextModel *text_model; - gtk_object_get (GTK_OBJECT (eentry), - "model", &text_model, - NULL); + g_object_get (eentry, + "model", &text_model, + NULL); g_assert (E_IS_SELECT_NAMES_TEXT_MODEL (text_model)); e_select_names_popup (text_model, ev, pos, GTK_WIDGET (eentry)); @@ -225,9 +225,9 @@ completion_handler (EEntry *entry, ECompletionMatch *match) bitch. */ g_object_ref (dest); - gtk_object_get (GTK_OBJECT (entry), - "model", &text_model, - NULL); + g_object_get (entry, + "model", &text_model, + NULL); g_assert (E_IS_SELECT_NAMES_TEXT_MODEL (text_model)); pos = e_entry_get_position (entry); @@ -253,12 +253,12 @@ e_select_names_manager_entry_new (ESelectNamesManager *manager, ESelectNamesMode entry->entry = E_ENTRY (e_entry_new ()); text_model = e_select_names_text_model_new (model); - gtk_object_set(GTK_OBJECT(entry->entry), - "model", text_model, /* The entry takes ownership of the text model */ - "editable", TRUE, - "use_ellipsis", TRUE, - "allow_newlines", FALSE, - NULL); + g_object_set(entry->entry, + "model", text_model, /* The entry takes ownership of the text model */ + "editable", TRUE, + "use_ellipsis", TRUE, + "allow_newlines", FALSE, + NULL); g_object_ref (entry->entry); @@ -296,10 +296,10 @@ e_select_names_manager_entry_new (ESelectNamesManager *manager, ESelectNamesMode G_CALLBACK (completion_popup_cb), entry); - gtk_object_set_data (GTK_OBJECT (entry->entry), "entry_info", entry); - gtk_object_set_data (GTK_OBJECT (entry->entry), "select_names_model", model); - gtk_object_set_data (GTK_OBJECT (entry->entry), "select_names_text_model", text_model); - gtk_object_set_data (GTK_OBJECT (entry->entry), "completion_handler", entry->comp); + g_object_set_data (G_OBJECT (entry->entry), "entry_info", entry); + g_object_set_data (G_OBJECT (entry->entry), "select_names_model", model); + g_object_set_data (G_OBJECT (entry->entry), "select_names_text_model", text_model); + g_object_set_data (G_OBJECT (entry->entry), "completion_handler", entry->comp); return entry; } @@ -459,7 +459,7 @@ uris_listener (EConfigListener *db, const char *key, ESelectNamesManager * e_select_names_manager_new (void) { - ESelectNamesManager *manager = E_SELECT_NAMES_MANAGER(gtk_type_new(e_select_names_manager_get_type())); + ESelectNamesManager *manager = g_object_new (E_TYPE_SELECT_NAMES_MANAGER, NULL); EConfigListener *db; db = e_book_get_config_database(); @@ -562,12 +562,12 @@ e_select_names_clicked(ESelectNames *dialog, gint button, ESelectNamesManager *m switch(button) { case 0: e_select_names_manager_discard_saved_models (manager); - gtk_signal_emit (GTK_OBJECT (manager), e_select_names_manager_signals[OK]); + g_signal_emit (manager, e_select_names_manager_signals[OK], 0); break; case 1: e_select_names_manager_revert_to_saved_models (manager); - gtk_signal_emit (GTK_OBJECT (manager), e_select_names_manager_signals[CANCEL]); + g_signal_emit (manager, e_select_names_manager_signals[CANCEL], 0); break; } } @@ -627,7 +627,7 @@ e_select_names_manager_init (ESelectNamesManager *manager) } static void -e_select_names_manager_destroy (GtkObject *object) +e_select_names_manager_dispose (GObject *object) { ESelectNamesManager *manager; @@ -658,11 +658,11 @@ e_select_names_manager_destroy (GtkObject *object) static void e_select_names_manager_class_init (ESelectNamesManagerClass *klass) { - GtkObjectClass *object_class; + GObjectClass *object_class; - object_class = GTK_OBJECT_CLASS(klass); + object_class = G_OBJECT_CLASS(klass); - object_class->destroy = e_select_names_manager_destroy; + object_class->dispose = e_select_names_manager_dispose; e_select_names_manager_signals[CHANGED] = g_signal_new ("changed", @@ -703,24 +703,25 @@ e_select_names_manager_class_init (ESelectNamesManagerClass *klass) * * Return value: The type ID of the &ESelectNamesManager class. **/ -GtkType +GType e_select_names_manager_get_type (void) { - static GtkType manager_type = 0; + static GType manager_type = 0; if (!manager_type) { - GtkTypeInfo manager_info = { - "ESelectNamesManager", - sizeof (ESelectNamesManager), + static const GTypeInfo manager_info = { sizeof (ESelectNamesManagerClass), - (GtkClassInitFunc) e_select_names_manager_class_init, - (GtkObjectInitFunc) e_select_names_manager_init, - NULL, /* reserved_1 */ - NULL, /* reserved_2 */ - (GtkClassInitFunc) NULL + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) e_select_names_manager_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (ESelectNamesManager), + 0, /* n_preallocs */ + (GInstanceInitFunc) e_select_names_manager_init, }; - manager_type = gtk_type_unique (gtk_object_get_type (), &manager_info); + manager_type = g_type_register_static (G_TYPE_OBJECT, "ESelectNamesManager", &manager_info, 0); } return manager_type; diff --git a/addressbook/gui/component/select-names/e-select-names-manager.h b/addressbook/gui/component/select-names/e-select-names-manager.h index dd1a418396..55242629a4 100644 --- a/addressbook/gui/component/select-names/e-select-names-manager.h +++ b/addressbook/gui/component/select-names/e-select-names-manager.h @@ -16,16 +16,16 @@ #include "e-select-names.h" #define E_TYPE_SELECT_NAMES_MANAGER (e_select_names_manager_get_type ()) -#define E_SELECT_NAMES_MANAGER(obj) (GTK_CHECK_CAST ((obj), E_TYPE_SELECT_NAMES_MANAGER, ESelectNamesManager)) -#define E_SELECT_NAMES_MANAGER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_MANAGER, ESelectNamesManagerClass)) -#define E_IS_SELECT_NAMES_MANAGER(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_SELECT_NAMES_MANAGER)) -#define E_IS_SELECT_NAMES_MANAGER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_MANAGER)) +#define E_SELECT_NAMES_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SELECT_NAMES_MANAGER, ESelectNamesManager)) +#define E_SELECT_NAMES_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_MANAGER, ESelectNamesManagerClass)) +#define E_IS_SELECT_NAMES_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SELECT_NAMES_MANAGER)) +#define E_IS_SELECT_NAMES_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_MANAGER)) typedef struct _ESelectNamesManager ESelectNamesManager; typedef struct _ESelectNamesManagerClass ESelectNamesManagerClass; struct _ESelectNamesManager { - GtkObject object; + GObject object; GList *sections; GList *entries; @@ -40,7 +40,7 @@ struct _ESelectNamesManager { }; struct _ESelectNamesManagerClass { - GtkObjectClass parent_class; + GObjectClass parent_class; void (*changed) (ESelectNamesManager *, const gchar *section_id, gint changed_working_copy); void (*ok) (ESelectNamesManager *); @@ -62,6 +62,6 @@ GtkWidget *e_select_names_manager_create_entry (ESelectNames void e_select_names_manager_activate_dialog (ESelectNamesManager *manager, const char *id); /* Standard Gtk function */ -GtkType e_select_names_manager_get_type (void); +GType e_select_names_manager_get_type (void); #endif /* ! __E_SELECT_NAMES_MANAGER_H__ */ diff --git a/addressbook/gui/component/select-names/e-select-names-model.c b/addressbook/gui/component/select-names/e-select-names-model.c index 253245d4d3..6c31e1baf7 100644 --- a/addressbook/gui/component/select-names/e-select-names-model.c +++ b/addressbook/gui/component/select-names/e-select-names-model.c @@ -65,37 +65,38 @@ struct _ESelectNamesModelPrivate { static void e_select_names_model_init (ESelectNamesModel *model); static void e_select_names_model_class_init (ESelectNamesModelClass *klass); -static void e_select_names_model_destroy (GtkObject *object); +static void e_select_names_model_dispose (GObject *object); -GtkType +GType e_select_names_model_get_type (void) { - static GtkType model_type = 0; + static GType type = 0; - if (!model_type) { - GtkTypeInfo model_info = { - "ESelectNamesModel", - sizeof (ESelectNamesModel), + if (!type) { + static const GTypeInfo info = { sizeof (ESelectNamesModelClass), - (GtkClassInitFunc) e_select_names_model_class_init, - (GtkObjectInitFunc) e_select_names_model_init, - NULL, /* reserved_1 */ - NULL, /* reserved_2 */ - (GtkClassInitFunc) NULL + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) e_select_names_model_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (ESelectNamesModel), + 0, /* n_preallocs */ + (GInstanceInitFunc) e_select_names_model_init, }; - model_type = gtk_type_unique (gtk_object_get_type (), &model_info); + type = g_type_register_static (G_TYPE_OBJECT, "ESelectNamesModel", &info, 0); } - return model_type; + return type; } static void e_select_names_model_class_init (ESelectNamesModelClass *klass) { - GtkObjectClass *object_class; + GObjectClass *object_class; - object_class = GTK_OBJECT_CLASS(klass); + object_class = G_OBJECT_CLASS(klass); e_select_names_model_signals[E_SELECT_NAMES_MODEL_CHANGED] = g_signal_new ("changed", @@ -120,7 +121,7 @@ e_select_names_model_class_init (ESelectNamesModelClass *klass) klass->changed = NULL; - object_class->destroy = e_select_names_model_destroy; + object_class->dispose = e_select_names_model_dispose; } /** @@ -135,7 +136,7 @@ e_select_names_model_init (ESelectNamesModel *model) } static void -e_select_names_model_destroy (GtkObject *object) +e_select_names_model_dispose (GObject *object) { ESelectNamesModel *model = E_SELECT_NAMES_MODEL (object); diff --git a/addressbook/gui/component/select-names/e-select-names-model.h b/addressbook/gui/component/select-names/e-select-names-model.h index 9179eb676d..40989ff370 100644 --- a/addressbook/gui/component/select-names/e-select-names-model.h +++ b/addressbook/gui/component/select-names/e-select-names-model.h @@ -19,10 +19,10 @@ #include <addressbook/backend/ebook/e-destination.h> #define E_TYPE_SELECT_NAMES_MODEL (e_select_names_model_get_type ()) -#define E_SELECT_NAMES_MODEL(obj) (GTK_CHECK_CAST ((obj), E_TYPE_SELECT_NAMES_MODEL, ESelectNamesModel)) -#define E_SELECT_NAMES_MODEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_MODEL, ESelectNamesModelClass)) -#define E_IS_SELECT_NAMES_MODEL(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_SELECT_NAMES_MODEL)) -#define E_IS_SELECT_NAMES_MODEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_MODEL)) +#define E_SELECT_NAMES_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SELECT_NAMES_MODEL, ESelectNamesModel)) +#define E_SELECT_NAMES_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_MODEL, ESelectNamesModelClass)) +#define E_IS_SELECT_NAMES_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SELECT_NAMES_MODEL)) +#define E_IS_SELECT_NAMES_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_MODEL)) typedef struct _ESelectNamesModel ESelectNamesModel; typedef struct _ESelectNamesModelClass ESelectNamesModelClass; @@ -41,7 +41,7 @@ struct _ESelectNamesModelClass { void (*resized) (ESelectNamesModel *model, gint index, gint old_len, gint new_len); }; -GtkType e_select_names_model_get_type (void); +GType e_select_names_model_get_type (void); ESelectNamesModel *e_select_names_model_new (void); ESelectNamesModel *e_select_names_model_duplicate (ESelectNamesModel *old); diff --git a/addressbook/gui/component/select-names/e-select-names-popup.c b/addressbook/gui/component/select-names/e-select-names-popup.c index 50b779a3e0..3c18638298 100644 --- a/addressbook/gui/component/select-names/e-select-names-popup.c +++ b/addressbook/gui/component/select-names/e-select-names-popup.c @@ -138,7 +138,7 @@ change_email_num_cb (GtkWidget *w, gpointer user_data) if (! GTK_CHECK_MENU_ITEM (w)->active) return; - n = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (w), "number")); + n = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (w), "number")); if (n != e_destination_get_email_num (info->dest)) { dest = e_destination_new (); @@ -340,7 +340,7 @@ popup_menu_card (PopupInfo *info) if (label && *label) { set_uiinfo_label (&(radioinfo[j]), label); - gtk_object_set_data (GTK_OBJECT (radioinfo[j].widget), "number", GINT_TO_POINTER (j)); + g_object_set_data (G_OBJECT (radioinfo[j].widget), "number", GINT_TO_POINTER (j)); if (j == n) gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (radioinfo[n].widget), TRUE); diff --git a/addressbook/gui/component/select-names/e-select-names-table-model.c b/addressbook/gui/component/select-names/e-select-names-table-model.c index 18a19bb171..476d009844 100644 --- a/addressbook/gui/component/select-names/e-select-names-table-model.c +++ b/addressbook/gui/component/select-names/e-select-names-table-model.c @@ -13,23 +13,23 @@ #include <gtk/gtksignal.h> #include <gal/util/e-util.h> +#include <libgnome/gnome-i18n.h> #include "e-select-names-table-model.h" #include "addressbook/backend/ebook/e-card-simple.h" /* Object argument IDs */ enum { - ARG_0, - ARG_SOURCE, + PROP_0, + PROP_SOURCE, }; static void e_select_names_table_model_init (ESelectNamesTableModel *model); static void e_select_names_table_model_class_init (ESelectNamesTableModelClass *klass); static void e_select_names_table_model_destroy (GtkObject *object); -static void e_select_names_table_model_set_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void e_select_names_table_model_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); - +static void e_select_names_table_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); +static void e_select_names_table_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void e_select_names_table_model_model_changed (ESelectNamesModel *source, ESelectNamesTableModel *model); @@ -50,7 +50,7 @@ static void e_select_names_table_model_drop_source (ESelectNamesTableModel *model) { if (model->source_changed_id) - gtk_signal_disconnect(GTK_OBJECT(model->source), model->source_changed_id); + g_signal_handler_disconnect(model->source, model->source_changed_id); if (model->source) g_object_unref(model->source); model->source = NULL; @@ -66,27 +66,28 @@ e_select_names_table_model_drop_source (ESelectNamesTableModel *model) * * Return value: The type ID of the &ESelectNamesTableModel class. **/ -GtkType +GType e_select_names_table_model_get_type (void) { - static GtkType model_type = 0; + static GType type = 0; - if (!model_type) { - GtkTypeInfo model_info = { - "ESelectNamesTableModel", - sizeof (ESelectNamesTableModel), + if (!type) { + static const GTypeInfo info = { sizeof (ESelectNamesTableModelClass), - (GtkClassInitFunc) e_select_names_table_model_class_init, - (GtkObjectInitFunc) e_select_names_table_model_init, - NULL, /* reserved_1 */ - NULL, /* reserved_2 */ - (GtkClassInitFunc) NULL + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) e_select_names_table_model_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (ESelectNamesTableModel), + 0, /* n_preallocs */ + (GInstanceInitFunc) e_select_names_table_model_init, }; - model_type = gtk_type_unique (e_table_model_get_type (), &model_info); + type = g_type_register_static (e_table_model_get_type (), "ESelectNamesTableModel", &info, 0); } - return model_type; + return type; } /** @@ -98,10 +99,10 @@ e_select_names_table_model_get_type (void) ETableModel * e_select_names_table_model_new (ESelectNamesModel *source) { - ETableModel *model = E_TABLE_MODEL(gtk_type_new(e_select_names_table_model_get_type())); - gtk_object_set(GTK_OBJECT(model), - "source", source, - NULL); + ETableModel *model = g_object_new (E_TYPE_SELECT_NAMES_TABLE_MODEL, NULL); + g_object_set(model, + "source", source, + NULL); return model; } @@ -159,7 +160,7 @@ clear_info (ESelectNamesTableModel *model) */ static void -e_select_names_table_model_destroy (GtkObject *object) +e_select_names_table_model_dispose (GObject *object) { ESelectNamesTableModel *model; @@ -272,36 +273,39 @@ e_select_names_table_model_model_changed (ESelectNamesModel *source, /* Set_arg handler for the model */ static void -e_select_names_table_model_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) +e_select_names_table_model_set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) { ESelectNamesTableModel *model; model = E_SELECT_NAMES_TABLE_MODEL (object); - switch (arg_id) { - case ARG_SOURCE: + switch (prop_id) { + case PROP_SOURCE: e_select_names_table_model_drop_source (model); - e_select_names_table_model_add_source (model, E_SELECT_NAMES_MODEL(GTK_VALUE_OBJECT (*arg))); + e_select_names_table_model_add_source (model, E_SELECT_NAMES_MODEL(g_value_get_object (value))); break; default: - return; + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; } } /* Get_arg handler for the model */ static void -e_select_names_table_model_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) +e_select_names_table_model_get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) { ESelectNamesTableModel *model; model = E_SELECT_NAMES_TABLE_MODEL (object); - switch (arg_id) { - case ARG_SOURCE: - GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(model->source); + switch (prop_id) { + case PROP_SOURCE: + g_value_set_object (value, model->source); break; default: - arg->type = GTK_TYPE_INVALID; + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } @@ -322,18 +326,22 @@ e_select_names_table_model_init (ESelectNamesTableModel *model) static void e_select_names_table_model_class_init (ESelectNamesTableModelClass *klass) { - GtkObjectClass *object_class; + GObjectClass *object_class; ETableModelClass *table_model_class; - object_class = GTK_OBJECT_CLASS(klass); + object_class = G_OBJECT_CLASS(klass); table_model_class = E_TABLE_MODEL_CLASS(klass); - gtk_object_add_arg_type ("ESelectNamesTableModel::source", - GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_SOURCE); + object_class->dispose = e_select_names_table_model_dispose; + object_class->get_property = e_select_names_table_model_get_property; + object_class->set_property = e_select_names_table_model_set_property; - object_class->destroy = e_select_names_table_model_destroy; - object_class->get_arg = e_select_names_table_model_get_arg; - object_class->set_arg = e_select_names_table_model_set_arg; + g_object_class_install_property (object_class, PROP_SOURCE, + g_param_spec_object ("source", + _("Source"), + /*_( */"XXX blurb" /*)*/, + E_TYPE_SELECT_NAMES_MODEL, + G_PARAM_READWRITE)); table_model_class->column_count = e_select_names_table_model_col_count; table_model_class->row_count = e_select_names_table_model_row_count; diff --git a/addressbook/gui/component/select-names/e-select-names-table-model.h b/addressbook/gui/component/select-names/e-select-names-table-model.h index f917ff17d8..1fd1026f19 100644 --- a/addressbook/gui/component/select-names/e-select-names-table-model.h +++ b/addressbook/gui/component/select-names/e-select-names-table-model.h @@ -16,10 +16,10 @@ #include "e-select-names-model.h" #define E_TYPE_SELECT_NAMES_TABLE_MODEL (e_select_names_table_model_get_type ()) -#define E_SELECT_NAMES_TABLE_MODEL(obj) (GTK_CHECK_CAST ((obj), E_TYPE_SELECT_NAMES_TABLE_MODEL, ESelectNamesTableModel)) -#define E_SELECT_NAMES_TABLE_MODEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_TABLE_MODEL, ESelectNamesTableModelClass)) -#define E_IS_SELECT_NAMES_TABLE_MODEL(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_SELECT_NAMES_TABLE_MODEL)) -#define E_IS_SELECT_NAMES_TABLE_MODEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_TABLE_MODEL)) +#define E_SELECT_NAMES_TABLE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SELECT_NAMES_TABLE_MODEL, ESelectNamesTableModel)) +#define E_SELECT_NAMES_TABLE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_TABLE_MODEL, ESelectNamesTableModelClass)) +#define E_IS_SELECT_NAMES_TABLE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SELECT_NAMES_TABLE_MODEL)) +#define E_IS_SELECT_NAMES_TABLE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_TABLE_MODEL)) typedef struct { char *name; @@ -46,6 +46,6 @@ struct _ESelectNamesTableModelClass { ETableModel *e_select_names_table_model_new (ESelectNamesModel *source); /* Standard Gtk function */ -GtkType e_select_names_table_model_get_type (void); +GType e_select_names_table_model_get_type (void); #endif /* ! __E_SELECT_NAMES_TABLE_MODEL_H__ */ diff --git a/addressbook/gui/component/select-names/e-select-names-text-model.c b/addressbook/gui/component/select-names/e-select-names-text-model.c index 8f04e440b5..2463e4c1f2 100644 --- a/addressbook/gui/component/select-names/e-select-names-text-model.c +++ b/addressbook/gui/component/select-names/e-select-names-text-model.c @@ -15,6 +15,7 @@ #include <ctype.h> #include <gal/e-text/e-text-model-repos.h> +#include <libgnome/gnome-i18n.h> #include <addressbook/gui/contact-editor/e-contact-editor.h> #include "e-select-names-text-model.h" @@ -24,15 +25,15 @@ static FILE *out = NULL; /* stream for debugging spew */ /* Object argument IDs */ enum { - ARG_0, - ARG_SOURCE, + PROP_0, + PROP_SOURCE, }; static void e_select_names_text_model_class_init (ESelectNamesTextModelClass *klass); static void e_select_names_text_model_init (ESelectNamesTextModel *model); -static void e_select_names_text_model_destroy (GtkObject *object); -static void e_select_names_text_model_set_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void e_select_names_text_model_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); +static void e_select_names_text_model_dispose (GObject *object); +static void e_select_names_text_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); +static void e_select_names_text_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void e_select_names_text_model_set_source (ESelectNamesTextModel *model, ESelectNamesModel *source); @@ -62,43 +63,48 @@ static ETextModelClass *parent_class; GtkType e_select_names_text_model_get_type (void) { - static GtkType model_type = 0; + static GType type = 0; - if (!model_type) { - GtkTypeInfo model_info = { - "ESelectNamesTextModel", - sizeof (ESelectNamesTextModel), + if (!type) { + static const GTypeInfo info = { sizeof (ESelectNamesTextModelClass), - (GtkClassInitFunc) e_select_names_text_model_class_init, - (GtkObjectInitFunc) e_select_names_text_model_init, - NULL, /* reserved_1 */ - NULL, /* reserved_2 */ - (GtkClassInitFunc) NULL + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) e_select_names_text_model_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (ESelectNamesTextModel), + 0, /* n_preallocs */ + (GInstanceInitFunc) e_select_names_text_model_init, }; - model_type = gtk_type_unique (PARENT_TYPE, &model_info); + type = g_type_register_static (PARENT_TYPE, "ESelectNamesTextModel", &info, 0); } - return model_type; + return type; } static void e_select_names_text_model_class_init (ESelectNamesTextModelClass *klass) { - GtkObjectClass *object_class; + GObjectClass *object_class; ETextModelClass *text_model_class; - object_class = GTK_OBJECT_CLASS(klass); + object_class = G_OBJECT_CLASS(klass); text_model_class = E_TEXT_MODEL_CLASS(klass); - parent_class = gtk_type_class(PARENT_TYPE); + parent_class = g_type_class_peek_parent (klass); - gtk_object_add_arg_type ("ESelectNamesTextModel::source", - GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_SOURCE); + object_class->dispose = e_select_names_text_model_dispose; + object_class->get_property = e_select_names_text_model_get_property; + object_class->set_property = e_select_names_text_model_set_property; - object_class->destroy = e_select_names_text_model_destroy; - object_class->get_arg = e_select_names_text_model_get_arg; - object_class->set_arg = e_select_names_text_model_set_arg; + g_object_class_install_property (object_class, PROP_SOURCE, + g_param_spec_object ("source", + _("Source"), + /*_( */"XXX blurb" /*)*/, + E_TYPE_SELECT_NAMES_MODEL, + G_PARAM_READWRITE)); text_model_class->get_text = e_select_names_text_model_get_text; text_model_class->set_text = e_select_names_text_model_set_text; @@ -151,7 +157,7 @@ e_select_names_text_model_init (ESelectNamesTextModel *model) } static void -e_select_names_text_model_destroy (GtkObject *object) +e_select_names_text_model_dispose (GObject *object) { ESelectNamesTextModel *model; @@ -162,39 +168,42 @@ e_select_names_text_model_destroy (GtkObject *object) e_select_names_text_model_set_source (model, NULL); - if (GTK_OBJECT_CLASS(parent_class)->destroy) - GTK_OBJECT_CLASS(parent_class)->destroy(object); + if (G_OBJECT_CLASS(parent_class)->dispose) + G_OBJECT_CLASS(parent_class)->dispose(object); } static void -e_select_names_text_model_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) +e_select_names_text_model_set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) { ESelectNamesTextModel *model; model = E_SELECT_NAMES_TEXT_MODEL (object); - switch (arg_id) { - case ARG_SOURCE: - e_select_names_text_model_set_source(model, E_SELECT_NAMES_MODEL (GTK_VALUE_OBJECT (*arg))); + switch (prop_id) { + case PROP_SOURCE: + e_select_names_text_model_set_source(model, E_SELECT_NAMES_MODEL (g_value_get_object(value))); break; default: - return; + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; } } static void -e_select_names_text_model_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) +e_select_names_text_model_get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) { ESelectNamesTextModel *model; model = E_SELECT_NAMES_TEXT_MODEL (object); - switch (arg_id) { - case ARG_SOURCE: - GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(model->source); + switch (prop_id) { + case PROP_SOURCE: + g_value_set_object (value, model->source); break; default: - arg->type = GTK_TYPE_INVALID; + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } @@ -246,8 +255,8 @@ e_select_names_text_model_set_source (ESelectNamesTextModel *model, return; if (model->source) { - gtk_signal_disconnect (GTK_OBJECT (model->source), model->source_changed_id); - gtk_signal_disconnect (GTK_OBJECT (model->source), model->source_resize_id); + g_signal_handler_disconnect (model->source, model->source_changed_id); + g_signal_handler_disconnect (model->source, model->source_resize_id); g_object_unref (model->source); } @@ -269,7 +278,7 @@ e_select_names_text_model_set_source (ESelectNamesTextModel *model, ETextModel * e_select_names_text_model_new (ESelectNamesModel *source) { - ETextModel *model = E_TEXT_MODEL (gtk_type_new (e_select_names_text_model_get_type())); + ETextModel *model = g_object_new (E_TYPE_SELECT_NAMES_TEXT_MODEL, NULL); e_select_names_text_model_set_source (E_SELECT_NAMES_TEXT_MODEL (model), source); return model; } @@ -331,7 +340,7 @@ e_select_names_text_model_insert_length (ETextModel *model, gint pos, const gcha /* We want to control all cursor motions ourselves, rather than taking hints from the ESelectNamesModel. */ - gtk_signal_handler_block (GTK_OBJECT (source), text_model->source_resize_id); + g_signal_handler_block (source, text_model->source_resize_id); /* We handle this one character at a time. */ @@ -488,7 +497,7 @@ e_select_names_text_model_insert_length (ETextModel *model, gint pos, const gcha dump_model (text_model); - gtk_signal_handler_unblock (GTK_OBJECT (source), text_model->source_resize_id); + g_signal_handler_unblock (source, text_model->source_resize_id); } @@ -534,7 +543,7 @@ e_select_names_text_model_delete (ETextModel *model, gint pos, gint length) /* We want to control all cursor motions ourselves, rather than taking hints from the ESelectNamesModel. */ - gtk_signal_handler_block (GTK_OBJECT (source), E_SELECT_NAMES_TEXT_MODEL (model)->source_resize_id); + g_signal_handler_block (source, E_SELECT_NAMES_TEXT_MODEL (model)->source_resize_id); /* First, we handle a few tricky cases. */ @@ -691,7 +700,7 @@ e_select_names_text_model_delete (ETextModel *model, gint pos, gint length) finished: E_SELECT_NAMES_TEXT_MODEL (model)->last_magic_comma_pos = -1; - gtk_signal_handler_unblock (GTK_OBJECT (source), E_SELECT_NAMES_TEXT_MODEL (model)->source_resize_id); + g_signal_handler_unblock (source, E_SELECT_NAMES_TEXT_MODEL (model)->source_resize_id); dump_model (E_SELECT_NAMES_TEXT_MODEL (model)); } diff --git a/addressbook/gui/component/select-names/e-select-names-text-model.h b/addressbook/gui/component/select-names/e-select-names-text-model.h index 29ab727368..eec062aee6 100644 --- a/addressbook/gui/component/select-names/e-select-names-text-model.h +++ b/addressbook/gui/component/select-names/e-select-names-text-model.h @@ -17,10 +17,10 @@ #include "e-select-names-model.h" #define E_TYPE_SELECT_NAMES_TEXT_MODEL (e_select_names_text_model_get_type ()) -#define E_SELECT_NAMES_TEXT_MODEL(obj) (GTK_CHECK_CAST ((obj), E_TYPE_SELECT_NAMES_TEXT_MODEL, ESelectNamesTextModel)) -#define E_SELECT_NAMES_TEXT_MODEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_TEXT_MODEL, ESelectNamesTextModelClass)) -#define E_IS_SELECT_NAMES_TEXT_MODEL(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_SELECT_NAMES_TEXT_MODEL)) -#define E_IS_SELECT_NAMES_TEXT_MODEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_TEXT_MODEL)) +#define E_SELECT_NAMES_TEXT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SELECT_NAMES_TEXT_MODEL, ESelectNamesTextModel)) +#define E_SELECT_NAMES_TEXT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_TEXT_MODEL, ESelectNamesTextModelClass)) +#define E_IS_SELECT_NAMES_TEXT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SELECT_NAMES_TEXT_MODEL)) +#define E_IS_SELECT_NAMES_TEXT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_TEXT_MODEL)) typedef struct _ESelectNamesTextModel ESelectNamesTextModel; typedef struct _ESelectNamesTextModelClass ESelectNamesTextModelClass; @@ -48,6 +48,6 @@ ETextModel *e_select_names_text_model_new (ESelectNamesModel *source); void e_select_names_text_model_set_separator (ESelectNamesTextModel *model, const char *sep); /* Standard Gtk function */ -GtkType e_select_names_text_model_get_type (void); +GType e_select_names_text_model_get_type (void); #endif /* ! __E_SELECT_NAMES_TEXT_MODEL_H__ */ diff --git a/addressbook/gui/component/select-names/e-select-names.c b/addressbook/gui/component/select-names/e-select-names.c index 33359ac90f..aa11db902a 100644 --- a/addressbook/gui/component/select-names/e-select-names.c +++ b/addressbook/gui/component/select-names/e-select-names.c @@ -20,6 +20,7 @@ #include <config.h> #include <glib.h> +#include <gtk/gtk.h> #include <libgnome/gnome-i18n.h> #include <libgnomeui/gnome-dialog.h> #include <libgnomeui/gnome-dialog-util.h> @@ -50,9 +51,7 @@ static void e_select_names_init (ESelectNames *card); static void e_select_names_class_init (ESelectNamesClass *klass); -static void e_select_names_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); -static void e_select_names_get_arg (GtkObject *object, GtkArg *arg, guint arg_id); -static void e_select_names_destroy (GtkObject *object); +static void e_select_names_dispose (GObject *object); static void update_query (GtkWidget *widget, ESelectNames *e_select_names); extern EvolutionShellClient *global_shell_client; @@ -74,25 +73,25 @@ typedef struct { GtkWidget *button; } ESelectNamesChild; -GtkType +GType e_select_names_get_type (void) { - static GtkType type = 0; + static GType type = 0; if (!type) { - static const GtkTypeInfo info = - { - "ESelectNames", - sizeof (ESelectNames), + static const GTypeInfo info = { sizeof (ESelectNamesClass), - (GtkClassInitFunc) e_select_names_class_init, - (GtkObjectInitFunc) e_select_names_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) e_select_names_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (ESelectNames), + 0, /* n_preallocs */ + (GInstanceInitFunc) e_select_names_init, }; - type = gtk_type_unique (PARENT_TYPE, &info); + type = g_type_register_static (PARENT_TYPE, "ESelectNames", &info, 0); } return type; @@ -101,15 +100,13 @@ e_select_names_get_type (void) static void e_select_names_class_init (ESelectNamesClass *klass) { - GtkObjectClass *object_class; + GObjectClass *object_class; - object_class = (GtkObjectClass*) klass; + object_class = G_OBJECT_CLASS (klass); - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_peek_parent (klass); - object_class->set_arg = e_select_names_set_arg; - object_class->get_arg = e_select_names_get_arg; - object_class->destroy = e_select_names_destroy; + object_class->dispose = e_select_names_dispose; } GtkWidget *e_addressbook_create_ebook_table(char *name, char *string1, char *string2, int num1, int num2); @@ -118,9 +115,9 @@ GtkWidget *e_addressbook_create_folder_selector(char *name, char *string1, char static void set_book(EBook *book, EBookStatus status, ESelectNames *esn) { - gtk_object_set(GTK_OBJECT(esn->model), - "book", book, - NULL); + g_object_set(esn->model, + "book", book, + NULL); update_query (NULL, esn); g_object_unref(book); g_object_unref(esn->model); @@ -301,9 +298,9 @@ e_addressbook_create_ebook_table(char *name, char *string1, char *string2, int n model = e_addressbook_model_new (); adapter = E_TABLE_MODEL (e_addressbook_table_adapter_new (model)); - gtk_object_set(GTK_OBJECT(model), - "editable", FALSE, - NULL); + g_object_set(model, + "editable", FALSE, + NULL); without = e_table_without_new (adapter, g_str_hash, @@ -319,9 +316,9 @@ e_addressbook_create_ebook_table(char *name, char *string1, char *string2, int n EVOLUTION_ETSPECDIR "/e-select-names.etspec", NULL); - gtk_object_set_data(GTK_OBJECT(table), "adapter", adapter); - gtk_object_set_data(GTK_OBJECT(table), "without", without); - gtk_object_set_data(GTK_OBJECT(table), "model", model); + g_object_set_data(G_OBJECT(table), "adapter", adapter); + g_object_set_data(G_OBJECT(table), "without", without); + g_object_set_data(G_OBJECT(table), "model", model); return table; } @@ -329,7 +326,7 @@ e_addressbook_create_ebook_table(char *name, char *string1, char *string2, int n GtkWidget * e_addressbook_create_folder_selector(char *name, char *string1, char *string2, int num1, int num2) { - return (GtkWidget *)gtk_type_new (EVOLUTION_TYPE_FOLDER_SELECTOR_BUTTON); + return g_object_new (EVOLUTION_TYPE_FOLDER_SELECTOR_BUTTON, NULL); } static void @@ -374,9 +371,9 @@ update_query (GtkWidget *widget, ESelectNames *e_select_names) } else { query = g_strdup (q_array[0]); } - gtk_object_set (GTK_OBJECT (e_select_names->model), - "query", query, - NULL); + g_object_set (e_select_names->model, + "query", query, + NULL); for (i = 1; q_array[i]; i++) { g_free (q_array[i]); } @@ -504,9 +501,9 @@ e_select_names_init (ESelectNames *e_select_names) gtk_window_set_policy(GTK_WINDOW(e_select_names), FALSE, TRUE, FALSE); e_select_names->table = E_TABLE_SCROLLED(glade_xml_get_widget(gui, "table-source")); - e_select_names->model = gtk_object_get_data(GTK_OBJECT(e_select_names->table), "model"); - e_select_names->adapter = gtk_object_get_data(GTK_OBJECT(e_select_names->table), "adapter"); - e_select_names->without = gtk_object_get_data(GTK_OBJECT(e_select_names->table), "without"); + e_select_names->model = g_object_get_data(G_OBJECT(e_select_names->table), "model"); + e_select_names->adapter = g_object_get_data(G_OBJECT(e_select_names->table), "adapter"); + e_select_names->without = g_object_get_data(G_OBJECT(e_select_names->table), "without"); e_select_names->status_message = glade_xml_get_widget (gui, "status-message"); if (e_select_names->status_message && !GTK_IS_LABEL (e_select_names->status_message)) @@ -579,7 +576,10 @@ e_select_names_init (ESelectNames *e_select_names) static void e_select_names_child_free(char *key, ESelectNamesChild *child, ESelectNames *e_select_names) { - gtk_signal_disconnect_by_func (GTK_OBJECT (child->source), G_CALLBACK (sync_table_and_models), e_select_names); + g_signal_handlers_disconnect_matched (child->source, + (GSignalMatchType) (G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA), + 0, 0, NULL, + G_CALLBACK (sync_table_and_models), e_select_names); g_free(child->title); g_object_unref(child->text_model); g_object_unref(child->source); @@ -588,7 +588,7 @@ static void e_select_names_child_free(char *key, ESelectNamesChild *child, ESele } static void -e_select_names_destroy (GtkObject *object) +e_select_names_dispose (GObject *object) { ESelectNames *e_select_names = E_SELECT_NAMES(object); @@ -601,44 +601,17 @@ e_select_names_destroy (GtkObject *object) g_free(e_select_names->def); - (*(GTK_OBJECT_CLASS(parent_class))->destroy)(object); + (*(G_OBJECT_CLASS(parent_class))->dispose)(object); } GtkWidget* e_select_names_new (void) { - GtkWidget *widget = GTK_WIDGET (gtk_type_new (e_select_names_get_type ())); + GtkWidget *widget = g_object_new (E_TYPE_SELECT_NAMES, NULL); return widget; } static void -e_select_names_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) -{ - ESelectNames *editor; - - editor = E_SELECT_NAMES (o); - - switch (arg_id){ - default: - return; - } -} - -static void -e_select_names_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) -{ - ESelectNames *e_select_names; - - e_select_names = E_SELECT_NAMES (object); - - switch (arg_id) { - default: - arg->type = GTK_TYPE_INVALID; - break; - } -} - -static void button_clicked(GtkWidget *button, ESelectNamesChild *child) { real_add_address(child->names, child); @@ -748,21 +721,21 @@ e_select_names_add_section(ESelectNames *e_select_names, char *name, char *id, E button = gtk_button_new (); label = e_entry_new (); - gtk_object_set(GTK_OBJECT(label), - "draw_background", FALSE, - "draw_borders", FALSE, - "draw_button", TRUE, - "editable", FALSE, - "text", "", - "use_ellipsis", FALSE, - "justification", GTK_JUSTIFY_CENTER, - NULL); + g_object_set(label, + "draw_background", FALSE, + "draw_borders", FALSE, + "draw_button", TRUE, + "editable", FALSE, + "text", "", + "use_ellipsis", FALSE, + "justification", GTK_JUSTIFY_CENTER, + NULL); label_text = g_strconcat (child->title, " ->", NULL); - gtk_object_set (GTK_OBJECT (label), - "text", label_text, - "emulate_label_resize", TRUE, - NULL); + g_object_set (label, + "text", label_text, + "emulate_label_resize", TRUE, + NULL); g_free (label_text); gtk_container_add (GTK_CONTAINER (button), label); child->label = label; @@ -782,13 +755,12 @@ e_select_names_add_section(ESelectNames *e_select_names, char *name, char *id, E etable = e_table_scrolled_get_table (e_select_names->table); gtk_widget_set_sensitive (button, e_table_selected_count (etable) > 0); - sw = gtk_scrolled_window_new (NULL, NULL); recipient_table = e_entry_new (); - gtk_object_set (GTK_OBJECT (recipient_table), - "model", child->text_model, - "allow_newlines", TRUE, - NULL); + g_object_set (recipient_table, + "model", child->text_model, + "allow_newlines", TRUE, + NULL); g_signal_connect (recipient_table, "popup", @@ -881,9 +853,9 @@ e_select_names_set_default (ESelectNames *e_select_names, if (e_select_names->def) { child = g_hash_table_lookup(e_select_names->children, e_select_names->def); if (child) - gtk_object_set (GTK_OBJECT (E_ENTRY (child->label)->item), - "bold", FALSE, - NULL); + g_object_set (E_ENTRY (child->label)->item, + "bold", FALSE, + NULL); } g_free(e_select_names->def); @@ -892,8 +864,8 @@ e_select_names_set_default (ESelectNames *e_select_names, if (e_select_names->def) { child = g_hash_table_lookup(e_select_names->children, e_select_names->def); if (child) - gtk_object_set (GTK_OBJECT (E_ENTRY (child->label)->item), - "bold", TRUE, - NULL); + g_object_set (E_ENTRY (child->label)->item, + "bold", TRUE, + NULL); } } diff --git a/addressbook/gui/component/select-names/e-select-names.h b/addressbook/gui/component/select-names/e-select-names.h index 154dfb67c3..d61cf0b388 100644 --- a/addressbook/gui/component/select-names/e-select-names.h +++ b/addressbook/gui/component/select-names/e-select-names.h @@ -46,11 +46,11 @@ extern "C" { * -------------------------------------------------------------------------------- */ -#define E_SELECT_NAMES_TYPE (e_select_names_get_type ()) -#define E_SELECT_NAMES(obj) (GTK_CHECK_CAST ((obj), E_SELECT_NAMES_TYPE, ESelectNames)) -#define E_SELECT_NAMES_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_SELECT_NAMES_TYPE, ESelectNamesClass)) -#define E_IS_SELECT_NAMES(obj) (GTK_CHECK_TYPE ((obj), E_SELECT_NAMES_TYPE)) -#define E_IS_SELECT_NAMES_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_SELECT_NAMES_TYPE)) +#define E_TYPE_SELECT_NAMES (e_select_names_get_type ()) +#define E_SELECT_NAMES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SELECT_NAMES, ESelectNames)) +#define E_SELECT_NAMES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES, ESelectNamesClass)) +#define E_IS_SELECT_NAMES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SELECT_NAMES)) +#define E_IS_SELECT_NAMES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_SELECT_NAMES)) typedef struct _ESelectNames ESelectNames; typedef struct _ESelectNamesClass ESelectNamesClass; @@ -83,7 +83,7 @@ struct _ESelectNamesClass GtkWidget *e_select_names_new (void); -GtkType e_select_names_get_type (void); +GType e_select_names_get_type (void); void e_select_names_add_section (ESelectNames *e_select_names, char *name, |