device-manager.cpp revision 5cb9a421ea3ff6d5fd2504f5e38f6014082dcb67
/*
* Inkscape::DeviceManager - a view of input devices available.
*
* Copyright 2006 Jon A. Cruz <jon@joncruz.org>
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <glib.h>
#include <map>
#include "device-manager.h"
static void createFakeList();
namespace Inkscape {
pair<gint, gint>(0, 1), pair<gint, gint>(1, 1 << 1), pair<gint, gint>(2, 1 << 2), pair<gint, gint>(3, 1 << 3),
pair<gint, gint>(4, 1 << 4), pair<gint, gint>(5, 1 << 5), pair<gint, gint>(6, 1 << 6), pair<gint, gint>(7, 1 << 7),
pair<gint, gint>(8, 1 << 8), pair<gint, gint>(9, 1 << 9), pair<gint, gint>(10, 1 << 10), pair<gint, gint>(11, 1 << 11),
pair<gint, gint>(12, 1 << 12), pair<gint, gint>(13, 1 << 13), pair<gint, gint>(14, 1 << 14), pair<gint, gint>(15, 1 << 15),
pair<gint, gint>(16, 1 << 16), pair<gint, gint>(17, 1 << 17), pair<gint, gint>(18, 1 << 18), pair<gint, gint>(19, 1 << 19),
pair<gint, gint>(20, 1 << 20), pair<gint, gint>(21, 1 << 21), pair<gint, gint>(22, 1 << 22), pair<gint, gint>(23, 1 << 23)
};
{}
InputDevice::~InputDevice() {}
class InputDeviceImpl : public InputDevice {
public:
virtual ~InputDeviceImpl() {}
private:
void operator=(InputDeviceImpl const &); // no assign
};
public:
private:
};
public:
private:
};
: InputDevice(),
id(),
link(),
liveAxes(0),
liveButtons(0)
{
switch ( source ) {
case Gdk::SOURCE_MOUSE:
id = "M:";
break;
case Gdk::SOURCE_CURSOR:
id = "C:";
break;
case Gdk::SOURCE_PEN:
id = "P:";
break;
case Gdk::SOURCE_ERASER:
id = "E:";
break;
default:
id = "?:";
}
}
class DeviceManagerImpl : public DeviceManager {
public:
protected:
};
devices()
{
if ( !fakeList ) {
}
// devList = fakeList;
if ( dev ) {
// g_message("device: name[%s] source[0x%x] mode[0x%x] cursor[%s] axis count[%d] key count[%d]", dev->name, dev->source, dev->mode,
// dev->has_cursor?"Yes":"no", dev->num_axes, dev->num_keys);
}
}
}
{
for ( std::list<InputDeviceImpl*>::const_iterator it = devices.begin(); it != devices.end(); ++it ) {
}
return tmp;
}
{
return signalDeviceChangedPriv;
}
{
return signalAxesChangedPriv;
}
{
return signalButtonsChangedPriv;
}
{
return signalLinkChangedPriv;
}
{
std::list<InputDeviceImpl*>::iterator it = std::find_if(devices.begin(), devices.end(), IdMatcher(id));
// Only signal if a new axis was added
}
}
}
}
{
std::list<InputDeviceImpl*>::iterator it = std::find_if(devices.begin(), devices.end(), IdMatcher(id));
// Only signal if a new button was added
}
}
}
}
{
std::list<InputDeviceImpl*>::iterator it = std::find_if(devices.begin(), devices.end(), IdMatcher(id));
// Need to be sure the target of the link exists
// only muck about if they aren't already linked
// Is something else already using that link?
}
}
for ( std::list<InputDeviceImpl*>::const_iterator iter = changedItems.begin(); iter != changedItems.end(); ++iter ) {
}
}
}
}
}
static DeviceManagerImpl* theInstance = 0;
{
}
DeviceManager::~DeviceManager() {
}
if ( !theInstance ) {
theInstance = new DeviceManagerImpl();
}
return *theInstance;
}
} // namespace Inkscape
GdkDeviceKey padKeys[] = {{0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0},
{0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0}};
GdkDeviceKey eraserKeys[] = {{0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0},
GdkDeviceKey cursorKeys[] = {{0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0},
GdkDeviceKey stylusKeys[] = {{0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0},
static void createFakeList() {
if ( !fakeList ) {
// try to find the first *real* core pointer
}
} else {
}
}
}
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :