From: joncruz Date: Sat, 15 Mar 2008 08:42:17 +0000 (+0000) Subject: Split data mode apart from UI and added button trackers X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=55919b10f5e27d2fa50c03ca269bce594f5c8d82;p=inkscape.git Split data mode apart from UI and added button trackers --- diff --git a/src/Makefile_insert b/src/Makefile_insert index c9ba189b4..99fed18c3 100644 --- a/src/Makefile_insert +++ b/src/Makefile_insert @@ -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 \ diff --git a/src/desktop.cpp b/src/desktop.cpp index f9d17b01a..922da935d 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -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(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 index 000000000..24ebbca69 --- /dev/null +++ b/src/device-manager.cpp @@ -0,0 +1,225 @@ + +/* + * Inkscape::DeviceManager - a view of input devices available. + * + * Copyright 2006 Jon A. Cruz + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#include + +#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(device->source);} + virtual Gdk::InputMode getMode() const {return static_cast(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 getDevices(); + +protected: + std::list 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(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 DeviceManagerImpl::getDevices() +{ + std::list tmp; + for ( std::list::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 index 000000000..0b532aae2 --- /dev/null +++ b/src/device-manager.h @@ -0,0 +1,67 @@ +/* + * Inkscape::DeviceManager - a view of input devices available. + * + * Copyright 2006 Jon A. Cruz + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#ifndef SEEN_INKSCAPE_DEVICE_MANAGER_H +#define SEEN_INKSCAPE_DEVICE_MANAGER_H + + +#include +#include +#include + +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 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 : diff --git a/src/ui/dialog/input.cpp b/src/ui/dialog/input.cpp index 9b2681b62..0d4deb14e 100644 --- a/src/ui/dialog/input.cpp +++ b/src/ui/dialog/input.cpp @@ -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 #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 filename; Gtk::TreeModelColumn description; Gtk::TreeModelColumn< Glib::RefPtr > thumbnail; - Gtk::TreeModelColumn device; + Gtk::TreeModelColumn device; MyModelColumns() { add(filename); add(description); add(thumbnail); add(device); } }; @@ -223,6 +275,10 @@ private: Glib::RefPtr eraserPix; Glib::RefPtr sidebuttonsPix; + Glib::RefPtr buttonsNonePix; + Glib::RefPtr buttonsOnPix; + Glib::RefPtr buttonsOffPix; + std::map > 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 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(curr->data); + for ( std::list::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(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