VLC  4.0.0-dev
vlc_actions.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * vlc_actions.h: handle vlc actions
3  *****************************************************************************
4  * Copyright (C) 2003-2016 VLC authors and VideoLAN
5  *
6  * Authors: Sigmund Augdal Helberg <dnumgis@videolan.org>
7  *
8  * This program is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation; either version 2.1 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this program; if not, write to the Free Software Foundation,
20  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21  *****************************************************************************/
22 
23 #ifndef VLC_ACTIONS_H
24 #define VLC_ACTIONS_H 1
25 
26 # include <vlc_mouse.h>
27 
28 /* Called from src/libvlc.c */
29 int
31 
32 /* Called from src/libvlc.c */
33 void
35 
36 /**
37  * \file
38  * This file defines keys and functions
39  */
40 
41 #define KEY_MODIFIER 0xFF000000
42 #define KEY_MODIFIER_ALT 0x01000000
43 #define KEY_MODIFIER_SHIFT 0x02000000
44 #define KEY_MODIFIER_CTRL 0x04000000
45 #define KEY_MODIFIER_META 0x08000000
46 #define KEY_MODIFIER_COMMAND 0x10000000
47 
48 #define KEY_UNSET 0x00000000
49 #define KEY_BACKSPACE 0x08
50 #define KEY_TAB 0x09
51 #define KEY_ENTER 0x0D
52 #define KEY_ESC 0x1B
53 /* End of Unicode range: 0x0010FFFF */
54 #define KEY_LEFT 0x00210000
55 #define KEY_RIGHT 0x00220000
56 #define KEY_UP 0x00230000
57 #define KEY_DOWN 0x00240000
58 #define KEY_F1 0x00270000
59 #define KEY_F2 0x00280000
60 #define KEY_F3 0x00290000
61 #define KEY_F4 0x002A0000
62 #define KEY_F5 0x002B0000
63 #define KEY_F6 0x002C0000
64 #define KEY_F7 0x002D0000
65 #define KEY_F8 0x002E0000
66 #define KEY_F9 0x002F0000
67 #define KEY_F10 0x00300000
68 #define KEY_F11 0x00310000
69 #define KEY_F12 0x00320000
70 #define KEY_HOME 0x00330000
71 #define KEY_END 0x00340000
72 #define KEY_INSERT 0x00350000
73 #define KEY_DELETE 0x00360000
74 #define KEY_MENU 0x00370000
75 #define KEY_PAGEUP 0x00390000
76 #define KEY_PAGEDOWN 0x003A0000
77 #define KEY_PRINT 0x003B0000
78 #define KEY_PAUSE 0x003D0000
79 
80 #define KEY_BROWSER_BACK 0x003F0000
81 #define KEY_BROWSER_FORWARD 0x00400000
82 #define KEY_BROWSER_REFRESH 0x00410000
83 #define KEY_BROWSER_STOP 0x00420000
84 #define KEY_BROWSER_SEARCH 0x00430000
85 #define KEY_BROWSER_FAVORITES 0x00440000
86 #define KEY_BROWSER_HOME 0x00450000
87 #define KEY_VOLUME_MUTE 0x00460000
88 #define KEY_VOLUME_DOWN 0x00470000
89 #define KEY_VOLUME_UP 0x00480000
90 #define KEY_MEDIA_NEXT_TRACK 0x00490000
91 #define KEY_MEDIA_PREV_TRACK 0x004A0000
92 #define KEY_MEDIA_STOP 0x004B0000
93 #define KEY_MEDIA_PLAY_PAUSE 0x004C0000
94 #define KEY_MEDIA_RECORD 0x004D0000
95 #define KEY_MEDIA_REWIND 0x004E0000
96 #define KEY_MEDIA_FORWARD 0x004F0000
97 #define KEY_MEDIA_REPEAT 0x00500000
98 #define KEY_MEDIA_SHUFFLE 0x00510000
99 #define KEY_MEDIA_SUBTITLE 0x00520000
100 #define KEY_MEDIA_AUDIO 0x00530000
101 #define KEY_MEDIA_ANGLE 0x00540000
102 #define KEY_MEDIA_TIME 0x00550000
103 #define KEY_MEDIA_FRAME_PREV 0x00560000
104 #define KEY_MEDIA_FRAME_NEXT 0x00570000
105 #define KEY_MEDIA_SELECT 0x00580000
106 #define KEY_MEDIA_VIEW 0x00590000
107 #define KEY_MEDIA_MENU 0x005A0000
108 #define KEY_ZOOM_IN 0x00600000
109 #define KEY_ZOOM_OUT 0x00610000
110 #define KEY_BRIGHTNESS_UP 0x00620000
111 #define KEY_BRIGHTNESS_DOWN 0x00630000
112 
113 #define KEY_MOUSEWHEELUP 0x00F00000
114 #define KEY_MOUSEWHEELDOWN 0x00F10000
115 #define KEY_MOUSEWHEELLEFT 0x00F20000
116 #define KEY_MOUSEWHEELRIGHT 0x00F30000
117 #define KEY_MOUSEWHEEL_FROM_BUTTON(button) \
118  (KEY_MOUSEWHEELUP | ((button - MOUSE_BUTTON_WHEEL_UP) << 16))
119 
120 VLC_API char *vlc_keycode2str(uint_fast32_t i_key, bool locale) VLC_USED;
121 VLC_API uint_fast32_t vlc_str2keycode(const char *str) VLC_USED;
122 
123 typedef enum vlc_action_id {
126  /* intf actions */
131  /* playlist interaction */
135  /* playback */
138  /* playlist bookmarks */
159  /* player state */
165  /* input seeking */
175  /* program SID, chapter and title navigation */
183  /* audio / subtitle track */
187  /* audio / subtitle delay */
192  /* subtitle toggle */
194  /* dual subtitle control */
196  /* subtitle sync */
201  /* subtitle display */
207  /* input rate */
213  /* input navigation */
219  /* input recording */
221  /* viewpoint */
226  /* aout actions */
231  /* all vouts actions */
236  /* vout aspect ratio */
238  /* vout cropping */
248  /* vout deinterlacing */
251  /* vout scaling / zooming */
261  /* Combo Actions */
265 
266 /**
267  * Get the action ID from an action key name
268  * \return the action ID or ACTIONID_NONE on error.
269  */
271 vlc_actions_get_id(const char *psz_key_name);
272 
273 /**
274  * Get keycodes from a action key name and vlc configuration
275  * \return The number of keycodes for this action, or 0 in case of an error.
276  * The list needs to be released with free()
277  */
278 VLC_API size_t
279 vlc_actions_get_keycodes(vlc_object_t *p_obj, const char *psz_key_name,
280  bool b_global, uint_fast32_t **pp_keycodes );
281 #define vlc_actions_get_keycodes(a, b, c, d) vlc_actions_get_keycodes(VLC_OBJECT(a), b, c, d)
282 
283 /**
284  * Get a list a key names
285  * \return A NULL terminated list of const char *
286  */
287 VLC_API const char* const*
289 #define vlc_actions_get_key_names(x) vlc_actions_get_key_names(VLC_OBJECT(x))
290 
291 #endif
ACTIONID_RATE_FASTER_FINE
@ ACTIONID_RATE_FASTER_FINE
Definition: vlc_actions.h:213
ACTIONID_VIEWPOINT_ROLL_ANTICLOCK
@ ACTIONID_VIEWPOINT_ROLL_ANTICLOCK
Definition: vlc_actions.h:226
vlc_action_id
vlc_action_id
Definition: vlc_actions.h:124
VLC_API
#define VLC_API
Definition: fourcc_gen.c:31
vlc_actions_get_keycodes
#define vlc_actions_get_keycodes(a, b, c, d)
Definition: vlc_actions.h:282
ACTIONID_PLAY_BOOKMARK9
@ ACTIONID_PLAY_BOOKMARK9
Definition: vlc_actions.h:158
ACTIONID_TOGGLE_AUTOSCALE
@ ACTIONID_TOGGLE_AUTOSCALE
Definition: vlc_actions.h:253
ACTIONID_SET_BOOKMARK6
@ ACTIONID_SET_BOOKMARK6
Definition: vlc_actions.h:145
ACTIONID_VOL_UP
@ ACTIONID_VOL_UP
Definition: vlc_actions.h:229
ACTIONID_SUBTITLE_TEXT_SCALE_DOWN
@ ACTIONID_SUBTITLE_TEXT_SCALE_DOWN
Definition: vlc_actions.h:206
ACTIONID_INTF_POPUP_MENU
@ ACTIONID_INTF_POPUP_MENU
Definition: vlc_actions.h:131
ACTIONID_UNCROP_RIGHT
@ ACTIONID_UNCROP_RIGHT
Definition: vlc_actions.h:248
ACTIONID_ZOOM_QUARTER
@ ACTIONID_ZOOM_QUARTER
Definition: vlc_actions.h:258
ACTIONID_PAUSE
@ ACTIONID_PAUSE
Definition: vlc_actions.h:163
libvlc_int_t
Definition: vlc_objects.h:114
ACTIONID_TOGGLE_FULLSCREEN
@ ACTIONID_TOGGLE_FULLSCREEN
Definition: vlc_actions.h:233
ACTIONID_SET_BOOKMARK5
@ ACTIONID_SET_BOOKMARK5
Definition: vlc_actions.h:144
ACTIONID_SUBTITLE_CONTROL_SECONDARY
@ ACTIONID_SUBTITLE_CONTROL_SECONDARY
Definition: vlc_actions.h:196
vlc_common.h
vlc_keycode2str
VLC_EXPORT char * vlc_keycode2str(uint_fast32_t i_key, bool locale)
Format a human-readable and unique representation of a VLC key code (including modifiers).
Definition: actions.c:225
ACTIONID_SET_BOOKMARK9
@ ACTIONID_SET_BOOKMARK9
Definition: vlc_actions.h:148
ACTIONID_QUIT
@ ACTIONID_QUIT
Definition: vlc_actions.h:126
ACTIONID_SNAPSHOT
@ ACTIONID_SNAPSHOT
Definition: vlc_actions.h:235
ACTIONID_PLAY
@ ACTIONID_PLAY
Definition: vlc_actions.h:162
ACTIONID_UNCROP_BOTTOM
@ ACTIONID_UNCROP_BOTTOM
Definition: vlc_actions.h:246
ACTIONID_NEXT
@ ACTIONID_NEXT
Definition: vlc_actions.h:135
ACTIONID_DEINTERLACE
@ ACTIONID_DEINTERLACE
Definition: vlc_actions.h:250
vlc_action_id_t
enum vlc_action_id vlc_action_id_t
ACTIONID_LEAVE_FULLSCREEN
@ ACTIONID_LEAVE_FULLSCREEN
Definition: vlc_actions.h:234
ACTIONID_SET_BOOKMARK3
@ ACTIONID_SET_BOOKMARK3
Definition: vlc_actions.h:142
ACTIONID_SUBDELAY_UP
@ ACTIONID_SUBDELAY_UP
Definition: vlc_actions.h:192
ACTIONID_STOP
@ ACTIONID_STOP
Definition: vlc_actions.h:164
ACTIONID_COMBO_VOL_FOV_DOWN
@ ACTIONID_COMBO_VOL_FOV_DOWN
Definition: vlc_actions.h:263
ACTIONID_AUDIODEVICE_CYCLE
@ ACTIONID_AUDIODEVICE_CYCLE
Definition: vlc_actions.h:231
ACTIONID_INTF_TOGGLE_FSC
@ ACTIONID_INTF_TOGGLE_FSC
Definition: vlc_actions.h:128
ACTIONID_NAV_LEFT
@ ACTIONID_NAV_LEFT
Definition: vlc_actions.h:218
ACTIONID_FRAME_NEXT
@ ACTIONID_FRAME_NEXT
Definition: vlc_actions.h:165
ACTIONID_VIEWPOINT_FOV_IN
@ ACTIONID_VIEWPOINT_FOV_IN
Definition: vlc_actions.h:223
ACTIONID_SUBDELAY_DOWN
@ ACTIONID_SUBDELAY_DOWN
Definition: vlc_actions.h:191
ACTIONID_TITLE_PREV
@ ACTIONID_TITLE_PREV
Definition: vlc_actions.h:179
ACTIONID_VOL_DOWN
@ ACTIONID_VOL_DOWN
Definition: vlc_actions.h:228
ACTIONID_PLAY_BOOKMARK7
@ ACTIONID_PLAY_BOOKMARK7
Definition: vlc_actions.h:156
ACTIONID_PROGRAM_SID_PREV
@ ACTIONID_PROGRAM_SID_PREV
Definition: vlc_actions.h:177
ACTIONID_SET_BOOKMARK4
@ ACTIONID_SET_BOOKMARK4
Definition: vlc_actions.h:143
ACTIONID_PLAY_BOOKMARK8
@ ACTIONID_PLAY_BOOKMARK8
Definition: vlc_actions.h:157
ACTIONID_ZOOM
@ ACTIONID_ZOOM
Definition: vlc_actions.h:256
ACTIONID_CHAPTER_PREV
@ ACTIONID_CHAPTER_PREV
Definition: vlc_actions.h:181
ACTIONID_CROP_BOTTOM
@ ACTIONID_CROP_BOTTOM
Definition: vlc_actions.h:245
vlc_actions_get_key_names
#define vlc_actions_get_key_names(x)
Definition: vlc_actions.h:290
ACTIONID_PLAY_BOOKMARK3
@ ACTIONID_PLAY_BOOKMARK3
Definition: vlc_actions.h:152
ACTIONID_SCALE_UP
@ ACTIONID_SCALE_UP
Definition: vlc_actions.h:254
ACTIONID_NAV_RIGHT
@ ACTIONID_NAV_RIGHT
Definition: vlc_actions.h:219
ACTIONID_SUBTITLE_TEXT_SCALE_NORMAL
@ ACTIONID_SUBTITLE_TEXT_SCALE_NORMAL
Definition: vlc_actions.h:205
ACTIONID_JUMP_BACKWARD_LONG
@ ACTIONID_JUMP_BACKWARD_LONG
Definition: vlc_actions.h:173
ACTIONID_PLAY_BOOKMARK6
@ ACTIONID_PLAY_BOOKMARK6
Definition: vlc_actions.h:155
libvlc_InternalActionsClean
void libvlc_InternalActionsClean(libvlc_int_t *p_libvlc)
Destroys the key map.
Definition: actions.c:556
ACTIONID_SUBSYNC_MARKAUDIO
@ ACTIONID_SUBSYNC_MARKAUDIO
Definition: vlc_actions.h:198
ACTIONID_JUMP_BACKWARD_EXTRASHORT
@ ACTIONID_JUMP_BACKWARD_EXTRASHORT
Definition: vlc_actions.h:167
ACTIONID_PLAY_BOOKMARK10
@ ACTIONID_PLAY_BOOKMARK10
Definition: vlc_actions.h:159
ACTIONID_PLAY_CLEAR
@ ACTIONID_PLAY_CLEAR
Definition: vlc_actions.h:133
vlc_actions_get_id
VLC_EXPORT vlc_action_id_t vlc_actions_get_id(const char *psz_key_name)
Get the action ID from an action key name.
Definition: actions.c:586
ACTIONID_CROP
@ ACTIONID_CROP
Definition: vlc_actions.h:240
ACTIONID_PREV
@ ACTIONID_PREV
Definition: vlc_actions.h:134
ACTIONID_UNCROP_TOP
@ ACTIONID_UNCROP_TOP
Definition: vlc_actions.h:242
ACTIONID_PLAY_BOOKMARK2
@ ACTIONID_PLAY_BOOKMARK2
Definition: vlc_actions.h:151
ACTIONID_SUBPOS_UP
@ ACTIONID_SUBPOS_UP
Definition: vlc_actions.h:204
ACTIONID_SET_BOOKMARK10
@ ACTIONID_SET_BOOKMARK10
Definition: vlc_actions.h:149
ACTIONID_SUBPOS_DOWN
@ ACTIONID_SUBPOS_DOWN
Definition: vlc_actions.h:203
ACTIONID_SET_BOOKMARK1
@ ACTIONID_SET_BOOKMARK1
Definition: vlc_actions.h:140
ACTIONID_ZOOM_ORIGINAL
@ ACTIONID_ZOOM_ORIGINAL
Definition: vlc_actions.h:260
ACTIONID_PROGRAM_SID_NEXT
@ ACTIONID_PROGRAM_SID_NEXT
Definition: vlc_actions.h:178
ACTIONID_SCALE_DOWN
@ ACTIONID_SCALE_DOWN
Definition: vlc_actions.h:255
ACTIONID_RATE_SLOWER
@ ACTIONID_RATE_SLOWER
Definition: vlc_actions.h:210
ACTIONID_RECORD
@ ACTIONID_RECORD
Definition: vlc_actions.h:221
ACTIONID_TITLE_NEXT
@ ACTIONID_TITLE_NEXT
Definition: vlc_actions.h:180
ACTIONID_DISC_MENU
@ ACTIONID_DISC_MENU
Definition: vlc_actions.h:183
ACTIONID_PLAY_BOOKMARK5
@ ACTIONID_PLAY_BOOKMARK5
Definition: vlc_actions.h:154
ACTIONID_SUBSYNC_RESET
@ ACTIONID_SUBSYNC_RESET
Definition: vlc_actions.h:201
ACTIONID_ZOOM_HALF
@ ACTIONID_ZOOM_HALF
Definition: vlc_actions.h:259
ACTIONID_JUMP_FORWARD_MEDIUM
@ ACTIONID_JUMP_FORWARD_MEDIUM
Definition: vlc_actions.h:172
ACTIONID_JUMP_FORWARD_SHORT
@ ACTIONID_JUMP_FORWARD_SHORT
Definition: vlc_actions.h:170
ACTIONID_NONE
@ ACTIONID_NONE
Definition: vlc_actions.h:125
ACTIONID_PLAY_BOOKMARK4
@ ACTIONID_PLAY_BOOKMARK4
Definition: vlc_actions.h:153
ACTIONID_INTF_BOSS
@ ACTIONID_INTF_BOSS
Definition: vlc_actions.h:130
libvlc_InternalActionsInit
int libvlc_InternalActionsInit(libvlc_int_t *p_libvlc)
Initializes the key map from configuration.
Definition: actions.c:501
ACTIONID_POSITION
@ ACTIONID_POSITION
Definition: vlc_actions.h:175
ACTIONID_JUMP_FORWARD_LONG
@ ACTIONID_JUMP_FORWARD_LONG
Definition: vlc_actions.h:174
vlc_mouse.h
ACTIONID_UNZOOM
@ ACTIONID_UNZOOM
Definition: vlc_actions.h:257
ACTIONID_JUMP_FORWARD_EXTRASHORT
@ ACTIONID_JUMP_FORWARD_EXTRASHORT
Definition: vlc_actions.h:168
ACTIONID_SUBTITLE_TOGGLE
@ ACTIONID_SUBTITLE_TOGGLE
Definition: vlc_actions.h:194
vlc_object_t
VLC object common members.
Definition: vlc_objects.h:43
ACTIONID_SUBTITLE_REVERSE_TRACK
@ ACTIONID_SUBTITLE_REVERSE_TRACK
Definition: vlc_actions.h:186
ACTIONID_COMBO_VOL_FOV_UP
@ ACTIONID_COMBO_VOL_FOV_UP
Definition: vlc_actions.h:264
ACTIONID_SUBSYNC_MARKSUB
@ ACTIONID_SUBSYNC_MARKSUB
Definition: vlc_actions.h:199
ACTIONID_AUDIODELAY_DOWN
@ ACTIONID_AUDIODELAY_DOWN
Definition: vlc_actions.h:189
ACTIONID_RANDOM
@ ACTIONID_RANDOM
Definition: vlc_actions.h:138
ACTIONID_RATE_NORMAL
@ ACTIONID_RATE_NORMAL
Definition: vlc_actions.h:209
VLC_USED
#define VLC_USED
Definition: fourcc_gen.c:32
ACTIONID_SUBSYNC_APPLY
@ ACTIONID_SUBSYNC_APPLY
Definition: vlc_actions.h:200
ACTIONID_DEINTERLACE_MODE
@ ACTIONID_DEINTERLACE_MODE
Definition: vlc_actions.h:251
ACTIONID_NAV_UP
@ ACTIONID_NAV_UP
Definition: vlc_actions.h:216
ACTIONID_RATE_SLOWER_FINE
@ ACTIONID_RATE_SLOWER_FINE
Definition: vlc_actions.h:212
ACTIONID_AUDIO_TRACK
@ ACTIONID_AUDIO_TRACK
Definition: vlc_actions.h:185
ACTIONID_VIEWPOINT_ROLL_CLOCK
@ ACTIONID_VIEWPOINT_ROLL_CLOCK
Definition: vlc_actions.h:225
ACTIONID_SET_BOOKMARK7
@ ACTIONID_SET_BOOKMARK7
Definition: vlc_actions.h:146
ACTIONID_NAV_DOWN
@ ACTIONID_NAV_DOWN
Definition: vlc_actions.h:217
ACTIONID_NAV_ACTIVATE
@ ACTIONID_NAV_ACTIVATE
Definition: vlc_actions.h:215
ACTIONID_SUBTITLE_TRACK
@ ACTIONID_SUBTITLE_TRACK
Definition: vlc_actions.h:187
ACTIONID_VIEWPOINT_FOV_OUT
@ ACTIONID_VIEWPOINT_FOV_OUT
Definition: vlc_actions.h:224
ACTIONID_CROP_LEFT
@ ACTIONID_CROP_LEFT
Definition: vlc_actions.h:243
ACTIONID_RATE_FASTER
@ ACTIONID_RATE_FASTER
Definition: vlc_actions.h:211
ACTIONID_SET_BOOKMARK2
@ ACTIONID_SET_BOOKMARK2
Definition: vlc_actions.h:141
ACTIONID_PLAY_PAUSE
@ ACTIONID_PLAY_PAUSE
Definition: vlc_actions.h:161
ACTIONID_JUMP_BACKWARD_MEDIUM
@ ACTIONID_JUMP_BACKWARD_MEDIUM
Definition: vlc_actions.h:171
ACTIONID_VOL_MUTE
@ ACTIONID_VOL_MUTE
Definition: vlc_actions.h:230
ACTIONID_AUDIODELAY_UP
@ ACTIONID_AUDIODELAY_UP
Definition: vlc_actions.h:190
ACTIONID_WALLPAPER
@ ACTIONID_WALLPAPER
Definition: vlc_actions.h:236
ACTIONID_SUBTITLE_TEXT_SCALE_UP
@ ACTIONID_SUBTITLE_TEXT_SCALE_UP
Definition: vlc_actions.h:207
ACTIONID_PLAY_BOOKMARK1
@ ACTIONID_PLAY_BOOKMARK1
Definition: vlc_actions.h:150
ACTIONID_JUMP_BACKWARD_SHORT
@ ACTIONID_JUMP_BACKWARD_SHORT
Definition: vlc_actions.h:169
vlc_str2keycode
VLC_EXPORT uint_fast32_t vlc_str2keycode(const char *str)
Parse a human-readable string representation of a VLC key code.
Definition: actions.c:174
ACTIONID_ZOOM_DOUBLE
@ ACTIONID_ZOOM_DOUBLE
Definition: vlc_actions.h:261
ACTIONID_SET_BOOKMARK8
@ ACTIONID_SET_BOOKMARK8
Definition: vlc_actions.h:147
ACTIONID_CROP_TOP
@ ACTIONID_CROP_TOP
Definition: vlc_actions.h:241
ACTIONID_INTF_HIDE
@ ACTIONID_INTF_HIDE
Definition: vlc_actions.h:129
ACTIONID_LOOP
@ ACTIONID_LOOP
Definition: vlc_actions.h:137
ACTIONID_UNCROP_LEFT
@ ACTIONID_UNCROP_LEFT
Definition: vlc_actions.h:244
ACTIONID_ASPECT_RATIO
@ ACTIONID_ASPECT_RATIO
Definition: vlc_actions.h:238
ACTIONID_CROP_RIGHT
@ ACTIONID_CROP_RIGHT
Definition: vlc_actions.h:247
ACTIONID_CHAPTER_NEXT
@ ACTIONID_CHAPTER_NEXT
Definition: vlc_actions.h:182