summaryrefslogtreecommitdiffstats
path: root/src/actions
diff options
context:
space:
mode:
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/actions-selection.cpp1
-rw-r--r--src/actions/actions-transform.cpp53
-rw-r--r--src/actions/actions-transform.h29
3 files changed, 83 insertions, 0 deletions
diff --git a/src/actions/actions-selection.cpp b/src/actions/actions-selection.cpp
index 9a0429400..5687ebdd7 100644
--- a/src/actions/actions-selection.cpp
+++ b/src/actions/actions-selection.cpp
@@ -97,6 +97,7 @@ select_all(InkscapeApplication* app)
if (!get_document_and_selection(app, &document, &selection)) {
return;
}
+ std::cerr << "select_all: Not implemented!" << std::endl;
}
void
diff --git a/src/actions/actions-transform.cpp b/src/actions/actions-transform.cpp
new file mode 100644
index 000000000..91f12df58
--- /dev/null
+++ b/src/actions/actions-transform.cpp
@@ -0,0 +1,53 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Gio::Actions for selection tied to the application and without GUI.
+ *
+ * Copyright (C) 2018 Tavmjong Bah
+ *
+ * The contents of this file may be used under the GNU General Public License Version 2 or later.
+ *
+ */
+
+#include <iostream>
+
+#include <giomm.h> // Not <gtkmm.h>! To eventually allow a headless version!
+
+#include "actions-transform.h"
+#include "actions-helper.h"
+#include "inkscape-application.h"
+
+#include "inkscape.h" // Inkscape::Application
+#include "selection.h" // Selection
+
+void
+transform_rotate(const Glib::VariantBase& value, InkscapeApplication *app)
+{
+ Glib::Variant<double> d = Glib::VariantBase::cast_dynamic<Glib::Variant<double> >(value);
+ auto selection = app->get_active_selection();
+ selection->rotate(d.get());
+}
+
+void
+add_actions_transform(InkscapeApplication* app)
+{
+ Glib::VariantType Bool( Glib::VARIANT_TYPE_BOOL);
+ Glib::VariantType Int( Glib::VARIANT_TYPE_INT32);
+ Glib::VariantType Double(Glib::VARIANT_TYPE_DOUBLE);
+ Glib::VariantType String(Glib::VARIANT_TYPE_STRING);
+
+ app->add_action_with_parameter( "transform-rotate", Double, sigc::bind<InkscapeApplication*>(sigc::ptr_fun(&transform_rotate), app));
+}
+
+
+
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
diff --git a/src/actions/actions-transform.h b/src/actions/actions-transform.h
new file mode 100644
index 000000000..9b1b0dc3d
--- /dev/null
+++ b/src/actions/actions-transform.h
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Gio::Actions for selection tied to the application and without GUI.
+ *
+ * Copyright (C) 2018 Tavmjong Bah
+ *
+ * The contents of this file may be used under the GNU General Public License Version 2 or later.
+ *
+ */
+
+#ifndef INK_ACTIONS_TRANSFORM_H
+#define INK_ACTIONS_TRANSFORM_H
+
+class InkscapeApplication;
+
+void add_actions_transform(InkscapeApplication* app);
+
+#endif // INK_ACTIONS_TRANSFORM_H
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :