## MateComponentUIEngine MateComponentUIEngine — The guts of the UI handler |

## Synopsis

    struct              MateComponentUIEngine;
    void                matecomponent_ui_engine_deregister_dead_components
                                                            (MateComponentUIEngine *engine);
    void                matecomponent_ui_engine_deregister_component_by_ref
                                                            (MateComponentUIEngine *engine,
                                                             MateComponent_Unknown ref);
    void                matecomponent_ui_engine_deregister_component
                                                            (MateComponentUIEngine *engine,
                                                             const char *name);
    void                matecomponent_ui_engine_register_component (MateComponentUIEngine *engine,
                                                             const char *name,
                                                             MateComponent_Unknown component);
    GList *             matecomponent_ui_engine_get_component_names
                                                            (MateComponentUIEngine *engine);
    MateComponent_Unknown      matecomponent_ui_engine_get_component      (MateComponentUIEngine *engine,
                                                             const char *name);
    void                matecomponent_ui_engine_config_set_path    (MateComponentUIEngine *engine,
                                                             const char *path);
    const char *        matecomponent_ui_engine_config_get_path    (MateComponentUIEngine *engine);
    void                matecomponent_ui_engine_set_ui_container   (MateComponentUIEngine *engine,
                                                             MateComponentUIContainer *ui_container);
    MateComponentUIContainer * matecomponent_ui_engine_get_ui_container   (MateComponentUIEngine *engine);
    void                matecomponent_ui_engine_freeze             (MateComponentUIEngine *engine);
    void                matecomponent_ui_engine_thaw               (MateComponentUIEngine *engine);
    void                matecomponent_ui_engine_update             (MateComponentUIEngine *engine);
    enum                MateComponentUIError;
                        MateComponentUIEnginePrivate;
                        MateComponentUIEngineClass;
    MateComponentUIEngine *    matecomponent_ui_engine_construct          (MateComponentUIEngine *engine,
                                                             GObject *view);
    MateComponentUIEngine *    matecomponent_ui_engine_new                (GObject *view);
    GObject *           matecomponent_ui_engine_get_view           (MateComponentUIEngine *engine);
    void                matecomponent_ui_engine_add_sync           (MateComponentUIEngine *engine,
                                                             MateComponentUISync *sync);
    void                matecomponent_ui_engine_remove_sync        (MateComponentUIEngine *engine,
                                                             MateComponentUISync *sync);
    GSList *            matecomponent_ui_engine_get_syncs          (MateComponentUIEngine *engine);
    void                matecomponent_ui_engine_update_node        (MateComponentUIEngine *engine,
                                                             MateComponentUISync *sync,
                                                             MateComponentUINode *node);
    void                matecomponent_ui_engine_queue_update       (MateComponentUIEngine *engine,
                                                             GtkWidget *widget,
                                                             MateComponentUINode *node,
                                                             MateComponentUINode *cmd_node);
    GtkWidget *         matecomponent_ui_engine_build_control      (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node);
    MateComponentUINode *      matecomponent_ui_engine_widget_get_node    (GtkWidget *widget);
    void                matecomponent_ui_engine_widget_set_node    (MateComponentUIEngine *engine,
                                                             GtkWidget *widget,
                                                             MateComponentUINode *node);
    MateComponentUIError       matecomponent_ui_engine_xml_set_prop       (MateComponentUIEngine *engine,
                                                             const char *path,
                                                             const char *property,
                                                             const char *value,
                                                             const char *component);
    CORBA_char *        matecomponent_ui_engine_xml_get_prop       (MateComponentUIEngine *engine,
                                                             const char *path,
                                                             const char *prop,
                                                             gboolean *invalid_path);
    void                matecomponent_ui_engine_prune_widget_info  (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node,
                                                             gboolean save_custom);
    MateComponentUINode *      matecomponent_ui_engine_get_path           (MateComponentUIEngine *engine,
                                                             const char *path);
    void                matecomponent_ui_engine_dirty_tree         (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node);
    void                matecomponent_ui_engine_clean_tree         (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node);
    void                matecomponent_ui_engine_dump               (MateComponentUIEngine *engine,
                                                             FILE *out,
                                                             const char *msg);
    CORBA_Object        matecomponent_ui_engine_node_get_object    (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node);
    gboolean            matecomponent_ui_engine_node_is_dirty      (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node);
    GtkWidget *         matecomponent_ui_engine_node_get_widget    (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node);
    const char *        matecomponent_ui_engine_node_get_id        (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node);
    MateComponentUINode *      matecomponent_ui_engine_get_cmd_node       (MateComponentUIEngine *engine,
                                                             MateComponentUINode *from_node);
    void                matecomponent_ui_engine_node_set_dirty     (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node,
                                                             gboolean dirty);
    void                matecomponent_ui_engine_stamp_custom       (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node);
    void                matecomponent_ui_engine_widget_set         (MateComponentUIEngine *engine,
                                                             const char *path,
                                                             GtkWidget *widget);
    void                matecomponent_ui_engine_stamp_root         (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node,
                                                             GtkWidget *widget);
    void                matecomponent_ui_engine_add_hint           (MateComponentUIEngine *engine,
                                                             const char *str);
    void                matecomponent_ui_engine_remove_hint        (MateComponentUIEngine *engine);
    void                matecomponent_ui_engine_emit_verb_on       (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node);
    void                matecomponent_ui_engine_emit_event_on      (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node,
                                                             const char *state);
    void                matecomponent_ui_engine_emit_verb_on_w     (MateComponentUIEngine *engine,
                                                             GtkWidget *widget);
    void                matecomponent_ui_engine_emit_event_on_w    (MateComponentUIEngine *engine,
                                                             GtkWidget *widget,
                                                             const char *state);
    char *              matecomponent_ui_engine_get_attr           (MateComponentUINode *node,
                                                             MateComponentUINode *cmd_node,
                                                             const char *attr);
    void                matecomponent_ui_engine_widget_attach_node (GtkWidget *widget,
                                                             MateComponentUINode *node);
    CORBA_char *        matecomponent_ui_engine_xml_get            (MateComponentUIEngine *engine,
                                                             const char *path,
                                                             gboolean node_only);
    gboolean            matecomponent_ui_engine_xml_node_exists    (MateComponentUIEngine *engine,
                                                             const char *path);
    MateComponentUIError       matecomponent_ui_engine_xml_merge_tree     (MateComponentUIEngine *engine,
                                                             const char *path,
                                                             MateComponentUINode *tree,
                                                             const char *component);
    MateComponentUIError       matecomponent_ui_engine_xml_rm             (MateComponentUIEngine *engine,
                                                             const char *path,
                                                             const char *by_component);
    MateComponentUIError       matecomponent_ui_engine_object_set         (MateComponentUIEngine *engine,
                                                             const char *path,
                                                             MateComponent_Unknown object,
                                                             CORBA_Environment *ev);
    MateComponentUIError       matecomponent_ui_engine_object_get         (MateComponentUIEngine *engine,
                                                             const char *path,
                                                             MateComponent_Unknown *object,
                                                             CORBA_Environment *ev);
    void                matecomponent_ui_engine_exec_verb          (MateComponentUIEngine *engine,
                                                             const CORBA_char *cname,
                                                             CORBA_Environment *ev);
    void                matecomponent_ui_engine_ui_event           (MateComponentUIEngine *engine,
                                                             const CORBA_char *id,
                                                             const MateComponent_UIComponent_EventType type,
                                                             const CORBA_char *state,
                                                             CORBA_Environment *ev);

