diff options
| author | Liam P. White <inkscapebrony@gmail.com> | 2014-11-26 01:17:02 +0000 |
|---|---|---|
| committer | Liam P. White <inkscapebrony@gmail.com> | 2014-11-26 01:17:02 +0000 |
| commit | bed3cc55fe40330718204c540b328d95407b00fa (patch) | |
| tree | e4269aab0a32957163935ec6b828b25d00613d68 /src/extension | |
| parent | Add CMake file to find LCMS2 (diff) | |
| parent | Update to trunk r13766 (diff) | |
| download | inkscape-bed3cc55fe40330718204c540b328d95407b00fa.tar.gz inkscape-bed3cc55fe40330718204c540b328d95407b00fa.zip | |
Merge inkscape-cppify branch
(bzr r13767)
Diffstat (limited to 'src/extension')
| -rw-r--r-- | src/extension/dbus/application-interface.cpp | 4 | ||||
| -rw-r--r-- | src/extension/dbus/dbus-init.cpp | 10 | ||||
| -rw-r--r-- | src/extension/dbus/document-interface.cpp | 2 | ||||
| -rw-r--r-- | src/extension/effect.cpp | 10 | ||||
| -rw-r--r-- | src/extension/error-file.cpp | 3 | ||||
| -rw-r--r-- | src/extension/extension.cpp | 2 | ||||
| -rw-r--r-- | src/extension/implementation/script.cpp | 2 | ||||
| -rw-r--r-- | src/extension/init.cpp | 2 | ||||
| -rw-r--r-- | src/extension/internal/cdr-input.cpp | 2 | ||||
| -rw-r--r-- | src/extension/internal/filter/filter-file.cpp | 2 | ||||
| -rw-r--r-- | src/extension/internal/pdfinput/pdf-input.cpp | 2 | ||||
| -rw-r--r-- | src/extension/internal/vsd-input.cpp | 2 | ||||
| -rw-r--r-- | src/extension/system.cpp | 2 |
13 files changed, 24 insertions, 21 deletions
diff --git a/src/extension/dbus/application-interface.cpp b/src/extension/dbus/application-interface.cpp index c0bc19d90..292832a4b 100644 --- a/src/extension/dbus/application-interface.cpp +++ b/src/extension/dbus/application-interface.cpp @@ -49,7 +49,7 @@ application_interface_init (ApplicationInterface *app_interface) static bool ensure_desktop_valid(GError **error) { - if (!inkscape_use_gui()) { + if (!INKSCAPE.use_gui()) { g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Application interface action requires a GUI"); return false; } @@ -59,7 +59,7 @@ ensure_desktop_valid(GError **error) static bool ensure_desktop_not_present(GError **error) { - if (inkscape_use_gui()) { + if (INKSCAPE.use_gui()) { g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Application interface action requires non-GUI (command line) mode"); return false; } diff --git a/src/extension/dbus/dbus-init.cpp b/src/extension/dbus/dbus-init.cpp index 19b48e10d..43830762c 100644 --- a/src/extension/dbus/dbus-init.cpp +++ b/src/extension/dbus/dbus-init.cpp @@ -153,23 +153,23 @@ gchar * init_document (void) { // This is for command-line use only - g_assert(!inkscape_use_gui()); + g_assert(!INKSCAPE.use_gui()); // Create a blank document and get its selection model etc in an ActionContext SPDocument *doc = SPDocument::createNewDoc(NULL, 1, TRUE); - inkscape_add_document(doc); - return dbus_register_document(inkscape_action_context_for_document(doc)); + INKSCAPE.add_document(doc); + return dbus_register_document(INKSCAPE.action_context_for_document(doc)); } gchar * init_active_document() { - SPDocument *doc = inkscape_active_document(); + SPDocument *doc = INKSCAPE.active_document(); if (!doc) { return NULL; } - return dbus_register_document(inkscape_active_action_context()); + return dbus_register_document(INKSCAPE.active_action_context()); } gchar * diff --git a/src/extension/dbus/document-interface.cpp b/src/extension/dbus/document-interface.cpp index e3452f4ce..bd5f826d3 100644 --- a/src/extension/dbus/document-interface.cpp +++ b/src/extension/dbus/document-interface.cpp @@ -156,7 +156,7 @@ get_name_from_object (SPObject * obj) void desktop_ensure_active (SPDesktop* desk) { if (desk != SP_ACTIVE_DESKTOP) - inkscape_activate_desktop (desk); + INKSCAPE.activate_desktop (desk); return; } diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp index 3c8ee5844..c8f3b2ff9 100644 --- a/src/extension/effect.cpp +++ b/src/extension/effect.cpp @@ -9,7 +9,7 @@ */ #include "prefdialog.h" -#include "inkscape-private.h" +#include "inkscape.h" #include "helper/action.h" #include "ui/view/view.h" #include "desktop-handles.h" @@ -89,11 +89,13 @@ Effect::Effect (Inkscape::XML::Node * in_repr, Implementation::Implementation * } // children of "inkscape-extension" } // if we have an XML file - if (INKSCAPE != NULL && inkscape_use_gui()) { + // \TODO this gets called from the Inkscape::Application constructor, where it initializes the menus. + // But in the constructor, our object isn't quite there yet! + if (Inkscape::Application::exists() && INKSCAPE.use_gui()) { if (_effects_list == NULL) - _effects_list = find_menu(inkscape_get_menus(INKSCAPE), EFFECTS_LIST); + _effects_list = find_menu(INKSCAPE.get_menus(), EFFECTS_LIST); if (_filters_list == NULL) - _filters_list = find_menu(inkscape_get_menus(INKSCAPE), FILTERS_LIST); + _filters_list = find_menu(INKSCAPE.get_menus(), FILTERS_LIST); } if ((_effects_list != NULL || _filters_list != NULL)) { diff --git a/src/extension/error-file.cpp b/src/extension/error-file.cpp index f60af870f..db354c0ce 100644 --- a/src/extension/error-file.cpp +++ b/src/extension/error-file.cpp @@ -48,9 +48,10 @@ ErrorFileNotice::ErrorFileNotice (void) : ) { + // \FIXME change this /* This is some filler text, needs to change before relase */ Glib::ustring dialog_text(_("<span weight=\"bold\" size=\"larger\">One or more extensions failed to load</span>\n\nThe failed extensions have been skipped. Inkscape will continue to run normally but those extensions will be unavailable. For details to troubleshoot this problem, please refer to the error log located at: ")); - gchar * ext_error_file = profile_path(EXTENSION_ERROR_LOG_FILENAME); + gchar * ext_error_file = Inkscape::Application::profile_path(EXTENSION_ERROR_LOG_FILENAME); dialog_text += ext_error_file; g_free(ext_error_file); set_message(dialog_text, true); diff --git a/src/extension/extension.cpp b/src/extension/extension.cpp index 6a22eb585..3d0f49a20 100644 --- a/src/extension/extension.cpp +++ b/src/extension/extension.cpp @@ -667,7 +667,7 @@ Extension::set_param_color (const gchar * name, guint32 color, SPDocument * doc, void Extension::error_file_open (void) { - gchar * ext_error_file = profile_path(EXTENSION_ERROR_LOG_FILENAME); + gchar * ext_error_file = Inkscape::Application::profile_path(EXTENSION_ERROR_LOG_FILENAME); gchar * filename = g_filename_from_utf8( ext_error_file, -1, NULL, NULL, NULL ); error_file.open(filename); if (!error_file.is_open()) { diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 99c882a01..e6ac13cdc 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -1051,7 +1051,7 @@ int Script::execute (const std::list<std::string> &in_command, Glib::ustring stderr_data = fileerr.string(); if (stderr_data.length() != 0 && - inkscape_use_gui() + INKSCAPE.use_gui() ) { checkStderr(stderr_data, Gtk::MESSAGE_INFO, _("Inkscape has received additional data from the script executed. " diff --git a/src/extension/init.cpp b/src/extension/init.cpp index 912d58a13..c16a5a899 100644 --- a/src/extension/init.cpp +++ b/src/extension/init.cpp @@ -243,7 +243,7 @@ init() /* Load search path for extensions */ if (Inkscape::Extension::Extension::search_path.size() == 0) { - Inkscape::Extension::Extension::search_path.push_back(profile_path("extensions")); + Inkscape::Extension::Extension::search_path.push_back(Inkscape::Application::profile_path("extensions")); Inkscape::Extension::Extension::search_path.push_back(g_strdup(INKSCAPE_EXTENSIONDIR)); diff --git a/src/extension/internal/cdr-input.cpp b/src/extension/internal/cdr-input.cpp index 3a3e2b58e..fb58887c9 100644 --- a/src/extension/internal/cdr-input.cpp +++ b/src/extension/internal/cdr-input.cpp @@ -263,7 +263,7 @@ SPDocument *CdrInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * u // If only one page is present, import that one without bothering user if (tmpSVGOutput.size() > 1) { CdrImportDialog *dlg = 0; - if (inkscape_use_gui()) { + if (INKSCAPE.use_gui()) { dlg = new CdrImportDialog(tmpSVGOutput); if (!dlg->showDialog()) { delete dlg; diff --git a/src/extension/internal/filter/filter-file.cpp b/src/extension/internal/filter/filter-file.cpp index 48e64f089..b1993057d 100644 --- a/src/extension/internal/filter/filter-file.cpp +++ b/src/extension/internal/filter/filter-file.cpp @@ -29,7 +29,7 @@ namespace Filter { void Filter::filters_all_files(void) { - gchar *filtersProfilePath = profile_path("filters"); + gchar *filtersProfilePath = Inkscape::Application::profile_path("filters"); filters_load_dir(INKSCAPE_FILTERDIR, _("Bundled")); filters_load_dir(filtersProfilePath, _("Personal")); diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp index c8a7feabf..defb15754 100644 --- a/src/extension/internal/pdfinput/pdf-input.cpp +++ b/src/extension/internal/pdfinput/pdf-input.cpp @@ -720,7 +720,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) { } PdfImportDialog *dlg = NULL; - if (inkscape_use_gui()) { + if (INKSCAPE.use_gui()) { dlg = new PdfImportDialog(pdf_doc, uri); if (!dlg->showDialog()) { _cancelled = true; diff --git a/src/extension/internal/vsd-input.cpp b/src/extension/internal/vsd-input.cpp index 9f9bf2651..25815e64f 100644 --- a/src/extension/internal/vsd-input.cpp +++ b/src/extension/internal/vsd-input.cpp @@ -263,7 +263,7 @@ SPDocument *VsdInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * u // If only one page is present, import that one without bothering user if (tmpSVGOutput.size() > 1) { VsdImportDialog *dlg = 0; - if (inkscape_use_gui()) { + if (INKSCAPE.use_gui()) { dlg = new VsdImportDialog(tmpSVGOutput); if (!dlg->showDialog()) { delete dlg; diff --git a/src/extension/system.cpp b/src/extension/system.cpp index 5225f11ee..6a95717f2 100644 --- a/src/extension/system.cpp +++ b/src/extension/system.cpp @@ -121,7 +121,7 @@ SPDocument *open(Extension *key, gchar const *filename) } if (last_chance_svg) { - if ( inkscape_use_gui() ) { + if ( INKSCAPE.use_gui() ) { sp_ui_error_dialog(_("Format autodetect failed. The file is being opened as SVG.")); } else { g_warning("%s", _("Format autodetect failed. The file is being opened as SVG.")); |
