Code

Split data mode apart from UI and added button trackers
authorjoncruz <joncruz@users.sourceforge.net>
Sat, 15 Mar 2008 08:42:17 +0000 (08:42 +0000)
committerjoncruz <joncruz@users.sourceforge.net>
Sat, 15 Mar 2008 08:42:17 +0000 (08:42 +0000)
src/Makefile_insert
src/desktop.cpp
src/device-manager.cpp [new file with mode: 0644]
src/device-manager.h [new file with mode: 0644]
src/ui/dialog/input.cpp

index c9ba189b46d981d853e878e0b53363fa0295f37c..99fed18c37a3aca5f03a22d8c1be7da5d30b2648 100644 (file)
@@ -60,6 +60,8 @@ libinkpre_a_SOURCES = \
        desktop-handles.cpp desktop-handles.h   \
        desktop-style.cpp desktop-style.h       \
        desktop.cpp desktop.h   \
+       device-manager.cpp      \
+       device-manager.h        \
        document-undo.cpp       \
        document.cpp document.h document-private.h      \
        document-subset.cpp document-subset.h   \
index f9d17b01ad6bbc5e938c8c9c5df0e2b8007427ab..922da935dc8d689a5f354dc22171165f73f02ff5 100644 (file)
@@ -84,6 +84,7 @@
 #include "ui/dialog/dialog-manager.h"
 #include "xml/repr.h"
 #include "message-context.h"
+#include "device-manager.h"
 #include "layer-manager.h"
 #include "event-log.h"
 #include "display/canvas-grid.h"
