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/ChangeLog | 15 ++++ my-evolution/GNOME_Evolution_Summary.oaf.in | 23 ++++-- my-evolution/Makefile.am | 123 +++++++++++++++++----------- my-evolution/component-factory.c | 26 +++--- my-evolution/e-summary-mail.c | 3 +- my-evolution/e-summary-preferences.c | 2 + 6 files changed, 126 insertions(+), 66 deletions(-) (limited to 'my-evolution') diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog index 5c6c4970cd..71fe3711d1 100644 --- a/my-evolution/ChangeLog +++ b/my-evolution/ChangeLog @@ -1,3 +1,18 @@ +2002-03-30 Ettore Perazzoli + + * 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. + 2002-03-29 Ettore Perazzoli * GNOME_Evolution_Summary.oaf.in: Add priority. diff --git a/my-evolution/GNOME_Evolution_Summary.oaf.in b/my-evolution/GNOME_Evolution_Summary.oaf.in index 60a49aa845..d9860c5ba4 100644 --- a/my-evolution/GNOME_Evolution_Summary.oaf.in +++ b/my-evolution/GNOME_Evolution_Summary.oaf.in @@ -1,23 +1,36 @@ + type="factory" + location="OAFIID:GNOME_Evolution_Summary_ShellComponentFactory"> + _value="Evolution Summary component."/> + + + + + + + + + + + type="shlib" + location="libevolution-executive-summary.so"> diff --git a/my-evolution/Makefile.am b/my-evolution/Makefile.am index d178a0edb0..7faacbc288 100644 --- a/my-evolution/Makefile.am +++ b/my-evolution/Makefile.am @@ -1,5 +1,3 @@ -bin_PROGRAMS = evolution-executive-summary - INCLUDES = \ -I$(top_srcdir) \ -I$(top_srcdir)/shell \ @@ -26,42 +24,44 @@ MAIL_GENERATED = \ $(MAIL_GENERATED): $(IDLS) $(ORBIT_IDL) -I $(srcdir) `$(GNOME_CONFIG) --cflags idl` $(top_srcdir)/mail/Mail.idl -evolution_executive_summary_SOURCES = \ +summary_sources = \ $(MAIL_GENERATED) \ - component-factory.c \ - component-factory.h \ - e-cell-tri.c \ - e-cell-tri.h \ - e-summary.c \ - e-summary.h \ - e-summary-calendar.c \ - e-summary-calendar.h \ - e-summary-factory.c \ - e-summary-factory.h \ - e-summary-mail.c \ - e-summary-mail.h \ - e-summary-offline-handler.c \ - e-summary-offline-handler.h \ - e-summary-preferences.c \ - e-summary-preferences.h \ - e-summary-rdf.c \ - e-summary-rdf.h \ - e-summary-shown.c \ - e-summary-shown.h \ - e-summary-table.c \ - e-summary-table.h \ - e-summary-tasks.c \ - e-summary-tasks.h \ - e-summary-type.h \ - e-summary-weather.c \ - e-summary-weather.h \ - main.c \ - metar.c \ - metar.h \ - my-evolution-html.h \ + component-factory.c \ + component-factory.h \ + e-cell-tri.c \ + e-cell-tri.h \ + e-summary.c \ + e-summary.h \ + e-summary-calendar.c \ + e-summary-calendar.h \ + e-summary-factory.c \ + e-summary-factory.h \ + e-summary-mail.c \ + e-summary-mail.h \ + e-summary-offline-handler.c \ + e-summary-offline-handler.h \ + e-summary-preferences.c \ + e-summary-preferences.h \ + e-summary-rdf.c \ + e-summary-rdf.h \ + e-summary-shown.c \ + e-summary-shown.h \ + e-summary-table.c \ + e-summary-table.h \ + e-summary-tasks.c \ + e-summary-tasks.h \ + e-summary-type.h \ + e-summary-weather.c \ + e-summary-weather.h \ + metar.c \ + metar.h \ + my-evolution-html.h \ weather.h -evolution_executive_summary_LDADD = \ +summary_exe_sources = \ + main.c + +summary_libs = \ $(top_builddir)/calendar/gui/alarm-notify/libalarm.a \ $(top_builddir)/shell/libeshell.la \ $(top_builddir)/widgets/misc/libemiscwidgets.a \ @@ -73,30 +73,55 @@ evolution_executive_summary_LDADD = \ $(top_builddir)/libwombat/libwombat.la \ $(EVOLUTION_EXECUTIVE_SUMMARY_LIBS) +if ENABLE_SHLIB_COMPONENTS + +lib_LTLIBRARIES = libevolution-executive-summary.la + +libevolution_executive_summary_la_SOURCES = \ + $(summary_sources) + +libevolution_executive_summary_la_LIBADD = \ + $(summary_libs) + +else + +bin_PROGRAMS = evolution-executive-summary + +evolution_executive_summary_SOURCES = \ + $(summary_sources) \ + $(summary_exe_sources) + +evolution_executive_summary_LDADD = \ + $(summary_libs) + +endif + Locationdir = $(datadir)/evolution Location_DATA = Locations +oaf_files = GNOME_Evolution_Summary.oaf +oaf_in_files = $(oaf_files:.oaf=.oaf.in) +oaf_in_in_files = $(oaf_files:oaf=.oaf.in.in) + oafdir = $(datadir)/oaf -oaf_in_files = GNOME_Evolution_Summary.oaf.in -oaf_DATA = $(oaf_in_files:.oaf.in=.oaf) +oaf_DATA = $(oaf_files) gladedir = $(datadir)/evolution/glade glade_DATA = my-evolution.glade @XML_I18N_MERGE_OAF_RULE@ -EXTRA_DIST = $(oaf_in_files) $(oaf_DATA) $(Location_DATA) $(glade_DATA) Locations.h Location-translation-script - -if ENABLE_PURIFY -PLINK = $(LIBTOOL) --mode=link $(PURIFY) $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ - -all-local: evolution-executive-summary.pure - -evolution-executive-summary.pure: evolution-executive-summary - @rm -f evolution-executive-summary.pure - $(PLINK) $(evolution_executive_summary_OBJECTS) $(evolution_executive_summary_LDADD) $(LIBS) - -endif +EXTRA_DIST = \ + $(summary_sources) \ + $(summary_exe_sources) \ + $(oaf_files) \ + $(oaf_in_files) \ + $(oaf_in_in_files) \ + $(oaf_DATA) \ + $(Location_DATA) \ + $(glade_DATA) \ + Locations.h \ + Location-translation-script dist-hook: cd $(distdir); rm -f $(BUILT_SOURCES) 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) diff --git a/my-evolution/e-summary-mail.c b/my-evolution/e-summary-mail.c index aff5061cc8..014e29cd85 100644 --- a/my-evolution/e-summary-mail.c +++ b/my-evolution/e-summary-mail.c @@ -248,7 +248,8 @@ update_folder_cb (EvolutionStorageListener *listener, } uri = e_path_to_physical (proto, path); - e_summary_mail_get_info (summary->mail, uri, summary->mail->listener); + if (summary->mail != NULL) + e_summary_mail_get_info (summary->mail, uri, summary->mail->listener); g_free (uri); } diff --git a/my-evolution/e-summary-preferences.c b/my-evolution/e-summary-preferences.c index bf3e4159e6..808dc04c7b 100644 --- a/my-evolution/e-summary-preferences.c +++ b/my-evolution/e-summary-preferences.c @@ -40,6 +40,8 @@ #include #include #include +#include + #include #include "e-summary.h" -- cgit v1.2.3