Patch for review.




Hi guys,

    The attached patch does three things:

        a. There was a problem with controls not being reparented
           properly.  Basically if you reparent a GtkWidget which has
           as an ancestor a BonoboControl, the control would crash.
           The reason for this was that reparenting causes the
           GtkSocket on the container side to get re-realized, and a
           new XID therefore gets passed to the control, which doesn't
           know how to deal with it and chokes.  The patch basically
           creates a GtkPlug using the new XID, reparents the
           control's top-level widget, and destroys the old plug.
           Easy as pie.

        b. In actually using controls, Ettore was experiencing a
           problem where he had no way of knowing when a container's
           UIHandler would be available to the control, because a
           ControlFrame creator is able to set the UIHandler of the
           control frame *after* exporting the frame over CORBA.  So a 
           call to bonobo_control_get_remote_ui_handler would return
           nil.

           This patch solves the problem by forcing you to specify the
           ui handler when you create the controlframe.  I also
           realized that you want to specify the ui handler with its
           corba objref, and not with the GtkObject.  But this might
           be wrong, now that I think of it.

           In any case, this sucks because it breaks the API again.
           Sigh.

        c. Adds an "autoactivate" facility to controls which allows
           them to automatically be activated when they get focus.
           This way, when you click on a control, it knows to merge
           it's menus/toolbars.  This feature is off by default (so
           that Views get the right behavior, basically), but
           BonoboWidget turns it on.

So please review my patch and tell me what you think before I commit
it.

Index: bonobo-client-site.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-client-site.c,v
retrieving revision 1.47
diff -u -r1.47 bonobo-client-site.c
--- bonobo-client-site.c	2000/01/25 11:35:41	1.47
+++ bonobo-client-site.c	2000/02/10 07:22:46
@@ -357,6 +357,7 @@
  * bonobo_client_site_get_embeddable:
  * @client_site: A BonoboClientSite object which is bound to a remote
  * BonoboObject server.
+ * @uih: The CORBA object for the container's UIHandler server.
  *
  * Returns: The BonoboObjectClient object which corresponds to the
  * remote BonoboObject to which @client_site is bound.
@@ -382,6 +383,7 @@
 /**
  * bonobo_client_site_new_view_full:
  * @client_site: the client site that contains a remote Embeddable object.
+ * @uih: The CORBA object for the container's UIHandler server.
  * @visible_cover: %TRUE if the cover should draw a border when it is active.
  * @active_view: %TRUE if the view should be uncovered when it is created.
  *
@@ -396,8 +398,9 @@
  */
 BonoboViewFrame *
 bonobo_client_site_new_view_full (BonoboClientSite *client_site,
-				 gboolean visible_cover,
-				 gboolean active_view)
+				  Bonobo_UIHandler  uih,
+				  gboolean          visible_cover,
+				  gboolean          active_view)
 {
 	BonoboObjectClient *server_object;
 	BonoboViewFrame *view_frame;
@@ -415,7 +418,7 @@
 	/*
 	 * 1. Create the view frame.
 	 */
-	view_frame = bonobo_view_frame_new (client_site);
+	view_frame = bonobo_view_frame_new (client_site, uih);
 	wrapper = BONOBO_WRAPPER (bonobo_view_frame_get_wrapper (view_frame));
 	bonobo_wrapper_set_visibility (wrapper, visible_cover);
 	bonobo_wrapper_set_covered (wrapper, ! active_view);
@@ -466,10 +469,11 @@
  * the new view of @server_object.
  */
 BonoboViewFrame *
-bonobo_client_site_new_view (BonoboClientSite *client_site)
+bonobo_client_site_new_view (BonoboClientSite *client_site,
+			     Bonobo_UIHandler  uih)
 {
 
-	return bonobo_client_site_new_view_full (client_site, TRUE, FALSE);
+	return bonobo_client_site_new_view_full (client_site, uih, TRUE, FALSE);
 }
 
 static void
Index: bonobo-client-site.h
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-client-site.h,v
retrieving revision 1.28
diff -u -r1.28 bonobo-client-site.h
--- bonobo-client-site.h	2000/01/25 11:35:41	1.28
+++ bonobo-client-site.h	2000/02/10 07:22:47
@@ -50,29 +50,29 @@
 	void (*save_object)  (BonoboClientSite *, Bonobo_Persist_Status *status);
 } BonoboClientSiteClass;
 
-GtkType            bonobo_client_site_get_type		(void);
-BonoboClientSite   *bonobo_client_site_new		(BonoboContainer *container);
-BonoboClientSite   *bonobo_client_site_construct		(BonoboClientSite  *client_site,
-							 Bonobo_ClientSite corba_client_site,
-							 BonoboContainer   *container);
+GtkType                     bonobo_client_site_get_type         (void);
+BonoboClientSite           *bonobo_client_site_new              (BonoboContainer    *container);
+BonoboClientSite           *bonobo_client_site_construct        (BonoboClientSite   *client_site,
+								 Bonobo_ClientSite   corba_client_site,
+								 BonoboContainer    *container);
+gboolean                    bonobo_client_site_bind_embeddable  (BonoboClientSite   *client_site,
+								 BonoboObjectClient *object);
+BonoboObjectClient         *bonobo_client_site_get_embeddable   (BonoboClientSite   *client_site);
 
-gboolean           bonobo_client_site_bind_embeddable	(BonoboClientSite *client_site,
-							 BonoboObjectClient *object);
-BonoboObjectClient *bonobo_client_site_get_embeddable	(BonoboClientSite *client_site);
-
 /*
  * Proxy/Utility functions.
  */
-BonoboViewFrame	  *bonobo_client_site_new_view_full	(BonoboClientSite *client_site,
-							 gboolean visible_cover,
-							 gboolean active_view);
-BonoboViewFrame    *bonobo_client_site_new_view		(BonoboClientSite *client_site);
-GnomeCanvasItem   *bonobo_client_site_new_item           (BonoboClientSite *client_site,
-							 GnomeCanvasGroup *group);
-GList		  *bonobo_client_site_get_verbs		(BonoboClientSite *client_site);
-void		   bonobo_client_site_free_verbs		(GList *verb_list);
-
-POA_Bonobo_ClientSite__epv *bonobo_client_site_get_epv	(void);
+BonoboViewFrame            *bonobo_client_site_new_view_full    (BonoboClientSite   *client_site,
+								 Bonobo_UIHandler    uih,
+								 gboolean            visible_cover,
+								 gboolean            active_view);
+BonoboViewFrame            *bonobo_client_site_new_view         (BonoboClientSite   *client_site,
+								 Bonobo_UIHandler    uih);
+GnomeCanvasItem            *bonobo_client_site_new_item         (BonoboClientSite   *client_site,
+								 GnomeCanvasGroup   *group);
+GList                      *bonobo_client_site_get_verbs        (BonoboClientSite   *client_site);
+void                        bonobo_client_site_free_verbs       (GList              *verb_list);
+POA_Bonobo_ClientSite__epv *bonobo_client_site_get_epv          (void);
 
 extern POA_Bonobo_ClientSite__vepv bonobo_client_site_vepv;
 
