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 --- .../component/GNOME_Evolution_Addressbook.oaf.in | 30 +++++++++++++++++ .../component/GNOME_Evolution_Addressbook.oafinfo | 30 +++++++++++++++++ addressbook/gui/component/Makefile.am | 9 +++++ addressbook/gui/component/addressbook-factory.c | 39 +++++++++++++++++----- addressbook/gui/component/addressbook.c | 14 +++++--- addressbook/gui/component/addressbook.oafinfo | 30 +++++++++++++++++ 6 files changed, 140 insertions(+), 12 deletions(-) create mode 100644 addressbook/gui/component/GNOME_Evolution_Addressbook.oaf.in create mode 100644 addressbook/gui/component/GNOME_Evolution_Addressbook.oafinfo create mode 100644 addressbook/gui/component/addressbook.oafinfo (limited to 'addressbook/gui') diff --git a/addressbook/gui/component/GNOME_Evolution_Addressbook.oaf.in b/addressbook/gui/component/GNOME_Evolution_Addressbook.oaf.in new file mode 100644 index 0000000000..8f51a1f07a --- /dev/null +++ b/addressbook/gui/component/GNOME_Evolution_Addressbook.oaf.in @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addressbook/gui/component/GNOME_Evolution_Addressbook.oafinfo b/addressbook/gui/component/GNOME_Evolution_Addressbook.oafinfo new file mode 100644 index 0000000000..8f51a1f07a --- /dev/null +++ b/addressbook/gui/component/GNOME_Evolution_Addressbook.oafinfo @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addressbook/gui/component/Makefile.am b/addressbook/gui/component/Makefile.am index c20864912b..9e72319d03 100644 --- a/addressbook/gui/component/Makefile.am +++ b/addressbook/gui/component/Makefile.am @@ -35,5 +35,14 @@ evolution_addressbook_LDADD = \ evolution_addressbook_LDFLAGS = `gnome-config --libs gdk_pixbuf` +if USING_OAF +oafdir = $(datadir)/oaf +oaf_DATA = addressbook.oafinfo +else gnorbadir = $(sysconfdir)/CORBA/servers gnorba_DATA = addressbook.gnorba +endif + +EXTRA_DIST = \ + addressbook.gnorba \ + addressbook.oafinfo diff --git a/addressbook/gui/component/addressbook-factory.c b/addressbook/gui/component/addressbook-factory.c index 83257b1189..aa6214786c 100644 --- a/addressbook/gui/component/addressbook-factory.c +++ b/addressbook/gui/component/addressbook-factory.c @@ -10,25 +10,48 @@ #include #include -#include #include #include + #include "addressbook.h" -CORBA_Environment ev; -CORBA_ORB orb; +#ifdef USING_OAF + +#include static void -init_bonobo (int argc, char **argv) +init_corba (int *argc, char **argv) { + gnome_init_with_popt_table ("evolution-addressbook", "0.0", + *argc, argv, oaf_popt_options, 0, NULL); + + oaf_init (*argc, argv); +} + +#else + +#include + +static void +init_corba (int *argc, char **argv) +{ + CORBA_Environment ev; + + CORBA_exception_init (&ev); gnome_CORBA_init_with_popt_table ( "evolution-addressbook", "0.0", - &argc, argv, NULL, 0, NULL, GNORBA_INIT_SERVER_FUNC, &ev); + argc, argv, NULL, 0, NULL, GNORBA_INIT_SERVER_FUNC, &ev); + + CORBA_exception_free (&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")); glade_gnome_init (); @@ -37,7 +60,7 @@ init_bonobo (int argc, char **argv) int main (int argc, char **argv) { - CORBA_exception_init (&ev); + init_corba (&argc, argv); init_bonobo (argc, argv); diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c index bb4b20406f..d634d5a926 100644 --- a/addressbook/gui/component/addressbook.c +++ b/addressbook/gui/component/addressbook.c @@ -9,6 +9,7 @@ */ #include + #include #include #include @@ -20,6 +21,12 @@ #include "e-minicard-view.h" #include "e-contact-editor.h" +#ifdef USING_OAF +#define CONTROL_FACTORY_ID "OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17" +#else +#define CONTROL_FACTORY_ID "control-factory:addressbook" +#endif + static void control_deactivate (BonoboControl *control, BonoboUIHandler *uih) { @@ -451,10 +458,9 @@ addressbook_factory_init (void) if (addressbook_control_factory != NULL) return; - addressbook_control_factory = - bonobo_generic_factory_new ( - "control-factory:addressbook", - addressbook_factory, NULL); + addressbook_control_factory = bonobo_generic_factory_new (CONTROL_FACTORY_ID, + addressbook_factory, + NULL); if (addressbook_control_factory == NULL) { g_error ("I could not register a Addressbook factory."); diff --git a/addressbook/gui/component/addressbook.oafinfo b/addressbook/gui/component/addressbook.oafinfo new file mode 100644 index 0000000000..8f51a1f07a --- /dev/null +++ b/addressbook/gui/component/addressbook.oafinfo @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3