aboutsummaryrefslogtreecommitdiffstats
path: root/executive-summary/evolution-services
diff options
context:
space:
mode:
Diffstat (limited to 'executive-summary/evolution-services')
-rw-r--r--executive-summary/evolution-services/Makefile.am15
-rw-r--r--executive-summary/evolution-services/executive-summary-component-client.c158
-rw-r--r--executive-summary/evolution-services/executive-summary-component-client.h3
-rw-r--r--executive-summary/evolution-services/executive-summary-component-factory-client.c181
-rw-r--r--executive-summary/evolution-services/executive-summary-component-factory-client.h57
-rw-r--r--executive-summary/evolution-services/executive-summary-component-view.c64
-rw-r--r--executive-summary/evolution-services/executive-summary-component-view.h18
-rw-r--r--executive-summary/evolution-services/executive-summary-component.c434
-rw-r--r--executive-summary/evolution-services/executive-summary-component.h49
-rw-r--r--executive-summary/evolution-services/executive-summary-html-view.c244
-rw-r--r--executive-summary/evolution-services/executive-summary-html-view.h57
-rw-r--r--executive-summary/evolution-services/executive-summary.c6
-rw-r--r--executive-summary/evolution-services/executive-summary.h1
13 files changed, 856 insertions, 431 deletions
diff --git a/executive-summary/evolution-services/Makefile.am b/executive-summary/evolution-services/Makefile.am
index cbe9d99a55..40e2972321 100644
--- a/executive-summary/evolution-services/Makefile.am
+++ b/executive-summary/evolution-services/Makefile.am
@@ -28,7 +28,8 @@ Executive-Summary-impl.o: Executive-Summary.h
IDLS = \
$(srcdir)/../idl/Executive-Summary.idl \
$(srcdir)/../idl/Summary.idl \
- $(srcdir)/../idl/SummaryComponent.idl
+ $(srcdir)/../idl/SummaryComponent.idl \
+ $(srcdir)/../idl/HtmlView.idl
$(IDL_GENERATED): $(IDLS)
$(ORBIT_IDL) -I $(srcdir) -I $(datadir)/idl `$(GNOME_CONFIG) --cflags idl` \
@@ -36,16 +37,12 @@ $(IDL_GENERATED): $(IDLS)
libevolution_services_la_SOURCES = \
$(IDL_GENERATED) \
- executive-summary.c \
- executive-summary.h \
- executive-summary-client.c \
- executive-summary-client.h \
executive-summary-component.c \
executive-summary-component.h \
- executive-summary-component-client.c \
- executive-summary-component-client.h \
- executive-summary-component-view.c \
- executive-summary-component-view.h
+ executive-summary-component-factory-client.c \
+ executive-summary-component-factory-client.h \
+ executive-summary-html-view.c \
+ executive-summary-html-view.h
libevolution_services_la_LIBADD = \
$(top_builddir)/e-util/libeutil.la \
diff --git a/executive-summary/evolution-services/executive-summary-component-client.c b/executive-summary/evolution-services/executive-summary-component-client.c
index 5d13a39e6d..33225e7d98 100644
--- a/executive-summary/evolution-services/executive-summary-component-client.c
+++ b/executive-summary/evolution-services/executive-summary-component-client.c
@@ -33,7 +33,6 @@
#include <Executive-Summary.h>
#include "executive-summary-component-client.h"
-#include "executive-summary-component-view.h"
#include "executive-summary.h"
#define PARENT_TYPE BONOBO_OBJECT_CLIENT_TYPE
@@ -174,163 +173,6 @@ executive_summary_component_client_unset_owner (ExecutiveSummaryComponentClient
return;
}
-#if 0
-void
-executive_summary_component_client_supports (ExecutiveSummaryComponentClient *client,
- gboolean *bonobo,
- gboolean *html)
-{
- GNOME_Evolution_Summary_Component component;
- CORBA_Environment ev;
-
- g_return_if_fail (client != NULL);
- g_return_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_CLIENT (client));
-
- CORBA_exception_init (&ev);
- component = bonobo_object_corba_objref (BONOBO_OBJECT (client));
-
- GNOME_Evolution_Summary_Component_supports (component, bonobo, html, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("Error checking supports");
- }
-
- CORBA_exception_free (&ev);
- return;
-}
-#endif
-
-ExecutiveSummaryComponentView *
-executive_summary_component_client_create_view (ExecutiveSummaryComponentClient *client,
- int id)
-{
- ExecutiveSummaryComponentView *view;
- GNOME_Evolution_Summary_Component component;
- char *html, *title, *icon;
- Bonobo_Control control;
- BonoboControl *bc;
- int ret_id;
- CORBA_Environment ev;
-
- g_return_val_if_fail (client != NULL, NULL);
- g_return_val_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_CLIENT (client),
- NULL);
-
- CORBA_exception_init (&ev);
- if (client)
- component = bonobo_object_corba_objref (BONOBO_OBJECT (client));
-
- /* Get all the details about the view */
- g_print ("In %s\n", __FUNCTION__);
- ret_id = GNOME_Evolution_Summary_Component_createView (component, id, &control,
- &html, &title, &icon, &ev);
- g_print ("Out %s\n", __FUNCTION__);
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("Error creating view");
- CORBA_exception_free (&ev);
- return NULL;
- }
-
- CORBA_exception_free (&ev);
-
- /* Create a local copy of the remote view */
- if (control != CORBA_OBJECT_NIL) {
- bc = BONOBO_CONTROL (bonobo_widget_new_control_from_objref (control, NULL));
- } else {
- bc = NULL;
- }
-
- view = executive_summary_component_view_new (NULL, bc, html, title,
- icon);
- executive_summary_component_view_set_id (view, ret_id);
-
- return view;
-}
-
-#if 0
-char *
-executive_summary_component_client_create_html_view (ExecutiveSummaryComponentClient *client,
- char **title,
- char **icon)
-{
- CORBA_char *ret_html;
- GNOME_Evolution_Summary_Component component;
- CORBA_Environment ev;
-
- g_return_val_if_fail (client != NULL, NULL);
- g_return_val_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_CLIENT (client),
- NULL);
-
- CORBA_exception_init (&ev);
- component = bonobo_object_corba_objref (BONOBO_OBJECT (client));
-
- ret_html = GNOME_Evolution_Summary_Component_create_html_view (component, title, icon, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("Error creating HTML view");
- CORBA_exception_free (&ev);
- return NULL;
- }
-
- CORBA_exception_free (&ev);
-
- return (char *)g_strdup (ret_html);
-}
-#endif
-
-void
-executive_summary_component_client_configure (ExecutiveSummaryComponentClient *client)
-{
- GNOME_Evolution_Summary_Component component;
- CORBA_Environment ev;
-
- g_return_if_fail (client != NULL);
- g_return_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_CLIENT (client));
-
- CORBA_exception_init (&ev);
- component = bonobo_object_corba_objref (BONOBO_OBJECT (client));
- GNOME_Evolution_Summary_Component_configure (component, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("Error configuring service");
- bonobo_object_unref (BONOBO_OBJECT (client));
- CORBA_exception_free (&ev);
- return;
- }
-
- CORBA_exception_free (&ev);
-
- return;
-}
-
-void
-executive_summary_component_client_destroy_view (ExecutiveSummaryComponentClient *client,
- ExecutiveSummaryComponentView *view)
-{
- int id;
- GNOME_Evolution_Summary_Component component;
- CORBA_Environment ev;
-
- g_return_if_fail (client != NULL);
- g_return_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_CLIENT (client));
- g_return_if_fail (view != NULL);
- g_return_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_VIEW (view));
-
- id = executive_summary_component_view_get_id (view);
-
- CORBA_exception_init (&ev);
- component = bonobo_object_corba_objref (BONOBO_OBJECT (client));
- GNOME_Evolution_Summary_Component_destroyView (component, id, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("Error destroying view #%d", id);
- }
-
- CORBA_exception_free (&ev);
-
- return;
-}
-
E_MAKE_TYPE (executive_summary_component_client,
"ExecutiveSummaryComponentClient",
ExecutiveSummaryComponentClient,
diff --git a/executive-summary/evolution-services/executive-summary-component-client.h b/executive-summary/evolution-services/executive-summary-component-client.h
index 3a9edd7a1c..b98aa9e7e5 100644
--- a/executive-summary/evolution-services/executive-summary-component-client.h
+++ b/executive-summary/evolution-services/executive-summary-component-client.h
@@ -59,7 +59,8 @@ void executive_summary_component_client_supports (ExecutiveSummaryComponentClien
gboolean *bonobo,
gboolean *html);
-void executive_summary_component_client_configure (ExecutiveSummaryComponentClient *client);
+void executive_summary_component_client_configure (ExecutiveSummaryComponentClient *client,
+ ExecutiveSummaryComponentView *view);
void executive_summary_component_client_destroy_view (ExecutiveSummaryComponentClient *client,
ExecutiveSummaryComponentView *view);
diff --git a/executive-summary/evolution-services/executive-summary-component-factory-client.c b/executive-summary/evolution-services/executive-summary-component-factory-client.c
new file mode 100644
index 0000000000..f798341c80
--- /dev/null
+++ b/executive-summary/evolution-services/executive-summary-component-factory-client.c
@@ -0,0 +1,181 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* executive-summary-component-factory-client.c
+ *
+ * Authors: Iain Holmes <iain@helixcode.com>
+ *
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <bonobo.h>
+#include <gnome.h>
+#include <gal/util/e-util.h>
+
+#include <liboaf/liboaf.h>
+
+#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;
+
+struct _ExecutiveSummaryComponentFactoryClientPrivate {
+ int dummy;
+};
+
+static void
+executive_summary_component_factory_client_destroy (GtkObject *object)
+{
+ ExecutiveSummaryComponentFactoryClient *client;
+ ExecutiveSummaryComponentFactoryClientPrivate *priv;
+
+ client = EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT (object);
+ priv = client->private;
+
+ if (priv == NULL)
+ return;
+
+ g_free (priv);
+ client->private = NULL;
+
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+}
+
+static void
+executive_summary_component_factory_client_init (ExecutiveSummaryComponentFactoryClient *client)
+{
+ ExecutiveSummaryComponentFactoryClientPrivate *priv;
+
+ priv = g_new0 (ExecutiveSummaryComponentFactoryClientPrivate, 1);
+ client->private = priv;
+}
+
+static void
+executive_summary_component_factory_client_class_init (ExecutiveSummaryComponentFactoryClientClass *klass)
+{
+ GtkObjectClass *object_class;
+
+ object_class = GTK_OBJECT_CLASS (klass);
+ object_class->destroy = executive_summary_component_factory_client_destroy;
+
+ parent_class = gtk_type_class (PARENT_TYPE);
+}
+
+E_MAKE_TYPE (executive_summary_component_factory_client,
+ "ExecutiveSummaryComponentFactoryClient",
+ ExecutiveSummaryComponentFactoryClient,
+ executive_summary_component_factory_client_class_init,
+ executive_summary_component_factory_client_init, PARENT_TYPE)
+
+
+/*** Public API ***/
+/**
+ * executive_summary_component_factory_client_construct:
+ * @client: The ExecutiveSummaryComponentFactoryClient to construct.
+ * @corba_object: The CORBA_Object to construct it from.
+ *
+ * Constructs a client from the given CORBA_Object.
+ */
+void
+executive_summary_component_factory_client_construct (ExecutiveSummaryComponentFactoryClient *client,
+ CORBA_Object corba_object)
+{
+ g_return_if_fail (client != NULL);
+ g_return_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT (client));
+ g_return_if_fail (corba_object != CORBA_OBJECT_NIL);
+
+ bonobo_object_client_construct (BONOBO_OBJECT_CLIENT (client), corba_object);
+}
+
+/**
+ * executive_summary_component_factory_client_new:
+ * @id: The OAFIID of the component to activate.
+ *
+ * Activates the component specified by @id, and creates a server side client
+ * for that object.
+ *
+ * Returns: A pointer to an ExecutiveSummaryComponentFactoryClient object.
+ */
+ExecutiveSummaryComponentFactoryClient *
+executive_summary_component_factory_client_new (const char *id)
+{
+ ExecutiveSummaryComponentFactoryClient *client;
+ CORBA_Environment ev;
+ CORBA_Object corba_object;
+
+ g_return_val_if_fail (id != NULL, NULL);
+
+ CORBA_exception_init (&ev);
+
+ corba_object = oaf_activate_from_id ((char *)id, 0, NULL, &ev);
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ CORBA_exception_free (&ev);
+ g_warning ("Could not start %s\n", id);
+ return NULL;
+ }
+
+ CORBA_exception_free (&ev);
+
+ if (corba_object == CORBA_OBJECT_NIL) {
+ g_warning ("Could not activate %s\n", id);
+ return NULL;
+ }
+
+ client = gtk_type_new (executive_summary_component_factory_client_get_type ());
+ executive_summary_component_factory_client_construct (client,
+ corba_object);
+
+ return client;
+}
+
+/**
+ * executive_summary_component_factory_client_create_view:
+ * @client: The client on which to create the view.
+ *
+ * Creates a new view of a remote component.
+ *
+ * Returns: A GNOME_Evolution_Summary_Component.
+ */
+GNOME_Evolution_Summary_Component
+executive_summary_component_factory_client_create_view (ExecutiveSummaryComponentFactoryClient *client)
+{
+ GNOME_Evolution_Summary_ComponentFactory factory;
+ GNOME_Evolution_Summary_Component component;
+ CORBA_Environment ev;
+
+ g_return_val_if_fail (client != NULL, CORBA_OBJECT_NIL);
+ g_return_val_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT (client),
+ CORBA_OBJECT_NIL);
+
+ CORBA_exception_init (&ev);
+ factory = bonobo_object_corba_objref (BONOBO_OBJECT (client));
+
+ component = GNOME_Evolution_Summary_ComponentFactory_createView (factory, &ev);
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_warning ("Error creating view: %s", CORBA_exception_id (&ev));
+ CORBA_exception_free (&ev);
+ return CORBA_OBJECT_NIL;
+ }
+
+ CORBA_exception_free (&ev);
+ return component;
+}
diff --git a/executive-summary/evolution-services/executive-summary-component-factory-client.h b/executive-summary/evolution-services/executive-summary-component-factory-client.h
new file mode 100644
index 0000000000..7c94afe15c
--- /dev/null
+++ b/executive-summary/evolution-services/executive-summary-component-factory-client.h
@@ -0,0 +1,57 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* executive-summary-component-factory-client.h
+ *
+ * Authors: Iain Holmes <iain@helixcode.com>
+ *
+ * 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.
+ */
+
+#ifndef _EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT_H__
+#define _EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT_H__
+
+#include <bonobo.h>
+
+#define EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT_TYPE (executive_summary_component_factory_client_get_type ())
+#define EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT(obj) (GTK_CHECK_CAST ((obj), EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT_TYPE, ExecutiveSummaryComponentFactoryClient))
+#define EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT_TYPE, ExecutiveSummaryComponentFactoryClientClass))
+#define IS_EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT(obj) (GTK_CHECK_TYPE ((obj), EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT_TYPE))
+#define IS_EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT_TYPE))
+
+typedef struct _ExecutiveSummaryComponentFactoryClientPrivate ExecutiveSummaryComponentFactoryClientPrivate;
+typedef struct _ExecutiveSummaryComponentFactoryClient ExecutiveSummaryComponentFactoryClient;
+typedef struct _ExecutiveSummaryComponentFactoryClientClass ExecutiveSummaryComponentFactoryClientClass;
+
+struct _ExecutiveSummaryComponentFactoryClient {
+ BonoboObjectClient parent;
+
+ ExecutiveSummaryComponentFactoryClientPrivate *private;
+};
+
+struct _ExecutiveSummaryComponentFactoryClientClass {
+ BonoboObjectClientClass parent_class;
+};
+
+GtkType executive_summary_component_factory_client_get_type (void);
+
+void executive_summary_component_factory_client_construct (ExecutiveSummaryComponentFactoryClient *client,
+ CORBA_Object corba_object);
+ExecutiveSummaryComponentFactoryClient *executive_summary_component_factory_client_new (const char *id);
+GNOME_Evolution_Summary_Component executive_summary_component_factory_client_create_view (ExecutiveSummaryComponentFactoryClient *client);
+
+#endif
+
diff --git a/executive-summary/evolution-services/executive-summary-component-view.c b/executive-summary/evolution-services/executive-summary-component-view.c
index ebcbeb9e09..6ba24e143c 100644
--- a/executive-summary/evolution-services/executive-summary-component-view.c
+++ b/executive-summary/evolution-services/executive-summary-component-view.c
@@ -37,6 +37,8 @@ struct _ExecutiveSummaryComponentViewPrivate {
ExecutiveSummaryComponent *component;
BonoboControl *control;
+ Bonobo_Control objref;
+
char *html;
char *title;
@@ -48,6 +50,13 @@ struct _ExecutiveSummaryComponentViewPrivate {
static GtkObjectClass *parent_class = NULL;
#define PARENT_TYPE (gtk_object_get_type ())
+enum {
+ CONFIGURE,
+ LAST_SIGNAL
+};
+
+static gint32 view_signals[LAST_SIGNAL] = { 0 };
+
static void
executive_summary_component_view_destroy (GtkObject *object)
{
@@ -83,6 +92,14 @@ executive_summary_component_view_class_init (ExecutiveSummaryComponentViewClass
object_class = GTK_OBJECT_CLASS (view_class);
object_class->destroy = executive_summary_component_view_destroy;
+
+ view_signals[CONFIGURE] = gtk_signal_new ("configure",
+ GTK_RUN_FIRST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (ExecutiveSummaryComponentViewClass, configure),
+ gtk_marshal_NONE__NONE,
+ GTK_TYPE_NONE, 0);
+ gtk_object_class_add_signals (object_class, view_signals, LAST_SIGNAL);
parent_class = gtk_type_class (PARENT_TYPE);
}
@@ -96,6 +113,7 @@ executive_summary_component_view_init (ExecutiveSummaryComponentView *view)
view->private = priv;
priv->control = NULL;
+ priv->objref = NULL;
priv->html = NULL;
priv->title = NULL;
priv->icon = NULL;
@@ -191,7 +209,6 @@ executive_summary_component_view_set_title (ExecutiveSummaryComponentView *view,
component = priv->component;
if (component == NULL) {
- g_warning ("Calling %s from the wrong side of the CORBA interface", __FUNCTION__);
return;
}
@@ -230,7 +247,6 @@ executive_summary_component_view_set_icon (ExecutiveSummaryComponentView *view,
if (component == NULL) {
return;
}
-
executive_summary_component_set_icon (component, view);
}
@@ -291,6 +307,12 @@ executive_summary_component_view_set_html (ExecutiveSummaryComponentView *view,
executive_summary_component_update (component, view);
}
+void
+executive_summary_component_view_configure (ExecutiveSummaryComponentView *view)
+{
+ gtk_signal_emit (GTK_OBJECT (view), view_signals[CONFIGURE]);
+}
+
const char *
executive_summary_component_view_get_html (ExecutiveSummaryComponentView *view)
{
@@ -314,7 +336,7 @@ executive_summary_component_view_get_control (ExecutiveSummaryComponentView *vie
priv = view->private;
- return priv->control;
+ return (BonoboObject *)priv->control;
}
void
@@ -343,3 +365,39 @@ executive_summary_component_view_get_id (ExecutiveSummaryComponentView *view)
return priv->id;
}
+
+void
+executive_summary_component_view_set_objref (ExecutiveSummaryComponentView *view,
+ Bonobo_Control objref)
+{
+ ExecutiveSummaryComponentViewPrivate *priv;
+
+ g_return_if_fail (view != NULL);
+ g_return_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_VIEW (view));
+
+ priv = view->private;
+
+ if (priv->objref) {
+ g_warning ("View already has an objref.");
+ return;
+ }
+
+ priv->objref = objref;
+}
+
+GtkWidget *
+executive_summary_component_view_get_widget (ExecutiveSummaryComponentView *view)
+{
+ ExecutiveSummaryComponentViewPrivate *priv;
+
+ g_return_val_if_fail (view != NULL, NULL);
+ g_return_val_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_VIEW (view), NULL);
+
+ priv = view->private;
+ if (priv->objref == NULL) {
+ g_warning ("View has no objref.");
+ return NULL;
+ }
+
+ return bonobo_widget_new_control_from_objref (priv->objref, NULL);
+}
diff --git a/executive-summary/evolution-services/executive-summary-component-view.h b/executive-summary/evolution-services/executive-summary-component-view.h
index ecd0c7ab33..c18f77dcf4 100644
--- a/executive-summary/evolution-services/executive-summary-component-view.h
+++ b/executive-summary/evolution-services/executive-summary-component-view.h
@@ -24,6 +24,7 @@
#ifndef __EXECUTIVE_SUMMARY_COMPONENT_VIEW_H__
#define __EXECUTIVE_SUMMARY_COMPONENT_VIEW_H__
+#include <bonobo/bonobo-control.h>
#include <evolution-services/executive-summary-component.h>
#define EXECUTIVE_SUMMARY_COMPONENT_VIEW_TYPE (executive_summary_component_view_get_type ())
@@ -37,13 +38,16 @@ typedef struct _ExecutiveSummaryComponentView ExecutiveSummaryComponentView;
typedef struct _ExecutiveSummaryComponentViewClass ExecutiveSummaryComponentViewClass;
struct _ExecutiveSummaryComponentView {
- GtkObject object;
-
- ExecutiveSummaryComponentViewPrivate *private;
+ GtkObject object;
+
+ ExecutiveSummaryComponentViewPrivate *private;
};
struct _ExecutiveSummaryComponentViewClass {
- GtkObjectClass parent_class;
+ GtkObjectClass parent_class;
+
+ /* Signals */
+ void (* configure) (ExecutiveSummaryComponentView *view);
};
GtkType executive_summary_component_view_get_type (void);
@@ -77,6 +81,12 @@ const char *executive_summary_component_view_get_html (ExecutiveSummaryComponent
BonoboObject *executive_summary_component_view_get_control (ExecutiveSummaryComponentView *view);
int executive_summary_component_view_get_id (ExecutiveSummaryComponentView *view);
+void executive_summary_component_view_set_id (ExecutiveSummaryComponentView *view,
+ int id);
+void executive_summary_component_view_configure (ExecutiveSummaryComponentView *view);
+void executive_summary_component_view_set_objref (ExecutiveSummaryComponentView *view,
+ Bonobo_Control objref);
+GtkWidget *executive_summary_component_view_get_widget (ExecutiveSummaryComponentView *view);
#endif
diff --git a/executive-summary/evolution-services/executive-summary-component.c b/executive-summary/evolution-services/executive-summary-component.c
index ba0c3b7832..1b1070da21 100644
--- a/executive-summary/evolution-services/executive-summary-component.c
+++ b/executive-summary/evolution-services/executive-summary-component.c
@@ -31,9 +31,7 @@
#include <gal/util/e-util.h>
#include "Executive-Summary.h"
-#include "executive-summary.h"
#include "executive-summary-component.h"
-#include "executive-summary-component-view.h"
#include "executive-summary-client.h"
static void executive_summary_component_destroy (GtkObject *object);
@@ -41,22 +39,26 @@ static void executive_summary_component_init (ExecutiveSummaryComponent *compone
static void executive_summary_component_class_init (ExecutiveSummaryComponentClass *esc_class);
#define PARENT_TYPE (bonobo_object_get_type ())
+#define FACTORY_PARENT_TYPE (bonobo_object_get_type ())
static BonoboObjectClass *parent_class;
+static BonoboObjectClass *factory_parent_class;
struct _ExecutiveSummaryComponentPrivate {
- EvolutionServicesCreateViewFn create_view;
- EvolutionServicesConfigureFn configure;
-
+ int dummy;
+#if 0
ExecutiveSummaryClient *owner_client;
-
- void *closure;
+#endif
+};
- GHashTable *id_to_view;
+struct _ExecutiveSummaryComponentFactoryPrivate {
+ EvolutionServicesCreateViewFn create_view;
+ void *closure;
};
/* CORBA interface */
static POA_GNOME_Evolution_Summary_Component__vepv SummaryComponent_vepv;
+static POA_GNOME_Evolution_Summary_ComponentFactory__vepv ComponentFactory_vepv;
static POA_GNOME_Evolution_Summary_Component *
create_servant (void)
@@ -80,37 +82,19 @@ create_servant (void)
return servant;
}
-#if 0
-static void
-impl_GNOME_Evolution_Summary_Component_supports (PortableServer_Servant servant,
- CORBA_boolean *html,
- CORBA_boolean *bonobo,
- CORBA_Environment *ev)
-{
- BonoboObject *bonobo_object;
- ExecutiveSummaryComponent *component;
- ExecutiveSummaryComponentPrivate *priv;
-
- bonobo_object = bonobo_object_from_servant (servant);
- component = EXECUTIVE_SUMMARY_COMPONENT (bonobo_object);
- priv = component->private;
-
- *html = (priv->create_html_view != NULL);
- *bonobo = (priv->create_bonobo_view != NULL);
-}
-#endif
-
static void
impl_GNOME_Evolution_Summary_Component_set_owner (PortableServer_Servant servant,
- GNOME_Evolution_Summary_ViewFrame summary,
- CORBA_Environment *ev)
+ 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;
@@ -122,12 +106,14 @@ impl_GNOME_Evolution_Summary_Component_set_owner (PortableServer_Servant servant
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;
@@ -141,127 +127,7 @@ impl_GNOME_Evolution_Summary_Component_unset_owner (PortableServer_Servant serva
bonobo_object_unref (BONOBO_OBJECT (priv->owner_client));
priv->owner_client = NULL;
-}
-
-static CORBA_long
-impl_GNOME_Evolution_Summary_Component_create_view (PortableServer_Servant servant,
- CORBA_long id,
- Bonobo_Control *control,
- CORBA_char **html,
- CORBA_char **title,
- CORBA_char **icon,
- CORBA_Environment *ev)
-{
- ExecutiveSummaryComponentView *view;
- BonoboObject *bonobo_object;
- ExecutiveSummaryComponent *component;
- ExecutiveSummaryComponentPrivate *priv;
- BonoboObject *initial_control;
- const char *initial_title, *initial_icon, *initial_html;
-
- bonobo_object = bonobo_object_from_servant (servant);
- component = EXECUTIVE_SUMMARY_COMPONENT (bonobo_object);
- priv = component->private;
-
- view = gtk_type_new (executive_summary_component_view_get_type ());
- executive_summary_component_view_set_id (view, id);
-
- (* priv->create_view) (component, view, priv->closure);
-
- /* Extract the values */
- initial_title = executive_summary_component_view_get_title (view);
- initial_icon = executive_summary_component_view_get_icon (view);
- initial_html = executive_summary_component_view_get_html (view);
- initial_control = executive_summary_component_view_get_control (view);
-
- /* Put the view in the hash table so it can be found later */
- g_hash_table_insert (priv->id_to_view, GINT_TO_POINTER (id), view);
-
- /* Duplicate the values */
- if (initial_control != NULL) {
- *control = bonobo_object_corba_objref (BONOBO_OBJECT (initial_control));
- } else {
- *control = CORBA_OBJECT_NIL;
- }
-
- *html = CORBA_string_dup (initial_html ? initial_html:"");
- *title = CORBA_string_dup (initial_title ? initial_title:"");
- *icon = CORBA_string_dup (initial_icon ? initial_icon:"");
-
- return id;
-}
-
-#if 0
-static CORBA_char *
-impl_GNOME_Evolution_Summary_Component_create_html_view (PortableServer_Servant servant,
- CORBA_char **title,
- CORBA_char **icon,
- CORBA_Environment *ev)
-{
- BonoboObject *bonobo_object;
- ExecutiveSummaryComponent *component;
- ExecutiveSummaryComponentPrivate *priv;
- CORBA_char *ret_str;
- char *ret_html;
- char *initial_title, *initial_icon;
-
- bonobo_object = bonobo_object_from_servant (servant);
- component = EXECUTIVE_SUMMARY_COMPONENT (bonobo_object);
- priv = component->private;
-
- ret_html = (* priv->create_html_view) (component, &initial_title,
- &initial_icon,
- priv->closure);
-
- *title = CORBA_string_dup (initial_title ? initial_title:"");
- *icon = CORBA_string_dup (initial_icon ? initial_icon:"");
- g_free (initial_title);
- g_free (initial_icon);
-
- ret_str = CORBA_string_dup (ret_html ? ret_html:"");
- g_free (ret_html);
- return ret_str;
-}
-#endif
-
-static void
-impl_GNOME_Evolution_Summary_Component_destroy_view (PortableServer_Servant servant,
- CORBA_long id,
- CORBA_Environment *ev)
-{
- BonoboObject *bonobo_object;
- ExecutiveSummaryComponent *component;
- ExecutiveSummaryComponentPrivate *priv;
- ExecutiveSummaryComponentView *view;
-
- g_print ("%s\n", __FUNCTION__);
- bonobo_object = bonobo_object_from_servant (servant);
- component = EXECUTIVE_SUMMARY_COMPONENT (bonobo_object);
- priv = component->private;
-
- view = g_hash_table_lookup (priv->id_to_view, GINT_TO_POINTER (id));
- if (view == NULL) {
- g_warning ("Unknown view: %d. Emit exception", id);
- return;
- }
-
- /* Destroy the view */
- gtk_object_unref (GTK_OBJECT (view));
-}
-
-static void
-impl_GNOME_Evolution_Summary_Component_configure (PortableServer_Servant servant,
- CORBA_Environment *ev)
-{
- BonoboObject *bonobo_object;
- ExecutiveSummaryComponent *component;
- ExecutiveSummaryComponentPrivate *priv;
-
- bonobo_object = bonobo_object_from_servant (servant);
- component = EXECUTIVE_SUMMARY_COMPONENT (bonobo_object);
- priv = component->private;
-
- (* priv->configure) (component, priv->closure);
+#endif
}
static void
@@ -278,11 +144,13 @@ executive_summary_component_destroy (GtkObject *object)
return;
CORBA_exception_init (&ev);
-
+
+#if 0
if (priv->owner_client != NULL) {
bonobo_object_unref (BONOBO_OBJECT (priv->owner_client));
priv->owner_client = NULL;
}
+#endif
CORBA_exception_free (&ev);
@@ -308,10 +176,7 @@ corba_class_init (void)
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;
- epv->createView = impl_GNOME_Evolution_Summary_Component_create_view;
- epv->destroyView = impl_GNOME_Evolution_Summary_Component_destroy_view;
- epv->configure = impl_GNOME_Evolution_Summary_Component_configure;
-
+
vepv = &SummaryComponent_vepv;
vepv->_base_epv = base_epv;
vepv->Bonobo_Unknown_epv = bonobo_object_get_epv ();
@@ -336,44 +201,37 @@ executive_summary_component_init (ExecutiveSummaryComponent *component)
{
ExecutiveSummaryComponentPrivate *priv;
- priv = g_new0 (ExecutiveSummaryComponentPrivate, 1);
+ priv = g_new (ExecutiveSummaryComponentPrivate, 1);
- priv->create_view = NULL;
- priv->configure = NULL;
-
- priv->owner_client = NULL;
- priv->closure = NULL;
-
- priv->id_to_view = g_hash_table_new (NULL, NULL);
component->private = priv;
}
+E_MAKE_TYPE (executive_summary_component, "ExecutiveSummaryComponent",
+ ExecutiveSummaryComponent, executive_summary_component_class_init,
+ executive_summary_component_init, PARENT_TYPE);
+
+
static void
executive_summary_component_construct (ExecutiveSummaryComponent *component,
- GNOME_Evolution_Summary_Component corba_object,
- EvolutionServicesCreateViewFn create_view,
- EvolutionServicesConfigureFn configure,
- void *closure)
+ GNOME_Evolution_Summary_Component corba_object)
{
- ExecutiveSummaryComponentPrivate *priv;
-
g_return_if_fail (component != NULL);
g_return_if_fail (corba_object != CORBA_OBJECT_NIL);
bonobo_object_construct (BONOBO_OBJECT (component), corba_object);
-
- priv = component->private;
-
- priv->create_view = create_view;
- priv->configure = configure;
-
- priv->closure = closure;
}
+
+/*** Public API ***/
+/**
+ * executive_summary_component_new:
+ *
+ * Creates a BonoboObject that implements the Summary::Component interface.
+ *
+ * Returns: A pointer to a BonoboObject.
+ */
BonoboObject *
-executive_summary_component_new (EvolutionServicesCreateViewFn create_view,
- EvolutionServicesConfigureFn configure,
- void *closure)
+executive_summary_component_new (void)
{
ExecutiveSummaryComponent *component;
POA_GNOME_Evolution_Summary_Component *servant;
@@ -387,23 +245,18 @@ executive_summary_component_new (EvolutionServicesCreateViewFn create_view,
corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (component),
servant);
- executive_summary_component_construct (component, corba_object,
- create_view, configure, closure);
+ executive_summary_component_construct (component, corba_object);
return BONOBO_OBJECT (component);
}
-E_MAKE_TYPE (executive_summary_component, "ExecutiveSummaryComponent",
- ExecutiveSummaryComponent, executive_summary_component_class_init,
- executive_summary_component_init, PARENT_TYPE);
-
+#if 0
void
-executive_summary_component_set_title (ExecutiveSummaryComponent *component,
- gpointer view)
+executive_summary_component_flash (ExecutiveSummaryComponent *component,
+ gpointer view)
{
ExecutiveSummaryComponentPrivate *priv;
int id;
- const char *title;
g_return_if_fail (component != NULL);
g_return_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT (component));
@@ -416,18 +269,17 @@ executive_summary_component_set_title (ExecutiveSummaryComponent *component,
}
id = executive_summary_component_view_get_id (EXECUTIVE_SUMMARY_COMPONENT_VIEW (view));
- title = executive_summary_component_view_get_title (EXECUTIVE_SUMMARY_COMPONENT_VIEW (view));
- executive_summary_client_set_title (priv->owner_client, id, title);
+ executive_summary_client_flash (priv->owner_client, id);
}
void
-executive_summary_component_set_icon (ExecutiveSummaryComponent *component,
- gpointer view)
+executive_summary_component_update (ExecutiveSummaryComponent *component,
+ gpointer view)
{
ExecutiveSummaryComponentPrivate *priv;
int id;
- const char *icon;
+ const char *html;
g_return_if_fail (component != NULL);
g_return_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT (component));
@@ -435,68 +287,184 @@ executive_summary_component_set_icon (ExecutiveSummaryComponent *component,
priv = component->private;
if (priv->owner_client == NULL) {
- g_warning ("Component not owned!");
+ g_warning ("Component not ownded!");
return;
}
id = executive_summary_component_view_get_id (EXECUTIVE_SUMMARY_COMPONENT_VIEW (view));
- icon = executive_summary_component_view_get_icon (EXECUTIVE_SUMMARY_COMPONENT_VIEW (view));
+ html = executive_summary_component_view_get_html (EXECUTIVE_SUMMARY_COMPONENT_VIEW (view));
- executive_summary_client_set_icon (priv->owner_client, id, icon);
+ executive_summary_client_update (priv->owner_client, id, html);
}
+#endif
-void
-executive_summary_component_flash (ExecutiveSummaryComponent *component,
- gpointer view)
+
+/**** ComponentFactory implementation ****/
+
+static POA_GNOME_Evolution_Summary_ComponentFactory *
+create_factory_servant (void)
{
- ExecutiveSummaryComponentPrivate *priv;
- int id;
+ POA_GNOME_Evolution_Summary_ComponentFactory *servant;
+ CORBA_Environment ev;
+
+ servant = (POA_GNOME_Evolution_Summary_ComponentFactory *)g_new0 (BonoboObjectServant, 1);
+ servant->vepv = &ComponentFactory_vepv;
+
+ CORBA_exception_init (&ev);
+ POA_GNOME_Evolution_Summary_ComponentFactory__init ((PortableServer_Servant) servant, &ev);
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_free (servant);
+ CORBA_exception_free (&ev);
+ return NULL;
+ }
+
+ CORBA_exception_free (&ev);
+
+ return servant;
+}
- g_return_if_fail (component != NULL);
- g_return_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT (component));
+static GNOME_Evolution_Summary_Component
+impl_GNOME_Evolution_Summary_ComponentFactory_createView (PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ BonoboObject *bonobo_object;
+ ExecutiveSummaryComponent *view;
+ ExecutiveSummaryComponentFactory *factory;
+ ExecutiveSummaryComponentFactoryPrivate *priv;
+ GNOME_Evolution_Summary_Component component, component_dup;
+ CORBA_Environment ev2;
- priv = component->private;
+ bonobo_object = bonobo_object_from_servant (servant);
+ factory = EXECUTIVE_SUMMARY_COMPONENT_FACTORY (bonobo_object);
+ priv = factory->private;
- if (priv->owner_client == NULL) {
- g_warning ("Component not owned!");
- return;
- }
+ g_warning ("Hello?");
+ view = (* priv->create_view) (factory, priv->closure);
+ g_return_val_if_fail (view != NULL, CORBA_OBJECT_NIL);
- id = executive_summary_component_view_get_id (EXECUTIVE_SUMMARY_COMPONENT_VIEW (view));
+ component = bonobo_object_corba_objref (BONOBO_OBJECT (view));
- executive_summary_client_flash (priv->owner_client, id);
+ return component;
}
-void
-executive_summary_component_update (ExecutiveSummaryComponent *component,
- gpointer view)
+static void
+corba_factory_init (void)
{
- ExecutiveSummaryComponentPrivate *priv;
- int id;
- const char *html;
+ POA_GNOME_Evolution_Summary_ComponentFactory__vepv *vepv;
+ POA_GNOME_Evolution_Summary_ComponentFactory__epv *epv;
+ PortableServer_ServantBase__epv *base_epv;
+
+ base_epv = g_new0 (PortableServer_ServantBase__epv, 1);
+ base_epv->_private = NULL;
+ base_epv->finalize = NULL;
+ base_epv->default_POA = NULL;
+
+ epv = g_new0 (POA_GNOME_Evolution_Summary_ComponentFactory__epv, 1);
+ epv->createView = impl_GNOME_Evolution_Summary_ComponentFactory_createView;
- g_return_if_fail (component != NULL);
- g_return_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT (component));
+ vepv = &ComponentFactory_vepv;
+ vepv->_base_epv = base_epv;
+ vepv->Bonobo_Unknown_epv = bonobo_object_get_epv ();
+ vepv->GNOME_Evolution_Summary_ComponentFactory_epv = epv;
+}
- priv = component->private;
+/* GtkObject methods */
+static void
+executive_summary_component_factory_destroy (GtkObject *object)
+{
+ ExecutiveSummaryComponentFactory *factory;
+ ExecutiveSummaryComponentFactoryPrivate *priv;
- if (priv->owner_client == NULL) {
- g_warning ("Component not ownded!");
+ factory = EXECUTIVE_SUMMARY_COMPONENT_FACTORY (object);
+ priv = factory->private;
+
+ if (priv == NULL)
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));
+ g_free (priv);
+ factory->private = NULL;
- executive_summary_client_update (priv->owner_client, id, html);
+ (* GTK_OBJECT_CLASS (factory_parent_class)->destroy) (object);
}
-int
-executive_summary_component_create_unique_id (void)
+static void
+executive_summary_component_factory_class_init (ExecutiveSummaryComponentFactoryClass *klass)
{
- static int id = 0;
+ GtkObjectClass *object_class;
+
+ object_class = GTK_OBJECT_CLASS (klass);
+ object_class->destroy = executive_summary_component_factory_destroy;
- id++;
- g_print ("%s -- %d\n", __FUNCTION__, id);
- return id;
+ factory_parent_class = gtk_type_class (FACTORY_PARENT_TYPE);
+ corba_factory_init ();
}
+
+static void
+executive_summary_component_factory_init (ExecutiveSummaryComponentFactory *factory)
+{
+ ExecutiveSummaryComponentFactoryPrivate *priv;
+
+ priv = g_new (ExecutiveSummaryComponentFactoryPrivate, 1);
+
+ priv->create_view = NULL;
+ priv->closure = NULL;
+ factory->private = priv;
+}
+
+E_MAKE_TYPE (executive_summary_component_factory,
+ "ExecutiveSummaryComponentFactory",
+ ExecutiveSummaryComponentFactory,
+ executive_summary_component_factory_class_init,
+ executive_summary_component_factory_init, FACTORY_PARENT_TYPE);
+
+static void
+executive_summary_component_factory_construct (ExecutiveSummaryComponentFactory *factory,
+ GNOME_Evolution_Summary_ComponentFactory corba_object,
+ EvolutionServicesCreateViewFn create_view,
+ void *closure)
+{
+ ExecutiveSummaryComponentFactoryPrivate *priv;
+
+ g_return_if_fail (factory != NULL);
+ g_return_if_fail (corba_object != CORBA_OBJECT_NIL);
+
+ bonobo_object_construct (BONOBO_OBJECT (factory), corba_object);
+ priv = factory->private;
+
+ priv->create_view = create_view;
+ priv->closure = closure;
+}
+
+
+/*** Public API ***/
+/**
+ * executive_summary_component_factory_new:
+ * @create_view: A pointer to the function to create a new view.
+ * @closure: The data to be passed to the @create_view function when it is
+ * called.
+ *
+ * Creates a BonoboObject that implements the Summary::ComponentFactory
+ * interface.
+ *
+ * Returns: A pointer to a BonoboObject.
+ */
+BonoboObject *
+executive_summary_component_factory_new (EvolutionServicesCreateViewFn create_view,
+ void *closure)
+{
+ ExecutiveSummaryComponentFactory *factory;
+ POA_GNOME_Evolution_Summary_ComponentFactory *servant;
+ GNOME_Evolution_Summary_ComponentFactory corba_object;
+
+ servant = create_factory_servant ();
+ if (servant == NULL)
+ return NULL;
+
+ factory = gtk_type_new (executive_summary_component_factory_get_type ());
+ corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (factory),
+ servant);
+ executive_summary_component_factory_construct (factory, corba_object,
+ create_view, closure);
+ return BONOBO_OBJECT (factory);
+}
+
diff --git a/executive-summary/evolution-services/executive-summary-component.h b/executive-summary/evolution-services/executive-summary-component.h
index 7d5ab904cc..9e09fea4a4 100644
--- a/executive-summary/evolution-services/executive-summary-component.h
+++ b/executive-summary/evolution-services/executive-summary-component.h
@@ -37,13 +37,6 @@ typedef struct _ExecutiveSummaryComponentPrivate ExecutiveSummaryComponentPrivat
typedef struct _ExecutiveSummaryComponent ExecutiveSummaryComponent;
typedef struct _ExecutiveSummaryComponentClass ExecutiveSummaryComponentClass;
-/* view is a ExecutiveSummaryComponentView * */
-typedef void (* EvolutionServicesCreateViewFn) (ExecutiveSummaryComponent *component,
- gpointer view,
- void *closure);
-typedef void (* EvolutionServicesConfigureFn) (ExecutiveSummaryComponent *component,
- void *closure);
-
struct _ExecutiveSummaryComponent {
BonoboObject parent;
@@ -56,18 +49,36 @@ struct _ExecutiveSummaryComponentClass {
GtkType executive_summary_component_get_type (void);
-BonoboObject *executive_summary_component_new (EvolutionServicesCreateViewFn create_view,
- EvolutionServicesConfigureFn configure,
- void *closure);
-void executive_summary_component_set_title (ExecutiveSummaryComponent *component,
- gpointer view);
-void executive_summary_component_set_icon (ExecutiveSummaryComponent *component,
- gpointer view);
+BonoboObject *executive_summary_component_new (void);
+
+
+/* Factory */
+
+#define EXECUTIVE_SUMMARY_COMPONENT_FACTORY_TYPE (executive_summary_component_factory_get_type ())
+#define EXECUTIVE_SUMMARY_COMPONENT_FACTORY(obj) (GTK_CHECK_CAST ((obj), EXECUTIVE_SUMMARY_COMPONENT_FACTORY_TYPE, ExecutiveSummaryComponentFactory))
+#define EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EXECUTIVE_SUMMARY_COMPONENT_FACTORY_TYPE, ExecutiveSummaryComponentFactoryClass))
+#define IS_EXECUTIVE_SUMMARY_COMPONENT_FACTORY(obj) (GTK_CHECK_TYPE ((obj), EXECUTIVE_SUMMARY_COMPONENT_FACTORY_TYPE))
+#define IS_EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), EXECUTIVE_SUMMARY_COMPONENT_FACTORY_TYPE))
+
+typedef struct _ExecutiveSummaryComponentFactoryPrivate ExecutiveSummaryComponentFactoryPrivate;
+typedef struct _ExecutiveSummaryComponentFactory ExecutiveSummaryComponentFactory;
+typedef struct _ExecutiveSummaryComponentFactoryClass ExecutiveSummaryComponentFactoryClass;
+
+typedef BonoboObject *(* EvolutionServicesCreateViewFn) (ExecutiveSummaryComponentFactory *factory,
+ void *closure);
+
+struct _ExecutiveSummaryComponentFactory {
+ BonoboObject parent;
+
+ ExecutiveSummaryComponentFactoryPrivate *private;
+};
+
+struct _ExecutiveSummaryComponentFactoryClass {
+ BonoboObjectClass parent_class;
+};
-void executive_summary_component_flash (ExecutiveSummaryComponent *component,
- gpointer view);
-void executive_summary_component_update (ExecutiveSummaryComponent *component,
- gpointer view);
-int executive_summary_component_create_unique_id (void);
+GtkType executive_summary_component_factory_get_type (void);
+BonoboObject *executive_summary_component_factory_new (EvolutionServicesCreateViewFn create_view,
+ void *closure);
#endif
diff --git a/executive-summary/evolution-services/executive-summary-html-view.c b/executive-summary/evolution-services/executive-summary-html-view.c
new file mode 100644
index 0000000000..ef90461623
--- /dev/null
+++ b/executive-summary/evolution-services/executive-summary-html-view.c
@@ -0,0 +1,244 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* executive-summary-html-view.c - Bonobo implementation of
+ * HtmlView.idl
+ *
+ * Authors: Iain Holmes <iain@helixcode.com>
+ *
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <bonobo.h>
+#include <gnome.h>
+#include <gal/util/e-util.h>
+
+#include "Executive-Summary.h"
+#include "executive-summary-html-view.h"
+
+static void executive_summary_html_view_destroy (GtkObject *object);
+static void executive_summary_html_view_init (ExecutiveSummaryHtmlView *component);
+static void executive_summary_html_view_class_init (ExecutiveSummaryHtmlViewClass *klass);
+
+#define PARENT_TYPE (bonobo_object_get_type ())
+
+static BonoboObjectClass *parent_class;
+
+struct _ExecutiveSummaryHtmlViewPrivate {
+ char *html;
+};
+
+/* CORBA interface */
+static POA_GNOME_Evolution_Summary_HTMLView__vepv HTMLView_vepv;
+
+static POA_GNOME_Evolution_Summary_HTMLView *
+create_servant (void)
+{
+ POA_GNOME_Evolution_Summary_HTMLView *servant;
+ CORBA_Environment ev;
+
+ servant = (POA_GNOME_Evolution_Summary_HTMLView *)g_new0 (BonoboObjectServant, 1);
+ servant->vepv = &HTMLView_vepv;
+
+ CORBA_exception_init (&ev);
+ POA_GNOME_Evolution_Summary_HTMLView__init ((PortableServer_Servant) servant, &ev);
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_free (servant);
+ CORBA_exception_free (&ev);
+ return NULL;
+ }
+
+ CORBA_exception_free (&ev);
+
+ return servant;
+}
+
+static CORBA_char *
+impl_GNOME_Evolution_Summary_HTMLView_getHtml (PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ BonoboObject *bonobo_object;
+ ExecutiveSummaryHtmlView *view;
+ ExecutiveSummaryHtmlViewPrivate *priv;
+
+ bonobo_object = bonobo_object_from_servant (servant);
+ view = EXECUTIVE_SUMMARY_HTML_VIEW (bonobo_object);
+ priv = view->private;
+
+ return CORBA_string_dup (priv->html? priv->html: "");
+}
+
+/* GtkObject methods */
+static void
+executive_summary_html_view_destroy (GtkObject *object)
+{
+ ExecutiveSummaryHtmlView *view;
+ ExecutiveSummaryHtmlViewPrivate *priv;
+
+ view = EXECUTIVE_SUMMARY_HTML_VIEW (object);
+ priv = view->private;
+
+ if (priv == NULL)
+ return;
+
+ g_free (priv->html);
+ g_free (priv);
+
+ view->private = NULL;
+
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+}
+
+static void
+corba_class_init (void)
+{
+ POA_GNOME_Evolution_Summary_HTMLView__vepv *vepv;
+ POA_GNOME_Evolution_Summary_HTMLView__epv *epv;
+ PortableServer_ServantBase__epv *base_epv;
+
+ base_epv = g_new0 (PortableServer_ServantBase__epv, 1);
+ base_epv->_private = NULL;
+ base_epv->finalize = NULL;
+ base_epv->default_POA = NULL;
+
+ epv = g_new0 (POA_GNOME_Evolution_Summary_HTMLView__epv, 1);
+ epv->getHtml = impl_GNOME_Evolution_Summary_HTMLView_getHtml;
+
+ vepv = &HTMLView_vepv;
+ vepv->_base_epv = base_epv;
+ vepv->Bonobo_Unknown_epv = bonobo_object_get_epv ();
+ vepv->GNOME_Evolution_Summary_HTMLView_epv = epv;
+}
+
+static void
+executive_summary_html_view_class_init (ExecutiveSummaryHtmlViewClass *klass)
+{
+ GtkObjectClass *object_class;
+
+ object_class = GTK_OBJECT_CLASS (klass);
+ object_class->destroy = executive_summary_html_view_destroy;
+
+ parent_class = gtk_type_class (PARENT_TYPE);
+
+ corba_class_init ();
+}
+
+static void
+executive_summary_html_view_init (ExecutiveSummaryHtmlView *view)
+{
+ ExecutiveSummaryHtmlViewPrivate *priv;
+
+ priv = g_new (ExecutiveSummaryHtmlViewPrivate, 1);
+ priv->html = NULL;
+
+ view->private = priv;
+}
+
+E_MAKE_TYPE (executive_summary_html_view, "ExecutiveSummaryHtmlView",
+ ExecutiveSummaryHtmlView, executive_summary_html_view_class_init,
+ executive_summary_html_view_init, PARENT_TYPE);
+
+static void
+executive_summary_html_view_construct (ExecutiveSummaryHtmlView *view,
+ GNOME_Evolution_Summary_HTMLView corba_object)
+{
+ g_return_if_fail (view != NULL);
+ g_return_if_fail (corba_object != CORBA_OBJECT_NIL);
+
+ bonobo_object_construct (BONOBO_OBJECT (view), corba_object);
+}
+
+/*** Public API ***/
+/**
+ * executive_summary_html_view_new:
+ *
+ * Creates a new BonoboObject that implements
+ * the HTMLView.idl interface.
+ *
+ * Returns: A BonoboObject.
+ */
+BonoboObject *
+executive_summary_html_view_new (void)
+{
+ ExecutiveSummaryHtmlView *view;
+ POA_GNOME_Evolution_Summary_HTMLView *servant;
+ GNOME_Evolution_Summary_HTMLView corba_object;
+
+ servant = create_servant ();
+ if (servant == NULL)
+ return NULL;
+
+ view = gtk_type_new (executive_summary_html_view_get_type ());
+ corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (view),
+ servant);
+ executive_summary_html_view_construct (view, corba_object);
+
+ return BONOBO_OBJECT (view);
+}
+
+/**
+ * executive_summary_html_view_set_html:
+ * @view: The ExecutiveSummaryHtmlView to operate on,
+ * @html: The HTML as a string.
+ *
+ * Sets the HTML string in @view to @html. @html is copied into @view,
+ * so after this call you are free to do what you want with @html.
+ */
+void
+executive_summary_html_view_set_html (ExecutiveSummaryHtmlView *view,
+ const char *html)
+{
+ ExecutiveSummaryHtmlViewPrivate *priv;
+
+ g_return_if_fail (view != NULL);
+ g_return_if_fail (IS_EXECUTIVE_SUMMARY_HTML_VIEW (view));
+
+ priv = view->private;
+ if (priv->html)
+ g_free (priv->html);
+
+ if (html != NULL)
+ priv->html = g_strdup (html);
+ else
+ priv->html = NULL;
+}
+/**
+ * executive_summary_html_view_get_html:
+ * @view: The ExecutiveSummaryHtmlView to operate on.
+ *
+ * Retrieves the HTML stored in @view. This return value is not duplicated
+ * before returning, so you should not free it. Instead, if you want to free
+ * the HTML stored in @view, you should use
+ * executive_summary_html_view_set_html (view, NULL);.
+ *
+ * Returns: A pointer to the HTML stored in @view.
+ */
+const char *
+executive_summary_html_view_get_html (ExecutiveSummaryHtmlView *view)
+{
+ ExecutiveSummaryHtmlViewPrivate *priv;
+
+ g_return_val_if_fail (view != NULL, NULL);
+ g_return_val_if_fail (IS_EXECUTIVE_SUMMARY_HTML_VIEW (view), NULL);
+
+ priv = view->private;
+ return priv->html;
+}
+
diff --git a/executive-summary/evolution-services/executive-summary-html-view.h b/executive-summary/evolution-services/executive-summary-html-view.h
new file mode 100644
index 0000000000..19e40cb2b8
--- /dev/null
+++ b/executive-summary/evolution-services/executive-summary-html-view.h
@@ -0,0 +1,57 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* executive-summary-html-view.h
+ *
+ * Authors: Iain Holmes <iain@helixcode.com>
+ *
+ * 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.
+ */
+
+#ifndef _EXECUTIVE_SUMMARY_HTML_VIEW_H__
+#define _EXECUTIVE_SUMMARY_HTML_VIEW_H__
+
+#include <bonobo/bonobo-object.h>
+
+#define EXECUTIVE_SUMMARY_HTML_VIEW_TYPE (executive_summary_html_view_get_type ())
+#define EXECUTIVE_SUMMARY_HTML_VIEW(obj) (GTK_CHECK_CAST ((obj), EXECUTIVE_SUMMARY_HTML_VIEW_TYPE, ExecutiveSummaryHtmlView))
+#define EXECUTIVE_SUMMARY_HTML_VIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EXECUTIVE_SUMMARY_HTML_VIEW_TYPE, ExecutiveSummaryHtmlViewClass))
+#define IS_EXECUTIVE_SUMMARY_HTML_VIEW(obj) (GTK_CHECK_TYPE ((obj), EXECUTIVE_SUMMARY_HTML_VIEW_TYPE))
+#define IS_EXECUTIVE_SUMMARY_HTML_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), EXECUTIVE_SUMMARY_HTML_VIEW_TYPE))
+
+typedef struct _ExecutiveSummaryHtmlViewPrivate ExecutiveSummaryHtmlViewPrivate;
+typedef struct _ExecutiveSummaryHtmlView ExecutiveSummaryHtmlView;
+typedef struct _ExecutiveSummaryHtmlViewClass ExecutiveSummaryHtmlViewClass;
+
+struct _ExecutiveSummaryHtmlView {
+ BonoboObject parent;
+
+ ExecutiveSummaryHtmlViewPrivate *private;
+};
+
+struct _ExecutiveSummaryHtmlViewClass {
+ BonoboObjectClass parent_class;
+};
+
+GtkType executive_summary_html_view_get_type (void);
+BonoboObject *executive_summary_html_view_new (void);
+
+void executive_summary_html_view_set_html (ExecutiveSummaryHtmlView *view,
+ const char *html);
+const char *executive_summary_html_view_get_html (ExecutiveSummaryHtmlView *view);
+
+#endif
+
diff --git a/executive-summary/evolution-services/executive-summary.c b/executive-summary/evolution-services/executive-summary.c
index 1f717cc0b4..868584ad52 100644
--- a/executive-summary/evolution-services/executive-summary.c
+++ b/executive-summary/evolution-services/executive-summary.c
@@ -79,6 +79,7 @@ create_servant (void)
return servant;
}
+#if 0
static void
impl_GNOME_Evolution_Summary_ViewFrame_setTitle (PortableServer_Servant servant,
CORBA_long id,
@@ -140,6 +141,7 @@ impl_GNOME_Evolution_Summary_ViewFrame_updateComponent (PortableServer_Servant s
gtk_signal_emit (GTK_OBJECT (summary), summary_signals[UPDATE],
id, html);
}
+#endif
/* GtkObject methods */
static void
@@ -173,10 +175,6 @@ corba_class_init (void)
base_epv->default_POA = NULL;
epv = g_new0 (POA_GNOME_Evolution_Summary_ViewFrame__epv, 1);
- epv->setTitle = impl_GNOME_Evolution_Summary_ViewFrame_setTitle;
- epv->setIcon = impl_GNOME_Evolution_Summary_ViewFrame_setIcon;
- epv->flash = impl_GNOME_Evolution_Summary_ViewFrame_flash;
- epv->updateComponent = impl_GNOME_Evolution_Summary_ViewFrame_updateComponent;
vepv = &Summary_vepv;
vepv->_base_epv = base_epv;
diff --git a/executive-summary/evolution-services/executive-summary.h b/executive-summary/evolution-services/executive-summary.h
index 23765044f4..ad5a07149d 100644
--- a/executive-summary/evolution-services/executive-summary.h
+++ b/executive-summary/evolution-services/executive-summary.h
@@ -65,3 +65,4 @@ void executive_summary_construct (ExecutiveSummary *es,
GNOME_Evolution_Summary_ViewFrame corba_object);
BonoboObject *executive_summary_new (void);
#endif
+