11 #if defined(__ANDROID__) || defined(ANDROID) 12 #define GAINPUT_PLATFORM_ANDROID 13 #define GAINPUT_LIBEXPORT 14 #elif defined(__linux) || defined(__linux__) || defined(linux) || defined(LINUX) 15 #define GAINPUT_PLATFORM_LINUX 16 #define GAINPUT_LIBEXPORT 17 #elif defined(_WIN32) || defined(__WIN32__) || defined(_MSC_VER) 18 #define GAINPUT_PLATFORM_WIN 19 #if defined(GAINPUT_LIB_DYNAMIC) 20 #define GAINPUT_LIBEXPORT __declspec(dllexport) 21 #elif defined(GAINPUT_LIB_DYNAMIC_USE) 22 #define GAINPUT_LIBEXPORT __declspec(dllimport) 24 #define GAINPUT_LIBEXPORT 26 #elif defined(__APPLE__) 27 #define GAINPUT_LIBEXPORT 28 #include <TargetConditionals.h> 30 #define GAINPUT_PLATFORM_TVOS 31 #elif TARGET_OS_IPHONE 32 #define GAINPUT_PLATFORM_IOS 34 #define GAINPUT_PLATFORM_MAC 36 #error Gainput: Unknown/unsupported Apple platform! 39 #error Gainput: Unknown/unsupported platform! 45 #define GAINPUT_ENABLE_ALL_GESTURES 46 #define GAINPUT_ENABLE_RECORDER 47 #define GAINPUT_TEXT_INPUT_QUEUE_LENGTH 32 49 #ifdef GAINPUT_ENABLE_CONCURRENCY 50 #define MOODYCAMEL_EXCEPTIONS_DISABLED 51 #include "concurrentqueue.h" 52 #define GAINPUT_CONC_QUEUE(TYPE) moodycamel::ConcurrentQueue<TYPE> 53 #define GAINPUT_CONC_CONSTRUCT(queue) queue() 54 #define GAINPUT_CONC_ENQUEUE(queue, obj) queue.enqueue(obj) 55 #define GAINPUT_CONC_DEQUEUE(queue, obj) queue.try_dequeue(obj) 57 #define GAINPUT_CONC_QUEUE(TYPE) gainput::Array<TYPE> 58 #define GAINPUT_CONC_CONSTRUCT(queue) queue(allocator) 59 #define GAINPUT_CONC_ENQUEUE(queue, obj) queue.push_back(obj) 60 #define GAINPUT_CONC_DEQUEUE(queue, obj) (!queue.empty() ? (obj = queue[queue.size()-1], queue.pop_back(), true) : false) 67 #define GAINPUT_ASSERT assert 68 #define GAINPUT_UNUSED(x) (void)(x) 70 #if defined(GAINPUT_PLATFORM_LINUX) 76 typedef _XEvent XEvent;
78 #elif defined(GAINPUT_PLATFORM_WIN) 82 typedef struct tagMSG MSG;
86 typedef unsigned __int8 uint8_t;
87 typedef __int8 int8_t;
88 typedef unsigned __int32 uint32_t;
89 typedef unsigned __int64 uint64_t;
92 #elif defined(GAINPUT_PLATFORM_ANDROID) 128 static const DeviceId InvalidDeviceId = -1;
130 static const DeviceButtonId InvalidDeviceButtonId = -1;
132 static const UserButtonId InvalidUserButtonId = -1;
147 template <
class T> T Abs(T a) {
return a < T() ? -a : a; }
167 #define GAINPUT_VER_MAJOR_SHIFT 16 168 #define GAINPUT_VER_GET_MAJOR(ver) (ver >> GAINPUT_VER_MAJOR_SHIFT) 169 #define GAINPUT_VER_GET_MINOR(ver) (ver & (uint32_t(-1) >> GAINPUT_VER_MAJOR_SHIFT)) 172 #include <gainput/GainputAllocator.h> 173 #include <gainput/GainputContainers.h> 174 #include <gainput/GainputInputState.h> 175 #include <gainput/GainputInputDevice.h> 176 #include <gainput/GainputInputListener.h> 177 #include <gainput/GainputInputManager.h> 178 #include <gainput/GainputInputMap.h> 180 #include <gainput/GainputInputDeviceMouse.h> 181 #include <gainput/GainputInputDeviceKeyboard.h> 182 #include <gainput/GainputInputDevicePad.h> 183 #include <gainput/GainputInputDeviceTouch.h> 184 #include <gainput/GainputInputDeviceBuiltIn.h> 186 #include <gainput/gestures/GainputGestures.h> 188 #include <gainput/recorder/GainputInputRecording.h> 189 #include <gainput/recorder/GainputInputPlayer.h> 190 #include <gainput/recorder/GainputInputRecorder.h>