Miscellaneous Types

## Miscellaneous Types Miscellaneous Types — Miscellaneous types used in Libeek |

## Synopsis

    #define             EEK_INVALID_KEYCODE
    struct              EekBounds;
    struct              EekColor;
                        EekContainer;
                        EekElement;
    enum                EekGradientType;
                        EekKey;
                        EekKeyboard;
                        EekKeysym;
    enum                EekModifierBehavior;
    enum                EekModifierType;
    enum                EekOrientation;
    struct              EekOutline;
    struct              EekPoint;
                        EekSection;
                        EekSymbol;
                        EekSymbolMatrix;
                        EekText;
                        EekTheme;
                        EekThemeContext;
                        EekThemeNode;
    #define             I_                                  (string)
    EekBounds *         eek_bounds_copy                     (const EekBounds *bounds);
    void                eek_bounds_free                     (EekBounds *bounds);
    gdouble             eek_bounds_long_side                (EekBounds *bounds);
    EekColor *          eek_color_copy                      (const EekColor *color);
    void                eek_color_free                      (EekColor *color);
    EekColor *          eek_color_new                       (gdouble red,
                                                             gdouble green,
                                                             gdouble blue,
                                                             gdouble alpha);
    EekOutline *        eek_outline_copy                    (const EekOutline *outline);
    void                eek_outline_free                    (EekOutline *outline);
    EekPoint *          eek_point_copy                      (const EekPoint *point);
    void                eek_point_free                      (EekPoint *point);
    void                eek_point_rotate                    (EekPoint *point,
                                                             gint angle);

## Object Hierarchy

      GBoxed
       +----EekBounds

      GBoxed
       +----EekColor

      GObject
       +----EekElement
             +----EekContainer
                   +----EekKeyboard
                   +----EekSection

      GObject
       +----EekElement
             +----EekContainer
             +----EekKey

      GObject
       +----EekElement
             +----EekKey

      GObject
       +----EekElement
             +----EekContainer
                   +----EekKeyboard

      GObject
       +----EekSymbol
             +----EekKeysym

      GBoxed
       +----EekOutline

      GBoxed
       +----EekPoint

      GObject
       +----EekElement
             +----EekContainer
                   +----EekSection

      GObject
       +----EekSymbol
             +----EekKeysym
             +----EekText

      GBoxed
       +----EekSymbolMatrix

      GObject
       +----EekSymbol
             +----EekText

      GObject
       +----EekThemeContext

## Implemented Interfaces

EekKeysym implements EekSerializable.

EekSymbol implements EekSerializable.

EekText implements EekSerializable.

## Properties

      "bounds"                   EekBounds*            : Read / Write
      "group"                    gint                  : Read / Write
      "level"                    gint                  : Read / Write
      "name"                     gchar*                : Read / Write
      "column"                   gint                  : Read / Write
      "keycode"                  guint                 : Read / Write
      "oref"                     gulong                : Read / Write
      "row"                      gint                  : Read / Write
      "symbol-matrix"            EekSymbolMatrix*      : Read / Write
      "layout"                   EekLayout*            : Read / Write / Construct Only
      "modifier-behavior"        EekModifierBehavior   : Read / Write
      "angle"                    gint                  : Read / Write
      "category"                 EekSymbolCategory     : Read / Write / Construct
      "icon-name"                gchar*                : Read / Write / Construct
      "label"                    gchar*                : Read / Write / Construct
      "modifier-mask"            EekModifierType       : Read / Write / Construct
      "name"                     gchar*                : Read / Write / Construct
      "tooltip"                  gchar*                : Read / Write / Construct
      "text"                     gchar*                : Read / Write / Construct Only

## Signals

      "child-added"                                    : Run First
      "child-removed"                                  : Run First
      "symbol-index-changed"                           : Run Last
      "cancelled"                                      : Run Last
      "locked"                                         : Run First
      "pressed"                                        : Run First
      "released"                                       : Run Last
      "unlocked"                                       : Run Last
      "key-cancelled"                                  : Run Last
      "key-locked"                                     : Run Last
      "key-pressed"                                    : Run Last
      "key-released"                                   : Run Last
      "key-unlocked"                                   : Run Last
      "key-cancelled"                                  : Run Last
      "key-locked"                                     : Run Last
      "key-pressed"                                    : Run Last
      "key-released"                                   : Run Last
      "key-unlocked"                                   : Run Last
      "changed"                                        : Run Last

