Merge commit 'e792f8d'

This commit is contained in:
Phillip Stephens 2016-01-31 00:37:51 -08:00
commit e3f20652db
4 changed files with 80 additions and 4 deletions

View File

@ -77,13 +77,10 @@ else(NOT GEKKO)
lib/x11/ApplicationWayland.hpp
lib/x11/WindowXlib.cpp
lib/x11/WindowWayland.cpp
lib/inputdev/HIDListenerUdev.cpp
lib/inputdev/HIDDeviceUdev.cpp
lib/graphicsdev/GL.cpp
lib/graphicsdev/GLX.cpp
lib/graphicsdev/glew.c
lib/audiodev/ALSA.cpp)
# list(APPEND PLAT_HDRS )
find_package(PkgConfig)
@ -109,6 +106,7 @@ else(NOT GEKKO)
PATHS
# TODO use CMAKE_SYSTEM_PROCESSOR or similar?
/usr/lib/dbus-1.0/include
/usr/local/lib/dbus-1.0/include
PATH_SUFFIXES
dbus-1.0/include/)
@ -127,7 +125,18 @@ else(NOT GEKKO)
endif()
include_directories(${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR})
list(APPEND _BOO_SYS_LIBS X11 Xi GL ${DBUS_LIBRARY} udev pthread)
list(APPEND _BOO_SYS_LIBS X11 Xi GL ${DBUS_LIBRARY} pthread)
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
list(APPEND PLAT_SRCS
lib/inputdev/HIDListenerUdev.cpp
lib/inputdev/HIDDeviceUdev.cpp)
list(APPEND _BOO_SYS_LIBS udev)
else()
list(APPEND PLAT_SRCS
lib/inputdev/HIDListenerBSD.cpp
lib/inputdev/HIDDeviceBSD.cpp)
endif()
endif()

View File

@ -0,0 +1,31 @@
#include "boo/inputdev/IHIDListener.hpp"
#include "boo/inputdev/DeviceFinder.hpp"
namespace boo
{
class HIDListenerBSD final : public IHIDListener
{
DeviceFinder& m_finder;
public:
HIDListenerBSD(DeviceFinder& finder)
: m_finder(finder)
{
}
~HIDListenerBSD()
{
}
bool startScanning() { return false; }
bool stopScanning() { return false; }
bool scanNow() { return false; }
};
IHIDListener* IHIDListenerNew(DeviceFinder &finder)
{
return new HIDListenerBSD(finder);
}
}

View File

@ -0,0 +1,34 @@
#include "IHIDDevice.hpp"
#include "boo/inputdev/DeviceToken.hpp"
#include "boo/inputdev/DeviceBase.hpp"
namespace boo
{
class HIDDeviceBSD final : public IHIDDevice
{
DeviceToken& m_token;
DeviceBase& m_devImp;
void _deviceDisconnected() {}
bool _sendUSBInterruptTransfer(const uint8_t* data, size_t length) { return false; }
size_t _receiveUSBInterruptTransfer(uint8_t* data, size_t length) { return 0; }
bool _sendHIDReport(const uint8_t* data, size_t length, uint16_t message) { return false; }
size_t _recieveReport(const uint8_t* data, size_t length, uint16_t message) {return 0; }
public:
HIDDeviceBSD(DeviceToken& token, DeviceBase& devImp)
: m_token(token),
m_devImp(devImp)
{
}
~HIDDeviceBSD()
{
}
};
IHIDDevice* IHIDDeviceNew(DeviceToken& token, DeviceBase& devImp)
{
return new HIDDeviceBSD(token, devImp);
}
}

View File

@ -9,12 +9,14 @@
#include <X11/extensions/XInput2.h>
#include <GL/glx.h>
#include <GL/glxext.h>
#include <locale>
#include <dbus/dbus.h>
DBusConnection* RegisterDBus(const char* appName, bool& isFirst);
#include <LogVisor/LogVisor.hpp>
#include <signal.h>
#include <sys/param.h>
#include <thread>
#include <mutex>