/**
* @file
* Input devices dialog (new) - implementation.
*/
/* Author:
* Jon A. Cruz
*
* Copyright (C) 2008 Author
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
#include <map>
#include <set>
#include <list>
#include <gtkmm/alignment.h>
#include <gtkmm/buttonbox.h>
#include <gtkmm/cellrenderercombo.h>
#include <gtkmm/checkbutton.h>
#include <gtkmm/comboboxtext.h>
#include <gtkmm/eventbox.h>
#include <gtkmm/liststore.h>
#include <gtkmm/notebook.h>
#include <gtkmm/progressbar.h>
#include <gtkmm/scrolledwindow.h>
#if WITH_GTKMM_3_0
#else
#endif
#include <gtkmm/treemodel.h>
#include <gtkmm/treemodelcolumn.h>
#include <gtkmm/treestore.h>
#include <gtkmm/treeview.h>
#include "device-manager.h"
#include "preferences.h"
#include "input.h"
/* XPM */
static char const * core_xpm[] = {
"16 16 4 1",
" c None",
". c #808080",
"+ c #000000",
"@ c #FFFFFF",
" ",
" ",
" ",
" .++++++. ",
" +@+@@+@+ ",
" +@+@@+@+ ",
" +.+..+.+ ",
" +@@@@@@+ ",
" +@@@@@@+ ",
" +@@@@@@+ ",
" +@@@@@@+ ",
" +@@@@@@+ ",
" .++++++. ",
" ",
" ",
" "};
/* XPM */
static char const *eraser[] = {
/* columns rows colors chars-per-pixel */
"16 16 5 1",
" c black",
". c green",
"X c #808080",
"o c gray100",
"O c None",
/* pixels */
"OOOOOOOOOOOOOOOO",
"OOOOOOOOOOOOO OO",
"OOOOOOOOOOOO . O",
"OOOOOOOOOOO . OO",
"OOOOOOOOOO . OOO",
"OOOOOOOOO . OOOO",
"OOOOOOOO . OOOOO",
"OOOOOOOXo OOOOOO",
"OOOOOOXoXOOOOOOO",
"OOOOOXoXOOOOOOOO",
"OOOOXoXOOOOOOOOO",
"OOOXoXOOOOOOOOOO",
"OOXoXOOOOOOOOOOO",
"OOXXOOOOOOOOOOOO",
"OOOOOOOOOOOOOOOO",
"OOOOOOOOOOOOOOOO"
};
/* XPM */
static char const *mouse[] = {
/* columns rows colors chars-per-pixel */
"16 16 3 1",
" c black",
". c gray100",
"X c None",
/* pixels */
"XXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXX",
"XXXXXXX XXXXXXX",
"XXXXX . XXXXXXX",
"XXXX .... XXXXXX",
"XXXX .... XXXXXX",
"XXXXX .... XXXXX",
"XXXXX .... XXXXX",
"XXXXXX .... XXXX",
"XXXXXX .... XXXX",
"XXXXXXX . XXXXX",
"XXXXXXX XXXXXXX",
"XXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXX"
};
/* XPM */
static char const *pen[] = {
/* columns rows colors chars-per-pixel */
"16 16 3 1",
" c black",
". c gray100",
"X c None",
/* pixels */
"XXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXX XX",
"XXXXXXXXXXXX . X",
"XXXXXXXXXXX . XX",
"XXXXXXXXXX . XXX",
"XXXXXXXXX . XXXX",
"XXXXXXXX . XXXXX",
"XXXXXXX . XXXXXX",
"XXXXXX . XXXXXXX",
"XXXXX . XXXXXXXX",
"XXXX . XXXXXXXXX",
"XXX . XXXXXXXXXX",
"XX . XXXXXXXXXXX",
"XX XXXXXXXXXXXX",
"XXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXX"
};
/* XPM */
static char const *sidebuttons[] = {
/* columns rows colors chars-per-pixel */
"16 16 4 1",
" c black",
". c #808080",
"o c green",
"O c None",
/* pixels */
"OOOOOOOOOOOOOOOO",
"OOOOOOOOOOOOOOOO",
"O..............O",
"O.OOOOOOOOOOOO.O",
"O OOOOOOOO O",
"O o OOOOOOOO o O",
"O o OOOOOOOO o O",
"O OOOOOOOO O",
"O.OOOOOOOOOOOO.O",
"O.OOOOOOOOOOOO.O",
"O.OOOOOOOOOOOO.O",
"O.OOOOOOOOOOOO.O",
"O.OOOOOOOOOOOO.O",
"O..............O",
"OOOOOOOOOOOOOOOO",
"OOOOOOOOOOOOOOOO"
};
/* XPM */
static char const *tablet[] = {
/* columns rows colors chars-per-pixel */
"16 16 3 1",
" c black",
". c gray100",
"X c None",
/* pixels */
"XXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXX",
"X X",
"X ............ X",
"X ............ X",
"X ............ X",
"X ............ X",
"X ............ X",
"X ............ X",
"X ............ X",
"X ............ X",
"X ............ X",
"X ............ X",
"X X",
"XXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXX"
};
/* XPM */
static char const *tip[] = {
/* columns rows colors chars-per-pixel */
"16 16 5 1",
" c black",
". c green",
"X c #808080",
"o c gray100",
"O c None",
/* pixels */
"OOOOOOOOOOOOOOOO",
"OOOOOOOOOOOOOXOO",
"OOOOOOOOOOOOXoXO",
"OOOOOOOOOOOXoXOO",
"OOOOOOOOOOXoXOOO",
"OOOOOOOOOXoXOOOO",
"OOOOOOOOXoXOOOOO",
"OOOOOOO oXOOOOOO",
"OOOOOO . OOOOOOO",
"OOOOO . OOOOOOOO",
"OOOO . OOOOOOOOO",
"OOO . OOOOOOOOOO",
"OO . OOOOOOOOOOO",
"OO OOOOOOOOOOOO",
"OOOOXXXXXOOOOOOO",
"OOOOOOOOOXXXXXOO"
};
/* XPM */
static char const *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.XX X.X",
"X.X XX.X",
"X .XX. X",
"XX .. XX",
"XXXXXXXX"
};
/* XPM */
static char const *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 const *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"
};
/* XPM */
static char const * axis_none_xpm[] = {
"24 8 3 1",
" c None",
". c #000000",
"+ c #808080",
" ",
" .++++++++++++++++++. ",
" .+ . .+. ",
" + . . . + ",
" + . . . + ",
" .+. . +. ",
" .++++++++++++++++++. ",
" "};
/* XPM */
static char const * axis_off_xpm[] = {
"24 8 4 1",
" c None",
". c #808080",
"+ c #000000",
"@ c #FFFFFF",
" ",
" .++++++++++++++++++. ",
" .+@@@@@@@@@@@@@@@@@@+. ",
" +@@@@@@@@@@@@@@@@@@@@+ ",
" +@@@@@@@@@@@@@@@@@@@@+ ",
" .+@@@@@@@@@@@@@@@@@@+. ",
" .++++++++++++++++++. ",
" "};
/* XPM */
static char const * axis_on_xpm[] = {
"24 8 3 1",
" c None",
". c #000000",
"+ c #00FF00",
" ",
" .................... ",
" ..++++++++++++++++++.. ",
" .++++++++++++++++++++. ",
" .++++++++++++++++++++. ",
" ..++++++++++++++++++.. ",
" .................... ",
" "};
using Inkscape::InputDevice;
namespace Inkscape {
namespace UI {
namespace Dialog {
{
public:
DeviceModelColumns() { add(toggler), add(expander), add(description); add(thumbnail); add(device); add(mode); }
};
{
}
return mapping;
}
{
return 0;
}
{
}
return mapping;
}
public:
virtual ~InputDialogImpl() {}
private:
{
public:
ConfPanel();
~ConfPanel();
{
public:
virtual ~Blink();
};
static void commitCellModeChange(Glib::ustring const &path, Glib::ustring const &newText, Glib::RefPtr<Gtk::TreeStore> store);
void saveSettings();
void onTreeSelect();
void useExtToggled();
void onModeChange();
#if WITH_GTKMM_3_0
#else
#endif
{
public:
{
}
virtual ~KeysColumns() {}
};
};
static DeviceModelColumns &getCols();
#if WITH_GTKMM_3_0
#else
#endif
#if WITH_GTKMM_3_0
#else
#endif
#if WITH_GTKMM_3_0
#else
#endif
void linkComboChanged();
void resyncToSelection();
static void updateDeviceLinks(Glib::RefPtr<InputDevice const> device, Gtk::TreeIter tabletIter, Glib::RefPtr<Gtk::TreeView> tree);
}; // class InputDialogImpl
{
return cols;
}
{
}
return pix;
}
// Now that we've defined the *Impl class, we can do the method to aquire one.
{
return *dialog;
}
InputDialog(),
lastDevnameSeen(""),
deviceIter(),
testFrame(_("Test Area")),
axisFrame(_("Axis")),
treeScroller(),
splitter(),
#if WITH_GTKMM_3_0
axisTable(),
#else
split2(),
#endif
linkCombo(),
topHolder(),
#if WITH_GTKMM_3_0
imageTable(),
#else
#endif
testDetector(),
cfgPanel()
{
#if WITH_GTKMM_3_0
#else
#endif
{
#if WITH_GTKMM_3_0
#else
#endif
col++;
if (col > 7) {
col = 0;
row++;
}
}
col = 0;
#if WITH_GTKMM_3_0
#else
#endif
col++;
if (col > 3) {
col = 0;
row++;
}
}
}
// This is a hidden preference to enable the "hardware" details in a separate tab
// By default this is not available to users
} else {
}
int rowNum = 0;
/* Gtk::Label* lbl = Gtk::manage(new Gtk::Label(_("Name:")));
axisTable.attach(*lbl, 0, 1, rowNum, rowNum+ 1,
::Gtk::FILL,
::Gtk::SHRINK);
axisTable.attach(devName, 1, 2, rowNum, rowNum + 1,
::Gtk::SHRINK,
::Gtk::SHRINK);
rowNum++;*/
#if WITH_GTKMM_3_0
#else
#endif
linkCombo.set_sensitive(false);
linkConnection = linkCombo.signal_changed().connect(sigc::mem_fun(*this, &InputDialogImpl::linkComboChanged));
#if WITH_GTKMM_3_0
#else
#endif
rowNum++;
#if WITH_GTKMM_3_0
#else
#endif
rowNum++;
/*
lbl = Gtk::manage(new Gtk::Label(_("Actual axes count:")));
devDetails.attach(*lbl, 0, 1, rowNum, rowNum+ 1,
::Gtk::FILL,
::Gtk::SHRINK);
devDetails.attach(axesCombo, 1, 2, rowNum, rowNum + 1,
::Gtk::SHRINK,
::Gtk::SHRINK);
rowNum++;
*/
#if WITH_GTKMM_3_0
lbl->set_hexpand();
#else
#endif
rowNum++;
}
#if WITH_GTKMM_3_0
#else
#endif
rowNum++;
/*
lbl = Gtk::manage(new Gtk::Label(_("Actual button count:")));
devDetails.attach(*lbl, 0, 1, rowNum, rowNum+ 1,
::Gtk::FILL,
::Gtk::SHRINK);
devDetails.attach(buttonCombo, 1, 2, rowNum, rowNum + 1,
::Gtk::SHRINK,
::Gtk::SHRINK);
rowNum++;
*/
#if WITH_GTKMM_3_0
#else
#endif
rowNum++;
// void gdk_input_set_extension_events (GdkWindow *window,
// gint mask,
// GdkExtensionMode mode);
// TODO: Extension event stuff has been removed from public API in GTK+ 3
// Need to check that this hasn't broken anything
#if !GTK_CHECK_VERSION(3,0,0)
#endif
testDetector.add_events(Gdk::POINTER_MOTION_MASK|Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK |Gdk::PROXIMITY_IN_MASK|Gdk::PROXIMITY_OUT_MASK|Gdk::SCROLL_MASK);
#if WITH_GTKMM_3_0
#else
#endif
rowNum++;
axisTable.set_sensitive(false);
/* detailScroller.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
detailScroller.set_shadow_type(Gtk::SHADOW_NONE);
detailScroller.set_border_width (0);
detailScroller.add(devDetails);*/
// gnome-dev-mouse-optical
// input-mouse
// input-tablet
// mouse
//Add the TreeView's view columns:
deviceTree.set_headers_visible(false);
deviceTree.get_selection()->signal_changed().connect(sigc::mem_fun(*this, &InputDialogImpl::resyncToSelection));
Inkscape::DeviceManager::getManager().signalDeviceChanged().connect(sigc::mem_fun(*this, &InputDialogImpl::handleDeviceChange));
Inkscape::DeviceManager::getManager().signalAxesChanged().connect(sigc::mem_fun(*this, &InputDialogImpl::updateDeviceAxes));
Inkscape::DeviceManager::getManager().signalButtonsChanged().connect(sigc::mem_fun(*this, &InputDialogImpl::updateDeviceButtons));
Inkscape::DeviceManager::getManager().signalLinkChanged().connect(sigc::bind(sigc::ptr_fun(&InputDialogImpl::updateDeviceLinks), deviceIter, treePtr));
}
class TabletTmp {
public:
TabletTmp() {}
};
{
bool match = true;
while ( match ) {
match = false;
break;
}
}
if (match) {
pos++;
}
} else {
match = false;
}
}
}
return result;
}
{
if (iter) {
}
}
}
{
std::list<Glib::RefPtr<InputDevice const> > devList = Inkscape::DeviceManager::getManager().getDevices();
//Gtk::TreeModel::Row row = *(store->append());
//row[getCols().description] = _("Hardware");
// Let's make some tablets!!!
// Phase 1 - figure out which tablets are present
for ( std::list<Glib::RefPtr<InputDevice const> >::iterator it = devList.begin(); it != devList.end(); ++it ) {
if ( dev ) {
}
}
} else {
g_warning("Null device in list");
}
}
// Phase 2 - build a UI for the present devices
// Check to see if we can derive one
for ( std::list<Glib::RefPtr<InputDevice const> >::iterator it2 = it->devices.begin(); it2 != it->devices.end(); ++it2 ) {
}
}
}
// Check if there is an eraser we can link to a pen
for ( std::list<Glib::RefPtr<InputDevice const> >::iterator it2 = it->devices.begin(); it2 != it->devices.end(); ++it2 ) {
for ( std::list<Glib::RefPtr<InputDevice const> >::iterator it3 = it->devices.begin(); it3 != it->devices.end(); ++it3 ) {
break; // only check the first eraser... for now
}
break; // only check the first pen... for now
}
}
}
for ( std::list<Glib::RefPtr<InputDevice const> >::iterator it2 = it->devices.begin(); it2 != it->devices.end(); ++it2 ) {
case GDK_SOURCE_MOUSE:
break;
case GDK_SOURCE_PEN:
} else {
}
break;
case GDK_SOURCE_CURSOR:
break;
case GDK_SOURCE_ERASER:
break;
default:
; // nothing
}
}
}
for ( std::list<Glib::RefPtr<InputDevice const> >::iterator it = devList.begin(); it != devList.end(); ++it ) {
}
}
} else {
g_warning("No devices found");
}
}
watcher(*this),
useExt(_("_Use pressure-sensitive tablet (requires restart)"), true),
save(_("_Save"), true),
detailsBox(false, 4),
titleFrame(false, 4),
titleLabel(""),
axisFrame(_("Axes")),
keysFrame(_("Keys")),
modeLabel(_("Mode:")),
modeBox(false, 4)
{
/* class Foo : public Gtk::TreeModel::ColumnRecord {
public :
Gtk::TreeModelColumn<Glib::ustring> one;
Foo() {add(one);}
};
static Foo foo;
//Add the TreeView's view columns:
{
Gtk::CellRendererToggle *rendr = new Gtk::CellRendererToggle();
Gtk::TreeViewColumn *col = new Gtk::TreeViewColumn("xx", *rendr);
if (col) {
confDeviceTree.append_column(*col);
col->set_cell_data_func(*rendr, sigc::ptr_fun(setCellStateToggle));
rendr->signal_toggled().connect(sigc::bind(sigc::ptr_fun(commitCellStateChange), confDeviceStore));
}
}*/
//int expPos = confDeviceTree.append_column("", getCols().expander);
//confDeviceTree.get_column(0)->set_fixed_width(100);
//confDeviceTree.get_column(1)->set_expand();
/* {
Gtk::TreeViewColumn *col = new Gtk::TreeViewColumn("X", *rendr);
if (col) {
confDeviceTree.append_column(*col);
col->set_cell_data_func(*rendr, sigc::ptr_fun(setModeCellString));
rendr->signal_edited().connect(sigc::bind(sigc::ptr_fun(commitCellModeChange), confDeviceStore));
rendr->property_editable() = true;
}
}*/
//confDeviceTree.set_enable_tree_lines();
confDeviceTree.property_enable_tree_lines() = false;
confDeviceTree.property_enable_grid_lines() = false;
confDeviceTree.set_headers_visible(false);
//confDeviceTree.set_expander_column( *confDeviceTree.get_column(expPos - 1) );
confDeviceTree.get_selection()->signal_changed().connect(sigc::mem_fun(*this, &InputDialogImpl::ConfPanel::onTreeSelect));
Inkscape::DeviceManager::getManager().signalLinkChanged().connect(sigc::bind(sigc::ptr_fun(&InputDialogImpl::updateDeviceLinks), confDeviceIter, treePtr));
#if WITH_GTKMM_3_0
#else
#endif
//Gtk::Alignment *align = new Gtk::Alignment(Gtk::ALIGN_END, Gtk::ALIGN_START, 0, 0);
//titleFrame.set_shadow_type(Gtk::SHADOW_IN);
modeCombo.set_tooltip_text(_("A device can be 'Disabled', its co-ordinates mapped to the whole 'Screen', or to a single (usually focused) 'Window'"));
modeCombo.signal_changed().connect(sigc::mem_fun(*this, &InputDialogImpl::ConfPanel::onModeChange));
/**
* Scrolled Window
*/
_kb_shortcut_renderer.property_editable() = true;
keysTree.set_headers_visible(false);
//keysTree.append_column("Value", _kb_shortcut_renderer);
//keysTree.get_column(1)->add_attribute(_kb_shortcut_renderer.property_text(), keysColumns.value);
//_kb_shortcut_renderer.signal_accel_edited().connect( sigc::mem_fun(*this, &InputDialogImpl::onKBTreeEdited) );
//_kb_shortcut_renderer.signal_accel_cleared().connect( sigc::mem_fun(*this, &InputDialogImpl::onKBTreeCleared) );
axisTree.set_headers_visible(false);
/**
* Scrolled Window
*/
pack_start(pane, true, true);
pack_start(*buttonBox, false, false);
// Select the first device
}
{
}
void InputDialogImpl::ConfPanel::setModeCellString(Gtk::CellRenderer *rndr, Gtk::TreeIter const &iter)
{
if (iter) {
if (combo) {
} else {
}
}
}
}
void InputDialogImpl::ConfPanel::commitCellModeChange(Glib::ustring const &path, Glib::ustring const &newText, Glib::RefPtr<Gtk::TreeStore> store)
{
if (iter) {
}
}
}
void InputDialogImpl::ConfPanel::setCellStateToggle(Gtk::CellRenderer *rndr, Gtk::TreeIter const &iter)
{
if (iter) {
if (toggle) {
if (dev) {
} else {
toggle->set_active(false);
}
}
}
}
void InputDialogImpl::ConfPanel::commitCellStateChange(Glib::ustring const &path, Glib::RefPtr<Gtk::TreeStore> store)
{
if (iter) {
if (dev) {
} else {
}
}
}
}
{
if (iter) {
if (dev) {
}
}
}
{
}
{
if (active) {
// As a work-around for a common problem, enable tablet toggles on the calligraphic tool.
// Covered in Launchpad bug #196195.
}
}
}
{
}
{
}
{
}
{
// g_message("OUCH!!!! for %p hits %s", &device, device->getId().c_str());
for (std::vector<Glib::RefPtr<Gtk::TreeStore> >::iterator it = stores.begin(); it != stores.end(); ++it) {
&deviceIter) );
if ( deviceIter ) {
}
}
}
}
{
}
}
}
}
{
}
}
}
}
{
bool stop = false;
if ( result ) {
}
stop = true;
}
return stop;
}
{
bool stop = false;
if ( result ) {
}
stop = true;
}
return stop;
}
void InputDialogImpl::updateDeviceLinks(Glib::RefPtr<InputDevice const> device, Gtk::TreeIter tabletIter, Glib::RefPtr<Gtk::TreeView> tree)
{
Glib::RefPtr<Gtk::TreeStore> deviceStore = Glib::RefPtr<Gtk::TreeStore>::cast_dynamic(tree->get_model());
// g_message("Links!!!! for %p hits [%s] with link of [%s]", &device, device->getId().c_str(), device->getLink().c_str());
&deviceIter) );
if ( deviceIter ) {
// Found the device concerned. Can proceed.
// is now unlinked
// g_message("Item %s is unlinked", device->getId().c_str());
// Not the child of the tablet. move on up
}
}
} else {
// is linking
// Simple case. Not already linked
&linkIter) );
if ( linkIter ) {
}
}
}
}
}
}
}
if (iter) {
if ( dev ) {
if ( linkCombo.get_active_row_number() == 0 ) {
// It is the "None" entry
} else {
std::list<Glib::RefPtr<InputDevice const> > devList = Inkscape::DeviceManager::getManager().getDevices();
for ( std::list<Glib::RefPtr<InputDevice const> >::const_iterator it = devList.begin(); it != devList.end(); ++it ) {
break;
}
}
}
}
}
}
bool clear = true;
if (iter) {
if ( dev ) {
axisTable.set_sensitive(true);
linkCombo.set_active(0);
std::list<Glib::RefPtr<InputDevice const> > devList = Inkscape::DeviceManager::getManager().getDevices();
for ( std::list<Glib::RefPtr<InputDevice const> >::const_iterator it = devList.begin(); it != devList.end(); ++it ) {
}
}
}
linkCombo.set_sensitive(true);
} else {
linkCombo.set_sensitive(false);
}
clear = false;
}
}
if (clear) {
}
}
{
/*
* TODO - Make each axis editable
*/
static Glib::ustring axesLabels[6] = {_("X"), _("Y"), _("Pressure"), _("X tilt"), _("Y tilt"), _("Wheel")};
} else {
}
}
}
{
/*
* TODO - Make each key assignable
*/
}
}
void InputDialogImpl::setupValueAndCombo( gint reported, gint actual, Gtk::Label& label, Gtk::ComboBoxText& combo )
{
combo.remove_all();
}
}
}
{
if ( i == hotButton ) {
} else {
}
} else {
}
}
}
{
//static gdouble epsilon = 0.0001;
{
if (iter) {
dev = 0;
}
}
}
case 0:
case 1:
axesValues[i].set_sensitive(false);
}
break;
case 2:
axesValues[i].set_sensitive(true);
// FIXME: Device axis ranges are inaccessible in GTK+ 3 and
// are deprecated in GTK+ 2. Progress-bar ranges are disabled
// until we find an alternative solution
// if ( (dev->axes[i].max - dev->axes[i].min) > epsilon ) {
axesValues[i].set_sensitive(true);
// axesValues[i].set_fraction( (axesMap[key][i].second- dev->axes[i].min) / (dev->axes[i].max - dev->axes[i].min) );
// }
}
break;
case 3:
axesValues[i].set_sensitive(true);
// FIXME: Device axis ranges are inaccessible in GTK+ 3 and
// are deprecated in GTK+ 2. Progress-bar ranges are disabled
// until we find an alternative solution
// if ( (dev->axes[i].max - dev->axes[i].min) > epsilon ) {
axesValues[i].set_sensitive(true);
// axesValues[i].set_fraction( (axesMap[key][i].second- dev->axes[i].min) / (dev->axes[i].max - dev->axes[i].min) );
// }
}
}
} else {
}
}
if ( !dev ) {
axesValues[i].set_sensitive(false);
}
}
}
void InputDialogImpl::mapAxesValues( Glib::ustring const& key, gdouble const * axes, GdkDevice* dev )
{
// 0 == new, 1 == set value, 2 == changed value, 3 == active
case 0:
{
}
break;
case 1:
{
// g_message("Axis %d changed on %s]", axisNum, key.c_str());
}
}
break;
case 2:
{
}
}
break;
case 3:
{
} else {
}
}
}
}
}
// std::map<Glib::ustring, std::map<guint, std::pair<guint, gdouble> > > axesMap;
}
{
switch ( source ) {
case GDK_SOURCE_MOUSE:
key = "M:";
break;
case GDK_SOURCE_CURSOR:
key = "C:";
break;
case GDK_SOURCE_PEN:
key = "P:";
break;
case GDK_SOURCE_ERASER:
key = "E:";
break;
default:
key = "?:";
}
return key;
}
{
int modmod = 0;
case GDK_KEY_PRESS:
case GDK_KEY_RELEASE:
{
// g_message("%d KEY state:0x%08x 0x%04x [%s]", keyEvt->type, keyEvt->state, keyEvt->keyval, name);
}
break;
case GDK_BUTTON_PRESS:
modmod = 1;
// fallthrough
case GDK_BUTTON_RELEASE:
{
// g_message("New button found for %s = %d", key.c_str(), btnEvt->button);
}
}
// g_message("%d BTN state:0x%08x %c %4d [%s] dev:%p [%s] ",
// btnEvt->type, btnEvt->state,
// (modmod ? '+':'-'),
// btnEvt->button, name, btnEvt->device,
// (btnEvt->device ? btnEvt->device->name : "null")
// );
}
break;
case GDK_MOTION_NOTIFY:
{
}
// g_message("%d MOV state:0x%08x [%s] dev:%p [%s] %3.2f %3.2f %3.2f %3.2f %3.2f %3.2f", btnMtn->type, btnMtn->state,
// name, btnMtn->device,
// (btnMtn->device ? btnMtn->device->name : "null"),
// ((btnMtn->device && btnMtn->axes && (btnMtn->device->num_axes > 0)) ? btnMtn->axes[0]:0),
// ((btnMtn->device && btnMtn->axes && (btnMtn->device->num_axes > 1)) ? btnMtn->axes[1]:0),
// ((btnMtn->device && btnMtn->axes && (btnMtn->device->num_axes > 2)) ? btnMtn->axes[2]:0),
// ((btnMtn->device && btnMtn->axes && (btnMtn->device->num_axes > 3)) ? btnMtn->axes[3]:0),
// ((btnMtn->device && btnMtn->axes && (btnMtn->device->num_axes > 4)) ? btnMtn->axes[4]:0),
// ((btnMtn->device && btnMtn->axes && (btnMtn->device->num_axes > 5)) ? btnMtn->axes[5]:0)
// );
}
break;
default:
;// nothing
}
switch (source) {
case GDK_SOURCE_MOUSE: {
break;
}
case GDK_SOURCE_CURSOR: {
// g_message("flip to cursor");
break;
}
case GDK_SOURCE_PEN: {
if (devName == _("pad")) {
// g_message("flip to pad");
} else {
// g_message("flip to pen");
}
break;
}
case GDK_SOURCE_ERASER: {
// g_message("flip to eraser");
break;
}
#if WITH_GTKMM_3_0
/// \fixme GTK3 added new GDK_SOURCEs that should be handled here!
case GDK_SOURCE_KEYBOARD:
case GDK_SOURCE_TOUCHSCREEN:
case GDK_SOURCE_TOUCHPAD: {
g_warning("InputDialogImpl::eventSnoop : unhandled GDK_SOURCE type!");
break;
}
#endif
}
}
return false;
}
} // end namespace Inkscape
} // end namespace UI
} // end namespace Dialog
/*
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:fileencoding=utf-8:textwidth=99 :