Merge pull request #4594 from FernetMenta/paplayer
[xbmc.git] / xbmc / android / activity / AndroidExtra.h
blob7b1c9ffa728520f6eaf605181ed934c000385fec
1 #pragma once
2 /*
3 * Copyright (C) 2013 Team XBMC
4 * http://xbmc.org
6 * This Program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
11 * This Program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with XBMC; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
22 /*** Extra's not found in the Android NDK ***/
24 // missing in early NDKs, is present in r9b+
25 extern float AMotionEvent_getAxisValue(const AInputEvent* motion_event, int32_t axis, size_t pointer_index);
26 extern typeof(AMotionEvent_getAxisValue) *p_AMotionEvent_getAxisValue;
27 #define AMotionEvent_getAxisValue (*p_AMotionEvent_getAxisValue)
29 // missing in NDK
30 extern int32_t AMotionEvent_getButtonState(const AInputEvent* motion_event);
31 extern typeof(AMotionEvent_getButtonState) *p_AMotionEvent_getButtonState;
32 #define AMotionEvent_getButtonState (*p_AMotionEvent_getButtonState)
34 //Additional defines from android.view.KeyEvent (http://developer.android.com/reference/android/view/KeyEvent.html)
35 #define AKEYCODE_ESCAPE 111
36 #define AKEYCODE_FORWARD_DEL 112
37 #define AKEYCODE_CTRL_LEFT 113
38 #define AKEYCODE_CTRL_RIGHT 114
39 #define AKEYCODE_CAPS_LOCK 115
40 #define AKEYCODE_SCROLL_LOCK 116
41 #define AKEYCODE_INSERT 124
42 #define AKEYCODE_FORWARD 125
43 #define AKEYCODE_MEDIA_PLAY 126
44 #define AKEYCODE_MEDIA_EJECT 129
46 //Additional defines from android.view.MotionEvent (http://developer.android.com/reference/android/view/MotionEvent.html)
47 #define AMOTION_EVENT_ACTION_SCROLL 0x08
49 #define AMOTION_EVENT_BUTTON_PRIMARY 0x00000001
50 #define AMOTION_EVENT_BUTTON_SECONDARY 0x00000002
51 #define AMOTION_EVENT_BUTTON_TERTIARY 0x00000004
52 #define AMOTION_EVENT_BUTTON_BACK 0x00000008
53 #define AMOTION_EVENT_BUTTON_FORWARD 0x00000010
55 #define AINPUT_SOURCE_CLASS_JOYSTICK 0x00000010
57 #define AINPUT_SOURCE_GAMEPAD (0x00000400 | AINPUT_SOURCE_CLASS_BUTTON)
58 #define AINPUT_SOURCE_JOYSTICK (0x01000000 | AINPUT_SOURCE_CLASS_JOYSTICK)
60 // 1st stick X, Y
61 #define AMOTION_EVENT_AXIS_X 0
62 #define AMOTION_EVENT_AXIS_Y 1
63 // 2nd stick X, Y
64 #define AMOTION_EVENT_AXIS_Z 11
65 #define AMOTION_EVENT_AXIS_RZ 14
66 // d-pad X, Y
67 #define AMOTION_EVENT_AXIS_HAT_X 15
68 #define AMOTION_EVENT_AXIS_HAT_Y 16
69 // trigger left, right
70 #define AMOTION_EVENT_AXIS_LTRIGGER 17
71 #define AMOTION_EVENT_AXIS_RTRIGGER 18
72 // mouse vertical wheel
73 #define AMOTION_EVENT_AXIS_VSCROLL 0x09