libgaminggear
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Data Structures | Typedefs | Enumerations | Functions | Variables
macro.h File Reference

Macros. More...

Data Structures

struct  _GaminggearMacroKeystroke
 
struct  _GaminggearMacroKeystrokes
 
struct  _GaminggearMacro
 

Typedefs

typedef struct _GaminggearMacro GaminggearMacro
 
typedef struct
_GaminggearMacroKeystroke 
GaminggearMacroKeystroke
 
typedef struct
_GaminggearMacroKeystrokes 
GaminggearMacroKeystrokes
 

Enumerations

enum  { GAMINGGEAR_MACRO_KEYSTROKES_NUM = 512, GAMINGGEAR_MACRO_KEYSTROKE_PERIOD_MAX = G_MAXUINT16 }
 
enum  GaminggearMacroKeystrokeKey { GAMINGGEAR_MACRO_KEYSTROKE_KEY_BUTTON_LEFT = 0xf0, GAMINGGEAR_MACRO_KEYSTROKE_KEY_BUTTON_RIGHT = 0xf1, GAMINGGEAR_MACRO_KEYSTROKE_KEY_BUTTON_MIDDLE = 0xf2 }
 
enum  GaminggearMacroKeystrokeAction { GAMINGGEAR_MACRO_KEYSTROKE_ACTION_PRESS = 0, GAMINGGEAR_MACRO_KEYSTROKE_ACTION_RELEASE = 1 }
 

Functions

struct _GaminggearMacroKeystroke __attribute__ ((packed))
 
static guint16 gaminggear_macro_keystroke_get_period (GaminggearMacroKeystroke const *keystroke)
 Get period from GaminggearMacroKeystroke. More...
 
static void gaminggear_macro_keystroke_set_period (GaminggearMacroKeystroke *keystroke, guint16 new_value)
 Set period of GaminggearMacroKeystroke. More...
 
static guint16 gaminggear_macro_keystrokes_get_count (GaminggearMacroKeystrokes const *keystrokes)
 Get count from GaminggearMacroKeystrokes. More...
 
static void gaminggear_macro_keystrokes_set_count (GaminggearMacroKeystrokes *keystrokes, guint16 new_value)
 Set count of GaminggearMacroKeystrokes. More...
 
void gaminggear_macro_keystrokes_init (GaminggearMacroKeystrokes *keystrokes)
 Reset keystrokes. More...
 
GaminggearMacroKeystrokesgaminggear_key_file_get_macro_keystrokes (GKeyFile *key_file, gchar const *macroset_name, gchar const *macro_name, GError **error)
 
gboolean gaminggear_macro_keystrokes_have_mouse_keystroke (GaminggearMacroKeystrokes const *keystrokes)
 Check if macro contains mouse events. More...
 
GaminggearMacroKeystrokesgaminggear_macro_keystrokes_new (void)
 
void gaminggear_macro_keystrokes_free (GaminggearMacroKeystrokes *keystrokes)
 
void gaminggear_macro_keystrokes_copy (GaminggearMacroKeystrokes const *from, GaminggearMacroKeystrokes *to)
 
GaminggearMacroKeystrokesgaminggear_macro_keystrokes_dup (GaminggearMacroKeystrokes const *old)
 
gboolean gaminggear_macro_keystrokes_add (GaminggearMacroKeystrokes *keystrokes, GaminggearMacroKeystroke const *keystroke)
 
void gaminggear_macro_set_macroset_name (GaminggearMacro *macro, gchar const *new_name)
 Sets macroset name. More...
 
void gaminggear_macro_set_macro_name (GaminggearMacro *macro, gchar const *new_name)
 Sets macro name. More...
 
gchar * gaminggear_macro_get_name_joined (GaminggearMacro const *macro)
 Get complete name in format macroset/macro. More...
 
GaminggearMacroKeystrokesgaminggear_macro_get_keystrokes (GaminggearMacro *macro)
 Get keystrokes of a macro. More...
 
