From e53eacd2d9b6b775dab6e8bd8cd39f0691192437 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Wed, 4 Dec 2002 19:52:45 +0000 Subject: Updated to be a shared library. * GNOME_Evolution_Summary.server.in.in: Updated to be a shared library. * main.c: Removed. * Makefile.am: Update to compile as a shared library. * component-factory.c: Changed to be a shared library factory, for both the ShellComponent and the ConfigControl objects. * e-summary-preferences.c (e_summary_preferences_init_config_control): Renamed from e_summary_preferences_register_config_control_factory. (e_summary_preferences_create_control): Renamed from factory_fn and removed all args. svn path=/trunk/; revision=19007 --- my-evolution/ChangeLog | 18 ++++++ my-evolution/GNOME_Evolution_Summary.server.in.in | 27 ++++----- my-evolution/Makefile.am | 33 ++-------- my-evolution/component-factory.c | 34 +++++------ my-evolution/e-summary-preferences.c | 18 ++---- my-evolution/e-summary-preferences.h | 4 +- my-evolution/main.c | 74 ----------------------- 7 files changed, 60 insertions(+), 148 deletions(-) delete mode 100644 my-evolution/main.c diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog index b157cc9585..9f678f71ed 100644 --- a/my-evolution/ChangeLog +++ b/my-evolution/ChangeLog @@ -1,3 +1,21 @@ +2002-12-04 Ettore Perazzoli + + * GNOME_Evolution_Summary.server.in.in: Updated to be a shared + library. + + * main.c: Removed. + + * Makefile.am: Update to compile as a shared library. + + * component-factory.c: Changed to be a shared library factory, for + both the ShellComponent and the ConfigControl objects. + + * e-summary-preferences.c + (e_summary_preferences_init_config_control): Renamed from + e_summary_preferences_register_config_control_factory. + (e_summary_preferences_create_control): Renamed from factory_fn + and removed all args. + 2002-11-27 Not Zed * e-summary-shown.c (e_summary_shown_init): GNOME_STOCK_*NEXT/PREV -> diff --git a/my-evolution/GNOME_Evolution_Summary.server.in.in b/my-evolution/GNOME_Evolution_Summary.server.in.in index 7ab98342a6..6bf4d63139 100644 --- a/my-evolution/GNOME_Evolution_Summary.server.in.in +++ b/my-evolution/GNOME_Evolution_Summary.server.in.in @@ -1,8 +1,17 @@ + + + + + + + + type="factory" + location="OAFIID:GNOME_Evolution_Summary_ComponentFactory"> @@ -18,21 +27,9 @@ - - - - - - - - - + location="OAFIID:GNOME_Evolution_Summary_ComponentFactory"> diff --git a/my-evolution/Makefile.am b/my-evolution/Makefile.am index 68b10e53c2..049deefebc 100644 --- a/my-evolution/Makefile.am +++ b/my-evolution/Makefile.am @@ -62,9 +62,6 @@ summary_sources = \ my-evolution-html.h \ weather.h -summary_exe_sources = \ - main.c - summary_libs = \ $(top_builddir)/calendar/gui/alarm-notify/libalarm.a \ $(top_builddir)/shell/libeshell.la \ @@ -77,28 +74,11 @@ summary_libs = \ $(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 - -libexec_PROGRAMS = evolution-executive-summary - -evolution_executive_summary_SOURCES = \ - $(summary_sources) \ - $(summary_exe_sources) - -evolution_executive_summary_LDADD = \ - $(summary_libs) - -endif +componentdir = $(prefix)/evolution/components +component_LTLIBRARIES = libevolution-executive-summary.la +libevolution_executive_summary_la_SOURCES = $(summary_sources) +libevolution_executive_summary_la_LIBADD = $(summary_libs) +libevolution_executive_summary_la_LDFLAGS = -module -avoid-version Locationdir = $(datadir)/evolution Location_DATA = Locations @@ -111,7 +91,7 @@ server_in_files = GNOME_Evolution_Summary.server.in.in serverdir = $(libdir)/bonobo/servers server_DATA = $(server_in_files:.server.in.in=.server) $(server_in_files:.server.in.in=.server.in): $(server_in_files) - sed -e "s|\@LIBEXECDIR\@|$(libexecdir)|" $< > $@ + sed -e "s|\@COMPONENTDIR\@|$(componentdir)|" $< > $@ @INTLTOOL_SERVER_RULE@ @@ -137,7 +117,6 @@ install-data-local: EXTRA_DIST = \ $(summary_sources) \ - $(summary_exe_sources) \ $(server_in_files) \ $(server_DATA) \ $(Location_DATA) \ diff --git a/my-evolution/component-factory.c b/my-evolution/component-factory.c index eaa84e39f8..6cfa41d7ba 100644 --- a/my-evolution/component-factory.c +++ b/my-evolution/component-factory.c @@ -42,7 +42,10 @@ #include "component-factory.h" -#define COMPONENT_ID "OAFIID:GNOME_Evolution_Summary_ShellComponent" +#define FACTORY_ID "OAFIID:GNOME_Evolution_Summary_ComponentFactory" + +#define COMPONENT_ID "OAFIID:GNOME_Evolution_Summary_ShellComponent" +#define PREFERENCES_CONTROL_ID "OAFIID:GNOME_Evolution_Summary_ConfigControl" static gint running_objects = 0; static ESummaryPrefs *global_preferences = NULL; @@ -101,7 +104,7 @@ owner_set_cb (EvolutionShellComponent *shell_component, corba_shell = evolution_shell_client_corba_objref (shell_client); e_summary_folder_init_folder_store (corba_shell); - e_summary_preferences_register_config_control_factory (corba_shell); + e_summary_preferences_init_control (corba_shell); } static void @@ -112,7 +115,7 @@ owner_unset_cb (EvolutionShellComponent *shell_component, } static BonoboObject * -create_component (void) +create_shell_component (void) { EvolutionShellComponent *shell_component; ESummaryOfflineHandler *offline_handler; @@ -141,23 +144,20 @@ create_component (void) return BONOBO_OBJECT (shell_component); } -/* Factory for the out-of-proc case. */ -void -component_factory_init (void) +static BonoboObject * +factory (BonoboGenericFactory *this, + const char *object_id, + void *data) { - Bonobo_RegistrationResult result; - BonoboObject *shell_component; + if (strcmp (object_id, COMPONENT_ID) == 0) + return create_shell_component (); - shell_component = create_component (); + if (strcmp (object_id, PREFERENCES_CONTROL_ID) == 0) + return e_summary_preferences_create_control (); - result = bonobo_activation_active_server_register (COMPONENT_ID, - bonobo_object_corba_objref (BONOBO_OBJECT (shell_component))); + g_warning (FACTORY_ID ": Don't know anything about %s", object_id); - if (result != Bonobo_ACTIVATION_REG_SUCCESS) - g_error ("Cannot register Evolution Summary component factory."); + return NULL; } -#if 0 -/* Factory for the shlib case. */ -BONOBO_OAF_SHLIB_FACTORY (COMPONENT_FACTORY_ID, "Evolution Summary component", create_component, NULL) -#endif +BONOBO_ACTIVATION_SHLIB_FACTORY (FACTORY_ID, "Evolution Summary component", factory, NULL) diff --git a/my-evolution/e-summary-preferences.c b/my-evolution/e-summary-preferences.c index 0d5db9235d..e14573594f 100644 --- a/my-evolution/e-summary-preferences.c +++ b/my-evolution/e-summary-preferences.c @@ -55,8 +55,6 @@ #include "evolution-config-control.h" -#define FACTORY_ID "OAFIID:GNOME_Evolution_Summary_ConfigControlFactory" - static ESummaryPrefs *global_preferences = NULL; static GNOME_Evolution_Shell global_shell = NULL; @@ -1229,10 +1227,8 @@ config_control_destroy_cb (EvolutionConfigControl *config_control, free_property_dialog (pd); } -static BonoboObject * -factory_fn (BonoboGenericFactory *generic_factory, - const char *id, - void *data) +BonoboObject * +e_summary_preferences_create_control (void) { PropertyData *pd; GtkWidget *widget; @@ -1263,13 +1259,9 @@ factory_fn (BonoboGenericFactory *generic_factory, return BONOBO_OBJECT (pd->config_control); } -gboolean -e_summary_preferences_register_config_control_factory (GNOME_Evolution_Shell corba_shell) +/* FIXME this kinda sucks. */ +void +e_summary_preferences_init_control (GNOME_Evolution_Shell corba_shell) { - if (bonobo_generic_factory_new (FACTORY_ID, factory_fn, NULL) == NULL) - return FALSE; - global_shell = corba_shell; - - return TRUE; } diff --git a/my-evolution/e-summary-preferences.h b/my-evolution/e-summary-preferences.h index 6b473fecab..2a706af02e 100644 --- a/my-evolution/e-summary-preferences.h +++ b/my-evolution/e-summary-preferences.h @@ -33,7 +33,7 @@ ESummaryPrefs *e_summary_preferences_copy (ESummaryPrefs *prefs); ESummaryPrefs *e_summary_preferences_init (void); ESummaryPrefs *e_summary_preferences_get_global (void); -gboolean e_summary_preferences_register_config_control_factory (GNOME_Evolution_Shell shell); - +BonoboObject *e_summary_preferences_create_control (void); +void e_summary_preferences_init_control (GNOME_Evolution_Shell shell); #endif diff --git a/my-evolution/main.c b/my-evolution/main.c deleted file mode 100644 index 7ac3337ea1..0000000000 --- a/my-evolution/main.c +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* main.c - * - * Copyright (C) 2001 Ximian, Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Author: Iain Holmes - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include - -#include - -#include - -#include - -#include - -#include "component-factory.h" - - -int -main (int argc, - char **argv) -{ - /* Make ElectricFence work. */ - free (malloc (10)); - - bindtextdomain (PACKAGE, EVOLUTION_LOCALEDIR); - textdomain (PACKAGE); - - gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE, argc, argv, - GNOME_PROGRAM_STANDARD_PROPERTIES, - GNOME_PARAM_HUMAN_READABLE_NAME, _("Evolution Summary"), - NULL); - - e_cursors_init (); - - /* Start our component */ - component_factory_init (); - - bonobo_main (); - - return 0; -} -- cgit v1.2.3