aboutsummaryrefslogtreecommitdiffstats
path: root/executive-summary/evolution-services/executive-summary-client.c
diff options
context:
space:
mode:
authorIain Holmes <iain@src.gnome.org>2000-10-05 08:27:52 +0800
committerIain Holmes <iain@src.gnome.org>2000-10-05 08:27:52 +0800
commiteac1b77c2ff04f5630409500f7582a010a1b3fd7 (patch)
tree8141f7dfd5b313d2926bda934679c018540892b9 /executive-summary/evolution-services/executive-summary-client.c
parentb3046d2a2345a862b65dc6b4c6cbd022519c7091 (diff)
downloadgsoc2013-evolution-eac1b77c2ff04f5630409500f7582a010a1b3fd7.tar
gsoc2013-evolution-eac1b77c2ff04f5630409500f7582a010a1b3fd7.tar.gz
gsoc2013-evolution-eac1b77c2ff04f5630409500f7582a010a1b3fd7.tar.bz2
gsoc2013-evolution-eac1b77c2ff04f5630409500f7582a010a1b3fd7.tar.lz
gsoc2013-evolution-eac1b77c2ff04f5630409500f7582a010a1b3fd7.tar.xz
gsoc2013-evolution-eac1b77c2ff04f5630409500f7582a010a1b3fd7.tar.zst
gsoc2013-evolution-eac1b77c2ff04f5630409500f7582a010a1b3fd7.zip
Add the executive summary stuff.
Hopefully nothing is broken. svn path=/trunk/; revision=5731
Diffstat (limited to 'executive-summary/evolution-services/executive-summary-client.c')
-rw-r--r--executive-summary/evolution-services/executive-summary-client.c162
1 files changed, 162 insertions, 0 deletions
diff --git a/executive-summary/evolution-services/executive-summary-client.c b/executive-summary/evolution-services/executive-summary-client.c
new file mode 100644
index 0000000000..2ea9175bd9
--- /dev/null
+++ b/executive-summary/evolution-services/executive-summary-client.c
@@ -0,0 +1,162 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* executive-summary-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 "Executive-Summary.h"
+#include "executive-summary-client.h"
+#include "executive-summary-component.h"
+
+#define PARENT_TYPE BONOBO_OBJECT_CLIENT_TYPE
+static BonoboObjectClass *parent_class = NULL;
+
+struct _ExecutiveSummaryClientPrivate {
+ int dummy;
+};
+
+static void
+executive_summary_client_destroy (GtkObject *object)
+{
+ ExecutiveSummaryClient *client;
+ ExecutiveSummaryClientPrivate *priv;
+
+ client = EXECUTIVE_SUMMARY_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_client_init (ExecutiveSummaryClient *client)
+{
+ ExecutiveSummaryClientPrivate *priv;
+
+ priv = g_new0 (ExecutiveSummaryClientPrivate, 1);
+ client->private = priv;
+}
+
+static void
+executive_summary_client_class_init (ExecutiveSummaryClientClass *client)
+{
+ GtkObjectClass *object_class;
+
+ object_class = GTK_OBJECT_CLASS (client);
+ parent_class = gtk_type_class (PARENT_TYPE);
+
+ object_class->destroy = executive_summary_client_destroy;
+}
+
+void
+executive_summary_client_construct (ExecutiveSummaryClient *client,
+ CORBA_Object corba_object)
+{
+ g_return_if_fail (client != NULL);
+ g_return_if_fail (IS_EXECUTIVE_SUMMARY_CLIENT (client));
+ g_return_if_fail (corba_object != CORBA_OBJECT_NIL);
+
+ bonobo_object_client_construct (BONOBO_OBJECT_CLIENT (client), corba_object);
+}
+
+E_MAKE_TYPE (executive_summary_client, "ExecutiveSummaryClient",
+ ExecutiveSummaryClient, executive_summary_client_class_init,
+ executive_summary_client_init, PARENT_TYPE);
+
+void
+executive_summary_client_set_title (ExecutiveSummaryClient *client,
+ ExecutiveSummaryComponent *component,
+ const char *title)
+{
+ Evolution_Summary summary;
+ Evolution_SummaryComponent corba_object;
+ CORBA_Environment ev;
+
+ CORBA_exception_init (&ev);
+ summary = bonobo_object_corba_objref (BONOBO_OBJECT (client));
+ corba_object = bonobo_object_corba_objref (BONOBO_OBJECT (component));
+
+ Evolution_Summary_set_title (summary, corba_object, title, &ev);
+
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_warning ("Error setting title to %s:%s", title, CORBA_exception_id (&ev));
+ }
+
+ CORBA_exception_free (&ev);
+}
+
+void
+executive_summary_client_flash (ExecutiveSummaryClient *client,
+ ExecutiveSummaryComponent *component)
+{
+ Evolution_Summary summary;
+ Evolution_SummaryComponent corba_object;
+ CORBA_Environment ev;
+
+ CORBA_exception_init (&ev);
+ summary = bonobo_object_corba_objref (BONOBO_OBJECT (client));
+ corba_object = bonobo_object_corba_objref (BONOBO_OBJECT (component));
+
+ Evolution_Summary_flash (summary, corba_object, &ev);
+
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_warning ("Error flashing");
+ }
+
+ CORBA_exception_free (&ev);
+}
+
+void
+executive_summary_client_update (ExecutiveSummaryClient *client,
+ ExecutiveSummaryComponent *component,
+ char *html)
+{
+ Evolution_Summary summary;
+ Evolution_SummaryComponent corba_object;
+ CORBA_Environment ev;
+
+ CORBA_exception_init (&ev);
+ summary = bonobo_object_corba_objref (BONOBO_OBJECT (client));
+ corba_object = bonobo_object_corba_objref (BONOBO_OBJECT (component));
+
+ Evolution_Summary_update_html_component (summary, corba_object,
+ html, &ev);
+
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_warning ("Error updating the component");
+ }
+
+ CORBA_exception_free (&ev);
+}
+
+