]> git.sesse.net Git - vlc/blobdiff - src/config/keys.c
Change the "intf-show" variable into a toggle.
[vlc] / src / config / keys.c
index fc6115616a77f5cc45143fff8d3ea58325d0bbad..b07215ccbe65c36a584bf2832d64a87ca8416598 100644 (file)
@@ -35,7 +35,9 @@
 
 #include <stdlib.h>
 #include <limits.h>
-#include <search.h>
+#ifdef HAVE_SEARCH_H
+# include <search.h>
+#endif
 
 #include <vlc_common.h>
 #include <vlc_keys.h>
@@ -150,7 +152,6 @@ static char *utf8_cp (uint_fast32_t cp, char *buf)
  * Parse a human-readable string representation of a VLC key code.
  * @return a VLC key code, or KEY_UNSET on failure.
  */
-static
 uint_fast32_t vlc_str2keycode (const char *name)
 {
     uint_fast32_t mods = 0;
@@ -229,7 +230,7 @@ found:
 struct action
 {
     char name[MAXACTION];
-    vlc_key_t value;
+    vlc_action_t value;
 };
 
 static const struct action actions[] =
@@ -253,8 +254,8 @@ static const struct action actions[] =
     { "faster", ACTIONID_FASTER, },
     { "frame-next", ACTIONID_FRAME_NEXT, },
     { "incr-scalefactor", ACTIONID_SCALE_UP, },
-    { "intf-hide", ACTIONID_INTF_HIDE, },
-    { "intf-show", ACTIONID_INTF_SHOW, },
+    { "intf-boss", ACTIONID_INTF_BOSS, },
+    { "intf-show", ACTIONID_INTF_TOGGLE_FSC, },
     { "jump+extrashort", ACTIONID_JUMP_FORWARD_EXTRASHORT, },
     { "jump+long", ACTIONID_JUMP_FORWARD_LONG, },
     { "jump+medium", ACTIONID_JUMP_FORWARD_MEDIUM, },
@@ -340,8 +341,8 @@ static const struct action actions[] =
 
 struct mapping
 {
-    uint32_t  key; ///< Key code
-    vlc_key_t action; ///< Action ID
+    uint32_t     key; ///< Key code
+    vlc_action_t action; ///< Action ID
 };
 
 static int keycmp (const void *a, const void *b)
@@ -378,9 +379,14 @@ static int vlc_key_to_action (vlc_object_t *obj, const char *varname,
     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,
-                           const char *confname, vlc_key_t action)
+                           const char *confname, vlc_action_t action)
 {
     char *keys = var_InheritString (obj, confname);
     if (keys == NULL)
@@ -448,7 +454,6 @@ struct vlc_actions *vlc_InitActions (libvlc_int_t *libvlc)
         }
 #endif
         keys->psz_action = actions[i].name;
-        keys->i_action = actions[i].value;
         keys++;
 
         char name[12 + MAXACTION];
@@ -459,7 +464,6 @@ struct vlc_actions *vlc_InitActions (libvlc_int_t *libvlc)
     }
 
     keys->psz_action = NULL;
-    keys->i_action = 0;
 
     libvlc->p_hotkeys = as->keys;
     var_AddCallback (obj, "key-pressed", vlc_key_to_action, &as->map);
@@ -497,7 +501,7 @@ static int actcmp(const void *key, const void *ent)
  * Get the action ID from the action name in the configuration subsystem.
  * @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;