![]() |
![]() |
![]() |
LibMateComponentUI API Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Signals |
MateComponentControlMateComponentControl — An implementation of the control interface for GtkWidgets |
struct MateComponentControl; MateComponentControlPrivate; MateComponentControlClass; MateComponentControl * matecomponent_control_new (GtkWidget *widget
); GtkWidget * matecomponent_control_get_widget (MateComponentControl *control
); void matecomponent_control_set_automerge (MateComponentControl *control
,gboolean automerge
); gboolean matecomponent_control_get_automerge (MateComponentControl *control
); void matecomponent_control_set_property (MateComponentControl *control
,CORBA_Environment *opt_ev
,const char *first_prop
,...
); void matecomponent_control_get_property (MateComponentControl *control
,CORBA_Environment *opt_ev
,const char *first_prop
,...
); void matecomponent_control_set_transient_for (MateComponentControl *control
,GtkWindow *window
,CORBA_Environment *opt_ev
); void matecomponent_control_unset_transient_for (MateComponentControl *control
,GtkWindow *window
,CORBA_Environment *opt_ev
); MateComponentControl * matecomponent_control_construct (MateComponentControl *control
,GtkWidget *widget
); MateComponentUIComponent * matecomponent_control_get_ui_component (MateComponentControl *control
); void matecomponent_control_set_ui_component (MateComponentControl *control
,MateComponentUIComponent *component
); MateComponent_UIContainer matecomponent_control_get_remote_ui_container (MateComponentControl *control
,CORBA_Environment *opt_ev
); void matecomponent_control_set_control_frame (MateComponentControl *control
,MateComponent_ControlFrame control_frame
,CORBA_Environment *opt_ev
); MateComponent_ControlFrame matecomponent_control_get_control_frame (MateComponentControl *control
,CORBA_Environment *opt_ev
); void matecomponent_control_set_properties (MateComponentControl *control
,MateComponent_PropertyBag pb
,CORBA_Environment *opt_ev
); MateComponent_PropertyBag matecomponent_control_get_properties (MateComponentControl *control
); MateComponent_PropertyBag matecomponent_control_get_ambient_properties (MateComponentControl *control
,CORBA_Environment *opt_ev
); void matecomponent_control_activate_notify (MateComponentControl *control
,gboolean activated
,CORBA_Environment *opt_ev
); MateComponent_Gdk_WindowId matecomponent_control_window_id_from_x11 (guint32 x11_id
); guint32 matecomponent_control_x11_from_window_id (const CORBA_char *id
); #define matecomponent_control_windowid_from_x11 (a) #define MATECOMPONENT_CONTROL_POPUP_BUTTON1 #define MATECOMPONENT_CONTROL_POPUP_BUTTON2 #define MATECOMPONENT_CONTROL_POPUP_BUTTON3 MateComponentUIContainer * matecomponent_control_get_popup_ui_container (MateComponentControl *control
); MateComponentUIComponent * matecomponent_control_get_popup_ui_component (MateComponentControl *control
); void matecomponent_control_set_popup_ui_container (MateComponentControl *control
,MateComponentUIContainer *ui_container
); gboolean matecomponent_control_do_popup (MateComponentControl *control
,guint button
,guint32 activate_time
); gboolean matecomponent_control_do_popup_full (MateComponentControl *control
,GtkWidget *parent_menu_shell
,GtkWidget *parent_menu_item
,GtkMenuPositionFunc func
,gpointer data
,guint button
,guint32 activate_time
); void (*MateComponentControlLifeCallback) (void
); void matecomponent_control_life_set_purge (long ms Param1
); void matecomponent_control_life_set_callback (MateComponentControlLifeCallback all_dead_callback
); void matecomponent_control_life_instrument (MateComponentControl *control
); int matecomponent_control_life_get_count (void
);
"activate" :Run Last
"disconnected" :Run Last
"plug-created" :Run Last
"set-frame" :Run Last
The MateComponentControl object implements the CORBA interface for handling remote embeddable components. A Control is a light weight, single view, arbitrarily complex 'widget'. Controls typicaly expose much of their functionality through a property bag.
A MateComponentControl provides the server ( or component ) side implementation of a Control. The client that uses this control will probably use a MateComponentWidget to use the control in their program.
If you want to expose your widget as a control it is very simple
Example 1. CORBA-ifying your GtkWidget
1 2 3 4 5 6 7 |
MateComponentControl *control; GtkWidget *widget; MateComponent_Unknown corba_object; widget = make_my_widget (); gtk_widget_show (widget); control = matecomponent_control_new (widget); corba_object = MATECOMPONENT_OBJREF (control); |
The corba_object can then be passed off down the wire to anyone
and the control popped into a MateComponentWidget or MateComponentControlFrame
at the other end. Here is an even less useful example
Example 2. A pretty useless Control
1 2 3 4 |
GtkWidget *widget; widget = gtk_button_new_with_label ("My Control"); gtk_widget_show (widget); return matecomponent_control_new (widget); |
If you learn only one thing from this example, it should be that
you need to do a gtk_widget_show on your control. It is not
sufficient to do a gtk_widget_show_all on the top level of the
client side, since this will not ( and should not ) propagate
over to the Control.
One final thing worth thinking about is activation. When a control is embedded inside a MateComponentControlFrame, it is initialy inactive. In order for the control to recieve interactive input it is neccessary to use matecomponent_control_frame_activate. This signals to the control that it is activated, at which point the Control should merge any UI elements it has with the associated MateComponentUIComponent. This needs to be done every time the control is activated.
typedef struct _MateComponentControlPrivate MateComponentControlPrivate;
typedef struct { MateComponentObjectClass parent_class; POA_MateComponent_Control__epv epv; gpointer dummy[2]; /* Signals. */ void (*plug_created) (MateComponentControl *control); void (*disconnected) (MateComponentControl *control); void (*set_frame) (MateComponentControl *control); void (*activate) (MateComponentControl *control, gboolean state); } MateComponentControlClass;
MateComponentControl * matecomponent_control_new (GtkWidget *widget
);
This function creates a new MateComponentControl object for widget
.
|
a GTK widget that contains the control and will be passed to the container process. |
Returns : |
a MateComponentControl object that implements the MateComponent::Control CORBA
service that will transfer the widget to the container process.
|
GtkWidget * matecomponent_control_get_widget (MateComponentControl *control
);
Returns the GtkWidget associated with a MateComponentControl.
|
a MateComponentControl |
Returns : |
the MateComponentControl's widget |
void matecomponent_control_set_automerge (MateComponentControl *control
,gboolean automerge
);
Sets whether or not the control handles menu/toolbar merging automatically. If automerge is on, the control will automatically register its MateComponentUIComponent with the remote MateComponentUIContainer when it is activated.
|
A MateComponentControl. |
|
Whether or not menus and toolbars should be automatically merged when the control is activated. |
gboolean matecomponent_control_get_automerge (MateComponentControl *control
);
|
A MateComponentControl. |
Returns : |
Whether or not the control is set to automerge its
menus/toolbars. See matecomponent_control_set_automerge() .
|
void matecomponent_control_set_property (MateComponentControl *control
,CORBA_Environment *opt_ev
,const char *first_prop
,...
);
This method takes a NULL terminated list of name, type, value triplicates, and sets the corresponding values on the control's associated property bag.
|
the control with associated property bag |
|
optional corba exception environment |
|
the first property's name |
|
void matecomponent_control_get_property (MateComponentControl *control
,CORBA_Environment *opt_ev
,const char *first_prop
,...
);
This method takes a NULL terminated list of name, type, value triplicates, and fetches the corresponding values on the control's associated property bag.
|
the control with associated property bag |
|
optional corba exception environment |
|
the first property's name |
|
void matecomponent_control_set_transient_for (MateComponentControl *control
,GtkWindow *window
,CORBA_Environment *opt_ev
);
Attempts to make the window
transient for the toplevel
of any associated controlframe the MateComponentControl may have.
|
a control with associated control frame |
|
a window upon which to set the transient window. |
|
void matecomponent_control_unset_transient_for (MateComponentControl *control
,GtkWindow *window
,CORBA_Environment *opt_ev
);
|
a control with associated control frame |
|
a window upon which to unset the transient window. |
|
MateComponentControl * matecomponent_control_construct (MateComponentControl *control
,GtkWidget *widget
);
|
|
|
|
Returns : |
MateComponentUIComponent * matecomponent_control_get_ui_component (MateComponentControl *control
);
|
The control |
Returns : |
the associated UI component |
void matecomponent_control_set_ui_component (MateComponentControl *control
,MateComponentUIComponent *component
);
|
|
|
MateComponent_UIContainer matecomponent_control_get_remote_ui_container (MateComponentControl *control
,CORBA_Environment *opt_ev
);
|
A MateComponentControl object which is associated with a remote ControlFrame. |
|
an optional exception environment |
Returns : |
The MateComponent_UIContainer CORBA server for the remote MateComponentControlFrame. |
void matecomponent_control_set_control_frame (MateComponentControl *control
,MateComponent_ControlFrame control_frame
,CORBA_Environment *opt_ev
);
|
|
|
|
|
MateComponent_ControlFrame matecomponent_control_get_control_frame (MateComponentControl *control
,CORBA_Environment *opt_ev
);
|
A MateComponentControl object whose MateComponent_ControlFrame CORBA interface is being retrieved. |
|
an optional exception environment |
Returns : |
The MateComponent_ControlFrame CORBA object associated with control , this is
a CORBA_Object_duplicated object. You need to CORBA_Object_release it when you are
done with it.
|
void matecomponent_control_set_properties (MateComponentControl *control
,MateComponent_PropertyBag pb
,CORBA_Environment *opt_ev
);
Binds pb
to control
. When a remote object queries control
for its property bag, pb
will be used in the responses.
|
A MateComponentControl object. |
|
A MateComponent_PropertyBag. |
|
An optional exception environment |
MateComponent_PropertyBag matecomponent_control_get_properties (MateComponentControl *control
);
|
A MateComponentControl whose PropertyBag has already been set. |
Returns : |
The MateComponent_PropertyBag bound to control .
|
MateComponent_PropertyBag matecomponent_control_get_ambient_properties (MateComponentControl *control
,CORBA_Environment *opt_ev
);
|
A MateComponentControl which is bound to a remote MateComponentControlFrame. |
|
an optional exception environment |
Returns : |
A MateComponent_PropertyBag bound to the bag of ambient properties associated with this Control's ControlFrame. |
void matecomponent_control_activate_notify (MateComponentControl *control
,gboolean activated
,CORBA_Environment *opt_ev
);
Notifies the remote ControlFrame which is associated with
control
that control
has been activated/deactivated.
|
A MateComponentControl object which is bound to a remote ControlFrame. |
|
Whether or not control has been activated.
|
|
An optional exception environment |
MateComponent_Gdk_WindowId matecomponent_control_window_id_from_x11 (guint32 x11_id
);
|
the x11 window id or Windows HWND. |
Returns : |
the window id or handle as a string; free after use. |
guint32 matecomponent_control_x11_from_window_id (const CORBA_char *id
);
De-mangle a window id string, fields are separated by ':' character, currently only the first field is used.
|
CORBA_char * |
Returns : |
the native window id. |
#define matecomponent_control_windowid_from_x11(a)
|
|
Returns : |
MateComponentUIContainer * matecomponent_control_get_popup_ui_container
(MateComponentControl *control
);
|
|
Returns : |
MateComponentUIComponent * matecomponent_control_get_popup_ui_component
(MateComponentControl *control
);
|
|
Returns : |
void matecomponent_control_set_popup_ui_container (MateComponentControl *control
,MateComponentUIContainer *ui_container
);
|
|
|
gboolean matecomponent_control_do_popup (MateComponentControl *control
,guint button
,guint32 activate_time
);
|
|
|
|
|
|
Returns : |
gboolean matecomponent_control_do_popup_full (MateComponentControl *control
,GtkWidget *parent_menu_shell
,GtkWidget *parent_menu_item
,GtkMenuPositionFunc func
,gpointer data
,guint button
,guint32 activate_time
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
void matecomponent_control_life_set_purge (long ms Param1
);
Set time we're prepared to wait without a ControlFrame before terminating the Control. This can happen if the panel activates us but crashes before the set_frame.
|
void matecomponent_control_life_set_callback (MateComponentControlLifeCallback all_dead_callback
);
See matecomponent_control_life_instrument
|
method to call at idle when no controls remain |
void matecomponent_control_life_instrument (MateComponentControl *control
);
Request that control
is lifecycle managed by this code;
when it (and all other registerees are dead, the
all_dead_callback set by matecomponent_control_life_set_callback
will be called at idle.
|
control to manage. |
"activate"
signalvoid user_function (MateComponentControl *matecomponentcontrol,
gboolean arg1,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
user data set when the signal handler was connected. |
"disconnected"
signalvoid user_function (MateComponentControl *matecomponentcontrol,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"plug-created"
signalvoid user_function (MateComponentControl *matecomponentcontrol,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"set-frame"
signalvoid user_function (MateComponentControl *matecomponentcontrol,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |