From 7f6f7e52113103e38dbb27aef10c1ffc25f269ec Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Wed, 5 Sep 2001 02:52:52 +0000 Subject: Implemented. 2001-09-04 Federico Mena Quintero * gui/component-factory.c (sc_user_create_new_item_cb): Implemented. * gui/main.c (component_editor_factory_init): New function to create the factory for the comp_editor_factory. * gui/comp-editor-factory.c: Finished implementation. * gui/alarm-notify/alarm-queue.c (edit_component): Implemented the Edit command. * gui/Makefile.am (evolution_calendar_SOURCES): Added comp-editor-factory.[ch] to the list of sources. svn path=/trunk/; revision=12619 --- calendar/gui/main.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'calendar/gui/main.c') diff --git a/calendar/gui/main.c b/calendar/gui/main.c index 318fbfbfa3..e3f16afb4c 100644 --- a/calendar/gui/main.c +++ b/calendar/gui/main.c @@ -34,6 +34,7 @@ #include #include +#include #include @@ -41,10 +42,14 @@ #include "calendar-commands.h" #include "calendar-config.h" #include "component-factory.h" +#include "comp-editor-factory.h" #include "control-factory.h" #include "itip-control-factory.h" #include "tasks-control-factory.h" +/* The component editor factory */ +static CompEditorFactory *comp_editor_factory = NULL; + static void init_bonobo (int argc, char **argv) { @@ -58,6 +63,35 @@ init_bonobo (int argc, char **argv) g_error (_("Could not initialize Bonobo")); } +/* Factory function for the calendar component factory; just creates and + * references a singleton service object. + */ +static BonoboObject * +comp_editor_factory_fn (BonoboGenericFactory *factory, void *data) +{ + if (!comp_editor_factory) { + comp_editor_factory = comp_editor_factory_new (); + if (!comp_editor_factory) + return NULL; + } + + bonobo_object_ref (BONOBO_OBJECT (comp_editor_factory)); + return BONOBO_OBJECT (comp_editor_factory); +} + +/* Creates and registers the component editor factory */ +static void +component_editor_factory_init (void) +{ + BonoboGenericFactory *factory; + + factory = bonobo_generic_factory_new ( + "OAFIID:GNOME_Evolution_Calendar_CompEditorFactory_Factory", + comp_editor_factory_fn, NULL); + if (!factory) + g_error (_("Could not create the component editor factory")); +} + int main (int argc, char **argv) { @@ -86,6 +120,7 @@ main (int argc, char **argv) component_factory_init (); itip_control_factory_init (); tasks_control_factory_init (); + component_editor_factory_init (); bonobo_main (); -- cgit v1.2.3