aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2002-11-03 14:14:01 +0800
committerChris Toshok <toshok@src.gnome.org>2002-11-03 14:14:01 +0800
commitf54b808bf2b6c6649f33c062036a207fe152bdd8 (patch)
tree9e4f2e0a40597c4ea425ba60501f20f5403ed76f /addressbook/backend
parent805e75e7d9315f8cb9f6a7213fc373a8a873a242 (diff)
downloadgsoc2013-evolution-f54b808bf2b6c6649f33c062036a207fe152bdd8.tar
gsoc2013-evolution-f54b808bf2b6c6649f33c062036a207fe152bdd8.tar.gz
gsoc2013-evolution-f54b808bf2b6c6649f33c062036a207fe152bdd8.tar.bz2
gsoc2013-evolution-f54b808bf2b6c6649f33c062036a207fe152bdd8.tar.lz
gsoc2013-evolution-f54b808bf2b6c6649f33c062036a207fe152bdd8.tar.xz
gsoc2013-evolution-f54b808bf2b6c6649f33c062036a207fe152bdd8.tar.zst
gsoc2013-evolution-f54b808bf2b6c6649f33c062036a207fe152bdd8.zip
just include glib.h instead of the gtk stuff.
2002-11-02 Chris Toshok <toshok@ximian.com> * backend/ebook/e-book-types.h: just include glib.h instead of the gtk stuff. * backend/ebook/e-book-listener.[ch]: convert to GObject/bonobo-activation/etc/etc. * e-book-util.[ch]: same. * e-book-view-listener.[ch]: same. * e-book-view.[ch]: same. * e-book.[ch]: same. * e-card-compare.[ch]: same. * e-card-cursor.[ch]: same. * e-card-simple.[ch]: same. * e-card.[ch]: same. * e-destination.[ch]: same. * evolution-ldif-importer.c: same. * evolution-vcard-importer.c: same. * load-gnomecard-addressbook.c: same. * load-pine-addressbok.c: same. * test-card.c: same. * test-client-list.c: same. * test-client.c: same. * backend/ebook/Makefile.am: add e-book-marshal.c to SOURCES, add e-book-marshal.[ch] to CLEANFILES, and add e-book-marshal.list to EXTRA_DIST. Also, remove the camel libs from the test LDADD's, and leave e-destination.[ch] out of the build. * backend/ebook/.cvsignore: ignore e-book-marshal.[ch] * backend/ebook/e-book-marshal.list: marshallers for e-book. svn path=/trunk/; revision=18505
Diffstat (limited to 'addressbook/backend')
-rw-r--r--addressbook/backend/ebook/.cvsignore2
-rw-r--r--addressbook/backend/ebook/Makefile.am138
-rw-r--r--addressbook/backend/ebook/e-book-listener.c177
-rw-r--r--addressbook/backend/ebook/e-book-listener.h35
-rw-r--r--addressbook/backend/ebook/e-book-marshal.list5
-rw-r--r--addressbook/backend/ebook/e-book-types.h8
-rw-r--r--addressbook/backend/ebook/e-book-util.c86
-rw-r--r--addressbook/backend/ebook/e-book-util.h12
-rw-r--r--addressbook/backend/ebook/e-book-view-listener.c174
-rw-r--r--addressbook/backend/ebook/e-book-view-listener.h35
-rw-r--r--addressbook/backend/ebook/e-book-view.c164
-rw-r--r--addressbook/backend/ebook/e-book-view.h27
-rw-r--r--addressbook/backend/ebook/e-book.c154
-rw-r--r--addressbook/backend/ebook/e-book.h26
-rw-r--r--addressbook/backend/ebook/e-card-compare.c52
-rw-r--r--addressbook/backend/ebook/e-card-cursor.c42
-rw-r--r--addressbook/backend/ebook/e-card-cursor.h27
-rw-r--r--addressbook/backend/ebook/e-card-simple.c264
-rw-r--r--addressbook/backend/ebook/e-card-simple.h18
-rw-r--r--addressbook/backend/ebook/e-card.c860
-rw-r--r--addressbook/backend/ebook/e-card.h18
-rw-r--r--addressbook/backend/ebook/e-destination.c123
-rw-r--r--addressbook/backend/ebook/e-destination.h20
-rw-r--r--addressbook/backend/ebook/evolution-ldif-importer.c39
-rw-r--r--addressbook/backend/ebook/evolution-vcard-importer.c15
-rw-r--r--addressbook/backend/ebook/load-gnomecard-addressbook.c30
-rw-r--r--addressbook/backend/ebook/load-pine-addressbook.c46
-rw-r--r--addressbook/backend/ebook/test-card.c47
-rw-r--r--addressbook/backend/ebook/test-client-list.c29
-rw-r--r--addressbook/backend/ebook/test-client.c30
30 files changed, 1498 insertions, 1205 deletions
diff --git a/addressbook/backend/ebook/.cvsignore b/addressbook/backend/ebook/.cvsignore
index deec6ea2e7..a90a07be40 100644
--- a/addressbook/backend/ebook/.cvsignore
+++ b/addressbook/backend/ebook/.cvsignore
@@ -23,3 +23,5 @@ Evolution-Composer-common.c
Evolution-Composer.h
GNOME_Evolution_Addressbook_VCard_Importer.oaf
GNOME_Evolution_Addressbook_LDIF_Importer.oaf
+e-book-marshal.c
+e-book-marshal.h
diff --git a/addressbook/backend/ebook/Makefile.am b/addressbook/backend/ebook/Makefile.am
index 307ec123fd..e4068d440d 100644
--- a/addressbook/backend/ebook/Makefile.am
+++ b/addressbook/backend/ebook/Makefile.am
@@ -1,9 +1,9 @@
noinst_PROGRAMS = test-card test-client test-client-list
-bin_PROGRAMS = evolution-vcard-importer \
- evolution-ldif-importer \
- load-pine-addressbook \
- load-gnomecard-addressbook
+#bin_PROGRAMS = evolution-vcard-importer \
+# evolution-ldif-importer \
+# load-pine-addressbook \
+# load-gnomecard-addressbook
CORBA_SOURCE = \
addressbook.h \
@@ -19,10 +19,8 @@ idls = \
$(srcdir)/../idl/addressbook.idl \
$(srcdir)/../../../composer/Evolution-Composer.idl
-idl_flags = `$(GNOME_CONFIG) --cflags idl` -I $(datadir)/idl
-
$(CORBA_SOURCE): $(idls)
- $(ORBIT_IDL) -I $(srcdir) $(idls) $(idl_flags)
+ $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) $(idls)
INCLUDES = \
-DGNOMELOCALEDIR=\""$(localedir)"\" \
@@ -42,6 +40,7 @@ privlib_LTLIBRARIES = libebook.la libebook-static.la
libebook_la_SOURCES = \
$(CORBA_SOURCE) \
e-book-listener.c \
+ e-book-marshal.c \
e-book-view-listener.c \
e-book-view.c \
e-book.c \
@@ -49,8 +48,9 @@ libebook_la_SOURCES = \
e-card-cursor.c \
e-card-simple.c \
e-card.c \
- e-card-compare.c \
- e-destination.c
+ e-card-compare.c
+
+# e-destination.c
libebookincludedir = $(includedir)/evolution/ebook
@@ -76,13 +76,26 @@ libebookinclude_HEADERS = \
libebook_static_la_SOURCES = $(libebook_la_SOURCES)
libebook_static_la_LDFLAGS = -all-static
+# GLib marshalling cruft
+
+e-book-marshal.h: e-book-marshal.list
+ ( @GLIB_GENMARSHAL@ --prefix=e_book_marshal e-book-marshal.list --header > e-book-marshal.tmp \
+ && mv e-book-marshal.tmp e-book-marshal.h ) \
+ || ( rm -f e-book-marshal.tmp && exit 1 )
+
+e-book-marshal.c: e-book-marshal.h
+ ( @GLIB_GENMARSHAL@ --prefix=e_book_marshal e-book-marshal.list --body > e-book-marshal.tmp \
+ && mv e-book-marshal.tmp e-book-marshal.c ) \
+ || ( rm -f e-book-marshal.tmp && exit 1 )
+
+MARSHAL_GENERATED = e-book-marshal.c e-book-marshal.h
+
test_client_SOURCES = \
test-client.c
test_client_LDADD = \
libebook.la \
$(EVOLUTION_ADDRESSBOOK_LIBS) \
- $(top_builddir)/camel/libcamel.la \
$(top_builddir)/libversit/libversit.a \
$(top_builddir)/e-util/ename/libename.la \
$(top_builddir)/e-util/libeutil.la
@@ -93,7 +106,6 @@ test_client_list_SOURCES = \
test_client_list_LDADD = \
libebook.la \
$(EVOLUTION_ADDRESSBOOK_LIBS) \
- $(top_builddir)/camel/libcamel.la \
$(top_builddir)/e-util/ename/libename.la \
$(top_builddir)/libversit/libversit.a \
$(top_builddir)/e-util/libeutil.la
@@ -104,62 +116,60 @@ test_card_SOURCES = \
test_card_LDADD = \
libebook.la \
$(EVOLUTION_ADDRESSBOOK_LIBS) \
- $(top_builddir)/camel/libcamel.la \
- $(top_builddir)/e-util/ename/libename.la \
- $(top_builddir)/libversit/libversit.a \
- $(top_builddir)/e-util/libeutil.la
-
-evolution_vcard_importer_SOURCES = \
- evolution-vcard-importer.c
-
-evolution_vcard_importer_LDADD = \
- libebook.la \
- $(EVOLUTION_ADDRESSBOOK_LIBS) \
- $(top_builddir)/camel/libcamel.la \
- $(top_builddir)/shell/importer/libevolution-importer.la \
- $(DB3_LDADD) \
- $(top_builddir)/e-util/ename/libename.la \
- $(top_builddir)/libversit/libversit.a \
- $(top_builddir)/e-util/libeutil.la
-
-evolution_ldif_importer_SOURCES = \
- evolution-ldif-importer.c
-
-evolution_ldif_importer_LDADD = \
- libebook.la \
- $(EVOLUTION_ADDRESSBOOK_LIBS) \
- $(top_builddir)/camel/libcamel.la \
- $(top_builddir)/shell/importer/libevolution-importer.la \
- $(DB3_LDADD) \
- $(top_builddir)/e-util/ename/libename.la \
- $(top_builddir)/libversit/libversit.a \
- $(top_builddir)/e-util/libeutil.la
-
-load_pine_addressbook_SOURCES = \
- load-pine-addressbook.c
-
-load_pine_addressbook_LDADD = \
- libebook.la \
- $(EVOLUTION_ADDRESSBOOK_LIBS) \
- $(top_builddir)/camel/libcamel.la \
$(top_builddir)/e-util/ename/libename.la \
$(top_builddir)/libversit/libversit.a \
$(top_builddir)/e-util/libeutil.la
-
-load_gnomecard_addressbook_SOURCES = \
- load-gnomecard-addressbook.c
-
-load_gnomecard_addressbook_LDADD = \
- libebook.la \
- $(EVOLUTION_ADDRESSBOOK_LIBS) \
- $(top_builddir)/camel/libcamel.la \
- $(top_builddir)/e-util/ename/libename.la \
- $(top_builddir)/libversit/libversit.a \
- $(top_builddir)/e-util/libeutil.la
-
-
-BUILT_SOURCES = $(CORBA_SOURCE)
+# evolution_vcard_importer_SOURCES = \
+# evolution-vcard-importer.c
+
+# evolution_vcard_importer_LDADD = \
+# libebook.la \
+# $(EVOLUTION_ADDRESSBOOK_LIBS) \
+# $(top_builddir)/camel/libcamel.la \
+# $(top_builddir)/shell/importer/libevolution-importer.la \
+# $(DB3_LDADD) \
+# $(top_builddir)/e-util/ename/libename.la \
+# $(top_builddir)/libversit/libversit.a \
+# $(top_builddir)/e-util/libeutil.la
+
+# evolution_ldif_importer_SOURCES = \
+# evolution-ldif-importer.c
+
+# evolution_ldif_importer_LDADD = \
+# libebook.la \
+# $(EVOLUTION_ADDRESSBOOK_LIBS) \
+# $(top_builddir)/camel/libcamel.la \
+# $(top_builddir)/shell/importer/libevolution-importer.la \
+# $(DB3_LDADD) \
+# $(top_builddir)/e-util/ename/libename.la \
+# $(top_builddir)/libversit/libversit.a \
+# $(top_builddir)/e-util/libeutil.la
+
+# load_pine_addressbook_SOURCES = \
+# load-pine-addressbook.c
+
+# load_pine_addressbook_LDADD = \
+# libebook.la \
+# $(EVOLUTION_ADDRESSBOOK_LIBS) \
+# $(top_builddir)/camel/libcamel.la \
+# $(top_builddir)/e-util/ename/libename.la \
+# $(top_builddir)/libversit/libversit.a \
+# $(top_builddir)/e-util/libeutil.la
+
+# load_gnomecard_addressbook_SOURCES = \
+# load-gnomecard-addressbook.c
+
+# load_gnomecard_addressbook_LDADD = \
+# libebook.la \
+# $(EVOLUTION_ADDRESSBOOK_LIBS) \
+# $(top_builddir)/camel/libcamel.la \
+# $(top_builddir)/e-util/ename/libename.la \
+# $(top_builddir)/libversit/libversit.a \
+# $(top_builddir)/e-util/libeutil.la
+
+
+BUILT_SOURCES = $(CORBA_SOURCE) $(MARSHAL_GENERATED)
CLEANFILES = $(BUILT_SOURCES)
dist-hook:
@@ -175,4 +185,4 @@ oaf_DATA = $(oaf_in_files:.oaf.in=.oaf)
# add this back when you add the file to the archive ;)
# GNOME_Evolution_Addressbook_Pine_Importer.oafinfo
-EXTRA_DIST = $(oaf_in_files) $(oaf_DATA)
+EXTRA_DIST = $(oaf_in_files) $(oaf_DATA) e-book-marshal.list
diff --git a/addressbook/backend/ebook/e-book-listener.c b/addressbook/backend/ebook/e-book-listener.c
index ca366386f2..ed3fad586a 100644
--- a/addressbook/backend/ebook/e-book-listener.c
+++ b/addressbook/backend/ebook/e-book-listener.c
@@ -10,8 +10,9 @@
*/
#include <config.h>
-#include <gtk/gtksignal.h>
+#include <bonobo/bonobo-main.h>
#include "e-book-listener.h"
+#include "e-book-marshal.h"
static EBookStatus e_book_listener_convert_status (GNOME_Evolution_Addressbook_BookListener_CallStatus status);
@@ -22,10 +23,13 @@ enum {
static guint e_book_listener_signals [LAST_SIGNAL];
-static BonoboObjectClass *e_book_listener_parent_class;
+static BonoboObjectClass *parent_class;
POA_GNOME_Evolution_Addressbook_BookListener__vepv e_book_listener_vepv;
struct _EBookListenerPrivate {
+ EBookListenerServant *servant;
+ GNOME_Evolution_Addressbook_BookListener corba_objref;
+
GList *response_queue;
gint timeout_id;
@@ -102,7 +106,7 @@ e_book_listener_check_queue (EBookListener *listener)
listener->priv->timeout_lock = TRUE;
if (listener->priv->response_queue != NULL && !listener->priv->stopped) {
- gtk_signal_emit (GTK_OBJECT (listener), e_book_listener_signals [RESPONSES_QUEUED]);
+ g_signal_emit (listener, e_book_listener_signals [RESPONSES_QUEUED], 0);
}
if (listener->priv->response_queue == NULL || listener->priv->stopped) {
@@ -372,7 +376,7 @@ e_book_listener_queue_get_supported_fields_response (EBookListener *listener,
static void
impl_BookListener_respond_create_card (PortableServer_Servant servant,
const GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- const GNOME_Evolution_Addressbook_CardId id,
+ const CORBA_char* id,
CORBA_Environment *ev)
{
EBookListener *listener = E_BOOK_LISTENER (bonobo_object_from_servant (servant));
@@ -410,7 +414,7 @@ impl_BookListener_respond_modify_card (PortableServer_Servant servant,
static void
impl_BookListener_respond_get_vcard (PortableServer_Servant servant,
const GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- const GNOME_Evolution_Addressbook_VCard card,
+ const CORBA_char* card,
CORBA_Environment *ev)
{
EBookListener *listener = E_BOOK_LISTENER (bonobo_object_from_servant (servant));
@@ -646,41 +650,70 @@ e_book_listener_convert_status (const GNOME_Evolution_Addressbook_BookListener_C
}
}
-static EBookListener *
-e_book_listener_construct (EBookListener *listener)
+void
+e_book_listener_construct (EBookListener *listener,
+ GNOME_Evolution_Addressbook_BookListener corba_objref)
{
- POA_GNOME_Evolution_Addressbook_BookListener *servant;
- CORBA_Environment ev;
- CORBA_Object obj;
+ EBookListenerPrivate *priv;
+
+ g_return_if_fail (listener != NULL);
+ g_return_if_fail (corba_objref != CORBA_OBJECT_NIL);
- g_assert (listener != NULL);
- g_assert (E_IS_BOOK_LISTENER (listener));
+ priv = listener->priv;
- servant = (POA_GNOME_Evolution_Addressbook_BookListener *) g_new0 (BonoboObjectServant, 1);
- servant->vepv = &e_book_listener_vepv;
+ g_return_if_fail (priv->corba_objref == CORBA_OBJECT_NIL);
+
+ priv->corba_objref = corba_objref;
+}
+
+static EBookListenerServant *
+create_servant (EBookListener *listener)
+{
+ EBookListenerServant *servant;
+ POA_GNOME_Evolution_Addressbook_BookListener *corba_servant;
+ CORBA_Environment ev;
CORBA_exception_init (&ev);
- POA_GNOME_Evolution_Addressbook_BookListener__init ((PortableServer_Servant) servant, &ev);
+ servant = g_new0 (EBookListenerServant, 1);
+ corba_servant = (POA_GNOME_Evolution_Addressbook_BookListener *) servant;
+
+ corba_servant->vepv = &e_book_listener_vepv;
+ POA_GNOME_Evolution_Addressbook_BookListener__init ((PortableServer_Servant) corba_servant, &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
g_free (servant);
CORBA_exception_free (&ev);
-
return NULL;
}
+ servant->object = listener;
+
CORBA_exception_free (&ev);
- obj = bonobo_object_activate_servant (BONOBO_OBJECT (listener), servant);
- if (obj == CORBA_OBJECT_NIL) {
- g_free (servant);
+ return servant;
+}
- return NULL;
+static GNOME_Evolution_Addressbook_BookListener
+activate_servant (EBookListener *listener,
+ POA_GNOME_Evolution_Addressbook_BookListener *servant)
+{
+ GNOME_Evolution_Addressbook_BookListener corba_object;
+ CORBA_Environment ev;
+
+ CORBA_exception_init (&ev);
+
+ CORBA_free (PortableServer_POA_activate_object (bonobo_poa (), servant, &ev));
+
+ corba_object = PortableServer_POA_servant_to_reference (bonobo_poa(), servant, &ev);
+
+ if (ev._major == CORBA_NO_EXCEPTION && ! CORBA_Object_is_nil (corba_object, &ev)) {
+ CORBA_exception_free (&ev);
+ return corba_object;
}
- bonobo_object_construct (BONOBO_OBJECT (listener), obj);
+ CORBA_exception_free (&ev);
- return listener;
+ return CORBA_OBJECT_NIL;
}
/**
@@ -695,26 +728,25 @@ EBookListener *
e_book_listener_new ()
{
EBookListener *listener;
- EBookListener *retval;
+ EBookListenerPrivate *priv;
+ GNOME_Evolution_Addressbook_BookListener corba_objref;
- listener = gtk_type_new (E_BOOK_LISTENER_TYPE);
+ listener = g_object_new (E_TYPE_BOOK_LISTENER, NULL);
+ priv = listener->priv;
- retval = e_book_listener_construct (listener);
+ priv->servant = create_servant (listener);
+ corba_objref = activate_servant (listener, (POA_GNOME_Evolution_Addressbook_BookListener *) priv->servant);
- if (retval == NULL) {
- g_warning ("e_book_listener_new: Error constructing "
- "EBookListener!\n");
- bonobo_object_unref (BONOBO_OBJECT (listener));
- return NULL;
- }
+ e_book_listener_construct (listener, corba_objref);
- return retval;
+ return listener;
}
static void
e_book_listener_init (EBookListener *listener)
{
listener->priv = g_new0 (EBookListenerPrivate, 1);
+ listener->priv->corba_objref = CORBA_OBJECT_NIL;
}
void
@@ -726,7 +758,7 @@ e_book_listener_stop (EBookListener *listener)
}
static void
-e_book_listener_destroy (GtkObject *object)
+e_book_listener_dispose (GObject *object)
{
EBookListener *listener = E_BOOK_LISTENER (object);
GList *l;
@@ -746,88 +778,87 @@ e_book_listener_destroy (GtkObject *object)
g_list_free (listener->priv->response_queue);
g_free (listener->priv);
-
- GTK_OBJECT_CLASS (e_book_listener_parent_class)->destroy (object);
+
+ G_OBJECT_CLASS (parent_class)->dispose (object);
}
-POA_GNOME_Evolution_Addressbook_BookListener__epv *
-e_book_listener_get_epv (void)
+static void
+corba_class_init (void)
{
+ POA_GNOME_Evolution_Addressbook_BookListener__vepv *vepv;
POA_GNOME_Evolution_Addressbook_BookListener__epv *epv;
+ PortableServer_ServantBase__epv *base_epv;
+
+ base_epv = g_new0 (PortableServer_ServantBase__epv, 1);
+ base_epv->_private = NULL;
+ base_epv->finalize = NULL;
+ base_epv->default_POA = NULL;
- epv = g_new0 (POA_GNOME_Evolution_Addressbook_BookListener__epv, 1);
+
+ epv = g_new0 (POA_GNOME_Evolution_Addressbook_BookListener__epv, 1);
epv->notifyOpenBookProgress = impl_BookListener_report_open_book_progress;
epv->notifyBookOpened = impl_BookListener_respond_open_book;
-
epv->notifyCardCreated = impl_BookListener_respond_create_card;
epv->notifyCardRemoved = impl_BookListener_respond_remove_card;
epv->notifyCardModified = impl_BookListener_respond_modify_card;
-
epv->notifyAuthenticationResult = impl_BookListener_respond_authentication_result;
epv->notifySupportedFields = impl_BookListener_response_get_supported_fields;
-
epv->notifyCardRequested = impl_BookListener_respond_get_vcard;
epv->notifyCursorRequested = impl_BookListener_respond_get_cursor;
epv->notifyViewRequested = impl_BookListener_respond_get_view;
epv->notifyChangesRequested = impl_BookListener_respond_get_changes;
-
epv->notifyConnectionStatus = impl_BookListener_report_connection_status;
epv->notifyWritable = impl_BookListener_report_writable;
- return epv;
-}
-
-static void
-e_book_listener_corba_class_init (void)
-{
- e_book_listener_vepv.Bonobo_Unknown_epv = bonobo_object_get_epv ();
- e_book_listener_vepv.GNOME_Evolution_Addressbook_BookListener_epv = e_book_listener_get_epv ();
+ vepv = &e_book_listener_vepv;
+ vepv->_base_epv = base_epv;
+ vepv->GNOME_Evolution_Addressbook_BookListener_epv = epv;
}
static void
e_book_listener_class_init (EBookListenerClass *klass)
{
- GtkObjectClass *object_class = (GtkObjectClass *) klass;
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
- e_book_listener_parent_class = gtk_type_class (bonobo_object_get_type ());
+ parent_class = g_type_class_ref (BONOBO_TYPE_OBJECT);
e_book_listener_signals [RESPONSES_QUEUED] =
- gtk_signal_new ("responses_queued",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EBookListenerClass, responses_queued),
- gtk_marshal_NONE__NONE,
- GTK_TYPE_NONE, 0);
-
- gtk_object_class_add_signals (object_class, e_book_listener_signals, LAST_SIGNAL);
+ g_signal_new ("responses_queued",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EBookListenerClass, responses_queued),
+ NULL, NULL,
+ e_book_marshal_NONE__NONE,
+ G_TYPE_NONE, 0);
- object_class->destroy = e_book_listener_destroy;
+ object_class->dispose = e_book_listener_dispose;
- e_book_listener_corba_class_init ();
+ corba_class_init ();
}
/**
* e_book_listener_get_type:
*/
-GtkType
+GType
e_book_listener_get_type (void)
{
- static GtkType type = 0;
+ static GType type = 0;
if (! type) {
- GtkTypeInfo info = {
- "EBookListener",
- sizeof (EBookListener),
+ GTypeInfo info = {
sizeof (EBookListenerClass),
- (GtkClassInitFunc) e_book_listener_class_init,
- (GtkObjectInitFunc) e_book_listener_init,
- NULL, /* reserved 1 */
- NULL, /* reserved 2 */
- (GtkClassInitFunc) NULL
+ NULL, /* base_class_init */
+ NULL, /* base_class_finalize */
+ (GClassInitFunc) e_book_listener_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (EBookListener),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) e_book_listener_init
};
- type = gtk_type_unique (bonobo_object_get_type (), &info);
+ type = g_type_register_static (G_TYPE_OBJECT, "EBookListener", &info, 0);
}
return type;
diff --git a/addressbook/backend/ebook/e-book-listener.h b/addressbook/backend/ebook/e-book-listener.h
index f546c9a029..6956d23db4 100644
--- a/addressbook/backend/ebook/e-book-listener.h
+++ b/addressbook/backend/ebook/e-book-listener.h
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
- * A client-side GtkObject which exposes the
+ * A client-side GObject which exposes the
* Evolution:BookListener interface.
*
* Author:
@@ -12,13 +12,19 @@
#ifndef __E_BOOK_LISTENER_H__
#define __E_BOOK_LISTENER_H__
-#include <libgnome/gnome-defs.h>
#include <bonobo/bonobo-object.h>
#include <ebook/addressbook.h>
#include <ebook/e-book-types.h>
#include <e-util/e-list.h>
-BEGIN_GNOME_DECLS
+#define E_TYPE_BOOK_LISTENER (e_book_listener_get_type ())
+#define E_BOOK_LISTENER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_BOOK_LISTENER, EBookListener))
+#define E_BOOK_LISTENER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_BOOK_LISTENER, EBookListenerClass))
+#define E_IS_BOOK_LISTENER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_BOOK_LISTENER))
+#define E_IS_BOOK_LISTENER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_BOOK_LISTENER))
+#define E_BOOK_LISTENER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_BOOK_LISTENER, EBookListenerClass))
+
+G_BEGIN_DECLS
typedef struct _EBookListener EBookListener;
typedef struct _EBookListenerClass EBookListenerClass;
@@ -90,20 +96,23 @@ typedef struct {
char *vcard;
} EBookListenerResponse;
+
+struct _EBookListenerServant {
+ POA_GNOME_Evolution_Addressbook_BookListener servant_placeholder;
+ EBookListener *object;
+};
+typedef struct _EBookListenerServant EBookListenerServant;
+
+
+
EBookListener *e_book_listener_new (void);
+void e_book_listener_construct (EBookListener *listener,
+ GNOME_Evolution_Addressbook_BookListener corba_objref);
int e_book_listener_check_pending (EBookListener *listener);
EBookListenerResponse *e_book_listener_pop_response (EBookListener *listener);
-GtkType e_book_listener_get_type (void);
+GType e_book_listener_get_type (void);
void e_book_listener_stop (EBookListener *listener);
-POA_GNOME_Evolution_Addressbook_BookListener__epv *e_book_listener_get_epv (void);
-
-#define E_BOOK_LISTENER_TYPE (e_book_listener_get_type ())
-#define E_BOOK_LISTENER(o) (GTK_CHECK_CAST ((o), E_BOOK_LISTENER_TYPE, EBookListener))
-#define E_BOOK_LISTENER_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_BOOK_LISTENER_TYPE, EBookListenerClass))
-#define E_IS_BOOK_LISTENER(o) (GTK_CHECK_TYPE ((o), E_BOOK_LISTENER_TYPE))
-#define E_IS_BOOK_LISTENER_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_BOOK_LISTENER_TYPE))
-
-END_GNOME_DECLS
+G_END_DECLS
#endif /* ! __E_BOOK_LISTENER_H__ */
diff --git a/addressbook/backend/ebook/e-book-marshal.list b/addressbook/backend/ebook/e-book-marshal.list
new file mode 100644
index 0000000000..3624766421
--- /dev/null
+++ b/addressbook/backend/ebook/e-book-marshal.list
@@ -0,0 +1,5 @@
+NONE:NONE
+NONE:BOOL
+NONE:POINTER
+NONE:STRING
+NONE:ENUM
diff --git a/addressbook/backend/ebook/e-book-types.h b/addressbook/backend/ebook/e-book-types.h
index eb70a778fc..b1900e77ed 100644
--- a/addressbook/backend/ebook/e-book-types.h
+++ b/addressbook/backend/ebook/e-book-types.h
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
- * A client-side GtkObject which exposes the
+ * A client-side GObject which exposes the
* Evolution:BookListener interface.
*
* Author:
@@ -12,9 +12,9 @@
#ifndef __E_BOOK_TYPES_H__
#define __E_BOOK_TYPES_H__
-#include <libgnome/gnome-defs.h>
+#include <glib.h>
-BEGIN_GNOME_DECLS
+G_BEGIN_DECLS
typedef enum {
E_BOOK_STATUS_SUCCESS,
@@ -48,6 +48,6 @@ typedef enum {
E_BOOK_SIMPLE_QUERY_STATUS_OTHER_ERROR
} EBookSimpleQueryStatus;
-END_GNOME_DECLS
+G_END_DECLS
#endif /* ! __E_BOOK_TYPES_H__ */
diff --git a/addressbook/backend/ebook/e-book-util.c b/addressbook/backend/ebook/e-book-util.c
index 06e2787f3e..a43416abbf 100644
--- a/addressbook/backend/ebook/e-book-util.c
+++ b/addressbook/backend/ebook/e-book-util.c
@@ -27,10 +27,8 @@
#include <config.h>
#include "e-book-util.h"
-#include <gtk/gtkobject.h>
-#include <gtk/gtksignal.h>
-#include <libgnome/gnome-defs.h>
-#include <libgnome/gnome-util.h>
+#include <glib.h>
+#include <glib-object.h>
#include "e-card-compare.h"
typedef struct _CommonBookInfo CommonBookInfo;
@@ -55,7 +53,7 @@ e_book_expand_uri (const char *uri)
char *ret_val;
char *file_name;
- file_name = g_concat_dir_and_file(uri + offset, "addressbook.db");
+ file_name = g_build_path(uri + offset, "addressbook.db", NULL);
ret_val = g_strdup_printf("file://%s", file_name);
g_free(file_name);
return ret_val;
@@ -115,21 +113,23 @@ e_book_use_address_book_by_uri (const char *uri, EBookCommonCallback cb, gpointe
book = e_book_new ();
if (! e_book_load_address_book_by_uri (book, uri, got_uri_book_cb, info)) {
- gtk_object_unref (GTK_OBJECT (book));
+ g_object_unref (book);
g_free (info);
}
}
-Bonobo_ConfigDatabase
-e_book_get_config_database (CORBA_Environment *ev)
+#if PENDING_PORT_WORK
+EConfigListener *
+e_book_get_config_database ()
{
- static Bonobo_ConfigDatabase config_db;
+ static EConfigListener *config_db;
if (config_db == NULL)
- config_db = bonobo_get_object ("wombat:", "Bonobo/ConfigDatabase", ev);
+ config_db = e_config_listener_new ();
return config_db;
}
+#endif
static EBook *common_default_book = NULL;
@@ -144,7 +144,7 @@ got_default_book_cb (EBook *book, EBookStatus status, gpointer closure)
default book got loaded twice. */
if (common_default_book) {
- gtk_object_unref (GTK_OBJECT (book));
+ g_object_unref (book);
book = common_default_book;
}
@@ -181,7 +181,7 @@ e_book_use_default_book (EBookCommonCallback cb, gpointer closure)
book = e_book_new ();
if (! e_book_load_default_book (book, got_default_book_cb, info)) {
- gtk_object_unref (GTK_OBJECT (book));
+ g_object_unref (book);
g_free (info);
}
}
@@ -196,27 +196,27 @@ set_default_book_uri_local (void)
if (default_book_uri)
g_free (default_book_uri);
- filename = gnome_util_prepend_user_home ("evolution/local/Contacts/addressbook.db");
+ filename = g_build_filename (g_get_home_dir(),
+ "evolution/local/Contacts/addressbook.db");
default_book_uri = g_strdup_printf ("file://%s", filename);
g_free (filename);
}
static void
-set_default_book_uri_from_bonobo_conf (void)
+set_default_book_uri_from_config_db (void)
{
- CORBA_Environment ev;
+#if PENDING_PORT_WORK
char *val;
- Bonobo_ConfigDatabase config_db;
+ EConfigListener* config_db;
- CORBA_exception_init (&ev);
- config_db = e_book_get_config_database (&ev);
- val = bonobo_config_get_string (config_db, "/DefaultFolders/contacts_uri", &ev);
- CORBA_exception_free (&ev);
+ config_db = e_book_get_config_database ();
+ val = e_config_listener_get_string_with_default (config_db, "/DefaultFolders/contacts_uri", NULL, NULL);
if (val) {
default_book_uri = e_book_expand_uri (val);
g_free (val);
} else
+#endif
set_default_book_uri_local ();
}
@@ -279,7 +279,7 @@ char*
e_book_get_default_book_uri ()
{
if (!default_book_uri)
- set_default_book_uri_from_bonobo_conf ();
+ set_default_book_uri_from_config_db ();
return default_book_uri;
}
@@ -307,15 +307,15 @@ struct _SimpleQueryInfo {
static void
book_add_simple_query (EBook *book, SimpleQueryInfo *info)
{
- GList *pending = gtk_object_get_data (GTK_OBJECT (book), "sq_pending");
+ GList *pending = g_object_get_data (G_OBJECT(book), "sq_pending");
pending = g_list_prepend (pending, info);
- gtk_object_set_data (GTK_OBJECT (book), "sq_pending", pending);
+ g_object_set_data (G_OBJECT (book), "sq_pending", pending);
}
static SimpleQueryInfo *
book_lookup_simple_query (EBook *book, guint tag)
{
- GList *pending = gtk_object_get_data (GTK_OBJECT (book), "sq_pending");
+ GList *pending = g_object_get_data (G_OBJECT (book), "sq_pending");
while (pending) {
SimpleQueryInfo *sq = pending->data;
if (sq->tag == tag)
@@ -328,7 +328,7 @@ book_lookup_simple_query (EBook *book, guint tag)
static void
book_remove_simple_query (EBook *book, SimpleQueryInfo *info)
{
- GList *pending = gtk_object_get_data (GTK_OBJECT (book), "sq_pending");
+ GList *pending = g_object_get_data (G_OBJECT (book), "sq_pending");
GList *i;
for (i=pending; i != NULL; i = g_list_next (i)) {
@@ -338,17 +338,17 @@ book_remove_simple_query (EBook *book, SimpleQueryInfo *info)
break;
}
}
- gtk_object_set_data (GTK_OBJECT (book), "sq_pending", pending);
+ g_object_set_data (G_OBJECT (book), "sq_pending", pending);
}
static guint
book_issue_tag (EBook *book)
{
- gpointer ptr = gtk_object_get_data (GTK_OBJECT (book), "sq_tag");
+ gpointer ptr = g_object_get_data (G_OBJECT (book), "sq_tag");
guint tag = GPOINTER_TO_UINT (ptr);
if (tag == 0)
tag = 1;
- gtk_object_set_data (GTK_OBJECT (book), "sq_tag", GUINT_TO_POINTER (tag+1));
+ g_object_set_data (G_OBJECT (book), "sq_tag", GUINT_TO_POINTER (tag+1));
return tag;
}
@@ -359,7 +359,7 @@ simple_query_new (EBook *book, const char *query, EBookSimpleQueryCallback cb, g
sq->tag = book_issue_tag (book);
sq->book = book;
- gtk_object_ref (GTK_OBJECT (book));
+ g_object_ref (book);
sq->query = g_strdup (query);
sq->cb = cb;
sq->closure = closure;
@@ -375,17 +375,17 @@ static void
simple_query_disconnect (SimpleQueryInfo *sq)
{
if (sq->add_tag) {
- gtk_signal_disconnect (GTK_OBJECT (sq->view), sq->add_tag);
+ g_signal_handler_disconnect (sq->view, sq->add_tag);
sq->add_tag = 0;
}
if (sq->seq_complete_tag) {
- gtk_signal_disconnect (GTK_OBJECT (sq->view), sq->seq_complete_tag);
+ g_signal_handler_disconnect (sq->view, sq->seq_complete_tag);
sq->seq_complete_tag = 0;
}
if (sq->view) {
- gtk_object_unref (GTK_OBJECT (sq->view));
+ g_object_unref (sq->view);
sq->view = NULL;
}
}
@@ -401,9 +401,9 @@ simple_query_free (SimpleQueryInfo *sq)
g_free (sq->query);
if (sq->book)
- gtk_object_unref (GTK_OBJECT (sq->book));
+ g_object_unref (sq->book);
- g_list_foreach (sq->cards, (GFunc) gtk_object_unref, NULL);
+ g_list_foreach (sq->cards, (GFunc) g_object_unref, NULL);
g_list_free (sq->cards);
g_free (sq);
@@ -418,7 +418,7 @@ simple_query_card_added_cb (EBookView *view, const GList *cards, gpointer closur
return;
sq->cards = g_list_concat (sq->cards, g_list_copy ((GList *) cards));
- g_list_foreach ((GList *) cards, (GFunc) gtk_object_ref, NULL);
+ g_list_foreach ((GList *) cards, (GFunc) g_object_ref, NULL);
}
static void
@@ -452,16 +452,12 @@ simple_query_book_view_cb (EBook *book, EBookStatus status, EBookView *book_view
}
sq->view = book_view;
- gtk_object_ref (GTK_OBJECT (book_view));
-
- sq->add_tag = gtk_signal_connect (GTK_OBJECT (sq->view),
- "card_added",
- GTK_SIGNAL_FUNC (simple_query_card_added_cb),
- sq);
- sq->seq_complete_tag = gtk_signal_connect (GTK_OBJECT (sq->view),
- "sequence_complete",
- GTK_SIGNAL_FUNC (simple_query_sequence_complete_cb),
- sq);
+ g_object_ref (book_view);
+
+ sq->add_tag = g_signal_connect (sq->view, "card_added",
+ G_CALLBACK (simple_query_card_added_cb), sq);
+ sq->seq_complete_tag = g_signal_connect (sq->view, "sequence_complete",
+ G_CALLBACK (simple_query_sequence_complete_cb), sq);
}
guint
diff --git a/addressbook/backend/ebook/e-book-util.h b/addressbook/backend/ebook/e-book-util.h
index c1c07564cd..71d9cd0c33 100644
--- a/addressbook/backend/ebook/e-book-util.h
+++ b/addressbook/backend/ebook/e-book-util.h
@@ -27,13 +27,12 @@
#ifndef __E_BOOK_UTIL_H__
#define __E_BOOK_UTIL_H__
-#include <libgnome/gnome-defs.h>
#include "e-book.h"
-#include <bonobo-conf/bonobo-config-database.h>
+#include "e-util/e-config-listener.h"
#include <bonobo/bonobo-object.h>
#include <bonobo/bonobo-moniker-util.h>
-BEGIN_GNOME_DECLS
+G_BEGIN_DECLS
/* Callbacks for asynchronous functions. */
typedef void (*EBookCommonCallback) (EBook *book, gpointer closure);
@@ -58,8 +57,8 @@ gboolean e_book_load_default_book (EBook
gpointer closure);
char *e_book_get_default_book_uri (void);
-/* Bonoboconf database interface. */
-Bonobo_ConfigDatabase e_book_get_config_database (CORBA_Environment *ev);
+/* config database interface. */
+EConfigListener *e_book_get_config_database (void);
/* Simple Query Interface. */
guint e_book_simple_query (EBook *book,
@@ -86,8 +85,7 @@ void e_book_query_address_default (const gchar
EBookHaveAddressCallback cb,
gpointer closure);
-END_GNOME_DECLS
-
+G_END_DECLS
#endif /* __E_BOOK_UTIL_H__ */
diff --git a/addressbook/backend/ebook/e-book-view-listener.c b/addressbook/backend/ebook/e-book-view-listener.c
index ce46fd1100..5e8c9300ae 100644
--- a/addressbook/backend/ebook/e-book-view-listener.c
+++ b/addressbook/backend/ebook/e-book-view-listener.c
@@ -10,10 +10,11 @@
*/
#include <config.h>
-#include <gtk/gtksignal.h>
+#include <bonobo/bonobo-main.h>
#include "e-book-view-listener.h"
#include "e-book-view.h"
#include "e-card.h"
+#include "e-book-marshal.h"
static EBookViewStatus e_book_view_listener_convert_status (GNOME_Evolution_Addressbook_BookViewListener_CallStatus status);
@@ -24,10 +25,13 @@ enum {
static guint e_book_view_listener_signals [LAST_SIGNAL];
-static BonoboObjectClass *e_book_view_listener_parent_class;
+static BonoboObjectClass *parent_class;
POA_GNOME_Evolution_Addressbook_BookViewListener__vepv e_book_view_listener_vepv;
struct _EBookViewListenerPrivate {
+ EBookViewListenerServant *servant;
+ GNOME_Evolution_Addressbook_BookViewListener corba_objref;
+
GList *response_queue;
gint timeout_id;
@@ -44,7 +48,7 @@ e_book_view_listener_check_queue (EBookViewListener *listener)
listener->priv->timeout_lock = TRUE;
if (listener->priv->response_queue != NULL && !listener->priv->stopped) {
- gtk_signal_emit (GTK_OBJECT (listener), e_book_view_listener_signals [RESPONSES_QUEUED]);
+ g_signal_emit (listener, e_book_view_listener_signals [RESPONSES_QUEUED], 0);
}
if (listener->priv->response_queue == NULL || listener->priv->stopped) {
@@ -68,7 +72,7 @@ e_book_view_listener_queue_response (EBookViewListener *listener,
if (listener->priv->stopped) {
/* Free response and return */
g_free (response->id);
- g_list_foreach (response->cards, (GFunc) gtk_object_unref, NULL);
+ g_list_foreach (response->cards, (GFunc) g_object_unref, NULL);
g_list_free (response->cards);
g_free (response->message);
g_free (response);
@@ -215,7 +219,7 @@ impl_BookViewListener_notify_card_added (PortableServer_Servant servant,
static void
impl_BookViewListener_notify_card_removed (PortableServer_Servant servant,
- const GNOME_Evolution_Addressbook_CardId id,
+ const CORBA_char* id,
CORBA_Environment *ev)
{
EBookViewListener *listener = E_BOOK_VIEW_LISTENER (bonobo_object_from_servant (servant));
@@ -327,41 +331,70 @@ e_book_view_listener_convert_status (const GNOME_Evolution_Addressbook_BookViewL
}
}
-static EBookViewListener *
-e_book_view_listener_construct (EBookViewListener *listener)
+void
+e_book_view_listener_construct (EBookViewListener *listener,
+ GNOME_Evolution_Addressbook_BookViewListener corba_objref)
{
- POA_GNOME_Evolution_Addressbook_BookViewListener *servant;
- CORBA_Environment ev;
- CORBA_Object obj;
+ EBookViewListenerPrivate *priv;
+
+ g_return_if_fail (listener != NULL);
+ g_return_if_fail (corba_objref != CORBA_OBJECT_NIL);
+
+ priv = listener->priv;
+
+ g_return_if_fail (priv->corba_objref == CORBA_OBJECT_NIL);
- g_assert (listener != NULL);
- g_assert (E_IS_BOOK_VIEW_LISTENER (listener));
+ priv->corba_objref = corba_objref;
+}
- servant = (POA_GNOME_Evolution_Addressbook_BookViewListener *) g_new0 (BonoboObjectServant, 1);
- servant->vepv = &e_book_view_listener_vepv;
+static EBookViewListenerServant *
+create_servant (EBookViewListener *listener)
+{
+ EBookViewListenerServant *servant;
+ POA_GNOME_Evolution_Addressbook_BookViewListener *corba_servant;
+ CORBA_Environment ev;
CORBA_exception_init (&ev);
- POA_GNOME_Evolution_Addressbook_BookViewListener__init ((PortableServer_Servant) servant, &ev);
+ servant = g_new0 (EBookViewListenerServant, 1);
+ corba_servant = (POA_GNOME_Evolution_Addressbook_BookViewListener *) servant;
+
+ corba_servant->vepv = &e_book_view_listener_vepv;
+ POA_GNOME_Evolution_Addressbook_BookViewListener__init ((PortableServer_Servant) corba_servant, &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
g_free (servant);
CORBA_exception_free (&ev);
-
return NULL;
}
+ servant->object = listener;
+
CORBA_exception_free (&ev);
- obj = bonobo_object_activate_servant (BONOBO_OBJECT (listener), servant);
- if (obj == CORBA_OBJECT_NIL) {
- g_free (servant);
+ return servant;
+}
- return NULL;
+static GNOME_Evolution_Addressbook_BookViewListener
+activate_servant (EBookViewListener *listener,
+ POA_GNOME_Evolution_Addressbook_BookViewListener *servant)
+{
+ GNOME_Evolution_Addressbook_BookViewListener corba_object;
+ CORBA_Environment ev;
+
+ CORBA_exception_init (&ev);
+
+ CORBA_free (PortableServer_POA_activate_object (bonobo_poa (), servant, &ev));
+
+ corba_object = PortableServer_POA_servant_to_reference (bonobo_poa(), servant, &ev);
+
+ if (ev._major == CORBA_NO_EXCEPTION && ! CORBA_Object_is_nil (corba_object, &ev)) {
+ CORBA_exception_free (&ev);
+ return corba_object;
}
- bonobo_object_construct (BONOBO_OBJECT (listener), obj);
+ CORBA_exception_free (&ev);
- return listener;
+ return CORBA_OBJECT_NIL;
}
/**
@@ -376,26 +409,25 @@ EBookViewListener *
e_book_view_listener_new ()
{
EBookViewListener *listener;
- EBookViewListener *retval;
+ EBookViewListenerPrivate *priv;
+ GNOME_Evolution_Addressbook_BookViewListener corba_objref;
- listener = gtk_type_new (E_BOOK_VIEW_LISTENER_TYPE);
+ listener = g_object_new (E_TYPE_BOOK_VIEW_LISTENER, NULL);
+ priv = listener->priv;
- retval = e_book_view_listener_construct (listener);
+ priv->servant = create_servant (listener);
+ corba_objref = activate_servant (listener, (POA_GNOME_Evolution_Addressbook_BookViewListener *) priv->servant);
- if (retval == NULL) {
- g_warning ("e_book_view_listener_new: Error constructing "
- "EBookViewListener!\n");
- bonobo_object_unref (BONOBO_OBJECT (listener));
- return NULL;
- }
+ e_book_view_listener_construct (listener, corba_objref);
- return retval;
+ return listener;
}
static void
e_book_view_listener_init (EBookViewListener *listener)
{
listener->priv = g_new0 (EBookViewListenerPrivate, 1);
+ listener->priv->corba_objref = CORBA_OBJECT_NIL;
listener->priv->response_queue = NULL;
listener->priv->timeout_id = 0;
listener->priv->timeout_lock = FALSE;
@@ -410,7 +442,7 @@ e_book_view_listener_stop (EBookViewListener *listener)
}
static void
-e_book_view_listener_destroy (GtkObject *object)
+e_book_view_listener_dispose (GObject *object)
{
EBookViewListener *listener = E_BOOK_VIEW_LISTENER (object);
GList *l;
@@ -427,7 +459,7 @@ e_book_view_listener_destroy (GtkObject *object)
g_free(resp->id);
- g_list_foreach(resp->cards, (GFunc) gtk_object_unref, NULL);
+ g_list_foreach(resp->cards, (GFunc) g_object_unref, NULL);
g_list_free(resp->cards);
resp->cards = NULL;
@@ -440,76 +472,78 @@ e_book_view_listener_destroy (GtkObject *object)
g_free (listener->priv);
listener->priv = NULL;
-
- GTK_OBJECT_CLASS (e_book_view_listener_parent_class)->destroy (object);
+
+ G_OBJECT_CLASS (parent_class)->dispose (object);
}
-POA_GNOME_Evolution_Addressbook_BookViewListener__epv *
-e_book_view_listener_get_epv (void)
+static void
+corba_class_init (void)
{
+ POA_GNOME_Evolution_Addressbook_BookViewListener__vepv *vepv;
POA_GNOME_Evolution_Addressbook_BookViewListener__epv *epv;
+ PortableServer_ServantBase__epv *base_epv;
- epv = g_new0 (POA_GNOME_Evolution_Addressbook_BookViewListener__epv, 1);
+ base_epv = g_new0 (PortableServer_ServantBase__epv, 1);
+ base_epv->_private = NULL;
+ base_epv->finalize = NULL;
+ base_epv->default_POA = NULL;
+
+ epv = g_new0 (POA_GNOME_Evolution_Addressbook_BookViewListener__epv, 1);
epv->notifyCardChanged = impl_BookViewListener_notify_card_changed;
epv->notifyCardRemoved = impl_BookViewListener_notify_card_removed;
epv->notifyCardAdded = impl_BookViewListener_notify_card_added;
epv->notifySequenceComplete = impl_BookViewListener_notify_sequence_complete;
epv->notifyStatusMessage = impl_BookViewListener_notify_status_message;
- return epv;
-}
-
-static void
-e_book_view_listener_corba_class_init (void)
-{
- e_book_view_listener_vepv.Bonobo_Unknown_epv = bonobo_object_get_epv ();
- e_book_view_listener_vepv.GNOME_Evolution_Addressbook_BookViewListener_epv = e_book_view_listener_get_epv ();
+ vepv = &e_book_view_listener_vepv;
+ vepv->_base_epv = base_epv;
+ vepv->GNOME_Evolution_Addressbook_BookViewListener_epv = epv;
}
static void
e_book_view_listener_class_init (EBookViewListenerClass *klass)
{
- GtkObjectClass *object_class = (GtkObjectClass *) klass;
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
- e_book_view_listener_parent_class = gtk_type_class (bonobo_object_get_type ());
+ parent_class = g_type_class_ref (BONOBO_TYPE_OBJECT);
e_book_view_listener_signals [RESPONSES_QUEUED] =
- gtk_signal_new ("responses_queued",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EBookViewListenerClass, responses_queued),
- gtk_marshal_NONE__NONE,
- GTK_TYPE_NONE, 0);
-
- gtk_object_class_add_signals (object_class, e_book_view_listener_signals, LAST_SIGNAL);
+ g_signal_new ("responses_queued",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EBookViewListenerClass, responses_queued),
+ NULL, NULL,
+ e_book_marshal_NONE__NONE,
+ G_TYPE_NONE, 0);
- object_class->destroy = e_book_view_listener_destroy;
+ object_class->dispose = e_book_view_listener_dispose;
- e_book_view_listener_corba_class_init ();
+ corba_class_init ();
}
/**
* e_book_view_listener_get_type:
*/
-GtkType
+GType
e_book_view_listener_get_type (void)
{
- static GtkType type = 0;
+ static GType type = 0;
if (! type) {
- GtkTypeInfo info = {
- "EBookViewListener",
- sizeof (EBookViewListener),
+ GTypeInfo info = {
sizeof (EBookViewListenerClass),
- (GtkClassInitFunc) e_book_view_listener_class_init,
- (GtkObjectInitFunc) e_book_view_listener_init,
- NULL, /* reserved 1 */
- NULL, /* reserved 2 */
- (GtkClassInitFunc) NULL
+ NULL, /* base_class_init */
+ NULL, /* base_class_finalize */
+ (GClassInitFunc) e_book_view_listener_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (EBookViewListener),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) e_book_view_listener_init
};
- type = gtk_type_unique (bonobo_object_get_type (), &info);
+ type = g_type_register_static (G_TYPE_OBJECT, "EBookViewListener", &info, 0);
}
return type;
diff --git a/addressbook/backend/ebook/e-book-view-listener.h b/addressbook/backend/ebook/e-book-view-listener.h
index 284c880ed1..3ca502dbfc 100644
--- a/addressbook/backend/ebook/e-book-view-listener.h
+++ b/addressbook/backend/ebook/e-book-view-listener.h
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
- * A client-side GtkObject which exposes the
+ * A client-side GObject which exposes the
* Evolution:BookViewListener interface.
*
* Author:
@@ -12,12 +12,18 @@
#ifndef __E_BOOK_VIEW_LISTENER_H__
#define __E_BOOK_VIEW_LISTENER_H__
-#include <libgnome/gnome-defs.h>
#include <bonobo/bonobo-object.h>
#include <ebook/e-book-types.h>
#include <ebook/addressbook.h>
-BEGIN_GNOME_DECLS
+#define E_TYPE_BOOK_VIEW_LISTENER (e_book_view_listener_get_type ())
+#define E_BOOK_VIEW_LISTENER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_BOOK_VIEW_LISTENER, EBookViewListener))
+#define E_BOOK_VIEW_LISTENER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_BOOK_VIEW_LISTENER, EBookViewListenerClass))
+#define E_IS_BOOK_VIEW_LISTENER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_BOOK_VIEW_LISTENER))
+#define E_IS_BOOK_VIEW_LISTENER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_BOOK_VIEW_LISTENER))
+#define E_BOOK_VIEW_LISTENER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_BOOK_VIEW_LISTENER, EBookViewListenerClass))
+
+G_BEGIN_DECLS
typedef struct _EBookViewListener EBookViewListener;
typedef struct _EBookViewListenerClass EBookViewListenerClass;
@@ -63,20 +69,23 @@ typedef struct {
} EBookViewListenerResponse;
+
+struct _EBookViewListenerServant {
+ POA_GNOME_Evolution_Addressbook_BookViewListener servant_placeholder;
+ EBookViewListener *object;
+};
+typedef struct _EBookViewListenerServant EBookViewListenerServant;
+
+
+
EBookViewListener *e_book_view_listener_new (void);
+void e_book_view_listener_construct (EBookViewListener *listener,
+ GNOME_Evolution_Addressbook_BookViewListener corba_objref);
int e_book_view_listener_check_pending (EBookViewListener *listener);
EBookViewListenerResponse *e_book_view_listener_pop_response (EBookViewListener *listener);
-GtkType e_book_view_listener_get_type (void);
+GType e_book_view_listener_get_type (void);
void e_book_view_listener_stop (EBookViewListener *listener);
-POA_GNOME_Evolution_Addressbook_BookViewListener__epv *e_book_view_listener_get_epv (void);
-
-#define E_BOOK_VIEW_LISTENER_TYPE (e_book_view_listener_get_type ())
-#define E_BOOK_VIEW_LISTENER(o) (GTK_CHECK_CAST ((o), E_BOOK_VIEW_LISTENER_TYPE, EBookViewListener))
-#define E_BOOK_VIEW_LISTENER_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_BOOK_VIEW_LISTENER_TYPE, EBookViewListenerClass))
-#define E_IS_BOOK_VIEW_LISTENER(o) (GTK_CHECK_TYPE ((o), E_BOOK_VIEW_LISTENER_TYPE))
-#define E_IS_BOOK_VIEW_LISTENER_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_BOOK_VIEW_LISTENER_TYPE))
-
-END_GNOME_DECLS
+G_END_DECLS
#endif /* ! __E_BOOK_VIEW_LISTENER_H__ */
diff --git a/addressbook/backend/ebook/e-book-view.c b/addressbook/backend/ebook/e-book-view.c
index 3dd5f4c703..47f8575b8f 100644
--- a/addressbook/backend/ebook/e-book-view.c
+++ b/addressbook/backend/ebook/e-book-view.c
@@ -9,16 +9,15 @@
*/
#include <config.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkmarshal.h>
#include "addressbook.h"
#include "e-card-cursor.h"
#include "e-book-view-listener.h"
#include "e-book-view.h"
#include "e-book.h"
+#include "e-book-marshal.h"
-GtkObjectClass *e_book_view_parent_class;
+static GObjectClass *parent_class;
struct _EBookViewPrivate {
GNOME_Evolution_Addressbook_BookView corba_book_view;
@@ -57,10 +56,10 @@ e_book_view_do_added_event (EBookView *book_view,
if (book_view->priv->book)
g_list_foreach (resp->cards, add_book_iterator, book_view->priv->book);
- gtk_signal_emit (GTK_OBJECT (book_view), e_book_view_signals [CARD_ADDED],
- resp->cards);
+ g_signal_emit (book_view, e_book_view_signals [CARD_ADDED], 0,
+ resp->cards);
- g_list_foreach (resp->cards, (GFunc) gtk_object_unref, NULL);
+ g_list_foreach (resp->cards, (GFunc) g_object_unref, NULL);
g_list_free (resp->cards);
}
@@ -71,10 +70,10 @@ e_book_view_do_modified_event (EBookView *book_view,
if (book_view->priv->book)
g_list_foreach (resp->cards, add_book_iterator, book_view->priv->book);
- gtk_signal_emit (GTK_OBJECT (book_view), e_book_view_signals [CARD_CHANGED],
- resp->cards);
+ g_signal_emit (book_view, e_book_view_signals [CARD_CHANGED], 0,
+ resp->cards);
- g_list_foreach (resp->cards, (GFunc) gtk_object_unref, NULL);
+ g_list_foreach (resp->cards, (GFunc) g_object_unref, NULL);
g_list_free (resp->cards);
}
@@ -82,8 +81,8 @@ static void
e_book_view_do_removed_event (EBookView *book_view,
EBookViewListenerResponse *resp)
{
- gtk_signal_emit (GTK_OBJECT (book_view), e_book_view_signals [CARD_REMOVED],
- resp->id);
+ g_signal_emit (book_view, e_book_view_signals [CARD_REMOVED], 0,
+ resp->id);
g_free(resp->id);
}
@@ -92,15 +91,16 @@ static void
e_book_view_do_complete_event (EBookView *book_view,
EBookViewListenerResponse *resp)
{
- gtk_signal_emit (GTK_OBJECT (book_view), e_book_view_signals [SEQUENCE_COMPLETE], resp->status);
+ g_signal_emit (book_view, e_book_view_signals [SEQUENCE_COMPLETE], 0,
+ resp->status);
}
static void
e_book_view_do_status_message_event (EBookView *book_view,
EBookViewListenerResponse *resp)
{
- gtk_signal_emit (GTK_OBJECT (book_view), e_book_view_signals [STATUS_MESSAGE],
- resp->message);
+ g_signal_emit (book_view, e_book_view_signals [STATUS_MESSAGE], 0,
+ resp->message);
g_free(resp->message);
}
@@ -170,8 +170,8 @@ e_book_view_construct (EBookView *book_view, GNOME_Evolution_Addressbook_BookVie
* Create our local BookListener interface.
*/
book_view->priv->listener = listener;
- book_view->priv->responses_queued_id = gtk_signal_connect (GTK_OBJECT (book_view->priv->listener), "responses_queued",
- e_book_view_check_listener_queue, book_view);
+ book_view->priv->responses_queued_id = g_signal_connect (book_view->priv->listener, "responses_queued",
+ G_CALLBACK (e_book_view_check_listener_queue), book_view);
bonobo_object_ref(BONOBO_OBJECT(book_view->priv->listener));
@@ -186,10 +186,10 @@ e_book_view_new (GNOME_Evolution_Addressbook_BookView corba_book_view, EBookView
{
EBookView *book_view;
- book_view = gtk_type_new (E_BOOK_VIEW_TYPE);
+ book_view = g_object_new (E_TYPE_BOOK_VIEW, NULL);
if (! e_book_view_construct (book_view, corba_book_view, listener)) {
- gtk_object_unref (GTK_OBJECT (book_view));
+ g_object_unref (book_view);
return NULL;
}
@@ -204,7 +204,7 @@ e_book_view_set_book (EBookView *book_view, EBook *book)
g_return_if_fail (book_view->priv->book == NULL);
book_view->priv->book = book;
- gtk_object_ref (GTK_OBJECT (book));
+ g_object_ref (book);
}
void
@@ -226,13 +226,13 @@ e_book_view_init (EBookView *book_view)
}
static void
-e_book_view_destroy (GtkObject *object)
+e_book_view_dispose (GObject *object)
{
EBookView *book_view = E_BOOK_VIEW (object);
CORBA_Environment ev;
if (book_view->priv->book) {
- gtk_object_unref (GTK_OBJECT (book_view->priv->book));
+ g_object_unref (book_view->priv->book);
}
if (book_view->priv->corba_book_view) {
@@ -249,103 +249,99 @@ e_book_view_destroy (GtkObject *object)
if (book_view->priv->listener) {
if (book_view->priv->responses_queued_id)
- gtk_signal_disconnect(GTK_OBJECT(book_view->priv->listener),
- book_view->priv->responses_queued_id);
+ g_signal_handler_disconnect(book_view->priv->listener,
+ book_view->priv->responses_queued_id);
e_book_view_listener_stop (book_view->priv->listener);
bonobo_object_unref (BONOBO_OBJECT(book_view->priv->listener));
}
g_free (book_view->priv);
- if (GTK_OBJECT_CLASS (e_book_view_parent_class)->destroy)
- GTK_OBJECT_CLASS (e_book_view_parent_class)->destroy (object);
+ G_OBJECT_CLASS(parent_class)->dispose (object);
}
static void
e_book_view_class_init (EBookViewClass *klass)
{
- GtkObjectClass *object_class = (GtkObjectClass *) klass;
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
- e_book_view_parent_class = gtk_type_class (gtk_object_get_type ());
+ parent_class = g_type_class_ref (G_TYPE_OBJECT);
e_book_view_signals [CARD_CHANGED] =
- gtk_signal_new ("card_changed",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EBookViewClass, card_changed),
- gtk_marshal_NONE__POINTER,
- GTK_TYPE_NONE, 1,
- GTK_TYPE_POINTER);
+ g_signal_new ("card_changed",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EBookViewClass, card_changed),
+ NULL, NULL,
+ e_book_marshal_NONE__POINTER,
+ G_TYPE_NONE, 1,
+ G_TYPE_POINTER);
e_book_view_signals [CARD_ADDED] =
- gtk_signal_new ("card_added",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EBookViewClass, card_added),
- gtk_marshal_NONE__STRING,
- GTK_TYPE_NONE, 1,
- GTK_TYPE_STRING);
+ g_signal_new ("card_added",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EBookViewClass, card_added),
+ NULL, NULL,
+ e_book_marshal_NONE__STRING,
+ G_TYPE_NONE, 1,
+ G_TYPE_STRING);
e_book_view_signals [CARD_REMOVED] =
- gtk_signal_new ("card_removed",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EBookViewClass, card_removed),
- gtk_marshal_NONE__POINTER,
- GTK_TYPE_NONE, 1,
- GTK_TYPE_POINTER);
+ g_signal_new ("card_removed",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EBookViewClass, card_removed),
+ NULL, NULL,
+ e_book_marshal_NONE__POINTER,
+ G_TYPE_NONE, 1,
+ G_TYPE_POINTER);
e_book_view_signals [SEQUENCE_COMPLETE] =
- gtk_signal_new ("sequence_complete",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EBookViewClass, sequence_complete),
- gtk_marshal_NONE__ENUM,
- GTK_TYPE_NONE, 1,
- GTK_TYPE_ENUM);
+ g_signal_new ("sequence_complete",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EBookViewClass, sequence_complete),
+ NULL, NULL,
+ e_book_marshal_NONE__ENUM,
+ G_TYPE_NONE, 1,
+ G_TYPE_ENUM);
e_book_view_signals [STATUS_MESSAGE] =
- gtk_signal_new ("status_message",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EBookViewClass, status_message),
- gtk_marshal_NONE__STRING,
- GTK_TYPE_NONE, 1,
- GTK_TYPE_STRING);
-
- gtk_object_class_add_signals (object_class, e_book_view_signals,
- LAST_SIGNAL);
-
- klass->card_changed = NULL;
- klass->card_added = NULL;
- klass->card_removed = NULL;
- klass->sequence_complete = NULL;
- klass->status_message = NULL;
-
- object_class->destroy = e_book_view_destroy;
+ g_signal_new ("status_message",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EBookViewClass, status_message),
+ NULL, NULL,
+ e_book_marshal_NONE__STRING,
+ G_TYPE_NONE, 1,
+ G_TYPE_STRING);
+
+ object_class->dispose = e_book_view_dispose;
}
/**
* e_book_view_get_type:
*/
-GtkType
+GType
e_book_view_get_type (void)
{
- static GtkType type = 0;
+ static GType type = 0;
if (! type) {
- GtkTypeInfo info = {
- "EBookView",
- sizeof (EBookView),
+ GTypeInfo info = {
sizeof (EBookViewClass),
- (GtkClassInitFunc) e_book_view_class_init,
- (GtkObjectInitFunc) e_book_view_init,
- NULL, /* reserved 1 */
- NULL, /* reserved 2 */
- (GtkClassInitFunc) NULL
+ NULL, /* base_class_init */
+ NULL, /* base_class_finalize */
+ (GClassInitFunc) e_book_view_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (EBookView),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) e_book_view_init
};
- type = gtk_type_unique (gtk_object_get_type (), &info);
+ type = g_type_register_static (G_TYPE_OBJECT, "EBookView", &info, 0);
}
return type;
diff --git a/addressbook/backend/ebook/e-book-view.h b/addressbook/backend/ebook/e-book-view.h
index 2e055ddec9..98eee4cde3 100644
--- a/addressbook/backend/ebook/e-book-view.h
+++ b/addressbook/backend/ebook/e-book-view.h
@@ -11,12 +11,19 @@
#ifndef __E_BOOK_VIEW_H__
#define __E_BOOK_VIEW_H__
-#include <libgnome/gnome-defs.h>
-
+#include <glib.h>
+#include <glib-object.h>
#include <ebook/e-card.h>
#include <ebook/e-book-view-listener.h>
-BEGIN_GNOME_DECLS
+#define E_TYPE_BOOK_VIEW (e_book_view_get_type ())
+#define E_BOOK_VIEW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_BOOK_VIEW, EBookView))
+#define E_BOOK_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_BOOK_VIEW, EBookViewClass))
+#define E_IS_BOOK_VIEW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_BOOK_VIEW))
+#define E_IS_BOOK_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_BOOK_VIEW))
+#define E_BOOK_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_BOOK_VIEW, EBookViewClass))
+
+G_BEGIN_DECLS
typedef struct _EBookView EBookView;
typedef struct _EBookViewClass EBookViewClass;
@@ -25,12 +32,12 @@ typedef struct _EBookViewPrivate EBookViewPrivate;
struct _EBook; /* Forward reference */
struct _EBookView {
- GtkObject parent;
+ GObject parent;
EBookViewPrivate *priv;
};
struct _EBookViewClass {
- GtkObjectClass parent;
+ GObjectClass parent;
/*
* Signals.
@@ -45,18 +52,12 @@ struct _EBookViewClass {
/* Creating a new addressbook. */
EBookView *e_book_view_new (GNOME_Evolution_Addressbook_BookView corba_book_view, EBookViewListener *listener);
-GtkType e_book_view_get_type (void);
+GType e_book_view_get_type (void);
void e_book_view_set_book (EBookView *book_view, struct _EBook *book);
void e_book_view_stop (EBookView *book_view);
-#define E_BOOK_VIEW_TYPE (e_book_view_get_type ())
-#define E_BOOK_VIEW(o) (GTK_CHECK_CAST ((o), E_BOOK_VIEW_TYPE, EBookView))
-#define E_BOOK_VIEW_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_BOOK_VIEW_TYPE, EBookViewClass))
-#define E_IS_BOOK_VIEW(o) (GTK_CHECK_TYPE ((o), E_BOOK_VIEW_TYPE))
-#define E_IS_BOOK_VIEW_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_BOOK_VIEW_TYPE))
-
-END_GNOME_DECLS
+G_END_DECLS
#endif /* ! __E_BOOK_VIEW_H__ */
diff --git a/addressbook/backend/ebook/e-book.c b/addressbook/backend/ebook/e-book.c
index d211496261..fe8f90cee7 100644
--- a/addressbook/backend/ebook/e-book.c
+++ b/addressbook/backend/ebook/e-book.c
@@ -9,18 +9,19 @@
*/
#include <config.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkmarshal.h>
-#include <libgnome/gnome-defs.h>
-#include <liboaf/liboaf.h>
+#include <glib.h>
+#include <glib-object.h>
+#include <string.h>
+#include <bonobo-activation/bonobo-activation.h>
#include "addressbook.h"
#include "e-card-cursor.h"
#include "e-book-listener.h"
#include "e-book.h"
+#include "e-book-marshal.h"
#include "e-util/e-component-listener.h"
-GtkObjectClass *e_book_parent_class;
+static GObjectClass *parent_class;
#define CARDSERVER_OAF_ID "OAFIID:GNOME_Evolution_Wombat_ServerFactory"
@@ -51,6 +52,8 @@ struct _EBookPrivate {
guint op_tag;
gchar *uri;
+
+ gulong died_signal;
};
enum {
@@ -234,7 +237,7 @@ e_book_do_response_get_vcard (EBook *book,
((EBookCardCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure);
}
- gtk_object_unref(GTK_OBJECT(card));
+ g_object_unref(card);
} else {
((EBookCursorCallback) op->cb) (book, resp->status, NULL, op->closure);
}
@@ -286,7 +289,7 @@ e_book_do_response_get_cursor (EBook *book,
CORBA_exception_free (&ev);
- gtk_object_unref(GTK_OBJECT(cursor));
+ g_object_unref(cursor);
} else {
((EBookCursorCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure);
}
@@ -339,7 +342,7 @@ e_book_do_response_get_view (EBook *book,
CORBA_exception_free (&ev);
- gtk_object_unref(GTK_OBJECT(book_view));
+ g_object_unref(book_view);
} else {
e_book_view_listener_stop (op->listener);
((EBookBookViewCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure);
@@ -390,7 +393,7 @@ e_book_do_response_get_changes (EBook *book,
CORBA_exception_free (&ev);
- gtk_object_unref(GTK_OBJECT(book_view));
+ g_object_unref(book_view);
} else {
e_book_view_listener_stop (op->listener);
((EBookBookViewCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure);
@@ -405,7 +408,7 @@ backend_died_cb (EComponentListener *cl, gpointer user_data)
EBook *book = user_data;
book->priv->load_state = URINotLoaded;
- gtk_signal_emit (GTK_OBJECT (book), e_book_signals [BACKEND_DIED]);
+ g_signal_emit (book, e_book_signals [BACKEND_DIED], 0);
}
static void
@@ -418,9 +421,11 @@ e_book_do_response_open (EBook *book,
book->priv->corba_book = resp->book;
book->priv->load_state = URILoaded;
+#if PENDING_PORT_WORK
book->priv->comp_listener = e_component_listener_new (book->priv->corba_book, 0);
- gtk_signal_connect (GTK_OBJECT (book->priv->comp_listener), "component_died",
- GTK_SIGNAL_FUNC (backend_died_cb), book);
+ book->priv->died_signal = g_signal_connect (book->priv->comp_listener, "component_died",
+ G_CALLBACK (backend_died_cb), book);
+#endif
}
op = e_book_pop_op (book);
@@ -440,8 +445,8 @@ static void
e_book_do_progress_event (EBook *book,
EBookListenerResponse *resp)
{
- gtk_signal_emit (GTK_OBJECT (book), e_book_signals [OPEN_PROGRESS],
- resp->msg, resp->percent);
+ g_signal_emit (book, e_book_signals [OPEN_PROGRESS], 0,
+ resp->msg, resp->percent);
g_free (resp->msg);
}
@@ -450,16 +455,16 @@ static void
e_book_do_link_event (EBook *book,
EBookListenerResponse *resp)
{
- gtk_signal_emit (GTK_OBJECT (book), e_book_signals [LINK_STATUS],
- resp->connected);
+ g_signal_emit (book, e_book_signals [LINK_STATUS], 0,
+ resp->connected);
}
static void
e_book_do_writable_event (EBook *book,
EBookListenerResponse *resp)
{
- gtk_signal_emit (GTK_OBJECT (book), e_book_signals [WRITABLE_STATUS],
- resp->writable);
+ g_signal_emit (book, e_book_signals [WRITABLE_STATUS], 0,
+ resp->writable);
}
static void
@@ -483,7 +488,7 @@ e_book_do_response_get_supported_fields (EBook *book,
((EBookFieldsCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure);
}
- gtk_object_unref(GTK_OBJECT(resp->fields));
+ g_object_unref(resp->fields);
e_book_op_free (op);
}
@@ -631,7 +636,7 @@ static gboolean
activate_factories_for_uri (EBook *book, const char *uri)
{
CORBA_Environment ev;
- OAF_ServerInfoList *info_list = NULL;
+ Bonobo_ServerInfoList *info_list = NULL;
int i;
char *protocol, *query, *colon;
gboolean retval = FALSE;
@@ -649,10 +654,10 @@ activate_factories_for_uri (EBook *book, const char *uri)
CORBA_exception_init (&ev);
- info_list = oaf_query (query, NULL, &ev);
+ info_list = bonobo_activation_query (query, NULL, &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("Eeek! Cannot perform OAF query for book factories.");
+ g_warning ("Eeek! Cannot perform bonobo-activation query for book factories.");
CORBA_exception_free (&ev);
goto shutdown;
}
@@ -666,12 +671,12 @@ activate_factories_for_uri (EBook *book, const char *uri)
CORBA_exception_free (&ev);
for (i = 0; i < info_list->_length; i ++) {
- const OAF_ServerInfo *info;
+ const Bonobo_ServerInfo *info;
GNOME_Evolution_Addressbook_BookFactory factory;
info = info_list->_buffer + i;
- factory = oaf_activate_from_id (info->iid, 0, NULL, NULL);
+ factory = bonobo_activation_activate_from_id (info->iid, 0, NULL, NULL);
if (factory == CORBA_OBJECT_NIL)
g_warning ("e_book_construct: Could not obtain a handle "
@@ -735,8 +740,8 @@ e_book_load_uri (EBook *book,
return FALSE;
}
- gtk_signal_connect (GTK_OBJECT (book->priv->listener), "responses_queued",
- e_book_check_listener_queue, book);
+ g_signal_connect (book->priv->listener, "responses_queued",
+ G_CALLBACK (e_book_check_listener_queue), book);
load_uri_data = g_new (EBookLoadURIData, 1);
load_uri_data->open_response = open_response;
@@ -886,10 +891,10 @@ e_book_new (void)
{
EBook *book;
- book = gtk_type_new (E_BOOK_TYPE);
+ book = g_object_new (E_TYPE_BOOK, NULL);
if (! e_book_construct (book)) {
- gtk_object_unref (GTK_OBJECT (book));
+ g_object_unref (book);
return NULL;
}
@@ -1084,9 +1089,9 @@ e_book_add_card (EBook *book,
g_free (vcard);
if (card->book && card->book != book)
- gtk_object_unref (GTK_OBJECT (card->book));
+ g_object_unref (card->book);
card->book = book;
- gtk_object_ref (GTK_OBJECT (card->book));
+ g_object_ref (card->book);
return retval;
}
@@ -1167,9 +1172,9 @@ e_book_commit_card (EBook *book,
g_free (vcard);
if (card->book && card->book != book)
- gtk_object_unref (GTK_OBJECT (card->book));
+ g_object_unref (card->book);
card->book = book;
- gtk_object_ref (GTK_OBJECT (card->book));
+ g_object_ref (card->book);
return retval;
}
@@ -1471,7 +1476,7 @@ e_book_init (EBook *book)
}
static void
-e_book_destroy (GtkObject *object)
+e_book_dispose (GObject *object)
{
EBook *book = E_BOOK (object);
CORBA_Environment ev;
@@ -1493,8 +1498,8 @@ e_book_destroy (GtkObject *object)
}
if (book->priv->comp_listener) {
- gtk_signal_disconnect_by_data (GTK_OBJECT (book->priv->comp_listener), book);
- gtk_object_unref (GTK_OBJECT (book->priv->comp_listener));
+ g_signal_handler_disconnect (book->priv->comp_listener, book->priv->died_signal);
+ g_object_unref (book->priv->comp_listener);
book->priv->comp_listener = NULL;
}
@@ -1502,69 +1507,70 @@ e_book_destroy (GtkObject *object)
g_free (book->priv);
- GTK_OBJECT_CLASS (e_book_parent_class)->destroy (object);
+ G_OBJECT_CLASS (parent_class)->dispose (object);
}
static void
e_book_class_init (EBookClass *klass)
{
- GtkObjectClass *object_class = (GtkObjectClass *) klass;
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
- e_book_parent_class = gtk_type_class (gtk_object_get_type ());
+ parent_class = g_type_class_ref (G_TYPE_OBJECT);
e_book_signals [LINK_STATUS] =
- gtk_signal_new ("link_status",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EBookClass, link_status),
- gtk_marshal_NONE__BOOL,
- GTK_TYPE_NONE, 1,
- GTK_TYPE_BOOL);
+ g_signal_new ("link_status",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EBookClass, link_status),
+ NULL, NULL,
+ e_book_marshal_NONE__BOOL,
+ G_TYPE_NONE, 1,
+ G_TYPE_BOOLEAN);
e_book_signals [WRITABLE_STATUS] =
- gtk_signal_new ("writable_status",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EBookClass, 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 (EBookClass, writable_status),
+ NULL, NULL,
+ e_book_marshal_NONE__BOOL,
+ G_TYPE_NONE, 1,
+ G_TYPE_BOOLEAN);
e_book_signals [BACKEND_DIED] =
- gtk_signal_new ("backend_died",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EBookClass, backend_died),
- gtk_marshal_NONE__NONE,
- GTK_TYPE_NONE, 0);
-
- gtk_object_class_add_signals (object_class, e_book_signals,
- LAST_SIGNAL);
-
- object_class->destroy = e_book_destroy;
+ g_signal_new ("backend_died",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EBookClass, backend_died),
+ NULL, NULL,
+ e_book_marshal_NONE__NONE,
+ G_TYPE_NONE, 0);
+
+ object_class->dispose = e_book_dispose;
}
/**
* e_book_get_type:
*/
-GtkType
+GType
e_book_get_type (void)
{
- static GtkType type = 0;
+ static GType type = 0;
if (! type) {
- GtkTypeInfo info = {
- "EBook",
- sizeof (EBook),
+ GTypeInfo info = {
sizeof (EBookClass),
- (GtkClassInitFunc) e_book_class_init,
- (GtkObjectInitFunc) e_book_init,
- NULL, /* reserved 1 */
- NULL, /* reserved 2 */
- (GtkClassInitFunc) NULL
+ NULL, /* base_class_init */
+ NULL, /* base_class_finalize */
+ (GClassInitFunc) e_book_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (EBook),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) e_book_init
};
- type = gtk_type_unique (gtk_object_get_type (), &info);
+ type = g_type_register_static (G_TYPE_OBJECT, "EBook", &info, 0);
}
return type;
diff --git a/addressbook/backend/ebook/e-book.h b/addressbook/backend/ebook/e-book.h
index be90f52c04..c7b8a100e8 100644
--- a/addressbook/backend/ebook/e-book.h
+++ b/addressbook/backend/ebook/e-book.h
@@ -11,26 +11,34 @@
#ifndef __E_BOOK_H__
#define __E_BOOK_H__
-#include <libgnome/gnome-defs.h>
+#include <glib.h>
+#include <glib-object.h>
#include <ebook/e-card.h>
#include <ebook/e-card-cursor.h>
#include <ebook/e-book-view.h>
#include <ebook/e-book-types.h>
-BEGIN_GNOME_DECLS
+#define E_TYPE_BOOK (e_book_get_type ())
+#define E_BOOK(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_BOOK, EBook))
+#define E_BOOK_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), E_TYPE_BOOK, EBookClass))
+#define E_IS_BOOK(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_BOOK))
+#define E_IS_BOOK_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_BOOK))
+#define E_BOOK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_BOOK, EBookClass))
+
+G_BEGIN_DECLS
typedef struct _EBook EBook;
typedef struct _EBookClass EBookClass;
typedef struct _EBookPrivate EBookPrivate;
struct _EBook {
- GtkObject parent;
+ GObject parent;
EBookPrivate *priv;
};
struct _EBookClass {
- GtkObjectClass parent;
+ GObjectClass parent;
/*
* Signals.
@@ -145,14 +153,8 @@ void e_book_cancel (EBook *book,
/* Getting the name of the repository. */
char *e_book_get_name (EBook *book);
-GtkType e_book_get_type (void);
-
-#define E_BOOK_TYPE (e_book_get_type ())
-#define E_BOOK(o) (GTK_CHECK_CAST ((o), E_BOOK_TYPE, EBook))
-#define E_BOOK_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_BOOK_TYPE, EBookClass))
-#define E_IS_BOOK(o) (GTK_CHECK_TYPE ((o), E_BOOK_TYPE))
-#define E_IS_BOOK_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_BOOK_TYPE))
+GType e_book_get_type (void);
-END_GNOME_DECLS
+G_END_DECLS
#endif /* ! __E_BOOK_H__ */
diff --git a/addressbook/backend/ebook/e-card-compare.c b/addressbook/backend/ebook/e-card-compare.c
index b8866e7e81..7b6c6f0823 100644
--- a/addressbook/backend/ebook/e-card-compare.c
+++ b/addressbook/backend/ebook/e-card-compare.c
@@ -26,7 +26,6 @@
#include <config.h>
#include <ctype.h>
-#include <gal/unicode/gunicode.h>
#include "e-book-util.h"
#include "e-card-compare.h"
@@ -80,7 +79,28 @@ static gchar *name_synonyms[][2] = {
/* We should add soundex here. */
{ NULL, NULL }
};
-
+
+static int
+utf8_casefold_collate_len (const gchar *str1, const gchar *str2, int len)
+{
+ gchar *s1 = g_utf8_casefold(str1, len);
+ gchar *s2 = g_utf8_casefold(str2, len);
+ int rv;
+
+ rv = g_utf8_collate (s1, s2);
+
+ g_free (s1);
+ g_free (s2);
+
+ return rv;
+}
+
+static int
+utf8_casefold_collate (const gchar *str1, const gchar *str2)
+{
+ return utf8_casefold_collate_len (str1, str2, -1);
+}
+
static gboolean
name_fragment_match (const gchar *a, const gchar *b, gboolean strict)
{
@@ -102,7 +122,7 @@ name_fragment_match (const gchar *a, const gchar *b, gboolean strict)
len = MIN (g_utf8_strlen (a, -1), g_utf8_strlen (b, -1));
}
- return !g_utf8_strncasecmp (a, b, len);
+ return !utf8_casefold_collate_len (a, b, len);
}
static gboolean
@@ -119,12 +139,12 @@ name_fragment_match_with_synonyms (const gchar *a, const gchar *b, gboolean stri
/* Check for nicknames. Yes, the linear search blows. */
for (i=0; name_synonyms[i][0]; ++i) {
- if (!g_utf8_strcasecmp (name_synonyms[i][0], a)
- && !g_utf8_strcasecmp (name_synonyms[i][1], b))
+ if (!utf8_casefold_collate (name_synonyms[i][0], a)
+ && !utf8_casefold_collate (name_synonyms[i][1], b))
return TRUE;
- if (!g_utf8_strcasecmp (name_synonyms[i][0], b)
- && !g_utf8_strcasecmp (name_synonyms[i][1], a))
+ if (!utf8_casefold_collate (name_synonyms[i][0], b)
+ && !utf8_casefold_collate (name_synonyms[i][1], a))
return TRUE;
}
@@ -221,7 +241,7 @@ e_card_compare_name_to_string_full (ECard *card, const gchar *str, gboolean allo
if (familyv && this_part_match == E_CARD_MATCH_PART_NONE) {
for (j = 0; familyv[j]; ++j) {
if (allow_partial_matches ? name_fragment_match_with_synonyms (familyv[j], namev[i], allow_partial_matches)
- : !g_utf8_strcasecmp (familyv[j], namev[i])) {
+ : !utf8_casefold_collate (familyv[j], namev[i])) {
this_part_match = E_CARD_MATCH_PART_FAMILY_NAME;
@@ -310,7 +330,7 @@ e_card_compare_name (ECard *card1, ECard *card2)
if (a->family && b->family) {
++possible;
/* We don't allow "loose matching" (i.e. John vs. Jon) on family names */
- if (! g_utf8_strcasecmp (a->family, b->family)) {
+ if (! utf8_casefold_collate (a->family, b->family)) {
++matches;
family_match = TRUE;
}
@@ -464,8 +484,8 @@ e_card_compare_email (ECard *card1, ECard *card2)
e_iterator_next (i1);
}
- gtk_object_unref (GTK_OBJECT (i1));
- gtk_object_unref (GTK_OBJECT (i2));
+ g_object_unref (i1);
+ g_object_unref (i2);
return match;
}
@@ -522,11 +542,11 @@ static void
match_search_info_free (MatchSearchInfo *info)
{
if (info) {
- gtk_object_unref (GTK_OBJECT (info->card));
+ g_object_unref (info->card);
/* This should already have been deallocated, but just in case... */
if (info->avoid) {
- g_list_foreach (info->avoid, (GFunc) gtk_object_unref, NULL);
+ g_list_foreach (info->avoid, (GFunc) g_object_unref, NULL);
g_list_free (info->avoid);
info->avoid = NULL;
}
@@ -663,7 +683,7 @@ e_card_locate_match (ECard *card, ECardMatchQueryCallback cb, gpointer closure)
info = g_new (MatchSearchInfo, 1);
info->card = card;
- gtk_object_ref (GTK_OBJECT (card));
+ g_object_ref (card);
info->cb = cb;
info->closure = closure;
info->avoid = NULL;
@@ -692,11 +712,11 @@ e_card_locate_match_full (EBook *book, ECard *card, GList *avoid, ECardMatchQuer
info = g_new (MatchSearchInfo, 1);
info->card = card;
- gtk_object_ref (GTK_OBJECT (card));
+ g_object_ref (card);
info->cb = cb;
info->closure = closure;
info->avoid = g_list_copy (avoid);
- g_list_foreach (info->avoid, (GFunc) gtk_object_ref, NULL);
+ g_list_foreach (info->avoid, (GFunc) g_object_ref, NULL);
if (book)
use_common_book_cb (book, info);
diff --git a/addressbook/backend/ebook/e-card-cursor.c b/addressbook/backend/ebook/e-card-cursor.c
index 171f83d736..4c96338a52 100644
--- a/addressbook/backend/ebook/e-card-cursor.c
+++ b/addressbook/backend/ebook/e-card-cursor.c
@@ -7,7 +7,6 @@
*/
#include <config.h>
-#include <gtk/gtkobject.h>
#include "addressbook.h"
#include "e-card-cursor.h"
@@ -18,13 +17,13 @@ struct _ECardCursorPrivate {
/*
* A pointer to our parent object class
*/
-static GtkObjectClass *parent_class;
+static GObjectClass *parent_class;
/*
- * Implemented GtkObject::destroy
+ * Implemented GObject::dispose
*/
static void
-e_card_cursor_destroy (GtkObject *object)
+e_card_cursor_dispose (GObject *object)
{
ECardCursor *cursor = E_CARD_CURSOR (object);
CORBA_Environment ev;
@@ -52,7 +51,7 @@ e_card_cursor_destroy (GtkObject *object)
if ( cursor->priv )
g_free ( cursor->priv );
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
+ G_OBJECT_CLASS (parent_class)->dispose (object);
}
/**
@@ -129,11 +128,11 @@ e_card_cursor_get_nth (ECardCursor *cursor,
static void
e_card_cursor_class_init (ECardCursorClass *klass)
{
- GtkObjectClass *object_class = (GtkObjectClass *) klass;
+ GObjectClass *object_class = (GObjectClass *) klass;
- parent_class = gtk_type_class (gtk_object_get_type ());
+ parent_class = g_type_class_ref (G_TYPE_OBJECT);
- object_class->destroy = e_card_cursor_destroy;
+ object_class->dispose = e_card_cursor_dispose;
}
static void
@@ -143,24 +142,25 @@ e_card_cursor_init (ECardCursor *cursor)
cursor->priv->corba_cursor = CORBA_OBJECT_NIL;
}
-GtkType
+GType
e_card_cursor_get_type (void)
{
- static GtkType type = 0;
+ static GType type = 0;
if (!type){
- GtkTypeInfo info = {
- "ECardCursor",
- sizeof (ECardCursor),
+ static const GTypeInfo info = {
sizeof (ECardCursorClass),
- (GtkClassInitFunc) e_card_cursor_class_init,
- (GtkObjectInitFunc) e_card_cursor_init,
- NULL, /* reserved 1 */
- NULL, /* reserved 2 */
- (GtkClassInitFunc) NULL
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) e_card_cursor_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (ECardCursor),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) e_card_cursor_init,
};
- type = gtk_type_unique (gtk_object_get_type (), &info);
+ type = g_type_register_static (G_TYPE_OBJECT, "ECardCursor", &info, 0);
}
return type;
@@ -209,7 +209,7 @@ e_card_cursor_construct (ECardCursor *cursor,
CORBA_exception_free (&ev);
/*
- * Success: return the GtkType we were given
+ * Success: return the GType we were given
*/
return cursor;
}
@@ -228,7 +228,7 @@ e_card_cursor_new (GNOME_Evolution_Addressbook_CardCursor corba_cursor)
{
ECardCursor *cursor;
- cursor = gtk_type_new (e_card_cursor_get_type ());
+ cursor = g_object_new (E_TYPE_CARD_CURSOR, NULL);
return e_card_cursor_construct (cursor,
corba_cursor);
diff --git a/addressbook/backend/ebook/e-card-cursor.h b/addressbook/backend/ebook/e-card-cursor.h
index d6e7625941..b8da39f023 100644
--- a/addressbook/backend/ebook/e-card-cursor.h
+++ b/addressbook/backend/ebook/e-card-cursor.h
@@ -10,24 +10,31 @@
#ifndef __E_CARD_CURSOR_H__
#define __E_CARD_CURSOR_H__
-#include <gtk/gtkobject.h>
-#include <libgnome/gnome-defs.h>
+#include <glib.h>
+#include <glib-object.h>
#include <ebook/addressbook.h>
#include <ebook/e-card.h>
-BEGIN_GNOME_DECLS
+#define E_TYPE_CARD_CURSOR (e_card_cursor_get_type ())
+#define E_CARD_CURSOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_CARD_CURSOR, ECardCursor))
+#define E_CARD_CURSOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_CARD_CURSOR, ECardCursorClass))
+#define E_IS_CARD_CURSOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_CARD_CURSOR))
+#define E_IS_CARD_CURSOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_CARD_CURSOR))
+#define E_CARD_CURSOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_CARD_CURSOR, ECardCursorClass))
+
+G_BEGIN_DECLS
typedef struct _ECardCursor ECardCursor;
typedef struct _ECardCursorPrivate ECardCursorPrivate;
typedef struct _ECardCursorClass ECardCursorClass;
struct _ECardCursor {
- GtkObject parent;
+ GObject parent;
ECardCursorPrivate *priv;
};
struct _ECardCursorClass {
- GtkObjectClass parent;
+ GObjectClass parent;
};
/* Creating a new addressbook. */
@@ -35,18 +42,12 @@ ECardCursor *e_card_cursor_new (GNOME_Evolution_Addressbook_CardCursor co
ECardCursor *e_card_cursor_construct (ECardCursor *cursor,
GNOME_Evolution_Addressbook_CardCursor corba_cursor);
-GtkType e_card_cursor_get_type (void);
+GType e_card_cursor_get_type (void);
/* Fetching cards. */
long e_card_cursor_get_length (ECardCursor *cursor);
ECard *e_card_cursor_get_nth (ECardCursor *cursor,
const long nth);
-#define E_CARD_CURSOR_TYPE (e_card_cursor_get_type ())
-#define E_CARD_CURSOR(o) (GTK_CHECK_CAST ((o), E_CARD_CURSOR_TYPE, ECardCursor))
-#define E_CARD_CURSOR_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_CARD_CURSOR_TYPE, ECardCursorClass))
-#define E_IS_CARD_CURSOR(o) (GTK_CHECK_TYPE ((o), E_CARD_CURSOR_TYPE))
-#define E_IS_CARD_CURSOR_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_CARD_CURSOR_TYPE))
-
-END_GNOME_DECLS
+G_END_DECLS
#endif /* ! __E_CARD_CURSOR_H__ */
diff --git a/addressbook/backend/ebook/e-card-simple.c b/addressbook/backend/ebook/e-card-simple.c
index 7f0dd263b4..9aa4638fb7 100644
--- a/addressbook/backend/ebook/e-card-simple.c
+++ b/addressbook/backend/ebook/e-card-simple.c
@@ -13,19 +13,19 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <gtk/gtkobject.h>
-#include <gal/util/e-unicode-i18n.h>
+#include <bonobo/bonobo-i18n.h>
#include <gal/util/e-util.h>
#include <libversit/vcc.h>
#include "e-card-simple.h"
-/* Object argument IDs */
+/* Object property IDs */
enum {
- ARG_0,
- ARG_CARD,
+ PROP_0,
+ PROP_CARD,
};
+static GObjectClass *parent_class;
typedef enum _ECardSimpleInternalType ECardSimpleInternalType;
typedef struct _ECardSimpleFieldData ECardSimpleFieldData;
@@ -114,9 +114,9 @@ static int field_data_count = sizeof (field_data) / sizeof (field_data[0]);
static void e_card_simple_init (ECardSimple *simple);
static void e_card_simple_class_init (ECardSimpleClass *klass);
-static void e_card_simple_destroy (GtkObject *object);
-static void e_card_simple_set_arg (GtkObject *object, GtkArg *arg, guint arg_id);
-static void e_card_simple_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
+static void e_card_simple_dispose (GObject *object);
+static void e_card_simple_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
+static void e_card_simple_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static void fill_in_info(ECardSimple *simple);
@@ -207,24 +207,25 @@ char *address_names[] = {
*
* Return value: The type ID of the &ECardSimple class.
**/
-GtkType
+GType
e_card_simple_get_type (void)
{
- static GtkType simple_type = 0;
+ static GType simple_type = 0;
if (!simple_type) {
- GtkTypeInfo simple_info = {
- "ECardSimple",
- sizeof (ECardSimple),
+ static const GTypeInfo simple_info = {
sizeof (ECardSimpleClass),
- (GtkClassInitFunc) e_card_simple_class_init,
- (GtkObjectInitFunc) e_card_simple_init,
- NULL, /* reserved_1 */
- NULL, /* reserved_2 */
- (GtkClassInitFunc) NULL
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) e_card_simple_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (ECardSimple),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) e_card_simple_init,
};
- simple_type = gtk_type_unique (gtk_object_get_type (), &simple_info);
+ simple_type = g_type_register_static (G_TYPE_OBJECT, "ECardSimple", &simple_info, 0);
}
return simple_type;
@@ -239,10 +240,10 @@ e_card_simple_get_type (void)
ECardSimple *
e_card_simple_new (ECard *card)
{
- ECardSimple *simple = E_CARD_SIMPLE(gtk_type_new(e_card_simple_get_type()));
- gtk_object_set(GTK_OBJECT(simple),
- "card", card,
- NULL);
+ ECardSimple *simple = g_object_new (E_TYPE_CARD_SIMPLE, NULL);
+ g_object_set(simple,
+ "card", card,
+ NULL);
return simple;
}
@@ -318,16 +319,22 @@ e_card_simple_get_vcard_assume_utf8 (ECardSimple *simple)
static void
e_card_simple_class_init (ECardSimpleClass *klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
+
+ object_class = G_OBJECT_CLASS(klass);
- object_class = GTK_OBJECT_CLASS(klass);
+ parent_class = g_type_class_ref (G_TYPE_OBJECT);
- gtk_object_add_arg_type ("ECardSimple::card",
- GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_CARD);
+ object_class->dispose = e_card_simple_dispose;
+ object_class->get_property = e_card_simple_get_property;
+ object_class->set_property = e_card_simple_set_property;
- object_class->destroy = e_card_simple_destroy;
- object_class->get_arg = e_card_simple_get_arg;
- object_class->set_arg = e_card_simple_set_arg;
+ g_object_class_install_property (object_class, PROP_CARD,
+ g_param_spec_object ("card",
+ _("ECard"),
+ /*_( */"XXX blurb" /*)*/,
+ E_TYPE_CARD,
+ G_PARAM_READWRITE));
}
/*
@@ -335,7 +342,7 @@ e_card_simple_class_init (ECardSimpleClass *klass)
*/
static void
-e_card_simple_destroy (GtkObject *object)
+e_card_simple_dispose (GObject *object)
{
ECardSimple *simple;
int i;
@@ -343,7 +350,7 @@ e_card_simple_destroy (GtkObject *object)
simple = E_CARD_SIMPLE (object);
if (simple->card)
- gtk_object_unref(GTK_OBJECT(simple->card));
+ g_object_unref(simple->card);
g_list_foreach(simple->temp_fields, (GFunc) g_free, NULL);
g_list_free(simple->temp_fields);
simple->temp_fields = NULL;
@@ -356,52 +363,61 @@ e_card_simple_destroy (GtkObject *object)
e_card_address_label_unref(simple->address[i]);
for(i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++)
e_card_delivery_address_unref(simple->delivery[i]);
+
+ G_OBJECT_CLASS (parent_class)->dispose (object);
}
/* Set_arg handler for the simple */
static void
-e_card_simple_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
+e_card_simple_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
ECardSimple *simple;
simple = E_CARD_SIMPLE (object);
- switch (arg_id) {
- case ARG_CARD:
+ switch (prop_id) {
+ case PROP_CARD:
if (simple->card)
- gtk_object_unref(GTK_OBJECT(simple->card));
+ g_object_unref(simple->card);
g_list_foreach(simple->temp_fields, (GFunc) g_free, NULL);
g_list_free(simple->temp_fields);
simple->temp_fields = NULL;
- if (GTK_VALUE_OBJECT(*arg))
- simple->card = E_CARD(GTK_VALUE_OBJECT(*arg));
+ if (g_value_get_pointer (value))
+ simple->card = E_CARD(g_value_get_pointer (value));
else
simple->card = NULL;
if(simple->card)
- gtk_object_ref(GTK_OBJECT(simple->card));
+ g_object_ref(simple->card);
fill_in_info(simple);
break;
default:
- return;
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
}
}
/* Get_arg handler for the simple */
static void
-e_card_simple_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
+e_card_simple_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
ECardSimple *simple;
simple = E_CARD_SIMPLE (object);
- switch (arg_id) {
- case ARG_CARD:
+ switch (prop_id) {
+ case PROP_CARD:
e_card_simple_sync_card(simple);
- GTK_VALUE_OBJECT (*arg) = (GtkObject *) simple->card;
+ g_value_set_pointer (value, simple->card);
break;
default:
- arg->type = GTK_TYPE_INVALID;
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@@ -443,12 +459,12 @@ fill_in_info(ECardSimple *simple)
EIterator *iterator;
- gtk_object_get(GTK_OBJECT(card),
- "address_label", &address_list,
- "address", &delivery_list,
- "phone", &phone_list,
- "email", &email_list,
- NULL);
+ g_object_get(card,
+ "address_label", &address_list,
+ "address", &delivery_list,
+ "phone", &phone_list,
+ "email", &email_list,
+ NULL);
for (i = 0; i < E_CARD_SIMPLE_PHONE_ID_LAST; i++) {
e_card_phone_unref(simple->phone[i]);
simple->phone[i] = NULL;
@@ -472,7 +488,7 @@ fill_in_info(ECardSimple *simple)
}
}
}
- gtk_object_unref(GTK_OBJECT(iterator));
+ g_object_unref(iterator);
for (i = 0; i < E_CARD_SIMPLE_EMAIL_ID_LAST; i++) {
g_free(simple->email[i]);
@@ -487,7 +503,7 @@ fill_in_info(ECardSimple *simple)
}
}
}
- gtk_object_unref(GTK_OBJECT(iterator));
+ g_object_unref(iterator);
for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++) {
e_card_address_label_unref(simple->address[i]);
@@ -502,7 +518,7 @@ fill_in_info(ECardSimple *simple)
}
}
}
- gtk_object_unref(GTK_OBJECT(iterator));
+ g_object_unref(iterator);
for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++) {
e_card_delivery_address_unref(simple->delivery[i]);
@@ -517,7 +533,7 @@ fill_in_info(ECardSimple *simple)
}
}
}
- gtk_object_unref(GTK_OBJECT(iterator));
+ g_object_unref(iterator);
e_card_free_empty_lists (card);
}
}
@@ -539,12 +555,12 @@ e_card_simple_sync_card(ECardSimple *simple)
EIterator *iterator;
- gtk_object_get(GTK_OBJECT(card),
- "address_label", &address_list,
- "address", &delivery_list,
- "phone", &phone_list,
- "email", &email_list,
- NULL);
+ g_object_get(card,
+ "address_label", &address_list,
+ "address", &delivery_list,
+ "phone", &phone_list,
+ "email", &email_list,
+ NULL);
for (iterator = e_list_get_iterator(phone_list); e_iterator_is_valid(iterator); e_iterator_next(iterator) ) {
int i;
@@ -584,7 +600,7 @@ e_card_simple_sync_card(ECardSimple *simple)
}
}
}
- gtk_object_unref(GTK_OBJECT(iterator));
+ g_object_unref(iterator);
for (i = 0; i < E_CARD_SIMPLE_PHONE_ID_LAST; i ++) {
if (simple->phone[i]) {
simple->phone[i]->flags = phone_correspondences[i];
@@ -610,7 +626,7 @@ e_card_simple_sync_card(ECardSimple *simple)
}
}
}
- gtk_object_unref(GTK_OBJECT(iterator));
+ g_object_unref(iterator);
for (i = 0; i < E_CARD_SIMPLE_EMAIL_ID_LAST; i ++) {
if (simple->email[i]) {
e_list_append(email_list, simple->email[i]);
@@ -639,7 +655,7 @@ e_card_simple_sync_card(ECardSimple *simple)
}
}
}
- gtk_object_unref(GTK_OBJECT(iterator));
+ g_object_unref(iterator);
for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i ++) {
if (simple->address[i]) {
simple->address[i]->flags &= ~E_CARD_ADDR_MASK;
@@ -670,7 +686,7 @@ e_card_simple_sync_card(ECardSimple *simple)
}
}
}
- gtk_object_unref(GTK_OBJECT(iterator));
+ g_object_unref(iterator);
for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i ++) {
if (simple->delivery[i]) {
simple->delivery[i]->flags &= ~E_CARD_ADDR_MASK;
@@ -769,17 +785,17 @@ char *e_card_simple_get (ECardSimple *simple,
switch(type) {
case E_CARD_SIMPLE_INTERNAL_TYPE_STRING:
if (simple->card) {
- gtk_object_get(GTK_OBJECT(simple->card),
- field_data[field].ecard_field, &string,
- NULL);
+ g_object_get(simple->card,
+ field_data[field].ecard_field, &string,
+ NULL);
return g_strdup(string);
} else
return NULL;
case E_CARD_SIMPLE_INTERNAL_TYPE_DATE:
if (simple->card) {
- gtk_object_get(GTK_OBJECT(simple->card),
- field_data[field].ecard_field, &date,
- NULL);
+ g_object_get(simple->card,
+ field_data[field].ecard_field, &date,
+ NULL);
if (date != NULL) {
char buf[26];
struct tm then;
@@ -817,9 +833,9 @@ char *e_card_simple_get (ECardSimple *simple,
case E_CARD_SIMPLE_INTERNAL_TYPE_BOOL:
if (simple->card) {
gboolean boole;
- gtk_object_get (GTK_OBJECT (simple->card),
- field_data[field].ecard_field, &boole,
- NULL);
+ g_object_get (simple->card,
+ field_data[field].ecard_field, &boole,
+ NULL);
if (boole)
return g_strdup("true");
else
@@ -833,19 +849,19 @@ char *e_card_simple_get (ECardSimple *simple,
if (simple->card) {
gboolean is_list;
- gtk_object_get(GTK_OBJECT(simple->card),
- "file_as", &string,
- NULL);
+ g_object_get(simple->card,
+ "file_as", &string,
+ NULL);
if (string && *string)
return g_strdup(string);
- gtk_object_get(GTK_OBJECT(simple->card),
- "full_name", &string,
- NULL);
+ g_object_get(simple->card,
+ "full_name", &string,
+ NULL);
if (string && *string)
return g_strdup(string);
- gtk_object_get(GTK_OBJECT(simple->card),
- "org", &string,
- NULL);
+ g_object_get(simple->card,
+ "org", &string,
+ NULL);
if (string && *string)
return g_strdup(string);
is_list = e_card_evolution_list (simple->card);
@@ -859,33 +875,33 @@ char *e_card_simple_get (ECardSimple *simple,
return NULL;
case E_CARD_SIMPLE_FIELD_FAMILY_NAME:
if (simple->card) {
- gtk_object_get (GTK_OBJECT(simple->card),
- "name", &name,
- NULL);
+ g_object_get (simple->card,
+ "name", &name,
+ NULL);
return g_strdup (name->family);
} else
return NULL;
case E_CARD_SIMPLE_FIELD_GIVEN_NAME:
if (simple->card) {
- gtk_object_get (GTK_OBJECT(simple->card),
- "name", &name,
- NULL);
+ g_object_get (simple->card,
+ "name", &name,
+ NULL);
return g_strdup (name->given);
} else
return NULL;
case E_CARD_SIMPLE_FIELD_ADDITIONAL_NAME:
if (simple->card) {
- gtk_object_get (GTK_OBJECT(simple->card),
- "name", &name,
- NULL);
+ g_object_get (simple->card,
+ "name", &name,
+ NULL);
return g_strdup (name->additional);
} else
return NULL;
case E_CARD_SIMPLE_FIELD_NAME_SUFFIX:
if (simple->card) {
- gtk_object_get (GTK_OBJECT(simple->card),
- "name", &name,
- NULL);
+ g_object_get (simple->card,
+ "name", &name,
+ NULL);
return g_strdup (name->suffix);
} else
return NULL;
@@ -961,9 +977,9 @@ file_as_get_style (ECardSimple *simple)
if (!company)
company = g_strdup("");
if (filestring) {
- gtk_object_get (GTK_OBJECT (simple->card),
- "name", &name,
- NULL);
+ g_object_get (simple->card,
+ "name", &name,
+ NULL);
if (!name) {
goto end;
@@ -999,9 +1015,9 @@ file_as_set_style(ECardSimple *simple, int style)
if (!company)
company = g_strdup("");
- gtk_object_get (GTK_OBJECT (simple->card),
- "name", &name,
- NULL);
+ g_object_get (simple->card,
+ "name", &name,
+ NULL);
if (name) {
string = name_to_style(name, company, style);
e_card_simple_set(simple, E_CARD_SIMPLE_FIELD_FILE_AS, string);
@@ -1024,17 +1040,17 @@ void e_card_simple_set (ECardSimple *simple,
case E_CARD_SIMPLE_FIELD_FULL_NAME:
case E_CARD_SIMPLE_FIELD_ORG:
style = file_as_get_style(simple);
- gtk_object_set(GTK_OBJECT(simple->card),
- field_data[field].ecard_field, data,
- NULL);
+ g_object_set(simple->card,
+ field_data[field].ecard_field, data,
+ NULL);
file_as_set_style(simple, style);
break;
default:
switch(type) {
case E_CARD_SIMPLE_INTERNAL_TYPE_STRING:
- gtk_object_set(GTK_OBJECT(simple->card),
- field_data[field].ecard_field, data,
- NULL);
+ g_object_set(simple->card,
+ field_data[field].ecard_field, data,
+ NULL);
break;
case E_CARD_SIMPLE_INTERNAL_TYPE_DATE:
break; /* FIXME!!!! */
@@ -1068,9 +1084,9 @@ void e_card_simple_set (ECardSimple *simple,
boole = FALSE;
else if (!strcasecmp (data, "false"))
boole = FALSE;
- gtk_object_set (GTK_OBJECT (simple->card),
- field_data[field].ecard_field, boole,
- NULL);
+ g_object_set (simple->card,
+ field_data[field].ecard_field, boole,
+ NULL);
}
break;
}
@@ -1110,7 +1126,7 @@ const char *e_card_simple_get_ecard_field (ECardSimple *simple,
const char *e_card_simple_get_name (ECardSimple *simple,
ECardSimpleField field)
{
- return U_(field_data[field].name);
+ return _(field_data[field].name);
}
gboolean
@@ -1141,7 +1157,7 @@ e_card_simple_get_allow_newlines (ECardSimple *simple,
const char *e_card_simple_get_short_name (ECardSimple *simple,
ECardSimpleField field)
{
- return U_(field_data[field].short_name);
+ return _(field_data[field].short_name);
}
void e_card_simple_arbitrary_foreach (ECardSimple *simple,
@@ -1151,9 +1167,9 @@ void e_card_simple_arbitrary_foreach (ECardSimple
if (simple->card) {
EList *list;
EIterator *iterator;
- gtk_object_get(GTK_OBJECT(simple->card),
- "arbitrary", &list,
- NULL);
+ g_object_get(simple->card,
+ "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);
if (callback)
@@ -1169,9 +1185,9 @@ const ECardArbitrary *e_card_simple_get_arbitrary (ECardSimple *sim
if (simple->card) {
EList *list;
EIterator *iterator;
- gtk_object_get(GTK_OBJECT(simple->card),
- "arbitrary", &list,
- NULL);
+ g_object_get(simple->card,
+ "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);
if (!strcasecmp(arbitrary->key, key))
@@ -1194,9 +1210,9 @@ void e_card_simple_set_arbitrary (ECardSimple *sim
EIterator *iterator;
simple->changed = TRUE;
- gtk_object_get(GTK_OBJECT(simple->card),
- "arbitrary", &list,
- NULL);
+ g_object_get(simple->card,
+ "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);
if (!strcasecmp(arbitrary->key, key)) {
@@ -1223,9 +1239,9 @@ e_card_simple_set_name (ECardSimple *simple, ECardName *name)
{
int style;
style = file_as_get_style(simple);
- gtk_object_set (GTK_OBJECT (simple->card),
- "name", name,
- NULL);
+ g_object_set (simple->card,
+ "name", name,
+ NULL);
file_as_set_style(simple, style);
}
diff --git a/addressbook/backend/ebook/e-card-simple.h b/addressbook/backend/ebook/e-card-simple.h
index 53c1d13164..9e77a43ae1 100644
--- a/addressbook/backend/ebook/e-card-simple.h
+++ b/addressbook/backend/ebook/e-card-simple.h
@@ -13,17 +13,18 @@
#define __E_CARD_SIMPLE_H__
#include <time.h>
-#include <gtk/gtk.h>
+#include <glib-object.h>
#include <stdio.h>
#include <ebook/e-card.h>
#include <ebook/e-card-types.h>
#include <e-util/e-list.h>
#define E_TYPE_CARD_SIMPLE (e_card_simple_get_type ())
-#define E_CARD_SIMPLE(obj) (GTK_CHECK_CAST ((obj), E_TYPE_CARD_SIMPLE, ECardSimple))
-#define E_CARD_SIMPLE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_CARD_SIMPLE, ECardSimpleClass))
-#define E_IS_CARD_SIMPLE(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_CARD_SIMPLE))
-#define E_IS_CARD_SIMPLE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_CARD_SIMPLE))
+#define E_CARD_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CARD_SIMPLE, ECardSimple))
+#define E_CARD_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CARD_SIMPLE, ECardSimpleClass))
+#define E_IS_CARD_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CARD_SIMPLE))
+#define E_IS_CARD_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_CARD_SIMPLE))
+#define E_CARD_SIMPLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_CARD_SIMPLE, ECardSimpleClass))
typedef enum _ECardSimplePhoneId ECardSimplePhoneId;
typedef enum _ECardSimpleEmailId ECardSimpleEmailId;
@@ -137,7 +138,7 @@ typedef struct _ECardSimple ECardSimple;
typedef struct _ECardSimpleClass ECardSimpleClass;
struct _ECardSimple {
- GtkObject object;
+ GObject object;
ECard *card;
GList *temp_fields;
@@ -151,7 +152,7 @@ struct _ECardSimple {
};
struct _ECardSimpleClass {
- GtkObjectClass parent_class;
+ GObjectClass parent_class;
};
typedef void (*ECardSimpleArbitraryCallback) (const ECardArbitrary *arbitrary, gpointer closure);
@@ -225,8 +226,7 @@ ECardSimpleField e_card_simple_map_phone_to_field (ECardSimplePho
ECardSimpleField e_card_simple_map_email_to_field (ECardSimpleEmailId email_id);
ECardSimpleField e_card_simple_map_address_to_field (ECardSimpleAddressId address_id);
-/* Standard Gtk function */
-GtkType e_card_simple_get_type (void);
+GType e_card_simple_get_type (void);
#endif /* ! __E_CARD_SIMPLE_H__ */
diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c
index 18f381713c..0419a6b885 100644
--- a/addressbook/backend/ebook/e-card.c
+++ b/addressbook/backend/ebook/e-card.c
@@ -12,7 +12,6 @@
#include "e-card.h"
-#include <gal/util/e-i18n.h>
#include <gal/widgets/e-unicode.h>
#include <ctype.h>
@@ -22,8 +21,7 @@
#include <time.h>
#include <math.h>
-#include <gtk/gtkobject.h>
-#include <bonobo/bonobo-object-client.h>
+#include <bonobo/bonobo-i18n.h>
#include <gal/util/e-util.h>
#include <libversit/vcc.h>
@@ -42,52 +40,54 @@
#define XEV_LIST_SHOW_ADDRESSES "X-EVOLUTION-LIST-SHOW_ADDRESSES"
#define XEV_RELATED_CONTACTS "X-EVOLUTION-RELATED_CONTACTS"
-/* Object argument IDs */
+/* Object property IDs */
enum {
- ARG_0,
- ARG_FILE_AS,
- ARG_FULL_NAME,
- ARG_NAME,
- ARG_ADDRESS,
- ARG_ADDRESS_LABEL,
- ARG_PHONE,
- ARG_EMAIL,
- ARG_BIRTH_DATE,
- ARG_URL,
- ARG_ORG,
- ARG_ORG_UNIT,
- ARG_OFFICE,
- ARG_TITLE,
- ARG_ROLE,
- ARG_MANAGER,
- ARG_ASSISTANT,
- ARG_NICKNAME,
- ARG_SPOUSE,
- ARG_ANNIVERSARY,
- ARG_MAILER,
- ARG_CALURI,
- ARG_FBURL,
- ARG_NOTE,
- ARG_RELATED_CONTACTS,
- ARG_CATEGORIES,
- ARG_CATEGORY_LIST,
- ARG_WANTS_HTML,
- ARG_WANTS_HTML_SET,
- ARG_EVOLUTION_LIST,
- ARG_EVOLUTION_LIST_SHOW_ADDRESSES,
- ARG_ARBITRARY,
- ARG_ID,
- ARG_LAST_USE,
- ARG_USE_SCORE,
+ PROP_0,
+ PROP_FILE_AS,
+ PROP_FULL_NAME,
+ PROP_NAME,
+ PROP_ADDRESS,
+ PROP_ADDRESS_LABEL,
+ PROP_PHONE,
+ PROP_EMAIL,
+ PROP_BIRTH_DATE,
+ PROP_URL,
+ PROP_ORG,
+ PROP_ORG_UNIT,
+ PROP_OFFICE,
+ PROP_TITLE,
+ PROP_ROLE,
+ PROP_MANAGER,
+ PROP_ASSISTANT,
+ PROP_NICKNAME,
+ PROP_SPOUSE,
+ PROP_ANNIVERSARY,
+ PROP_MAILER,
+ PROP_CALURI,
+ PROP_FBURL,
+ PROP_NOTE,
+ PROP_RELATED_CONTACTS,
+ PROP_CATEGORIES,
+ PROP_CATEGORY_LIST,
+ PROP_WANTS_HTML,
+ PROP_WANTS_HTML_SET,
+ PROP_EVOLUTION_LIST,
+ PROP_EVOLUTION_LIST_SHOW_ADDRESSES,
+ PROP_ARBITRARY,
+ PROP_ID,
+ PROP_LAST_USE,
+ PROP_USE_SCORE,
};
+static GObjectClass *parent_class;
+
static void parse(ECard *card, VObject *vobj, char *default_charset);
static void e_card_init (ECard *card);
static void e_card_class_init (ECardClass *klass);
-static void e_card_destroy (GtkObject *object);
-static void e_card_set_arg (GtkObject *object, GtkArg *arg, guint arg_id);
-static void e_card_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
+static void e_card_dispose (GObject *object);
+static void e_card_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
+static void e_card_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static void assign_string(VObject *vobj, char *default_charset, char **string);
@@ -180,24 +180,25 @@ struct {
*
* Return value: The type ID of the &ECard class.
**/
-GtkType
+GType
e_card_get_type (void)
{
- static GtkType card_type = 0;
+ static GType card_type = 0;
if (!card_type) {
- GtkTypeInfo card_info = {
- "ECard",
- sizeof (ECard),
+ static const GTypeInfo card_info = {
sizeof (ECardClass),
- (GtkClassInitFunc) e_card_class_init,
- (GtkObjectInitFunc) e_card_init,
- NULL, /* reserved_1 */
- NULL, /* reserved_2 */
- (GtkClassInitFunc) NULL
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) e_card_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (ECard),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) e_card_init,
};
- card_type = gtk_type_unique (gtk_object_get_type (), &card_info);
+ card_type = g_type_register_static (G_TYPE_OBJECT, "ECard", &card_info, 0);
}
return card_type;
@@ -206,7 +207,7 @@ e_card_get_type (void)
ECard *
e_card_new_with_default_charset (char *vcard, char *default_charset)
{
- ECard *card = E_CARD(gtk_type_new(e_card_get_type()));
+ ECard *card = g_object_new (E_TYPE_CARD, NULL);
VObject *vobj = Parse_MIME(vcard, strlen(vcard));
while(vobj) {
VObject *next;
@@ -245,7 +246,7 @@ e_card_duplicate(ECard *card)
if (card->book) {
new_card->book = card->book;
- gtk_object_ref (GTK_OBJECT (new_card->book));
+ g_object_ref (new_card->book);
}
return new_card;
@@ -357,10 +358,10 @@ e_card_set_book (ECard *card, EBook *book)
g_return_if_fail (card && E_IS_CARD (card));
if (card->book)
- gtk_object_unref (GTK_OBJECT (card->book));
+ g_object_unref (card->book);
card->book = book;
if (card->book)
- gtk_object_ref (GTK_OBJECT (card->book));
+ g_object_ref (card->book);
}
gchar *
@@ -540,7 +541,7 @@ e_card_get_vobject (const ECard *card, gboolean assumeUTF8)
if (!(is_ascii || assumeUTF8))
addPropValue (addressprop, "CHARSET", "UTF-8");
}
- gtk_object_unref(GTK_OBJECT(iterator));
+ g_object_unref(iterator);
}
if ( card->address_label ) {
@@ -555,7 +556,7 @@ e_card_get_vobject (const ECard *card, gboolean assumeUTF8)
set_address_flags (labelprop, address_label->flags);
}
- gtk_object_unref(GTK_OBJECT(iterator));
+ g_object_unref(iterator);
}
if ( card->phone ) {
@@ -567,7 +568,7 @@ e_card_get_vobject (const ECard *card, gboolean assumeUTF8)
set_phone_flags (phoneprop, phone->flags);
}
- gtk_object_unref(GTK_OBJECT(iterator));
+ g_object_unref(iterator);
}
if ( card->email ) {
@@ -577,7 +578,7 @@ e_card_get_vobject (const ECard *card, gboolean assumeUTF8)
emailprop = ADD_PROP_VALUE(vobj, VCEmailAddressProp, (char *) e_iterator_get(iterator));
addProp (emailprop, VCInternetProp);
}
- gtk_object_unref(GTK_OBJECT(iterator));
+ g_object_unref(iterator);
}
if ( card->bday ) {
@@ -828,9 +829,9 @@ parse_email(ECard *card, VObject *vobj, char *default_charset)
EList *list;
assign_string(vobj, default_charset, &next_email);
- gtk_object_get(GTK_OBJECT(card),
- "email", &list,
- NULL);
+ g_object_get(card,
+ "email", &list,
+ NULL);
e_list_append(list, next_email);
g_free (next_email);
}
@@ -858,9 +859,9 @@ parse_phone(ECard *card, VObject *vobj, char *default_charset)
assign_string(vobj, default_charset, &(next_phone->number));
next_phone->flags = get_phone_flags(vobj);
- gtk_object_get(GTK_OBJECT(card),
- "phone", &list,
- NULL);
+ g_object_get(card,
+ "phone", &list,
+ NULL);
e_list_append(list, next_phone);
e_card_phone_unref (next_phone);
}
@@ -880,9 +881,9 @@ parse_address(ECard *card, VObject *vobj, char *default_charset)
next_addr->code = e_v_object_get_child_value (vobj, VCPostalCodeProp, default_charset);
next_addr->country = e_v_object_get_child_value (vobj, VCCountryNameProp, default_charset);
- gtk_object_get(GTK_OBJECT(card),
- "address", &list,
- NULL);
+ g_object_get(card,
+ "address", &list,
+ NULL);
e_list_append(list, next_addr);
e_card_delivery_address_unref (next_addr);
}
@@ -896,9 +897,9 @@ parse_address_label(ECard *card, VObject *vobj, char *default_charset)
next_addr->flags = get_address_flags (vobj);
assign_string(vobj, default_charset, &next_addr->data);
- gtk_object_get(GTK_OBJECT(card),
- "address_label", &list,
- NULL);
+ g_object_get(card,
+ "address_label", &list,
+ NULL);
e_list_append(list, next_addr);
e_card_address_label_unref (next_addr);
}
@@ -1050,7 +1051,7 @@ add_list_unique(ECard *card, EList *list, char *string)
e_list_append(list, temp);
}
g_free(temp);
- gtk_object_unref(GTK_OBJECT(iterator));
+ g_object_unref(iterator);
}
static void
@@ -1060,9 +1061,9 @@ do_parse_categories(ECard *card, char *str)
char *copy = g_new(char, length + 1);
int i, j;
EList *list;
- gtk_object_get(GTK_OBJECT(card),
- "category_list", &list,
- NULL);
+ g_object_get(card,
+ "category_list", &list,
+ NULL);
for (i = 0, j = 0; str[i]; i++, j++) {
switch (str[i]) {
case '\\':
@@ -1185,9 +1186,9 @@ parse_arbitrary(ECard *card, VObject *vobj, char *default_charset)
assign_string(vobj, default_charset, &(arbitrary->value));
- gtk_object_get(GTK_OBJECT(card),
- "arbitrary", &list,
- NULL);
+ g_object_get(card,
+ "arbitrary", &list,
+ NULL);
e_list_append(list, arbitrary);
e_card_arbitrary_unref(arbitrary);
}
@@ -1229,7 +1230,7 @@ parse_use_score(ECard *card, VObject *vobj, char *default_charset)
static void
parse_attribute(ECard *card, VObject *vobj, char *default_charset)
{
- ParsePropertyFunc function = g_hash_table_lookup(E_CARD_CLASS(GTK_OBJECT(card)->klass)->attribute_jump_table, vObjectName(vobj));
+ ParsePropertyFunc function = g_hash_table_lookup(E_CARD_GET_CLASS(card)->attribute_jump_table, vObjectName(vobj));
if ( function )
function(card, vobj, default_charset);
}
@@ -1267,9 +1268,11 @@ static void
e_card_class_init (ECardClass *klass)
{
int i;
- GtkObjectClass *object_class;
+ GObjectClass *object_class;
- object_class = GTK_OBJECT_CLASS(klass);
+ object_class = G_OBJECT_CLASS(klass);
+
+ parent_class = g_type_class_ref (G_TYPE_OBJECT);
klass->attribute_jump_table = g_hash_table_new(g_str_hash, g_str_equal);
@@ -1277,79 +1280,250 @@ e_card_class_init (ECardClass *klass)
g_hash_table_insert(klass->attribute_jump_table, attribute_jump_array[i].key, attribute_jump_array[i].function);
}
- gtk_object_add_arg_type ("ECard::file_as",
- GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_FILE_AS);
- gtk_object_add_arg_type ("ECard::full_name",
- GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_FULL_NAME);
- gtk_object_add_arg_type ("ECard::name",
- GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_NAME);
- gtk_object_add_arg_type ("ECard::address",
- GTK_TYPE_OBJECT, GTK_ARG_READABLE, ARG_ADDRESS);
- gtk_object_add_arg_type ("ECard::address_label",
- GTK_TYPE_OBJECT, GTK_ARG_READABLE, ARG_ADDRESS_LABEL);
- gtk_object_add_arg_type ("ECard::phone",
- GTK_TYPE_OBJECT, GTK_ARG_READABLE, ARG_PHONE);
- gtk_object_add_arg_type ("ECard::email",
- GTK_TYPE_OBJECT, GTK_ARG_READABLE, ARG_EMAIL);
- gtk_object_add_arg_type ("ECard::birth_date",
- GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_BIRTH_DATE);
- gtk_object_add_arg_type ("ECard::url",
- GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_URL);
- gtk_object_add_arg_type ("ECard::org",
- GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_ORG);
- gtk_object_add_arg_type ("ECard::org_unit",
- GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_ORG_UNIT);
- gtk_object_add_arg_type ("ECard::office",
- GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_OFFICE);
- gtk_object_add_arg_type ("ECard::title",
- GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_TITLE);
- gtk_object_add_arg_type ("ECard::role",
- GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_ROLE);
- gtk_object_add_arg_type ("ECard::manager",
- GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_MANAGER);
- gtk_object_add_arg_type ("ECard::assistant",
- GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_ASSISTANT);
- gtk_object_add_arg_type ("ECard::nickname",
- GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_NICKNAME);
- gtk_object_add_arg_type ("ECard::spouse",
- GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_SPOUSE);
- gtk_object_add_arg_type ("ECard::anniversary",
- GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_ANNIVERSARY);
- gtk_object_add_arg_type ("ECard::mailer",
- GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_MAILER);
- gtk_object_add_arg_type ("ECard::caluri",
- GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_CALURI);
- gtk_object_add_arg_type ("ECard::fburl",
- GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_FBURL);
- gtk_object_add_arg_type ("ECard::note",
- GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_NOTE);
- gtk_object_add_arg_type ("ECard::related_contacts",
- GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_RELATED_CONTACTS);
- gtk_object_add_arg_type ("ECard::categories",
- GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_CATEGORIES);
- gtk_object_add_arg_type ("ECard::category_list",
- GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_CATEGORY_LIST);
- gtk_object_add_arg_type ("ECard::wants_html",
- GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_WANTS_HTML);
- gtk_object_add_arg_type ("ECard::wants_html_set",
- GTK_TYPE_BOOL, GTK_ARG_READABLE, ARG_WANTS_HTML);
- gtk_object_add_arg_type ("ECard::list",
- GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_EVOLUTION_LIST);
- gtk_object_add_arg_type ("ECard::list_show_addresses",
- GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_EVOLUTION_LIST_SHOW_ADDRESSES);
- gtk_object_add_arg_type ("ECard::arbitrary",
- GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_ARBITRARY);
- gtk_object_add_arg_type ("ECard::id",
- GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_ID);
- gtk_object_add_arg_type ("ECard::last_use",
- GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_LAST_USE);
- gtk_object_add_arg_type ("ECard::use_score",
- GTK_TYPE_FLOAT, GTK_ARG_READWRITE, ARG_USE_SCORE);
-
-
- object_class->destroy = e_card_destroy;
- object_class->get_arg = e_card_get_arg;
- object_class->set_arg = e_card_set_arg;
+ object_class->dispose = e_card_dispose;
+ object_class->get_property = e_card_get_property;
+ object_class->set_property = e_card_set_property;
+
+ g_object_class_install_property (object_class, PROP_FILE_AS,
+ g_param_spec_string ("file_as",
+ _("File As"),
+ /*_( */"XXX blurb" /*)*/,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_FULL_NAME,
+ g_param_spec_string ("full_name",
+ _("Full Name"),
+ /*_( */"XXX blurb" /*)*/,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_NAME,
+ g_param_spec_pointer ("name",
+ _("Name"),
+ /*_( */"XXX blurb" /*)*/,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_ADDRESS,
+ g_param_spec_object ("address",
+ _("Address"),
+ /*_( */"XXX blurb" /*)*/,
+ E_TYPE_LIST,
+ G_PARAM_READABLE));
+
+ g_object_class_install_property (object_class, PROP_ADDRESS_LABEL,
+ g_param_spec_object ("address_label",
+ _("Address Label"),
+ /*_( */"XXX blurb" /*)*/,
+ E_TYPE_LIST,
+ G_PARAM_READABLE));
+
+ g_object_class_install_property (object_class, PROP_PHONE,
+ g_param_spec_object ("phone",
+ _("Phone"),
+ /*_( */"XXX blurb" /*)*/,
+ E_TYPE_LIST,
+ G_PARAM_READABLE));
+
+ g_object_class_install_property (object_class, PROP_EMAIL,
+ g_param_spec_object ("email",
+ _("Email"),
+ /*_( */"XXX blurb" /*)*/,
+ E_TYPE_LIST,
+ G_PARAM_READABLE));
+
+ g_object_class_install_property (object_class, PROP_BIRTH_DATE,
+ g_param_spec_pointer ("birth_date",
+ _("Birth date"),
+ /*_( */"XXX blurb" /*)*/,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_URL,
+ g_param_spec_string ("url",
+ _("URL"),
+ /*_( */"XXX blurb" /*)*/,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_ORG,
+ g_param_spec_string ("org",
+ _("Organization"),
+ /*_( */"XXX blurb" /*)*/,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_ORG_UNIT,
+ g_param_spec_string ("org_unit",
+ _("Organizational Unit"),
+ /*_( */"XXX blurb" /*)*/,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_OFFICE,
+ g_param_spec_string ("office",
+ _("Office"),
+ /*_( */"XXX blurb" /*)*/,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_TITLE,
+ g_param_spec_string ("title",
+ _("Title"),
+ /*_( */"XXX blurb" /*)*/,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_ROLE,
+ g_param_spec_string ("role",
+ _("Role"),
+ /*_( */"XXX blurb" /*)*/,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_MANAGER,
+ g_param_spec_string ("manager",
+ _("Manager"),
+ /*_( */"XXX blurb" /*)*/,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_ASSISTANT,
+ g_param_spec_string ("assistant",
+ _("Assistant"),
+ /*_( */"XXX blurb" /*)*/,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_NICKNAME,
+ g_param_spec_string ("nickname",
+ _("Nickname"),
+ /*_( */"XXX blurb" /*)*/,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_SPOUSE,
+ g_param_spec_string ("spouse",
+ _("Spouse"),
+ /*_( */"XXX blurb" /*)*/,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_ANNIVERSARY,
+ g_param_spec_pointer ("anniversary",
+ _("Anniversary"),
+ /*_( */"XXX blurb" /*)*/,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_MAILER,
+ g_param_spec_string ("mailer",
+ _("Mailer"),
+ /*_( */"XXX blurb" /*)*/,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_CALURI,
+ g_param_spec_string ("caluri",
+ _("Calendar URI"),
+ /*_( */"XXX blurb" /*)*/,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_FBURL,
+ g_param_spec_string ("fburl",
+ _("Free/Busy URL"),
+ /*_( */"XXX blurb" /*)*/,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_NOTE,
+ g_param_spec_string ("note",
+ _("Note"),
+ /*_( */"XXX blurb" /*)*/,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_RELATED_CONTACTS,
+ g_param_spec_string ("related_contacts",
+ _("Related Contacts"),
+ /*_( */"XXX blurb" /*)*/,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_CATEGORIES,
+ g_param_spec_string ("categories",
+ _("Categories"),
+ /*_( */"XXX blurb" /*)*/,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_CATEGORY_LIST,
+ g_param_spec_object ("category list",
+ _("Category List"),
+ /*_( */"XXX blurb" /*)*/,
+ E_TYPE_LIST,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_WANTS_HTML,
+ g_param_spec_boolean ("wants_html",
+ _("Wants HTML"),
+ /*_( */"XXX blurb" /*)*/,
+ FALSE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_WANTS_HTML_SET,
+ g_param_spec_boolean ("wants_html_set",
+ _("Wants HTML set"),
+ /*_( */"XXX blurb" /*)*/,
+ FALSE,
+ G_PARAM_READABLE));
+
+ g_object_class_install_property (object_class, PROP_EVOLUTION_LIST,
+ g_param_spec_boolean ("list",
+ _("List"),
+ /*_( */"XXX blurb" /*)*/,
+ FALSE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_EVOLUTION_LIST_SHOW_ADDRESSES,
+ g_param_spec_boolean ("list_show_addresses",
+ _("List Show Addresses"),
+ /*_( */"XXX blurb" /*)*/,
+ FALSE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_ARBITRARY,
+ g_param_spec_object ("arbitrary",
+ _("Arbitrary"),
+ /*_( */"XXX blurb" /*)*/,
+ E_TYPE_LIST,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_ID,
+ g_param_spec_string ("id",
+ _("ID"),
+ /*_( */"XXX blurb" /*)*/,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_LAST_USE,
+ g_param_spec_pointer ("last_use",
+ _("Last Use"),
+ /*_( */"XXX blurb" /*)*/,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (object_class, PROP_USE_SCORE,
+ /* XXX at some point we
+ should remove
+ LAX_VALIDATION and figure
+ out some hard min & max
+ scores. */
+ g_param_spec_float ("use_score",
+ _("Use Score"),
+ /*_( */"XXX blurb" /*)*/,
+ 0.0,
+ 0.0,
+ 0.0,
+ G_PARAM_READWRITE | G_PARAM_LAX_VALIDATION));
}
ECardPhone *
@@ -1784,7 +1958,7 @@ e_card_email_match_string (const ECard *card, const gchar *str)
if (e_card_email_match_single_string (e_iterator_get (iter), str))
return TRUE;
}
- gtk_object_unref (GTK_OBJECT (iter));
+ g_object_unref (iter);
return FALSE;
}
@@ -1810,7 +1984,7 @@ e_card_email_find_number (const ECard *card, const gchar *email)
count = -1;
finished:
- gtk_object_unref (GTK_OBJECT (iter));
+ g_object_unref (iter);
return count;
}
@@ -1820,12 +1994,12 @@ e_card_email_find_number (const ECard *card, const gchar *email)
*/
static void
-e_card_destroy (GtkObject *object)
+e_card_dispose (GObject *object)
{
ECard *card = E_CARD(object);
g_free(card->id);
if (card->book)
- gtk_object_unref (GTK_OBJECT (card->book));
+ g_object_unref (card->book);
g_free(card->file_as);
g_free(card->fname);
e_card_name_unref(card->name);
@@ -1848,46 +2022,51 @@ e_card_destroy (GtkObject *object)
g_free(card->related_contacts);
if (card->categories)
- gtk_object_unref(GTK_OBJECT(card->categories));
+ g_object_unref(card->categories);
if (card->email)
- gtk_object_unref(GTK_OBJECT(card->email));
+ g_object_unref(card->email);
if (card->phone)
- gtk_object_unref(GTK_OBJECT(card->phone));
+ g_object_unref(card->phone);
if (card->address)
- gtk_object_unref(GTK_OBJECT(card->address));
+ g_object_unref(card->address);
if (card->address_label)
- gtk_object_unref(GTK_OBJECT(card->address_label));
+ g_object_unref(card->address_label);
+
+ G_OBJECT_CLASS (parent_class)->dispose (object);
}
/* Set_arg handler for the card */
static void
-e_card_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
+e_card_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
ECard *card;
card = E_CARD (object);
- switch (arg_id) {
- case ARG_FILE_AS:
+ switch (prop_id) {
+ case PROP_FILE_AS:
g_free(card->file_as);
- card->file_as = g_strdup(GTK_VALUE_STRING(*arg));
+ card->file_as = g_strdup(g_value_get_string (value));
if (card->file_as == NULL)
card->file_as = g_strdup("");
break;
- case ARG_FULL_NAME:
+ case PROP_FULL_NAME:
g_free(card->fname);
- card->fname = g_strdup(GTK_VALUE_STRING(*arg));
+ card->fname = g_strdup(g_value_get_string (value));
if (card->fname == NULL)
card->fname = g_strdup("");
e_card_name_unref (card->name);
card->name = e_card_name_from_string (card->fname);
break;
- case ARG_NAME:
+ case PROP_NAME:
e_card_name_unref (card->name);
- card->name = e_card_name_ref(GTK_VALUE_POINTER(*arg));
+ card->name = e_card_name_ref(g_value_get_pointer (value));
if (card->name == NULL)
card->name = e_card_name_new();
if (card->fname == NULL) {
@@ -1907,185 +2086,189 @@ e_card_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
card->file_as = string;
}
break;
- case ARG_CATEGORIES:
+ case PROP_CATEGORIES:
if (card->categories)
- gtk_object_unref(GTK_OBJECT(card->categories));
+ g_object_unref(card->categories);
card->categories = NULL;
- if (GTK_VALUE_STRING(*arg))
- do_parse_categories(card, GTK_VALUE_STRING(*arg));
+ if (g_value_get_string (value))
+ do_parse_categories(card, (char*)g_value_get_string (value));
break;
- case ARG_CATEGORY_LIST:
+ case PROP_CATEGORY_LIST:
if (card->categories)
- gtk_object_unref(GTK_OBJECT(card->categories));
- card->categories = E_LIST(GTK_VALUE_OBJECT(*arg));
+ g_object_unref(card->categories);
+ card->categories = E_LIST(g_value_get_pointer(value));
if (card->categories)
- gtk_object_ref(GTK_OBJECT(card->categories));
+ g_object_ref(card->categories);
break;
- case ARG_BIRTH_DATE:
+ case PROP_BIRTH_DATE:
g_free(card->bday);
- if (GTK_VALUE_POINTER (*arg)) {
+ if (g_value_get_pointer (value)) {
card->bday = g_new (ECardDate, 1);
- memcpy (card->bday, GTK_VALUE_POINTER (*arg), sizeof (ECardDate));
+ memcpy (card->bday, g_value_get_pointer (value), sizeof (ECardDate));
} else {
card->bday = NULL;
}
break;
- case ARG_URL:
+ case PROP_URL:
g_free(card->url);
- card->url = g_strdup(GTK_VALUE_STRING(*arg));
+ card->url = g_strdup(g_value_get_string(value));
break;
- case ARG_ORG:
+ case PROP_ORG:
g_free(card->org);
- card->org = g_strdup(GTK_VALUE_STRING(*arg));
+ card->org = g_strdup(g_value_get_string(value));
break;
- case ARG_ORG_UNIT:
+ case PROP_ORG_UNIT:
g_free(card->org_unit);
- card->org_unit = g_strdup(GTK_VALUE_STRING(*arg));
+ card->org_unit = g_strdup(g_value_get_string(value));
break;
- case ARG_OFFICE:
+ case PROP_OFFICE:
g_free(card->office);
- card->office = g_strdup(GTK_VALUE_STRING(*arg));
+ card->office = g_strdup(g_value_get_string(value));
break;
- case ARG_TITLE:
+ case PROP_TITLE:
g_free(card->title);
- card->title = g_strdup(GTK_VALUE_STRING(*arg));
+ card->title = g_strdup(g_value_get_string(value));
break;
- case ARG_ROLE:
+ case PROP_ROLE:
g_free(card->role);
- card->role = g_strdup(GTK_VALUE_STRING(*arg));
+ card->role = g_strdup(g_value_get_string(value));
break;
- case ARG_MANAGER:
+ case PROP_MANAGER:
g_free(card->manager);
- card->manager = g_strdup(GTK_VALUE_STRING(*arg));
+ card->manager = g_strdup(g_value_get_string(value));
break;
- case ARG_ASSISTANT:
+ case PROP_ASSISTANT:
g_free(card->assistant);
- card->assistant = g_strdup(GTK_VALUE_STRING(*arg));
+ card->assistant = g_strdup(g_value_get_string(value));
break;
- case ARG_NICKNAME:
+ case PROP_NICKNAME:
g_free(card->nickname);
- card->nickname = g_strdup(GTK_VALUE_STRING(*arg));
+ card->nickname = g_strdup(g_value_get_string(value));
break;
- case ARG_SPOUSE:
+ case PROP_SPOUSE:
g_free(card->spouse);
- card->spouse = g_strdup(GTK_VALUE_STRING(*arg));
+ card->spouse = g_strdup(g_value_get_string(value));
break;
- case ARG_ANNIVERSARY:
+ case PROP_ANNIVERSARY:
g_free(card->anniversary);
- if (GTK_VALUE_POINTER (*arg)) {
+ if (g_value_get_pointer (value)) {
card->anniversary = g_new (ECardDate, 1);
- memcpy (card->anniversary, GTK_VALUE_POINTER (*arg), sizeof (ECardDate));
+ memcpy (card->anniversary, g_value_get_pointer (value), sizeof (ECardDate));
} else {
card->anniversary = NULL;
}
break;
- case ARG_MAILER:
+ case PROP_MAILER:
g_free(card->mailer);
- card->mailer = g_strdup(GTK_VALUE_STRING(*arg));
+ card->mailer = g_strdup(g_value_get_string(value));
break;
- case ARG_CALURI:
+ case PROP_CALURI:
g_free(card->caluri);
- card->caluri = g_strdup(GTK_VALUE_STRING(*arg));
+ card->caluri = g_strdup(g_value_get_string(value));
break;
- case ARG_FBURL:
+ case PROP_FBURL:
g_free(card->fburl);
- card->fburl = g_strdup(GTK_VALUE_STRING(*arg));
+ card->fburl = g_strdup(g_value_get_string(value));
break;
- case ARG_NOTE:
+ case PROP_NOTE:
g_free (card->note);
- card->note = g_strdup(GTK_VALUE_STRING(*arg));
+ card->note = g_strdup(g_value_get_string(value));
break;
- case ARG_RELATED_CONTACTS:
+ case PROP_RELATED_CONTACTS:
g_free (card->related_contacts);
- card->related_contacts = g_strdup(GTK_VALUE_STRING(*arg));
+ card->related_contacts = g_strdup(g_value_get_string(value));
break;
- case ARG_WANTS_HTML:
- card->wants_html = GTK_VALUE_BOOL(*arg);
+ case PROP_WANTS_HTML:
+ card->wants_html = g_value_get_boolean (value);
card->wants_html_set = TRUE;
break;
- case ARG_ARBITRARY:
+ case PROP_ARBITRARY:
if (card->arbitrary)
- gtk_object_unref(GTK_OBJECT(card->arbitrary));
- card->arbitrary = E_LIST(GTK_VALUE_OBJECT(*arg));
+ g_object_unref(card->arbitrary);
+ card->arbitrary = E_LIST(g_value_get_pointer(value));
if (card->arbitrary)
- gtk_object_ref(GTK_OBJECT(card->arbitrary));
+ g_object_ref(card->arbitrary);
break;
- case ARG_ID:
+ case PROP_ID:
g_free(card->id);
- card->id = g_strdup(GTK_VALUE_STRING(*arg));
+ card->id = g_strdup(g_value_get_string(value));
if (card->id == NULL)
card->id = g_strdup ("");
break;
- case ARG_LAST_USE:
+ case PROP_LAST_USE:
g_free(card->last_use);
- if (GTK_VALUE_POINTER (*arg)) {
+ if (g_value_get_pointer (value)) {
card->last_use = g_new (ECardDate, 1);
- memcpy (card->last_use, GTK_VALUE_POINTER (*arg), sizeof (ECardDate));
+ memcpy (card->last_use, g_value_get_pointer (value), sizeof (ECardDate));
} else {
card->last_use = NULL;
}
break;
- case ARG_USE_SCORE:
- card->raw_use_score = GTK_VALUE_FLOAT(*arg);
+ case PROP_USE_SCORE:
+ card->raw_use_score = g_value_get_float (value);
break;
- case ARG_EVOLUTION_LIST:
- card->list = GTK_VALUE_BOOL(*arg);
+ case PROP_EVOLUTION_LIST:
+ card->list = g_value_get_boolean (value);
break;
- case ARG_EVOLUTION_LIST_SHOW_ADDRESSES:
- card->list_show_addresses = GTK_VALUE_BOOL(*arg);
+ case PROP_EVOLUTION_LIST_SHOW_ADDRESSES:
+ card->list_show_addresses = g_value_get_boolean (value);
break;
default:
- return;
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
}
}
/* Get_arg handler for the card */
static void
-e_card_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
+e_card_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
ECard *card;
card = E_CARD (object);
- switch (arg_id) {
- case ARG_FILE_AS:
- GTK_VALUE_STRING (*arg) = card->file_as;
+ switch (prop_id) {
+ case PROP_FILE_AS:
+ g_value_set_string (value, card->file_as);
break;
- case ARG_FULL_NAME:
- GTK_VALUE_STRING (*arg) = card->fname;
+ case PROP_FULL_NAME:
+ g_value_set_string (value, card->fname);
break;
- case ARG_NAME:
- GTK_VALUE_POINTER(*arg) = card->name;
+ case PROP_NAME:
+ g_value_set_pointer (value, card->name);
break;
- case ARG_ADDRESS:
+ case PROP_ADDRESS:
if (!card->address)
card->address = e_list_new((EListCopyFunc) e_card_delivery_address_ref,
(EListFreeFunc) e_card_delivery_address_unref,
NULL);
- GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(card->address);
+ g_value_set_object (value, card->address);
break;
- case ARG_ADDRESS_LABEL:
+ case PROP_ADDRESS_LABEL:
if (!card->address_label)
card->address_label = e_list_new((EListCopyFunc) e_card_address_label_ref,
(EListFreeFunc) e_card_address_label_unref,
NULL);
- GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(card->address_label);
+ g_value_set_object (value, card->address_label);
break;
- case ARG_PHONE:
+ case PROP_PHONE:
if (!card->phone)
card->phone = e_list_new((EListCopyFunc) e_card_phone_ref,
(EListFreeFunc) e_card_phone_unref,
NULL);
- GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(card->phone);
+ g_value_set_object (value, card->phone);
break;
- case ARG_EMAIL:
+ case PROP_EMAIL:
if (!card->email)
card->email = e_list_new((EListCopyFunc) g_strdup,
(EListFreeFunc) g_free,
NULL);
- GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(card->email);
+ g_value_set_object (value, card->email);
break;
- case ARG_CATEGORIES:
+ case PROP_CATEGORIES:
{
int i;
char ** strs;
@@ -2101,100 +2284,99 @@ e_card_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
strs[i] = (char *)e_iterator_get(iterator);
}
strs[i] = 0;
- GTK_VALUE_STRING(*arg) = g_strjoinv(", ", strs);
+ g_value_set_string(value, g_strjoinv(", ", strs)); /* XXX leak here? */
g_free(strs);
}
break;
- case ARG_CATEGORY_LIST:
+ case PROP_CATEGORY_LIST:
if (!card->categories)
card->categories = e_list_new((EListCopyFunc) g_strdup,
(EListFreeFunc) g_free,
NULL);
- GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(card->categories);
+ g_value_set_object (value, card->categories);
break;
- case ARG_BIRTH_DATE:
- GTK_VALUE_POINTER(*arg) = card->bday;
+ case PROP_BIRTH_DATE:
+ g_value_set_pointer (value, card->bday);
break;
- case ARG_URL:
- GTK_VALUE_STRING(*arg) = card->url;
+ case PROP_URL:
+ g_value_set_string (value, card->url);
break;
- case ARG_ORG:
- GTK_VALUE_STRING(*arg) = card->org;
+ case PROP_ORG:
+ g_value_set_string (value, card->org);
break;
- case ARG_ORG_UNIT:
- GTK_VALUE_STRING(*arg) = card->org_unit;
+ case PROP_ORG_UNIT:
+ g_value_set_string (value, card->org_unit);
break;
- case ARG_OFFICE:
- GTK_VALUE_STRING(*arg) = card->office;
+ case PROP_OFFICE:
+ g_value_set_string (value, card->office);
break;
- case ARG_TITLE:
- GTK_VALUE_STRING(*arg) = card->title;
+ case PROP_TITLE:
+ g_value_set_string (value, card->title);
break;
- case ARG_ROLE:
- GTK_VALUE_STRING(*arg) = card->role;
+ case PROP_ROLE:
+ g_value_set_string (value, card->role);
break;
- case ARG_MANAGER:
- GTK_VALUE_STRING(*arg) = card->manager;
+ case PROP_MANAGER:
+ g_value_set_string (value, card->manager);
break;
- case ARG_ASSISTANT:
- GTK_VALUE_STRING(*arg) = card->assistant;
+ case PROP_ASSISTANT:
+ g_value_set_string (value, card->assistant);
break;
- case ARG_NICKNAME:
- GTK_VALUE_STRING(*arg) = card->nickname;
+ case PROP_NICKNAME:
+ g_value_set_string (value, card->nickname);
break;
- case ARG_SPOUSE:
- GTK_VALUE_STRING(*arg) = card->spouse;
+ case PROP_SPOUSE:
+ g_value_set_string (value, card->spouse);
break;
- case ARG_ANNIVERSARY:
- GTK_VALUE_POINTER(*arg) = card->anniversary;
+ case PROP_ANNIVERSARY:
+ g_value_set_pointer (value, card->anniversary);
break;
- case ARG_MAILER:
- GTK_VALUE_STRING(*arg) = card->mailer;
+ case PROP_MAILER:
+ g_value_set_string (value, card->mailer);
break;
- case ARG_CALURI:
- GTK_VALUE_STRING(*arg) = card->caluri;
+ case PROP_CALURI:
+ g_value_set_string (value, card->caluri);
break;
- case ARG_FBURL:
- GTK_VALUE_STRING(*arg) = card->fburl;
+ case PROP_FBURL:
+ g_value_set_string (value, card->fburl);
break;
- case ARG_NOTE:
- GTK_VALUE_STRING(*arg) = card->note;
+ case PROP_NOTE:
+ g_value_set_string (value, card->note);
break;
- case ARG_RELATED_CONTACTS:
- GTK_VALUE_STRING(*arg) = card->related_contacts;
+ case PROP_RELATED_CONTACTS:
+ g_value_set_string (value, card->related_contacts);
break;
- case ARG_WANTS_HTML:
- GTK_VALUE_BOOL(*arg) = card->wants_html;
+ case PROP_WANTS_HTML:
+ g_value_set_boolean (value, card->wants_html);
break;
- case ARG_WANTS_HTML_SET:
- GTK_VALUE_BOOL(*arg) = card->wants_html_set;
+ case PROP_WANTS_HTML_SET:
+ g_value_set_boolean (value, card->wants_html_set);
break;
- case ARG_ARBITRARY:
+ case PROP_ARBITRARY:
if (!card->arbitrary)
card->arbitrary = e_list_new((EListCopyFunc) e_card_arbitrary_ref,
(EListFreeFunc) e_card_arbitrary_unref,
NULL);
- GTK_VALUE_OBJECT(*arg) = GTK_OBJECT(card->arbitrary);
+ g_value_set_object (value, card->arbitrary);
break;
- case ARG_ID:
- GTK_VALUE_STRING(*arg) = card->id;
+ case PROP_ID:
+ g_value_set_string (value, card->id);
break;
- case ARG_LAST_USE:
- GTK_VALUE_POINTER(*arg) = card->last_use;
+ case PROP_LAST_USE:
+ g_value_set_pointer (value, card->last_use);
break;
-
- case ARG_USE_SCORE:
- GTK_VALUE_FLOAT(*arg) = e_card_get_use_score (card);
+ case PROP_USE_SCORE:
+ g_value_set_float (value, e_card_get_use_score (card));
break;
- case ARG_EVOLUTION_LIST:
- GTK_VALUE_BOOL(*arg) = card->list;
+ case PROP_EVOLUTION_LIST:
+ g_value_set_boolean (value, card->list);
break;
- case ARG_EVOLUTION_LIST_SHOW_ADDRESSES:
- GTK_VALUE_BOOL(*arg) = card->list_show_addresses;
+ case PROP_EVOLUTION_LIST_SHOW_ADDRESSES:
+ g_value_set_boolean (value, card->list_show_addresses);
break;
default:
- arg->type = GTK_TYPE_INVALID;
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
@@ -2249,7 +2431,7 @@ e_card_load_cards_from_file_with_default_charset(const char *filename, char *def
GList *list = NULL;
while(vobj) {
VObject *next;
- ECard *card = E_CARD(gtk_type_new(e_card_get_type()));
+ ECard *card = g_object_new (E_TYPE_CARD, NULL);
parse(card, vobj, default_charset);
next = nextVObjectInList(vobj);
cleanVObject(vobj);
@@ -2273,7 +2455,7 @@ e_card_load_cards_from_string_with_default_charset(const char *str, char *defaul
GList *list = NULL;
while(vobj) {
VObject *next;
- ECard *card = E_CARD(gtk_type_new(e_card_get_type()));
+ ECard *card = g_object_new (E_TYPE_CARD, NULL);
parse(card, vobj, default_charset);
next = nextVObjectInList(vobj);
cleanVObject(vobj);
@@ -2294,32 +2476,32 @@ void
e_card_free_empty_lists (ECard *card)
{
if (card->address && e_list_length (card->address) == 0) {
- gtk_object_unref (GTK_OBJECT (card->address));
+ g_object_unref (card->address);
card->address = NULL;
}
if (card->address_label && e_list_length (card->address_label) == 0) {
- gtk_object_unref (GTK_OBJECT (card->address_label));
+ g_object_unref (card->address_label);
card->address_label = NULL;
}
if (card->phone && e_list_length (card->phone) == 0) {
- gtk_object_unref (GTK_OBJECT (card->phone));
+ g_object_unref (card->phone);
card->phone = NULL;
}
if (card->email && e_list_length (card->email) == 0) {
- gtk_object_unref (GTK_OBJECT (card->email));
+ g_object_unref (card->email);
card->email = NULL;
}
if (card->categories && e_list_length (card->categories) == 0) {
- gtk_object_unref (GTK_OBJECT (card->categories));
+ g_object_unref (card->categories);
card->categories = NULL;
}
if (card->arbitrary && e_list_length (card->arbitrary) == 0) {
- gtk_object_unref (GTK_OBJECT (card->arbitrary));
+ g_object_unref (card->arbitrary);
card->arbitrary = NULL;
}
}
@@ -2529,21 +2711,16 @@ set_address_flags (VObject *vobj, ECardAddressFlags flags)
void
e_card_list_send (GList *cards, ECardDisposition disposition)
{
- BonoboObjectClient *bonobo_server;
+#if PENDING_PORT_WORK
GNOME_Evolution_Composer composer_server;
CORBA_Environment ev;
if (cards == NULL)
return;
-
- /* First, I obtain an object reference that represents the Composer. */
- bonobo_server = bonobo_object_activate (COMPOSER_OAFID, 0);
-
- g_return_if_fail (bonobo_server != NULL);
-
- composer_server = bonobo_object_corba_objref (BONOBO_OBJECT (bonobo_server));
CORBA_exception_init (&ev);
+
+ composer_server = bonobo_activation_activate_from_id (COMPOSER_OAFID, 0, NULL, &ev);
if (disposition == E_CARD_DISPOSITION_AS_TO) {
GNOME_Evolution_Composer_RecipientList *to_list, *cc_list, *bcc_list;
@@ -2622,7 +2799,7 @@ e_card_list_send (GList *cards, ECardDisposition disposition)
name = g_strdup (e_destination_get_name (dest));
addr = g_strdup (e_destination_get_email (dest));
free_name_addr = TRUE;
- gtk_object_unref (GTK_OBJECT (dest));
+ g_object_unref (dest);
}
} else { /* is just a plain old card */
@@ -2646,7 +2823,7 @@ e_card_list_send (GList *cards, ECardDisposition disposition)
break;
}
- gtk_object_unref (GTK_OBJECT (iterator));
+ g_object_unref (iterator);
}
cards = g_list_next (cards);
@@ -2684,9 +2861,9 @@ e_card_list_send (GList *cards, ECardDisposition disposition)
} else {
char *file_as;
- gtk_object_get(GTK_OBJECT(cards->data),
- "file_as", &file_as,
- NULL);
+ g_object_get(cards->data,
+ "file_as", &file_as,
+ NULL);
tempstr = g_strdup_printf (_("VCard for %s"), file_as);
description = CORBA_string_dup (tempstr);
@@ -2734,28 +2911,28 @@ e_card_list_send (GList *cards, ECardDisposition disposition)
const gchar *tempstr2;
tempstr2 = NULL;
- gtk_object_get(GTK_OBJECT(card),
- "file_as", &tempstr2,
- NULL);
+ g_object_get(card,
+ "file_as", &tempstr2,
+ NULL);
if (!tempstr2 || !*tempstr2)
- gtk_object_get(GTK_OBJECT(card),
- "full_name", &tempstr2,
- NULL);
+ g_object_get(card,
+ "full_name", &tempstr2,
+ NULL);
if (!tempstr2 || !*tempstr2)
- gtk_object_get(GTK_OBJECT(card),
- "org", &tempstr2,
- NULL);
+ g_object_get(card,
+ "org", &tempstr2,
+ NULL);
if (!tempstr2 || !*tempstr2) {
EList *list;
EIterator *iterator;
- gtk_object_get(GTK_OBJECT(card),
- "email", &list,
- NULL);
+ g_object_get(card,
+ "email", &list,
+ NULL);
iterator = e_list_get_iterator (list);
if (e_iterator_is_valid (iterator)) {
tempstr2 = e_iterator_get (iterator);
}
- gtk_object_unref (GTK_OBJECT (iterator));
+ g_object_unref (iterator);
}
if (!tempstr2 || !*tempstr2)
@@ -2783,6 +2960,7 @@ e_card_list_send (GList *cards, ECardDisposition disposition)
}
CORBA_exception_free (&ev);
+#endif
}
void
diff --git a/addressbook/backend/ebook/e-card.h b/addressbook/backend/ebook/e-card.h
index e9b3701149..1221a35e65 100644
--- a/addressbook/backend/ebook/e-card.h
+++ b/addressbook/backend/ebook/e-card.h
@@ -13,16 +13,17 @@
#define __E_CARD_H__
#include <time.h>
-#include <gtk/gtkobject.h>
+#include <glib-object.h>
#include <stdio.h>
#include <ebook/e-card-types.h>
#include <e-util/e-list.h>
#define E_TYPE_CARD (e_card_get_type ())
-#define E_CARD(obj) (GTK_CHECK_CAST ((obj), E_TYPE_CARD, ECard))
-#define E_CARD_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_CARD, ECardClass))
-#define E_IS_CARD(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_CARD))
-#define E_IS_CARD_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_CARD))
+#define E_CARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CARD, ECard))
+#define E_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CARD, ECardClass))
+#define E_IS_CARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CARD))
+#define E_IS_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_CARD))
+#define E_CARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_CARD, ECardClass))
typedef struct _ECard ECard;
typedef struct _ECardClass ECardClass;
@@ -30,7 +31,7 @@ typedef struct _ECardClass ECardClass;
struct _EBook; /* Forward reference */
struct _ECard {
- GtkObject object;
+ GObject object;
char *id;
struct _EBook *book; /* The EBook this card is from. */
@@ -111,7 +112,7 @@ struct _ECard {
};
struct _ECardClass {
- GtkObjectClass parent_class;
+ GObjectClass parent_class;
GHashTable *attribute_jump_table;
};
@@ -212,7 +213,6 @@ void e_card_load_uri (const gchar
gpointer closure);
-/* Standard Gtk function */
-GtkType e_card_get_type (void);
+GType e_card_get_type (void);
#endif /* ! __E_CARD_H__ */
diff --git a/addressbook/backend/ebook/e-destination.c b/addressbook/backend/ebook/e-destination.c
index 25932c29e6..1c85efa6fb 100644
--- a/addressbook/backend/ebook/e-destination.c
+++ b/addressbook/backend/ebook/e-destination.c
@@ -30,10 +30,6 @@
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
-#include <gtk/gtkobject.h>
-#include <gtk/gtkmain.h>
-#include <libgnome/gnome-defs.h>
-#include <libgnome/gnome-i18n.h>
#include "e-book.h"
#include "e-book-util.h"
#include <gal/widgets/e-unicode.h>
@@ -91,55 +87,52 @@ struct _EDestinationPrivate {
static void e_destination_clear_card (EDestination *);
static void e_destination_clear_strings (EDestination *);
-static GtkObjectClass *parent_class;
+static GObjectClass *parent_class;
static void
-e_destination_destroy (GtkObject *obj)
+e_destination_destroy (GObject *obj)
{
EDestination *dest = E_DESTINATION (obj);
e_destination_clear (dest);
if (dest->priv->old_card)
- gtk_object_unref (GTK_OBJECT (dest->priv->old_card));
+ g_object_unref (dest->priv->old_card);
if (dest->priv->cardify_book)
- gtk_object_unref (GTK_OBJECT (dest->priv->cardify_book));
+ g_object_unref (dest->priv->cardify_book);
g_free (dest->priv->old_textrep);
g_free (dest->priv);
-
- if (parent_class->destroy)
- parent_class->destroy (obj);
}
static void
e_destination_class_init (EDestinationClass *klass)
{
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
- parent_class = GTK_OBJECT_CLASS (gtk_type_class (GTK_TYPE_OBJECT));
+ parent_class = g_type_class_ref (G_TYPE_OBJECT);
object_class->destroy = e_destination_destroy;
e_destination_signals[CHANGED] =
- gtk_signal_new ("changed",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EDestinationClass, changed),
- gtk_marshal_NONE__NONE,
- GTK_TYPE_NONE, 0);
+ g_signal_new ("changed",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EDestinationClass, changed),
+ NULL, NULL,
+ e_book_marshal_NONE__NONE,
+ G_TYPE_NONE, 0);
e_destination_signals[CARDIFIED] =
- gtk_signal_new ("cardified",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EDestinationClass, cardified),
- gtk_marshal_NONE__NONE,
- GTK_TYPE_NONE, 0);
-
- gtk_object_class_add_signals (object_class, e_destination_signals, LAST_SIGNAL);
+ g_signal_new ("cardified",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EDestinationClass, cardified),
+ NULL, NULL,
+ e_book_marshal_NONE__NONE,
+ G_TYPE_NONE, 0);
}
static void
@@ -153,23 +146,25 @@ e_destination_init (EDestination *dest)
dest->priv->pending_cardification = 0;
}
-GtkType
+GType
e_destination_get_type (void)
{
- static GtkType dest_type = 0;
+ static GType dest_type = 0;
if (!dest_type) {
- GtkTypeInfo dest_info = {
- "EDestination",
- sizeof (EDestination),
+ GTypeInfo dest_info = {
sizeof (EDestinationClass),
- (GtkClassInitFunc) e_destination_class_init,
- (GtkObjectInitFunc) e_destination_init,
- NULL, NULL, /* reserved */
- (GtkClassInitFunc) NULL
- };
+ NULL, /* base_class_init */
+ NULL, /* base_class_finalize */
+ (GClassInitFunc) e_destination_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (EDestination),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) e_destination_init
- dest_type = gtk_type_unique (gtk_object_get_type (), &dest_info);
+ dest_type = g_type_register_static (G_TYPE_OBJECT, "EDestination", &dest_info, 0);
+ };
}
return dest_type;
@@ -178,7 +173,7 @@ e_destination_get_type (void)
EDestination *
e_destination_new (void)
{
- return E_DESTINATION (gtk_type_new (E_TYPE_DESTINATION));
+ return g_object_new (E_TYPE_DESTINATION, NULL);
}
static void
@@ -205,7 +200,7 @@ void
e_destination_changed (EDestination *dest)
{
if (dest->priv->freeze_count == 0) {
- gtk_signal_emit (GTK_OBJECT (dest), e_destination_signals[CHANGED]);
+ g_signal_emit (dest, e_destination_signals[CHANGED], 0);
dest->priv->pending_change = FALSE;
dest->priv->cannot_cardify = FALSE;
@@ -235,11 +230,11 @@ e_destination_copy (const EDestination *dest)
new_dest->priv->card = dest->priv->card;
if (new_dest->priv->card)
- gtk_object_ref (GTK_OBJECT (new_dest->priv->card));
+ g_object_ref (new_dest->priv->card);
new_dest->priv->old_card = dest->priv->old_card;
if (new_dest->priv->old_card)
- gtk_object_ref (GTK_OBJECT (new_dest->priv->old_card));
+ g_object_ref (new_dest->priv->old_card);
new_dest->priv->html_mail_override = dest->priv->html_mail_override;
new_dest->priv->wants_html_mail = dest->priv->wants_html_mail;
@@ -257,7 +252,7 @@ e_destination_clear_card (EDestination *dest)
{
if (dest->priv->card) {
if (dest->priv->old_card)
- gtk_object_unref (GTK_OBJECT (dest->priv->old_card));
+ g_object_unref (dest->priv->old_card);
dest->priv->old_card = dest->priv->card;
dest->priv->old_card_email_num = dest->priv->card_email_num;
@@ -274,7 +269,7 @@ e_destination_clear_card (EDestination *dest)
dest->priv->card = NULL;
dest->priv->card_email_num = -1;
- g_list_foreach (dest->priv->list_dests, (GFunc) gtk_object_unref, NULL);
+ g_list_foreach (dest->priv->list_dests, (GFunc) g_object_unref, NULL);
g_list_free (dest->priv->list_dests);
dest->priv->list_dests = NULL;
@@ -424,7 +419,7 @@ e_destination_set_card (EDestination *dest, ECard *card, gint email_num)
e_destination_clear (dest);
dest->priv->card = card;
- gtk_object_ref (GTK_OBJECT (dest->priv->card));
+ g_object_ref (dest->priv->card);
dest->priv->card_email_num = email_num;
@@ -448,7 +443,7 @@ e_destination_set_book_uri (EDestination *dest, const gchar *uri)
if (dest->priv->card) {
EBook *book = e_card_get_book (dest->priv->card);
if ((!book) || strcmp (uri, e_book_get_uri (book))) {
- gtk_object_unref (GTK_OBJECT (dest->priv->card));
+ g_object_unref (dest->priv->card);
dest->priv->card = NULL;
}
}
@@ -474,7 +469,7 @@ e_destination_set_card_uid (EDestination *dest, const gchar *uid, gint email_num
/* If we already have a card, remove it unless it's uri matches the one
we just set. */
if (dest->priv->card && strcmp (uid, e_card_get_id (dest->priv->card))) {
- gtk_object_unref (GTK_OBJECT (dest->priv->card));
+ g_object_unref (dest->priv->card);
dest->priv->card = NULL;
}
@@ -594,7 +589,7 @@ use_card_cb (ECard *card, gpointer closure)
if (card != NULL && uc->dest->priv->card == NULL) {
uc->dest->priv->card = card;
- gtk_object_ref (GTK_OBJECT (uc->dest->priv->card));
+ g_object_ref (uc->dest->priv->card);
e_destination_changed (uc->dest);
}
@@ -603,7 +598,7 @@ use_card_cb (ECard *card, gpointer closure)
}
/* We held a copy of the destination during the callback. */
- gtk_object_unref (GTK_OBJECT (uc->dest));
+ g_object_unref (uc->dest);
g_free (uc);
}
@@ -620,7 +615,7 @@ e_destination_use_card (EDestination *dest, EDestinationCardCallback cb, gpointe
uc->dest = dest;
/* Hold a reference to the destination during the callback. */
- gtk_object_ref (GTK_OBJECT (uc->dest));
+ g_object_ref (uc->dest);
uc->cb = cb;
uc->closure = closure;
e_card_load_uri (dest->priv->book_uri, dest->priv->card_uid, use_card_cb, uc);
@@ -940,13 +935,13 @@ static void
set_cardify_book (EDestination *dest, EBook *book)
{
if (dest->priv->cardify_book && dest->priv->cardify_book != book) {
- gtk_object_unref (GTK_OBJECT (dest->priv->cardify_book));
+ g_object_unref (dest->priv->cardify_book);
}
dest->priv->cardify_book = book;
if (book)
- gtk_object_ref (GTK_OBJECT (book));
+ g_object_ref (book);
}
static void
@@ -971,7 +966,7 @@ name_and_email_simple_query_cb (EBook *book, EBookSimpleQueryStatus status, cons
dest->priv->has_been_cardified = TRUE;
e_destination_set_card (dest, card, email_num);
e_destination_set_book_uri (dest, book_uri);
- gtk_signal_emit (GTK_OBJECT (dest), e_destination_signals[CARDIFIED]);
+ g_signal_emit (dest, e_destination_signals[CARDIFIED], 0);
}
}
@@ -979,7 +974,7 @@ name_and_email_simple_query_cb (EBook *book, EBookSimpleQueryStatus status, cons
dest->priv->cannot_cardify = TRUE;
}
- gtk_object_unref (GTK_OBJECT (dest)); /* drop the reference held by the query */
+ g_object_unref (dest); /* drop the reference held by the query */
}
@@ -997,9 +992,9 @@ nickname_simple_query_cb (EBook *book, EBookSimpleQueryStatus status, const GLis
dest->priv->has_been_cardified = TRUE;
e_destination_set_card (dest, E_CARD (cards->data), 0); /* Uses primary e-mail by default. */
e_destination_set_book_uri (dest, book_uri);
- gtk_signal_emit (GTK_OBJECT (dest), e_destination_signals[CARDIFIED]);
+ g_signal_emit (dest, e_destination_signals[CARDIFIED], 0);
- gtk_object_unref (GTK_OBJECT (dest)); /* drop the reference held by the query */
+ g_object_unref (dest); /* drop the reference held by the query */
} else {
/* We can only end up here if we don't look at all like an e-mail address, so
@@ -1013,7 +1008,7 @@ nickname_simple_query_cb (EBook *book, EBookSimpleQueryStatus status, const GLis
}
} else {
/* Something went wrong with the query: drop our ref to the destination and return. */
- gtk_object_unref (GTK_OBJECT (dest));
+ g_object_unref (dest);
}
}
@@ -1042,7 +1037,7 @@ use_default_book_cb (EBook *book, gpointer closure)
EDestination *dest = E_DESTINATION (closure);
if (dest->priv->cardify_book == NULL) {
dest->priv->cardify_book = book;
- gtk_object_ref (GTK_OBJECT (book));
+ g_object_ref (book);
}
launch_cardify_query (dest);
@@ -1107,7 +1102,7 @@ e_destination_cardify (EDestination *dest, EBook *book)
/* If we have a book ready, proceed. We hold a reference to ourselves
until our query is complete. */
- gtk_object_ref (GTK_OBJECT (dest));
+ g_object_ref (dest);
if (dest->priv->cardify_book != NULL) {
launch_cardify_query (dest);
} else {
@@ -1137,7 +1132,7 @@ e_destination_cardify_delayed (EDestination *dest, EBook *book, gint delay)
set_cardify_book (dest, book);
- dest->priv->pending_cardification = gtk_timeout_add (delay, do_cardify_delayed, dest);
+ dest->priv->pending_cardification = g_timeout_add (delay, do_cardify_delayed, dest);
}
void
@@ -1146,7 +1141,7 @@ e_destination_cancel_cardify (EDestination *dest)
g_return_if_fail (E_IS_DESTINATION (dest));
if (dest->priv->pending_cardification) {
- gtk_timeout_remove (dest->priv->pending_cardification);
+ g_source_remove (dest->priv->pending_cardification);
dest->priv->pending_cardification = 0;
}
}
@@ -1520,7 +1515,7 @@ e_destination_import (const gchar *str)
if (dest_doc && dest_doc->xmlRootNode) {
dest = e_destination_new ();
if (! e_destination_xml_decode (dest, dest_doc->xmlRootNode)) {
- gtk_object_unref (GTK_OBJECT (dest));
+ g_object_unref (dest);
dest = NULL;
}
}
@@ -1593,7 +1588,7 @@ e_destination_importv (const gchar *str)
if (e_destination_xml_decode (dest, node) && !e_destination_is_empty (dest)) {
g_ptr_array_add (dest_array, dest);
} else {
- gtk_object_unref (GTK_OBJECT (dest));
+ g_object_unref (dest);
}
node = node->next;
@@ -1648,7 +1643,7 @@ e_destination_freev (EDestination **destv)
if (destv) {
for (i = 0; destv[i] != NULL; ++i) {
- gtk_object_unref (GTK_OBJECT (destv[i]));
+ g_object_unref (destv[i]);
}
g_free (destv);
}
diff --git a/addressbook/backend/ebook/e-destination.h b/addressbook/backend/ebook/e-destination.h
index 42dc97800e..68ae1a4018 100644
--- a/addressbook/backend/ebook/e-destination.h
+++ b/addressbook/backend/ebook/e-destination.h
@@ -27,16 +27,18 @@
#ifndef __E_DESTINATION_H__
#define __E_DESTINATION_H__
-#include <gtk/gtkobject.h>
+#include <glib.h>
+#include <glib-object.h>
#include <ebook/e-card.h>
#include <ebook/e-book.h>
#include <gnome-xml/tree.h>
-#define E_TYPE_DESTINATION (e_destination_get_type ())
-#define E_DESTINATION(o) (GTK_CHECK_CAST ((o), E_TYPE_DESTINATION, EDestination))
-#define E_DESTINATION_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), E_TYPE_DESTINATION, EDestinationClass))
-#define E_IS_DESTINATION(o) (GTK_CHECK_TYPE ((o), E_TYPE_DESTINATION))
-#define E_IS_DESTINATION_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TYPE_DESTINATION))
+#define E_TYPE_DESTINATION (e_destination_get_type ())
+#define E_DESTINATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_DESTINATION, EDestination))
+#define E_DESTINATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), E_TYPE_DESTINATION, EDestinationClass))
+#define E_IS_DESTINATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_DESTINATION))
+#define E_IS_DESTINATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_DESTINATION))
+#define E_DESTINATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_DESTINATION, EDestinationClass))
typedef struct _EDestination EDestination;
typedef struct _EDestinationClass EDestinationClass;
@@ -46,19 +48,19 @@ typedef void (*EDestinationCardCallback) (EDestination *dest, ECard *card, gpoin
struct _EDestinationPrivate;
struct _EDestination {
- GtkObject object;
+ GObject object;
struct _EDestinationPrivate *priv;
};
struct _EDestinationClass {
- GtkObjectClass parent_class;
+ GObjectClass parent_class;
void (*changed) (EDestination *dest);
void (*cardified) (EDestination *dest);
};
-GtkType e_destination_get_type (void);
+GType e_destination_get_type (void);
EDestination *e_destination_new (void);
diff --git a/addressbook/backend/ebook/evolution-ldif-importer.c b/addressbook/backend/ebook/evolution-ldif-importer.c
index d792a74172..8ec5b631ab 100644
--- a/addressbook/backend/ebook/evolution-ldif-importer.c
+++ b/addressbook/backend/ebook/evolution-ldif-importer.c
@@ -13,9 +13,6 @@
*/
#include <config.h>
-#include <bonobo.h>
-#include <gnome.h>
-#include <liboaf/liboaf.h>
#include <stdio.h>
#include <ctype.h>
@@ -269,9 +266,9 @@ parseLine( ECardSimple *simple, ECardDeliveryAddress *address, char **buf )
}
else if (!g_strcasecmp (ptr, "member")) {
EList *email;
- gtk_object_get (GTK_OBJECT (simple->card),
- "email", &email,
- NULL);
+ g_object_get (simple->card,
+ "email", &email,
+ NULL);
e_list_append (email, ldif_value->str);
}
}
@@ -326,7 +323,7 @@ getNextLDIFEntry( FILE *f )
while (buf) {
if (!parseLine (simple, address, &buf)) {
/* parsing error */
- gtk_object_unref (GTK_OBJECT (simple));
+ g_object_unref (simple);
e_card_delivery_address_unref (address);
return NULL;
}
@@ -374,17 +371,17 @@ resolve_list_card (LDIFImporter *gci, ECard *card)
if (!e_card_evolution_list (card))
return;
- gtk_object_get (GTK_OBJECT (card),
- "email", &email,
- "full_name", &full_name,
- NULL);
+ g_object_get (card,
+ "email", &email,
+ "full_name", &full_name,
+ NULL);
/* set file_as to full_name so we don't later try and figure
out a first/last name for the list. */
if (full_name)
- gtk_object_set (GTK_OBJECT (card),
- "file_as", full_name,
- NULL);
+ g_object_set (card,
+ "file_as", full_name,
+ NULL);
email_iter = e_list_get_iterator (email);
while (e_iterator_is_valid (email_iter)) {
@@ -397,7 +394,7 @@ resolve_list_card (LDIFImporter *gci, ECard *card)
gchar *dest_xml;
e_destination_set_card (dest, dn_card, 0); /* Hard-wired for default e-mail, since netscape only exports 1 email address */
dest_xml = e_destination_export (dest);
- gtk_object_unref (GTK_OBJECT (dest));
+ g_object_unref (dest);
if (dest_xml) {
e_iterator_set (email_iter, dest_xml);
g_free (dest_xml);
@@ -549,10 +546,10 @@ support_format_fn (EvolutionImporter *importer,
}
static void
-importer_destroy_cb (GtkObject *object,
+importer_destroy_cb (GObject *object,
LDIFImporter *gci)
{
- gtk_main_quit ();
+ g_main_quit ();
}
static gboolean
@@ -584,8 +581,8 @@ factory_fn (BonoboGenericFactory *_factory,
importer = evolution_importer_new (support_format_fn, load_file_fn,
process_item_fn, NULL, gci);
- gtk_signal_connect (GTK_OBJECT (importer), "destroy",
- GTK_SIGNAL_FUNC (importer_destroy_cb), gci);
+ g_signal_connect (importer, "destroy",
+ G_CALLBACK (importer_destroy_cb), gci);
return BONOBO_OBJECT (importer);
}
@@ -615,8 +612,8 @@ main (int argc,
gnome_init_with_popt_table ("Evolution-LDIF-Importer",
"0.0", argc, argv, oaf_popt_options, 0,
NULL);
- orb = oaf_init (argc, argv);
- if (bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE) {
+ orb = bonobo_activation_init (argc, argv);
+ if (bonobo_init_full (&argc, argv, orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE) {
g_error ("Could not initialize Bonobo.");
}
diff --git a/addressbook/backend/ebook/evolution-vcard-importer.c b/addressbook/backend/ebook/evolution-vcard-importer.c
index 9e0a475977..b60691f87c 100644
--- a/addressbook/backend/ebook/evolution-vcard-importer.c
+++ b/addressbook/backend/ebook/evolution-vcard-importer.c
@@ -2,7 +2,6 @@
#include <config.h>
#include <stdio.h>
-#include <liboaf/liboaf.h>
#include <bonobo/bonobo-context.h>
#include <bonobo/bonobo-generic-factory.h>
#include <bonobo/bonobo-main.h>
@@ -31,7 +30,7 @@ static void
add_card_cb (EBook *book, EBookStatus status, const gchar *id, gpointer closure)
{
ECard *card = E_CARD(closure);
- gtk_object_unref(GTK_OBJECT(card));
+ g_object_unref(card);
}
static void
@@ -181,10 +180,10 @@ support_format_fn (EvolutionImporter *importer,
}
static void
-importer_destroy_cb (GtkObject *object,
+importer_destroy_cb (GObject *object,
VCardImporter *gci)
{
- gtk_main_quit ();
+ g_main_quit ();
}
static gboolean
@@ -221,8 +220,8 @@ factory_fn (BonoboGenericFactory *_factory,
importer = evolution_importer_new (support_format_fn, load_file_fn,
process_item_fn, NULL, gci);
- gtk_signal_connect (GTK_OBJECT (importer), "destroy",
- GTK_SIGNAL_FUNC (importer_destroy_cb), gci);
+ g_signal_connect (importer, "destroy",
+ G_CALLBACK (importer_destroy_cb), gci);
return BONOBO_OBJECT (importer);
}
@@ -252,8 +251,8 @@ main (int argc,
gnome_init_with_popt_table ("Evolution-VCard-Importer",
PACKAGE, argc, argv, oaf_popt_options, 0,
NULL);
- orb = oaf_init (argc, argv);
- if (bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE) {
+ orb = bonobo_activation_init (argc, argv);
+ if (bonobo_init_full (&argc, argv, orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE) {
g_error ("Could not initialize Bonobo.");
}
diff --git a/addressbook/backend/ebook/load-gnomecard-addressbook.c b/addressbook/backend/ebook/load-gnomecard-addressbook.c
index 6f592a4664..0e26c2d101 100644
--- a/addressbook/backend/ebook/load-gnomecard-addressbook.c
+++ b/addressbook/backend/ebook/load-gnomecard-addressbook.c
@@ -2,22 +2,18 @@
#include <config.h>
#include <stdio.h>
#include <glib.h>
-#include <gtk/gtkmain.h>
-#include <libgnome/gnome-defs.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnome/gnome-util.h>
-#include <libgnomeui/gnome-init.h>
+
+#include <bonobo/bonobo-i18n.h>
#include <bonobo/bonobo-main.h>
-#include <liboaf/liboaf.h>
#include "e-book.h"
static CORBA_Environment ev;
static void
-init_bonobo (int argc, char **argv)
+init_bonobo (int *argc, char **argv)
{
- if (bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE)
+ if (bonobo_init (argc, argv) == FALSE)
g_error (_("Could not initialize Bonobo"));
}
@@ -28,7 +24,7 @@ add_card_cb (EBook *book, EBookStatus status, const gchar *id, gpointer closure)
char *vcard = e_card_get_vcard_assume_utf8(card);
g_print ("Saved card: %s\n", vcard);
g_free(vcard);
- gtk_object_unref(GTK_OBJECT(card));
+ g_object_unref(card);
}
static void
@@ -43,8 +39,8 @@ book_open_cb (EBook *book, EBookStatus status, gpointer closure)
g_list_free(list);
}
-static guint
-ebook_create (void)
+static gboolean
+ebook_create (gpointer data)
{
EBook *book;
gchar *path, *uri;
@@ -59,8 +55,9 @@ ebook_create (void)
}
- path = g_concat_dir_and_file (g_get_home_dir (),
- "evolution/local/Contacts/addressbook.db");
+ path = g_build_filename (g_get_home_dir (),
+ "evolution/local/Contacts/addressbook.db",
+ NULL);
uri = g_strdup_printf ("file://%s", path);
g_free (path);
@@ -80,10 +77,11 @@ main (int argc, char **argv)
CORBA_exception_init (&ev);
gnome_init_with_popt_table("blah", "0.0", argc, argv, NULL, 0, NULL);
- oaf_init (argc, argv);
- init_bonobo (argc, argv);
- gtk_idle_add ((GtkFunction) ebook_create, NULL);
+ bonobo_activation_init (argc, argv);
+ init_bonobo (&argc, argv);
+
+ g_idle_add (ebook_create, NULL);
bonobo_main ();
diff --git a/addressbook/backend/ebook/load-pine-addressbook.c b/addressbook/backend/ebook/load-pine-addressbook.c
index c1d58a88bf..b7bc394e55 100644
--- a/addressbook/backend/ebook/load-pine-addressbook.c
+++ b/addressbook/backend/ebook/load-pine-addressbook.c
@@ -3,22 +3,17 @@
#include <ctype.h>
#include <stdio.h>
#include <glib.h>
-#include <gtk/gtkmain.h>
-#include <libgnome/gnome-defs.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnome/gnome-util.h>
-#include <libgnomeui/gnome-init.h>
+#include <bonobo/bonobo-i18n.h>
#include <bonobo/bonobo-main.h>
-#include <liboaf/liboaf.h>
#include "e-book.h"
static CORBA_Environment ev;
static void
-init_bonobo (int argc, char **argv)
+init_bonobo (int *argc, char **argv)
{
- if (bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE)
+ if (bonobo_init (argc, argv) == FALSE)
g_error (_("Could not initialize Bonobo"));
}
@@ -29,7 +24,7 @@ add_card_cb (EBook *book, EBookStatus status, const gchar *id, gpointer closure)
char *vcard = e_card_get_vcard_assume_utf8(card);
g_print ("Saved card: %s\n", vcard);
g_free(vcard);
- gtk_object_unref(GTK_OBJECT(card));
+ g_object_unref(card);
}
static void
@@ -44,14 +39,14 @@ parse_line (EBook *book, char *line)
strings = g_strsplit(line, "\t", 3);
if (strings[0] && strings[1] && strings[2]) {
name = e_card_name_from_string(strings[1]);
- gtk_object_set(GTK_OBJECT(card),
- "nickname", strings[0],
- "full_name", strings[1],
- "name", name,
- NULL);
- gtk_object_get(GTK_OBJECT(card),
- "email", &list,
- NULL);
+ g_object_set(card,
+ "nickname", strings[0],
+ "full_name", strings[1],
+ "name", name,
+ NULL);
+ g_object_get(card,
+ "email", &list,
+ NULL);
e_list_append(list, strings[2]);
e_book_add_card(book, card, add_card_cb, card);
}
@@ -99,8 +94,8 @@ book_open_cb (EBook *book, EBookStatus status, gpointer closure)
}
}
-static guint
-ebook_create (void)
+static gboolean
+ebook_create (gpointer data)
{
EBook *book;
gchar *path, *uri;
@@ -115,8 +110,10 @@ ebook_create (void)
}
- path = g_concat_dir_and_file (g_get_home_dir (),
- "evolution/local/Contacts/addressbook.db");
+ path = g_build_filename (g_get_home_dir (),
+ "evolution/local/Contacts/addressbook.db",
+ NULL);
+
uri = g_strdup_printf ("file://%s", path);
g_free (path);
@@ -161,10 +158,11 @@ main (int argc, char **argv)
CORBA_exception_init (&ev);
gnome_init_with_popt_table("blah", "0.0", argc, argv, NULL, 0, NULL);
- oaf_init (argc, argv);
- init_bonobo (argc, argv);
- gtk_idle_add ((GtkFunction) ebook_create, NULL);
+ bonobo_activation_init (argc, argv);
+ init_bonobo (&argc, argv);
+
+ g_idle_add (ebook_create, NULL);
bonobo_main ();
diff --git a/addressbook/backend/ebook/test-card.c b/addressbook/backend/ebook/test-card.c
index d625214bfd..62d9897c18 100644
--- a/addressbook/backend/ebook/test-card.c
+++ b/addressbook/backend/ebook/test-card.c
@@ -1,7 +1,6 @@
#include <string.h>
-#include <libgnome/gnome-defs.h>
-#include <libgnomeui/gnome-init.h>
#include "e-card.h"
+#include <libgnome/gnome-init.h>
#define TEST_VCARD \
"BEGIN:VCARD\r\n" \
@@ -67,7 +66,7 @@ main (int argc, char **argv)
EIterator *iterator;
ECardDate *bday;
- gnome_init ("TestCard", "0.0", argc, argv);
+ gnome_program_init("test-card", "0.0", LIBGNOME_MODULE, argc, argv, NULL);
cardstr = NULL;
if (argc == 2)
@@ -81,26 +80,26 @@ main (int argc, char **argv)
for ( i = 0; i < 100000; i++ ) {
card = e_card_new (cardstr);
- gtk_object_unref (GTK_OBJECT (card));
+ g_object_unref (card);
}
}
#endif
card = e_card_new_with_default_charset (cardstr, "ISO-8859-1");
- gtk_object_get(GTK_OBJECT(card),
- "full_name", &fname,
- "name", &name,
- "address", &address,
- "phone", &phone,
- "email", &email,
- "org", &org,
- "org_unit", &org_unit,
- "title", &title,
- "role", &role,
- "nickname", &nickname,
- "fburl", &fburl,
- "arbitrary", &arbitrary,
- "birth_date", &bday,
- NULL);
+ g_object_get(card,
+ "full_name", &fname,
+ "name", &name,
+ "address", &address,
+ "phone", &phone,
+ "email", &email,
+ "org", &org,
+ "org_unit", &org_unit,
+ "title", &title,
+ "role", &role,
+ "nickname", &nickname,
+ "fburl", &fburl,
+ "arbitrary", &arbitrary,
+ "birth_date", &bday,
+ NULL);
if ( fname ) {
printf("Name : %s\n", fname);
g_free(fname);
@@ -142,7 +141,7 @@ main (int argc, char **argv)
ECardArbitrary *arbitrary = (ECardArbitrary *) e_iterator_get(iterator);
printf("Arbitrary : %s, %s\n", arbitrary->key, arbitrary->value);
}
- gtk_object_unref(GTK_OBJECT(iterator));
+ g_object_unref(iterator);
}
if ( bday ) {
printf("BDay : %4d-%02d-%02d\n", bday->year, bday->month, bday->day);
@@ -152,7 +151,7 @@ main (int argc, char **argv)
for (; e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
printf("Email : %s\n", (char *) e_iterator_get(iterator));
}
- gtk_object_unref(GTK_OBJECT(iterator));
+ g_object_unref(iterator);
}
if ( phone ) {
iterator = e_list_get_iterator(address);
@@ -160,7 +159,7 @@ main (int argc, char **argv)
ECardPhone *e_card_phone = (ECardPhone *) e_iterator_get(iterator);
printf("Phone ; %d : %s\n", e_card_phone->flags, e_card_phone->number);
}
- gtk_object_unref(GTK_OBJECT(iterator));
+ g_object_unref(iterator);
}
if ( address ) {
iterator = e_list_get_iterator(address);
@@ -182,10 +181,10 @@ main (int argc, char **argv)
if ( del_address->country )
printf(" Country : %s\n", del_address->country);
}
- gtk_object_unref(GTK_OBJECT(iterator));
+ g_object_unref(iterator);
}
printf("%s", e_card_get_vcard_assume_utf8(card));
- gtk_object_unref (GTK_OBJECT (card));
+ g_object_unref (card);
return 0;
}
diff --git a/addressbook/backend/ebook/test-client-list.c b/addressbook/backend/ebook/test-client-list.c
index 8a38ccf4e1..0c93277d5a 100644
--- a/addressbook/backend/ebook/test-client-list.c
+++ b/addressbook/backend/ebook/test-client-list.c
@@ -2,24 +2,16 @@
#include <config.h>
#include <glib.h>
-#include <gtk/gtkmain.h>
-#include <libgnome/gnome-defs.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-init.h>
-#include <liboaf/liboaf.h>
+#include <bonobo/bonobo-i18n.h>
#include <bonobo/bonobo-main.h>
+#include <libgnome/gnome-init.h>
#include "e-book.h"
-CORBA_Environment ev;
-
static void
-init_bonobo (int argc, char **argv)
+init_bonobo (int *argc, char **argv)
{
- gnome_init ("blah", "0.0", argc, argv);
- oaf_init (argc, argv);
-
- if (bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE)
+ if (bonobo_init (argc, argv) == FALSE)
g_error (_("Could not initialize Bonobo"));
}
@@ -35,7 +27,7 @@ get_cursor_cb (EBook *book, EBookStatus status, ECardCursor *cursor, gpointer cl
char *vcard = e_card_get_vcard_assume_utf8(card);
printf("[%s]\n", vcard);
g_free(vcard);
- gtk_object_unref(GTK_OBJECT(card));
+ g_object_unref(card);
}
}
@@ -46,8 +38,8 @@ book_open_cb (EBook *book, EBookStatus status, gpointer closure)
e_book_get_cursor(book, "", get_cursor_cb, NULL);
}
-static guint
-ebook_create (void)
+static gboolean
+ebook_create (gpointer data)
{
EBook *book;
@@ -64,11 +56,12 @@ ebook_create (void)
int
main (int argc, char **argv)
{
+ gnome_program_init("test-client-list", "0.0", LIBGNOME_MODULE, argc, argv, NULL);
- CORBA_exception_init (&ev);
- init_bonobo (argc, argv);
+ bonobo_activation_init (argc, argv);
+ init_bonobo (&argc, argv);
- gtk_idle_add ((GtkFunction) ebook_create, NULL);
+ g_idle_add (ebook_create, NULL);
bonobo_main ();
diff --git a/addressbook/backend/ebook/test-client.c b/addressbook/backend/ebook/test-client.c
index 300f25958b..96706eea7c 100644
--- a/addressbook/backend/ebook/test-client.c
+++ b/addressbook/backend/ebook/test-client.c
@@ -1,12 +1,9 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#include <config.h>
#include <glib.h>
-#include <gtk/gtkmain.h>
-#include <libgnome/gnome-defs.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-init.h>
+#include <bonobo/bonobo-i18n.h>
#include <bonobo/bonobo-main.h>
-#include <liboaf/liboaf.h>
+#include <libgnome/gnome-init.h>
#include "e-book.h"
#include "e-book-util.h"
@@ -28,9 +25,9 @@ static CORBA_Environment ev;
static char *cardstr;
static void
-init_bonobo (int argc, char **argv)
+init_bonobo (int *argc, char **argv)
{
- if (bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE)
+ if (bonobo_init (argc, argv) == FALSE)
g_error (_("Could not initialize Bonobo"));
}
@@ -51,7 +48,7 @@ get_cursor_cb (EBook *book, EBookStatus status, ECardCursor *cursor, gpointer cl
char *vcard = e_card_get_vcard_assume_utf8(card);
printf("Get all cards callback: [%s]\n", vcard);
g_free(vcard);
- gtk_object_unref(GTK_OBJECT(card));
+ g_object_unref(card);
}
}
@@ -63,7 +60,7 @@ get_card_cb (EBook *book, EBookStatus status, ECard *card, gpointer closure)
vcard = e_card_get_vcard_assume_utf8(card);
printf ("Card added: [%s]\n", vcard);
g_free(vcard);
- gtk_object_unref(GTK_OBJECT(card));
+ g_object_unref(card);
printf ("Getting cards..\n");
e_book_get_cursor(book, "", get_cursor_cb, NULL);
@@ -98,7 +95,7 @@ get_fields_cb (EBook *book, EBookStatus status, EList *fields, gpointer closure)
printf (" %s\n", (char*)e_iterator_get (iter));
}
- gtk_object_unref(GTK_OBJECT(fields));
+ g_object_unref(fields);
}
else {
printf ("No supported fields?\n");
@@ -121,8 +118,8 @@ book_open_cb (EBook *book, EBookStatus status, gpointer closure)
e_book_authenticate_user (book, "username", "password", "auth_method", auth_user_cb, NULL);
}
-static guint
-ebook_create (void)
+static gboolean
+ebook_create (gpointer data)
{
EBook *book;
@@ -174,9 +171,10 @@ main (int argc, char **argv)
CORBA_exception_init (&ev);
- gnome_init_with_popt_table ("blah", "0.0", argc, argv, NULL, 0, NULL);
- oaf_init (argc, argv);
- init_bonobo (argc, argv);
+ gnome_program_init("test-client", "0.0", LIBGNOME_MODULE, argc, argv, NULL);
+
+ bonobo_activation_init (argc, argv);
+ init_bonobo (&argc, argv);
cardstr = NULL;
if (argc == 2)
@@ -185,7 +183,7 @@ main (int argc, char **argv)
if (cardstr == NULL)
cardstr = TEST_VCARD;
- gtk_idle_add ((GtkFunction) ebook_create, NULL);
+ g_idle_add (ebook_create, NULL);
bonobo_main ();