BonoboControlFrame

Name

BonoboControlFrame -- An implementation of the container's frame containing a Control

Synopsis



typedef     BonoboControlFrame;
typedef     BonoboControlFrameClass;
BonoboControlFrame* bonobo_control_frame_new
                                            (Bonobo_UIContainer ui_container);
GtkWidget*  bonobo_control_frame_get_widget (BonoboControlFrame *frame);
void        bonobo_control_frame_set_ui_container
                                            (BonoboControlFrame *control_frame,
                                             Bonobo_UIContainer uic);
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);
Bonobo_PropertyBag bonobo_control_frame_get_control_property_bag
                                            (BonoboControlFrame *control_frame,
                                             CORBA_Environment *ev);
void        bonobo_control_frame_set_propbag
                                            (BonoboControlFrame *control_frame,
                                             BonoboPropertyBag *propbag);
BonoboPropertyBag* bonobo_control_frame_get_propbag
                                            (BonoboControlFrame *control_frame);
void        bonobo_control_frame_control_set_state
                                            (BonoboControlFrame *control_frame,
                                             GtkStateType state);
void        bonobo_control_frame_set_autostate
                                            (BonoboControlFrame *control_frame,
                                             gboolean autostate);
gboolean    bonobo_control_frame_get_autostate
                                            (BonoboControlFrame *control_frame);
void        bonobo_control_frame_bind_to_control
                                            (BonoboControlFrame *control_frame,
                                             Bonobo_Control control);
Bonobo_Control bonobo_control_frame_get_control
                                            (BonoboControlFrame *control_frame);
Bonobo_UIContainer bonobo_control_frame_get_ui_container
                                            (BonoboControlFrame *control_frame);
BonoboControlFrame* bonobo_control_frame_construct
                                            (BonoboControlFrame *control_frame,
                                             Bonobo_UIContainer ui_container);
void        bonobo_control_frame_size_request
                                            (BonoboControlFrame *control_frame,
                                             int *desired_width,
                                             int *desired_height);
void        bonobo_control_frame_sync_realize
                                            (BonoboControlFrame *frame);
void        bonobo_control_frame_sync_unrealize
                                            (BonoboControlFrame *frame);

Description

The BonoboControlFrame object is used to embed a Control. Most people will want to use BonoboWidget instead of the control frame since it provides lots of nice auxiliary features to make embedding easy.

The control frame is coupled to an embedded control and is used to allow the Control to communicate with its environment, particuarly getting the BonoboUIContainer for merging its menu / toolbar UI elements.

Example 1. A nice use of a BonoboControlFrame

BonoboWidget *
bonobo_widget_construct_control_from_objref (BonoboWidget      *bw,
					     Bonobo_Control     control,
					     Bonobo_UIContainer uic)
{
	GtkWidget    *control_frame_widget;

	/*
	 * Create a local ControlFrame for it.
	 */
	bw->priv->control_frame = bonobo_control_frame_new (uic);

	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.
	 */
	control_frame_widget = bonobo_control_frame_get_widget (bw->priv->control_frame);

	/*
	 * Now stick it into this BonoboWidget.
	 */
	gtk_container_add (GTK_CONTAINER (bw),
			   control_frame_widget);

	/*
	 * Always remember to show the widget before reporting bugs.
	 */
	gtk_widget_show (control_frame_widget);

	if (uic != CORBA_OBJECT_NIL)
		bw->priv->uic = bonobo_object_dup_ref (uic, NULL);

	return bw;
}
    

Details

BonoboControlFrame

typedef struct {
	BonoboXObject base;
	BonoboControlFramePrivate *priv;
} BonoboControlFrame;


BonoboControlFrameClass

typedef struct {
	BonoboXObjectClass parent_class;

	POA_Bonobo_ControlFrame__epv epv;

	/* Signals. */
	void (*activated)           (BonoboControlFrame *control_frame, gboolean state);
	void (*activate_uri)        (BonoboControlFrame *control_frame, const char *uri, gboolean relative);

} BonoboControlFrameClass;


bonobo_control_frame_new ()

BonoboControlFrame* bonobo_control_frame_new
                                            (Bonobo_UIContainer ui_container);


bonobo_control_frame_get_widget ()