## Description

## Details

### EEK_INVALID_KEYCODE

    #define EEK_INVALID_KEYCODE (0)

Pseudo keycode used for error reporting.

### struct EekBounds

    struct EekBounds {
        gdouble x;
        gdouble y;
        gdouble width;
        gdouble height;
    };

The rectangle containing an element's bounding box.

gdouble `x`; | X coordinate of the top left point
gdouble `y`; | Y coordinate of the top left point
gdouble `width`; | width of the box
gdouble `height`; | height of the box

### struct EekColor

    struct EekColor {
        gdouble red;
        gdouble green;
        gdouble blue;
        gdouble alpha;
    };

Color used for drawing.

gdouble `red`; | red component of color, between 0.0 and 1.0
gdouble `green`; | green component of color, between 0.0 and 1.0
gdouble `blue`; | blue component of color, between 0.0 and 1.0
gdouble `alpha`; | alpha component of color, between 0.0 and 1.0

### EekContainer

    typedef struct _EekContainer EekContainer;

### EekElement

    typedef struct _EekElement EekElement;

### enum EekGradientType

    typedef enum {
      EEK_GRADIENT_NONE,
      EEK_GRADIENT_VERTICAL,
      EEK_GRADIENT_HORIZONTAL,
      EEK_GRADIENT_RADIAL
    } EekGradientType;

### EekKey

    typedef struct _EekKey EekKey;

The EekKey structure contains only private data and should only be accessed using the provided API.

### EekKeyboard

    typedef struct _EekKeyboard EekKeyboard;

The EekKeyboard structure contains only private data and should only be accessed using the provided API.

### EekKeysym

    typedef struct _EekKeysym EekKeysym;

The EekKeysym structure contains only private data and should only be accessed using the provided API.

### enum EekModifierBehavior

    typedef enum {
        EEK_MODIFIER_BEHAVIOR_NONE,
        EEK_MODIFIER_BEHAVIOR_LOCK,
        EEK_MODIFIER_BEHAVIOR_LATCH
    } EekModifierBehavior;

Modifier handling mode.

`EEK_MODIFIER_BEHAVIOR_NONE` | do nothing when a modifier key is pressed
`EEK_MODIFIER_BEHAVIOR_LOCK` | toggle the modifier status each time a modifier key are pressed
`EEK_MODIFIER_BEHAVIOR_LATCH` | enable the modifier when a modifier key is pressed and keep it enabled until any key is pressed.

### enum EekModifierType

    typedef enum {
      EEK_SHIFT_MASK    = 1 << 0,
      EEK_LOCK_MASK	    = 1 << 1,
      EEK_CONTROL_MASK  = 1 << 2,
      EEK_MOD1_MASK	    = 1 << 3,
      EEK_MOD2_MASK	    = 1 << 4,
      EEK_MOD3_MASK	    = 1 << 5,
      EEK_MOD4_MASK	    = 1 << 6,
      EEK_MOD5_MASK	    = 1 << 7,
      EEK_BUTTON1_MASK  = 1 << 8,
      EEK_BUTTON2_MASK  = 1 << 9,
      EEK_BUTTON3_MASK  = 1 << 10,
      EEK_BUTTON4_MASK  = 1 << 11,
      EEK_BUTTON5_MASK  = 1 << 12,

      /* The next few modifiers are used by XKB, so we skip to the end.
       * Bits 15 - 25 are currently unused. Bit 29 is used internally.
       */

      EEK_SUPER_MASK    = 1 << 26,
      EEK_HYPER_MASK    = 1 << 27,
      EEK_META_MASK     = 1 << 28,

      EEK_RELEASE_MASK  = 1 << 30,

      EEK_MODIFIER_MASK = 0x5c001fff
    } EekModifierType;

