input.cpp revision 55919b10f5e27d2fa50c03ca269bce594f5c8d82
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrmstatic char *eraser[] = {
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm/* columns rows colors chars-per-pixel */
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"16 16 5 1",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm" c black",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm". c green",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X c #808080",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"o c gray100",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"O c None",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm/* pixels */
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOOOOOOOOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOOOOOOOO OO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOOOOOOO . O",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOOOOOO . OO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOOOOO . OOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOOOO . OOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOOO . OOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOOXo OOOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOXoXOOOOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOXoXOOOOOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOXoXOOOOOOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOXoXOOOOOOOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOXoXOOOOOOOOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOXXOOOOOOOOOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOOOOOOOOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOOOOOOOOOOO"
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrmstatic char *mouse[] = {
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm/* columns rows colors chars-per-pixel */
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"16 16 3 1",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm" c black",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm". c gray100",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X c None",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm/* pixels */
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXXXXXXXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXXXXXXXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXXXXXXXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXXXXXXXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXX XXXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXX . XXXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXX .... XXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXX .... XXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXX .... XXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXX .... XXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXX .... XXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXX .... XXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXX . XXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXX XXXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXXXXXXXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXXXXXXXXXXX"
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrmstatic char *pen[] = {
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm/* columns rows colors chars-per-pixel */
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"16 16 3 1",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm" c black",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm". c gray100",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X c None",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm/* pixels */
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXXXXXXXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXXXXXXXX XX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXXXXXXX . X",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXXXXXX . XX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXXXXX . XXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXXXX . XXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXXX . XXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXX . XXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXX . XXXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXX . XXXXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXX . XXXXXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXX . XXXXXXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XX . XXXXXXXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XX XXXXXXXXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXXXXXXXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXXXXXXXXXXX"
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrmstatic char *sidebuttons[] = {
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm/* columns rows colors chars-per-pixel */
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"16 16 4 1",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm" c black",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm". c #808080",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"o c green",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"O c None",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm/* pixels */
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOOOOOOOOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOOOOOOOOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"O..............O",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"O.OOOOOOOOOOOO.O",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"O OOOOOOOO O",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"O o OOOOOOOO o O",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"O o OOOOOOOO o O",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"O OOOOOOOO O",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"O.OOOOOOOOOOOO.O",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"O.OOOOOOOOOOOO.O",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"O.OOOOOOOOOOOO.O",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"O.OOOOOOOOOOOO.O",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"O.OOOOOOOOOOOO.O",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"O..............O",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOOOOOOOOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOOOOOOOOOOO"
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrmstatic char *tablet[] = {
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm/* columns rows colors chars-per-pixel */
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"16 16 3 1",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm" c black",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm". c gray100",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X c None",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm/* pixels */
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXXXXXXXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXXXXXXXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X ............ X",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X ............ X",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X ............ X",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X ............ X",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X ............ X",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X ............ X",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X ............ X",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X ............ X",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X ............ X",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X ............ X",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXXXXXXXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXXXXXXXXXXX"
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrmstatic char *tip[] = {
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm/* columns rows colors chars-per-pixel */
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"16 16 5 1",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm" c black",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm". c green",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X c #808080",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"o c gray100",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"O c None",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm/* pixels */
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOOOOOOOOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOOOOOOOOXOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOOOOOOOXoXO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOOOOOOXoXOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOOOOOXoXOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOOOOXoXOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOOOXoXOOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOO oXOOOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOO . OOOOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOO . OOOOOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOO . OOOOOOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOO . OOOOOOOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OO . OOOOOOOOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OO OOOOOOOOOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOXXXXXOOOOOOO",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"OOOOOOOOOXXXXXOO"
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrmstatic char *button_none[] = {
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm/* columns rows colors chars-per-pixel */
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm" c black",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm". c #808080",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X c None",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm/* pixels */
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XX .. XX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X .XX. X",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X.XXXX.X",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X.XXXX.X",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X .XX. X",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XX .. XX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrmstatic char *button_off[] = {
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm/* columns rows colors chars-per-pixel */
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm" c black",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm". c #808080",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X c gray100",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"o c None",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm/* pixels */
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"oooooooo",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"o. XX .o",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"o XXXX o",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"o XXXX o",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"o. XX .o",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrmstatic char *button_on[] = {
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm/* columns rows colors chars-per-pixel */
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm" c black",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm". c green",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X c None",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm/* pixels */
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"XXXXXXXX",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X .... X",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm"X .... X",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrmnamespace UI {
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrmclass MyModelColumns : public Gtk::TreeModel::ColumnRecord
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > thumbnail;
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm MyModelColumns() { add(filename); add(description); add(thumbnail); add(device); }
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm virtual ~InputDialogImpl() {}
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm void setupValueAndCombo( gint reported, gint actual, Gtk::Label& label, Gtk::ComboBoxText& combo );
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm// Now that we've defined the *Impl class, we can do the method to aquire one.
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm sidebuttonsPix(Gdk::Pixbuf::create_from_xpm_data(sidebuttons)),
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm buttonsNonePix(Gdk::Pixbuf::create_from_xpm_data(button_none)),
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm buttonsOnPix(Gdk::Pixbuf::create_from_xpm_data(button_on)),
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm buttonsOffPix(Gdk::Pixbuf::create_from_xpm_data(button_off)),
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm treeScroller.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm imageTable.attach(testThumb, 0, 8, 0, 1, ::Gtk::EXPAND, ::Gtk::EXPAND);
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm imageTable.attach(testButtons[num], col, col + 1, row, row + 1, ::Gtk::FILL, ::Gtk::FILL);
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm Gtk::Label* lbl = Gtk::manage(new Gtk::Label("Name:"));
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm lbl = Gtk::manage(new Gtk::Label("Reported axes count:"));
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm devDetails.attach(devAxesCount, 1, 2, rowNum, rowNum + 1,
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm lbl = Gtk::manage(new Gtk::Label("Actual axes count:"));
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm lbl = Gtk::manage(new Gtk::Label("Reported button count:"));
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm devDetails.attach(devKeyCount, 1, 2, rowNum, rowNum + 1,
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm lbl = Gtk::manage(new Gtk::Label("Actual button count:"));
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm devDetails.attach(buttonCombo, 1, 2, rowNum, rowNum + 1,
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm testDetector.signal_event().connect(sigc::mem_fun(*this, &InputDialogImpl::eventSnoop));
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm// void gdk_input_set_extension_events (GdkWindow *window,
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm// gint mask,
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm// GdkExtensionMode mode);
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm gtk_widget_set_extension_events( GTK_WIDGET(testDetector.gobj()), GDK_EXTENSION_EVENTS_ALL );
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm 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);
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm detailScroller.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm// gnome-dev-mouse-optical
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm// input-mouse
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm// input-tablet
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm //Add the TreeView's view columns:
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm tree.get_selection()->signal_changed().connect(sigc::mem_fun(*this, &InputDialogImpl::foo));
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm std::list<InputDevice const *> devList = Inkscape::DeviceManager::getManager().getDevices();
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm GdkModifierType defaultModMask = static_cast<GdkModifierType>(gtk_accelerator_get_default_mod_mask());
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm gchar* name = gtk_accelerator_name(GDK_a, defaultModMask);
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm gchar* label = gtk_accelerator_get_label(GDK_a, defaultModMask);
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm for ( std::list<InputDevice const *>::iterator it = devList.begin(); it != devList.end(); ++it ) {
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm 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(),
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm dev->hasCursor() ? "Yes":"no", dev->getNumAxes(), dev->getNumKeys());
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm ; // nothing
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm bool clear = true;
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm Glib::RefPtr<Gtk::TreeSelection> treeSel = tree.get_selection();
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm Gtk::TreeModel::iterator iter = treeSel->get_selected();
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm setupValueAndCombo( dev->getNumAxes(), dev->getNumAxes(), devAxesCount, axesCombo);
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm setupValueAndCombo( dev->getNumKeys(), dev->getNumKeys(), devKeyCount, buttonCombo);
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrmvoid InputDialogImpl::setupValueAndCombo( gint reported, gint actual, Gtk::Label& label, Gtk::ComboBoxText& combo )
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm GdkEventKey* keyEvt = reinterpret_cast<GdkEventKey*>(event);
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm gchar* name = gtk_accelerator_name(keyEvt->keyval, static_cast<GdkModifierType>(keyEvt->state));
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm g_message("%d KEY state:0x%08x 0x%04x [%s]", keyEvt->type, keyEvt->state, keyEvt->keyval, name);
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm // fallthrough
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm GdkEventButton* btnEvt = reinterpret_cast<GdkEventButton*>(event);
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm if ( buttonMap[key].find(btnEvt->button) == buttonMap[key].end() ) {
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm g_message("New button found for %s = %d", key.c_str(), btnEvt->button);
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm if ( buttonMap[key].find(i) != buttonMap[key].end() ) {
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm gchar* name = gtk_accelerator_name(0, static_cast<GdkModifierType>(btnEvt->state));
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm g_message("%d BTN state:0x%08x %c %4d [%s] dev:%p [%s] ",
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm GdkEventMotion* btnMtn = reinterpret_cast<GdkEventMotion*>(event);
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm gchar* name = gtk_accelerator_name(0, static_cast<GdkModifierType>(btnMtn->state));
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm 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,
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm ((btnMtn->device && btnMtn->axes && (btnMtn->device->num_axes > 0)) ? btnMtn->axes[0]:0),
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm ((btnMtn->device && btnMtn->axes && (btnMtn->device->num_axes > 1)) ? btnMtn->axes[1]:0),
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm ((btnMtn->device && btnMtn->axes && (btnMtn->device->num_axes > 2)) ? btnMtn->axes[2]:0),
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm ((btnMtn->device && btnMtn->axes && (btnMtn->device->num_axes > 3)) ? btnMtn->axes[3]:0),
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm ((btnMtn->device && btnMtn->axes && (btnMtn->device->num_axes > 4)) ? btnMtn->axes[4]:0),
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm ((btnMtn->device && btnMtn->axes && (btnMtn->device->num_axes > 5)) ? btnMtn->axes[5]:0)
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm ;// nothing
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm if ( (lastSourceSeen != source) || (lastDevnameSeen != devName) ) {
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm g_message("FLIPPIES %d => %d", lastSourceSeen, source);
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm return false;
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm} // end namespace Inkscape
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm} // end namespace UI
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm} // end namespace Dialog
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm Local Variables:
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm c-file-style:"stroustrup"
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm indent-tabs-mode:nil
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm fill-column:99
da58597f9f9ecb17c4f545c4483a844a363bcc27pjrm// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :