Commit 06164840 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Rename vlc_key_t to vlc_action_t

parent e68c3be2
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
VLC_EXPORT( char *, vlc_keycode2str, (uint_fast32_t i_key) ) LIBVLC_USED; VLC_EXPORT( char *, vlc_keycode2str, (uint_fast32_t i_key) ) LIBVLC_USED;
VLC_EXPORT( uint_fast32_t, vlc_str2keycode, (const char *str) ) LIBVLC_USED; VLC_EXPORT( uint_fast32_t, vlc_str2keycode, (const char *str) ) LIBVLC_USED;
typedef enum vlc_key { typedef enum vlc_action {
ACTIONID_NONE = 0, ACTIONID_NONE = 0,
ACTIONID_QUIT, ACTIONID_QUIT,
ACTIONID_PLAY_PAUSE, ACTIONID_PLAY_PAUSE,
...@@ -200,9 +200,9 @@ typedef enum vlc_key { ...@@ -200,9 +200,9 @@ typedef enum vlc_key {
ACTIONID_RATE_SLOWER_FINE, ACTIONID_RATE_SLOWER_FINE,
ACTIONID_RATE_FASTER_FINE, ACTIONID_RATE_FASTER_FINE,
} vlc_key_t; } vlc_action_t;
VLC_EXPORT( vlc_key_t, vlc_GetActionId, (const char *psz_key) ) LIBVLC_USED; VLC_EXPORT( vlc_action_t, vlc_GetActionId, (const char *psz_key) ) LIBVLC_USED;
struct hotkey struct hotkey
{ {
......
...@@ -304,7 +304,7 @@ LRESULT CALLBACK WMHOTKEYPROC( HWND hwnd, UINT uMsg, WPARAM wParam, ...@@ -304,7 +304,7 @@ LRESULT CALLBACK WMHOTKEYPROC( HWND hwnd, UINT uMsg, WPARAM wParam,
return 0; return 0;
/* search for key associated with VLC */ /* search for key associated with VLC */
vlc_key_t action = vlc_GetActionId( psz_atomName ); vlc_action_t action = vlc_GetActionId( psz_atomName );
if( action != ACTIONID_NONE ) if( action != ACTIONID_NONE )
{ {
var_SetInteger( p_intf->p_libvlc, var_SetInteger( p_intf->p_libvlc,
......
...@@ -186,7 +186,7 @@ static void Process( intf_thread_t *p_intf ) ...@@ -186,7 +186,7 @@ static void Process( intf_thread_t *p_intf )
{ {
if( !strncmp( "key-", c, 4 ) ) if( !strncmp( "key-", c, 4 ) )
{ {
vlc_key_t i_key = vlc_GetActionId( c ); vlc_action_t i_key = vlc_GetActionId( c );
if( i_key ) if( i_key )
var_SetInteger( p_intf->p_libvlc, "key-action", i_key ); var_SetInteger( p_intf->p_libvlc, "key-action", i_key );
else else
......
...@@ -237,7 +237,7 @@ static int vlclua_intf_should_die( lua_State *L ) ...@@ -237,7 +237,7 @@ static int vlclua_intf_should_die( lua_State *L )
static int vlclua_action_id( lua_State *L ) static int vlclua_action_id( lua_State *L )
{ {
vlc_key_t i_key = vlc_GetActionId( luaL_checkstring( L, 1 ) ); vlc_action_t i_key = vlc_GetActionId( luaL_checkstring( L, 1 ) );
if (i_key == 0) if (i_key == 0)
return 0; return 0;
lua_pushnumber( L, i_key ); lua_pushnumber( L, i_key );
......
...@@ -230,7 +230,7 @@ found: ...@@ -230,7 +230,7 @@ found:
struct action struct action
{ {
char name[MAXACTION]; char name[MAXACTION];
vlc_key_t value; vlc_action_t value;
}; };
static const struct action actions[] = static const struct action actions[] =
...@@ -341,8 +341,8 @@ static const struct action actions[] = ...@@ -341,8 +341,8 @@ static const struct action actions[] =
struct mapping struct mapping
{ {
uint32_t key; ///< Key code uint32_t key; ///< Key code
vlc_key_t action; ///< Action ID vlc_action_t action; ///< Action ID
}; };
static int keycmp (const void *a, const void *b) static int keycmp (const void *a, const void *b)
...@@ -379,9 +379,14 @@ static int vlc_key_to_action (vlc_object_t *obj, const char *varname, ...@@ -379,9 +379,14 @@ static int vlc_key_to_action (vlc_object_t *obj, const char *varname,
return var_SetInteger (obj, "key-action", (*pent)->action); return var_SetInteger (obj, "key-action", (*pent)->action);
} }
/**
* Sets up all key mappings for a given action.
* \param map tree (of struct mapping entries) to write mappings to
* \param confname VLC configuration item to read mappings from
* \param action action ID
*/
static void vlc_MapAction (vlc_object_t *obj, void **map, static void vlc_MapAction (vlc_object_t *obj, void **map,
const char *confname, vlc_key_t action) const char *confname, vlc_action_t action)
{ {
char *keys = var_InheritString (obj, confname); char *keys = var_InheritString (obj, confname);
if (keys == NULL) if (keys == NULL)
...@@ -496,7 +501,7 @@ static int actcmp(const void *key, const void *ent) ...@@ -496,7 +501,7 @@ static int actcmp(const void *key, const void *ent)
* Get the action ID from the action name in the configuration subsystem. * Get the action ID from the action name in the configuration subsystem.
* @return the action ID or ACTIONID_NONE on error. * @return the action ID or ACTIONID_NONE on error.
*/ */
vlc_key_t vlc_GetActionId(const char *name) vlc_action_t vlc_GetActionId (const char *name)
{ {
const struct action *act; const struct action *act;
......
...@@ -43,9 +43,9 @@ ...@@ -43,9 +43,9 @@
#include "media_player_internal.h" #include "media_player_internal.h"
/* /*
* mapping of libvlc_navigate_mode_t to vlc_key_t * mapping of libvlc_navigate_mode_t to vlc_action_t
*/ */
static const vlc_key_t libvlc_navigate_to_action[] = static const vlc_action_t libvlc_navigate_to_action[] =
{ {
ACTIONID_NAV_ACTIVATE, ACTIONID_NAV_ACTIVATE,
ACTIONID_NAV_UP, ACTIONID_NAV_UP,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment