summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/toolbox.cpp78
-rw-r--r--src/widgets/toolbox.h55
2 files changed, 0 insertions, 133 deletions
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index bd9b3bf0b..cdc1717c4 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -102,7 +102,6 @@
using Inkscape::UI::UXManager;
using Inkscape::DocumentUndo;
-using Inkscape::UI::PrefPusher;
using Inkscape::UI::ToolboxFactory;
using Inkscape::UI::Tools::ToolBase;
@@ -379,85 +378,8 @@ void VerbAction::on_activate()
}
}
-/* Global text entry widgets necessary for update */
-/* GtkWidget *dropper_rgb_entry,
- *dropper_opacity_entry ; */
-// should be made a private member once this is converted to class
-
-void delete_connection(GObject * /*obj*/, sigc::connection *connection)
-{
- connection->disconnect();
- delete connection;
-}
-
-void purge_repr_listener( GObject* /*obj*/, GObject* tbl )
-{
- Inkscape::XML::Node* oldrepr = reinterpret_cast<Inkscape::XML::Node *>( g_object_get_data( tbl, "repr" ) );
- if (oldrepr) { // remove old listener
- sp_repr_remove_listener_by_data(oldrepr, tbl);
- Inkscape::GC::release(oldrepr);
- oldrepr = nullptr;
- g_object_set_data( tbl, "repr", nullptr );
- }
-}
-
-PrefPusher::PrefPusher( GtkToggleAction *act, Glib::ustring const &path, void (*callback)(gpointer), gpointer cbData ) :
- Observer(path),
- act(act),
- callback(callback),
- cbData(cbData),
- freeze(false)
-{
- g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(toggleCB), this);
- freeze = true;
- gtk_toggle_action_set_active( act, Inkscape::Preferences::get()->getBool(observed_path) );
- freeze = false;
-
- Inkscape::Preferences::get()->addObserver(*this);
-}
-
-PrefPusher::~PrefPusher()
-{
- Inkscape::Preferences::get()->removeObserver(*this);
-}
-
-void PrefPusher::toggleCB( GtkToggleAction * /*act*/, PrefPusher *self )
-{
- if (self) {
- self->handleToggled();
- }
-}
-
-void PrefPusher::handleToggled()
-{
- if (!freeze) {
- freeze = true;
- Inkscape::Preferences::get()->setBool(observed_path, gtk_toggle_action_get_active( act ));
- if (callback) {
- (*callback)(cbData);
- }
- freeze = false;
- }
-}
-
-void PrefPusher::notify(Inkscape::Preferences::Entry const &newVal)
-{
- bool newBool = newVal.getBool();
- bool oldBool = gtk_toggle_action_get_active(act);
-
- if (!freeze && (newBool != oldBool)) {
- gtk_toggle_action_set_active( act, newBool );
- }
-}
-
-void delete_prefspusher(GObject * /*obj*/, PrefPusher *watcher )
-{
- delete watcher;
-}
-
// ------------------------------------------------------
-
GtkToolItem * sp_toolbox_button_item_new_from_verb_with_doubleclick(GtkWidget *t, GtkIconSize size, Inkscape::UI::Widget::ButtonType type,
Inkscape::Verb *verb, Inkscape::Verb *doubleclick_verb,
Inkscape::UI::View::View *view)
diff --git a/src/widgets/toolbox.h b/src/widgets/toolbox.h
index 6c973ba4a..9a4eef3cd 100644
--- a/src/widgets/toolbox.h
+++ b/src/widgets/toolbox.h
@@ -68,57 +68,6 @@ public:
ToolboxFactory() = delete;
};
-/**
- * A simple mediator class that keeps UI controls matched to the preference values they set.
- */
-class PrefPusher : public Inkscape::Preferences::Observer
-{
-public:
- /**
- * Constructor for a boolean value that syncs to the supplied path.
- * Initializes the widget to the current preference stored state and registers callbacks
- * for widget changes and preference changes.
- *
- * @param act the widget to synchronize preference with.
- * @param path the path to the preference the widget is synchronized with.
- * @param callback function to invoke when changes are pushed.
- * @param cbData data to be passed on to the callback function.
- */
- PrefPusher( GtkToggleAction *act,
- Glib::ustring const & path,
- void (*callback)(gpointer) = nullptr,
- gpointer cbData = nullptr );
-
- /**
- * Destructor that unregisters the preference callback.
- */
- ~PrefPusher() override;
-
- /**
- * Callback method invoked when the preference setting changes.
- */
- void notify(Inkscape::Preferences::Entry const &new_val) override;
-
-
-private:
- /**
- * Callback hook invoked when the widget changes.
- *
- * @param act the toggle action widget that was changed.
- * @param self the PrefPusher instance the callback was registered to.
- */
- static void toggleCB( GtkToggleAction *act, PrefPusher *self );
-
- /**
- * Method to handle the widget change.
- */
- void handleToggled();
-
- GtkToggleAction *act;
- void (*callback)(gpointer);
- gpointer cbData;
- bool freeze;
-};
} // namespace UI
@@ -127,10 +76,6 @@ private:
// utility
-void delete_prefspusher(GObject * /*obj*/, Inkscape::UI::PrefPusher *watcher );
-void purge_repr_listener( GObject* /*obj*/, GObject* tbl );
-void delete_connection(GObject * /*obj*/, sigc::connection *connection);
-
EgeAdjustmentAction * create_adjustment_action( gchar const *name,
gchar const *label, gchar const *shortLabel, gchar const *tooltip,
Glib::ustring const &path, gdouble def,