From 7bbad129a0c9c9f3a38b178557d68623bef03464 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sun, 9 Dec 2018 20:04:42 +0100 Subject: Gtk/Gio templating of main inkscape application class to allow commandline usage when graphic server is not available --- src/actions/actions-base.cpp | 6 +++++- src/actions/actions-base.h | 5 +++-- src/actions/actions-output.cpp | 9 ++++++++- src/actions/actions-output.h | 4 +++- src/actions/actions-selection.cpp | 7 ++++++- src/actions/actions-selection.h | 5 +++-- src/actions/actions-transform.cpp | 7 ++++++- src/actions/actions-transform.h | 5 +++-- 8 files changed, 37 insertions(+), 11 deletions(-) (limited to 'src/actions') 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 void -add_actions_base(InkscapeApplication* app) +add_actions_base(ConcreteInkscapeApplication* 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* app); +template void add_actions_base(ConcreteInkscapeApplication* 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 ConcreteInkscapeApplication; -void add_actions_base(InkscapeApplication* app); +template +void add_actions_base(ConcreteInkscapeApplication* 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 void -add_actions_output(InkscapeApplication* app) +add_actions_output(ConcreteInkscapeApplication* 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* app); +template void add_actions_output(ConcreteInkscapeApplication* 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 ConcreteInkscapeApplication; -void add_actions_output(InkscapeApplication* app); +template +void add_actions_output(ConcreteInkscapeApplication* 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 void -add_actions_selection(InkscapeApplication* app) +add_actions_selection(ConcreteInkscapeApplication* app) { app->add_action( "select-clear", sigc::bind(sigc::ptr_fun(&select_clear), app) ); app->add_action_radio_string( "select", sigc::bind(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(sigc::ptr_fun(&select_via_selector), app), "null"); } +template void add_actions_selection(ConcreteInkscapeApplication* app); +template void add_actions_selection(ConcreteInkscapeApplication* 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 ConcreteInkscapeApplication; -void add_actions_selection(InkscapeApplication* app); +template +void add_actions_selection(ConcreteInkscapeApplication* 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 void -add_actions_transform(InkscapeApplication* app) +add_actions_transform(ConcreteInkscapeApplication* 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* app); +template void add_actions_transform(ConcreteInkscapeApplication* 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 ConcreteInkscapeApplication; -void add_actions_transform(InkscapeApplication* app); +template +void add_actions_transform(ConcreteInkscapeApplication* app); #endif // INK_ACTIONS_TRANSFORM_H -- cgit v1.2.3