## SwamiguiTreeStore SwamiguiTreeStore |

## Synopsis

                        SwamiguiTreeStore;
    #define             SWAMIGUI_TREE_ERRMSG_PARENT_NOT_IN_TREE
    #define             SWAMIGUI_TREE_ERRMSG_ITEM_NOT_IN_TREE
    void                swamigui_tree_store_insert          (SwamiguiTreeStore *store,
                                                             GObject *item,
                                                             const char *label,
                                                             char *icon,
                                                             GtkTreeIter *parent,
                                                             int pos,
                                                             GtkTreeIter *out_iter);
    void                swamigui_tree_store_insert_before   (SwamiguiTreeStore *store,
                                                             GObject *item,
                                                             const char *label,
                                                             char *icon,
                                                             GtkTreeIter *parent,
                                                             GtkTreeIter *sibling,
                                                             GtkTreeIter *out_iter);
    void                swamigui_tree_store_insert_after    (SwamiguiTreeStore *store,
                                                             GObject *item,
                                                             const char *label,
                                                             char *icon,
                                                             GtkTreeIter *parent,
                                                             GtkTreeIter *sibling,
                                                             GtkTreeIter *out_iter);
    void                swamigui_tree_store_change          (SwamiguiTreeStore *store,
                                                             GObject *item,
                                                             const char *label,
                                                             char *icon);
    void                swamigui_tree_store_remove          (SwamiguiTreeStore *store,
                                                             GObject *item);
    void                swamigui_tree_store_move_before     (SwamiguiTreeStore *store,
                                                             GObject *item,
                                                             GtkTreeIter *position);
    void                swamigui_tree_store_move_after      (SwamiguiTreeStore *store,
                                                             GObject *item,
                                                             GtkTreeIter *position);
    gboolean            swamigui_tree_store_item_get_node   (SwamiguiTreeStore *store,
                                                             GObject *item,
                                                             GtkTreeIter *iter);
    GObject *           swamigui_tree_store_node_get_item   (SwamiguiTreeStore *store,
                                                             GtkTreeIter *iter);
    void                swamigui_tree_store_add             (SwamiguiTreeStore *store,
                                                             GObject *item);
    void                swamigui_tree_store_changed         (SwamiguiTreeStore *store,
                                                             GObject *item);

## Object Hierarchy

      GObject
       +----GtkTreeStore
             +----SwamiguiTreeStore
                   +----SwamiguiTreeStorePatch

## Implemented Interfaces

SwamiguiTreeStore implements GtkBuildable, GtkTreeModel, GtkTreeDragSource, GtkTreeDragDest and GtkTreeSortable.

## Description

## Details

### SwamiguiTreeStore

    typedef struct _SwamiguiTreeStore SwamiguiTreeStore;

### SWAMIGUI_TREE_ERRMSG_PARENT_NOT_IN_TREE

    #define SWAMIGUI_TREE_ERRMSG_PARENT_NOT_IN_TREE "Parent not in tree store"

### SWAMIGUI_TREE_ERRMSG_ITEM_NOT_IN_TREE

    #define SWAMIGUI_TREE_ERRMSG_ITEM_NOT_IN_TREE "Item not in tree store"

### swamigui_tree_store_insert ()

    void                swamigui_tree_store_insert          (SwamiguiTreeStore *store,
                                                             GObject *item,
                                                             const char *label,
                                                             char *icon,
                                                             GtkTreeIter *parent,
                                                             int pos,
                                                             GtkTreeIter *out_iter);

Creates a new tree node and inserts it at the position given by `parent` and `pos`, returning the created node in `out_iter` (if supplied). `item` is an object to link with the created node. It is also used if either `label` or `icons` is `NULL` in which case it obtains the information via other methods.

`store` : | Swami tree store to insert tree node into
`item` : | Object to link to tree node or `NULL`
`label` : | Label for node or `NULL` to try and obtain it other ways.
`icon` : | Stock ID of icon (`NULL` to use "icon" type property or category icon)
`parent` : | Pointer to parent tree node or `NULL` if inserting a toplevel node
`pos` : | Position to insert new node at (0 = prepend, > sibling list to append)
`out_iter` : | Pointer to a user supplied GtkTreeIter structure to store the new node in or `NULL` to ignore.

### swamigui_tree_store_insert_before ()

    void                swamigui_tree_store_insert_before   (SwamiguiTreeStore *store,
                                                             GObject *item,
                                                             const char *label,
                                                             char *icon,
                                                             GtkTreeIter *parent,
                                                             GtkTreeIter *sibling,
                                                             GtkTreeIter *out_iter);

Like `swamigui_tree_store_insert()` but inserts the node before the specified `sibling` instead.

