## BtUIResources BtUIResources — common shared ui resources like icons and colors |

## Synopsis

    #include "bt-edit.h"

                        BtUIResources;
    enum                BtUIResourcesColors;
    enum                BtUIResourcesMachineColors;
    BtUIResources *     bt_ui_resources_new                 (void);
    GdkPixbuf *         bt_ui_resources_get_icon_pixbuf_by_machine
                                                            (const BtMachine *machine);
    GdkPixbuf *         bt_ui_resources_get_machine_graphics_pixbuf_by_machine
                                                            (const BtMachine *machine,
                                                             gdouble zoom);
    GtkWidget *         bt_ui_resources_get_icon_image_by_machine
                                                            (const BtMachine *machine);
    GtkWidget *         bt_ui_resources_get_icon_image_by_machine_type
                                                            (GType machine_type);
    GdkColor *          bt_ui_resources_get_gdk_color       (BtUIResourcesColors color_type);
    guint32             bt_ui_resources_get_color_by_machine
                                                            (const BtMachine *machine,
                                                             BtUIResourcesMachineColors color_type);
    GtkAccelGroup *     bt_ui_resources_get_accel_group     (void);

## Object Hierarchy

      GObject
       +----BtUIResources

## Description

This class serves as a central storage for colors and icons. It is implemented as a singleton.

## Details

### BtUIResources

    typedef struct _BtUIResources BtUIResources;

a collection of shared ui ressources

### enum BtUIResourcesColors

    typedef enum {
      BT_UI_RES_COLOR_CURSOR=0,
      BT_UI_RES_COLOR_SELECTION1,
      BT_UI_RES_COLOR_SELECTION2,
      BT_UI_RES_COLOR_PLAYLINE,
      BT_UI_RES_COLOR_LOOPLINE,
      BT_UI_RES_COLOR_ENDLINE,
      BT_UI_RES_COLOR_SOURCE_MACHINE_BASE,       /* machine view normal */
      BT_UI_RES_COLOR_SOURCE_MACHINE_BRIGHT1,    /* list view odd */
      BT_UI_RES_COLOR_SOURCE_MACHINE_BRIGHT2,    /* list view even */
      BT_UI_RES_COLOR_SOURCE_MACHINE_DARK1,      /* machine title */
      BT_UI_RES_COLOR_SOURCE_MACHINE_DARK2,      /* --- */
      BT_UI_RES_COLOR_PROCESSOR_MACHINE_BASE,    /* machine view normal */
      BT_UI_RES_COLOR_PROCESSOR_MACHINE_BRIGHT1, /* list view odd */
      BT_UI_RES_COLOR_PROCESSOR_MACHINE_BRIGHT2, /* list view even */
      BT_UI_RES_COLOR_PROCESSOR_MACHINE_DARK1,   /* machine title */
      BT_UI_RES_COLOR_PROCESSOR_MACHINE_DARK2,   /* --- */
      BT_UI_RES_COLOR_SINK_MACHINE_BASE,         /* machine view normal */
      BT_UI_RES_COLOR_SINK_MACHINE_BRIGHT1,      /* list view odd */
      BT_UI_RES_COLOR_SINK_MACHINE_BRIGHT2,      /* list view even */
      BT_UI_RES_COLOR_SINK_MACHINE_DARK1,        /* --- */
      BT_UI_RES_COLOR_SINK_MACHINE_DARK2,        /* --- */
      BT_UI_RES_COLOR_ANALYZER_PEAK,             /* analyzer widnow peak marks */
      BT_UI_RES_COLOR_GRID_LINES,                /* grid lines */
      BT_UI_RES_COLOR_COUNT
    } BtUIResourcesColors;

Symbolic color names for the UI.

### enum BtUIResourcesMachineColors

    typedef enum {
      BT_UI_RES_COLOR_MACHINE_BASE=0,     /* machine view normal */
      BT_UI_RES_COLOR_MACHINE_BRIGHT1,    /* list view odd */
      BT_UI_RES_COLOR_MACHINE_BRIGHT2,    /* list view even */
      BT_UI_RES_COLOR_MACHINE_DARK1,      /* --- */
      BT_UI_RES_COLOR_MACHINE_DARK2       /* --- */
    } BtUIResourcesMachineColors;

Symbolic color names for machines.

### bt_ui_resources_new ()

    BtUIResources *     bt_ui_resources_new                 (void);

Create a new instance

Returns : | the new instance or `NULL` in case of an error

### bt_ui_resources_get_icon_pixbuf_by_machine ()

    GdkPixbuf *         bt_ui_resources_get_icon_pixbuf_by_machine
                                                            (const BtMachine *machine);

Gets a GdkPixbuf image that matches the given machine type for use in menus.

`machine` : | the machine to get the image for
Returns : | a GdkPixbuf image

### bt_ui_resources_get_machine_graphics_pixbuf_by_machine ()

    GdkPixbuf *         bt_ui_resources_get_machine_graphics_pixbuf_by_machine
                                                            (const BtMachine *machine,
                                                             gdouble zoom);

Gets a GdkPixbuf image that matches the given machine type for use on the canvas.

`machine` : | the machine to get the image for
`zoom` : | scaling factor for the icons
Returns : | a GdkPixbuf image

### bt_ui_resources_get_icon_image_by_machine ()

    GtkWidget *         bt_ui_resources_get_icon_image_by_machine
                                                            (const BtMachine *machine);

Gets a GtkImage that matches the given machine type.

`machine` : | the machine to get the image for
Returns : | a GtkImage widget

### bt_ui_resources_get_icon_image_by_machine_type ()

    GtkWidget *         bt_ui_resources_get_icon_image_by_machine_type
                                                            (GType machine_type);

Gets a GtkImage that matches the given machine type.

`machine_type` : | the machine_type to get the image for
Returns : | a GtkImage widget

### bt_ui_resources_get_gdk_color ()

    GdkColor *          bt_ui_resources_get_gdk_color       (BtUIResourcesColors color_type);

Gets a prealocated color by id.

`color_type` : | the color id
Returns : | the requested GdkColor.

### bt_ui_resources_get_color_by_machine ()

    guint32             bt_ui_resources_get_color_by_machine
                                                            (const BtMachine *machine,
                                                             BtUIResourcesMachineColors color_type);

Gets a colors shade depending on machine type in rgba format.

`machine` : | the machine to get the color for
`color_type` : | a color shade
Returns : | a color depending on machine class and color_type

### bt_ui_resources_get_accel_group ()

    GtkAccelGroup *     bt_ui_resources_get_accel_group     (void);

All windows share one accelerator map.

Returns : | the shared keyboard accelerator map