gboolean gaminggear_macro_add_keystroke (GaminggearMacro *macro, GaminggearMacroKeystroke const *keystroke)
 Add keystroke to macro. More...
 
GaminggearMacrogaminggear_macro_new (gchar const *macroset_name, gchar const *macro_name, GaminggearMacroKeystrokes const *keystrokes)
 Creates new macro. More...
 
GaminggearMacrogaminggear_macro_dup (GaminggearMacro const *gaminggear_macro)
 Duplicates a GaminggearMacro. More...
 
gboolean gaminggear_macro_has_mouse_keystroke (GaminggearMacro const *gaminggear_macro)
 Test if GaminggearMacro contains mouse events. More...
 
void gaminggear_macro_free (GaminggearMacro *macro)
 Frees macro. More...
 
gboolean gaminggear_macros_store_macro (GaminggearMacro const *gaminggear_macro, GError **error)
 Stores macro in macros database. More...
 

Variables

typedef __attribute__
 
guint8 key
 
guint8 action
 
guint16 period
 
guint16 count
 
GaminggearMacroKeystroke keystrokes [GAMINGGEAR_MACRO_KEYSTROKES_NUM]
 
guint8 loop
 

Detailed Description

Macros.

Typedef Documentation

Enumeration Type Documentation

anonymous enum
Enumerator
GAMINGGEAR_MACRO_KEYSTROKES_NUM 
GAMINGGEAR_MACRO_KEYSTROKE_PERIOD_MAX 
Enumerator
GAMINGGEAR_MACRO_KEYSTROKE_ACTION_PRESS 
GAMINGGEAR_MACRO_KEYSTROKE_ACTION_RELEASE 
Enumerator
GAMINGGEAR_MACRO_KEYSTROKE_KEY_BUTTON_LEFT 
GAMINGGEAR_MACRO_KEYSTROKE_KEY_BUTTON_RIGHT 
GAMINGGEAR_MACRO_KEYSTROKE_KEY_BUTTON_MIDDLE 

Function Documentation

struct _GaminggearMacroKeystroke __attribute__ ( (packed)  )
GaminggearMacroKeystrokes* gaminggear_key_file_get_macro_keystrokes ( GKeyFile *  key_file,
gchar const *  macroset_name,
gchar const *  macro_name,
GError **  error 
)
Parameters
key_file
macroset_name
macro_name
error
Return values
keystrokes
Since
1.0
gboolean gaminggear_macro_add_keystroke ( GaminggearMacro macro,
GaminggearMacroKeystroke const *  keystroke 
)

Add keystroke to macro.

Parameters
macro
keystroke
Return values
booleanIf successful TRUE is returned. FALSE is returned if number of keystrokes is exceeded and keystroke was not added.
Since
1.0
GaminggearMacro* gaminggear_macro_dup ( GaminggearMacro const *  gaminggear_macro)

Duplicates a GaminggearMacro.

Parameters
gaminggear_macro
Return values
macroGaminggearMacro that has to be freed with gaminggear_macro_free().
Since
1.0
void gaminggear_macro_free ( GaminggearMacro macro)

Frees macro.

Frees the memory allocated for macro.

Parameters
macroA GaminggearMacro.
Since
1.0
GaminggearMacroKeystrokes* gaminggear_macro_get_keystrokes ( GaminggearMacro macro)

Get keystrokes of a macro.

Parameters
macro
Return values
keystrokesThe returned struct is part of macro and should not be freed alone.
Since
1.0
gchar* gaminggear_macro_get_name_joined ( GaminggearMacro const *  macro)

Get complete name in format macroset/macro.

Parameters
macro
Return values
stringThat has to be freed with g_free().
Since
1.0
gboolean gaminggear_macro_has_mouse_keystroke ( GaminggearMacro const *  gaminggear_macro)

Test if GaminggearMacro contains mouse events.

Parameters
gaminggear_macro
Return values
booleanTRUE if gaminggear_macro has mouse keystroke, FALSE else.
Since
1.0
static guint16 gaminggear_macro_keystroke_get_period ( GaminggearMacroKeystroke const *  keystroke)
inlinestatic