## Object Hierarchy

      GObject
       +----MateComponentUIEngine

## Signals

      "add-hint"                                       : Run Last
      "destroy"                                        : Run Last
      "emit-event-on"                                  : Run Last
      "emit-verb-on"                                   : Run Last
      "remove-hint"                                    : Run Last

## Description

The MateComponent UI code as exposed through the MateComponentWindow, MateComponentUIComponent and MateComponentUIContainer API's use the MateComponentUIEngine. The Engine effectively maintains a MateComponentUIXml tree internaly, and a list of MateComponentUISync synchronizers that, when the tree changes are used to re-sync the associated widgets with the XML model.

The Engine can be tweaked by getting its pointer from an associated MateComponentWindow eg. this can be useful for setting the configuration path. To allow a MateComponentWindow to be configurable you need to do:

Example 7. How to make your UI user configurable

    1
    2
    3
    matecomponent_ui_engine_config_set_path (
            matecomponent_window_get_ui_engine (win),
            "/my-application-name/UIConfig/kvps");

where "UIConfig/kvps" is some convenient path into your mate_config file.

Key value pairs (kvps) are stored in this, mangled into a comma delimited string and these are used to clobber the XML on merges, eg.

Example 8. User configuration format

    1
    2
    [UIConfig]
    kvps=/Toolbar:look:both

