InputCommon: Split Device stuff out

The ExpressionParser needs this to be out of here to prevent issues
with cyclic references.
This commit is contained in:
Jasper St. Pierre
2013-06-16 20:07:10 -04:00
parent 143d2eccb4
commit 877106b027
30 changed files with 448 additions and 451 deletions

View File

@ -1,13 +1,13 @@
#pragma once
#include "../ControllerInterface.h"
#include "../Device.h"
namespace ciface
{
namespace OSX
{
void Init(std::vector<ControllerInterface::Device*>& devices, void *window);
void Init(std::vector<Core::Device*>& devices, void *window);
void DeInit();
void DeviceElementDebugPrint(const void *, void *);

View File

@ -2,11 +2,12 @@
#include <IOKit/hid/IOHIDLib.h>
#include <Cocoa/Cocoa.h>
#include "../ControllerInterface.h"
#include "OSX.h"
#include "OSXKeyboard.h"
#include "OSXJoystick.h"
#include <map>
namespace ciface
{
namespace OSX
@ -145,8 +146,8 @@ static void DeviceMatching_callback(void* inContext,
DeviceDebugPrint(inIOHIDDeviceRef);
std::vector<ControllerInterface::Device*> *devices =
(std::vector<ControllerInterface::Device*> *)inContext;
std::vector<Core::Device*> *devices =
(std::vector<Core::Device*> *)inContext;
// Add to the devices vector if it's of a type we want
if (IOHIDDeviceConformsTo(inIOHIDDeviceRef,
@ -164,7 +165,7 @@ static void DeviceMatching_callback(void* inContext,
name, joy_name_counts[name]++));
}
void Init(std::vector<ControllerInterface::Device*>& devices, void *window)
void Init(std::vector<Core::Device*>& devices, void *window)
{
HIDManager = IOHIDManagerCreate(kCFAllocatorDefault,
kIOHIDOptionsTypeNone);

View File

@ -1,13 +1,13 @@
#include <IOKit/hid/IOHIDLib.h>
#include "../ControllerInterface.h"
#include "../Device.h"
namespace ciface
{
namespace OSX
{
class Joystick : public ControllerInterface::Device
class Joystick : public Core::Device
{
private:
class Button : public Input

View File

@ -1,9 +1,10 @@
#include <Foundation/Foundation.h>
#include <IOKit/hid/IOHIDLib.h>
#include "../ControllerInterface.h"
#include "OSXJoystick.h"
#include <sstream>
namespace ciface
{
namespace OSX

View File

@ -1,13 +1,13 @@
#include <IOKit/hid/IOHIDLib.h>
#include "../ControllerInterface.h"
#include "../Device.h"
namespace ciface
{
namespace OSX
{
class Keyboard : public ControllerInterface::Device
class Keyboard : public Core::Device
{
private:
class Key : public Input

View File

@ -3,9 +3,10 @@
#include <Cocoa/Cocoa.h>
#include <wx/wx.h> // wxWidgets
#include "../ControllerInterface.h"
#include "OSXKeyboard.h"
#include <sstream>
namespace ciface
{
namespace OSX