From 3e5f3687c7460009c93e876ae0ab7eb0e2a71648 Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Wed, 27 Dec 2000 00:03:11 +0000 Subject: More fixes for new bonobo pt 2 svn path=/trunk/; revision=7178 --- executive-summary/component/e-summary.c | 103 +++++++++----------------------- 1 file changed, 28 insertions(+), 75 deletions(-) (limited to 'executive-summary/component/e-summary.c') diff --git a/executive-summary/component/e-summary.c b/executive-summary/component/e-summary.c index ef95c7e8b1..12ed32376e 100644 --- a/executive-summary/component/e-summary.c +++ b/executive-summary/component/e-summary.c @@ -337,25 +337,13 @@ make_control_html (ESummaryWindow *window, { char *html, *tmp; int id = GPOINTER_TO_INT (window); - gboolean u, d, l, r, config; + gboolean config; - u = d = l = r = config = TRUE; + config = TRUE; if (window->propertycontrol == CORBA_OBJECT_NIL) config = FALSE; - if (row == 0) /* Top row */ - u = FALSE; - - if (row >= numwindows - 3) /* Bottom row */ - d = FALSE; - - if (col == 0) /* Leftmost column */ - l = FALSE; - - if (col == 2 || ((row * 3) + col) == numwindows - 1) /* Rightmost column */ - r = FALSE; - html = g_strdup_printf ("
" "" "
", id); @@ -371,53 +359,6 @@ make_control_html (ESummaryWindow *window, } g_free (tmp); -#if 0 - tmp = html; - if (!l) { - html = g_strdup_printf ("%s" - "", tmp); - } else { - html = g_strdup_printf ("%s" - "" - "", tmp, id); - } - g_free (tmp); - - tmp = html; - if (!r) { - html = g_strdup_printf ("%s" - "
", tmp); - } else { - html = g_strdup_printf ("%s" - "" - "", tmp, id); - } - g_free (tmp); - - - tmp = html; - if (!d) { - html = g_strdup_printf ("%s" - "", tmp); - } else { - html = g_strdup_printf ("%s" - "" - "", tmp, id); - } - g_free (tmp); - - tmp = html; - if (!u) { - html = g_strdup_printf ("%s" - "", tmp); - } else { - html = g_strdup_printf ("%s" - "" - "", tmp, id); - } - g_free (tmp); - -#endif return html; } @@ -648,9 +589,10 @@ html_event (BonoboListener *listener, } static void -prop_changed_cb (BonoboPropertyListener *listener, +prop_changed_cb (BonoboListener *listener, char *name, BonoboArg *arg, + CORBA_Environment *ev, ESummaryWindow *window) { if (strcmp (name, "window_title") == 0) { @@ -678,7 +620,6 @@ e_summary_add_service (ESummary *esummary, ESummaryWindow *window; ESummaryPrivate *priv; Bonobo_Unknown unknown = CORBA_OBJECT_NIL; - Bonobo_PropertyListener corba_listener; CORBA_Environment ev; g_return_val_if_fail (esummary != NULL, NULL); @@ -718,6 +659,16 @@ e_summary_add_service (ESummary *esummary, return NULL; } + window->event_source = Bonobo_Unknown_queryInterface(window->component, + "IDL:Bonobo/EventSource:1.0", &ev); + if (window->event_source == CORBA_OBJECT_NIL) { + g_warning ("There is no Bonobo::EventSource interface"); + + /* FIXME: Free whatever objects exist */ + g_free (window); + return NULL; + } + if (window->html != CORBA_OBJECT_NIL) { Bonobo_Listener listener; CORBA_Environment ev2; @@ -762,19 +713,21 @@ e_summary_add_service (ESummary *esummary, window->propertybag, "window_icon", NULL)); /* Listen to changes */ - window->listener = bonobo_property_listener_new (); - gtk_signal_connect (GTK_OBJECT (window->listener), "prop_changed", - GTK_SIGNAL_FUNC (prop_changed_cb), window); - corba_listener = bonobo_object_corba_objref (BONOBO_OBJECT (window->listener)); - Bonobo_PropertyBag_addChangeListener (window->propertybag, - "window_title", - corba_listener, &ev); - - Bonobo_PropertyBag_addChangeListener (window->propertybag, - "window_icon", - corba_listener, &ev); - CORBA_exception_free (&ev); + if (window->propertycontrol != CORBA_OBJECT_NIL) { + Bonobo_Listener listener; + CORBA_Environment ev2; + + window->listener = bonobo_listener_new (NULL, NULL); + listener = bonobo_object_corba_objref (BONOBO_OBJECT (window->html_listener)); + Bonobo_EventSource_addListener (window->event_source, + listener, &ev); + + gtk_signal_connect (GTK_OBJECT (window->listener), "event_notify", + GTK_SIGNAL_FUNC (prop_changed_cb), window); + } + + CORBA_exception_free (&ev); priv->window_list = g_list_append (priv->window_list, window); return window; -- cgit v1.2.3