inside your ~/.mate/my-application-name file, will ensure that whenever the item with path '/Toolbar' is modified the 'look="both"' attribute will be stamped onto it, effecively forcing a certain look.

## Details

### struct MateComponentUIEngine

    struct MateComponentUIEngine;

### matecomponent_ui_engine_deregister_dead_components ()

    void                matecomponent_ui_engine_deregister_dead_components
                                                            (MateComponentUIEngine *engine);

Detect any components that have died and deregister them - unmerging their UI elements.

`engine` : | the engine

### matecomponent_ui_engine_deregister_component_by_ref ()

    void                matecomponent_ui_engine_deregister_component_by_ref
                                                            (MateComponentUIEngine *engine,
                                                             MateComponent_Unknown ref);

Deregisters component with reference `ref` from `engine`.

`engine` : | the engine
`ref` : | the ref.

### matecomponent_ui_engine_deregister_component ()

    void                matecomponent_ui_engine_deregister_component
                                                            (MateComponentUIEngine *engine,
                                                             const char *name);

Deregisters component of `name` from `engine`.

`engine` : | the engine
`name` : | the component name

### matecomponent_ui_engine_register_component ()

    void                matecomponent_ui_engine_register_component (MateComponentUIEngine *engine,
                                                             const char *name,
                                                             MateComponent_Unknown component);

Registers `component` with `engine` by `name`.

`engine` : | the engine
`name` : | a name to associate a component with
`component` : | the component

### matecomponent_ui_engine_get_component_names ()

    GList *             matecomponent_ui_engine_get_component_names
                                                            (MateComponentUIEngine *engine);

`engine` : | the engine
Returns : | the names of all registered components

### matecomponent_ui_engine_get_component ()

    MateComponent_Unknown      matecomponent_ui_engine_get_component      (MateComponentUIEngine *engine,
                                                             const char *name);

`engine` : | the engine
`name` : | the name of the component to fetch
Returns : | the component with name `name`

### matecomponent_ui_engine_config_set_path ()

    void                matecomponent_ui_engine_config_set_path    (MateComponentUIEngine *engine,
                                                             const char *path);

`engine` : |
`path` : |

### matecomponent_ui_engine_config_get_path ()

    const char *        matecomponent_ui_engine_config_get_path    (MateComponentUIEngine *engine);

`engine` : |
Returns : |

### matecomponent_ui_engine_set_ui_container ()

    void                matecomponent_ui_engine_set_ui_container   (MateComponentUIEngine *engine,
                                                             MateComponentUIContainer *ui_container);

Associates a given UI Container with this MateComponentUIEngine.

`engine` : | the engine
`ui_container` : | a UI Container matecomponent object.

### matecomponent_ui_engine_get_ui_container ()

    MateComponentUIContainer * matecomponent_ui_engine_get_ui_container   (MateComponentUIEngine *engine);

Fetches the associated UI Container

`engine` : | the engine
Returns : | the associated UI container.

### matecomponent_ui_engine_freeze ()

    void                matecomponent_ui_engine_freeze             (MateComponentUIEngine *engine);

### Warning

`matecomponent_ui_engine_freeze` is deprecated and should not be used in newly-written code.

This increments the freeze count on the tree, while this count > 0 no syncronization between the internal XML model and the widget views occurs. This means that many simple merges can be glupped together with little performance impact and overhead.

`engine` : | the engine

### matecomponent_ui_engine_thaw ()

    void                matecomponent_ui_engine_thaw               (MateComponentUIEngine *engine);

### Warning

`matecomponent_ui_engine_thaw` is deprecated and should not be used in newly-written code.

This decrements the freeze count and if it is 0 causes the UI widgets to be re-synched with the XML model, see also matecomponent_ui_engine_freeze

`engine` : | the engine

### matecomponent_ui_engine_update ()

    void                matecomponent_ui_engine_update             (MateComponentUIEngine *engine);

### Warning

`matecomponent_ui_engine_update` is deprecated and should not be used in newly-written code.

This function is called to update the entire UI model synchronizing any changes in it with the widget tree where neccessary

