aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2002-12-05 03:52:45 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2002-12-05 03:52:45 +0800
commite53eacd2d9b6b775dab6e8bd8cd39f0691192437 (patch)
treef7bbd92c815ecd7fdbe85ec97d1c693b1c4b8fd0
parent51a6fc1a8f6369014d91801ffb88aa2fa6f65cd4 (diff)
downloadgsoc2013-evolution-e53eacd2d9b6b775dab6e8bd8cd39f0691192437.tar.gz
gsoc2013-evolution-e53eacd2d9b6b775dab6e8bd8cd39f0691192437.tar.zst
gsoc2013-evolution-e53eacd2d9b6b775dab6e8bd8cd39f0691192437.zip
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
-rw-r--r--my-evolution/ChangeLog18
-rw-r--r--my-evolution/GNOME_Evolution_Summary.server.in.in27
-rw-r--r--my-evolution/Makefile.am33
-rw-r--r--my-evolution/component-factory.c34
-rw-r--r--my-evolution/e-summary-preferences.c18
-rw-r--r--my-evolution/e-summary-preferences.h4
-rw-r--r--my-evolution/main.c74
7 files changed, 60 insertions, 148 deletions
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 <ettore@ximian.com>
+
+ * 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 <NotZed@Ximian.com>
* 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 @@
<oaf_info>
+ <oaf_server iid="OAFIID:GNOME_Evolution_Summary_ComponentFactory"
+ type="shlib"
+ location="@COMPONENTDIR@/libevolution-executive-summary.so">
+
+ <oaf_attribute name="repo_ids" type="stringv">
+ <item value="IDL:Bonobo/GenericFactory:1.0"/>
+ </oaf_attribute>
+ </oaf_server>
+
<oaf_server iid="OAFIID:GNOME_Evolution_Summary_ShellComponent"
- type="exe"
- location="@LIBEXECDIR@/evolution-executive-summary">
+ type="factory"
+ location="OAFIID:GNOME_Evolution_Summary_ComponentFactory">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:GNOME/Evolution/ShellComponent:1.0"/>
@@ -18,21 +27,9 @@
</oaf_server>
- <oaf_server iid="OAFIID:GNOME_Evolution_Summary_ConfigControlFactory"
- type="exe"
- location="@LIBEXECDIR@/evolution-executive-summary">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/GenericFactory:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="description" type="string"
- _value="Factory for Evolution Summary's configuration control."/>
- </oaf_server>
-
<oaf_server iid="OAFIID:GNOME_Evolution_Summary_ConfigControl"
type="factory"
- location="OAFIID:GNOME_Evolution_Summary_ConfigControlFactory">
+ location="OAFIID:GNOME_Evolution_Summary_ComponentFactory">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:GNOME/Evolution/ConfigControl:1.0"/>
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 <config.h>
-#endif
-
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-
-#include <glib.h>
-#include <gdk/gdk.h>
-#include <gdk/gdkrgb.h>
-
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-ui-init.h>
-
-#include <bonobo/bonobo-main.h>
-
-#include <e-util/e-proxy.h>
-
-#include <glade/glade.h>
-
-#include <gconf/gconf.h>
-
-#include <gal/widgets/e-cursors.h>
-
-#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;
-}