diff options
author | Miguel de Icaza <miguel@helixcode.com> | 2001-01-12 07:20:37 +0800 |
---|---|---|
committer | Miguel de Icaza <miguel@src.gnome.org> | 2001-01-12 07:20:37 +0800 |
commit | c6737bc9e8da67083a455a2b3f0e5704290ab06c (patch) | |
tree | 0174acc088461cdf45483090c4c8b29caac59f76 /composer | |
parent | 5a405a2c31ce8e3a6e14ab991a3e019243c14292 (diff) | |
download | gsoc2013-evolution-c6737bc9e8da67083a455a2b3f0e5704290ab06c.tar.gz gsoc2013-evolution-c6737bc9e8da67083a455a2b3f0e5704290ab06c.tar.zst gsoc2013-evolution-c6737bc9e8da67083a455a2b3f0e5704290ab06c.zip |
Add an ItemContainer Bonobo interface to allow client applications to
2001-01-10 Miguel de Icaza <miguel@helixcode.com>
* evolution-composer.c (evolution_composer_construct): Add an
ItemContainer Bonobo interface to allow client applications to
locate the Message Composer component.
svn path=/trunk/; revision=7416
Diffstat (limited to 'composer')
-rw-r--r-- | composer/ChangeLog | 8 | ||||
-rw-r--r-- | composer/e-msg-composer.c | 52 | ||||
-rw-r--r-- | composer/e-msg-composer.h | 3 | ||||
-rw-r--r-- | composer/evolution-composer.c | 26 |
4 files changed, 86 insertions, 3 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog index 02e4efec96..10edf9858f 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,9 @@ +2001-01-10 Miguel de Icaza <miguel@helixcode.com> + + * evolution-composer.c (evolution_composer_construct): Add an + ItemContainer Bonobo interface to allow client applications to + locate the Message Composer component. + 2001-01-11 Jeffrey Stedfast <fejj@helixcode.com> * e-msg-composer.c (menu_file_save_draft_cb): New callback to save @@ -8,6 +14,8 @@ * e-msg-composer.c: Removed more UNSAFE stuff. Maybe we should kill this macro, and have people that want these broken things define their own macros. + (setup_item_container): Add an ItemContainer bonobo interface to + handle options to the window component. 2001-01-08 Jeffrey Stedfast <fejj@helixcode.com> diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 0527375e52..b75813f568 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -37,6 +37,7 @@ #include <bonobo.h> #include <bonobo/bonobo-stream-memory.h> +#include <bonobo/bonobo-item-handler.h> #include <glade/glade.h> #include <gnome.h> #include <libgnorba/gnorba.h> @@ -1429,6 +1430,54 @@ e_msg_composer_construct (EMsgComposer *composer) gtk_widget_grab_focus (composer->editor); } +static Bonobo_ItemContainer_ObjectList * +msg_composer_enum_objects (BonoboItemHandler *handler, gpointer data, CORBA_Environment *ev) +{ +#warning "This function is not implemented because enumObjects has a broken CORBA prototype" + return NULL; +} + + +static Bonobo_Unknown +msg_composer_get_object (BonoboItemHandler *h, const char *item_name, + gboolean only_if_exists, + gpointer data, CORBA_Environment *ev) +{ + EMsgComposer *composer = data; + GSList *options, *l; + + options = bonobo_item_option_parse (item_name); + for (l = options; l; l = l->next){ + BonoboItemOption *option = l->data; + + if (strcmp (option->key, "visible")){ + gboolean show = 1; + + if (option->value) + show = atoi (option->value); + + if (show) + gtk_widget_show (GTK_WIDGET (composer)); + else + gtk_widget_hide (GTK_WIDGET (composer)); + } + } + return bonobo_object_dup_ref ( + BONOBO_OBJECT (composer)->corba_objref, ev); +} + +static void +setup_item_container (EMsgComposer *composer) +{ + composer->item_container = BONOBO_OBJECT (bonobo_item_handler_new ( + msg_composer_enum_objects, + msg_composer_get_object, composer)); + + bonobo_object_add_interface ( + BONOBO_OBJECT (composer), + composer->item_container); +} + static EMsgComposer * create_composer (void) { @@ -1443,7 +1492,8 @@ create_composer (void) return NULL; } prepare_engine (new); - + setup_item_container (new); + return new; } diff --git a/composer/e-msg-composer.h b/composer/e-msg-composer.h index 58fd9c689a..069c45ab2f 100644 --- a/composer/e-msg-composer.h +++ b/composer/e-msg-composer.h @@ -68,7 +68,8 @@ struct _EMsgComposer { GNOME_GtkHTML_Editor_Engine editor_engine; BonoboObject *editor_listener; GHashTable *inline_images; - + BonoboObject *item_container; + char *sig_file; gboolean attachment_bar_visible : 1; diff --git a/composer/evolution-composer.c b/composer/evolution-composer.c index b4614d6c50..45a6949eb3 100644 --- a/composer/evolution-composer.c +++ b/composer/evolution-composer.c @@ -27,7 +27,7 @@ #include <camel/camel.h> #include <gal/util/e-util.h> #include <gal/widgets/e-gui-utils.h> - +#include <bonobo/bonobo-item-handler.h> #include "evolution-composer.h" #define PARENT_TYPE BONOBO_OBJECT_TYPE @@ -247,15 +247,39 @@ init (EvolutionComposer *composer) } +static Bonobo_ItemContainer_ObjectList * +enum_objects (BonoboItemHandler *handler, gpointer data, CORBA_Environment *ev) +{ +#warning "This function is not implemented because enumObjects has a broken CORBA prototype"); +} + +static Bonobo_Unknown +get_object (BonoboItemHandler *h, const char *item_name, gboolean only_if_exists, + gpointer data, CORBA_Environment *ev) +{ + EvolutionComposer *composer = data; + + if (strcmp (item_name, "composer_window") == 0) + return bonobo_object_dup_ref ( + BONOBO_OBJECT (composer->composer)->corba_objref, ev); + + return CORBA_OBJECT_NIL; +} + void evolution_composer_construct (EvolutionComposer *composer, GNOME_Evolution_Composer corba_object) { + BonoboObject *item_handler; + g_return_if_fail (composer != NULL); g_return_if_fail (EVOLUTION_IS_COMPOSER (composer)); g_return_if_fail (corba_object != CORBA_OBJECT_NIL); bonobo_object_construct (BONOBO_OBJECT (composer), corba_object); + + item_handler = bonobo_item_handler_new (enum_objects, get_object, composer); + bonobo_object_add_interface (BONOBO_OBJECT (composer), BONOBO_OBJECT (item_handler)); } EvolutionComposer * |