diff options
author | Federico Mena Quintero <federico@ximian.com> | 2001-09-05 10:52:52 +0800 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2001-09-05 10:52:52 +0800 |
commit | 7f6f7e52113103e38dbb27aef10c1ffc25f269ec (patch) | |
tree | f34fb410189e6dedb8a2bcfcf079b85151dcdc84 /calendar/gui/main.c | |
parent | bc21d949ca1a3a1eb0fc5dd735411030c01c6b79 (diff) | |
download | gsoc2013-evolution-7f6f7e52113103e38dbb27aef10c1ffc25f269ec.tar.gz gsoc2013-evolution-7f6f7e52113103e38dbb27aef10c1ffc25f269ec.tar.zst gsoc2013-evolution-7f6f7e52113103e38dbb27aef10c1ffc25f269ec.zip |
Implemented.
2001-09-04 Federico Mena Quintero <federico@ximian.com>
* 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
Diffstat (limited to 'calendar/gui/main.c')
-rw-r--r-- | calendar/gui/main.c | 35 |
1 files changed, 35 insertions, 0 deletions
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 <liboaf/liboaf.h> #include <bonobo/bonobo-main.h> +#include <bonobo/bonobo-generic-factory.h> #include <gal/widgets/e-cursors.h> @@ -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 (); |