`engine` : | the engine.

### enum MateComponentUIError

    typedef enum {
    	MATECOMPONENT_UI_ERROR_OK = 0,
    	MATECOMPONENT_UI_ERROR_BAD_PARAM,
    	MATECOMPONENT_UI_ERROR_INVALID_PATH,
    	MATECOMPONENT_UI_ERROR_INVALID_XML
    } MateComponentUIError;

### MateComponentUIEnginePrivate

    typedef struct _MateComponentUIEnginePrivate MateComponentUIEnginePrivate;

### MateComponentUIEngineClass

    typedef struct {
    	GObjectClass parent_class;

    	/* Signals */
    	void (*add_hint)      (MateComponentUIEngine *engine,
    			       const char     *str);
    	void (*remove_hint)   (MateComponentUIEngine *engine);

    	void (*emit_verb_on)  (MateComponentUIEngine *engine,
    			       MateComponentUINode   *node);

    	void (*emit_event_on) (MateComponentUIEngine *engine,
    			       MateComponentUINode   *node,
    			       const char     *state);

    	void (*destroy)       (MateComponentUIEngine *engine);
    } MateComponentUIEngineClass;

### matecomponent_ui_engine_construct ()

    MateComponentUIEngine *    matecomponent_ui_engine_construct          (MateComponentUIEngine *engine,
                                                             GObject *view);

Construct a new matecomponent_ui_engine

`engine` : | the engine.
`view` : | the view [ often a MateComponentWindow ]
Returns : | the constructed engine.

### matecomponent_ui_engine_new ()

    MateComponentUIEngine *    matecomponent_ui_engine_new                (GObject *view);

Create a new MateComponentUIEngine structure

`view` : |
Returns : | the new UI Engine.

### matecomponent_ui_engine_get_view ()

    GObject *           matecomponent_ui_engine_get_view           (MateComponentUIEngine *engine);

This returns the associated view, often a MateComponentWindow

`engine` : | the engine
Returns : | the view widget.

### matecomponent_ui_engine_add_sync ()

    void                matecomponent_ui_engine_add_sync           (MateComponentUIEngine *engine,
                                                             MateComponentUISync *sync);

Add a MateComponentUISync synchronizer to the engine

`engine` : | the enginer
`sync` : | the synchronizer

### matecomponent_ui_engine_remove_sync ()

    void                matecomponent_ui_engine_remove_sync        (MateComponentUIEngine *engine,
                                                             MateComponentUISync *sync);

Remove a specified MateComponentUISync synchronizer from the engine

`engine` : | the engine
`sync` : | the sync

### matecomponent_ui_engine_get_syncs ()

    GSList *            matecomponent_ui_engine_get_syncs          (MateComponentUIEngine *engine);

Retrieve a list of available synchronizers.

`engine` : | the engine
Returns : | a GSList of MateComponentUISync s

### matecomponent_ui_engine_update_node ()

    void                matecomponent_ui_engine_update_node        (MateComponentUIEngine *engine,
                                                             MateComponentUISync *sync,
                                                             MateComponentUINode *node);

This function is used to write recursive synchronizers and is intended only for internal / privilaged use.

By the time this returns, due to re-enterancy, node points at undefined memory.

`engine` : | the engine
`sync` : |
`node` : | the node to start updating.

### matecomponent_ui_engine_queue_update ()

    void                matecomponent_ui_engine_queue_update       (MateComponentUIEngine *engine,
                                                             GtkWidget *widget,
                                                             MateComponentUINode *node,
                                                             MateComponentUINode *cmd_node);

This function is used to queue a state update on `widget`, essentialy transfering any state from the XML model into the widget view. This is queued to avoid re-enterancy problems.

`engine` : | the engine
`widget` : | the widget to update later
`node` : | the node
`cmd_node` : | the associated command's node

### matecomponent_ui_engine_build_control ()

    GtkWidget *         matecomponent_ui_engine_build_control      (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node);

A helper function for synchronizers, this creates a control if possible from the node's associated object, stamps the node as containing a control and sets its widget.

`engine` : | the engine
`node` : | the control node.
Returns : | a Control's GtkWidget.

### matecomponent_ui_engine_widget_get_node ()

    MateComponentUINode *      matecomponent_ui_engine_widget_get_node    (GtkWidget *widget);

`widget` : | the widget
Returns : | the MateComponentUINode associated with this widget