@@ -164,6 +165,9 @@ SPDesktop::SPDesktop() :
 void
 SPDesktop::init (SPNamedView *nv, SPCanvas *aCanvas)
 {
+    // Temporary workaround for link order issues:
+    Inkscape::DeviceManager::getManager().getDevices();
+
     _guides_message_context = new Inkscape::MessageContext(const_cast<Inkscape::MessageStack*>(messageStack()));
 
     current = sp_repr_css_attr_inherited (inkscape_get_repr (INKSCAPE, "desktop"), "style");
diff --git a/src/device-manager.cpp b/src/device-manager.cpp
new file mode 100644 (file)
index 0000000..24ebbca
--- /dev/null
@@ -0,0 +1,225 @@
+
+/*
+ * 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 "device-manager.h"
+
+
+static void createFakeList();
+GdkDevice fakeout[5];
+static GList* fakeList = 0;
+
+
+namespace Inkscape {
+
+InputDevice::InputDevice() {}
+InputDevice::~InputDevice() {}
+
+class InputDeviceImpl : public InputDevice {
+public:
+    virtual Glib::ustring getName() const {return Glib::ustring(device->name);}
+    virtual Gdk::InputSource getSource() const {return static_cast<Gdk::InputSource>(device->source);}
+    virtual Gdk::InputMode getMode() const {return static_cast<Gdk::InputMode>(device->mode);}
+    virtual bool hasCursor() const {return device->has_cursor;}
+    virtual gint getNumAxes() const {return device->num_axes;}
+    virtual gint getNumKeys() const {return device->num_keys;}
+
+    InputDeviceImpl(GdkDevice* device);
+    virtual ~InputDeviceImpl() {}
+
+private:
+    InputDeviceImpl(InputDeviceImpl const &); // no copy
+    void operator=(InputDeviceImpl const &); // no assign
+
+    GdkDevice* device;
+};
+
+InputDeviceImpl::InputDeviceImpl(GdkDevice* device)
+    : InputDevice(),
+      device(device)
+{
+}
+
+
+
+
+
+
+
+
+class DeviceManagerImpl : public DeviceManager {
+public:
+    DeviceManagerImpl();
+    virtual std::list<InputDevice const *> getDevices();
+
+protected:
+    std::list<InputDeviceImpl*> devices;
+};
+
+DeviceManagerImpl::DeviceManagerImpl() :
+    DeviceManager(),
+    devices()
+{
+    GList* devList = gdk_devices_list();
+
+    if ( !fakeList ) {
+        createFakeList();
+    }
+    devList = fakeList;
+
+    for ( GList* curr = devList; curr; curr = g_list_next(curr) ) {
+        GdkDevice* dev = reinterpret_cast<GdkDevice*>(curr->data);
+        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);
+
+            InputDeviceImpl* device = new InputDeviceImpl(dev);
+            devices.push_back(device);
+        }
+    }
+}
+
+std::list<InputDevice const *> DeviceManagerImpl::getDevices()
+{
+    std::list<InputDevice const *> tmp;
+    for ( std::list<InputDeviceImpl*>::const_iterator it = devices.begin(); it != devices.end(); ++it ) {
+        tmp.push_back(*it);
+    }
+    return tmp;
+}
+
+
+static DeviceManagerImpl* theInstance = 0;
+
+DeviceManager::DeviceManager() {
+}
+
+DeviceManager::~DeviceManager() {
+}
+
+DeviceManager& DeviceManager::getManager() {
+    if ( !theInstance ) {
+        theInstance = new DeviceManagerImpl();
+    }
+
+    return *theInstance;
+}
+
+} // namespace Inkscape
+
+
+
+
+
+
+GdkDeviceAxis padAxes[] = {{GDK_AXIS_X, 0.0, 0.0},
+                           {GDK_AXIS_Y, 0.0, 0.0},
+                           {GDK_AXIS_PRESSURE, 0.0, 1.0},
+                           {GDK_AXIS_XTILT, -1.0, 1.0},
+                           {GDK_AXIS_YTILT, -1.0, 1.0},
+                           {GDK_AXIS_WHEEL, 0.0, 1.0}};
+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}};
+
+GdkDeviceAxis eraserAxes[] = {{GDK_AXIS_X, 0.0, 0.0},
+                              {GDK_AXIS_Y, 0.0, 0.0},
+                              {GDK_AXIS_PRESSURE, 0.0, 1.0},
+                              {GDK_AXIS_XTILT, -1.0, 1.0},
+                              {GDK_AXIS_YTILT, -1.0, 1.0},
+                              {GDK_AXIS_WHEEL, 0.0, 1.0}};
+GdkDeviceKey eraserKeys[] = {{0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0},
+                             {0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0}};
+
+GdkDeviceAxis cursorAxes[] = {{GDK_AXIS_X, 0.0, 0.0},
+                              {GDK_AXIS_Y, 0.0, 0.0},
+                              {GDK_AXIS_PRESSURE, 0.0, 1.0},
+                              {GDK_AXIS_XTILT, -1.0, 1.0},
+                              {GDK_AXIS_YTILT, -1.0, 1.0},
+                              {GDK_AXIS_WHEEL, 0.0, 1.0}};
+GdkDeviceKey cursorKeys[] = {{0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0},
+                             {0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0}};
+
+GdkDeviceAxis stylusAxes[] = {{GDK_AXIS_X, 0.0, 0.0},
+                              {GDK_AXIS_Y, 0.0, 0.0},
+                              {GDK_AXIS_PRESSURE, 0.0, 1.0},
+                              {GDK_AXIS_XTILT, -1.0, 1.0},
+                              {GDK_AXIS_YTILT, -1.0, 1.0},
+                              {GDK_AXIS_WHEEL, 0.0, 1.0}};
+GdkDeviceKey stylusKeys[] = {{0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0},
+                             {0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0}};
+
+
+GdkDeviceAxis coreAxes[] = {{GDK_AXIS_X, 0.0, 0.0},
+                            {GDK_AXIS_Y, 0.0, 0.0}};
+
+static void createFakeList() {
+    if ( !fakeList ) {
+        fakeout[0].name = "pad";
+        fakeout[0].source = GDK_SOURCE_PEN;
+        fakeout[0].mode = GDK_MODE_SCREEN;
+        fakeout[0].has_cursor = TRUE;
+        fakeout[0].num_axes = 6;
+        fakeout[0].axes = padAxes;
+        fakeout[0].num_keys = 8;
+        fakeout[0].keys = padKeys;
+
+        fakeout[1].name = "eraser";
+        fakeout[1].source = GDK_SOURCE_ERASER;
+        fakeout[1].mode = GDK_MODE_SCREEN;
+        fakeout[1].has_cursor = TRUE;
+        fakeout[1].num_axes = 6;
+        fakeout[1].axes = eraserAxes;
+        fakeout[1].num_keys = 7;
+        fakeout[1].keys = eraserKeys;
+
+        fakeout[2].name = "cursor";
+        fakeout[2].source = GDK_SOURCE_CURSOR;
+        fakeout[2].mode = GDK_MODE_SCREEN;
+        fakeout[2].has_cursor = TRUE;
+        fakeout[2].num_axes = 6;
+        fakeout[2].axes = cursorAxes;
+        fakeout[2].num_keys = 7;
+        fakeout[2].keys = cursorKeys;
+
+        fakeout[3].name = "stylus";
+        fakeout[3].source = GDK_SOURCE_PEN;
+        fakeout[3].mode = GDK_MODE_SCREEN;
+        fakeout[3].has_cursor = TRUE;
+        fakeout[3].num_axes = 6;
+        fakeout[3].axes = stylusAxes;
+        fakeout[3].num_keys = 7;
+        fakeout[3].keys = stylusKeys;
+
+        fakeout[4].name = "Core Pointer";
+        fakeout[4].source = GDK_SOURCE_MOUSE;
+        fakeout[4].mode = GDK_MODE_SCREEN;
+        fakeout[4].has_cursor = TRUE;
+        fakeout[4].num_axes = 2;
+        fakeout[4].axes = coreAxes;
+        fakeout[4].num_keys = 0;
+        fakeout[4].keys = NULL;
+
+        for ( guint pos = 0; pos < G_N_ELEMENTS(fakeout); pos++) {
+            fakeList = g_list_append(fakeList, &(fakeout[pos]));
+        }
+    }
+}
+
+
+/*
+  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 :
diff --git a/src/device-manager.h b/src/device-manager.h
new file mode 100644 (file)
index 0000000..0b532aa
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * 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
+ */
+
+#ifndef SEEN_INKSCAPE_DEVICE_MANAGER_H
+#define SEEN_INKSCAPE_DEVICE_MANAGER_H
+
+
+#include <list>
+#include <glibmm/ustring.h>
+#include <gdkmm/device.h>
+
+namespace Inkscape {
+
+class InputDevice {
+public:
+    virtual Glib::ustring getName() const = 0;
+    virtual Gdk::InputSource getSource() const = 0;
+    virtual Gdk::InputMode getMode() const = 0;
+    virtual bool hasCursor() const = 0;
+    virtual gint getNumAxes() const = 0;
+    virtual gint getNumKeys() const = 0;
+
+protected:
+    InputDevice();
+    virtual ~InputDevice();
+
+private:
+    InputDevice(InputDevice const &); // no copy
+    void operator=(InputDevice const &); // no assign
+};
+
+class DeviceManager {
+public:
+    static DeviceManager& getManager();
+
+    virtual std::list<InputDevice const *> getDevices() = 0;
+
+protected:
+    DeviceManager();
+    virtual ~DeviceManager();
+
+private:
+    DeviceManager(DeviceManager const &); // no copy
+    void operator=(DeviceManager const &); // no assign
+};
+
+
+
+} // namespace Inkscape
+
+#endif // SEEN_INKSCAPE_DEVICE_MANAGER_H
+
+/*
+  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 :
index 9b2681b62a9d910149421953f66eff0615e41bf7..0d4deb14e8fb09c42b2a9fec2adfd28a703b45d2 100644 (file)
@@ -157,8 +157,61 @@ static char *tip[] = {
 "OOO . OOOOOOOOOO",
 "OO . OOOOOOOOOOO",
 "OO  OOOOOOOOOOOO",
-"OOOOOOOOOOOOOOOO",
-"OOOOOOOOOOOOOOOO"
+"OOOOXXXXXOOOOOOO",
+"OOOOOOOOOXXXXXOO"
+};
+
+/* XPM */
+static char *button_none[] = {
+/* columns rows colors chars-per-pixel */
+"8 8 3 1",
+"  c black",
+". c #808080",
+"X c None",
+/* pixels */
+"XXXXXXXX",
+"XX .. XX",
+"X .XX. X",
+"X.XXXX.X",
+"X.XXXX.X",
+"X .XX. X",
+"XX .. XX",
+"XXXXXXXX"
+};
+/* XPM */
+static char *button_off[] = {
+/* columns rows colors chars-per-pixel */
+"8 8 4 1",
+"  c black",
+". c #808080",
+"X c gray100",
+"o c None",
+/* pixels */
+"oooooooo",
+"oo.  .oo",
+"o. XX .o",
+"o XXXX o",
+"o XXXX o",
+"o. XX .o",
+"oo.  .oo",
+"oooooooo"
+};
+/* XPM */
+static char *button_on[] = {
+/* columns rows colors chars-per-pixel */
+"8 8 3 1",
+"  c black",
+". c green",
+"X c None",
+/* pixels */
+"XXXXXXXX",
+"XX    XX",
+"X  ..  X",
+"X .... X",
+"X .... X",
+"X  ..  X",
+"XX    XX",
+"XXXXXXXX"
 };
 
 
@@ -186,17 +239,16 @@ static char *tip[] = {
 #include <gtkmm/treeview.h>
 
 #include "ui/widget/panel.h"
+#include "device-manager.h"
 
 #include "input.h"
 
+using Inkscape::InputDevice;
+
 namespace Inkscape {
 namespace UI {
 namespace Dialog {
 
-static void createFakeList();
-GdkDevice fakeout[5];
-static GList* fakeList = 0;
-
 
 
 class MyModelColumns : public Gtk::TreeModel::ColumnRecord
@@ -205,7 +257,7 @@ public:
     Gtk::TreeModelColumn<Glib::ustring>                filename;
     Gtk::TreeModelColumn<Glib::ustring>                description;
     Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> >  thumbnail;
-    Gtk::TreeModelColumn<GdkDevice*>                   device;
+    Gtk::TreeModelColumn<InputDevice const *>          device;
 
     MyModelColumns() { add(filename); add(description); add(thumbnail); add(device); }
 };
@@ -223,6 +275,10 @@ private:
     Glib::RefPtr<Gdk::Pixbuf> eraserPix;
     Glib::RefPtr<Gdk::Pixbuf> sidebuttonsPix;
 
+    Glib::RefPtr<Gdk::Pixbuf> buttonsNonePix;
+    Glib::RefPtr<Gdk::Pixbuf> buttonsOnPix;
+    Glib::RefPtr<Gdk::Pixbuf> buttonsOffPix;
+
     std::map<Glib::ustring, std::set<guint> > buttonMap;
 
     GdkInputSource lastSourceSeen;
@@ -249,6 +305,8 @@ private:
     Gtk::HPaned confSplitter;
     Gtk::Notebook topHolder;
     Gtk::Image testThumb;
+    Gtk::Image testButtons[24];
+    Gtk::Table imageTable;
     Gtk::EventBox testDetector;
 
     void setupValueAndCombo( gint reported, gint actual, Gtk::Label& label, Gtk::ComboBoxText& combo );
@@ -275,6 +333,10 @@ InputDialogImpl::InputDialogImpl() :
     eraserPix(Gdk::Pixbuf::create_from_xpm_data(eraser)),
     sidebuttonsPix(Gdk::Pixbuf::create_from_xpm_data(sidebuttons)),
 
+    buttonsNonePix(Gdk::Pixbuf::create_from_xpm_data(button_none)),
+    buttonsOnPix(Gdk::Pixbuf::create_from_xpm_data(button_on)),
+    buttonsOffPix(Gdk::Pixbuf::create_from_xpm_data(button_off)),
+
     lastSourceSeen((GdkInputSource)-1),
     lastDevnameSeen(""),
     cols(),
@@ -289,7 +351,8 @@ InputDialogImpl::InputDialogImpl() :
     modeCombo(),
     devDetails(6, 2),
     confSplitter(),
-    topHolder()
+    topHolder(),
+    imageTable(8, 4)
 {
     Gtk::Box *contents = _getContents();
 
@@ -301,10 +364,25 @@ InputDialogImpl::InputDialogImpl() :
     splitter.pack1(treeScroller);
     splitter.pack2(split2);
 
-    testDetector.add(testThumb);
+    testDetector.add(imageTable);
     testFrame.add(testDetector);
     testThumb.set(tabletPix);
     testThumb.set_padding(24, 24);
+    imageTable.attach(testThumb, 0, 8, 0, 1, ::Gtk::EXPAND, ::Gtk::EXPAND);
+    {
+        guint col = 0;
+        guint row = 1;
+        for ( guint num = 0; num < 24; num++ ) {
+            testButtons[num].set(buttonsNonePix);
+            imageTable.attach(testButtons[num], col, col + 1, row, row + 1, ::Gtk::FILL, ::Gtk::FILL);
+            col++;
+            if (col > 7) {
+                col = 0;
+                row++;
+            }
+        }
+    }
+
 
     topHolder.append_page(confSplitter, "Configuration");
     topHolder.append_page(splitter, "Hardware");
@@ -431,12 +509,9 @@ InputDialogImpl::InputDialogImpl() :
     tree.get_selection()->signal_changed().connect(sigc::mem_fun(*this, &InputDialogImpl::foo));
 
 
-    GList* devList = gdk_devices_list();
-    if ( !fakeList ) {
-        createFakeList();
-    }
-//     devList = fakeList;
-    if ( devList ) {
+
+    std::list<InputDevice const *> devList = Inkscape::DeviceManager::getManager().getDevices();
+    if ( !devList.empty() ) {
         g_message("Found some");
 
         {
@@ -455,17 +530,17 @@ InputDialogImpl::InputDialogImpl() :
         childrow[cols.description] = "Tablet";
         childrow[cols.thumbnail] = tabletPix;
 
-        for ( GList* curr = devList; curr; curr = g_list_next(curr) ) {
-            GdkDevice* dev = reinterpret_cast<GdkDevice*>(curr->data);
+        for ( std::list<InputDevice const *>::iterator it = devList.begin(); it != devList.end(); ++it ) {
+            InputDevice const* dev = *it;
             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);
+                g_message("device: name[%s] source[0x%x] mode[0x%x] cursor[%s] axis count[%d] key count[%d]", dev->getName().c_str(), dev->getSource(), dev->getMode(),
+                          dev->hasCursor() ? "Yes":"no", dev->getNumAxes(), dev->getNumKeys());
 
-                if ( dev->source != GDK_SOURCE_MOUSE ) {
+                if ( dev->getSource() != Gdk::SOURCE_MOUSE ) {
                     deviceRow = *(store->append(childrow.children()));
-                    deviceRow[cols.description] = dev->name;
+                    deviceRow[cols.description] = dev->getName();
                     deviceRow[cols.device] = dev;
-                    switch ( dev->source ) {
+                    switch ( dev->getSource() ) {
                         case GDK_SOURCE_PEN:
                             if (deviceRow[cols.description] == "pad") {
                                 deviceRow[cols.thumbnail] = sidebuttonsPix;
@@ -503,11 +578,11 @@ void InputDialogImpl::foo() {
     if (iter) {
         Gtk::TreeModel::Row row = *iter;
         Glib::ustring val = row[cols.description];
-        GdkDevice* dev = row[cols.device];
+        InputDevice const * dev = row[cols.device];
         if ( dev ) {
             devDetails.set_sensitive(true);
             modeCombo.set_sensitive(true);
-            switch( dev->mode ) {
+            switch( dev->getMode() ) {
                 case GDK_MODE_DISABLED:
                     modeCombo.set_active(0);
                     break;
@@ -522,8 +597,8 @@ void InputDialogImpl::foo() {
             }
             clear = false;
             devName.set_label(row[cols.description]);
-            setupValueAndCombo( dev->num_axes, dev->num_axes, devAxesCount, axesCombo);
-            setupValueAndCombo( dev->num_keys, dev->num_keys, devKeyCount, buttonCombo);
+            setupValueAndCombo( dev->getNumAxes(), dev->getNumAxes(), devAxesCount, axesCombo);
+            setupValueAndCombo( dev->getNumKeys(), dev->getNumKeys(), devKeyCount, buttonCombo);
         }
     }
 
@@ -603,6 +678,17 @@ bool InputDialogImpl::eventSnoop(GdkEvent* event)
                     g_message("New button found for %s = %d", key.c_str(), btnEvt->button);
                     buttonMap[key].insert(btnEvt->button);
                 }
+                for ( guint i = 0; i < 24; i++ ) {
+                    if ( buttonMap[key].find(i) != buttonMap[key].end() ) {
+                        if (modmod && (i == btnEvt->button) ) {
+                            testButtons[i].set(buttonsOnPix);
+                        } else {
+                            testButtons[i].set(buttonsOffPix);
+                        }
+                    } else {
+                        testButtons[i].set(buttonsNonePix);
+                    }
+                }
             }
             gchar* name = gtk_accelerator_name(0, static_cast<GdkModifierType>(btnEvt->state));
             keyVal.set_label(name);
@@ -685,105 +771,6 @@ bool InputDialogImpl::eventSnoop(GdkEvent* event)
 }
 
 
-
-
-
-GdkDeviceAxis padAxes[] = {{GDK_AXIS_X, 0.0, 0.0},
-                           {GDK_AXIS_Y, 0.0, 0.0},
-                           {GDK_AXIS_PRESSURE, 0.0, 1.0},
-                           {GDK_AXIS_XTILT, -1.0, 1.0},
-                           {GDK_AXIS_YTILT, -1.0, 1.0},
-                           {GDK_AXIS_WHEEL, 0.0, 1.0}};
-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}};
-
-GdkDeviceAxis eraserAxes[] = {{GDK_AXIS_X, 0.0, 0.0},
-                              {GDK_AXIS_Y, 0.0, 0.0},
-                              {GDK_AXIS_PRESSURE, 0.0, 1.0},
-                              {GDK_AXIS_XTILT, -1.0, 1.0},
-                              {GDK_AXIS_YTILT, -1.0, 1.0},
-                              {GDK_AXIS_WHEEL, 0.0, 1.0}};
-GdkDeviceKey eraserKeys[] = {{0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0},
-                             {0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0}};
-
-GdkDeviceAxis cursorAxes[] = {{GDK_AXIS_X, 0.0, 0.0},
-                              {GDK_AXIS_Y, 0.0, 0.0},
-                              {GDK_AXIS_PRESSURE, 0.0, 1.0},
-                              {GDK_AXIS_XTILT, -1.0, 1.0},
-                              {GDK_AXIS_YTILT, -1.0, 1.0},
-                              {GDK_AXIS_WHEEL, 0.0, 1.0}};
-GdkDeviceKey cursorKeys[] = {{0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0},
-                             {0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0}};
-
-GdkDeviceAxis stylusAxes[] = {{GDK_AXIS_X, 0.0, 0.0},
-                              {GDK_AXIS_Y, 0.0, 0.0},
-                              {GDK_AXIS_PRESSURE, 0.0, 1.0},
-                              {GDK_AXIS_XTILT, -1.0, 1.0},
-                              {GDK_AXIS_YTILT, -1.0, 1.0},
-                              {GDK_AXIS_WHEEL, 0.0, 1.0}};
-GdkDeviceKey stylusKeys[] = {{0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0},
-                             {0, (GdkModifierType)0}, {0, (GdkModifierType)0}, {0, (GdkModifierType)0}};
-
-
-GdkDeviceAxis coreAxes[] = {{GDK_AXIS_X, 0.0, 0.0},
-                            {GDK_AXIS_Y, 0.0, 0.0}};
-
-
-static void createFakeList() {
-    if ( !fakeList ) {
-        fakeout[0].name = "pad";
-        fakeout[0].source = GDK_SOURCE_PEN;
-        fakeout[0].mode = GDK_MODE_SCREEN;
-        fakeout[0].has_cursor = TRUE;
-        fakeout[0].num_axes = 6;
-        fakeout[0].axes = padAxes;
-        fakeout[0].num_keys = 8;
-        fakeout[0].keys = padKeys;
-
-        fakeout[1].name = "eraser";
-        fakeout[1].source = GDK_SOURCE_ERASER;
-        fakeout[1].mode = GDK_MODE_SCREEN;
-        fakeout[1].has_cursor = TRUE;
-        fakeout[1].num_axes = 6;
-        fakeout[1].axes = eraserAxes;
-        fakeout[1].num_keys = 7;
-        fakeout[1].keys = eraserKeys;
-
-        fakeout[2].name = "cursor";
-        fakeout[2].source = GDK_SOURCE_CURSOR;
-        fakeout[2].mode = GDK_MODE_SCREEN;
-        fakeout[2].has_cursor = TRUE;
-        fakeout[2].num_axes = 6;
-        fakeout[2].axes = cursorAxes;
-        fakeout[2].num_keys = 7;
-        fakeout[2].keys = cursorKeys;
-
-        fakeout[3].name = "stylus";
-        fakeout[3].source = GDK_SOURCE_PEN;
-        fakeout[3].mode = GDK_MODE_SCREEN;
-        fakeout[3].has_cursor = TRUE;
-        fakeout[3].num_axes = 6;
-        fakeout[3].axes = stylusAxes;
-        fakeout[3].num_keys = 7;
-        fakeout[3].keys = stylusKeys;
-
-        fakeout[4].name = "Core Pointer";
-        fakeout[4].source = GDK_SOURCE_MOUSE;
-        fakeout[4].mode = GDK_MODE_SCREEN;
-        fakeout[4].has_cursor = TRUE;
-        fakeout[4].num_axes = 2;
-        fakeout[4].axes = coreAxes;
-        fakeout[4].num_keys = 0;
-        fakeout[4].keys = NULL;
-
-        for ( guint pos = 0; pos < G_N_ELEMENTS(fakeout); pos++) {
-            fakeList = g_list_append(fakeList, &(fakeout[pos]));
-        }
-    }
-}
-
-
-
 } // end namespace Inkscape
 } // end namespace UI
 } // end namespace Dialog