aboutsummaryrefslogtreecommitdiffstats
path: root/mail/component-factory.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2003-01-09 20:17:19 +0800
committerMichael Zucci <zucchi@src.gnome.org>2003-01-09 20:17:19 +0800
commit6e9cb1e2bf29610e0d111572e72244b11542cc8d (patch)
tree21db40dbfab1d71cd0316457ed3679f362bef96f /mail/component-factory.c
parent45d0c39700d2d6ee12f45c17778d69f3119ba078 (diff)
downloadgsoc2013-evolution-6e9cb1e2bf29610e0d111572e72244b11542cc8d.tar
gsoc2013-evolution-6e9cb1e2bf29610e0d111572e72244b11542cc8d.tar.gz
gsoc2013-evolution-6e9cb1e2bf29610e0d111572e72244b11542cc8d.tar.bz2
gsoc2013-evolution-6e9cb1e2bf29610e0d111572e72244b11542cc8d.tar.lz
gsoc2013-evolution-6e9cb1e2bf29610e0d111572e72244b11542cc8d.tar.xz
gsoc2013-evolution-6e9cb1e2bf29610e0d111572e72244b11542cc8d.tar.zst
gsoc2013-evolution-6e9cb1e2bf29610e0d111572e72244b11542cc8d.zip
Added druidpagestart1 to the pages list. (construct): Change the limits on
2003-01-09 Not Zed <NotZed@Ximian.com> * mail-config-druid.c: Added druidpagestart1 to the pages list. (construct): Change the limits on the page initialisation, and widget_show_all on the page rather than the content. * GNOME_Evolution_Mail.server.in.in: Make Mail a shlib component. * folder-info.c (evolution_folder_info_factory_init): Removed. (evolution_folder_info_factory_fn): renamed to evolution_folder_info_new(). * mail-config-druid.c (evolution_mail_config_wizard_factory_fn): Renamed to evolution_mail_config_wizard_new(). (evolution_mail_config_wizard_init): Removed. * mail-config-factory.c (mail_config_register_factory): Remove. (config_control_factory_cb): make this public. * Makefile.am: setup evolution-mail as a shared library. * component-factory.c (make_factory): implement the bonobo-plugin factory for shlib operation. Also, preliminary work to setup mailer-specific (factory): Implement the factory which starts various components. * mail-config.c (xml_get_prop): g_free->xmlFree (account_to_xml): copy xml memory to glib memory when adding the 0 on the end of the string. (accounts_save): Use slightly different logic with appending to the tail of the list, we can't use the &node trick with gslists. (accounts_changed): Same here. svn path=/trunk/; revision=19362
Diffstat (limited to 'mail/component-factory.c')
-rw-r--r--mail/component-factory.c112
1 files changed, 110 insertions, 2 deletions
diff --git a/mail/component-factory.c b/mail/component-factory.c
index 2e2cdb4c2c..652f62fcd2 100644
--- a/mail/component-factory.c
+++ b/mail/component-factory.c
@@ -943,9 +943,8 @@ owner_unset_cb (EvolutionShellComponent *shell_component, gpointer user_data)
{
GConfClient *gconf;
int i;
-
+
gconf = gconf_client_get_default ();
-
for (i=0;i<sizeof(shell_component_handlers)/sizeof(shell_component_handlers[0]);i++)
g_signal_handler_disconnect((GtkObject *)shell_component, shell_component_handlers[i].hand);
@@ -1596,3 +1595,112 @@ mail_storages_foreach (GHFunc func, gpointer data)
{
g_hash_table_foreach (storages_hash, func, data);
}
+
+
+
+#include <signal.h>
+
+#include <bonobo/bonobo-shlib-factory.h>
+#include "folder-info.h"
+#include "mail-preferences.h"
+#include "mail-composer-prefs.h"
+
+#define FACTORY_ID "OAFIID:GNOME_Evolution_Mail_ControlFactory"
+
+#define MAIL_CONFIG_IID "OAFIID:GNOME_Evolution_MailConfig"
+#define WIZARD_IID "OAFIID:GNOME_Evolution_Mail_Wizard"
+#define FOLDER_INFO_IID "OAFIID:GNOME_Evolution_FolderInfo"
+
+static BonoboObject *
+factory (BonoboGenericFactory *factory,
+ const char *component_id,
+ void *closure)
+{
+ printf("Activating component '%s'\n", component_id);
+
+ if (strcmp (component_id, COMPONENT_ID) == 0)
+ return create_component();
+ else if (strcmp(component_id, MAIL_CONFIG_IID) == 0)
+ return (BonoboObject *)g_object_new (evolution_mail_config_get_type (), NULL);
+ else if (strcmp(component_id, FOLDER_INFO_IID) == 0)
+ return evolution_folder_info_new();
+ else if (strcmp(component_id, WIZARD_IID) == 0)
+ return evolution_mail_config_wizard_new();
+
+#warning "font prefs"
+#define MAIL_FONT_PREFS_CONTROL_ID "OAFIID:GNOME_Evolution_Mail_FontPrefs_ConfigControl"
+
+ else if (strcmp (component_id, MAIL_ACCOUNTS_CONTROL_ID) == 0
+ || strcmp (component_id, MAIL_PREFERENCES_CONTROL_ID) == 0
+ || strcmp (component_id, MAIL_COMPOSER_PREFS_CONTROL_ID) == 0
+ || strcmp (component_id, MAIL_FONT_PREFS_CONTROL_ID) == 0)
+ return config_control_factory_cb(factory, component_id, evolution_shell_client_corba_objref (global_shell_client));
+
+ g_warning (FACTORY_ID ": Don't know what to do with %s", component_id);
+ return NULL;
+}
+
+/* The GNOME SEGV handler will lose if it's not run from the main Gtk
+ * thread. So if we crash in another thread, redirect the signal.
+ */
+static void (*gnome_segv_handler) (int);
+
+static GStaticMutex segv_mutex = G_STATIC_MUTEX_INIT;
+
+static void
+segv_redirect (int sig)
+{
+ if (pthread_self () == mail_gui_thread)
+ gnome_segv_handler (sig);
+ else {
+ pthread_kill (mail_gui_thread, sig);
+ /* We can't return from the signal handler or the
+ * thread may SEGV again. But we can't pthread_exit,
+ * because then the thread may get cleaned up before
+ * bug-buddy can get a stack trace. So we block by
+ * trying to lock a mutex we know is already locked.
+ */
+ g_static_mutex_lock (&segv_mutex);
+ }
+}
+
+
+static Bonobo_Unknown
+make_factory (PortableServer_POA poa, const char *iid, gpointer impl_ptr, CORBA_Environment *ev)
+{
+ struct sigaction sa, osa;
+ static int init = 0;
+
+ if (!init) {
+ sigaction (SIGSEGV, NULL, &osa);
+ if (osa.sa_handler != SIG_DFL) {
+ sa.sa_flags = 0;
+ sigemptyset (&sa.sa_mask);
+ sa.sa_handler = segv_redirect;
+ sigaction (SIGSEGV, &sa, NULL);
+ sigaction (SIGBUS, &sa, NULL);
+ sigaction (SIGFPE, &sa, NULL);
+
+ sa.sa_handler = SIG_IGN;
+ sigaction (SIGXFSZ, &sa, NULL);
+ gnome_segv_handler = osa.sa_handler;
+ g_static_mutex_lock (&segv_mutex);
+ }
+
+ /* init ? */
+ mail_config_init ();
+ mail_msg_init ();
+ init = 1;
+ }
+
+ return bonobo_shlib_factory_std (FACTORY_ID, poa, impl_ptr, factory, NULL, ev);
+}
+
+static BonoboActivationPluginObject plugin_list[] = {
+ {FACTORY_ID, make_factory},
+ { NULL }
+};
+const BonoboActivationPlugin Bonobo_Plugin_info = {
+ plugin_list, "Evolution Mail component factory"
+};
+