vlc_actions.h 8.71 KB
Newer Older
1
/*****************************************************************************
2
 * vlc_actions.h: handle vlc actions
3
 *****************************************************************************
4
 * Copyright (C) 2003-2016 VLC authors and VideoLAN
5
 * $Id$
6
 *
7
 * Authors: Sigmund Augdal Helberg <dnumgis@videolan.org>
8
 *
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
9 10 11
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
12 13 14 15
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
16 17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
18
 *
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
19 20 21
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 23
 *****************************************************************************/

24 25
#ifndef VLC_ACTIONS_H
#define VLC_ACTIONS_H 1
26

27 28 29 30 31 32 33 34
/* Called from src/libvlc.c */
int
libvlc_InternalActionsInit(libvlc_int_t *p_libvlc);

/* Called from src/libvlc.c */
void
libvlc_InternalActionsClean(libvlc_int_t *p_libvlc);

35 36
/**
 * \file
37
 * This file defines keys and functions
38 39
 */

40 41 42 43 44 45 46
#define KEY_MODIFIER         0xFF000000
#define KEY_MODIFIER_ALT     0x01000000
#define KEY_MODIFIER_SHIFT   0x02000000
#define KEY_MODIFIER_CTRL    0x04000000
#define KEY_MODIFIER_META    0x08000000
#define KEY_MODIFIER_COMMAND 0x10000000

47
#define KEY_UNSET            0x00000000
48 49 50 51
#define KEY_BACKSPACE              0x08
#define KEY_TAB                    0x09
#define KEY_ENTER                  0x0D
#define KEY_ESC                    0x1B
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
/* End of Unicode range:     0x0010FFFF */
#define KEY_LEFT             0x00210000
#define KEY_RIGHT            0x00220000
#define KEY_UP               0x00230000
#define KEY_DOWN             0x00240000
#define KEY_F1               0x00270000
#define KEY_F2               0x00280000
#define KEY_F3               0x00290000
#define KEY_F4               0x002A0000
#define KEY_F5               0x002B0000
#define KEY_F6               0x002C0000
#define KEY_F7               0x002D0000
#define KEY_F8               0x002E0000
#define KEY_F9               0x002F0000
#define KEY_F10              0x00300000
#define KEY_F11              0x00310000
#define KEY_F12              0x00320000
#define KEY_HOME             0x00330000
#define KEY_END              0x00340000
#define KEY_INSERT           0x00350000
#define KEY_DELETE           0x00360000
#define KEY_MENU             0x00370000
#define KEY_PAGEUP           0x00390000
#define KEY_PAGEDOWN         0x003A0000
76 77
#define KEY_PRINT            0x003B0000
#define KEY_PAUSE            0x003D0000
78

79 80 81 82 83 84 85 86 87 88 89 90 91 92
#define KEY_BROWSER_BACK     0x003F0000
#define KEY_BROWSER_FORWARD  0x00400000
#define KEY_BROWSER_REFRESH  0x00410000
#define KEY_BROWSER_STOP     0x00420000
#define KEY_BROWSER_SEARCH   0x00430000
#define KEY_BROWSER_FAVORITES 0x00440000
#define KEY_BROWSER_HOME     0x00450000
#define KEY_VOLUME_MUTE      0x00460000
#define KEY_VOLUME_DOWN      0x00470000
#define KEY_VOLUME_UP        0x00480000
#define KEY_MEDIA_NEXT_TRACK 0x00490000
#define KEY_MEDIA_PREV_TRACK 0x004A0000
#define KEY_MEDIA_STOP       0x004B0000
#define KEY_MEDIA_PLAY_PAUSE 0x004C0000
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
#define KEY_MEDIA_RECORD     0x004D0000
#define KEY_MEDIA_REWIND     0x004E0000
#define KEY_MEDIA_FORWARD    0x004F0000
#define KEY_MEDIA_REPEAT     0x00500000
#define KEY_MEDIA_SHUFFLE    0x00510000
#define KEY_MEDIA_SUBTITLE   0x00520000
#define KEY_MEDIA_AUDIO      0x00530000
#define KEY_MEDIA_ANGLE      0x00540000
#define KEY_MEDIA_TIME       0x00550000
#define KEY_MEDIA_FRAME_PREV 0x00560000
#define KEY_MEDIA_FRAME_NEXT 0x00570000
#define KEY_MEDIA_SELECT     0x00580000
#define KEY_MEDIA_VIEW       0x00590000
#define KEY_MEDIA_MENU       0x005A0000
#define KEY_ZOOM_IN          0x00600000
#define KEY_ZOOM_OUT         0x00610000
#define KEY_BRIGHTNESS_UP    0x00620000
#define KEY_BRIGHTNESS_DOWN  0x00630000
111

