From: Jon A. Cruz Date: Mon, 12 Apr 2010 08:09:40 +0000 (-0700) Subject: Simplifying sigc::bind use. Possible fix for mac compile. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9e681e203a208a1994e83056bbba03f43361c6ff;p=inkscape.git Simplifying sigc::bind use. Possible fix for mac compile. --- diff --git a/src/device-manager.cpp b/src/device-manager.cpp index b71cca059..62e0c2545 100644 --- a/src/device-manager.cpp +++ b/src/device-manager.cpp @@ -260,10 +260,10 @@ public: virtual std::list > getDevices(); - virtual sigc::signal& > signalDeviceChanged(); - virtual sigc::signal& > signalAxesChanged(); - virtual sigc::signal& > signalButtonsChanged(); - virtual sigc::signal& > signalLinkChanged(); + virtual sigc::signal > signalDeviceChanged(); + virtual sigc::signal > signalAxesChanged(); + virtual sigc::signal > signalButtonsChanged(); + virtual sigc::signal > signalLinkChanged(); virtual void addAxis(Glib::ustring const & id, gint axis); virtual void addButton(Glib::ustring const & id, gint button); @@ -276,10 +276,10 @@ public: protected: std::list > devices; - sigc::signal& > signalDeviceChangedPriv; - sigc::signal& > signalAxesChangedPriv; - sigc::signal& > signalButtonsChangedPriv; - sigc::signal& > signalLinkChangedPriv; + sigc::signal > signalDeviceChangedPriv; + sigc::signal > signalAxesChangedPriv; + sigc::signal > signalButtonsChangedPriv; + sigc::signal > signalLinkChangedPriv; }; @@ -445,22 +445,22 @@ void DeviceManagerImpl::setKey( Glib::ustring const & id, guint index, guint key } } -sigc::signal& > DeviceManagerImpl::signalDeviceChanged() +sigc::signal > DeviceManagerImpl::signalDeviceChanged() { return signalDeviceChangedPriv; } -sigc::signal& > DeviceManagerImpl::signalAxesChanged() +sigc::signal > DeviceManagerImpl::signalAxesChanged() { return signalAxesChangedPriv; } -sigc::signal& > DeviceManagerImpl::signalButtonsChanged() +sigc::signal > DeviceManagerImpl::signalButtonsChanged() { return signalButtonsChangedPriv; } -sigc::signal& > DeviceManagerImpl::signalLinkChanged() +sigc::signal > DeviceManagerImpl::signalLinkChanged() { return signalLinkChangedPriv; } diff --git a/src/device-manager.h b/src/device-manager.h index c32a79bfa..4aea99ac0 100644 --- a/src/device-manager.h +++ b/src/device-manager.h @@ -47,10 +47,10 @@ public: virtual std::list > getDevices() = 0; - virtual sigc::signal& > signalDeviceChanged() = 0; - virtual sigc::signal& > signalAxesChanged() = 0; - virtual sigc::signal& > signalButtonsChanged() = 0; - virtual sigc::signal& > signalLinkChanged() = 0; + virtual sigc::signal > signalDeviceChanged() = 0; + virtual sigc::signal > signalAxesChanged() = 0; + virtual sigc::signal > signalButtonsChanged() = 0; + virtual sigc::signal > signalLinkChanged() = 0; virtual void addAxis(Glib::ustring const & id, gint axis) = 0; virtual void addButton(Glib::ustring const & id, gint button) = 0; diff --git a/src/ui/dialog/input.cpp b/src/ui/dialog/input.cpp index 570f00944..92a54affb 100644 --- a/src/ui/dialog/input.cpp +++ b/src/ui/dialog/input.cpp @@ -454,10 +454,10 @@ private: bool eventSnoop(GdkEvent* event); void linkComboChanged(); void resyncToSelection(); - void handleDeviceChange(const Glib::RefPtr& device); - void updateDeviceAxes(const Glib::RefPtr& device); - void updateDeviceButtons(const Glib::RefPtr& device); - static void updateDeviceLinks(const Glib::RefPtr& device, Gtk::TreeIter &tabletIter, Gtk::TreeView &tree); + void handleDeviceChange(Glib::RefPtr device); + void updateDeviceAxes(Glib::RefPtr device); + void updateDeviceButtons(Glib::RefPtr device); + static void updateDeviceLinks(Glib::RefPtr device, Gtk::TreeIter tabletIter, Glib::RefPtr tree); static bool findDevice(const Gtk::TreeModel::iterator& iter, Glib::ustring id, @@ -713,7 +713,8 @@ InputDialogImpl::InputDialogImpl() : 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), tabletIter, tree)); + Glib::RefPtr treePtr(&tree); + Inkscape::DeviceManager::getManager().signalLinkChanged().connect(sigc::bind(sigc::ptr_fun(&InputDialogImpl::updateDeviceLinks), tabletIter, treePtr)); tree.expand_all(); show_all_children(); @@ -826,7 +827,8 @@ InputDialogImpl::ConfPanel::ConfPanel() : setupTree( store, tabletIter ); - Inkscape::DeviceManager::getManager().signalLinkChanged().connect(sigc::bind(sigc::ptr_fun(&InputDialogImpl::updateDeviceLinks), tabletIter, tree)); + Glib::RefPtr 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& device) +void InputDialogImpl::handleDeviceChange(Glib::RefPtr device) { // g_message("OUCH!!!! for %p hits %s", &device, device->getId().c_str()); std::vector > stores; @@ -932,7 +934,7 @@ void InputDialogImpl::handleDeviceChange(const Glib::RefPtr& device } } -void InputDialogImpl::updateDeviceAxes(const Glib::RefPtr& device) +void InputDialogImpl::updateDeviceAxes(Glib::RefPtr device) { gint live = device->getLiveAxes(); @@ -949,7 +951,7 @@ void InputDialogImpl::updateDeviceAxes(const Glib::RefPtr& device) updateTestAxes( device->getId(), 0 ); } -void InputDialogImpl::updateDeviceButtons(const Glib::RefPtr& device) +void InputDialogImpl::updateDeviceButtons(Glib::RefPtr device) { gint live = device->getLiveButtons(); std::set existing = buttonMap[device->getId()]; @@ -995,9 +997,9 @@ bool InputDialogImpl::findDeviceByLink(const Gtk::TreeModel::iterator& iter, return stop; } -void InputDialogImpl::updateDeviceLinks(const Glib::RefPtr& device, Gtk::TreeIter &tabletIter, Gtk::TreeView &tree) +void InputDialogImpl::updateDeviceLinks(Glib::RefPtr device, Gtk::TreeIter tabletIter, Glib::RefPtr tree) { - Glib::RefPtr store = Glib::RefPtr::cast_dynamic(tree.get_model()); + Glib::RefPtr store = Glib::RefPtr::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& device, if ( oldParent->children().empty() ) { store->erase(oldParent); } - tree.expand_row(Gtk::TreePath(newGroup), true); + tree->expand_row(Gtk::TreePath(newGroup), true); } } }