Index: bonobo-control-frame.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-control-frame.c,v
retrieving revision 1.13
diff -u -r1.13 bonobo-control-frame.c
--- bonobo-control-frame.c	2000/02/03 03:30:58	1.13
+++ bonobo-control-frame.c	2000/02/10 07:22:50
@@ -37,11 +37,12 @@
 POA_Bonobo_ControlFrame__vepv bonobo_control_frame_vepv;
 
 struct _BonoboControlFramePrivate {
-	Bonobo_Control	  control;
-	GtkWidget        *container;
-	GtkWidget	 *socket;
-	BonoboUIHandler   *uih;
+	Bonobo_Control	   control;
+	GtkWidget         *container;
+	GtkWidget	  *socket;
+	Bonobo_UIHandler   uih;
 	BonoboPropertyBag *propbag;
+	gboolean           autoactivate;
 };
 
 static void
@@ -77,9 +78,8 @@
 
 	if (control_frame->priv->uih == NULL)
 		return CORBA_OBJECT_NIL;
-	
-	return CORBA_Object_duplicate (
-		bonobo_object_corba_objref (BONOBO_OBJECT (control_frame->priv->uih)), ev);
+
+	return CORBA_Object_duplicate (control_frame->priv->uih, ev);
 }
 
 static Bonobo_PropertyBag
@@ -146,6 +146,37 @@
 	return bonobo_object_activate_servant (object, servant);
 }
 
