diff options
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 20 | ||||
-rw-r--r-- | mail/GNOME_Evolution_Mail.oaf.in | 26 | ||||
-rw-r--r-- | mail/GNOME_Evolution_Mail.oafinfo | 26 | ||||
-rw-r--r-- | mail/Makefile.am | 14 | ||||
-rw-r--r-- | mail/component-factory.c | 112 | ||||
-rw-r--r-- | mail/component-factory.h | 29 | ||||
-rw-r--r-- | mail/evolution-mail.gnorba | 10 | ||||
-rw-r--r-- | mail/evolution-mail.oafinfo | 26 | ||||
-rw-r--r-- | mail/folder-browser-factory.c | 22 | ||||
-rw-r--r-- | mail/mail.h | 5 | ||||
-rw-r--r-- | mail/main.c | 9 |
11 files changed, 283 insertions, 16 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 37c96cc2dc..4790a405e9 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,23 @@ +2000-05-25 Ettore Perazzoli <ettore@helixcode.com> + + * main.c (main): Initialize the component factory. + + * Makefile.am (evolution_mail_LDADD): Link with + `evolution-shell-component.o' from the shell directory. + + * evolution-mail.oafinfo: Updated with the + Evolution::ShellComponent OAFIID. + + * evolution-mail.gnorba: Updated with the + Evolution::ShellComponent GOAD ID. + + * folder-browser-factory.c (folder_browser_factory_new_control): + New function; code moved out from `folder_browser_factory'. + (folder_browser_factory): Use it. + + * component-factory.c: New. + * component-factory.h: New. + 2000-05-24 Dan Winship <danw@helixcode.com> * mail-ops.c (composer_send_cb): connect to and disconnect from diff --git a/mail/GNOME_Evolution_Mail.oaf.in b/mail/GNOME_Evolution_Mail.oaf.in index 6c284ece5c..2be622f3f6 100644 --- a/mail/GNOME_Evolution_Mail.oaf.in +++ b/mail/GNOME_Evolution_Mail.oaf.in @@ -25,4 +25,30 @@ value="Evolution mail folder display component."/> </oaf_server> +<oaf_server iid="OAFIID:evolution-shell-component-factory:evolution-mail:0ea887d5-622b-4b8c-b525-18aa1cbe18a6" + type="exe" + location="evolution-mail"> + + <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 the Evolution mail component."/> + +</oaf_server> + +<oaf_server iid="OAFIID:evolution-shell-component:evolution-mail:d3cb3ed6-a654-4337-8aa0-f443751d6d1b" + type="factory" + location="OAFIID:evolution-shell-component-factory:evolution-mail:0ea887d5-622b-4b8c-b525-18aa1cbe18a6"> + + <oaf_attribute name="repo_ids" type="stringv"> + <item value="IDL:Evolution/ShellComponent:1.0"/> + </oaf_attribute> + + <oaf_attribute name="description" type="string" + value="Evolution component for handling mail."/> + +</oaf_server> + </oaf_info> diff --git a/mail/GNOME_Evolution_Mail.oafinfo b/mail/GNOME_Evolution_Mail.oafinfo index 6c284ece5c..2be622f3f6 100644 --- a/mail/GNOME_Evolution_Mail.oafinfo +++ b/mail/GNOME_Evolution_Mail.oafinfo @@ -25,4 +25,30 @@ value="Evolution mail folder display component."/> </oaf_server> +<oaf_server iid="OAFIID:evolution-shell-component-factory:evolution-mail:0ea887d5-622b-4b8c-b525-18aa1cbe18a6" + type="exe" + location="evolution-mail"> + + <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 the Evolution mail component."/> + +</oaf_server> + +<oaf_server iid="OAFIID:evolution-shell-component:evolution-mail:d3cb3ed6-a654-4337-8aa0-f443751d6d1b" + type="factory" + location="OAFIID:evolution-shell-component-factory:evolution-mail:0ea887d5-622b-4b8c-b525-18aa1cbe18a6"> + + <oaf_attribute name="repo_ids" type="stringv"> + <item value="IDL:Evolution/ShellComponent:1.0"/> + </oaf_attribute> + + <oaf_attribute name="description" type="string" + value="Evolution component for handling mail."/> + +</oaf_server> + </oaf_info> diff --git a/mail/Makefile.am b/mail/Makefile.am index 2666edc1bb..7d78ab5ea6 100644 --- a/mail/Makefile.am +++ b/mail/Makefile.am @@ -12,6 +12,7 @@ INCLUDES = \ -I$(top_srcdir) \ -I$(top_srcdir)/camel \ -I$(top_builddir)/shell \ + -I$(top_srcdir)/shell \ $(BONOBO_HTML_GNOME_CFLAGS) \ -DEVOLUTION_VERSION=\""$(VERSION)"\" \ -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ @@ -27,8 +28,17 @@ EVOLUTION_MAIL_CORBA_GENERATED = \ Mail-skels.c \ Mail-stubs.c +# FIXME We should make a libeshell library instead of this gross hack. +SHELL_OBJS = \ + $(top_builddir)/shell/Evolution-common.o \ + $(top_builddir)/shell/Evolution-stubs.o \ + $(top_builddir)/shell/Evolution-skels.o \ + $(top_builddir)/shell/evolution-shell-component.o + evolution_mail_SOURCES = \ $(EVOLUTION_MAIL_CORBA_GENERATED) \ + component-factory.c \ + component-factory.h \ folder-browser.c \ folder-browser.h \ folder-browser-factory.c \ @@ -48,9 +58,7 @@ evolution_mail_SOURCES = \ evolution_mail_LDADD = \ - ../shell/Evolution-common.o \ - ../shell/Evolution-stubs.o \ - ../shell/Evolution-skels.o \ + $(SHELL_OBJS) \ ../composer/libcomposer.la \ $(top_builddir)/widgets/e-paned/libepaned.a \ ../widgets/e-table/libetable.a \ diff --git a/mail/component-factory.c b/mail/component-factory.c new file mode 100644 index 0000000000..5983c4548a --- /dev/null +++ b/mail/component-factory.c @@ -0,0 +1,112 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* component-factory.c + * + * Copyright (C) 2000 Helix Code, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * 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: Ettore Perazzoli + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <bonobo.h> + +#include "evolution-shell-component.h" +#include "folder-browser.h" +#include "mail.h" /* YUCK FIXME */ + +#include "component-factory.h" + + +#ifdef USING_OAF +#define COMPONENT_FACTORY_ID "OAFIID:evolution-shell-component-factory:evolution-mail:0ea887d5-622b-4b8c-b525-18aa1cbe18a6" +#else +#define COMPONENT_FACTORY_ID "evolution-shell-component-factory:evolution-mail" +#endif + +static BonoboGenericFactory *factory = NULL; + +static const EvolutionShellComponentFolderType folder_types[] = { + { "mail", "evolution-inbox.png" }, + { NULL, NULL } +}; + + +/* EvolutionShellComponent methods and signals. */ + +static BonoboControl * +create_view (EvolutionShellComponent *shell_component, + const char *physical_uri, + void *closure) +{ + BonoboControl *control; + GtkWidget *folder_browser_widget; + + control = folder_browser_factory_new_control (); + + folder_browser_widget = bonobo_control_get_widget (control); + + g_assert (folder_browser_widget != NULL); + g_assert (IS_FOLDER_BROWSER (folder_browser_widget)); + + /* FIXME: This never fails. :-/ */ + folder_browser_set_uri (FOLDER_BROWSER (folder_browser_widget), physical_uri); + + return control; +} + +static void +owner_set_cb (EvolutionShellComponent *shell_component, + Evolution_Shell shell_interface) +{ + g_print ("evolution-mail: Yeeeh! We have an owner!\n"); /* FIXME */ +} + + +/* The factory function. */ + +static BonoboObject * +factory_fn (BonoboGenericFactory *factory, + void *closure) +{ + EvolutionShellComponent *shell_component; + + shell_component = evolution_shell_component_new (folder_types, create_view, NULL); + + gtk_signal_connect (GTK_OBJECT (shell_component), "owner_set", + GTK_SIGNAL_FUNC (owner_set_cb), NULL); + + return BONOBO_OBJECT (shell_component); +} + + +void +component_factory_init (void) +{ + if (factory != NULL) + return; + + factory = bonobo_generic_factory_new (COMPONENT_FACTORY_ID, factory_fn, NULL); + + if (factory == NULL) { + e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, + _("Cannot initialize Evolution's mail component.")); + exit (1); + } +} diff --git a/mail/component-factory.h b/mail/component-factory.h new file mode 100644 index 0000000000..1f5a33f407 --- /dev/null +++ b/mail/component-factory.h @@ -0,0 +1,29 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* component-factory.h + * + * Copyright (C) 2000 Helix Code, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * 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: Ettore Perazzoli + */ + +#ifndef COMPONENT_FACTORY_H +#define COMPONENT_FACTORY_H + +void component_factory_init (void); + +#endif diff --git a/mail/evolution-mail.gnorba b/mail/evolution-mail.gnorba index 7eb90dbc8a..b799a57aa2 100644 --- a/mail/evolution-mail.gnorba +++ b/mail/evolution-mail.gnorba @@ -10,4 +10,14 @@ repo_id=IDL:BonoboControl/evolution-mail:1.0 IDL:GNOME/Control:1.0 description=Evolution mail folder display component. location_info=control-factory:evolution-mail +[evolution-shell-component-factory:evolution-mail] +type=exe +repo_id=IDL:GNOME/GenericFactory:1.0 +description=Factory for the Evolution mail component. +location_info=evolution-mail +[evolution-shell-component:evolution-mail] +type=factory +repo_id=IDL:Evolution/ShellComponent:1.0 +description=Evolution component for handling mail. +location_info=evolution-shell-component-factory:evolution-mail diff --git a/mail/evolution-mail.oafinfo b/mail/evolution-mail.oafinfo index 6c284ece5c..2be622f3f6 100644 --- a/mail/evolution-mail.oafinfo +++ b/mail/evolution-mail.oafinfo @@ -25,4 +25,30 @@ value="Evolution mail folder display component."/> </oaf_server> +<oaf_server iid="OAFIID:evolution-shell-component-factory:evolution-mail:0ea887d5-622b-4b8c-b525-18aa1cbe18a6" + type="exe" + location="evolution-mail"> + + <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 the Evolution mail component."/> + +</oaf_server> + +<oaf_server iid="OAFIID:evolution-shell-component:evolution-mail:d3cb3ed6-a654-4337-8aa0-f443751d6d1b" + type="factory" + location="OAFIID:evolution-shell-component-factory:evolution-mail:0ea887d5-622b-4b8c-b525-18aa1cbe18a6"> + + <oaf_attribute name="repo_ids" type="stringv"> + <item value="IDL:Evolution/ShellComponent:1.0"/> + </oaf_attribute> + + <oaf_attribute name="description" type="string" + value="Evolution component for handling mail."/> + +</oaf_server> + </oaf_info> diff --git a/mail/folder-browser-factory.c b/mail/folder-browser-factory.c index de9d9ff06e..23e5550594 100644 --- a/mail/folder-browser-factory.c +++ b/mail/folder-browser-factory.c @@ -127,13 +127,8 @@ control_destroy_cb (BonoboControl *control, gtk_object_destroy (GTK_OBJECT (folder_browser)); } -/* - * Creates the Folder Browser, wraps it in a Bonobo Control, and - * sets the Bonobo Control properties to point to the Folder Browser - * Properties - */ -static BonoboObject * -folder_browser_factory (BonoboGenericFactory *factory, void *closure) +BonoboControl * +folder_browser_factory_new_control (void) { BonoboControl *control; GtkWidget *folder_browser; @@ -160,7 +155,18 @@ folder_browser_factory (BonoboGenericFactory *factory, void *closure) bonobo_control_set_property_bag (control, FOLDER_BROWSER (folder_browser)->properties); - return BONOBO_OBJECT (control); + return control; +} + +/* + * Creates the Folder Browser, wraps it in a Bonobo Control, and + * sets the Bonobo Control properties to point to the Folder Browser + * Properties + */ +static BonoboObject * +folder_browser_factory (BonoboGenericFactory *factory, void *closure) +{ + return BONOBO_OBJECT (folder_browser_factory_new_control ()); } void diff --git a/mail/mail.h b/mail/mail.h index b9275a29d6..a7c1a9f3aa 100644 --- a/mail/mail.h +++ b/mail/mail.h @@ -22,8 +22,11 @@ #include "camel/camel.h" #include "composer/e-msg-composer.h" +/* FIXME FIXME FIXME this sucks sucks sucks sucks */ + /* folder-browser-factory */ -void folder_browser_factory_init (void); +void folder_browser_factory_init (void); +BonoboControl *folder_browser_factory_new_control (void); /* mail-config */ void mail_config_druid (void); diff --git a/mail/main.c b/mail/main.c index 737b6df11a..0355c5534c 100644 --- a/mail/main.c +++ b/mail/main.c @@ -6,12 +6,16 @@ * * (C) 2000 Helix Code, Inc. */ + #include <config.h> #include <gnome.h> #include <bonobo/bonobo-main.h> #include <glade/glade.h> + #include "e-util/e-gui-utils.h" #include "e-util/e-cursors.h" + +#include "component-factory.h" #include "mail.h" #ifdef USING_OAF @@ -71,12 +75,9 @@ main (int argc, char *argv []) e_cursors_init (); folder_browser_factory_init (); + component_factory_init (); bonobo_main (); return 0; } - - - - |