### matecomponent_ui_engine_widget_set_node ()

    void                matecomponent_ui_engine_widget_set_node    (MateComponentUIEngine *engine,
                                                             GtkWidget *widget,
                                                             MateComponentUINode *node);

Used internaly to associate a widget with a node, some synchronisers need to be able to execute code on widget creation.

`engine` : | the engine
`widget` : | the widget
`node` : | the node

### matecomponent_ui_engine_xml_set_prop ()

    MateComponentUIError       matecomponent_ui_engine_xml_set_prop       (MateComponentUIEngine *engine,
                                                             const char *path,
                                                             const char *property,
                                                             const char *value,
                                                             const char *component);

This function sets the property of a node in the internal tree representation at `path` in `engine`.

`engine` : | the engine
`path` : | the path into the tree
`property` : | The property to set
`value` : | The new value of the property
`component` : | the component ID associated with the nodes.
Returns : | flag on error

### matecomponent_ui_engine_xml_get_prop ()

    CORBA_char *        matecomponent_ui_engine_xml_get_prop       (MateComponentUIEngine *engine,
                                                             const char *path,
                                                             const char *prop,
                                                             gboolean *invalid_path);

This function fetches the property `prop` at node at `path` in the internal structure.

`engine` : | the engine
`path` : | the path into the tree
`prop` : | The property
`invalid_path` : |
Returns : | a CORBA allocated string

### matecomponent_ui_engine_prune_widget_info ()

    void                matecomponent_ui_engine_prune_widget_info  (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node,
                                                             gboolean save_custom);

This function destroys any widgets associated with `node` and all its children, if `save_custom`, any widget that is a custom widget ( such as a control ) will be preserved. All widgets flagged ROOT are preserved always.

`engine` : | the engine
`node` : | the node
`save_custom` : | whether to save custom widgets

### matecomponent_ui_engine_get_path ()

    MateComponentUINode *      matecomponent_ui_engine_get_path           (MateComponentUIEngine *engine,
                                                             const char *path);

This routine gets a node from the internal XML tree pointed at by `path`

`engine` : | the engine.
`path` : | the path into the tree
Returns : | the node.

### matecomponent_ui_engine_dirty_tree ()

    void                matecomponent_ui_engine_dirty_tree         (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node);

Mark all the node's children as being dirty and needing a re-synch with their widget views.

`engine` : | the engine
`node` : | the node

### matecomponent_ui_engine_clean_tree ()

    void                matecomponent_ui_engine_clean_tree         (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node);

This cleans the tree, marking the node and its children as not needing a re-synch with their widget views.

`engine` : | the engine
`node` : | the node

### matecomponent_ui_engine_dump ()

    void                matecomponent_ui_engine_dump               (MateComponentUIEngine *engine,
                                                             FILE *out,
                                                             const char *msg);

This is a debugging function mostly for internal and testing use, it dumps the XML tree, including the associated, and overridden nodes in a wierd hackish format to the `out` stream with the helpful `msg` prepended.

`engine` : | the engine
`out` : | the FILE stream to dump to
`msg` : | user visible message

### matecomponent_ui_engine_node_get_object ()

    CORBA_Object        matecomponent_ui_engine_node_get_object    (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node);

`engine` : | the engine
`node` : | the node
Returns : | the CORBA_Object associated with a `node`

### matecomponent_ui_engine_node_is_dirty ()

    gboolean            matecomponent_ui_engine_node_is_dirty      (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node);

`engine` : | the engine
`node` : | the node
Returns : | whether the `node` is marked dirty

### matecomponent_ui_engine_node_get_widget ()

    GtkWidget *         matecomponent_ui_engine_node_get_widget    (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node);

Gets the widget associated with `node`

`engine` : | the engine
`node` : | the node
Returns : | the widget

### matecomponent_ui_engine_node_get_id ()

    const char *        matecomponent_ui_engine_node_get_id        (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node);

Each component has an associated textual id or name - see matecomponent_ui_engine_register_component

`engine` : | the engine
`node` : | the node
Returns : | the component id associated with the node

### matecomponent_ui_engine_get_cmd_node ()

    MateComponentUINode *      matecomponent_ui_engine_get_cmd_node       (MateComponentUIEngine *engine,
                                                             MateComponentUINode *from_node);

