BtUIResources

BtUIResources — common shared ui resources like icons and colors

Functions

Types and Values

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_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_gdk_color ()

GdkColor *
bt_ui_resources_get_gdk_color (BtUIResourcesColors color_type);

Gets a prealocated color by id.

Parameters

color_type

the color id

 

Returns

the requested GdkColor.


bt_ui_resources_get_rgb_color ()

void
bt_ui_resources_get_rgb_color (BtUIResourcesColors color_type,
                               gdouble *r,
                               gdouble *g,
                               gdouble *b);

Gets a prealocated color by id. Sets the given parts to values from 0.0 to 1.0.

Parameters

color_type

the color id

 

r

target for red color part

 

g

target for green color part

 

b

target for blue color part

 

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.

Parameters

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

Types and Values

struct BtUIResources

struct BtUIResources;

a collection of shared ui ressources


enum BtUIResourcesColors

Symbolic color names for the UI.

Members

BT_UI_RES_COLOR_CURSOR

cursor color

 

BT_UI_RES_COLOR_SELECTION1

selection color

 

BT_UI_RES_COLOR_SELECTION2

shaded selection color

 

BT_UI_RES_COLOR_PLAYLINE

playback line

 

BT_UI_RES_COLOR_LOOPLINE

loop line

 

BT_UI_RES_COLOR_ENDLINE

song end line

 

BT_UI_RES_COLOR_SOURCE_MACHINE_BASE

source machine base color

 

BT_UI_RES_COLOR_SOURCE_MACHINE_BRIGHT1

source machine lighter variant

 

BT_UI_RES_COLOR_SOURCE_MACHINE_BRIGHT2

source machine even lighter variant

 

BT_UI_RES_COLOR_SOURCE_MACHINE_DARK1

source machine darker variant

 

BT_UI_RES_COLOR_SOURCE_MACHINE_DARK2

source machine even darker variant

 

BT_UI_RES_COLOR_PROCESSOR_MACHINE_BASE

processor machine base color

 

BT_UI_RES_COLOR_PROCESSOR_MACHINE_BRIGHT1

processor machine lighter variant

 

BT_UI_RES_COLOR_PROCESSOR_MACHINE_BRIGHT2

processor machine even lighter variant

 

BT_UI_RES_COLOR_PROCESSOR_MACHINE_DARK1

processor machine darker variant

 

BT_UI_RES_COLOR_PROCESSOR_MACHINE_DARK2

processor machine even darker variant

 

BT_UI_RES_COLOR_SINK_MACHINE_BASE

sink machine base color

 

BT_UI_RES_COLOR_SINK_MACHINE_BRIGHT1

sink machine lighter variant

 

BT_UI_RES_COLOR_SINK_MACHINE_BRIGHT2

sink machine even lighter variant

 

BT_UI_RES_COLOR_SINK_MACHINE_DARK1

sink machine darker variant

 

BT_UI_RES_COLOR_SINK_MACHINE_DARK2

sink machine even darker variant

 

BT_UI_RES_COLOR_ANALYZER_PEAK

analyzer peak lines

 

BT_UI_RES_COLOR_GRID_LINES

grid lines

 

BT_UI_RES_COLOR_COUNT

symbolic color count

 

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