+
+static gint
+bonobo_control_frame_autoactivate_focus_in (GtkWidget     *widget,
+					    GdkEventFocus *focus,
+					    gpointer       data)
+{
+	BonoboControlFrame *control_frame = data;
+	
+	if (! control_frame->priv->autoactivate)
+		return FALSE;
+
+	bonobo_control_frame_control_activate (control_frame);
+
+	return FALSE;
+}
+
+static gint
+bonobo_control_frame_autoactivate_focus_out (GtkWidget     *widget,
+					     GdkEventFocus *focus,
+					     gpointer       data)
+{
+	BonoboControlFrame *control_frame = data;
+
+	if (! control_frame->priv->autoactivate)
+		return FALSE;
+	
+	bonobo_control_frame_control_activate (control_frame);
+
+	return FALSE;
+}
+
 static void
 bonobo_control_frame_set_remote_window (GtkWidget *socket, BonoboControlFrame *control_frame)
 {
@@ -175,8 +206,9 @@
 
 /**
  * bonobo_control_frame_construct:
- * @control_frame: The BonoboControlFrame object to be initialized.
+ * @control_frame: The #BonoboControlFrame object to be initialized.
  * @corba_control_frame: A CORBA object for the Bonobo_ControlFrame interface.
+ * @uih: A CORBA object for the UIHandler for the container application.
  *
  * Initializes @control_frame with the parameters.
  *
@@ -184,14 +216,17 @@
  * Bonobo::ControlFrame CORBA service.
  */
 BonoboControlFrame *
-bonobo_control_frame_construct (BonoboControlFrame *control_frame,
-			       Bonobo_ControlFrame corba_control_frame)
+bonobo_control_frame_construct (BonoboControlFrame  *control_frame,
+				Bonobo_ControlFrame  corba_control_frame,
+				Bonobo_UIHandler     uih)
 {
 	g_return_val_if_fail (control_frame != NULL, NULL);
 	g_return_val_if_fail (BONOBO_IS_CONTROL_FRAME (control_frame), NULL);
 
 	bonobo_object_construct (BONOBO_OBJECT (control_frame), corba_control_frame);
 
+	control_frame->priv->uih = uih;
+
 	/*
 	 * Now create the GtkSocket which will be used to embed
 	 * the Control.
@@ -200,6 +235,20 @@
 	gtk_widget_show (control_frame->priv->socket);
 
 	/*
+	 * Connect to the focus events on the socket so
+	 * that we can provide the autoactivation feature.
+	 */
+	gtk_signal_connect (GTK_OBJECT (control_frame->priv->socket),
+			    "focus_in_event",
+			    GTK_SIGNAL_FUNC (bonobo_control_frame_autoactivate_focus_in),
+			    control_frame);
+
+	gtk_signal_connect (GTK_OBJECT (control_frame->priv->socket),
+			    "focus_out_event",
+			    GTK_SIGNAL_FUNC (bonobo_control_frame_autoactivate_focus_out),
+			    control_frame);
+
+	/*
 	 * Finally, create a box to hold the socket; this no-window
 	 * container is needed solely for the sake of bypassing
 	 * plug/socket in the local case.
@@ -210,7 +259,7 @@
 			  control_frame->priv->socket,
 			  TRUE, TRUE, 0);
 	gtk_widget_ref (control_frame->priv->container);
-	gtk_object_sink (GTK_OBJECT(control_frame->priv->container));
+	gtk_object_sink (GTK_OBJECT (control_frame->priv->container));
 	gtk_widget_show (control_frame->priv->container);
 
 	/*
@@ -227,12 +276,13 @@
 
 /**
  * bonobo_control_frame_new:
+ * @uih: The #Bonobo_UIHandler for the container application.
  *
  * Returns: BonoboControlFrame object that implements the
  * Bonobo::ControlFrame CORBA service. 
  */
 BonoboControlFrame *
-bonobo_control_frame_new (void)
+bonobo_control_frame_new (Bonobo_UIHandler uih)
 {
 	Bonobo_ControlFrame corba_control_frame;
 	BonoboControlFrame *control_frame;
@@ -245,7 +295,7 @@
 		return NULL;
 	}
 
-	return bonobo_control_frame_construct (control_frame, corba_control_frame);
+	return bonobo_control_frame_construct (control_frame, corba_control_frame, uih);
 }
 
 static void
@@ -360,7 +410,8 @@
 {
 	BonoboControlFrame *control_frame = BONOBO_CONTROL_FRAME (object);
 
-	control_frame->priv = g_new0 (BonoboControlFramePrivate, 1);
+	control_frame->priv               = g_new0 (BonoboControlFramePrivate, 1);
+	control_frame->priv->autoactivate = FALSE;
 }
 
 /**
@@ -587,40 +638,45 @@
 }
 
 /**
- * bonobo_control_frame_set_ui_handler:
+ * bonobo_control_frame_set_autoactivate:
  * @control_frame: A BonoboControlFrame object.
- * @uih: A BonoboUIHandler object to be associated with this ControlFrame.
- *
- * Sets the BonoboUIHandler object for this ControlFrame.  When the
- * ControlFrame's Control requests its container's UIHandler
- * interface, the ControlFrame will pass it the UIHandler specified
- * here.  See also bonobo_control_frame_get_ui_handler().
+ * @autoactivate: A flag which indicates whether or not the
+ * ControlFrame should automatically perform activation on the Control
+ * to which it is bound.
+ *
+ * Modifies the autoactivate behavior of @control_frame.  If
+ * @control_frame is set to autoactivate, then it will automatically
+ * send an "activate" message to the Control to which it is bound when
+ * it gets a focus-in event, and a "deactivate" message when it gets a
+ * focus-out event.
  */
+
 void
-bonobo_control_frame_set_ui_handler (BonoboControlFrame *control_frame, BonoboUIHandler *uih)
+bonobo_control_frame_set_autoactivate (BonoboControlFrame  *control_frame,
+				       gboolean             autoactivate)
 {
 	g_return_if_fail (control_frame != NULL);
 	g_return_if_fail (BONOBO_IS_CONTROL_FRAME (control_frame));
-	g_return_if_fail (uih != NULL);
-	g_return_if_fail (BONOBO_IS_UI_HANDLER (uih));
 
-	control_frame->priv->uih = uih;
+	control_frame->priv->autoactivate = autoactivate;
 }
 
+
 /**
- * bonobo_control_frame_get_ui_handler:
+ * bonobo_control_frame_get_autoactivate:
  * @control_frame: A BonoboControlFrame object.
  *
- * Returns: The BonoboUIHandler associated with this COntrolFrame.  See
- * also bonobo_control_frame_set_ui_handler().
+ * Returns: A boolean which indicates whether or not @control_frame is
+ * set to automatically activate its Control.  See
+ * bonobo_control_frame_set_autoactivate().
  */
-BonoboUIHandler *
-bonobo_control_frame_get_ui_handler (BonoboControlFrame *control_frame)
+gboolean
+bonobo_control_frame_get_autoactivate (BonoboControlFrame *control_frame)
 {
-	g_return_val_if_fail (control_frame != NULL, NULL);
-	g_return_val_if_fail (BONOBO_IS_CONTROL_FRAME (control_frame), NULL);
+	g_return_val_if_fail (control_frame != NULL, FALSE);
+	g_return_val_if_fail (BONOBO_IS_CONTROL_FRAME (control_frame), FALSE);
 
-	return control_frame->priv->uih;
+	return control_frame->priv->autoactivate;
 }
 
 /**
Index: bonobo-control-frame.h
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-control-frame.h,v
retrieving revision 1.8
diff -u -r1.8 bonobo-control-frame.h
--- bonobo-control-frame.h	2000/01/25 11:35:42	1.8
+++ bonobo-control-frame.h	2000/02/10 07:22:53
@@ -39,22 +39,23 @@
 } BonoboControlFrameClass;
 
 
-GtkType                      bonobo_control_frame_get_type                  (void);
+GtkType                       bonobo_control_frame_get_type                  (void);
 BonoboControlFrame           *bonobo_control_frame_construct                 (BonoboControlFrame  *control_frame,
-									    Bonobo_ControlFrame  corba_control_frame);
-BonoboControlFrame           *bonobo_control_frame_new                       (void);
-void                         bonobo_control_frame_bind_to_control           (BonoboControlFrame  *control_frame,
-									    Bonobo_Control       control);
+									      Bonobo_ControlFrame  corba_control_frame,
+									      Bonobo_UIHandler     uih);
+BonoboControlFrame           *bonobo_control_frame_new                       (Bonobo_UIHandler     uih);
+void                          bonobo_control_frame_bind_to_control           (BonoboControlFrame  *control_frame,
+									      Bonobo_Control       control);
 Bonobo_Control                bonobo_control_frame_get_control               (BonoboControlFrame  *control_frame);
-void			     bonobo_control_frame_set_propbag		   (BonoboControlFrame  *control_frame,
-									    BonoboPropertyBag   *propbag);
-BonoboPropertyBag	    *bonobo_control_frame_get_propbag		   (BonoboControlFrame  *control_frame);
-GtkWidget                   *bonobo_control_frame_get_widget                (BonoboControlFrame  *frame);
-void                         bonobo_control_frame_control_activate          (BonoboControlFrame *control_frame);
-void                         bonobo_control_frame_control_deactivate        (BonoboControlFrame *control_frame);
-void                         bonobo_control_frame_set_ui_handler            (BonoboControlFrame     *view_frame,
-									    BonoboUIHandler        *uih);
-BonoboUIHandler              *bonobo_control_frame_get_ui_handler            (BonoboControlFrame  *view_frame);
+void                          bonobo_control_frame_set_propbag               (BonoboControlFrame  *control_frame,
+									      BonoboPropertyBag   *propbag);
+BonoboPropertyBag            *bonobo_control_frame_get_propbag               (BonoboControlFrame  *control_frame);
+GtkWidget                    *bonobo_control_frame_get_widget                (BonoboControlFrame  *frame);
+void                          bonobo_control_frame_control_activate          (BonoboControlFrame  *control_frame);
+void                          bonobo_control_frame_control_deactivate        (BonoboControlFrame  *control_frame);
+void                          bonobo_control_frame_set_autoactivate          (BonoboControlFrame  *control_frame,
+									      gboolean             autoactivate);
+gboolean                      bonobo_control_frame_get_autoactivate          (BonoboControlFrame  *control_frame);
 BonoboPropertyBagClient      *bonobo_control_frame_get_control_property_bag  (BonoboControlFrame  *control_frame);
 POA_Bonobo_ControlFrame__epv *bonobo_control_frame_get_epv                   (void);
 
Index: bonobo-control.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-control.c,v
retrieving revision 1.17
diff -u -r1.17 bonobo-control.c
--- bonobo-control.c	2000/02/03 03:30:58	1.17
+++ bonobo-control.c	2000/02/10 07:22:56
@@ -182,9 +182,9 @@
 }
 
 static void
-impl_Bonobo_Control_set_window (PortableServer_Servant servant,
-				Bonobo_Control_windowid id,
-				CORBA_Environment *ev)
+impl_Bonobo_Control_set_window (PortableServer_Servant   servant,
+				Bonobo_Control_windowid  id,
+				CORBA_Environment       *ev)
 {
 	guint32 x11_id;
 	GtkWidget *local_socket;
@@ -192,24 +192,45 @@
 
 	x11_id = window_id_demangle (id);
 
-	local_socket = bonobo_gtk_widget_from_x11_id(x11_id);
+	local_socket = bonobo_gtk_widget_from_x11_id (x11_id);
 
 	if (local_socket) {
 		GtkWidget *socket_parent;
 		control->priv->is_local = TRUE;
 		socket_parent = local_socket->parent;
-		gtk_widget_hide(local_socket);
+		gtk_widget_hide (local_socket);
 
 		gtk_box_pack_end (GTK_BOX (socket_parent),
 				  control->priv->widget,
 				  TRUE, TRUE, 0);
 	} else {
+		GtkWidget *old_plug;
+		gint       old_plug_destroy_id;
+
+		old_plug            = control->priv->plug;
+		old_plug_destroy_id = control->priv->plug_destroy_id;
+
+		/* Create the new plug */
 		control->priv->plug = gtk_plug_new (x11_id);
 		control->priv->plug_destroy_id = gtk_signal_connect (
 		        GTK_OBJECT (control->priv->plug), "destroy_event",
 		        GTK_SIGNAL_FUNC (bonobo_control_plug_destroy_cb), control);
-		gtk_container_add (GTK_CONTAINER (control->priv->plug), control->priv->widget);
-		gtk_widget_show_all (control->priv->plug);
+
+		/*
+		 * Put the control widget inside the plug.  If we
+		 * already have a plug, then reparent the control into
+		 * the new plug.
+		 */
+
+		if (old_plug != NULL) {
+			gtk_signal_disconnect (GTK_OBJECT (old_plug), old_plug_destroy_id);
+			gtk_object_unref (GTK_OBJECT (old_plug));
+			gtk_widget_reparent (control->priv->widget, control->priv->plug);
+		} else {
+			gtk_container_add (GTK_CONTAINER (control->priv->plug), control->priv->widget);
+		}
+
+		gtk_widget_show (control->priv->plug);
 	}
 }
 
