From 9483369aa04a5d2c4dc5c0034a3e4431153d9c99 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Fri, 28 Apr 2000 04:23:19 +0000 Subject: Made Evolution OAF-compatible. svn path=/trunk/; revision=2673 --- addressbook/backend/ebook/Makefile.am | 18 +++------------- addressbook/backend/ebook/e-book-view.c | 2 +- addressbook/backend/ebook/e-book.c | 14 +++++++++++- addressbook/backend/ebook/test-client-list.c | 17 +++++++++------ addressbook/backend/ebook/test-client.c | 32 ++++++++++++++++++++++------ 5 files changed, 53 insertions(+), 30 deletions(-) (limited to 'addressbook/backend/ebook') diff --git a/addressbook/backend/ebook/Makefile.am b/addressbook/backend/ebook/Makefile.am index 3dfe72fec4..dd213e1ab7 100644 --- a/addressbook/backend/ebook/Makefile.am +++ b/addressbook/backend/ebook/Makefile.am @@ -1,7 +1,5 @@ noinst_PROGRAMS = test-card test-client test-client-list -corbadir = $(sysconfdir)/CORBA/servers - CORBA_SOURCE = \ addressbook.h \ addressbook-common.c \ @@ -24,16 +22,6 @@ INCLUDES = \ -I$(top_builddir)/addressbook/backend \ $(BONOBO_GNOME_CFLAGS) -gnome_libs = \ - $(GNOME_LIBDIR) \ - $(GNOMEUI_LIBS) \ - $(GNOMEGNORBA_LIBS) \ - $(INTLLIBS) - -ebook_libs = \ - libebook.la \ - $(gnome_libs) - lib_LTLIBRARIES = libebook.la libebook_la_SOURCES = \ @@ -65,24 +53,24 @@ test_client_SOURCES = \ test-client.c test_client_LDADD = \ + libebook.la \ $(BONOBO_GNOME_LIBS) \ - $(ebook_libs) \ $(top_builddir)/libversit/libversit.la test_client_list_SOURCES = \ test-client-list.c test_client_list_LDADD = \ + libebook.la \ $(BONOBO_GNOME_LIBS) \ - $(ebook_libs) \ $(top_builddir)/libversit/libversit.la test_card_SOURCES = \ test-card.c test_card_LDADD = \ + libebook.la \ $(BONOBO_GNOME_LIBS) \ - $(ebook_libs) \ $(top_builddir)/libversit/libversit.la BUILT_SOURCES = $(CORBA_SOURCE) diff --git a/addressbook/backend/ebook/e-book-view.c b/addressbook/backend/ebook/e-book-view.c index db7e1b9e67..65a90b8ede 100644 --- a/addressbook/backend/ebook/e-book-view.c +++ b/addressbook/backend/ebook/e-book-view.c @@ -9,9 +9,9 @@ */ #include -#include #include #include + #include "addressbook.h" #include "e-card-cursor.h" #include "e-book-view-listener.h" diff --git a/addressbook/backend/ebook/e-book.c b/addressbook/backend/ebook/e-book.c index 1b6411ae0a..e3301233a6 100644 --- a/addressbook/backend/ebook/e-book.c +++ b/addressbook/backend/ebook/e-book.c @@ -9,9 +9,9 @@ */ #include -#include #include #include + #include "addressbook.h" #include "e-card-cursor.h" #include "e-book-listener.h" @@ -19,7 +19,13 @@ GtkObjectClass *e_book_parent_class; +#ifdef USING_OAF +#include +#define CARDSERVER_OAF_ID "OAFIID:evolution:addressbook-server:0fbc844d-c721-4615-98d0-d67eacf42d80" +#else +#include #define CARDSERVER_GOAD_ID "evolution:addressbook-server" +#endif typedef enum { URINotLoaded, @@ -426,8 +432,14 @@ e_book_construct (EBook *book) /* * Connect to the Personal Addressbook Server. */ + +#ifdef USING_OAF + book->priv->book_factory = (Evolution_BookFactory) + oaf_activate_from_id (CARDSERVER_OAF_ID, 0, NULL, NULL); +#else book->priv->book_factory = (Evolution_BookFactory) goad_server_activate_with_id (NULL, CARDSERVER_GOAD_ID, 0, NULL); +#endif if (book->priv->book_factory == CORBA_OBJECT_NIL) { g_warning ("e_book_construct: Could not obtain a handle " diff --git a/addressbook/backend/ebook/test-client-list.c b/addressbook/backend/ebook/test-client-list.c index eaa6e41c94..e492323310 100644 --- a/addressbook/backend/ebook/test-client-list.c +++ b/addressbook/backend/ebook/test-client-list.c @@ -2,26 +2,31 @@ #include #include #include + +#ifdef USING_OAF +#include +#else #include +#endif #include "e-book.h" CORBA_Environment ev; -CORBA_ORB orb; static void init_bonobo (int argc, char **argv) { - +#ifdef USING_OAF + gnome_init ("blah", "0.0", argc, argv); + oaf_init (argc, argv); +#else gnome_CORBA_init_with_popt_table ( "blah", "0.0", &argc, argv, NULL, 0, NULL, GNORBA_INIT_SERVER_FUNC, &ev); +#endif - orb = gnome_CORBA_ORB (); - - if (bonobo_init (orb, NULL, NULL) == FALSE) + if (bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE) g_error (_("Could not initialize Bonobo")); - } static void diff --git a/addressbook/backend/ebook/test-client.c b/addressbook/backend/ebook/test-client.c index 15c5410146..ef13c1ab96 100644 --- a/addressbook/backend/ebook/test-client.c +++ b/addressbook/backend/ebook/test-client.c @@ -2,7 +2,6 @@ #include #include #include -#include #include @@ -31,22 +30,39 @@ " static CORBA_Environment ev; -static CORBA_ORB orb; static char *cardstr; +#ifdef USING_OAF + +#include + static void -init_bonobo (int argc, char **argv) +init_corba (int *argc, char **argv) { + gnome_init_with_popt_table("blah", "0.0", *argc, argv, NULL, 0, NULL); + + oaf_init (*argc, argv); +} + +#else + +#include +static void +init_corba (int *argc, char **argv) +{ gnome_CORBA_init_with_popt_table ( "blah", "0.0", - &argc, argv, NULL, 0, NULL, GNORBA_INIT_SERVER_FUNC, &ev); + argc, argv, NULL, 0, NULL, GNORBA_INIT_SERVER_FUNC, &ev); +} - orb = gnome_CORBA_ORB (); +#endif - if (bonobo_init (orb, NULL, NULL) == FALSE) +static void +init_bonobo (int argc, char **argv) +{ + if (bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE) g_error (_("Could not initialize Bonobo")); - } static void @@ -155,6 +171,8 @@ main (int argc, char **argv) { CORBA_exception_init (&ev); + + init_corba (&argc, argv); init_bonobo (argc, argv); cardstr = NULL; -- cgit v1.2.3