`EEK_SHIFT_MASK` | the Shift key.
`EEK_LOCK_MASK` | a Lock key (depending on the modifier mapping of the X server this may either be CapsLock or ShiftLock).
`EEK_CONTROL_MASK` | the Control key.
`EEK_MOD1_MASK` | the fourth modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier, but normally it is the Alt key).
`EEK_MOD2_MASK` | the fifth modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier).
`EEK_MOD3_MASK` | the sixth modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier).
`EEK_MOD4_MASK` | the seventh modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier).
`EEK_MOD5_MASK` | the eighth modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier).
`EEK_BUTTON1_MASK` | the first mouse button.
`EEK_BUTTON2_MASK` | the second mouse button.
`EEK_BUTTON3_MASK` | the third mouse button.
`EEK_BUTTON4_MASK` | the fourth mouse button.
`EEK_BUTTON5_MASK` | the fifth mouse button.
`EEK_SUPER_MASK` | the Super modifier. Since 2.10
`EEK_HYPER_MASK` | the Hyper modifier. Since 2.10
`EEK_META_MASK` | the Meta modifier. Since 2.10
`EEK_RELEASE_MASK` | not used in EEK itself. GTK+ uses it to differentiate between (keyval, modifiers) pairs from key press and release events.
`EEK_MODIFIER_MASK` | a mask covering all modifier types.

### enum EekOrientation

    typedef enum {
        EEK_ORIENTATION_VERTICAL,
        EEK_ORIENTATION_HORIZONTAL,
        EEK_ORIENTATION_INVALID = -1
    } EekOrientation;

Orientation of rows in sections. Elements in a row will be arranged with the specified orientation.

`EEK_ORIENTATION_VERTICAL` | the elements will be arranged vertically
`EEK_ORIENTATION_HORIZONTAL` | the elements will be arranged horizontally
`EEK_ORIENTATION_INVALID` | used for error reporting

### struct EekOutline

    struct EekOutline {
        gdouble corner_radius;
        EekPoint *points;
        gint num_points;
    };

2D rounded polygon used to draw key shape

gdouble `corner_radius`; | radius of corners of rounded polygon
EekPoint *`points`; | an array of points represents a polygon
gint `num_points`; | the length of `points`

### struct EekPoint

    struct EekPoint {
        gdouble x;
        gdouble y;
    };

2D vertex

gdouble `x`; | X coordinate of the point
gdouble `y`; | Y coordinate of the point

### EekSection

    typedef struct _EekSection EekSection;

The EekSection structure contains only private data and should only be accessed using the provided API.

### EekSymbol

    typedef struct _EekSymbol EekSymbol;

The EekSymbol structure contains only private data and should only be accessed using the provided API.

### EekSymbolMatrix

    typedef struct {
        gint num_groups;
        gint num_levels;
        EekSymbol **data;
    } EekSymbolMatrix;

Symbol matrix of a key.

gint `num_groups`; | the number of groups (rows)
gint `num_levels`; | the number of levels (columns)
EekSymbol **`data`; | array of symbols

### EekText

    typedef struct _EekText EekText;

The EekText structure contains only private data and should only be accessed using the provided API.

### EekTheme

    typedef struct _EekTheme EekTheme;

### EekThemeContext

    typedef struct _EekThemeContext EekThemeContext;

### EekThemeNode

    typedef struct _EekThemeNode EekThemeNode;

### I_()

    #define I_(string) g_intern_static_string (string)

### eek_bounds_copy ()

    EekBounds *         eek_bounds_copy                     (const EekBounds *bounds);

### eek_bounds_free ()

    void                eek_bounds_free                     (EekBounds *bounds);

### eek_bounds_long_side ()

    gdouble             eek_bounds_long_side                (EekBounds *bounds);

### eek_color_copy ()

    EekColor *          eek_color_copy                      (const EekColor *color);

### eek_color_free ()

    void                eek_color_free                      (EekColor *color);

### eek_color_new ()

    EekColor *          eek_color_new                       (gdouble red,
                                                             gdouble green,
                                                             gdouble blue,
                                                             gdouble alpha);

### eek_outline_copy ()

    EekOutline *        eek_outline_copy                    (const EekOutline *outline);

### eek_outline_free ()

    void                eek_outline_free                    (EekOutline *outline);

### eek_point_copy ()

    EekPoint *          eek_point_copy                      (const EekPoint *point);

### eek_point_free ()

    void                eek_point_free                      (EekPoint *point);

### eek_point_rotate ()

    void                eek_point_rotate                    (EekPoint *point,
                                                             gint angle);

## Property Details

### The `"bounds"` property

      "bounds"                   EekBounds*            : Read / Write

The bounding box of EekElement.

### The `"group"` property

      "group"                    gint                  : Read / Write

The group value of the symbol index of EekElement.

Allowed values: >= G_MAXULONG

Default value: -1

### The `"level"` property

      "level"                    gint                  : Read / Write

The level value of the symbol index of EekElement.

Allowed values: >= G_MAXULONG

Default value: -1

### The `"name"` property

      "name"                     gchar*                : Read / Write