Index: bonobo-selector.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-selector.c,v
retrieving revision 1.17
diff -u -r1.17 bonobo-selector.c
--- bonobo-selector.c	1999/12/16 18:26:26	1.17
+++ bonobo-selector.c	2000/02/10 07:22:59
@@ -1,16 +1,18 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 #include <config.h>
-#include "gnome-bonobo-selector.h"
+#include "bonobo-selector.h"
 #include <string.h> /* strcmp */
+#include <gnome.h>
+#include "bonobo-object-directory.h"
 
 #define DEFAULT_INTERFACE	"IDL:GNOME/Embeddable:1.0"
 
 static GtkDialogClass *parent_class;
 
-struct _GnomeBonoboSelectorPrivate 
+struct _BonoboSelectorPrivate 
 {
 	GtkWidget *clist;
-	GoadServerList *servers;
+	GList *servers;
 	int n_servers;
 	const gchar **interfaces_required;
 };
@@ -23,16 +25,15 @@
 
 guint bonobo_selector_signals[LAST_SIGNAL] = { 0, 0 };
 
-static void gnome_bonobo_selector_class_init (GnomeBonoboSelectorClass *klass);
-static void gnome_bonobo_selector_init (GtkWidget *widget);
-static void gnome_bonobo_selector_destroy (GtkObject *object);
+static void bonobo_selector_class_init (BonoboSelectorClass *klass);
+static void bonobo_selector_init (GtkWidget *widget);
+static void bonobo_selector_destroy (GtkObject *object);
 static void button_callback (GtkWidget *widget, gint button_number,
 	gpointer data);
 static void ok_callback (GtkWidget *widget, gpointer data);
 static void cancel_callback (GtkWidget *widget, gpointer data);
-static void add_gnorba_objects (GnomeBonoboSelector *widget); 
-static GList *get_filtered_objects (GnomeBonoboSelector *widget);
-static gboolean stringlist_contains (gchar **list, const gchar *word);
+static void add_gnorba_objects (BonoboSelector *widget); 
+static GList *get_filtered_objects (BonoboSelector *widget);
 
 
 /* fixme: revove this as soon it is included in gnome-dialog */
@@ -44,7 +45,7 @@
 
 
 static void
-gnome_bonobo_selector_class_init (GnomeBonoboSelectorClass *klass)
+bonobo_selector_class_init (BonoboSelectorClass *klass)
 {
 	GtkObjectClass *object_class;
 	
@@ -55,27 +56,27 @@
 
 	bonobo_selector_signals[OK] =
 		gtk_signal_new ("ok", GTK_RUN_LAST, object_class->type,
-		GTK_SIGNAL_OFFSET (GnomeBonoboSelectorClass, ok),
+		GTK_SIGNAL_OFFSET (BonoboSelectorClass, ok),
 		gtk_signal_default_marshaller, GTK_TYPE_NONE, 0);
 	
 	bonobo_selector_signals[CANCEL] =
 		gtk_signal_new ("cancel", GTK_RUN_LAST, object_class->type,
-		GTK_SIGNAL_OFFSET (GnomeBonoboSelectorClass, cancel),
+		GTK_SIGNAL_OFFSET (BonoboSelectorClass, cancel),
 		gtk_signal_default_marshaller, GTK_TYPE_NONE, 0);
 	
 	gtk_object_class_add_signals (object_class, bonobo_selector_signals,
 		LAST_SIGNAL);
 	
-	object_class->destroy = gnome_bonobo_selector_destroy;
+	object_class->destroy = bonobo_selector_destroy;
 }
 
 /**
- * gnome_bonobo_selector_get_type:
+ * bonobo_selector_get_type:
  *
- * Returns: The GtkType for the GnomeBonoboSelector object class.
+ * Returns: The GtkType for the BonoboSelector object class.
  */
 GtkType
