From 3b9ea2d060d2705563950fb063532aff54b1a08c Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Sun, 31 Mar 2002 01:17:33 +0000 Subject: [Some initial broken support for building components as shlib. Mostly just a playground for testing the idea.] * Makefile.am: Added support for the ENABLE_SHLIB_COMPONENTS conditional. * GNOME_Evolution_Summary.oaf.in.in: New. * e-summary-mail.c (update_folder_cb): Protect against summary->mail being NULL. * component-factory.c: Add a shlib factory. (create_component): Get a @factory and @data. (component_factory_init): Actually make it use a BonoboGenericFactory again. * configure.in: Add argument `--enable-shlib-components'. New substitutions OAF_SHLIB_LOCATION, OAF_SHLIB_PREFIX, OAF_SHLIB_SUFFIX. svn path=/trunk/; revision=16299 --- my-evolution/component-factory.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'my-evolution/component-factory.c') diff --git a/my-evolution/component-factory.c b/my-evolution/component-factory.c index 2059df50ee..fb7dbc8829 100644 --- a/my-evolution/component-factory.c +++ b/my-evolution/component-factory.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -37,7 +38,8 @@ #include "component-factory.h" #include -#define COMPONENT_ID "OAFIID:GNOME_Evolution_Summary_ShellComponent" +#define COMPONENT_ID "OAFIID:GNOME_Evolution_Summary_ShellComponent" +#define COMPONENT_FACTORY_ID "OAFIID:GNOME_Evolution_Summary_ShellComponentFactory" static gint running_objects = 0; static ESummaryPrefs *global_preferences = NULL; @@ -113,7 +115,8 @@ component_destroy (BonoboObject *factory, } static BonoboObject * -create_component (void) +create_component (BonoboGenericFactory *factory, + void *data) { EvolutionShellComponent *shell_component; ESummaryOfflineHandler *offline_handler; @@ -145,18 +148,19 @@ create_component (void) return BONOBO_OBJECT (shell_component); } +/* Factory for the out-of-proc case. */ void component_factory_init (void) { - BonoboObject *object; - int result; + BonoboGenericFactory *factory; - object = create_component (); + factory = bonobo_generic_factory_new (COMPONENT_FACTORY_ID, + create_component, + NULL); - result = oaf_active_server_register (COMPONENT_ID, bonobo_object_corba_objref (object)); - if (result == OAF_REG_ERROR) { - e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, - _("Cannot initialize Evolution's Summary component.")); - exit (1); - } + if (factory == NULL) + g_error ("Cannot register Evolution Summary component factory."); } + +/* Factory for the shlib case. */ +BONOBO_OAF_SHLIB_FACTORY (COMPONENT_FACTORY_ID, "Evolution Summary component", create_component, NULL) -- cgit