Miscellaneous Types

Miscellaneous Types — Miscellaneous types used in Libeek

Synopsis

#define             I_                                  (string)
#define             EEK_TYPE_POINT
#define             EEK_TYPE_BOUNDS
#define             EEK_TYPE_OUTLINE
#define             EEK_TYPE_COLOR
enum                EekOrientation;
enum                EekModifierBehavior;
enum                EekModifierType;
#define             EEK_INVALID_KEYCODE
struct              EekPoint;
GType               eek_point_get_type                  (void);
EekPoint *          eek_point_copy                      (const EekPoint *point);
void                eek_point_free                      (EekPoint *point);
void                eek_point_rotate                    (EekPoint *point,
                                                         gint angle);
struct              EekBounds;
GType               eek_bounds_get_type                 (void);
EekBounds *         eek_bounds_copy                     (const EekBounds *bounds);
void                eek_bounds_free                     (EekBounds *bounds);
gdouble             eek_bounds_long_side                (EekBounds *bounds);
struct              EekOutline;
GType               eek_outline_get_type                (void);
EekOutline *        eek_outline_copy                    (const EekOutline *outline);
void                eek_outline_free                    (EekOutline *outline);
struct              EekColor;
GType               eek_color_get_type                  (void);
EekColor *          eek_color_new                       (gdouble red,
                                                         gdouble green,
                                                         gdouble blue,
                                                         gdouble alpha);
EekColor *          eek_color_copy                      (const EekColor *color);
void                eek_color_free                      (EekColor *color);
enum                EekGradientType;

Object Hierarchy

  GBoxed
   +----EekPoint
  GBoxed
   +----EekBounds
  GBoxed
   +----EekOutline
  GBoxed
   +----EekColor

Description

Details

I_()

#define I_(string) g_intern_static_string (string)

EEK_TYPE_POINT

#define EEK_TYPE_POINT (eek_point_get_type ())

EEK_TYPE_BOUNDS

#define EEK_TYPE_BOUNDS (eek_bounds_get_type ())

EEK_TYPE_OUTLINE

#define EEK_TYPE_OUTLINE (eek_outline_get_type ())

EEK_TYPE_COLOR

#define EEK_TYPE_COLOR (eek_color_get_type ())

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

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.

EEK_INVALID_KEYCODE

#define EEK_INVALID_KEYCODE (0)

Pseudo keycode used for error reporting.


struct EekPoint

struct EekPoint {
    gdouble x;
    gdouble y;
};

2D vertex

gdouble x;

X coordinate of the point

gdouble y;

Y coordinate of the point

eek_point_get_type ()

GType               eek_point_get_type                  (void);

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);

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

eek_bounds_get_type ()

GType               eek_bounds_get_type                 (void);

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);

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

eek_outline_get_type ()

GType               eek_outline_get_type                (void);

eek_outline_copy ()

EekOutline *        eek_outline_copy                    (const EekOutline *outline);

eek_outline_free ()

void                eek_outline_free                    (EekOutline *outline);

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

eek_color_get_type ()

GType               eek_color_get_type                  (void);

eek_color_new ()

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

eek_color_copy ()

EekColor *          eek_color_copy                      (const EekColor *color);

eek_color_free ()

void                eek_color_free                      (EekColor *color);

enum EekGradientType

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