-gnome_bonobo_selector_get_type (void)
+bonobo_selector_get_type (void)
 {
 	static guint bonobo_selector_type = 0;
 
@@ -83,11 +84,11 @@
 	{
 		GtkTypeInfo bonobo_selector_info =
 		{
-			"GnomeBonoboSelector",
-			sizeof (GnomeBonoboSelector),
-			sizeof (GnomeBonoboSelectorClass),
-			 (GtkClassInitFunc) gnome_bonobo_selector_class_init,
-			 (GtkObjectInitFunc) gnome_bonobo_selector_init,
+			"BonoboSelector",
+			sizeof (BonoboSelector),
+			sizeof (BonoboSelectorClass),
+			 (GtkClassInitFunc) bonobo_selector_class_init,
+			 (GtkObjectInitFunc) bonobo_selector_init,
 			 (GtkArgSetFunc) NULL,
 			 (GtkArgGetFunc) NULL
 		};
@@ -101,31 +102,31 @@
 }
 
 /**
- * gnome_bonobo_selector_new:
+ * bonobo_selector_new:
  * @title: A string which should go in the title of the
- * GnomeBonoboSelector window.
+ * BonoboSelector window.
  * @interfaces_required: A NULL_terminated array of interfaces which a
  * server must support in order to be listed in the selector.  Defaults
  * to "IDL:GNOME/Embeddable:1.0" if no interfaces are listed.
  *
- * Creates a new GnomeBonoboSelector widget.  The title of the dialog
+ * Creates a new BonoboSelector widget.  The title of the dialog
  * is set to @title, and the list of selectable servers is populated
  * with those servers which support the interfaces specified in
  * @interfaces_required.
  *
- * Returns: A pointer to the newly-created GnomeBonoboSelector widget.
+ * Returns: A pointer to the newly-created BonoboSelector widget.
  */
 GtkWidget *
-gnome_bonobo_selector_new (const gchar *title,
+bonobo_selector_new (const gchar *title,
 			   const gchar **interfaces_required)
 {
-	GnomeBonoboSelector *sel;
-	GnomeBonoboSelectorPrivate *priv;
+	BonoboSelector *sel;
+	BonoboSelectorPrivate *priv;
 
 	if (title == NULL) title = "";
 
 	
-	sel = gtk_type_new (gnome_bonobo_selector_get_type ());
+	sel = gtk_type_new (bonobo_selector_get_type ());
 	priv = sel->priv;
 	priv->interfaces_required = interfaces_required;
 	add_gnorba_objects (sel);
@@ -134,18 +135,18 @@
 }
 
 static void
-gnome_bonobo_selector_destroy (GtkObject *object)
+bonobo_selector_destroy (GtkObject *object)
 {
-	GnomeBonoboSelector *sel;
-	GnomeBonoboSelectorPrivate *priv; 
+	BonoboSelector *sel;
+	BonoboSelectorPrivate *priv; 
 	g_return_if_fail (object != NULL);
 	g_return_if_fail (GNOME_IS_BONOBO_SELECTOR (object));
 
-	sel = GNOME_BONOBO_SELECTOR (object);
+	sel = BONOBO_SELECTOR (object);
 	priv = sel->priv;
 
 	gtk_widget_destroy (priv->clist);
-	goad_server_list_free (priv->servers);
+	od_server_list_free (priv->servers);
 	g_free (priv);
 
 	if (GTK_OBJECT_CLASS (parent_class)->destroy)
@@ -153,21 +154,14 @@
 	
 }
 
-/**
- * gnome_bonobo_selector_get_selected_goad_id:
- * @sel: A GnomeBonoboSelector widget.
- *
- * Returns: A newly-allocated string containing the GOAD ID of the
- * currently-selected CORBA server (i.e., the corba server whose
- * name is highlighted in the list).  The user of this function is
- * responsible for freeing this.
- */
-gchar *
-gnome_bonobo_selector_get_selected_goad_id (GnomeBonoboSelector *sel)
+static gchar *
+bonobo_selector_get_selected_id (BonoboSelector *sel)
 {
 	GList *selection;
 	gchar *text;
-	GnomeBonoboSelectorPrivate *priv; 
+	BonoboSelectorPrivate *priv; 
+
+	od_assert_using_goad();
 	
 	g_return_val_if_fail (sel != NULL, NULL);
 	priv = sel->priv;	
@@ -179,25 +173,11 @@
 	return g_strdup (text);
 }
 
-/**
- * gnome_bonobo_select_goad_id:
- * @title: The title to be used for the dialog.
- * @interfaces_required: A list of required interfaces.  See
- * gnome_bonobo_selector_new().
- *
- * Calls gnome_bonobo_selector_new() to create a new
- * GnomeBonoboSelector widget with the specified paramters, @title and
- * @interfaces_required.  Then runs the dialog modally and allows
- * the user to make a selection.
- *
- * Returns: The GOAD ID of the selected server, or NULL if no server
- * is selected.  The GOAD ID string has been allocated with g_strdup
- */
-gchar *
-gnome_bonobo_select_goad_id (const gchar *title,
-			     const gchar **interfaces_required)
+static gchar *
+gnome_bonobo_select_id (const gchar *title,
+			const gchar **interfaces_required)
 {
-	GtkWidget *sel = gnome_bonobo_selector_new (title, interfaces_required);
+	GtkWidget *sel = bonobo_selector_new (title, interfaces_required);
 	gchar *name = NULL;
 	int n;
 
@@ -224,6 +204,82 @@
 	return name;
 }
 
+/**
+ * bonobo_selector_get_selected_goad_id:
+ * @sel: A BonoboSelector widget.
+ *
+ * Returns: A newly-allocated string containing the GOAD ID of the
+ * currently-selected CORBA server (i.e., the corba server whose
+ * name is highlighted in the list).  The user of this function is
+ * responsible for freeing this.
+ */
+gchar *
+bonobo_selector_get_selected_goad_id (BonoboSelector *sel)
+{
+	od_assert_using_goad();
+	return bonobo_selector_get_selected_id(sel);
+}
+
+/**
+ * gnome_bonobo_select_goad_id:
+ * @title: The title to be used for the dialog.
+ * @interfaces_required: A list of required interfaces.  See
+ * bonobo_selector_new().
+ *
+ * Calls bonobo_selector_new() to create a new
+ * BonoboSelector widget with the specified paramters, @title and
+ * @interfaces_required.  Then runs the dialog modally and allows
+ * the user to make a selection.
+ *
+ * Returns: The GOAD ID of the selected server, or NULL if no server
+ * is selected.  The GOAD ID string has been allocated with g_strdup
+ */
+gchar *
+gnome_bonobo_select_goad_id (const gchar *title,
+			     const gchar **interfaces_required)
+{
+	od_assert_using_goad();
+	return gnome_bonobo_select_id(title, interfaces_required);
+}
+
+/**
+ * bonobo_selector_get_selected_oaf_id:
+ * @sel: A BonoboSelector widget.
+ *
+ * Returns: A newly-allocated string containing the OAF ID of the
+ * currently-selected CORBA server (i.e., the corba server whose
+ * name is highlighted in the list).  The user of this function is
+ * responsible for freeing this.
+ */
+gchar *
+bonobo_selector_get_selected_oaf_id (BonoboSelector *sel)
+{
+	od_assert_using_oaf();
+	return bonobo_selector_get_selected_id(sel);
+}
+
+/**
+ * gnome_bonobo_select_oaf_id:
+ * @title: The title to be used for the dialog.
+ * @interfaces_required: A list of required interfaces.  See
+ * bonobo_selector_new().
+ *
+ * Calls bonobo_selector_new() to create a new
+ * BonoboSelector widget with the specified paramters, @title and
+ * @interfaces_required.  Then runs the dialog modally and allows
+ * the user to make a selection.
+ *
+ * Returns: The OAF ID of the selected server, or NULL if no server
+ * is selected.  The OAF ID string has been allocated with g_strdup
+ */
+gchar *
+gnome_bonobo_select_oaf_id (const gchar *title,
+			     const gchar **interfaces_required)
+{
+	od_assert_using_oaf();
+	return gnome_bonobo_select_id(title, interfaces_required);
+}
+
 static void
 button_callback (GtkWidget *widget, gint button_number,
 		 gpointer data) 
@@ -245,8 +301,8 @@
 static void
 ok_callback (GtkWidget *widget, gpointer data)
 {
-	char *text = gnome_bonobo_selector_get_selected_goad_id (
-		GNOME_BONOBO_SELECTOR (widget));
+	char *text = bonobo_selector_get_selected_id (
+		BONOBO_SELECTOR (widget));
 	gtk_object_set_user_data (GTK_OBJECT (widget), text);
 	gtk_main_quit ();
 }
@@ -259,7 +315,7 @@
 
 static void
 select_row (GtkCList *clist, gint row, gint col, 
-	    GdkEvent *event, GnomeBonoboSelector *sel)
+	    GdkEvent *event, BonoboSelector *sel)
 {
 	if (event && event->type == GDK_2BUTTON_PRESS)
 		gnome_dialog_clicked ( GNOME_DIALOG (sel), 0);
@@ -273,16 +329,16 @@
 }
 
 static void
-gnome_bonobo_selector_init (GtkWidget *widget)
+bonobo_selector_init (GtkWidget *widget)
 {
-	GnomeBonoboSelector *sel = GNOME_BONOBO_SELECTOR (widget);
+	BonoboSelector *sel = BONOBO_SELECTOR (widget);
 	GtkWidget *scrolled;
-	GnomeBonoboSelectorPrivate *priv;
-	gchar *titles[] = { N_("Bonobo object description"), "goadid", NULL };
+	BonoboSelectorPrivate *priv;
+	gchar *titles[] = { N_("Bonobo object description"), "ID", NULL };
 	
 	g_return_if_fail (widget != NULL);
 	
-	sel->priv = g_new0 (GnomeBonoboSelectorPrivate, 1);
+	sel->priv = g_new0 (BonoboSelectorPrivate, 1);
 	priv = sel->priv;
 	
 	scrolled = gtk_scrolled_window_new (NULL, NULL);
@@ -317,11 +373,11 @@
 }
 
 static void
-add_gnorba_objects (GnomeBonoboSelector *widget) 
+add_gnorba_objects (BonoboSelector *widget) 
 {
-	gchar *text[3];
+	const gchar *text[3];
 	GList *list = NULL;
-	GnomeBonoboSelectorPrivate *priv;
+	BonoboSelectorPrivate *priv;
 	
 	text[2] = NULL;
 	
@@ -344,9 +400,9 @@
 	
 	while (list != NULL)  
 	{
-		text[0] = ( (GoadServer *)list->data)->description;
-		text[1] = ( (GoadServer *)list->data)->server_id;
-		gtk_clist_append (GTK_CLIST (priv->clist), text);
+		text[0] = od_server_info_get_description(list->data);
+		text[1] = od_server_info_get_id(list->data);
+		gtk_clist_append (GTK_CLIST (priv->clist), (gchar**)text);
 		priv->n_servers++;
 		list = list->next;  	
 	}
@@ -355,81 +411,35 @@
 }
 
 static GList *
-get_filtered_objects (GnomeBonoboSelector *widget) 
+get_filtered_objects (BonoboSelector *widget) 
 {
-	int i = 0, j = 0, num = 0;
+	int i = 0;
 	const gchar **inters;
-	GList *objects = NULL;
+	BonoboSelectorPrivate *priv;
 	int n_inters = 0;
-	int n_objects = 0;
-	GnomeBonoboSelectorPrivate *priv;
 	
 	g_return_val_if_fail (widget != NULL, NULL);
 
 	priv = widget->priv;
-	
-	priv->servers = goad_server_list_get ();
-	if (priv->servers == NULL) return NULL;
 
-	if (priv->interfaces_required == NULL) 
-	{
+	if (priv->interfaces_required == NULL) {
 		inters = g_malloc (sizeof (gpointer) * 2);
 		inters[0] = DEFAULT_INTERFACE;
 		inters[1] = NULL;
 		n_inters = 1;
-	} 
-	else 
-	{	
+	} else {	
 		inters = priv->interfaces_required;
-		while (inters[i] != NULL)
-		{
+		while (inters[i] != NULL) {
 			n_inters++;
 			i++;
 		}
-	}
-	
-	while (priv->servers->list[i].repo_id != NULL)
-	{
-		num = 0;
-		
-		for (j = 0; j < n_inters; j++) 
-		{
-			if (stringlist_contains (
-				priv->servers->list[i].repo_id, inters[j]))
-			{
-				num++;
-			}
-		}
-		if (num == n_inters) /* We have a match! */
-		{
-			objects = g_list_prepend (objects, 
-				&priv->servers->list[i]);
-			n_objects++;
-		}
-		i++;
 	}
-	objects = g_list_reverse (objects);
+
+	priv->servers = od_get_server_list(inters);
 
 	/* Free our temporary criteria */
-	if (priv->interfaces_required == NULL) g_free (inters); 
-	
-	return objects;
-}
+	if (priv->interfaces_required == NULL)
+		g_free (inters);
 
-static gboolean
-stringlist_contains (gchar **list, const gchar *word)
-{
-	int i = 0;
-	
-	if (list == NULL) return FALSE;
-	
-	while (list[i] != NULL) 
-	{
-		if (strcmp (list[i], word) == 0) 
-		{
-			return TRUE;
-		}
-		i++;
-	}
-	return FALSE;
+	return priv->servers;
 }
Index: bonobo-ui-handler.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-ui-handler.c,v
retrieving revision 1.49
diff -u -r1.49 bonobo-ui-handler.c
--- bonobo-ui-handler.c	2000/02/09 03:18:01	1.49
+++ bonobo-ui-handler.c	2000/02/10 07:23:41
@@ -6420,7 +6420,7 @@
 	switch (internal->item->type) {
 
 	case BONOBO_UI_HANDLER_TOOLBAR_CONTROL:
-		toolbar_item = bonobo_widget_new_control_from_objref (internal->item->control);
+		toolbar_item = bonobo_widget_new_control_from_objref (internal->item->control, NULL);
 
 		gtk_widget_show (toolbar_item);
 
Index: bonobo-view-frame.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-view-frame.c,v
retrieving revision 1.39
diff -u -r1.39 bonobo-view-frame.c
--- bonobo-view-frame.c	2000/01/29 11:02:32	1.39
+++ bonobo-view-frame.c	2000/02/10 07:23:46
@@ -110,6 +110,7 @@
  * @corba_view_frame: A CORBA object for the Bonobo_ViewFrame interface.
  * @wrapper: A BonoboWrapper widget which the new ViewFrame will use to cover its enclosed View.
  * @client_site: the client site to which the newly-created ViewFrame will belong.
+ * @uih: 
  *
  * Initializes @view_frame with the parameters.
  *
@@ -117,9 +118,10 @@
  * Bonobo::ViewFrame CORBA service.
  */
 BonoboViewFrame *
-bonobo_view_frame_construct (BonoboViewFrame *view_frame,
-			    Bonobo_ViewFrame corba_view_frame,
-			    BonoboClientSite *client_site)
+bonobo_view_frame_construct (BonoboViewFrame  *view_frame,
+			     Bonobo_ViewFrame  corba_view_frame,
+			     BonoboClientSite *client_site,
+			     Bonobo_UIHandler  uih)
 {
 	GtkWidget *wrapper;
 
@@ -128,7 +130,7 @@
 	g_return_val_if_fail (client_site != NULL, NULL);
 	g_return_val_if_fail (BONOBO_IS_CLIENT_SITE (client_site), NULL);
 
-	bonobo_control_frame_construct (BONOBO_CONTROL_FRAME (view_frame), corba_view_frame);
+	bonobo_control_frame_construct (BONOBO_CONTROL_FRAME (view_frame), corba_view_frame, uih);
 
 	view_frame->priv->client_site = client_site;
 	
@@ -163,12 +165,14 @@
 /**
  * bonobo_view_frame_new:
  * @client_site: the client site to which the newly-created ViewFrame will belong.
+ * @uih: A CORBA object for the container's UIHandler server. 
  *
  * Returns: BonoboViewFrame object that implements the
  * Bonobo::ViewFrame CORBA service.
  */
 BonoboViewFrame *
-bonobo_view_frame_new (BonoboClientSite *client_site)
+bonobo_view_frame_new (BonoboClientSite *client_site,
+		       Bonobo_UIHandler  uih)
 {
 	Bonobo_ViewFrame corba_view_frame;
 	BonoboViewFrame *view_frame;
@@ -184,7 +188,7 @@
 		return NULL;
 	}
 
-	return bonobo_view_frame_construct (view_frame, corba_view_frame, client_site);
+	return bonobo_view_frame_construct (view_frame, corba_view_frame, client_site, uih);
 }
 
 static void
@@ -448,43 +452,6 @@
 	g_return_val_if_fail (BONOBO_IS_VIEW_FRAME (view_frame), NULL);
 
 	return GTK_WIDGET (view_frame->priv->wrapper);
-}
-
-/**
- * bonobo_view_frame_set_ui_handler:
- * @view_frame: A BonoboViewFrame object.
- * @uih: A BonoboUIHandler object to be associated with this ViewFrame.
- *
- * Sets the BonoboUIHandler object for this ViewFrame.  When the
- * ViewFrame's View requests its container's UIHandler interface, the
- * ViewFrame will pass it the UIHandler specified here.  See also
- * bonobo_view_frame_get_ui_handler().
- */
-void
-bonobo_view_frame_set_ui_handler (BonoboViewFrame *view_frame, BonoboUIHandler *uih)
-{
-	g_return_if_fail (view_frame != NULL);
-	g_return_if_fail (BONOBO_IS_VIEW_FRAME (view_frame));
-	g_return_if_fail (uih != NULL);
-	g_return_if_fail (BONOBO_IS_UI_HANDLER (uih));
-
-	bonobo_control_frame_set_ui_handler (BONOBO_CONTROL_FRAME (view_frame), uih);
-}
-
-/**
- * bonobo_view_frame_get_ui_handler:
- * @view_frame: A BonoboViewFrame object.
- *
- * Returns: The BonoboUIHandler associated with this ViewFrame.  See
- * also bonobo_view_frame_set_ui_handler().
- */
-BonoboUIHandler *
-bonobo_view_frame_get_ui_handler (BonoboViewFrame *view_frame)
-{
-	g_return_val_if_fail (view_frame != NULL, NULL);
-	g_return_val_if_fail (BONOBO_IS_VIEW_FRAME (view_frame), NULL);
-
-	return bonobo_control_frame_get_ui_handler (BONOBO_CONTROL_FRAME (view_frame));
 }
 
 /**
Index: bonobo-view-frame.h
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-view-frame.h,v
retrieving revision 1.26
diff -u -r1.26 bonobo-view-frame.h
--- bonobo-view-frame.h	2000/01/25 11:35:46	1.26
+++ bonobo-view-frame.h	2000/02/10 07:23:46
@@ -34,40 +34,35 @@
 	void (*user_context)        (BonoboViewFrame *view_frame);
 } BonoboViewFrameClass;
 
-GtkType           bonobo_view_frame_get_type        (void);
-BonoboViewFrame   *bonobo_view_frame_construct       (BonoboViewFrame *view_frame,
-						    Bonobo_ViewFrame corba_view_frame,
-						    BonoboClientSite *client_site);
-BonoboViewFrame   *bonobo_view_frame_new             (BonoboClientSite *client_site);
-void		  bonobo_view_frame_bind_to_view	   (BonoboViewFrame *view_frame,
-						    Bonobo_View view);
-Bonobo_View	  bonobo_view_frame_get_view	   (BonoboViewFrame *view_frame);
+GtkType                    bonobo_view_frame_get_type         (void);
+BonoboViewFrame           *bonobo_view_frame_construct        (BonoboViewFrame  *view_frame,
+							       Bonobo_ViewFrame  corba_view_frame,
+							       BonoboClientSite *client_site,
+							       Bonobo_UIHandler  uih);
+BonoboViewFrame           *bonobo_view_frame_new              (BonoboClientSite *client_site,
+							       Bonobo_UIHandler  uih);
+void                       bonobo_view_frame_bind_to_view     (BonoboViewFrame  *view_frame,
+							       Bonobo_View       view);
+Bonobo_View                bonobo_view_frame_get_view         (BonoboViewFrame  *view_frame);
+BonoboClientSite          *bonobo_view_frame_get_client_site  (BonoboViewFrame  *view_frame);
+GtkWidget                 *bonobo_view_frame_get_wrapper      (BonoboViewFrame  *view_frame);
+char                      *bonobo_view_frame_popup_verbs      (BonoboViewFrame  *view_frame);
+void                       bonobo_view_frame_set_covered      (BonoboViewFrame  *view_frame,
+							       gboolean          covered);
 
-BonoboClientSite  *bonobo_view_frame_get_client_site (BonoboViewFrame *view_frame);
-
-GtkWidget        *bonobo_view_frame_get_wrapper     (BonoboViewFrame *view_frame);
-
-char		 *bonobo_view_frame_popup_verbs	   (BonoboViewFrame *view_frame);
-
-void		  bonobo_view_frame_set_covered     (BonoboViewFrame *view_frame,
-						    gboolean covered);
-
-void              bonobo_view_frame_set_ui_handler  (BonoboViewFrame *view_frame, BonoboUIHandler *uih);
-BonoboUIHandler   *bonobo_view_frame_get_ui_handler  (BonoboViewFrame *view_frame);
 /*
  * A BonoboViewFrame acts as a proxy for the remote BonoboView object to
  * which it is bound.  These functions act as wrappers which a
  * container can use to communicate with the BonoboView associated with
  * a given BonoboViewFrame.
  */
-void		  bonobo_view_frame_view_activate   (BonoboViewFrame *view_frame);
-void		  bonobo_view_frame_view_deactivate (BonoboViewFrame *view_frame);
-
-void		  bonobo_view_frame_view_do_verb	   (BonoboViewFrame *view_frame,
-						    const char *verb_name);
-void              bonobo_view_frame_set_zoom_factor (BonoboViewFrame *view_frame, double zoom);
-
-POA_Bonobo_ViewFrame__epv *bonobo_view_frame_get_epv (void);
+void                       bonobo_view_frame_view_activate    (BonoboViewFrame  *view_frame);
+void                       bonobo_view_frame_view_deactivate  (BonoboViewFrame  *view_frame);
+void                       bonobo_view_frame_view_do_verb     (BonoboViewFrame  *view_frame,
+							       const char       *verb_name);
+void                       bonobo_view_frame_set_zoom_factor  (BonoboViewFrame  *view_frame,
+							       double            zoom);
+POA_Bonobo_ViewFrame__epv *bonobo_view_frame_get_epv          (void);
 
 /* The entry point vectors for the server we provide */
 extern POA_Bonobo_ViewFrame__vepv bonobo_view_frame_vepv;
Index: bonobo-widget.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-widget.c,v
retrieving revision 1.14
diff -u -r1.14 bonobo-widget.c
--- bonobo-widget.c	2000/01/25 22:04:41	1.14
+++ bonobo-widget.c	2000/02/10 07:23:48
@@ -77,7 +77,7 @@
 static BonoboWrapperClass *bonobo_widget_parent_class;
 
 static BonoboObjectClient *
-bonobo_widget_launch_component (char *object_desc)
+bonobo_widget_launch_component (const char *object_desc)
 {
 	BonoboObjectClient *server;
 
@@ -93,18 +93,21 @@
  *
  */
 static BonoboWidget *
-bonobo_widget_construct_control_from_objref (BonoboWidget *bw,
-						   Bonobo_Control control)
+bonobo_widget_construct_control_from_objref (BonoboWidget     *bw,
+					     Bonobo_Control    control,
+					     Bonobo_UIHandler  uih)
 {
 	GtkWidget    *control_frame_widget;
 
 	/*
 	 * Create a local ControlFrame for it.
 	 */
-	bw->priv->control_frame = bonobo_control_frame_new ();
-	bonobo_control_frame_bind_to_control (bw->priv->control_frame,
-					     control);
+	bw->priv->control_frame = bonobo_control_frame_new (uih);
 
+	bonobo_control_frame_bind_to_control (bw->priv->control_frame, control);
+
+	bonobo_control_frame_set_autoactivate (bw->priv->control_frame, TRUE);
+
 	/*
 	 * Grab the actual widget which visually contains the remote
 	 * Control.  This is a GtkSocket, in reality.
@@ -122,8 +125,9 @@
 }
 
 static BonoboWidget *
-bonobo_widget_construct_control (BonoboWidget *bw,
-				       char *goad_id)
+bonobo_widget_construct_control (BonoboWidget     *bw,
+				 const char       *goad_id,
+				 Bonobo_UIHandler  uih)
 {
 	Bonobo_Control control;
 
@@ -138,11 +142,12 @@
 
 	control = bonobo_object_corba_objref (BONOBO_OBJECT (bw->priv->server));
 
-	return bonobo_widget_construct_control_from_objref (bw, control);
+	return bonobo_widget_construct_control_from_objref (bw, control, uih);
 }
 
 GtkWidget *
-bonobo_widget_new_control_from_objref (Bonobo_Control control)
+bonobo_widget_new_control_from_objref (Bonobo_Control   control,
+				       Bonobo_UIHandler uih)
 {
 	BonoboWidget *bw;
 
@@ -150,7 +155,7 @@
 
 	bw = gtk_type_new (BONOBO_WIDGET_TYPE);
 
-	bw = bonobo_widget_construct_control_from_objref (bw, control);
+	bw = bonobo_widget_construct_control_from_objref (bw, control, uih);
 
 	if (bw == NULL)
 		return NULL;
@@ -159,7 +164,8 @@
 }
 
 GtkWidget *
-bonobo_widget_new_control (char *goad_id)
+bonobo_widget_new_control (const char       *goad_id,
+			   Bonobo_UIHandler  uih)
 {
 	BonoboWidget *bw;
 
@@ -167,7 +173,7 @@
 
 	bw = gtk_type_new (BONOBO_WIDGET_TYPE);
 
-	bw = bonobo_widget_construct_control (bw, goad_id);
+	bw = bonobo_widget_construct_control (bw, goad_id, uih);
 
 	if (bw == NULL)
 		return NULL;
@@ -193,7 +199,9 @@
  *
  */
 static void
-bonobo_widget_create_subdoc_object (BonoboWidget *bw, char *object_desc)
+bonobo_widget_create_subdoc_object (BonoboWidget     *bw,
+				    const char       *object_desc,
+				    Bonobo_UIHandler  uih)
 {
 	GtkWidget *view_widget;
 
@@ -227,7 +235,7 @@
 	/*
 	 * Now create a new view for the remote object.
 	 */
-	bw->priv->view_frame = bonobo_client_site_new_view (bw->priv->client_site);
+	bw->priv->view_frame = bonobo_client_site_new_view (bw->priv->client_site, uih);
 
 	/*
 	 * Add the view frame.
@@ -238,8 +246,8 @@
 }
 
 GtkWidget *
-bonobo_widget_new_subdoc (char *object_desc,
-				BonoboUIHandler *uih)
+bonobo_widget_new_subdoc (const char       *object_desc,
+			  Bonobo_UIHandler  uih)
 {
 	BonoboWidget *bw;
 
@@ -250,7 +258,7 @@
 	if (bw == NULL)
 		return NULL;
 
-	bonobo_widget_create_subdoc_object (bw, object_desc);
+	bonobo_widget_create_subdoc_object (bw, object_desc, uih);
 
 	if (bw == NULL)
 		return NULL;
@@ -320,7 +328,7 @@
 
 static void
 bonobo_widget_size_request (GtkWidget *widget,
-				  GtkRequisition *requisition)
+			    GtkRequisition *requisition)
 {
 	GtkBin *bin;
 
@@ -342,7 +350,7 @@
 
 static void
 bonobo_widget_size_allocate (GtkWidget *widget,
-				   GtkAllocation *allocation)
+			     GtkAllocation *allocation)
 {
 	GtkBin *bin;
 	GtkAllocation child_allocation;
Index: bonobo-widget.h
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-widget.h,v
retrieving revision 1.5
diff -u -r1.5 bonobo-widget.h
--- bonobo-widget.h	2000/01/25 11:35:46	1.5
+++ bonobo-widget.h	2000/02/10 07:23:49
@@ -42,25 +42,27 @@
 	GtkBinClass	 bin_class;
 } BonoboWidgetClass;
 
-GtkType            bonobo_widget_get_type                (void);
-BonoboObjectClient *bonobo_widget_get_server              (BonoboWidget *bw);
+GtkType             bonobo_widget_get_type                 (void);
+BonoboObjectClient *bonobo_widget_get_server               (BonoboWidget     *bw);
 
 /*
  * BonoboWidget for Controls.
  */
-GtkWidget	  *bonobo_widget_new_control	       (char *goad_id);
-GtkWidget	  *bonobo_widget_new_control_from_objref (Bonobo_Control control);
-BonoboControlFrame *bonobo_widget_get_control_frame       (BonoboWidget *bw);
+GtkWidget          *bonobo_widget_new_control              (const char       *goad_id,
+							    Bonobo_UIHandler  uih);
+GtkWidget          *bonobo_widget_new_control_from_objref  (Bonobo_Control    control,
+							    Bonobo_UIHandler  uih);
+BonoboControlFrame *bonobo_widget_get_control_frame        (BonoboWidget     *bw);
 
 /*
  * Gnome Bonobo Widget for subdocuments (Embeddables with a single View).
  */
-GtkWidget	  *bonobo_widget_new_subdoc              (char *object_desc,
-							       	BonoboUIHandler *uih);
-BonoboContainer	  *bonobo_widget_get_container           (BonoboWidget *bw);
-BonoboClientSite	  *bonobo_widget_get_client_site         (BonoboWidget *bw);
-BonoboViewFrame	  *bonobo_widget_get_view_frame          (BonoboWidget *bw);
-BonoboUIHandler	  *bonobo_widget_get_uih	               (BonoboWidget *bw);
+GtkWidget          *bonobo_widget_new_subdoc               (const char       *object_desc,
+							    Bonobo_UIHandler  uih);
+BonoboContainer    *bonobo_widget_get_container            (BonoboWidget     *bw);
+BonoboClientSite   *bonobo_widget_get_client_site          (BonoboWidget     *bw);
+BonoboViewFrame    *bonobo_widget_get_view_frame           (BonoboWidget     *bw);
+BonoboUIHandler    *bonobo_widget_get_uih                  (BonoboWidget     *bw);
 
 END_GNOME_DECLS
 
Index: test-container-autoload.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/test-container-autoload.c,v
retrieving revision 1.25
diff -u -r1.25 test-container-autoload.c
--- test-container-autoload.c	2000/01/25 11:35:52	1.25
+++ test-container-autoload.c	2000/02/10 07:23:52
@@ -202,7 +202,7 @@
 	if (server == NULL)
 		return NULL;
 
-	view_frame = bonobo_client_site_new_view (client_site);
+	view_frame = bonobo_client_site_new_view (client_site, CORBA_OBJECT_NIL);
 	view_widget = bonobo_view_frame_get_wrapper (view_frame);
 
 	frame = gtk_frame_new (server_goadid);
Index: test-container.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/test-container.c,v
retrieving revision 1.52
diff -u -r1.52 test-container.c
--- test-container.c	2000/01/25 16:34:59	1.52
+++ test-container.c	2000/02/10 07:23:56
@@ -198,14 +198,12 @@
 	GtkWidget *view_widget;
 	GtkWidget *frame;
 	
-	view_frame = bonobo_client_site_new_view (client_site);
+	view_frame = bonobo_client_site_new_view (client_site, CORBA_OBJECT_NIL);
 
 	gtk_signal_connect (GTK_OBJECT (view_frame), "user_activate",
 			    GTK_SIGNAL_FUNC (user_activation_request_cb), NULL);
 	gtk_signal_connect (GTK_OBJECT (view_frame), "view_activated",
 			    GTK_SIGNAL_FUNC (view_activated_cb), NULL);
-
-	bonobo_view_frame_set_ui_handler (view_frame, app->uih);
 
 	view_widget = bonobo_view_frame_get_wrapper (view_frame);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]