112 113 114 115
#define KEY_MOUSEWHEELUP     0x00F00000
#define KEY_MOUSEWHEELDOWN   0x00F10000
#define KEY_MOUSEWHEELLEFT   0x00F20000
#define KEY_MOUSEWHEELRIGHT  0x00F30000
116

117
VLC_API char *vlc_keycode2str(uint_fast32_t i_key, bool locale) VLC_USED;
118
VLC_API uint_fast32_t vlc_str2keycode(const char *str) VLC_USED;
119

120
typedef enum vlc_action_id {
121 122
    ACTIONID_NONE = 0,
    ACTIONID_QUIT,
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
    ACTIONID_PLAY_PAUSE,
    ACTIONID_PLAY,
    ACTIONID_PAUSE,
    ACTIONID_STOP,
    ACTIONID_PREV,
    ACTIONID_NEXT,
    ACTIONID_SLOWER,
    ACTIONID_FASTER,
    ACTIONID_TOGGLE_FULLSCREEN,
    ACTIONID_VOL_UP,
    ACTIONID_VOL_DOWN,
    ACTIONID_NAV_ACTIVATE,
    ACTIONID_NAV_UP,
    ACTIONID_NAV_DOWN,
    ACTIONID_NAV_LEFT,
    ACTIONID_NAV_RIGHT,
    ACTIONID_JUMP_BACKWARD_EXTRASHORT,
    ACTIONID_JUMP_FORWARD_EXTRASHORT,
    ACTIONID_JUMP_BACKWARD_SHORT,
    ACTIONID_JUMP_FORWARD_SHORT,
    ACTIONID_JUMP_BACKWARD_MEDIUM,
    ACTIONID_JUMP_FORWARD_MEDIUM,
    ACTIONID_JUMP_BACKWARD_LONG,
    ACTIONID_JUMP_FORWARD_LONG,
147
    ACTIONID_FRAME_NEXT,
148 149
    ACTIONID_POSITION,
    ACTIONID_VOL_MUTE,
150
/* let ACTIONID_SET_BOOMARK* and ACTIONID_PLAY_BOOKMARK* be contiguous */
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
    ACTIONID_SET_BOOKMARK1,
    ACTIONID_SET_BOOKMARK2,
    ACTIONID_SET_BOOKMARK3,
    ACTIONID_SET_BOOKMARK4,
    ACTIONID_SET_BOOKMARK5,
    ACTIONID_SET_BOOKMARK6,
    ACTIONID_SET_BOOKMARK7,
    ACTIONID_SET_BOOKMARK8,
    ACTIONID_SET_BOOKMARK9,
    ACTIONID_SET_BOOKMARK10,
    ACTIONID_PLAY_BOOKMARK1,
    ACTIONID_PLAY_BOOKMARK2,
    ACTIONID_PLAY_BOOKMARK3,
    ACTIONID_PLAY_BOOKMARK4,
    ACTIONID_PLAY_BOOKMARK5,
    ACTIONID_PLAY_BOOKMARK6,
    ACTIONID_PLAY_BOOKMARK7,
    ACTIONID_PLAY_BOOKMARK8,
    ACTIONID_PLAY_BOOKMARK9,
    ACTIONID_PLAY_BOOKMARK10,
    /* end of contiguous zone */
172
    ACTIONID_PLAY_CLEAR,
173 174
    ACTIONID_SUBDELAY_UP,
    ACTIONID_SUBDELAY_DOWN,
175 176 177 178
    ACTIONID_SUBSYNC_MARKAUDIO,
    ACTIONID_SUBSYNC_MARKSUB,
    ACTIONID_SUBSYNC_APPLY,
    ACTIONID_SUBSYNC_RESET,
179 180
    ACTIONID_SUBPOS_UP,
    ACTIONID_SUBPOS_DOWN,
181
    ACTIONID_AUDIO_TRACK,
182
    ACTIONID_SUBTITLE_REVERSE_TRACK,
183
    ACTIONID_SUBTITLE_TRACK,
184
    ACTIONID_SUBTITLE_TOGGLE,
185 186 187
    ACTIONID_SUBTITLE_TEXT_SCALE_NORMAL,
    ACTIONID_SUBTITLE_TEXT_SCALE_UP,
    ACTIONID_SUBTITLE_TEXT_SCALE_DOWN,
188
    ACTIONID_INTF_TOGGLE_FSC,
189
    ACTIONID_INTF_HIDE,
190
    ACTIONID_INTF_BOSS,
191 192 193 194 195 196 197 198 199 200 201 202 203 204
    /* chapter and title navigation */
    ACTIONID_TITLE_PREV,
    ACTIONID_TITLE_NEXT,
    ACTIONID_CHAPTER_PREV,
    ACTIONID_CHAPTER_NEXT,
    /* end of chapter and title navigation */
    ACTIONID_AUDIODELAY_UP,
    ACTIONID_AUDIODELAY_DOWN,
    ACTIONID_SNAPSHOT,
    ACTIONID_RECORD,
    ACTIONID_DISC_MENU,
    ACTIONID_ASPECT_RATIO,
    ACTIONID_CROP,
    ACTIONID_DEINTERLACE,
205
    ACTIONID_DEINTERLACE_MODE,
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
    ACTIONID_ZOOM,
    ACTIONID_UNZOOM,
    ACTIONID_CROP_TOP,
    ACTIONID_UNCROP_TOP,
    ACTIONID_CROP_LEFT,
    ACTIONID_UNCROP_LEFT,
    ACTIONID_CROP_BOTTOM,
    ACTIONID_UNCROP_BOTTOM,
    ACTIONID_CROP_RIGHT,
    ACTIONID_UNCROP_RIGHT,
    ACTIONID_RANDOM,
    ACTIONID_LOOP,
    ACTIONID_WALLPAPER,
    ACTIONID_LEAVE_FULLSCREEN,
    /* Zoom */
    ACTIONID_ZOOM_QUARTER,
    ACTIONID_ZOOM_HALF,
    ACTIONID_ZOOM_ORIGINAL,
    ACTIONID_ZOOM_DOUBLE,
    /* Cycle Through Audio Devices */
226
    ACTIONID_AUDIODEVICE_CYCLE,
227 228 229
    /* scaling */
    ACTIONID_TOGGLE_AUTOSCALE,
    ACTIONID_SCALE_UP,
230 231 232
    ACTIONID_SCALE_DOWN,
    /* */
    ACTIONID_RATE_NORMAL,
233 234
    ACTIONID_RATE_SLOWER_FINE,
    ACTIONID_RATE_FASTER_FINE,
235
    /* Cycle Through Program Service IDs */
236 237
    ACTIONID_PROGRAM_SID_NEXT,
    ACTIONID_PROGRAM_SID_PREV,
238
    ACTIONID_INTF_POPUP_MENU,
239
    /* Viewpoint */
240 241
    ACTIONID_VIEWPOINT_FOV_IN,
    ACTIONID_VIEWPOINT_FOV_OUT,
242 243
    ACTIONID_VIEWPOINT_ROLL_CLOCK,
    ACTIONID_VIEWPOINT_ROLL_ANTICLOCK,
244
    /* Combo Actions */
245 246
    ACTIONID_COMBO_VOL_FOV_UP,
    ACTIONID_COMBO_VOL_FOV_DOWN,
247

248
} vlc_action_id_t;
249

250 251 252 253 254 255
/**
 * Get the action ID from an action key name
 * \return the action ID or ACTIONID_NONE on error.
 */
VLC_API vlc_action_id_t
vlc_actions_get_id(const char *psz_key_name);
256

257 258 259 260 261 262 263 264 265 266
/**
 * Get keycodes from a action key name and vlc configuration
 * \return The number of keycodes for this action, or 0 in case of an error.
 * The list needs to be released with free()
 */
VLC_API size_t
vlc_actions_get_keycodes(vlc_object_t *p_obj, const char *psz_key_name,
                        bool b_global, uint_fast32_t **pp_keycodes );
#define vlc_actions_get_keycodes(a, b, c, d) vlc_actions_get_keycodes(VLC_OBJECT(a), b, c, d)

267 268 269 270 271 272 273
/**
 * Get a list a key names
 * \return A NULL terminated list of const char *
 */
VLC_API const char* const*
vlc_actions_get_key_names(vlc_object_t *p_obj);
#define vlc_actions_get_key_names(x) vlc_actions_get_key_names(VLC_OBJECT(x))
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
274

275
#endif