Add Win32 gestures helper
[vlc.git] / modules / control / win32touch.h
blobd3f912895a8fcbc448bbacf0f6f6bfd43b081ed6
1 /*****************************************************************************
2 * win32touch.c: touch gestures recognition
3 *****************************************************************************
4 * Copyright © 2013-2014 VideoLAN
6 * Authors: Ludovic Fauvet <etix@videolan.org>
7 * Jean-Baptiste Kempf <jb@videolan.org>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef VLC_GESTURE_H_
25 #define VLC_GESTURE_H_
27 # ifdef _WIN32_WINNT
28 # undef _WIN32_WINNT
29 # endif
30 # define _WIN32_WINNT 0x0601
31 # include <windows.h>
32 # include <winuser.h>
34 #ifdef HAVE_CONFIG_H
35 # include "config.h"
36 #endif
38 #include <vlc_common.h>
40 #ifndef WM_GESTURE
41 # define WM_GESTURE 0x0119
42 #endif
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
48 enum {
49 GESTURE_ACTION_UNDEFINED = 0,
50 GESTURE_ACTION_VOLUME,
51 GESTURE_ACTION_JUMP,
52 GESTURE_ACTION_BRIGHTNESS
55 typedef struct {
56 DWORD i_type; /* Gesture ID */
57 int i_action; /* GESTURE_ACTION */
59 int i_beginx; /* Start X position */
60 int i_beginy; /* Start Y position */
61 int i_lasty; /* Last known Y position for PAN */
63 ULONGLONG i_ullArguments; /* Base values to compare between 2 zoom gestures */
64 bool b_2fingers; /* Did we detect 2 fingers? */
66 HINSTANCE huser_dll; /* user32.dll */
67 BOOL (WINAPI * OurCloseGestureInfoHandle)(HGESTUREINFO hGestureInfo);
68 BOOL (WINAPI * OurGetGestureInfo)(HGESTUREINFO hGestureInfo, PGESTUREINFO pGestureInfo);
69 } win32_gesture_sys_t;
72 BOOL InitGestures( HWND hwnd, win32_gesture_sys_t **p_gesture );
74 LRESULT DecodeGesture( vlc_object_t *p_intf, win32_gesture_sys_t *p_gesture,
75 HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam );
77 void CloseGestures( win32_gesture_sys_t *p_gesture );
79 #ifdef __cplusplus
81 #endif
83 #endif