diff options
Diffstat (limited to 'executive-summary/evolution-services')
3 files changed, 30 insertions, 105 deletions
diff --git a/executive-summary/evolution-services/executive-summary-component-factory-client.c b/executive-summary/evolution-services/executive-summary-component-factory-client.c index f798341c80..19114bfa6f 100644 --- a/executive-summary/evolution-services/executive-summary-component-factory-client.c +++ b/executive-summary/evolution-services/executive-summary-component-factory-client.c @@ -33,7 +33,6 @@ #include <Executive-Summary.h> #include "executive-summary-component-factory-client.h" -#include "executive-summary.h" #define PARENT_TYPE BONOBO_OBJECT_CLIENT_TYPE static BonoboObjectClass *parent_class = NULL; diff --git a/executive-summary/evolution-services/executive-summary-component.c b/executive-summary/evolution-services/executive-summary-component.c index 609b31939b..5339defc6b 100644 --- a/executive-summary/evolution-services/executive-summary-component.c +++ b/executive-summary/evolution-services/executive-summary-component.c @@ -45,9 +45,6 @@ static BonoboObjectClass *factory_parent_class; struct _ExecutiveSummaryComponentPrivate { int dummy; -#if 0 - ExecutiveSummaryClient *owner_client; -#endif }; struct _ExecutiveSummaryComponentFactoryPrivate { @@ -82,54 +79,6 @@ create_servant (void) } static void -impl_GNOME_Evolution_Summary_Component_set_owner (PortableServer_Servant servant, - GNOME_Evolution_Summary_ViewFrame summary, - CORBA_Environment *ev) -{ -#if 0 - - BonoboObject *bonobo_object; - ExecutiveSummaryComponent *component; - ExecutiveSummaryComponentPrivate *priv; - ExecutiveSummaryClient *client; - GNOME_Evolution_Summary_ViewFrame summary_duplicate; - - bonobo_object = bonobo_object_from_servant (servant); - component = EXECUTIVE_SUMMARY_COMPONENT (bonobo_object); - priv = component->private; - - /* Create a summary client */ - client = gtk_type_new (executive_summary_client_get_type ()); - - summary_duplicate = CORBA_Object_duplicate (summary, ev); - executive_summary_client_construct (client, summary_duplicate); - - priv->owner_client = client; -#endif -} - -static void -impl_GNOME_Evolution_Summary_Component_unset_owner (PortableServer_Servant servant, - CORBA_Environment *ev) -{ -#if 0 - BonoboObject *bonobo_object; - ExecutiveSummaryComponent *component; - ExecutiveSummaryComponentPrivate *priv; - - bonobo_object = bonobo_object_from_servant (servant); - component = EXECUTIVE_SUMMARY_COMPONENT (bonobo_object); - priv = component->private; - - if (priv->owner_client == NULL) - return; - - bonobo_object_unref (BONOBO_OBJECT (priv->owner_client)); - priv->owner_client = NULL; -#endif -} - -static void executive_summary_component_destroy (GtkObject *object) { ExecutiveSummaryComponent *component; @@ -173,8 +122,6 @@ corba_class_init (void) base_epv->default_POA = NULL; epv = g_new0 (POA_GNOME_Evolution_Summary_Component__epv, 1); - epv->setOwner = impl_GNOME_Evolution_Summary_Component_set_owner; - epv->unsetOwner = impl_GNOME_Evolution_Summary_Component_unset_owner; vepv = &SummaryComponent_vepv; vepv->_base_epv = base_epv; @@ -249,54 +196,6 @@ executive_summary_component_new (void) return BONOBO_OBJECT (component); } -#if 0 -void -executive_summary_component_flash (ExecutiveSummaryComponent *component, - gpointer view) -{ - ExecutiveSummaryComponentPrivate *priv; - int id; - - g_return_if_fail (component != NULL); - g_return_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT (component)); - - priv = component->private; - - if (priv->owner_client == NULL) { - g_warning ("Component not owned!"); - return; - } - - id = executive_summary_component_view_get_id (EXECUTIVE_SUMMARY_COMPONENT_VIEW (view)); - - executive_summary_client_flash (priv->owner_client, id); -} - -void -executive_summary_component_update (ExecutiveSummaryComponent *component, - gpointer view) -{ - ExecutiveSummaryComponentPrivate *priv; - int id; - const char *html; - - g_return_if_fail (component != NULL); - g_return_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT (component)); - - priv = component->private; - - if (priv->owner_client == NULL) { - g_warning ("Component not ownded!"); - return; - } - - id = executive_summary_component_view_get_id (EXECUTIVE_SUMMARY_COMPONENT_VIEW (view)); - html = executive_summary_component_view_get_html (EXECUTIVE_SUMMARY_COMPONENT_VIEW (view)); - - executive_summary_client_update (priv->owner_client, id, html); -} -#endif - /**** ComponentFactory implementation ****/ @@ -337,13 +236,15 @@ impl_GNOME_Evolution_Summary_ComponentFactory_createView (PortableServer_Servant factory = EXECUTIVE_SUMMARY_COMPONENT_FACTORY (bonobo_object); priv = factory->private; - g_warning ("Hello?"); view = (* priv->create_view) (factory, priv->closure); g_return_val_if_fail (view != NULL, CORBA_OBJECT_NIL); component = bonobo_object_corba_objref (BONOBO_OBJECT (view)); + CORBA_exception_init (&ev2); + component_dup = CORBA_Object_duplicate (component, &ev2); + CORBA_exception_free (&ev2); - return component; + return component_dup; } static void diff --git a/executive-summary/evolution-services/executive-summary-html-view.c b/executive-summary/evolution-services/executive-summary-html-view.c index ef90461623..ebc3ae9b23 100644 --- a/executive-summary/evolution-services/executive-summary-html-view.c +++ b/executive-summary/evolution-services/executive-summary-html-view.c @@ -27,6 +27,7 @@ #endif #include <bonobo.h> +#include <bonobo/bonobo-event-source.h> #include <gnome.h> #include <gal/util/e-util.h> @@ -42,6 +43,8 @@ static void executive_summary_html_view_class_init (ExecutiveSummaryHtmlViewClas static BonoboObjectClass *parent_class; struct _ExecutiveSummaryHtmlViewPrivate { + BonoboEventSource *event_source; + char *html; }; @@ -103,7 +106,7 @@ executive_summary_html_view_destroy (GtkObject *object) view->private = NULL; - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + GTK_OBJECT_CLASS (parent_class)->destroy (object); } static void @@ -147,6 +150,7 @@ executive_summary_html_view_init (ExecutiveSummaryHtmlView *view) priv = g_new (ExecutiveSummaryHtmlViewPrivate, 1); priv->html = NULL; + priv->event_source = NULL; view->private = priv; } @@ -159,9 +163,18 @@ static void executive_summary_html_view_construct (ExecutiveSummaryHtmlView *view, GNOME_Evolution_Summary_HTMLView corba_object) { + ExecutiveSummaryHtmlViewPrivate *priv; + g_return_if_fail (view != NULL); g_return_if_fail (corba_object != CORBA_OBJECT_NIL); + priv = view->private; + + priv->event_source = bonobo_event_source_new (); + g_warning ("new event source: %p", priv->event_source); + bonobo_object_add_interface (BONOBO_OBJECT (view), + BONOBO_OBJECT (priv->event_source)); + bonobo_object_construct (BONOBO_OBJECT (view), corba_object); } @@ -206,6 +219,8 @@ executive_summary_html_view_set_html (ExecutiveSummaryHtmlView *view, const char *html) { ExecutiveSummaryHtmlViewPrivate *priv; + CORBA_any any; + CORBA_short s; g_return_if_fail (view != NULL); g_return_if_fail (IS_EXECUTIVE_SUMMARY_HTML_VIEW (view)); @@ -218,6 +233,16 @@ executive_summary_html_view_set_html (ExecutiveSummaryHtmlView *view, priv->html = g_strdup (html); else priv->html = NULL; + + /* Notify any listeners */ + s = 0; + + any._type = (CORBA_TypeCode) TC_short; + any._value = &s; + + g_warning ("Notifying event source: %p", priv->event_source); + bonobo_event_source_notify_listeners (BONOBO_EVENT_SOURCE (priv->event_source), + "html_changed", &any, NULL); } /** * executive_summary_html_view_get_html: |