summaryrefslogtreecommitdiffstats
path: root/src/inkscape-application.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2019-02-15 12:07:06 +0000
committerTavmjong Bah <tavmjong@free.fr>2019-02-15 12:07:06 +0000
commit93ae542b95b3708e49a75aaa6f81943819e95f7e (patch)
tree1fdb0613de56280bd1036e8eb2f7b96896ded948 /src/inkscape-application.cpp
parentMove all files except inkscape_main and inkview_main into shared library. (diff)
downloadinkscape-93ae542b95b3708e49a75aaa6f81943819e95f7e.tar.gz
inkscape-93ae542b95b3708e49a75aaa6f81943819e95f7e.zip
Turn InkscapeApplication into singleton.
Diffstat (limited to 'src/inkscape-application.cpp')
-rw-r--r--src/inkscape-application.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/inkscape-application.cpp b/src/inkscape-application.cpp
index 0ebc93f82..cd88345ff 100644
--- a/src/inkscape-application.cpp
+++ b/src/inkscape-application.cpp
@@ -52,6 +52,11 @@ InkscapeApplication::InkscapeApplication()
, _active_view(nullptr)
{}
+/** Update windows in response to:
+ * - New active window
+ * - Document change
+ * - Selection change
+ */
void
InkscapeApplication::update_windows(SPDocument* document)
{
@@ -60,12 +65,22 @@ InkscapeApplication::update_windows(SPDocument* document)
if (it != _documents.end()) {
std::vector<InkscapeWindow*> windows = it->second;
std::cout << "InkscapeApplication::update_windows: windows: " << windows.size() << std::endl;
+ // Loop over InkscapeWindows.
+ // Loop over DialogWindows. TBD
} else {
std::cout << "InkscapeApplication::update_windows: no windows found" << std::endl;
}
}
template<class T>
+ConcreteInkscapeApplication<T>&
+ConcreteInkscapeApplication<T>::get_instance()
+{
+ static ConcreteInkscapeApplication<T> instance;
+ return instance;
+}
+
+template<class T>
ConcreteInkscapeApplication<T>::ConcreteInkscapeApplication()
: T("org.inkscape.application.with_gui",
Gio::APPLICATION_HANDLES_OPEN | // Use default file opening.