diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2018-12-09 19:04:42 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marc@jeanmougin.fr> | 2018-12-09 19:04:42 +0000 |
| commit | 7bbad129a0c9c9f3a38b178557d68623bef03464 (patch) | |
| tree | 964e4f6ced0914ea706197645a7ca636ca60376c /src/actions | |
| parent | fix, test, and document more Inkscape::URI methods (diff) | |
| download | inkscape-7bbad129a0c9c9f3a38b178557d68623bef03464.tar.gz inkscape-7bbad129a0c9c9f3a38b178557d68623bef03464.zip | |
Gtk/Gio templating of main inkscape application class to allow commandline usage when graphic server is not available
Diffstat (limited to 'src/actions')
| -rw-r--r-- | src/actions/actions-base.cpp | 6 | ||||
| -rw-r--r-- | src/actions/actions-base.h | 5 | ||||
| -rw-r--r-- | src/actions/actions-output.cpp | 9 | ||||
| -rw-r--r-- | src/actions/actions-output.h | 4 | ||||
| -rw-r--r-- | src/actions/actions-selection.cpp | 7 | ||||
| -rw-r--r-- | src/actions/actions-selection.h | 5 | ||||
| -rw-r--r-- | src/actions/actions-transform.cpp | 7 | ||||
| -rw-r--r-- | src/actions/actions-transform.h | 5 |
8 files changed, 37 insertions, 11 deletions
diff --git a/src/actions/actions-base.cpp b/src/actions/actions-base.cpp index b24602ca7..252eb956f 100644 --- a/src/actions/actions-base.cpp +++ b/src/actions/actions-base.cpp @@ -201,8 +201,9 @@ vacuum_defs(InkscapeApplication* app) document->vacuumDocument(); } +template<class T> void -add_actions_base(InkscapeApplication* app) +add_actions_base(ConcreteInkscapeApplication<T>* app) { // Note: "radio" actions are just an easy way to set type without using templating. app->add_action("inkscape-version", sigc::ptr_fun(&print_inkscape_version )); @@ -224,6 +225,9 @@ add_actions_base(InkscapeApplication* app) } +template void add_actions_base(ConcreteInkscapeApplication<Gio::Application>* app); +template void add_actions_base(ConcreteInkscapeApplication<Gtk::Application>* app); + /* Local Variables: mode:c++ diff --git a/src/actions/actions-base.h b/src/actions/actions-base.h index a52078881..cf43b8e02 100644 --- a/src/actions/actions-base.h +++ b/src/actions/actions-base.h @@ -11,8 +11,9 @@ #ifndef INK_ACTIONS_BASE_H #define INK_ACTIONS_BASE_H -class InkscapeApplication; +template<class T> class ConcreteInkscapeApplication; -void add_actions_base(InkscapeApplication* app); +template<class T> +void add_actions_base(ConcreteInkscapeApplication<T>* app); #endif // INK_ACTIONS_BASE_H diff --git a/src/actions/actions-output.cpp b/src/actions/actions-output.cpp index 0ea7f6dc4..1d6946553 100644 --- a/src/actions/actions-output.cpp +++ b/src/actions/actions-output.cpp @@ -210,8 +210,9 @@ export_do(InkscapeApplication *app) app->file_export()->do_export(document, filename); } +template <class T> void -add_actions_output(InkscapeApplication* app) +add_actions_output(ConcreteInkscapeApplication<T>* app) { Glib::VariantType Bool( Glib::VARIANT_TYPE_BOOL); Glib::VariantType Int( Glib::VARIANT_TYPE_INT32); @@ -255,6 +256,12 @@ add_actions_output(InkscapeApplication* app) #endif } + +template void add_actions_output(ConcreteInkscapeApplication<Gio::Application>* app); +template void add_actions_output(ConcreteInkscapeApplication<Gtk::Application>* app); + + + /* Local Variables: mode:c++ diff --git a/src/actions/actions-output.h b/src/actions/actions-output.h index fffe1842d..01ea455f7 100644 --- a/src/actions/actions-output.h +++ b/src/actions/actions-output.h @@ -12,8 +12,10 @@ #define INK_ACTIONS_OUTPUT_H class InkscapeApplication; +template<class T> class ConcreteInkscapeApplication; -void add_actions_output(InkscapeApplication* app); +template<class T> +void add_actions_output(ConcreteInkscapeApplication<T>* app); #endif // INK_ACTIONS_OUTPUT_H diff --git a/src/actions/actions-selection.cpp b/src/actions/actions-selection.cpp index 5687ebdd7..7a46f5398 100644 --- a/src/actions/actions-selection.cpp +++ b/src/actions/actions-selection.cpp @@ -100,8 +100,9 @@ select_all(InkscapeApplication* app) std::cerr << "select_all: Not implemented!" << std::endl; } +template<class T> void -add_actions_selection(InkscapeApplication* app) +add_actions_selection(ConcreteInkscapeApplication<T>* app) { app->add_action( "select-clear", sigc::bind<InkscapeApplication*>(sigc::ptr_fun(&select_clear), app) ); app->add_action_radio_string( "select", sigc::bind<InkscapeApplication*>(sigc::ptr_fun(&select_via_id), app), "null"); // Backwards compatible. @@ -111,6 +112,10 @@ add_actions_selection(InkscapeApplication* app) app->add_action_radio_string( "select-via-selector",sigc::bind<InkscapeApplication*>(sigc::ptr_fun(&select_via_selector), app), "null"); } +template void add_actions_selection(ConcreteInkscapeApplication<Gio::Application>* app); +template void add_actions_selection(ConcreteInkscapeApplication<Gtk::Application>* app); + + diff --git a/src/actions/actions-selection.h b/src/actions/actions-selection.h index 1d5a31127..f792a5cb8 100644 --- a/src/actions/actions-selection.h +++ b/src/actions/actions-selection.h @@ -11,9 +11,10 @@ #ifndef INK_ACTIONS_SELECTION_H #define INK_ACTIONS_SELECTION_H -class InkscapeApplication; +template<class T> class ConcreteInkscapeApplication; -void add_actions_selection(InkscapeApplication* app); +template<class T> +void add_actions_selection(ConcreteInkscapeApplication<T>* app); #endif // INK_ACTIONS_SELECTION_H diff --git a/src/actions/actions-transform.cpp b/src/actions/actions-transform.cpp index 2480363fa..10dabd76a 100644 --- a/src/actions/actions-transform.cpp +++ b/src/actions/actions-transform.cpp @@ -27,8 +27,9 @@ transform_rotate(const Glib::VariantBase& value, InkscapeApplication *app) selection->rotate(d.get()); } +template<class T> void -add_actions_transform(InkscapeApplication* app) +add_actions_transform(ConcreteInkscapeApplication<T>* app) { Glib::VariantType Bool( Glib::VARIANT_TYPE_BOOL); Glib::VariantType Int( Glib::VARIANT_TYPE_INT32); @@ -45,6 +46,10 @@ add_actions_transform(InkscapeApplication* app) +template void add_actions_transform(ConcreteInkscapeApplication<Gio::Application>* app); +template void add_actions_transform(ConcreteInkscapeApplication<Gtk::Application>* app); + + /* Local Variables: diff --git a/src/actions/actions-transform.h b/src/actions/actions-transform.h index 9b1b0dc3d..03c2afd97 100644 --- a/src/actions/actions-transform.h +++ b/src/actions/actions-transform.h @@ -11,9 +11,10 @@ #ifndef INK_ACTIONS_TRANSFORM_H #define INK_ACTIONS_TRANSFORM_H -class InkscapeApplication; +template<class T> class ConcreteInkscapeApplication; -void add_actions_transform(InkscapeApplication* app); +template<class T> +void add_actions_transform(ConcreteInkscapeApplication<T>* app); #endif // INK_ACTIONS_TRANSFORM_H |