This function seeks the command node associated with `from_node` in `engine` 's internal tree.

`engine` : | the engine
`from_node` : | the node
Returns : | the command node or NULL

### matecomponent_ui_engine_node_set_dirty ()

    void                matecomponent_ui_engine_node_set_dirty     (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node,
                                                             gboolean dirty);

Set `node` s dirty bit to `dirty`.

`engine` : | the engine
`node` : | the node
`dirty` : | whether the node should be dirty.

### matecomponent_ui_engine_stamp_custom ()

    void                matecomponent_ui_engine_stamp_custom       (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node);

Marks a node as containing a custom widget.

`engine` : | the engine
`node` : | the node

### matecomponent_ui_engine_widget_set ()

    void                matecomponent_ui_engine_widget_set         (MateComponentUIEngine *engine,
                                                             const char *path,
                                                             GtkWidget *widget);

`engine` : |
`path` : |
`widget` : |

### matecomponent_ui_engine_stamp_root ()

    void                matecomponent_ui_engine_stamp_root         (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node,
                                                             GtkWidget *widget);

This stamps `node` with `widget` which is marked as being a ROOT node, so the engine will never destroy it.

`engine` : | the engine
`node` : | the node
`widget` : | the root widget

### matecomponent_ui_engine_add_hint ()

    void                matecomponent_ui_engine_add_hint           (MateComponentUIEngine *engine,
                                                             const char *str);

This fires the 'add_hint' signal.

`engine` : | the engine
`str` : | the hint string

### matecomponent_ui_engine_remove_hint ()

    void                matecomponent_ui_engine_remove_hint        (MateComponentUIEngine *engine);

This fires the 'remove_hint' signal

`engine` : | the engine

### matecomponent_ui_engine_emit_verb_on ()

    void                matecomponent_ui_engine_emit_verb_on       (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node);

This fires the 'emit_verb' signal

`engine` : | the engine
`node` : | the node

### matecomponent_ui_engine_emit_event_on ()

    void                matecomponent_ui_engine_emit_event_on      (MateComponentUIEngine *engine,
                                                             MateComponentUINode *node,
                                                             const char *state);

This fires the 'emit_event_on' signal

`engine` : | the engine
`node` : | the node
`state` : | the new state of the node

### matecomponent_ui_engine_emit_verb_on_w ()

    void                matecomponent_ui_engine_emit_verb_on_w     (MateComponentUIEngine *engine,
                                                             GtkWidget *widget);

This function looks up the node from `widget` and emits the 'emit_verb_on' signal on that node.

`engine` : | the engine
`widget` : | the widget

### matecomponent_ui_engine_emit_event_on_w ()

    void                matecomponent_ui_engine_emit_event_on_w    (MateComponentUIEngine *engine,
                                                             GtkWidget *widget,
                                                             const char *state);

This function looks up the node from `widget` and emits the 'emit_event_on' signal on that node passint `state` as the new state.

`engine` : | the engine
`widget` : | the widget
`state` : | the new state

### matecomponent_ui_engine_get_attr ()

    char *              matecomponent_ui_engine_get_attr           (MateComponentUINode *node,
                                                             MateComponentUINode *cmd_node,
                                                             const char *attr);

This function is used to get node attributes in many UI synchronizers, it first attempts to get the attribute from `node`, and if this fails falls back to `cmd_node`.

`node` : | the node
`cmd_node` : | the command's node
`attr` : | the attribute name
Returns : | the attr or NULL if it doesn't exist.

### matecomponent_ui_engine_widget_attach_node ()

    void                matecomponent_ui_engine_widget_attach_node (GtkWidget *widget,
                                                             MateComponentUINode *node);

Associate `node` with `widget`

`widget` : | the widget
`node` : | the node

### matecomponent_ui_engine_xml_get ()

    CORBA_char *        matecomponent_ui_engine_xml_get            (MateComponentUIEngine *engine,
                                                             const char *path,
                                                             gboolean node_only);

This function fetches the node at `path` in the internal structure, and if `node_only` dumps the node to an XML string, otherwise it dumps it and its children.

`engine` : | the engine
`path` : | the path into the tree
`node_only` : | just the node, or children too.
Returns : | the XML string - use CORBA_free to free

### matecomponent_ui_engine_xml_node_exists ()

    gboolean            matecomponent_ui_engine_xml_node_exists    (MateComponentUIEngine *engine,
                                                             const char *path);

