This file defines functions and structures for hotkey handling in vlc. More...

Data Structures | |
| struct | key_descriptor_s |
| struct | action |
| struct | mapping |
| struct | vlc_actions |
Defines | |
| #define | KEYS_COUNT (sizeof(vlc_keys)/sizeof(vlc_keys[0])) |
| #define | MAXACTION 20 |
| #define | ACTIONS_COUNT (sizeof (actions) / sizeof (actions[0])) |
Typedefs | |
| typedef struct key_descriptor_s | key_descriptor_t |
Functions | |
| static int | keystrcmp (const void *key, const void *elem) |
| static char * | utf8_cp (uint_fast32_t cp, char *buf) |
| uint_fast32_t | vlc_str2keycode (const char *name) |
| Parse a human-readable string representation of a VLC key code. | |
| static char * | nooptext (const char *txt) |
| char * | vlc_keycode2str (uint_fast32_t code, bool locale) |
| Format a human-readable and unique representation of a VLC key code (including modifiers). | |
| static int | keycmp (const void *a, const void *b) |
| static int | vlc_key_to_action (vlc_object_t *obj, const char *varname, vlc_value_t prevkey, vlc_value_t curkey, void *d) |
| static void | vlc_MapAction (vlc_object_t *obj, void **map, const char *confname, vlc_action_t action) |
| Sets up all key mappings for a given action. | |
| struct vlc_actions * | vlc_InitActions (libvlc_int_t *libvlc) |
| Initializes the key map from configuration. | |
| void | vlc_DeinitActions (libvlc_int_t *libvlc, struct vlc_actions *as) |
| Destroys the key map. | |
| static int | actcmp (const void *key, const void *ent) |
| vlc_action_t | vlc_GetActionId (const char *name) |
| Get the action ID from the action name in the configuration subsystem. | |
Variables | |
| static struct key_descriptor_s | vlc_keys [] |
| static struct action | actions [] |
This file defines functions and structures for hotkey handling in vlc.
Referenced by vlc_GetActionId(), and vlc_InitActions().
Referenced by vlc_str2keycode().
| #define MAXACTION 20 |
| typedef struct key_descriptor_s key_descriptor_t |
| static int actcmp | ( | const void * | key, | |
| const void * | ent | |||
| ) | [static] |
References action::name.
Referenced by vlc_GetActionId().
| static int keycmp | ( | const void * | a, | |
| const void * | b | |||
| ) | [static] |
References mapping::key.
Referenced by vlc_key_to_action(), and vlc_MapAction().
| static int keystrcmp | ( | const void * | key, | |
| const void * | elem | |||
| ) | [static] |
Referenced by vlc_str2keycode().
| static char* nooptext | ( | const char * | txt | ) | [static] |
Referenced by vlc_keycode2str().
| static char* utf8_cp | ( | uint_fast32_t | cp, | |
| char * | buf | |||
| ) | [static] |
Referenced by vlc_keycode2str().
| void vlc_DeinitActions | ( | libvlc_int_t * | libvlc, | |
| struct vlc_actions * | as | |||
| ) |
Destroys the key map.
References vlc_actions::global_map, vlc_actions::map, libvlc_int_t::p_hotkeys, tdestroy(), unlikely, var_DelCallback, and vlc_key_to_action().
Referenced by libvlc_InternalCleanup().
| vlc_action_t vlc_GetActionId | ( | const char * | name | ) |
Get the action ID from the action name in the configuration subsystem.
References actcmp(), ACTIONS_COUNT, and action::value.
| struct vlc_actions* vlc_InitActions | ( | libvlc_int_t * | libvlc | ) | [read] |
Initializes the key map from configuration.
References ACTIONS_COUNT, vlc_actions::global_map, vlc_actions::keys, vlc_actions::map, msg_Err, action::name, name, libvlc_int_t::p_hotkeys, hotkey::psz_action, unlikely, action::value, var_AddCallback, var_Create, vlc_key_to_action(), vlc_MapAction(), VLC_OBJECT, and VLC_VAR_INTEGER.
Referenced by libvlc_InternalInit().
| static int vlc_key_to_action | ( | vlc_object_t * | obj, | |
| const char * | varname, | |||
| vlc_value_t | prevkey, | |||
| vlc_value_t | curkey, | |||
| void * | d | |||
| ) | [static] |
References vlc_value_t::i_int, keycmp(), tfind(), and var_SetInteger.
Referenced by vlc_DeinitActions(), and vlc_InitActions().
| char* vlc_keycode2str | ( | uint_fast32_t | code, | |
| bool | locale | |||
| ) |
Format a human-readable and unique representation of a VLC key code (including modifiers).
| code | key code to translate to a string | |
| locale | true to get a localized string, false to get a C string suitable for 'vlcrc' |
References asprintf(), key_descriptor_s::i_key_code, KEY_MODIFIER_ALT, KEY_MODIFIER_COMMAND, KEY_MODIFIER_CTRL, KEY_MODIFIER_META, KEY_MODIFIER_SHIFT, N_, name, nooptext(), key_descriptor_s::psz_key_string, utf8_cp(), and vlc_gettext().
| static void vlc_MapAction | ( | vlc_object_t * | obj, | |
| void ** | map, | |||
| const char * | confname, | |||
| vlc_action_t | action | |||
| ) | [static] |
Sets up all key mappings for a given action.
| map | tree (of struct mapping entries) to write mappings to | |
| confname | VLC configuration item to read mappings from | |
| action | action ID |
References mapping::action, code, mapping::key, KEY_UNSET, keycmp(), msg_Warn, strtok_r(), tsearch(), unlikely, var_InheritString, and vlc_str2keycode().
Referenced by vlc_InitActions().
| uint_fast32_t vlc_str2keycode | ( | const char * | name | ) |
Parse a human-readable string representation of a VLC key code.
References code, key_descriptor_s::i_key_code, KEY_UNSET, KEYS_COUNT, keystrcmp(), strncasecmp(), and vlc_towc().
Referenced by vlc_MapAction().
struct key_descriptor_s vlc_keys[] [static] |
1.7.1