From 69ae98cb453849c6d32a1c7ea8bc057fb13deea3 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Wed, 25 Jun 2014 11:32:51 -0400 Subject: 1. make it compile (bzr r13341.5.1) --- src/main.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 517ba0506..597cda27d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -933,9 +933,9 @@ guint get_group0_keyval(GdkEventKey const* event); static void snooper(GdkEvent *event, gpointer /*data*/) { - if (inkscape_mapalt()) /* returns the map of the keyboard modifier to map to Alt, zero if no mapping */ + if (INKSCAPE->mapalt()) /* returns the map of the keyboard modifier to map to Alt, zero if no mapping */ { - GdkModifierType mapping=(GdkModifierType)inkscape_mapalt(); + GdkModifierType mapping=(GdkModifierType)INKSCAPE->mapalt(); switch (event->type) { case GDK_MOTION_NOTIFY: if(event->motion.state & mapping) { @@ -957,7 +957,7 @@ snooper(GdkEvent *event, gpointer /*data*/) { } } - if (inkscape_trackalt()) { + if (INKSCAPE->trackalt()) { // MacOS X with X11 has some problem with the default // xmodmapping. A ~/.xmodmap solution does not work reliably due // to the way we package our executable in a .app that can launch @@ -1042,7 +1042,7 @@ sp_main_gui(int argc, char const **argv) } // Add our icon directory to the search path for icon theme lookups. - gchar *usericondir = profile_path("icons"); + gchar *usericondir = INKSCAPE->profile_path("icons"); gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), usericondir); gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), INKSCAPE_PIXMAPDIR); g_free(usericondir); @@ -1125,14 +1125,14 @@ static int sp_process_file_list(GSList *fl) retVal++; } else { - inkscape_add_document(doc); + INKSCAPE->add_document(doc); if (sp_vacuum_defs) { doc->vacuumDocument(); } // Execute command-line actions (selections and verbs) using our local models - bool has_performed_actions = Inkscape::CmdLineAction::doList(inkscape_active_action_context()); + bool has_performed_actions = Inkscape::CmdLineAction::doList(INKSCAPE->active_action_context()); #ifdef WITH_DBUS // If we've been asked to listen for D-Bus messages, enter a main loop here @@ -1221,7 +1221,7 @@ static int sp_process_file_list(GSList *fl) do_query_dimension (doc, false, sp_query_x? Geom::X : Geom::Y, sp_query_id); } - inkscape_remove_document(doc); + INKSCAPE->remove_document(doc); delete doc; } -- cgit v1.2.3 From cdc7587062b42c39a23451e5c9ec7da06dd6fdb3 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Wed, 25 Jun 2014 21:45:01 -0400 Subject: 3. remove dead code, refactor existing code. Connect overlooked signals. (bzr r13341.5.3) --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 597cda27d..77be9a275 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -74,7 +74,7 @@ #include "svg/svg-color.h" #include "svg/stringstream.h" -#include "inkscape-private.h" +#include "inkscape.h" #include "inkscape-version.h" #include "sp-namedview.h" -- cgit v1.2.3 From 6dfb9b4eade77ac55d11f05669c2192352b9b8fa Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Thu, 26 Jun 2014 13:49:17 -0400 Subject: 4. further refactor Application class; create proper singleton, encapsulate members, simplify signals (bzr r13341.5.6) --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 77be9a275..8d978c5ab 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1059,7 +1059,7 @@ sp_main_gui(int argc, char const **argv) gboolean create_new = TRUE; /// \todo FIXME BROKEN - non-UTF-8 sneaks in here. - inkscape_application_init(argv[0], true); + Inkscape::Application::init(argv[0], true); while (fl) { if (sp_file_open((gchar *)fl->data,NULL)) { @@ -1335,7 +1335,7 @@ int sp_main_console(int argc, char const **argv) exit(0); } - inkscape_application_init(argv[0], false); + Inkscape::Application::init(argv[0], false); if (sp_shell) { int retVal = sp_main_shell(argv[0]); // Run as interactive shell -- cgit v1.2.3 From 1ed5e67c01975040a78765a1cf97b942d736c14b Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Thu, 26 Jun 2014 15:40:39 -0400 Subject: Convert accidental member accesses into static function accesses (bzr r13341.5.7) --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 8d978c5ab..499285a7b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1042,7 +1042,7 @@ sp_main_gui(int argc, char const **argv) } // Add our icon directory to the search path for icon theme lookups. - gchar *usericondir = INKSCAPE->profile_path("icons"); + gchar *usericondir = Inkscape::Application::profile_path("icons"); gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), usericondir); gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), INKSCAPE_PIXMAPDIR); g_free(usericondir); -- cgit v1.2.3 From a65c95ff4739e2803e28d64b2a3b3774dd1f45aa Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Thu, 26 Jun 2014 21:40:01 -0400 Subject: Move constructor/destructor into private section, remove protected section. Rename init(). Add to-do list. (bzr r13341.5.8) --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 499285a7b..2e36e3d50 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1059,7 +1059,7 @@ sp_main_gui(int argc, char const **argv) gboolean create_new = TRUE; /// \todo FIXME BROKEN - non-UTF-8 sneaks in here. - Inkscape::Application::init(argv[0], true); + Inkscape::Application::create(argv[0], true); while (fl) { if (sp_file_open((gchar *)fl->data,NULL)) { @@ -1335,7 +1335,7 @@ int sp_main_console(int argc, char const **argv) exit(0); } - Inkscape::Application::init(argv[0], false); + Inkscape::Application::create(argv[0], false); if (sp_shell) { int retVal = sp_main_shell(argv[0]); // Run as interactive shell -- cgit v1.2.3 From 45f373f3319b598d8e0222fb48e9d3a4760b2044 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Fri, 27 Jun 2014 15:23:06 -0400 Subject: 5. Refactoring of Application class: make copy/assignment operators private, disallow pointers to Application (bzr r13341.5.9) --- src/main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 2e36e3d50..e57231d17 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -933,9 +933,9 @@ guint get_group0_keyval(GdkEventKey const* event); static void snooper(GdkEvent *event, gpointer /*data*/) { - if (INKSCAPE->mapalt()) /* returns the map of the keyboard modifier to map to Alt, zero if no mapping */ + if (INKSCAPE.mapalt()) /* returns the map of the keyboard modifier to map to Alt, zero if no mapping */ { - GdkModifierType mapping=(GdkModifierType)INKSCAPE->mapalt(); + GdkModifierType mapping=(GdkModifierType)INKSCAPE.mapalt(); switch (event->type) { case GDK_MOTION_NOTIFY: if(event->motion.state & mapping) { @@ -957,7 +957,7 @@ snooper(GdkEvent *event, gpointer /*data*/) { } } - if (INKSCAPE->trackalt()) { + if (INKSCAPE.trackalt()) { // MacOS X with X11 has some problem with the default // xmodmapping. A ~/.xmodmap solution does not work reliably due // to the way we package our executable in a .app that can launch @@ -1125,14 +1125,14 @@ static int sp_process_file_list(GSList *fl) retVal++; } else { - INKSCAPE->add_document(doc); + INKSCAPE.add_document(doc); if (sp_vacuum_defs) { doc->vacuumDocument(); } // Execute command-line actions (selections and verbs) using our local models - bool has_performed_actions = Inkscape::CmdLineAction::doList(INKSCAPE->active_action_context()); + bool has_performed_actions = Inkscape::CmdLineAction::doList(INKSCAPE.active_action_context()); #ifdef WITH_DBUS // If we've been asked to listen for D-Bus messages, enter a main loop here @@ -1221,7 +1221,7 @@ static int sp_process_file_list(GSList *fl) do_query_dimension (doc, false, sp_query_x? Geom::X : Geom::Y, sp_query_id); } - INKSCAPE->remove_document(doc); + INKSCAPE.remove_document(doc); delete doc; } -- cgit v1.2.3