## SwamiguiRoot SwamiguiRoot |

## Synopsis

    enum                SwamiguiQuitConfirm;
                        SwamiguiRoot;
    extern              SwamiguiRoot *swamigui_root;
    extern              SwamiRoot *swami_root;
    void                swamigui_init                       (int *argc,
                                                             char **argv[]);
    SwamiguiRoot *      swamigui_root_new                   (void);
    void                swamigui_root_activate              (SwamiguiRoot *root);
    void                swamigui_root_quit                  (SwamiguiRoot *root);
    SwamiguiRoot *      swamigui_get_root                   (gpointer gobject);
    gboolean            swamigui_root_save_prefs            (SwamiguiRoot *root);
    gboolean            swamigui_root_load_prefs            (SwamiguiRoot *root);

## Object Hierarchy

      GObject
       +----SwamiLock
             +----SwamiRoot
                   +----SwamiguiRoot

## Properties

      "default-patch-type"       GType*                : Read / Write
      "main-window"              GtkWidget*            : Read
      "piano-lower-keys"         gchar*                : Read / Write
      "piano-upper-keys"         gchar*                : Read / Write
      "quit-confirm"             SwamiguiQuitConfirm   : Read / Write
      "selection"                IpatchList*           : Read / Write
      "selection-origin"         GObject*              : Read
      "selection-single"         GObject*              : Read / Write
      "solo-item-enable"         gboolean              : Read / Write
      "splash-delay"             guint                 : Read / Write
      "splash-enable"            gboolean              : Read / Write
      "tips-enable"              gboolean              : Read / Write
      "tips-position"            gint                  : Read / Write
      "tree-store-list"          IpatchList*           : Read
      "update-interval"          gint                  : Read / Write

## Signals

      "quit"                                           : Run Last

## Description

## Details

### enum SwamiguiQuitConfirm

    typedef enum
    {
      SWAMIGUI_QUIT_CONFIRM_ALWAYS,	/* always pop a quit confirmation */
      SWAMIGUI_QUIT_CONFIRM_UNSAVED,	/* only if there are unsaved files */
      SWAMIGUI_QUIT_CONFIRM_NEVER	/* spontaneous combust */
    } SwamiguiQuitConfirm;

### SwamiguiRoot

    typedef struct _SwamiguiRoot SwamiguiRoot;

### swamigui_root

    extern SwamiguiRoot *swamigui_root;

### swami_root

    extern SwamiRoot *swami_root;	/* just for convenience */

### swamigui_init ()

    void                swamigui_init                       (int *argc,
                                                             char **argv[]);

Function to initialize Swami User Interface. Should be called before any other Swamigui related functions. This function calls `swami_init()` as well.

`argc` : | Number of arguments from `main()`
`argv` : | Command line arguments from `main()`

### swamigui_root_new ()

    SwamiguiRoot *      swamigui_root_new                   (void);

Create a new Swami root user interface object which is a subclass of SwamiRoot.

Returns : | New Swami user interface object

### swamigui_root_activate ()

    void                swamigui_root_activate              (SwamiguiRoot *root);

Activates Swami GUI by creating main window, loading plugins, and displaying tips and splash image. Separate from object init function so that preferences can be loaded or not.

`root` : | Swami GUI root object

### swamigui_root_quit ()

    void                swamigui_root_quit                  (SwamiguiRoot *root);

Quit Swami GUI. Pops a quit confirmation depending on preferences.

`root` : | Swami GUI root object

### swamigui_get_root ()

    SwamiguiRoot *      swamigui_get_root                   (gpointer gobject);

Gets a SwamiguiObject associated with a `gobject`. A convenience function really as `swami_get_root()` will return the same object but casted to SwamiRoot instead.

`gobject` : | An object registered to a SwamiguiRoot object
Returns : | A SwamiguiRoot object or `NULL` if `gobject` not registered to one. Returned object's refcount is not incremented.

### swamigui_root_save_prefs ()

    gboolean            swamigui_root_save_prefs            (SwamiguiRoot *root);

Save application preferences to XML config file. Only stores config if it differs from existing stored config on disk.

`root` : | Swami GUI root object
Returns : | `TRUE` on success, `FALSE` otherwise (error message will be logged)

### swamigui_root_load_prefs ()

    gboolean            swamigui_root_load_prefs            (SwamiguiRoot *root);

Restore application preferences from XML config files.

`root` : | Swami GUI root object
Returns : | `TRUE` on success, `FALSE` otherwise (error message will be logged)

## Property Details

### The `"default-patch-type"` property

      "default-patch-type"       GType*                : Read / Write

Default patch type.

### The `"main-window"` property

      "main-window"              GtkWidget*            : Read

Main window.

### The `"piano-lower-keys"` property

      "piano-lower-keys"         gchar*                : Read / Write

Comma delimited list of GDK key names.

Default value: "z,s,x,d,c,v,g,b,h,n,j,m,comma,l,period,semicolon,slash"

### The `"piano-upper-keys"` property

      "piano-upper-keys"         gchar*                : Read / Write

Comma delimited list of GDK key names.

Default value: "q,2,w,3,e,r,5,t,6,y,7,u,i,9,o,0,p,bracketleft,equal,bracketright"

### The `"quit-confirm"` property

      "quit-confirm"             SwamiguiQuitConfirm   : Read / Write

Quit confirmation method.

Default value: SWAMIGUI_QUIT_CONFIRM_UNSAVED

### The `"selection"` property

      "selection"                IpatchList*           : Read / Write

Last item selection.

### The `"selection-origin"` property

      "selection-origin"         GObject*              : Read

Origin of selection.

### The `"selection-single"` property

      "selection-single"         GObject*              : Read / Write

Last single selected item.

### The `"solo-item-enable"` property

      "solo-item-enable"         gboolean              : Read / Write

Enable solo audition of active instrument.

Default value: FALSE

### The `"splash-delay"` property

      "splash-delay"             guint                 : Read / Write

Splash delay in milliseconds (0 to wait for button click).

Default value: 5000

### The `"splash-enable"` property

      "splash-enable"            gboolean              : Read / Write

Show splash on startup.

Default value: TRUE

### The `"tips-enable"` property

      "tips-enable"              gboolean              : Read / Write

Show tips on startup.

Default value: TRUE

### The `"tips-position"` property

      "tips-position"            gint                  : Read / Write

Tips position.

Allowed values: [0,255]

Default value: 0

### The `"tree-store-list"` property

      "tree-store-list"          IpatchList*           : Read

List of tree stores.

### The `"update-interval"` property

      "update-interval"          gint                  : Read / Write

GUI update interval in milliseconds.

Allowed values: [10,1000]

Default value: 100

## Signal Details

### The `"quit"` signal

    void                user_function                      (SwamiguiRoot *swamiguiroot,
                                                            gpointer      user_data)         : Run Last