From 8e9511af0e47355211e189d5cba5dcd9ae97584c Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Tue, 5 Nov 2002 11:09:59 +0000 Subject: port to gnome 2. 2002-11-05 Chris Toshok * backend/pas/pas-backend-card-sexp.[ch]: port to gnome 2. * backend/pas/pas-backend-file.[ch]: same. * backend/pas/pas-backend-file.[ch]: same. * backend/pas/pas-backend-ldap.[ch]: same. * backend/pas/pas-backend-summary.[ch]: same. * backend/pas/pas-backend.[ch]: same. * backend/pas/pas-book-factory.[ch]: same. * backend/pas/pas-book-view.[ch]: same. * backend/pas/pas-book.[ch]: same. * backend/pas/pas-card-cursor.[ch]: same. * backend/pas/pas-marshal.list: list of marshallers. * backend/pas/Makefile.am (libpas_a_SOURCES): add pas-marshal.c also add the marshal building foo. * backend/pas/.cvsignore: ignore pas-marshal.[ch] svn path=/trunk/; revision=18544 --- addressbook/backend/pas/pas-backend-card-sexp.c | 71 +++++++++++++------------ 1 file changed, 36 insertions(+), 35 deletions(-) (limited to 'addressbook/backend/pas/pas-backend-card-sexp.c') diff --git a/addressbook/backend/pas/pas-backend-card-sexp.c b/addressbook/backend/pas/pas-backend-card-sexp.c index f747189bba..f33c391534 100644 --- a/addressbook/backend/pas/pas-backend-card-sexp.c +++ b/addressbook/backend/pas/pas-backend-card-sexp.c @@ -25,7 +25,7 @@ #include #include -static GtkObjectClass *parent_class; +static GObjectClass *parent_class; typedef struct _SearchContext SearchContext; @@ -104,12 +104,12 @@ compare_category (ECardSimple *card, const char *str, ECard *ecard; gboolean ret_val = FALSE; - gtk_object_get (GTK_OBJECT (card), - "card", &ecard, - NULL); - gtk_object_get (GTK_OBJECT (ecard), - "category_list", &categories, - NULL); + g_object_get (card, + "card", &ecard, + NULL); + g_object_get (ecard, + "category_list", &categories, + NULL); for (iterator = e_list_get_iterator(categories); e_iterator_is_valid (iterator); e_iterator_next (iterator)) { const char *category = e_iterator_get (iterator); @@ -120,7 +120,7 @@ compare_category (ECardSimple *card, const char *str, } } - gtk_object_unref (GTK_OBJECT (iterator)); + g_object_unref (iterator); e_card_free_empty_lists (ecard); return ret_val; } @@ -134,12 +134,12 @@ compare_arbitrary (ECardSimple *card, const char *str, ECard *ecard; gboolean ret_val = FALSE; - gtk_object_get (GTK_OBJECT (card), - "card", &ecard, - NULL); - gtk_object_get (GTK_OBJECT (ecard), - "arbitrary", &list, - NULL); + g_object_get (card, + "card", &ecard, + NULL); + g_object_get (ecard, + "arbitrary", &list, + NULL); for (iterator = e_list_get_iterator(list); e_iterator_is_valid (iterator); e_iterator_next (iterator)) { const ECardArbitrary *arbitrary = e_iterator_get (iterator); @@ -150,7 +150,7 @@ compare_arbitrary (ECardSimple *card, const char *str, } } - gtk_object_unref (GTK_OBJECT (iterator)); + g_object_unref (iterator); e_card_free_empty_lists (ecard); return ret_val; } @@ -353,7 +353,7 @@ pas_backend_card_sexp_match_vcard (PASBackendCardSExp *sexp, const char *vcard) card = e_card_new ((char*)vcard); sexp->priv->search_context->card = e_card_simple_new (card); - gtk_object_unref(GTK_OBJECT(card)); + g_object_unref(card); /* if it's not a valid vcard why is it in our db? :) */ if (!sexp->priv->search_context->card) @@ -363,7 +363,7 @@ pas_backend_card_sexp_match_vcard (PASBackendCardSExp *sexp, const char *vcard) retval = (r && r->type == ESEXP_RES_BOOL && r->value.bool); - gtk_object_unref(GTK_OBJECT(sexp->priv->search_context->card)); + g_object_unref(sexp->priv->search_context->card); e_sexp_result_free(sexp->priv->search_sexp, r); @@ -378,7 +378,7 @@ pas_backend_card_sexp_match_vcard (PASBackendCardSExp *sexp, const char *vcard) PASBackendCardSExp * pas_backend_card_sexp_new (const char *text) { - PASBackendCardSExp *sexp = gtk_type_new (pas_backend_card_sexp_get_type ()); + PASBackendCardSExp *sexp = g_object_new (PAS_TYPE_BACKEND_CARD_SEXP, NULL); int esexp_error; int i; @@ -398,7 +398,7 @@ pas_backend_card_sexp_new (const char *text) esexp_error = e_sexp_parse(sexp->priv->search_sexp); if (esexp_error == -1) { - gtk_object_unref (GTK_OBJECT (sexp)); + g_object_unref (sexp); sexp = NULL; } @@ -406,7 +406,7 @@ pas_backend_card_sexp_new (const char *text) } static void -pas_backend_card_sexp_destroy (GtkObject *object) +pas_backend_card_sexp_dispose (GObject *object) { PASBackendCardSExp *sexp = PAS_BACKEND_CARD_SEXP (object); e_sexp_unref(sexp->priv->search_sexp); @@ -414,19 +414,19 @@ pas_backend_card_sexp_destroy (GtkObject *object) g_free (sexp->priv->search_context); g_free (sexp->priv); - GTK_OBJECT_CLASS (parent_class)->destroy (object); + G_OBJECT_CLASS (parent_class)->dispose (object); } static void pas_backend_card_sexp_class_init (PASBackendCardSExpClass *klass) { - GtkObjectClass *object_class = (GtkObjectClass *) klass; + GObjectClass *object_class = G_OBJECT_CLASS (klass); - parent_class = gtk_type_class (gtk_object_get_type ()); + parent_class = g_type_class_ref (G_TYPE_OBJECT); /* Set the virtual methods. */ - object_class->destroy = pas_backend_card_sexp_destroy; + object_class->dispose = pas_backend_card_sexp_dispose; } static void @@ -443,24 +443,25 @@ pas_backend_card_sexp_init (PASBackendCardSExp *sexp) /** * pas_backend_card_sexp_get_type: */ -GtkType +GType pas_backend_card_sexp_get_type (void) { - static GtkType type = 0; + static GType type = 0; if (! type) { - GtkTypeInfo info = { - "PASBackendCardSExp", - sizeof (PASBackendCardSExp), + GTypeInfo info = { sizeof (PASBackendCardSExpClass), - (GtkClassInitFunc) pas_backend_card_sexp_class_init, - (GtkObjectInitFunc) pas_backend_card_sexp_init, - NULL, /* reserved 1 */ - NULL, /* reserved 2 */ - (GtkClassInitFunc) NULL + NULL, /* base_class_init */ + NULL, /* base_class_finalize */ + (GClassInitFunc) pas_backend_card_sexp_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (PASBackendCardSExp), + 0, /* n_preallocs */ + (GInstanceInitFunc) pas_backend_card_sexp_init }; - type = gtk_type_unique (gtk_object_get_type (), &info); + type = g_type_register_static (G_TYPE_OBJECT, "PASBackendCardSExp", &info, 0); } return type; -- cgit v1.2.3