The name of EekElement.

Default value: NULL

### The `"column"` property

      "column"                   gint                  : Read / Write

The column index of EekKey in the parent EekSection.

Allowed values: >= G_MAXULONG

Default value: -1

### The `"keycode"` property

      "keycode"                  guint                 : Read / Write

The keycode of EekKey.

Default value: 0

### The `"oref"` property

      "oref"                     gulong                : Read / Write

The outline id of EekKey.

### The `"row"` property

      "row"                      gint                  : Read / Write

The row index of EekKey in the parent EekSection.

Allowed values: >= G_MAXULONG

Default value: -1

### The `"symbol-matrix"` property

      "symbol-matrix"            EekSymbolMatrix*      : Read / Write

The symbol matrix of EekKey.

### The `"layout"` property

      "layout"                   EekLayout*            : Read / Write / Construct Only

The layout used to create this EekKeyboard.

### The `"modifier-behavior"` property

      "modifier-behavior"        EekModifierBehavior   : Read / Write

The modifier handling mode of EekKeyboard.

Default value: EEK_MODIFIER_BEHAVIOR_NONE

### The `"angle"` property

      "angle"                    gint                  : Read / Write

The rotation angle of EekSection.

Allowed values: [-360,360]

Default value: 0

### The `"category"` property

      "category"                 EekSymbolCategory     : Read / Write / Construct

Category of the symbol.

Default value: EEK_SYMBOL_CATEGORY_UNKNOWN

### The `"icon-name"` property

      "icon-name"                gchar*                : Read / Write / Construct

Icon name used to render the symbol.

Default value: NULL

### The `"label"` property

      "label"                    gchar*                : Read / Write / Construct

Text used to display the symbol.

Default value: NULL

### The `"modifier-mask"` property

      "modifier-mask"            EekModifierType       : Read / Write / Construct

Modifier mask of the symbol.

### The `"name"` property

      "name"                     gchar*                : Read / Write / Construct

Canonical name of the symbol.

Default value: NULL

### The `"tooltip"` property

      "tooltip"                  gchar*                : Read / Write / Construct

Tooltip text.

Default value: NULL

### The `"text"` property

      "text"                     gchar*                : Read / Write / Construct Only

Text.

Default value: NULL

## Signal Details

### The `"child-added"` signal

    void                user_function                      (EekContainer *container,
                                                            EekElement   *element,
                                                            gpointer      user_data)      : Run First

The ::child-added signal is emitted each time an element is added to `container`.

`container` : | an EekContainer
`element` : | an EekElement
`user_data` : | user data set when the signal handler was connected.

### The `"child-removed"` signal

    void                user_function                      (EekContainer *container,
                                                            EekElement   *element,
                                                            gpointer      user_data)      : Run First

The ::child-removed signal is emitted each time an element is removed from `container`.

`container` : | an EekContainer
`element` : | an EekElement
`user_data` : | user data set when the signal handler was connected.

### The `"symbol-index-changed"` signal

    void                user_function                      (EekElement *element,
                                                            gint        group,
                                                            gint        level,
                                                            gpointer    user_data)      : Run Last

The ::symbol-index-changed signal is emitted each time the global configuration of group/level index changes.

`element` : | an EekElement
`group` : | row index of the symbol matrix of keys on `element`
`level` : | column index of the symbol matrix of keys on `element`
`user_data` : | user data set when the signal handler was connected.

### The `"cancelled"` signal

    void                user_function                      (EekKey  *key,
                                                            gpointer user_data)      : Run Last

The ::cancelled signal is emitted each time `key` is shifted to the cancelled state.

`key` : | an EekKey
`user_data` : | user data set when the signal handler was connected.

### The `"locked"` signal

    void                user_function                      (EekKey  *key,
                                                            gpointer user_data)      : Run First

The ::locked signal is emitted each time `key` is shifted to the locked state. The class handler runs before signal handlers to allow signal handlers to read the status of `key` with `eek_key_is_locked()`.

`key` : | an EekKey
`user_data` : | user data set when the signal handler was connected.

### The `"pressed"` signal

    void                user_function                      (EekKey  *key,
                                                            gpointer user_data)      : Run First

The ::pressed signal is emitted each time `key` is shifted to the pressed state. The class handler runs before signal handlers to allow signal handlers to read the status of `key` with `eek_key_is_pressed()`.

`key` : | an EekKey
`user_data` : | user data set when the signal handler was connected.

