summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8ba8394)
raw | patch | inline | side by side (parent: 8ba8394)
author | Jon A. Cruz <jon@joncruz.org> | |
Mon, 12 Apr 2010 08:09:40 +0000 (01:09 -0700) | ||
committer | Jon A. Cruz <jon@joncruz.org> | |
Mon, 12 Apr 2010 08:09:40 +0000 (01:09 -0700) |
src/device-manager.cpp | patch | blob | history | |
src/device-manager.h | patch | blob | history | |
src/ui/dialog/input.cpp | patch | blob | history |
diff --git a/src/device-manager.cpp b/src/device-manager.cpp
index b71cca05962e60c506b76e4d6812679ba0f9bfa7..62e0c2545a12c12b986b1ad76bcf818126517b98 100644 (file)
--- a/src/device-manager.cpp
+++ b/src/device-manager.cpp
virtual std::list<Glib::RefPtr<InputDevice const> > getDevices();
- virtual sigc::signal<void, const Glib::RefPtr<InputDevice>& > signalDeviceChanged();
- virtual sigc::signal<void, const Glib::RefPtr<InputDevice>& > signalAxesChanged();
- virtual sigc::signal<void, const Glib::RefPtr<InputDevice>& > signalButtonsChanged();
- virtual sigc::signal<void, const Glib::RefPtr<InputDevice>& > signalLinkChanged();
+ virtual sigc::signal<void, Glib::RefPtr<InputDevice const> > signalDeviceChanged();
+ virtual sigc::signal<void, Glib::RefPtr<InputDevice const> > signalAxesChanged();
+ virtual sigc::signal<void, Glib::RefPtr<InputDevice const> > signalButtonsChanged();
+ virtual sigc::signal<void, Glib::RefPtr<InputDevice const> > signalLinkChanged();
virtual void addAxis(Glib::ustring const & id, gint axis);
virtual void addButton(Glib::ustring const & id, gint button);
protected:
std::list<Glib::RefPtr<InputDeviceImpl> > devices;
- sigc::signal<void, const Glib::RefPtr<InputDevice>& > signalDeviceChangedPriv;
- sigc::signal<void, const Glib::RefPtr<InputDevice>& > signalAxesChangedPriv;
- sigc::signal<void, const Glib::RefPtr<InputDevice>& > signalButtonsChangedPriv;
- sigc::signal<void, const Glib::RefPtr<InputDevice>& > signalLinkChangedPriv;
+ sigc::signal<void, Glib::RefPtr<InputDevice const> > signalDeviceChangedPriv;
+ sigc::signal<void, Glib::RefPtr<InputDevice const> > signalAxesChangedPriv;
+ sigc::signal<void, Glib::RefPtr<InputDevice const> > signalButtonsChangedPriv;
+ sigc::signal<void, Glib::RefPtr<InputDevice const> > signalLinkChangedPriv;
};
@@ -445,22 +445,22 @@ void DeviceManagerImpl::setKey( Glib::ustring const & id, guint index, guint key
}
}
-sigc::signal<void, const Glib::RefPtr<InputDevice>& > DeviceManagerImpl::signalDeviceChanged()
+sigc::signal<void, Glib::RefPtr<InputDevice const> > DeviceManagerImpl::signalDeviceChanged()
{
return signalDeviceChangedPriv;
}
-sigc::signal<void, const Glib::RefPtr<InputDevice>& > DeviceManagerImpl::signalAxesChanged()
+sigc::signal<void, Glib::RefPtr<InputDevice const> > DeviceManagerImpl::signalAxesChanged()
{
return signalAxesChangedPriv;
}
-sigc::signal<void, const Glib::RefPtr<InputDevice>& > DeviceManagerImpl::signalButtonsChanged()
+sigc::signal<void, Glib::RefPtr<InputDevice const> > DeviceManagerImpl::signalButtonsChanged()
{
return signalButtonsChangedPriv;
}
-sigc::signal<void, const Glib::RefPtr<InputDevice>& > DeviceManagerImpl::signalLinkChanged()
+sigc::signal<void, Glib::RefPtr<InputDevice const> > DeviceManagerImpl::signalLinkChanged()
{
return signalLinkChangedPriv;
}
diff --git a/src/device-manager.h b/src/device-manager.h
index c32a79bfa82e63fe84ebfbb65b230f81e3044423..4aea99ac0cb236b804ee4c9bae99680e2e29edfb 100644 (file)
--- a/src/device-manager.h
+++ b/src/device-manager.h
virtual std::list<Glib::RefPtr<InputDevice const> > getDevices() = 0;
- virtual sigc::signal<void, const Glib::RefPtr<InputDevice>& > signalDeviceChanged() = 0;
- virtual sigc::signal<void, const Glib::RefPtr<InputDevice>& > signalAxesChanged() = 0;
- virtual sigc::signal<void, const Glib::RefPtr<InputDevice>& > signalButtonsChanged() = 0;
- virtual sigc::signal<void, const Glib::RefPtr<InputDevice>& > signalLinkChanged() = 0;
+ virtual sigc::signal<void, Glib::RefPtr<InputDevice const> > signalDeviceChanged() = 0;
+ virtual sigc::signal<void, Glib::RefPtr<InputDevice const> > signalAxesChanged() = 0;
+ virtual sigc::signal<void, Glib::RefPtr<InputDevice const> > signalButtonsChanged() = 0;
+ virtual sigc::signal<void, Glib::RefPtr<InputDevice const> > signalLinkChanged() = 0;
virtual void addAxis(Glib::ustring const & id, gint axis) = 0;
virtual void addButton(Glib::ustring const & id, gint button) = 0;
index 570f009447d01e8f02e5eb49a581ab086c3f6a61..92a54affb00cd8712ca3bbba79cad7dc790a673e 100644 (file)
--- a/src/ui/dialog/input.cpp
+++ b/src/ui/dialog/input.cpp
bool eventSnoop(GdkEvent* event);
void linkComboChanged();
void resyncToSelection();
- void handleDeviceChange(const Glib::RefPtr<InputDevice>& device);
- void updateDeviceAxes(const Glib::RefPtr<InputDevice>& device);
- void updateDeviceButtons(const Glib::RefPtr<InputDevice>& device);
- static void updateDeviceLinks(const Glib::RefPtr<InputDevice>& device, Gtk::TreeIter &tabletIter, Gtk::TreeView &tree);
+ void handleDeviceChange(Glib::RefPtr<InputDevice const> device);
+ void updateDeviceAxes(Glib::RefPtr<InputDevice const> device);
+ void updateDeviceButtons(Glib::RefPtr<InputDevice const> device);
+ static void updateDeviceLinks(Glib::RefPtr<InputDevice const> device, Gtk::TreeIter tabletIter, Glib::RefPtr<Gtk::TreeView> tree);
static bool findDevice(const Gtk::TreeModel::iterator& iter,
Glib::ustring id,
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<Gtk::TreeIter &, Gtk::TreeView &>(sigc::ptr_fun(&InputDialogImpl::updateDeviceLinks), tabletIter, tree));
+ Glib::RefPtr<Gtk::TreeView> treePtr(&tree);
+ Inkscape::DeviceManager::getManager().signalLinkChanged().connect(sigc::bind(sigc::ptr_fun(&InputDialogImpl::updateDeviceLinks), tabletIter, treePtr));
tree.expand_all();
show_all_children();
setupTree( store, tabletIter );
- Inkscape::DeviceManager::getManager().signalLinkChanged().connect(sigc::bind<Gtk::TreeIter &, Gtk::TreeView &>(sigc::ptr_fun(&InputDialogImpl::updateDeviceLinks), tabletIter, tree));
+ Glib::RefPtr<Gtk::TreeView> treePtr(&tree);
+ Inkscape::DeviceManager::getManager().signalLinkChanged().connect(sigc::bind(sigc::ptr_fun(&InputDialogImpl::updateDeviceLinks), tabletIter, treePtr));
tree.expand_all();
@@ -909,7 +911,7 @@ void InputDialogImpl::ConfPanel::Blink::notify(Preferences::Entry const &new_val
parent.useExt.set_active(new_val.getBool());
}
-void InputDialogImpl::handleDeviceChange(const Glib::RefPtr<InputDevice>& device)
+void InputDialogImpl::handleDeviceChange(Glib::RefPtr<InputDevice const> device)
{
// g_message("OUCH!!!! for %p hits %s", &device, device->getId().c_str());
std::vector<Glib::RefPtr<Gtk::TreeStore> > stores;
@@ -932,7 +934,7 @@ void InputDialogImpl::handleDeviceChange(const Glib::RefPtr<InputDevice>& device
}
}
-void InputDialogImpl::updateDeviceAxes(const Glib::RefPtr<InputDevice>& device)
+void InputDialogImpl::updateDeviceAxes(Glib::RefPtr<InputDevice const> device)
{
gint live = device->getLiveAxes();
updateTestAxes( device->getId(), 0 );
}
-void InputDialogImpl::updateDeviceButtons(const Glib::RefPtr<InputDevice>& device)
+void InputDialogImpl::updateDeviceButtons(Glib::RefPtr<InputDevice const> device)
{
gint live = device->getLiveButtons();
std::set<guint> existing = buttonMap[device->getId()];
return stop;
}
-void InputDialogImpl::updateDeviceLinks(const Glib::RefPtr<InputDevice>& device, Gtk::TreeIter &tabletIter, Gtk::TreeView &tree)
+void InputDialogImpl::updateDeviceLinks(Glib::RefPtr<InputDevice const> device, Gtk::TreeIter tabletIter, Glib::RefPtr<Gtk::TreeView> tree)
{
- Glib::RefPtr<Gtk::TreeStore> store = Glib::RefPtr<Gtk::TreeStore>::cast_dynamic(tree.get_model());
+ Glib::RefPtr<Gtk::TreeStore> store = 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());
Gtk::TreeModel::iterator deviceIter;
@@ -1078,7 +1080,7 @@ void InputDialogImpl::updateDeviceLinks(const Glib::RefPtr<InputDevice>& device,
if ( oldParent->children().empty() ) {
store->erase(oldParent);
}
- tree.expand_row(Gtk::TreePath(newGroup), true);
+ tree->expand_row(Gtk::TreePath(newGroup), true);
}
}
}