Get period from GaminggearMacroKeystroke.

Parameters
keystrokeA keystroke.
Return values
period
Since
1.0
static void gaminggear_macro_keystroke_set_period ( GaminggearMacroKeystroke keystroke,
guint16  new_value 
)
inlinestatic

Set period of GaminggearMacroKeystroke.

Parameters
keystrokeA keystroke.
new_value
Since
1.0
gboolean gaminggear_macro_keystrokes_add ( GaminggearMacroKeystrokes keystrokes,
GaminggearMacroKeystroke const *  keystroke 
)
Parameters
keystrokesKeystrokes.
keystrokeKeystroke.
Return values
booleanIf successful TRUE is returned. FALSE is returned if number of keystrokes is exceeded and keystroke was not added.
Since
1.0
void gaminggear_macro_keystrokes_copy ( GaminggearMacroKeystrokes const *  from,
GaminggearMacroKeystrokes to 
)
Parameters
from
to
Since
1.0
GaminggearMacroKeystrokes* gaminggear_macro_keystrokes_dup ( GaminggearMacroKeystrokes const *  old)
Parameters
old
Return values
keystrokesKeystrokes that have to be freed with gaminggear_macro_keystrokes_free().
Since
1.0
void gaminggear_macro_keystrokes_free ( GaminggearMacroKeystrokes keystrokes)
Parameters
keystrokesKeystrokes.
Since
1.0
static guint16 gaminggear_macro_keystrokes_get_count ( GaminggearMacroKeystrokes const *  keystrokes)
inlinestatic

Get count from GaminggearMacroKeystrokes.

Parameters
keystrokesKeystrokes.
Return values
count
Since
1.0
gboolean gaminggear_macro_keystrokes_have_mouse_keystroke ( GaminggearMacroKeystrokes const *  keystrokes)

Check if macro contains mouse events.

Parameters
keystrokesKeystrokes.
Return values
booleanTRUE if macro contains mouse events.
Since
1.0
void gaminggear_macro_keystrokes_init ( GaminggearMacroKeystrokes keystrokes)

Reset keystrokes.

Parameters
keystrokesKeystrokes.
Since
1.0
GaminggearMacroKeystrokes* gaminggear_macro_keystrokes_new ( void  )
Return values
keystrokesKeystrokes that have to be freed with gaminggear_macro_keystrokes_free().
Since
1.0
static void gaminggear_macro_keystrokes_set_count ( GaminggearMacroKeystrokes keystrokes,
guint16  new_value 
)
inlinestatic

Set count of GaminggearMacroKeystrokes.

Parameters
keystrokesKeystrokes.
new_value
Since
1.0
GaminggearMacro* gaminggear_macro_new ( gchar const *  macroset_name,
gchar const *  macro_name,
GaminggearMacroKeystrokes const *  keystrokes 
)

Creates new macro.

Keystrokes can be NULL. In this case an empty macro is created.

Parameters
macroset_name
macro_name
keystrokes
Return values
macroGaminggearMacro that has to be freed with gaminggear_macro_free().
Since
1.0
void gaminggear_macro_set_macro_name ( GaminggearMacro macro,
gchar const *  new_name 
)

Sets macro name.

Parameters
macro
new_name
Since
1.0
void gaminggear_macro_set_macroset_name ( GaminggearMacro macro,
gchar const *  new_name 
)

Sets macroset name.

Parameters
macro
new_name
Since
1.0
gboolean gaminggear_macros_store_macro ( GaminggearMacro const *  gaminggear_macro,
GError **  error 
)

Stores macro in macros database.

Used to store macros generated by macro live recording.

Parameters
gaminggear_macroThe GaminggearMacro to be stored.
errorReturn location for error or NULL.
Return values
booleanTRUE on success, FALSE on error with error set.
Since
1.0

Variable Documentation

struct _GaminggearMacro __attribute__
guint8 action
guint16 count

Stored little endian.

guint8 key
guint8 loop
guint16 period

Stored little endian.