### The `"released"` signal

    void                user_function                      (EekKey  *key,
                                                            gpointer user_data)      : Run Last

The ::released signal is emitted each time `key` is shifted to the released state.

`key` : | an EekKey
`user_data` : | user data set when the signal handler was connected.

### The `"unlocked"` signal

    void                user_function                      (EekKey  *key,
                                                            gpointer user_data)      : Run Last

The ::unlocked signal is emitted each time `key` is shifted to the unlocked state.

`key` : | an EekKey
`user_data` : | user data set when the signal handler was connected.

### The `"key-cancelled"` signal

    void                user_function                      (EekKeyboard *keyboard,
                                                            EekKey      *key,
                                                            gpointer     user_data)      : Run Last

The ::key-cancelled signal is emitted each time a key in `keyboard` is shifted to the cancelled state.

`keyboard` : | an EekKeyboard
`key` : | an EekKey
`user_data` : | user data set when the signal handler was connected.

### The `"key-locked"` signal

    void                user_function                      (EekKeyboard *keyboard,
                                                            EekKey      *key,
                                                            gpointer     user_data)      : Run Last

The ::key-locked signal is emitted each time a key in `keyboard` is shifted to the locked state.

`keyboard` : | an EekKeyboard
`key` : | an EekKey
`user_data` : | user data set when the signal handler was connected.

### The `"key-pressed"` signal

    void                user_function                      (EekKeyboard *keyboard,
                                                            EekKey      *key,
                                                            gpointer     user_data)      : Run Last

The ::key-pressed signal is emitted each time a key in `keyboard` is shifted to the pressed state.

`keyboard` : | an EekKeyboard
`key` : | an EekKey
`user_data` : | user data set when the signal handler was connected.

### The `"key-released"` signal

    void                user_function                      (EekKeyboard *keyboard,
                                                            EekKey      *key,
                                                            gpointer     user_data)      : Run Last

The ::key-released signal is emitted each time a key in `keyboard` is shifted to the released state.

`keyboard` : | an EekKeyboard
`key` : | an EekKey
`user_data` : | user data set when the signal handler was connected.

### The `"key-unlocked"` signal

    void                user_function                      (EekKeyboard *keyboard,
                                                            EekKey      *key,
                                                            gpointer     user_data)      : Run Last

The ::key-unlocked signal is emitted each time a key in `keyboard` is shifted to the unlocked state.

`keyboard` : | an EekKeyboard
`key` : | an EekKey
`user_data` : | user data set when the signal handler was connected.

### The `"key-cancelled"` signal

    void                user_function                      (EekSection *section,
                                                            EekKey     *key,
                                                            gpointer    user_data)      : Run Last

The ::key-cancelled signal is emitted each time a key in `section` is shifted to the cancelled state.

`section` : | an EekSection
`key` : | an EekKey
`user_data` : | user data set when the signal handler was connected.

### The `"key-locked"` signal

    void                user_function                      (EekSection *section,
                                                            EekKey     *key,
                                                            gpointer    user_data)      : Run Last

The ::key-locked signal is emitted each time a key in `section` is shifted to the locked state.

`section` : | an EekSection
`key` : | an EekKey
`user_data` : | user data set when the signal handler was connected.

### The `"key-pressed"` signal

    void                user_function                      (EekSection *section,
                                                            EekKey     *key,
                                                            gpointer    user_data)      : Run Last

The ::key-pressed signal is emitted each time a key in `section` is shifted to the pressed state.

`section` : | an EekSection
`key` : | an EekKey
`user_data` : | user data set when the signal handler was connected.

### The `"key-released"` signal

    void                user_function                      (EekSection *section,
                                                            EekKey     *key,
                                                            gpointer    user_data)      : Run Last

The ::key-released signal is emitted each time a key in `section` is shifted to the released state.

`section` : | an EekSection
`key` : | an EekKey
`user_data` : | user data set when the signal handler was connected.

### The `"key-unlocked"` signal

    void                user_function                      (EekSection *section,
                                                            EekKey     *key,
                                                            gpointer    user_data)      : Run Last

The ::key-unlocked signal is emitted each time a key in `section` is shifted to the unlocked state.

`section` : | an EekSection
`key` : | an EekKey
`user_data` : | user data set when the signal handler was connected.

### The `"changed"` signal

    void                user_function                      (EekThemeContext *eekthemecontext,
                                                            gpointer         user_data)            : Run Last