summaryrefslogtreecommitdiffstats
path: root/src/extension
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-12-02 18:39:33 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-12-02 18:39:33 +0000
commit09e2f7b62d13537a0f006fc9953c533802fd9c12 (patch)
tree78c1a72538f0e60e38c3ca1845a909fcad53f394 /src/extension
parentadding fussion improvements (diff)
parentExtensions. Fix for Bug #1192746 (e key does not start export on firefox [Jes... (diff)
downloadinkscape-09e2f7b62d13537a0f006fc9953c533802fd9c12.tar.gz
inkscape-09e2f7b62d13537a0f006fc9953c533802fd9c12.zip
update to trunk
(bzr r13708.1.4)
Diffstat (limited to 'src/extension')
-rw-r--r--src/extension/dbus/application-interface.cpp4
-rw-r--r--src/extension/dbus/dbus-init.cpp10
-rw-r--r--src/extension/dbus/document-interface.cpp2
-rw-r--r--src/extension/effect.cpp10
-rw-r--r--src/extension/error-file.cpp3
-rw-r--r--src/extension/extension.cpp2
-rw-r--r--src/extension/implementation/script.cpp2
-rw-r--r--src/extension/init.cpp2
-rw-r--r--src/extension/internal/cairo-renderer.cpp10
-rw-r--r--src/extension/internal/cdr-input.cpp4
-rw-r--r--src/extension/internal/emf-print.cpp2
-rw-r--r--src/extension/internal/filter/filter-file.cpp2
-rw-r--r--src/extension/internal/gdkpixbuf-input.cpp2
-rw-r--r--src/extension/internal/grid.cpp2
-rw-r--r--src/extension/internal/pdfinput/pdf-input.cpp4
-rw-r--r--src/extension/internal/vsd-input.cpp4
-rw-r--r--src/extension/internal/wpg-input.cpp2
-rw-r--r--src/extension/system.cpp2
18 files changed, 36 insertions, 33 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/cairo-renderer.cpp b/src/extension/internal/cairo-renderer.cpp
index 5a9a28ef9..1f48d2097 100644
--- a/src/extension/internal/cairo-renderer.cpp
+++ b/src/extension/internal/cairo-renderer.cpp
@@ -206,7 +206,7 @@ static void sp_shape_render(SPShape *shape, CairoRenderContext *ctx)
} else if (marker->orient_mode == MARKER_ORIENT_AUTO_START_REVERSE) {
tr = Geom::Rotate::from_degrees( 180.0 ) * sp_shape_marker_get_transform_at_start(pathv.begin()->front());
} else {
- tr = Geom::Rotate::from_degrees(marker->orient) * Geom::Translate(pathv.begin()->front().pointAt(0));
+ tr = Geom::Rotate::from_degrees(marker->orient.computed) * Geom::Translate(pathv.begin()->front().pointAt(0));
}
sp_shape_render_invoke_marker_rendering(marker, tr, style, ctx);
}
@@ -224,7 +224,7 @@ static void sp_shape_render(SPShape *shape, CairoRenderContext *ctx)
if (marker->orient_mode != MARKER_ORIENT_ANGLE) {
tr = sp_shape_marker_get_transform_at_start(path_it->front());
} else {
- tr = Geom::Rotate::from_degrees(marker->orient) * Geom::Translate(path_it->front().pointAt(0));
+ tr = Geom::Rotate::from_degrees(marker->orient.computed) * Geom::Translate(path_it->front().pointAt(0));
}
sp_shape_render_invoke_marker_rendering(marker, tr, style, ctx);
}
@@ -241,7 +241,7 @@ static void sp_shape_render(SPShape *shape, CairoRenderContext *ctx)
if (marker->orient_mode != MARKER_ORIENT_ANGLE) {
tr = sp_shape_marker_get_transform(*curve_it1, *curve_it2);
} else {
- tr = Geom::Rotate::from_degrees(marker->orient) * Geom::Translate(curve_it1->pointAt(1));
+ tr = Geom::Rotate::from_degrees(marker->orient.computed) * Geom::Translate(curve_it1->pointAt(1));
}
sp_shape_render_invoke_marker_rendering(marker, tr, style, ctx);
@@ -257,7 +257,7 @@ static void sp_shape_render(SPShape *shape, CairoRenderContext *ctx)
if (marker->orient_mode != MARKER_ORIENT_ANGLE) {
tr = sp_shape_marker_get_transform_at_end(lastcurve);
} else {
- tr = Geom::Rotate::from_degrees(marker->orient) * Geom::Translate(lastcurve.pointAt(1));
+ tr = Geom::Rotate::from_degrees(marker->orient.computed) * Geom::Translate(lastcurve.pointAt(1));
}
sp_shape_render_invoke_marker_rendering(marker, tr, style, ctx);
}
@@ -281,7 +281,7 @@ static void sp_shape_render(SPShape *shape, CairoRenderContext *ctx)
if (marker->orient_mode != MARKER_ORIENT_ANGLE) {
tr = sp_shape_marker_get_transform_at_end(lastcurve);
} else {
- tr = Geom::Rotate::from_degrees(marker->orient) * Geom::Translate(lastcurve.pointAt(1));
+ tr = Geom::Rotate::from_degrees(marker->orient.computed) * Geom::Translate(lastcurve.pointAt(1));
}
sp_shape_render_invoke_marker_rendering(marker, tr, style, ctx);
diff --git a/src/extension/internal/cdr-input.cpp b/src/extension/internal/cdr-input.cpp
index 3a3e2b58e..f4789a08f 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;
@@ -285,7 +285,7 @@ SPDocument *CdrInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * u
// Set viewBox if it doesn't exist
if (doc && !doc->getRoot()->viewBox_set) {
- doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc->getDefaultUnit()), doc->getHeight().value(doc->getDefaultUnit())));
+ doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc->getDisplayUnit()), doc->getHeight().value(doc->getDisplayUnit())));
}
return doc;
}
diff --git a/src/extension/internal/emf-print.cpp b/src/extension/internal/emf-print.cpp
index 0f43fbca1..f7b6626c4 100644
--- a/src/extension/internal/emf-print.cpp
+++ b/src/extension/internal/emf-print.cpp
@@ -144,7 +144,7 @@ unsigned int PrintEmf::begin(Inkscape::Extension::Print *mod, SPDocument *doc)
// width and height in px
_width = doc->getWidth().value("px");
_height = doc->getHeight().value("px");
- _doc_unit_scale = Inkscape::Util::Quantity::convert(1, (doc->getDefaultUnit()), "px");
+ _doc_unit_scale = Inkscape::Util::Quantity::convert(1, &doc->getSVGUnit(), "px");
// initialize a few global variables
hbrush = hbrushOld = hpen = 0;
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/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp
index 28e44c461..04a446d1c 100644
--- a/src/extension/internal/gdkpixbuf-input.cpp
+++ b/src/extension/internal/gdkpixbuf-input.cpp
@@ -136,7 +136,7 @@ GdkpixbufInput::open(Inkscape::Extension::Input *mod, char const *uri)
// Set viewBox if it doesn't exist
if (!doc->getRoot()->viewBox_set) {
std::cout << "Viewbox not set, setting" << std::endl;
- doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc->getDefaultUnit()), doc->getHeight().value(doc->getDefaultUnit())));
+ doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc->getDisplayUnit()), doc->getHeight().value(doc->getDisplayUnit())));
}
// restore undo, as now this document may be shown to the user if a bitmap was opened
diff --git a/src/extension/internal/grid.cpp b/src/extension/internal/grid.cpp
index 0059bbec2..f4e0e5843 100644
--- a/src/extension/internal/grid.cpp
+++ b/src/extension/internal/grid.cpp
@@ -113,7 +113,7 @@ Grid::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View *doc
bounding_area = temprec;
}
- gdouble scale = Inkscape::Util::Quantity::convert(1, "px", (document->doc())->getDefaultUnit());
+ gdouble scale = Inkscape::Util::Quantity::convert(1, "px", &document->doc()->getSVGUnit());
bounding_area *= Geom::Scale(scale);
Geom::Point spacings( scale * module->get_param_float("xspacing"),
scale * module->get_param_float("yspacing") );
diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
index c8a7feabf..148d2dcba 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;
@@ -883,7 +883,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
// Set viewBox if it doesn't exist
if (!doc->getRoot()->viewBox_set) {
- doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc->getDefaultUnit()), doc->getHeight().value(doc->getDefaultUnit())));
+ doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc->getDisplayUnit()), doc->getHeight().value(doc->getDisplayUnit())));
}
// Restore undo
diff --git a/src/extension/internal/vsd-input.cpp b/src/extension/internal/vsd-input.cpp
index 9f9bf2651..7fd0d363b 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;
@@ -285,7 +285,7 @@ SPDocument *VsdInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * u
// Set viewBox if it doesn't exist
if (!doc->getRoot()->viewBox_set) {
- doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc->getDefaultUnit()), doc->getHeight().value(doc->getDefaultUnit())));
+ doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc->getDisplayUnit()), doc->getHeight().value(doc->getDisplayUnit())));
}
return doc;
diff --git a/src/extension/internal/wpg-input.cpp b/src/extension/internal/wpg-input.cpp
index 12d86a99a..54a14fc72 100644
--- a/src/extension/internal/wpg-input.cpp
+++ b/src/extension/internal/wpg-input.cpp
@@ -129,7 +129,7 @@ SPDocument *WpgInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * u
// Set viewBox if it doesn't exist
if (doc && !doc->getRoot()->viewBox_set) {
- doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc->getDefaultUnit()), doc->getHeight().value(doc->getDefaultUnit())));
+ doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().value(doc->getDisplayUnit()), doc->getHeight().value(doc->getDisplayUnit())));
}
delete input;
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."));