dolphin/Source/Plugins/Plugin_GCPadNew/Src/ControllerInterface/Xlib/Xlib.h
Jordan Woyak f51d8fffa0 Plugin that should eventually replace the GCPad and emulated Wiimote plugin:
It's currently only really usable on Windows. Linux/OS X will need keyboard support added in, but SDL should work for joysticks on non-Windows without too many modifications.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5254 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-03-30 19:14:11 +00:00

70 lines
1.4 KiB
C++

#ifndef _CIFACE_XLIB_H_
#define _CIFACE_XLIB_H_
#include "../ControllerInterface.h"
#include <X11/Xlib.h>
namespace ciface
{
namespace XInput
{
void Init( std::vector<ControllerInterface::Device*>& devices, void* const hwnd );
class Keyboard : public ControllerInterface::Device
{
friend class ControllerInterface;
friend class ControllerInterface::ControlReference;
protected:
struct State
{
char keyboard[32];
// mouse crap will go here
};
class Input : public ControllerInterface::Input
{
friend class Keyboard;
protected:
ControlState GetState( const State* const state ) = 0;
}
class Key : public Input
{
friend class Keyboard;
public:
std::string GetName() const;
protected:
Key( KeySym keysym ) : m_keysym(keysym) {}
ControlState GetState( const State* const state );
private:
const KeySym m_keysym
};
bool UpdateInput();
bool UpdateOutput();
ControlState Keyboard::GetInputState( const ControllerInterface::Device::Input* const input );
void Keyboard::SetOutputState( const ControllerInterface::Device::Output* const output, const ControlState state );
public:
Keyboard( Display* const display );
~Keyboard();
std::string GetName() const;
std::string GetSource() const;
int GetId() const;
private:
Display* const m_display;
State m_state;
};
}
}
#endif