diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2018-12-10 13:29:19 +0000 |
|---|---|---|
| committer | Tavmjong Bah <tavmjong@free.fr> | 2018-12-10 13:29:19 +0000 |
| commit | 3c200d427b4de843d3c979e2c7269ee8f3a31e0b (patch) | |
| tree | 22fafaa06b47df78ca3a2c479b028616ad753da0 /src | |
| parent | remove Inkscape::URI::getFullPath (diff) | |
| download | inkscape-3c200d427b4de843d3c979e2c7269ee8f3a31e0b.tar.gz inkscape-3c200d427b4de843d3c979e2c7269ee8f3a31e0b.zip | |
Minor tweaks.
Diffstat (limited to 'src')
| -rw-r--r-- | src/inkscape-application.cpp | 6 | ||||
| -rw-r--r-- | src/inkscape-application.h | 21 | ||||
| -rw-r--r-- | src/inkscape-main.cpp | 2 |
3 files changed, 16 insertions, 13 deletions
diff --git a/src/inkscape-application.cpp b/src/inkscape-application.cpp index a5bde2d25..4c39ee51c 100644 --- a/src/inkscape-application.cpp +++ b/src/inkscape-application.cpp @@ -180,7 +180,9 @@ ConcreteInkscapeApplication<T>::on_startup() // Here are things that should be in on_startup() but cannot be as we don't set _with_gui until // on_handle_local_options() is called. -template<> void ConcreteInkscapeApplication<Gio::Application>::on_startup2() +template<> +void +ConcreteInkscapeApplication<Gio::Application>::on_startup2() { Inkscape::Application::create(nullptr, false); } @@ -589,7 +591,7 @@ ConcreteInkscapeApplication<T>::on_handle_local_options(const Glib::RefPtr<Glib: // ===================== QUERY ===================== - // 'query-id' should be processed first! Idea: We could turn this into a comma separated list. + // 'query-id' should be processed first! Can be a comma separated list. if (options->contains("query-id")) { Glib::ustring query_id; options->lookup_value("query-id", query_id); diff --git a/src/inkscape-application.h b/src/inkscape-application.h index c80110ac2..e8cf12ee9 100644 --- a/src/inkscape-application.h +++ b/src/inkscape-application.h @@ -42,24 +42,25 @@ public: virtual void on_quit() = 0; SPDocument* get_active_document(); Inkscape::Selection* get_active_selection(); + protected: bool _with_gui; bool _use_shell; InkscapeApplication(); + // Documents are owned by the application which is responsible for opening/saving/exporting. WIP std::vector<SPDocument*> _documents; + InkFileExportCmd _file_export; + // Actions from the command line or file. action_vector_t _command_line_actions; - - }; - - - - - +// T can be either: +// Gio::Application (window server is not present) or +// Gtk::Application (window server is present). +// With Gtk::Application, one can still run "headless" by not creating any windows. template <class T> class ConcreteInkscapeApplication : public T, public InkscapeApplication { public: @@ -78,11 +79,11 @@ protected: private: // Callbacks - int on_handle_local_options(const Glib::RefPtr<Glib::VariantDict>& options); + int on_handle_local_options(const Glib::RefPtr<Glib::VariantDict>& options) override; // Actions - void on_new(); - void on_quit(); + void on_new() override; + void on_quit() override; void on_about(); void shell(); diff --git a/src/inkscape-main.cpp b/src/inkscape-main.cpp index e1c0411e0..d4fe68bb8 100644 --- a/src/inkscape-main.cpp +++ b/src/inkscape-main.cpp @@ -20,7 +20,7 @@ int main(int argc, char *argv[]) { - if(gtk_init_check(NULL, NULL)) + if (gtk_init_check(NULL, NULL)) return (new ConcreteInkscapeApplication<Gtk::Application>())->run(argc, argv); else return (new ConcreteInkscapeApplication<Gio::Application>())->run(argc, argv); |
