aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2004-01-12 13:26:25 +0800
committerJP Rosevear <jpr@src.gnome.org>2004-01-12 13:26:25 +0800
commit4787dbb15c1f8ef0a2825841055906bd576eb8e4 (patch)
tree839cdbe5cae5a26fdbdac755857bddda5a52f9db /shell
parentfad2e1d35daaca3af3d6c9fafb76d0f0fe56c938 (diff)
downloadgsoc2013-evolution-4787dbb15c1f8ef0a2825841055906bd576eb8e4.tar.gz
gsoc2013-evolution-4787dbb15c1f8ef0a2825841055906bd576eb8e4.tar.zst
gsoc2013-evolution-4787dbb15c1f8ef0a2825841055906bd576eb8e4.zip
Complete rewrite to match current component api
2004-01-12 JP Rosevear <jpr@ximian.com> * evolution-test-component.[hc]: Complete rewrite to match current component api * Makefile.am: conditionally build the test component svn path=/trunk/; revision=24166
Diffstat (limited to 'shell')
-rw-r--r--shell/ChangeLog7
-rw-r--r--shell/evolution-test-component.c39
2 files changed, 43 insertions, 3 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 7ee15bda30..c6f928e438 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,10 @@
+2004-01-12 JP Rosevear <jpr@ximian.com>
+
+ * evolution-test-component.[hc]: Complete rewrite to match current
+ component api
+
+ * Makefile.am: conditionally build the test component
+
2004-01-11 JP Rosevear <jpr@ximian.com>
* e-sidebar.c (button_new): track hbox and label widget
diff --git a/shell/evolution-test-component.c b/shell/evolution-test-component.c
index 4c6fbea4f9..2fd140b032 100644
--- a/shell/evolution-test-component.c
+++ b/shell/evolution-test-component.c
@@ -26,6 +26,7 @@
#include <errno.h>
#include <string.h>
+#include <bonobo/bonobo-shlib-factory.h>
#include <bonobo/bonobo-control.h>
#include <bonobo/bonobo-i18n.h>
#include <bonobo/bonobo-exception.h>
@@ -34,6 +35,8 @@
#include "evolution-test-component.h"
+#define FACTORY_ID "OAFIID:GNOME_Evolution_Test_Factory:" BASE_VERSION
+#define TEST_COMPONENT_ID "OAFIID:GNOME_Evolution_Test_Component:" BASE_VERSION
#define CREATE_TEST_ID "test"
#define PARENT_TYPE bonobo_object_get_type ()
@@ -96,12 +99,24 @@ impl_createControls (PortableServer_Servant servant,
{
EvolutionTestComponent *component = EVOLUTION_TEST_COMPONENT (bonobo_object_from_servant (servant));
EvolutionTestComponentPrivate *priv;
+ GtkWidget *label, *bar;
priv = component->priv;
- priv->sidebar_control = bonobo_control_new (gtk_label_new ("Side Bar Control"));
- priv->view_control = bonobo_control_new (gtk_label_new ("View Control"));
- priv->status_control = bonobo_control_new (e_task_bar_new ());
+ /* Sidebar */
+ label = gtk_label_new ("Side Bar Control");
+ gtk_widget_show (label);
+ priv->sidebar_control = bonobo_control_new (label);
+
+ /* View */
+ label = gtk_label_new ("View Control");
+ gtk_widget_show (label);
+ priv->view_control = bonobo_control_new (label);
+
+ /* Status bar */
+ bar = e_task_bar_new ();
+ gtk_widget_show (bar);
+ priv->status_control = bonobo_control_new (bar);
/* Return the controls */
*corba_sidebar_control = CORBA_Object_duplicate (BONOBO_OBJREF (priv->sidebar_control), ev);
@@ -179,3 +194,21 @@ evolution_test_component_init (EvolutionTestComponent *component, EvolutionTestC
}
BONOBO_TYPE_FUNC_FULL (EvolutionTestComponent, GNOME_Evolution_Component, PARENT_TYPE, evolution_test_component)
+
+static BonoboObject *
+factory (BonoboGenericFactory *factory,
+ const char *component_id,
+ void *closure)
+{
+ if (strcmp (component_id, TEST_COMPONENT_ID) == 0) {
+ BonoboObject *object = BONOBO_OBJECT (g_object_new (EVOLUTION_TEST_TYPE_COMPONENT, NULL));
+ bonobo_object_ref (object);
+ return object;
+ }
+
+ g_warning (FACTORY_ID ": Don't know what to do with %s", component_id);
+
+ return NULL;
+}
+
+BONOBO_ACTIVATION_SHLIB_FACTORY (FACTORY_ID, "Evolution Calendar component factory", factory, NULL)