`store` : | Swami tree store to insert tree node into
`item` : | Object to link to tree node or `NULL`
`label` : | Label for node or `NULL` to try and obtain it other ways.
`icon` : | Stock ID of icon (`NULL` to use "icon" type property or category icon)
`parent` : | Pointer to parent tree node or `NULL` if inserting a toplevel node
`sibling` : | A sibling node to insert the new node before or `NULL` to append
`out_iter` : | Pointer to a user supplied GtkTreeIter structure to store the new node in or `NULL` to ignore.

### swamigui_tree_store_insert_after ()

    void                swamigui_tree_store_insert_after    (SwamiguiTreeStore *store,
                                                             GObject *item,
                                                             const char *label,
                                                             char *icon,
                                                             GtkTreeIter *parent,
                                                             GtkTreeIter *sibling,
                                                             GtkTreeIter *out_iter);

Like `swamigui_tree_store_insert()` but inserts the node after the specified `sibling` instead.

`store` : | Swami tree store to insert tree node into
`item` : | Object to link to tree node or `NULL`
`label` : | Label for node or `NULL` to try and obtain it other ways.
`icon` : | Stock ID of icon (`NULL` to use "icon" type property or category icon)
`parent` : | Pointer to parent tree node or `NULL` if inserting a toplevel node
`sibling` : | A sibling node to insert the new node after or `NULL` to prepend
`out_iter` : | Pointer to a user supplied GtkTreeIter structure to store the new node in or `NULL` to ignore.

### swamigui_tree_store_change ()

    void                swamigui_tree_store_change          (SwamiguiTreeStore *store,
                                                             GObject *item,
                                                             const char *label,
                                                             char *icon);

Changes a row in a Swami tree store.

`store` : | Swami tree store
`item` : | Object in `store` to update
`label` : | New label or `NULL` to keep old
`icon` : | GdkPixbuf icon or `NULL` to keep old

### swamigui_tree_store_remove ()

    void                swamigui_tree_store_remove          (SwamiguiTreeStore *store,
                                                             GObject *item);

Removes a node (and all its children) from a Swami tree store.

`store` : | Swami tree store
`item` : | Object in `store` to remove

### swamigui_tree_store_move_before ()

    void                swamigui_tree_store_move_before     (SwamiguiTreeStore *store,
                                                             GObject *item,
                                                             GtkTreeIter *position);

Move an item from its current location to before `position`. `position` must be at the same level as `item` in the tree.

`store` : | Swami tree store
`item` : | Item to move
`position` : | Location to move item before or `NULL` for last position

### swamigui_tree_store_move_after ()

    void                swamigui_tree_store_move_after      (SwamiguiTreeStore *store,
                                                             GObject *item,
                                                             GtkTreeIter *position);

Move an item from its current location to after `position`. `position` must be at the same level as `item` in the tree.

`store` : | Swami tree store
`item` : | Item to move
`position` : | Location to move item after or `NULL` for first position

### swamigui_tree_store_item_get_node ()

    gboolean            swamigui_tree_store_item_get_node   (SwamiguiTreeStore *store,
                                                             GObject *item,
                                                             GtkTreeIter *iter);

Gets a tree node for `item` in `store`. The tree node is stored in `iter` which should be a pointer to a user supplied GtkTreeIter structure.

`store` : | Swami tree store
`item` : | Item that is in `store`
`iter` : | Pointer to a GtkTreeIter structure to store the linked tree node
Returns : | `TRUE` if `iter` was set (`item` has a linked node in `store`), `FALSE` otherwise

### swamigui_tree_store_node_get_item ()

    GObject *           swamigui_tree_store_node_get_item   (SwamiguiTreeStore *store,
                                                             GtkTreeIter *iter);

Gets the linked item object for `iter` node in `store`. The returned item is not referenced but can be safely used as long as the tree model isn't changed (possibly causing item to be destroyed). The item should be ref'd if used for extended periods.

`store` : | Swami tree store
`iter` : | Node in `store` to find linked item of
Returns : | The item object linked with `iter` node or `NULL` if not found. Item has NOT been referenced, see note above.

### swamigui_tree_store_add ()

    void                swamigui_tree_store_add             (SwamiguiTreeStore *store,
                                                             GObject *item);

Add an item to a tree store using the item_add class method (specific to tree store types).

`store` : | Swami tree store
`item` : | Item to add

### swamigui_tree_store_changed ()

    void                swamigui_tree_store_changed         (SwamiguiTreeStore *store,
                                                             GObject *item);

This function updates the title and sorting of an item that changed using the item_changed class method (specific to tree store types). Note that re-ordering of the changed item may occur in a delayed fashion, to prevent delays while user is typing a name for example.

`store` : | Swami tree store
`item` : | Item that changed