Whole document tree
BonoboUISync
Name BonoboUISync -- A Synchronizer object to keep a widget tree in sync with an XML tree.
Synopsis
void (*BonoboUISyncStateFn ) (BonoboUISync *sync,
BonoboUINode *node,
BonoboUINode *cmd_node,
GtkWidget *widget,
GtkWidget *parent);
GtkWidget* (*BonoboUISyncBuildFn ) (BonoboUISync *sync,
BonoboUINode *node,
BonoboUINode *cmd_node,
int *pos,
GtkWidget *parent);
BonoboUISync* bonobo_ui_sync_construct (BonoboUISync *sync,
BonoboUIEngine *engine,
gboolean is_recursive,
gboolean has_widgets);
gboolean bonobo_ui_sync_is_recursive (BonoboUISync *sync);
gboolean bonobo_ui_sync_has_widgets (BonoboUISync *sync);
void bonobo_ui_sync_remove_root (BonoboUISync *sync,
BonoboUINode *root);
void bonobo_ui_sync_update_root (BonoboUISync *sync,
BonoboUINode *root);
void bonobo_ui_sync_state (BonoboUISync *sync,
BonoboUINode *node,
BonoboUINode *cmd_node,
GtkWidget *widget,
GtkWidget *parent);
void bonobo_ui_sync_state_placeholder
(BonoboUISync *sync,
BonoboUINode *node,
BonoboUINode *cmd_node,
GtkWidget *widget,
GtkWidget *parent);
GtkWidget* bonobo_ui_sync_build (BonoboUISync *sync,
BonoboUINode *node,
BonoboUINode *cmd_node,
int *pos,
GtkWidget *parent);
GtkWidget* bonobo_ui_sync_build_placeholder
(BonoboUISync *sync,
BonoboUINode *node,
BonoboUINode *cmd_node,
int *pos,
GtkWidget *parent);
gboolean bonobo_ui_sync_ignore_widget (BonoboUISync *sync,
GtkWidget *widget);
GList* bonobo_ui_sync_get_widgets (BonoboUISync *sync,
BonoboUINode *node);
void bonobo_ui_sync_stamp_root (BonoboUISync *sync);
gboolean bonobo_ui_sync_can_handle (BonoboUISync *sync,
BonoboUINode *node);
GtkWidget* bonobo_ui_sync_get_attached (BonoboUISync *sync,
GtkWidget *widget,
BonoboUINode *node);
void bonobo_ui_sync_state_update (BonoboUISync *sync,
GtkWidget *widget,
const char *new_state);
gboolean bonobo_ui_sync_do_show_hide (BonoboUISync *sync,
BonoboUINode *node,
BonoboUINode *cmd_node,
GtkWidget *widget);
Description The BonoboUISynchronizer is used internaly by the BonoboUIEngine. Writing
one is a very advanced topic, and should only be attempted by carefuly study
of the code. No normal user should need to write his own synchronizer.
Details BonoboUISyncStateFn ()void (*BonoboUISyncStateFn) (BonoboUISync *sync,
BonoboUINode *node,
BonoboUINode *cmd_node,
GtkWidget *widget,
GtkWidget *parent);
BonoboUISyncBuildFn ()GtkWidget* (*BonoboUISyncBuildFn) (BonoboUISync *sync,
BonoboUINode *node,
BonoboUINode *cmd_node,
int *pos,
GtkWidget *parent);
bonobo_ui_sync_construct ()BonoboUISync* bonobo_ui_sync_construct (BonoboUISync *sync,
BonoboUIEngine *engine,
gboolean is_recursive,
gboolean has_widgets);
Used to construct a new synchronizer object
bonobo_ui_sync_is_recursive ()gboolean bonobo_ui_sync_is_recursive (BonoboUISync *sync);
bonobo_ui_sync_has_widgets ()gboolean bonobo_ui_sync_has_widgets (BonoboUISync *sync);
bonobo_ui_sync_remove_root ()void bonobo_ui_sync_remove_root (BonoboUISync *sync,
BonoboUINode *root);
This is called when a 'root' or toplevel node is
removed that this synchronizer deals with. eg. in
the toolbar case, this might trigger hiding an
associated dock item.
bonobo_ui_sync_update_root ()void bonobo_ui_sync_update_root (BonoboUISync *sync,
BonoboUINode *root);
This flags the fact that a toplevel node has changed
and is used primarily by non-recursive handlers, such
as the keybinding sync method.
bonobo_ui_sync_state ()void bonobo_ui_sync_state (BonoboUISync *sync,
BonoboUINode *node,
BonoboUINode *cmd_node,
GtkWidget *widget,
GtkWidget *parent);
This method is used to synchronize the state of a node
with that of a widget , by ensuring the pertainant
attributes are reflected in the widget view.
bonobo_ui_sync_state_placeholder ()void bonobo_ui_sync_state_placeholder
(BonoboUISync *sync,
BonoboUINode *node,
BonoboUINode *cmd_node,
GtkWidget *widget,
GtkWidget *parent);
This synchronizes the state of a placeholder, there is
a default implementation for this method.
bonobo_ui_sync_build ()GtkWidget* bonobo_ui_sync_build (BonoboUISync *sync,
BonoboUINode *node,
BonoboUINode *cmd_node,
int *pos,
GtkWidget *parent);
This function causes a child widget to be build that matches
node 's attributes. This should then be inserted by into
parent 's associated widget at position pos in the container.
bonobo_ui_sync_build_placeholder ()GtkWidget* bonobo_ui_sync_build_placeholder
(BonoboUISync *sync,
BonoboUINode *node,
BonoboUINode *cmd_node,
int *pos,
GtkWidget *parent);
As for bonobo_ui_sync_build but for placeholders
bonobo_ui_sync_ignore_widget ()gboolean bonobo_ui_sync_ignore_widget (BonoboUISync *sync,
GtkWidget *widget);
bonobo_ui_sync_get_widgets ()GList* bonobo_ui_sync_get_widgets (BonoboUISync *sync,
BonoboUINode *node);
This method is used to obtain a sensibly ordered list
of child widgets of the container associated with node .
Essentialy this does something like gtk_container_children
but preserving the visible order of the widgets in the list.
bonobo_ui_sync_stamp_root ()void bonobo_ui_sync_stamp_root (BonoboUISync *sync);
This asks the synchronizer to stamp all its associated
root widget containers into the XML tree.
bonobo_ui_sync_can_handle ()gboolean bonobo_ui_sync_can_handle (BonoboUISync *sync,
BonoboUINode *node);
This is used to determine which, of multiple synchronizers
can be used to deal with a specific node type. Each synchronizer
deals with different types of node.
bonobo_ui_sync_get_attached ()GtkWidget* bonobo_ui_sync_get_attached (BonoboUISync *sync,
GtkWidget *widget,
BonoboUINode *node);
This is used to get an 'attached' widget - some
widgets have associated widgets that are coupled
in strange ways - eg. GtkMenuItem <-> GtkMenuShell
It is neccessary to store the GtkContainer item of
these couples in the XML tree, since then we can
do things more genericaly and cleanly.
bonobo_ui_sync_state_update ()void bonobo_ui_sync_state_update (BonoboUISync *sync,
GtkWidget *widget,
const char *new_state);
This is used to synchronize state with a stateful widget,
eg. when a "state" attribute is set, this is not reflected
in the normal 'state-sync' process, but occurs later with
a set of state_updates to avoid re-enterancy problems.
bonobo_ui_sync_do_show_hide ()gboolean bonobo_ui_sync_do_show_hide (BonoboUISync *sync,
BonoboUINode *node,
BonoboUINode *cmd_node,
GtkWidget *widget);
This is a helper function that applies the hidden attribute
from either the node or fallback to the cmd_node to the
widget .