From 2177dbe64b6ece6261b1d6827d202b608dd77501 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Thu, 8 Apr 2010 00:49:42 -0700 Subject: Cleanup of device internal handling and API. (bzr r9300) --- src/ui/dialog/input.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src/ui/dialog/input.cpp') diff --git a/src/ui/dialog/input.cpp b/src/ui/dialog/input.cpp index ae8594e50..555b18349 100644 --- a/src/ui/dialog/input.cpp +++ b/src/ui/dialog/input.cpp @@ -329,7 +329,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); } }; @@ -640,7 +640,7 @@ InputDialogImpl::InputDialogImpl() : - std::list devList = Inkscape::DeviceManager::getManager().getDevices(); + std::list > devList = Inkscape::DeviceManager::getManager().getDevices(); if ( !devList.empty() ) { row = *(store->append()); row[cols.description] = "Hardware"; @@ -650,8 +650,8 @@ InputDialogImpl::InputDialogImpl() : childrow[cols.description] = "Tablet"; childrow[cols.thumbnail] = tabletPix; - for ( std::list::iterator it = devList.begin(); it != devList.end(); ++it ) { - InputDevice const* dev = *it; + for ( std::list >::iterator it = devList.begin(); it != devList.end(); ++it ) { + Glib::RefPtr dev = *it; if ( dev ) { // 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()); @@ -741,7 +741,7 @@ bool InputDialogImpl::findDevice(const Gtk::TreeModel::iterator& iter, Gtk::TreeModel::iterator* result) { bool stop = false; - const InputDevice* dev = (*iter)[cols.device]; + Glib::RefPtr dev = (*iter)[cols.device]; if ( dev && (dev->getId() == id) ) { if ( result ) { *result = iter; @@ -756,7 +756,7 @@ bool InputDialogImpl::findDeviceByLink(const Gtk::TreeModel::iterator& iter, Gtk::TreeModel::iterator* result) { bool stop = false; - const InputDevice* dev = (*iter)[cols.device]; + Glib::RefPtr dev = (*iter)[cols.device]; if ( dev && (dev->getLink() == link) ) { if ( result ) { *result = iter; @@ -783,8 +783,8 @@ void InputDialogImpl::updateDeviceLinks(const Glib::RefPtr& device) // g_message("Item %s is unlinked", device->getId().c_str()); if ( deviceIter->parent() != tabletIter ) { // Not the child of the tablet. move on up - - InputDevice const *dev = (*deviceIter)[cols.device]; + + Glib::RefPtr dev = (*deviceIter)[cols.device]; Glib::ustring descr = (*deviceIter)[cols.description]; Glib::RefPtr thumb = (*deviceIter)[cols.thumbnail]; @@ -808,7 +808,7 @@ void InputDialogImpl::updateDeviceLinks(const Glib::RefPtr& device) (*newGroup)[cols.description] = "Pen"; (*newGroup)[cols.thumbnail] = penPix; - InputDevice const *dev = (*deviceIter)[cols.device]; + Glib::RefPtr dev = (*deviceIter)[cols.device]; Glib::ustring descr = (*deviceIter)[cols.description]; Glib::RefPtr thumb = (*deviceIter)[cols.thumbnail]; @@ -817,7 +817,7 @@ void InputDialogImpl::updateDeviceLinks(const Glib::RefPtr& device) deviceRow[cols.thumbnail] = thumb; deviceRow[cols.device] = dev; - + Gtk::TreeModel::iterator linkIter; store->foreach_iter( sigc::bind( sigc::mem_fun(*this, &InputDialogImpl::findDeviceByLink), @@ -856,15 +856,15 @@ void InputDialogImpl::linkComboChanged() { if (iter) { Gtk::TreeModel::Row row = *iter; Glib::ustring val = row[cols.description]; - InputDevice const * dev = row[cols.device]; + Glib::RefPtr dev = row[cols.device]; if ( dev ) { if ( linkCombo.get_active_row_number() == 0 ) { // It is the "None" entry DeviceManager::getManager().setLinkedTo(dev->getId(), ""); } else { Glib::ustring linkName = linkCombo.get_active_text(); - std::list devList = Inkscape::DeviceManager::getManager().getDevices(); - for ( std::list::const_iterator it = devList.begin(); it != devList.end(); ++it ) { + std::list > devList = Inkscape::DeviceManager::getManager().getDevices(); + for ( std::list >::const_iterator it = devList.begin(); it != devList.end(); ++it ) { if ( linkName == (*it)->getName() ) { DeviceManager::getManager().setLinkedTo(dev->getId(), (*it)->getId()); break; @@ -882,7 +882,7 @@ void InputDialogImpl::resyncToSelection() { if (iter) { Gtk::TreeModel::Row row = *iter; Glib::ustring val = row[cols.description]; - InputDevice const * dev = row[cols.device]; + Glib::RefPtr dev = row[cols.device]; if ( dev ) { devDetails.set_sensitive(true); @@ -892,8 +892,8 @@ void InputDialogImpl::resyncToSelection() { linkCombo.set_active(0); if ( dev->getSource() != Gdk::SOURCE_MOUSE ) { Glib::ustring linked = dev->getLink(); - std::list devList = Inkscape::DeviceManager::getManager().getDevices(); - for ( std::list::const_iterator it = devList.begin(); it != devList.end(); ++it ) { + std::list > devList = Inkscape::DeviceManager::getManager().getDevices(); + for ( std::list >::const_iterator it = devList.begin(); it != devList.end(); ++it ) { if ( ((*it)->getSource() != Gdk::SOURCE_MOUSE) && ((*it) != dev) ) { linkCombo.append_text((*it)->getName().c_str()); if ( (linked.length() > 0) && (linked == (*it)->getId()) ) { @@ -964,7 +964,7 @@ void InputDialogImpl::updateTestAxes( Glib::ustring const& key, GdkDevice* dev ) if (iter) { Gtk::TreeModel::Row row = *iter; Glib::ustring val = row[cols.description]; - InputDevice const * idev = row[cols.device]; + Glib::RefPtr idev = row[cols.device]; if ( !idev || (idev->getId() != key) ) { dev = 0; } -- cgit v1.2.3