00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #pragma once
00020
00021 #define WIN32_LEAN_AND_MEAN
00022 #include <Windows.h>
00023
00024 #if defined(winmmjoy_EXPORTS)
00025 #define WINMMJOY_API __declspec(dllexport)
00026 #else
00027 #define WINMMJOY_API __declspec(dllimport)
00028 #endif
00029
00030 extern "C" {
00031
00032 WINMMJOY_API int init(void (*sendEvent)(const char*, void*), void (*log)(const char*));
00033 WINMMJOY_API int cleanup();
00034
00035 }
00036
00037 DWORD WINAPI mainLoop(void* data);
00038
00039 typedef unsigned char GameDeviceID;
00040 typedef unsigned short GameDeviceButton;
00041
00042 class CGameDeviceButtonInfo {
00043 public:
00044 CGameDeviceButtonInfo(GameDeviceID id, GameDeviceButton buttons) :
00045 m_id(id), m_buttons(buttons) { }
00046 public:
00047 GameDeviceID m_id;
00048 GameDeviceButton m_buttons;
00049 };
00050
00051 class CGameDeviceStickInfo {
00052 public:
00053 CGameDeviceStickInfo(GameDeviceID id, short x1, short y1, short x2, short y2) :
00054 m_id(id), m_x1(x1), m_x2(x2), m_y1(y1), m_y2(y2) { }
00055 public:
00056 GameDeviceID m_id;
00057 short m_x1;
00058 short m_x2;
00059 short m_y1;
00060 short m_y2;
00061 };
00062
00063 class CGameDeviceTriggerInfo {
00064 public:
00065 CGameDeviceTriggerInfo(GameDeviceID id, unsigned char t1, unsigned char t2) :
00066 m_id(id), m_t1(t1), m_t2(t2) { }
00067 public:
00068 GameDeviceID m_id;
00069 unsigned char m_t1;
00070 unsigned char m_t2;
00071 };