`engine` : | the engine
`path` : | the path into the tree
Returns : | true if the node at `path` exists

### matecomponent_ui_engine_xml_merge_tree ()

    MateComponentUIError       matecomponent_ui_engine_xml_merge_tree     (MateComponentUIEngine *engine,
                                                             const char *path,
                                                             MateComponentUINode *tree,
                                                             const char *component);

This function merges the XML `tree` into the internal tree representation as children of the node at `path` in `engine`.

`engine` : | the engine
`path` : | the path into the tree
`tree` : | the nodes
`component` : | the component ID associated with these nodes.
Returns : | flag on error

### matecomponent_ui_engine_xml_rm ()

    MateComponentUIError       matecomponent_ui_engine_xml_rm             (MateComponentUIEngine *engine,
                                                             const char *path,
                                                             const char *by_component);

Remove a chunk of the xml tree pointed at by `path` in `engine`, if `by_component` then only remove items associated with that component - possibly revealing other overridden items.

`engine` : | the engine
`path` : | the path into the tree
`by_component` : | whether to remove elements from only a specific component
Returns : | flag on error

### matecomponent_ui_engine_object_set ()

    MateComponentUIError       matecomponent_ui_engine_object_set         (MateComponentUIEngine *engine,
                                                             const char *path,
                                                             MateComponent_Unknown object,
                                                             CORBA_Environment *ev);

This associates a CORBA Object reference with a node in the tree, most often this is done to insert a Control's reference into a 'control' element.

`engine` : | the engine
`path` : | the path into the tree
`object` : | an object reference
`ev` : | CORBA exception environment
Returns : | flag if success

### matecomponent_ui_engine_object_get ()

    MateComponentUIError       matecomponent_ui_engine_object_get         (MateComponentUIEngine *engine,
                                                             const char *path,
                                                             MateComponent_Unknown *object,
                                                             CORBA_Environment *ev);

This extracts a CORBA object reference associated with the node at `path` in `engine`, and returns it in the reference pointed to by `object`.

`engine` : | the engine
`path` : | the path into the tree
`object` : | an pointer to an object reference
`ev` : | CORBA exception environment
Returns : | flag if success

### matecomponent_ui_engine_exec_verb ()

    void                matecomponent_ui_engine_exec_verb          (MateComponentUIEngine *engine,
                                                             const CORBA_char *cname,
                                                             CORBA_Environment *ev);

`engine` : |
`cname` : |
`ev` : |

### matecomponent_ui_engine_ui_event ()

    void                matecomponent_ui_engine_ui_event           (MateComponentUIEngine *engine,
                                                             const CORBA_char *id,
                                                             const MateComponent_UIComponent_EventType type,
                                                             const CORBA_char *state,
                                                             CORBA_Environment *ev);

`engine` : |
`id` : |
`type` : |
`state` : |
`ev` : |

## Signal Details

### The `"add-hint"` signal

    void                user_function                      (MateComponentUIEngine *matecomponentuiengine,
                                                            gchar          *arg1,
                                                            gpointer        user_data)           : Run Last

`matecomponentuiengine` : | the object which received the signal.
`arg1` : |
`user_data` : | user data set when the signal handler was connected.

### The `"destroy"` signal

    void                user_function                      (MateComponentUIEngine *matecomponentuiengine,
                                                            gpointer        user_data)           : Run Last

`matecomponentuiengine` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.

### The `"emit-event-on"` signal

    void                user_function                      (MateComponentUIEngine *matecomponentuiengine,
                                                            gpointer        arg1,
                                                            gchar          *arg2,
                                                            gpointer        user_data)           : Run Last

`matecomponentuiengine` : | the object which received the signal.
`arg1` : |
`arg2` : |
`user_data` : | user data set when the signal handler was connected.

### The `"emit-verb-on"` signal

    void                user_function                      (MateComponentUIEngine *matecomponentuiengine,
                                                            gpointer        arg1,
                                                            gpointer        user_data)           : Run Last

`matecomponentuiengine` : | the object which received the signal.
`arg1` : |
`user_data` : | user data set when the signal handler was connected.

### The `"remove-hint"` signal

    void                user_function                      (MateComponentUIEngine *matecomponentuiengine,
                                                            gpointer        user_data)           : Run Last

`matecomponentuiengine` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.