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 --- mail/ChangeLog | 24 ++++++++++++++++++++ mail/GNOME_Evolution_Mail.oaf.in | 28 ++++++++++++++++++++++++ mail/GNOME_Evolution_Mail.oafinfo | 28 ++++++++++++++++++++++++ mail/Makefile.am | 14 +++++++++--- mail/evolution-mail.oafinfo | 28 ++++++++++++++++++++++++ mail/folder-browser-factory.c | 13 ++++++----- mail/main.c | 35 ++++++++++++++++++++++------- mail/test-mail.c | 46 ++++++++++++++++++++++++++++----------- 8 files changed, 187 insertions(+), 29 deletions(-) create mode 100644 mail/GNOME_Evolution_Mail.oaf.in create mode 100644 mail/GNOME_Evolution_Mail.oafinfo create mode 100644 mail/evolution-mail.oafinfo (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index af7b74ab6c..b119e9a18e 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,27 @@ +2000-04-27 Ettore Perazzoli + + * folder-browser-factory.c: New macro `CONTROL_FACTORY_ID', which + is #defined to a different value according to whether we are + `USING_OAF' or not. + (folder_browser_factory_init): Use `CONTROL_FACTORY_ID'. + + * test-mail.c + (init_corba): New helper function, implemented differently + according to `USING_OAF'. + (main): Use `init_corba()'. + + * main.c + (init_corba): New helper function, implemented differently + according to `USING_OAF'. + (init_bonobo): Use `init_corba()'. + + * Makefile.am: Install OAF stuff if `USING_OAF'. Add + `-I$(datadir)/idl' to the `orbit-idl' command-line so that we can + use Bonobo IDL files installed under our prefix as well. Also, + use `$(ORBIT_IDL)' instead of hardcoded `orbit-idl'. + + * evolution-mail.oafinfo: New file. + 2000-04-27 Dan Winship * mail-format.c: Move text_to_html to e-util. diff --git a/mail/GNOME_Evolution_Mail.oaf.in b/mail/GNOME_Evolution_Mail.oaf.in new file mode 100644 index 0000000000..6c284ece5c --- /dev/null +++ b/mail/GNOME_Evolution_Mail.oaf.in @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/mail/GNOME_Evolution_Mail.oafinfo b/mail/GNOME_Evolution_Mail.oafinfo new file mode 100644 index 0000000000..6c284ece5c --- /dev/null +++ b/mail/GNOME_Evolution_Mail.oafinfo @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/mail/Makefile.am b/mail/Makefile.am index 4c2193330f..283333d2a4 100644 --- a/mail/Makefile.am +++ b/mail/Makefile.am @@ -63,13 +63,21 @@ test_mail_LDADD = \ $(BONOBO_HTML_GNOME_LIBS) +GOAD_FILES = evolution-mail.gnorba +OAF_FILES = evolution-mail.oafinfo + +if USING_OAF +oafdir = $(datadir)/oaf +oaf_DATA = $(OAF_FILES) +else gnorbadir = $(sysconfdir)/CORBA/servers -gnorba_DATA = evolution-mail.gnorba +gnorba_DATA = $(GOAD_FILES) +endif $(EVOLUTION_MAIL_CORBA_GENERATED): Mail.idl - orbit-idl -I`$(GNOME_CONFIG) --datadir`/idl -I$(srcdir) $(srcdir)/Mail.idl + $(ORBIT_IDL) -I$(datadir)/idl -I`$(GNOME_CONFIG) --datadir`/idl -I$(srcdir) $(srcdir)/Mail.idl -EXTRA_DIST = Mail.idl evolution-mail.gnorba +EXTRA_DIST = Mail.idl $(GOAD_FILES) $(OAF_FILES) dist-hook: -mkdir $(distdir)/pixmaps diff --git a/mail/evolution-mail.oafinfo b/mail/evolution-mail.oafinfo new file mode 100644 index 0000000000..6c284ece5c --- /dev/null +++ b/mail/evolution-mail.oafinfo @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/mail/folder-browser-factory.c b/mail/folder-browser-factory.c index 0f438a7118..a485df29d9 100644 --- a/mail/folder-browser-factory.c +++ b/mail/folder-browser-factory.c @@ -23,6 +23,11 @@ #include #include "mail-ops.h" +#ifdef USING_OAF +#define CONTROL_FACTORY_ID "OAFIID:control-factory:evolution-mail:25902062-543b-4f44-8702-d90145fcdbf2" +#else +#define CONTROL_FACTORY_ID "control-factory:evolution-mail" +#endif static void folder_browser_set_shell (EvolutionServiceRepository *sr, @@ -252,14 +257,12 @@ folder_browser_factory_init (void) { static BonoboGenericFactory *bonobo_folder_browser_factory = NULL; - if (bonobo_folder_browser_factory != NULL) return; - bonobo_folder_browser_factory = - bonobo_generic_factory_new ( - "control-factory:evolution-mail", - folder_browser_factory, NULL); + bonobo_folder_browser_factory = bonobo_generic_factory_new (CONTROL_FACTORY_ID, + folder_browser_factory, + NULL); if (bonobo_folder_browser_factory == NULL){ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, diff --git a/mail/main.c b/mail/main.c index 953f424a79..2102a153ff 100644 --- a/mail/main.c +++ b/mail/main.c @@ -8,7 +8,6 @@ */ #include #include -#include #include #include #include "e-util/e-gui-utils.h" @@ -16,28 +15,48 @@ #include "main.h" #include "session.h" -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-mail-component", VERSION, argc, argv, + oaf_popt_options, 0, NULL); + oaf_init (argc, argv); +} + +#else /* USING_OAF */ + +#include + +static void +init_corba (int *argc, char *argv []) { CORBA_Environment ev; CORBA_exception_init (&ev); - gnome_CORBA_init_with_popt_table ( + gnome_CORBA_init_with_popt_table ( "evolution-mail-component", "1.0", &argc, argv, NULL, 0, NULL, GNORBA_INIT_SERVER_FUNC, &ev); - orb = gnome_CORBA_ORB (); + CORBA_exception_free (&ev); +} + +#endif /* USING_OAF */ - if (bonobo_init (orb, NULL, NULL) == FALSE){ +static void +init_bonobo (int argc, char **argv) +{ + init_corba (argc, argv); + + if (bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE){ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, _("Mail Component: I could not initialize Bonobo")); exit (1); } - - CORBA_exception_free (&ev); } int diff --git a/mail/test-mail.c b/mail/test-mail.c index 94102da1d3..4d6707c711 100644 --- a/mail/test-mail.c +++ b/mail/test-mail.c @@ -6,10 +6,41 @@ * * (C) 2000 Helix Code, Inc. */ + +#include + #include #include + +#ifdef USING_OAF + +#include + +static void +init_corba (int *argc, char *argv[]) +{ + gnome_init ("sample-control-container", "1.0", *argc, argv); + oaf_init (*argc, argv); +} + +#else /* USING_OAF */ + #include +static void +init_corba (int *argc, char *argv []) +{ + CORBA_Environment ev; + + CORBA_exception_init (&ev); + + gnome_CORBA_init ("sample-control-container", "1.0", argc, argv, 0, &ev); + + CORBA_exception_free (&ev); +} + +#endif /* USING_OAF */ + static guint create_container (void) { @@ -46,21 +77,10 @@ create_container (void) int main (int argc, char *argv []) { - CORBA_Environment ev; - CORBA_ORB orb; - - CORBA_exception_init (&ev); - - gnome_CORBA_init ("sample-control-container", "1.0", &argc, argv, 0, &ev); - - CORBA_exception_free (&ev); + init_corba (&argc, argv); - 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\n"); - - gtk_idle_add ((GtkFunction) create_container, NULL); -- cgit v1.2.3