diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-03-14 00:59:34 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-03-14 00:59:34 +0800 |
commit | f59d7438e2498b9a7dcaf3d95e403069338ca0e2 (patch) | |
tree | 9c540a5ea870e15c44981b59d4e211d22b5cc356 /addressbook/demo/addressbook.c | |
parent | 2e19c1630acc12875081163e20ddd9538dafd741 (diff) | |
download | gsoc2013-evolution-f59d7438e2498b9a7dcaf3d95e403069338ca0e2.tar gsoc2013-evolution-f59d7438e2498b9a7dcaf3d95e403069338ca0e2.tar.gz gsoc2013-evolution-f59d7438e2498b9a7dcaf3d95e403069338ca0e2.tar.bz2 gsoc2013-evolution-f59d7438e2498b9a7dcaf3d95e403069338ca0e2.tar.lz gsoc2013-evolution-f59d7438e2498b9a7dcaf3d95e403069338ca0e2.tar.xz gsoc2013-evolution-f59d7438e2498b9a7dcaf3d95e403069338ca0e2.tar.zst gsoc2013-evolution-f59d7438e2498b9a7dcaf3d95e403069338ca0e2.zip |
Added an E_FOLDER_CONTACTS section to the get_view function.
2000-03-13 Christopher James Lahey <clahey@helixcode.com>
* shell/e-shell-view.c: Added an E_FOLDER_CONTACTS section to the
get_view function.
* addressbook/demo/Makefile.am: Added files for addressbook bonobo
component. Changed non bonobo version to compile as
test-addressbook.
* addressbook/demo/addressbook.c,
addressbook/demo/addressbook.gnorba,
addressbook/demo/addressbook.h,
addressbook/demo/addressbook-factory.c,
addressbook/demo/addressbook-widget.c,
addressbook/demo/addressbook-widget.h: New factory to create an
addressbook bonobo component.
svn path=/trunk/; revision=2114
Diffstat (limited to 'addressbook/demo/addressbook.c')
-rw-r--r-- | addressbook/demo/addressbook.c | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/addressbook/demo/addressbook.c b/addressbook/demo/addressbook.c new file mode 100644 index 0000000000..7350e0cd0c --- /dev/null +++ b/addressbook/demo/addressbook.c @@ -0,0 +1,111 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * folder-browser-factory.c: A Bonobo Control factory for Folder Browsers + * + * Author: + * Miguel de Icaza (miguel@helixcode.com) + * + * (C) 2000 Helix Code, Inc. + */ +/* + * bonobo-clock-control.c + * + * Copyright 1999, Helix Code, Inc. + * + * Author: + * Nat Friedman (nat@nat.org) + */ + +#include <config.h> +#include <gnome.h> +#include <libgnorba/gnorba.h> +#include <bonobo.h> + +#include <libgnomeui/gtk-clock.h> + +#include "addressbook-widget.h" +#include "addressbook.h" + +#if 0 +static void +bonobo_clock_control_prop_value_changed_cb (BonoboPropertyBag *pb, char *name, char *type, + gpointer old_value, gpointer new_value, + gpointer user_data) +{ + GtkClock *clock = user_data; + + if (! strcmp (name, "running")) { + gboolean *b = new_value; + + if (*b) + gtk_clock_start (clock); + else + gtk_clock_stop (clock); + } +} + +/* + * Callback routine used to release any values we associated with the control + * dynamically. + */ +static void +release_data (GtkObject *object, void *data) +{ + g_free (data); +} +#endif + +static BonoboObject * +addressbook_factory (BonoboGenericFactory *Factory, void *closure) +{ +#if 0 + BonoboPropertyBag *pb; + CORBA_boolean *running; +#endif + BonoboControl *control; + View *view; + + /* Create the control. */ + view = create_view(); + control = bonobo_control_new (view->widget); +#if 0 + /* Create the properties. */ + pb = bonobo_property_bag_new (); + bonobo_control_set_property_bag (control, pb); + + gtk_signal_connect (GTK_OBJECT (pb), "value_changed", + bonobo_clock_control_prop_value_changed_cb, + clock); + + running = g_new0 (CORBA_boolean, 1); + *running = TRUE; + bonobo_property_bag_add (pb, "running", "boolean", + (gpointer) running, + NULL, "Whether or not the clock is running", 0); + + /* + * Release "running" when the object is destroyed + */ + gtk_signal_connect (GTK_OBJECT (pb), "destroy", GTK_SIGNAL_FUNC (release_data), running); +#endif + + return BONOBO_OBJECT (control); +} + +void +addressbook_factory_init (void) +{ + static BonoboGenericFactory *addressbook_control_factory = NULL; + + if (addressbook_control_factory != NULL) + return; + + addressbook_control_factory = + bonobo_generic_factory_new ( + "control-factory:addressbook", + addressbook_factory, NULL); + + if (addressbook_control_factory == NULL) { + g_error ("I could not register a Addressbook factory."); + } +} |