## BtUIResources

BtUIResources — common shared ui resources like icons and colors

## Functions

BtUIResources * | bt_ui_resources_new ()
GdkPixbuf * | bt_ui_resources_get_icon_pixbuf_by_machine ()
GdkPixbuf * | bt_ui_resources_get_machine_graphics_pixbuf_by_machine ()
GdkPixbuf * | bt_ui_resources_get_wire_graphics_pixbuf_by_wire ()
GtkWidget * | bt_ui_resources_get_icon_image_by_machine ()
GtkWidget * | bt_ui_resources_get_icon_image_by_machine_type ()
GtkAccelGroup * | bt_ui_resources_get_accel_group ()

## Types and Values

struct | BtUIResources
enum | BtUIResourcesMachineColors

## Object Hierarchy

        GObject
        ╰── BtUIResources

## Includes

    #include "bt-edit.h"

## Description

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

## Functions

### bt_ui_resources_new ()

    BtUIResources *
    bt_ui_resources_new (void);

Create a new instance on first call and return a reference later on.

#### Returns

the new signleton instance

### 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.

#### Parameters

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.

#### Parameters

machine | the machine to get the image for |
zoom | scaling factor for the icons |

#### Returns

a GdkPixbuf image

### bt_ui_resources_get_wire_graphics_pixbuf_by_wire ()

    GdkPixbuf *
    bt_ui_resources_get_wire_graphics_pixbuf_by_wire
                                   (const BtWire *wire,
                                    gdouble zoom);

Gets a GdkPixbuf image for use on the canvas.

#### Parameters

wire | the wire 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.

#### Parameters

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.

#### Parameters

machine_type | the machine_type to get the image for |

#### Returns

a GtkImage widget

### 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

## Types and Values

### struct BtUIResources

    struct BtUIResources;

a collection of shared ui resources

### enum BtUIResourcesMachineColors

Symbolic color names for machines.

#### Members

BT_UI_RES_COLOR_MACHINE_BASE | base color |
BT_UI_RES_COLOR_MACHINE_BRIGHT1 | lighter variant |
BT_UI_RES_COLOR_MACHINE_BRIGHT2 | even lighter variant |
BT_UI_RES_COLOR_MACHINE_DARK1 | darker variant |
BT_UI_RES_COLOR_MACHINE_DARK2 | even darker variant |