diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2002-03-31 09:17:33 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2002-03-31 09:17:33 +0800 |
commit | 3b9ea2d060d2705563950fb063532aff54b1a08c (patch) | |
tree | fa33ff724c4833f9158d9b63397c1500c2a2daea /my-evolution/component-factory.c | |
parent | b5ee9fc4243e93781e2061f42f1b0af62696b499 (diff) | |
download | gsoc2013-evolution-3b9ea2d060d2705563950fb063532aff54b1a08c.tar.gz gsoc2013-evolution-3b9ea2d060d2705563950fb063532aff54b1a08c.tar.zst gsoc2013-evolution-3b9ea2d060d2705563950fb063532aff54b1a08c.zip |
[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
Diffstat (limited to 'my-evolution/component-factory.c')
-rw-r--r-- | my-evolution/component-factory.c | 26 |
1 files changed, 15 insertions, 11 deletions
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 <bonobo/bonobo-object.h> #include <bonobo/bonobo-generic-factory.h> #include <bonobo/bonobo-context.h> +#include <bonobo/bonobo-shlib-factory.h> #include <shell/evolution-shell-component.h> #include <shell/Evolution.h> @@ -37,7 +38,8 @@ #include "component-factory.h" #include <gal/widgets/e-gui-utils.h> -#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) |