GtkWidget*  bonobo_control_frame_get_widget (BonoboControlFrame *frame);

Use this function when you want to embed a BonoboControl into your container's widget hierarchy. Once you have bound the BonoboControlFrame to a remote BonoboControl, place the widget returned by bonobo_control_frame_get_widget() into your widget hierarchy and the control will appear in your application.


bonobo_control_frame_set_ui_container ()

void        bonobo_control_frame_set_ui_container
                                            (BonoboControlFrame *control_frame,
                                             Bonobo_UIContainer uic);

Associates a new Bonobo_UIContainer object with this ControlFrame. This is only allowed while the Control is deactivated.


bonobo_control_frame_control_activate ()

void        bonobo_control_frame_control_activate
                                            (BonoboControlFrame *control_frame);

Activates the BonoboControl embedded in control_frame by calling the activate() Bonobo_Control interface method on it.


bonobo_control_frame_control_deactivate ()

void        bonobo_control_frame_control_deactivate
                                            (BonoboControlFrame *control_frame);

Deactivates the BonoboControl embedded in control_frame by calling the activate() CORBA method on it with the parameter FALSE.


bonobo_control_frame_set_autoactivate ()

void        bonobo_control_frame_set_autoactivate
                                            (BonoboControlFrame *control_frame,
                                             gboolean autoactivate);

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. Autoactivation is off by default.


bonobo_control_frame_get_autoactivate ()

gboolean    bonobo_control_frame_get_autoactivate
                                            (BonoboControlFrame *control_frame);


bonobo_control_frame_get_control_property_bag ()

Bonobo_PropertyBag bonobo_control_frame_get_control_property_bag
                                            (BonoboControlFrame *control_frame,
                                             CORBA_Environment *ev);

This retrives a Bonobo_PropertyBag reference from its associated Bonobo Control


bonobo_control_frame_set_propbag ()

void        bonobo_control_frame_set_propbag
                                            (BonoboControlFrame *control_frame,
                                             BonoboPropertyBag *propbag);

Makes control_frame use propbag for its ambient properties. When control_frame's Control requests the ambient properties, it will get them from propbag.


bonobo_control_frame_get_propbag ()

BonoboPropertyBag* bonobo_control_frame_get_propbag
                                            (BonoboControlFrame *control_frame);


bonobo_control_frame_control_set_state ()

void        bonobo_control_frame_control_set_state
                                            (BonoboControlFrame *control_frame,
                                             GtkStateType state);

Proxies state to the control bound to control_frame.


bonobo_control_frame_set_autostate ()

void        bonobo_control_frame_set_autostate
                                            (BonoboControlFrame *control_frame,
                                             gboolean autostate);

Changes whether or not control_frame automatically proxies state changes to its associated control. The default mode is for the control frame to autopropagate.


bonobo_control_frame_get_autostate ()

gboolean    bonobo_control_frame_get_autostate
                                            (BonoboControlFrame *control_frame);


bonobo_control_frame_bind_to_control ()

void        bonobo_control_frame_bind_to_control
                                            (BonoboControlFrame *control_frame,
                                             Bonobo_Control control);

Associates control with this control_frame.


bonobo_control_frame_get_control ()

Bonobo_Control bonobo_control_frame_get_control
                                            (BonoboControlFrame *control_frame);


bonobo_control_frame_get_ui_container ()

Bonobo_UIContainer bonobo_control_frame_get_ui_container
                                            (BonoboControlFrame *control_frame);


bonobo_control_frame_construct ()

BonoboControlFrame* bonobo_control_frame_construct
                                            (BonoboControlFrame *control_frame,
                                             Bonobo_UIContainer ui_container);

Initializes control_frame with the parameters.


bonobo_control_frame_size_request ()

void        bonobo_control_frame_size_request
                                            (BonoboControlFrame *control_frame,
                                             int *desired_width,
                                             int *desired_height);


bonobo_control_frame_sync_realize ()

void        bonobo_control_frame_sync_realize
                                            (BonoboControlFrame *frame);


bonobo_control_frame_sync_unrealize ()

void        bonobo_control_frame_sync_unrealize
                                            (BonoboControlFrame *frame);

See Also

BonoboWidget, bonobo_widget_new()