From c43545a9ecf143cc0e6f8e3e3d81a7787710ed6b Mon Sep 17 00:00:00 2001 From: bulia byak Date: Sun, 12 Jul 2009 16:39:27 +0000 Subject: fix a small memleak (bzr r8265) --- src/extension/internal/bitmap/imagemagick.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/extension') diff --git a/src/extension/internal/bitmap/imagemagick.cpp b/src/extension/internal/bitmap/imagemagick.cpp index ab2834141..e907612fd 100644 --- a/src/extension/internal/bitmap/imagemagick.cpp +++ b/src/extension/internal/bitmap/imagemagick.cpp @@ -129,6 +129,7 @@ ImageMagickDocCache::readImage(const char *xlink, Magick::Image *image) image->read(path); } catch (...) {} } + g_free(search); } bool -- cgit v1.2.3 From d8d60c60ebeeefb068d9b68bf7d96f1f1f88518a Mon Sep 17 00:00:00 2001 From: Adib Taraben Date: Sat, 1 Aug 2009 23:31:02 +0000 Subject: FIX 309856 353847: correctly advertise exception leads to error message dialogue (bzr r8380) --- src/extension/implementation/script.cpp | 15 ++++++++++----- src/extension/implementation/script.h | 12 ++++++++---- src/extension/output.cpp | 2 +- src/extension/system.cpp | 14 +++++++++++++- 4 files changed, 32 insertions(+), 11 deletions(-) (limited to 'src/extension') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index eabf147f6..e6ce40bc0 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -63,7 +63,7 @@ namespace Extension { namespace Implementation { /** \brief Make GTK+ events continue to come through a little bit - + This just keeps coming the events through so that we'll make the GUI update and look pretty. */ @@ -604,6 +604,7 @@ Script::open(Inkscape::Extension::Input *module, \param module Extention to be used \param doc Document to be saved \param filename The name to save the final file as + \return false in case of any failure writing the file, otherwise true Well, at some point people need to save - it is really what makes the entire application useful. And, it is possible that someone @@ -634,7 +635,7 @@ Script::save(Inkscape::Extension::Output *module, tempfd_in = Inkscape::IO::file_open_tmp(tempfilename_in, "ink_ext_XXXXXX.svg"); } catch (...) { /// \todo Popup dialog here - return; + throw Inkscape::Extension::Output::save_failed(); } if (helper_extension.size() == 0) { @@ -652,13 +653,17 @@ Script::save(Inkscape::Extension::Output *module, execute(command, params, tempfilename_in, fileout); std::string lfilename = Glib::filename_from_utf8(filenameArg); - fileout.toFile(lfilename); + bool success = fileout.toFile(lfilename); // make sure we don't leak file descriptors from g_file_open_tmp close(tempfd_in); // FIXME: convert to utf8 (from "filename encoding") and unlink_utf8name unlink(tempfilename_in.c_str()); + if(success == false) { + throw Inkscape::Extension::Output::save_failed(); + } + return; } @@ -840,7 +845,7 @@ Script::copy_doc (Inkscape::XML::Node * oldroot, Inkscape::XML::Node * newroot) { using Inkscape::Util::List; - using Inkscape::XML::AttributeRecord; + using Inkscape::XML::AttributeRecord; std::vector attribs; // Make a list of all attributes of the old root node. @@ -1007,7 +1012,7 @@ Script::execute (const std::list &in_command, for (std::list::const_iterator i = in_params.begin(); i != in_params.end(); i++) { //g_message("Script parameter: %s",(*i)g.c_str()); - argv.push_back(*i); + argv.push_back(*i); } if (!(filein.empty())) { diff --git a/src/extension/implementation/script.h b/src/extension/implementation/script.h index 4620375f9..8e25fb351 100644 --- a/src/extension/implementation/script.h +++ b/src/extension/implementation/script.h @@ -135,7 +135,7 @@ private: /** * */ - void checkStderr (const Glib::ustring &filename, + void checkStderr (const Glib::ustring &filename, Gtk::MessageType type, const Glib::ustring &message); @@ -146,7 +146,7 @@ private: Glib::RefPtr _channel; Glib::RefPtr _main_loop; bool _dead; - + public: file_listener () : _dead(false) { }; virtual ~file_listener () { @@ -187,11 +187,15 @@ private: // Note, doing a copy here, on purpose Glib::ustring string (void) { return _string; }; - void toFile (const Glib::ustring &name) { + bool toFile (const Glib::ustring &name) { + try { Glib::RefPtr stdout_file = Glib::IOChannel::create_from_file(name, "w"); stdout_file->set_encoding(); stdout_file->write(_string); - return; + } catch (Glib::FileError &e) { + return false; + } + return true; }; }; diff --git a/src/extension/output.cpp b/src/extension/output.cpp index e1481d000..742e938de 100644 --- a/src/extension/output.cpp +++ b/src/extension/output.cpp @@ -218,7 +218,7 @@ Output::save(SPDocument *doc, gchar const *filename) imp->save(this, doc, filename); } catch (...) { - g_warning("There was an error saving the file."); + throw Inkscape::Extension::Output::save_failed(); } return; diff --git a/src/extension/system.cpp b/src/extension/system.cpp index a7828d3fc..33ee544a1 100644 --- a/src/extension/system.cpp +++ b/src/extension/system.cpp @@ -277,7 +277,19 @@ save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension, doc->setModifiedSinceSave(false); } - omod->save(doc, fileName); + try { + omod->save(doc, fileName); + } + catch(...) { + // free used ressources + if ( !official) { + g_free(saved_output_extension); + g_free(saved_dataloss); + } + g_free(fileName); + + throw Inkscape::Extension::Output::save_failed(); + } // If it is an unofficial save, set the modified attributes back to what they were. if ( !official) { -- cgit v1.2.3 From 98f6e4db3c307628c9d02cb432986741d59af058 Mon Sep 17 00:00:00 2001 From: theAdib Date: Sun, 2 Aug 2009 20:42:44 +0000 Subject: FIX 309856 353847 in case save_as fails the document uri is reverted (bzr r8387) --- src/extension/system.cpp | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'src/extension') diff --git a/src/extension/system.cpp b/src/extension/system.cpp index 33ee544a1..d7e0eebf3 100644 --- a/src/extension/system.cpp +++ b/src/extension/system.cpp @@ -247,15 +247,16 @@ save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension, Inkscape::XML::Node *repr = sp_document_repr_root(doc); - // remember attributes in case this is an unofficial save + + // remember attributes in case this is an unofficial save and/or overwrite fails + gchar *saved_uri = g_strdup(doc->uri); bool saved_modified = false; gchar *saved_output_extension = NULL; gchar *saved_dataloss = NULL; - if (!official) { - saved_modified = doc->isModifiedSinceSave(); - saved_output_extension = g_strdup(repr->attribute("inkscape:output_extension")); - saved_dataloss = g_strdup(repr->attribute("inkscape:dataloss")); - } else { + saved_modified = doc->isModifiedSinceSave(); + saved_output_extension = g_strdup(repr->attribute("inkscape:output_extension")); + saved_dataloss = g_strdup(repr->attribute("inkscape:dataloss")); + if (official) { /* The document is changing name/uri. */ sp_document_change_uri_and_hrefs(doc, fileName); } @@ -281,11 +282,23 @@ save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension, omod->save(doc, fileName); } catch(...) { - // free used ressources - if ( !official) { - g_free(saved_output_extension); - g_free(saved_dataloss); + // revert attributes in case of official and overwrite + if(check_overwrite && official) { + bool const saved = sp_document_get_undo_sensitive(doc); + sp_document_set_undo_sensitive(doc, false); + { + repr->setAttribute("inkscape:output_extension", saved_output_extension); + repr->setAttribute("inkscape:dataloss", saved_dataloss); + } + sp_document_set_undo_sensitive(doc, saved); + sp_document_change_uri_and_hrefs(doc, saved_uri); } + doc->setModifiedSinceSave(saved_modified); + // free used ressources + g_free(saved_output_extension); + g_free(saved_dataloss); + g_free(saved_uri); + g_free(fileName); throw Inkscape::Extension::Output::save_failed(); -- cgit v1.2.3 From a6fa3b454bdcef9b23e0a3107b6de6b4c6a477a0 Mon Sep 17 00:00:00 2001 From: johnce Date: Wed, 5 Aug 2009 05:56:35 +0000 Subject: SPDocument->Document (bzr r8405) --- src/extension/effect.cpp | 2 +- src/extension/execution-env.cpp | 2 +- src/extension/extension.cpp | 24 ++++++++++++------------ src/extension/input.cpp | 4 ++-- src/extension/output.cpp | 2 +- src/extension/patheffect.cpp | 4 ++-- src/extension/print.cpp | 2 +- src/extension/system.cpp | 6 +++--- 8 files changed, 23 insertions(+), 23 deletions(-) (limited to 'src/extension') diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp index afc0668a9..c6b731a84 100644 --- a/src/extension/effect.cpp +++ b/src/extension/effect.cpp @@ -358,7 +358,7 @@ void Effect::EffectVerb::perform( SPAction *action, void * data, void */*pdata*/ ) { Inkscape::UI::View::View * current_view = sp_action_get_view(action); -// SPDocument * current_document = current_view->doc; +// Document * current_document = current_view->doc; Effect::EffectVerb * ev = reinterpret_cast(data); Effect * effect = ev->_effect; diff --git a/src/extension/execution-env.cpp b/src/extension/execution-env.cpp index 4a13890d7..a87cc6b64 100644 --- a/src/extension/execution-env.cpp +++ b/src/extension/execution-env.cpp @@ -179,7 +179,7 @@ ExecutionEnv::commit (void) { void ExecutionEnv::reselect (void) { if (_doc == NULL) { return; } - SPDocument * doc = _doc->doc(); + Document * doc = _doc->doc(); if (doc == NULL) { return; } SPDesktop *desktop = (SPDesktop *)_doc; diff --git a/src/extension/extension.cpp b/src/extension/extension.cpp index 52d5f5148..c8dc30d8b 100644 --- a/src/extension/extension.cpp +++ b/src/extension/extension.cpp @@ -423,7 +423,7 @@ param_shared (const gchar * name, GSList * list) found parameter. */ const gchar * -Extension::get_param_string (const gchar * name, const SPDocument * doc, const Inkscape::XML::Node * node) +Extension::get_param_string (const gchar * name, const Document * doc, const Inkscape::XML::Node * node) { Parameter * param; @@ -432,7 +432,7 @@ Extension::get_param_string (const gchar * name, const SPDocument * doc, const I } const gchar * -Extension::get_param_enum (const gchar * name, const SPDocument * doc, const Inkscape::XML::Node * node) +Extension::get_param_enum (const gchar * name, const Document * doc, const Inkscape::XML::Node * node) { Parameter* param = param_shared(name, parameters); return param->get_enum(doc, node); @@ -450,7 +450,7 @@ Extension::get_param_enum (const gchar * name, const SPDocument * doc, const Ink found parameter. */ bool -Extension::get_param_bool (const gchar * name, const SPDocument * doc, const Inkscape::XML::Node * node) +Extension::get_param_bool (const gchar * name, const Document * doc, const Inkscape::XML::Node * node) { Parameter * param; @@ -470,7 +470,7 @@ Extension::get_param_bool (const gchar * name, const SPDocument * doc, const Ink found parameter. */ int -Extension::get_param_int (const gchar * name, const SPDocument * doc, const Inkscape::XML::Node * node) +Extension::get_param_int (const gchar * name, const Document * doc, const Inkscape::XML::Node * node) { Parameter * param; @@ -490,7 +490,7 @@ Extension::get_param_int (const gchar * name, const SPDocument * doc, const Inks found parameter. */ float -Extension::get_param_float (const gchar * name, const SPDocument * doc, const Inkscape::XML::Node * node) +Extension::get_param_float (const gchar * name, const Document * doc, const Inkscape::XML::Node * node) { Parameter * param; param = param_shared(name, parameters); @@ -509,7 +509,7 @@ Extension::get_param_float (const gchar * name, const SPDocument * doc, const In found parameter. */ guint32 -Extension::get_param_color (const gchar * name, const SPDocument * doc, const Inkscape::XML::Node * node) +Extension::get_param_color (const gchar * name, const Document * doc, const Inkscape::XML::Node * node) { Parameter* param = param_shared(name, parameters); return param->get_color(doc, node); @@ -528,7 +528,7 @@ Extension::get_param_color (const gchar * name, const SPDocument * doc, const In found parameter. */ bool -Extension::set_param_bool (const gchar * name, bool value, SPDocument * doc, Inkscape::XML::Node * node) +Extension::set_param_bool (const gchar * name, bool value, Document * doc, Inkscape::XML::Node * node) { Parameter * param; param = param_shared(name, parameters); @@ -548,7 +548,7 @@ Extension::set_param_bool (const gchar * name, bool value, SPDocument * doc, Ink found parameter. */ int -Extension::set_param_int (const gchar * name, int value, SPDocument * doc, Inkscape::XML::Node * node) +Extension::set_param_int (const gchar * name, int value, Document * doc, Inkscape::XML::Node * node) { Parameter * param; param = param_shared(name, parameters); @@ -568,7 +568,7 @@ Extension::set_param_int (const gchar * name, int value, SPDocument * doc, Inksc found parameter. */ float -Extension::set_param_float (const gchar * name, float value, SPDocument * doc, Inkscape::XML::Node * node) +Extension::set_param_float (const gchar * name, float value, Document * doc, Inkscape::XML::Node * node) { Parameter * param; param = param_shared(name, parameters); @@ -588,7 +588,7 @@ Extension::set_param_float (const gchar * name, float value, SPDocument * doc, I found parameter. */ const gchar * -Extension::set_param_string (const gchar * name, const gchar * value, SPDocument * doc, Inkscape::XML::Node * node) +Extension::set_param_string (const gchar * name, const gchar * value, Document * doc, Inkscape::XML::Node * node) { Parameter * param; param = param_shared(name, parameters); @@ -608,7 +608,7 @@ Extension::set_param_string (const gchar * name, const gchar * value, SPDocument found parameter. */ guint32 -Extension::set_param_color (const gchar * name, guint32 color, SPDocument * doc, Inkscape::XML::Node * node) +Extension::set_param_color (const gchar * name, guint32 color, Document * doc, Inkscape::XML::Node * node) { Parameter* param = param_shared(name, parameters); return param->set_color(color, doc, node); @@ -671,7 +671,7 @@ public: If all parameters are gui_visible = false NULL is returned as well. */ Gtk::Widget * -Extension::autogui (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +Extension::autogui (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (param_visible_count() == 0) return NULL; diff --git a/src/extension/input.cpp b/src/extension/input.cpp index 689c1286f..ca5fdc29f 100644 --- a/src/extension/input.cpp +++ b/src/extension/input.cpp @@ -145,7 +145,7 @@ Input::check (void) Adobe Illustrator file can be transparent (not recommended, but transparent). This is all done with undo being turned off. */ -SPDocument * +Document * Input::open (const gchar *uri) { if (!loaded()) { @@ -156,7 +156,7 @@ Input::open (const gchar *uri) } timer->touch(); - SPDocument *const doc = imp->open(this, uri); + Document *const doc = imp->open(this, uri); if (doc != NULL) { Inkscape::XML::Node * repr = sp_document_repr_root(doc); bool saved = sp_document_get_undo_sensitive(doc); diff --git a/src/extension/output.cpp b/src/extension/output.cpp index 742e938de..8e2fa5486 100644 --- a/src/extension/output.cpp +++ b/src/extension/output.cpp @@ -212,7 +212,7 @@ Output::prefs (void) could be changed, and old files will still work properly. */ void -Output::save(SPDocument *doc, gchar const *filename) +Output::save(Document *doc, gchar const *filename) { try { imp->save(this, doc, filename); diff --git a/src/extension/patheffect.cpp b/src/extension/patheffect.cpp index 8e3fc13f1..f6fa84f5b 100644 --- a/src/extension/patheffect.cpp +++ b/src/extension/patheffect.cpp @@ -28,14 +28,14 @@ PathEffect::~PathEffect (void) } void -PathEffect::processPath (SPDocument * /*doc*/, Inkscape::XML::Node * /*path*/, Inkscape::XML::Node * /*def*/) +PathEffect::processPath (Document * /*doc*/, Inkscape::XML::Node * /*path*/, Inkscape::XML::Node * /*def*/) { } void -PathEffect::processPathEffects (SPDocument * doc, Inkscape::XML::Node * path) +PathEffect::processPathEffects (Document * doc, Inkscape::XML::Node * path) { gchar const * patheffectlist = path->attribute("inkscape:path-effects"); if (patheffectlist == NULL) diff --git a/src/extension/print.cpp b/src/extension/print.cpp index 2d4177d60..f6f6bb1e5 100644 --- a/src/extension/print.cpp +++ b/src/extension/print.cpp @@ -49,7 +49,7 @@ Print::set_preview (void) } unsigned int -Print::begin (SPDocument *doc) +Print::begin (Document *doc) { return imp->begin(this, doc); } diff --git a/src/extension/system.cpp b/src/extension/system.cpp index d7e0eebf3..ad49c3d2a 100644 --- a/src/extension/system.cpp +++ b/src/extension/system.cpp @@ -59,7 +59,7 @@ static Extension *build_from_reprdoc(Inkscape::XML::Document *doc, Implementatio * * Lastly, the open function is called in the module itself. */ -SPDocument * +Document * open(Extension *key, gchar const *filename) { Input *imod = NULL; @@ -91,7 +91,7 @@ open(Extension *key, gchar const *filename) if (!imod->prefs(filename)) return NULL; - SPDocument *doc = imod->open(filename); + Document *doc = imod->open(filename); if (!doc) { throw Input::open_failed(); } @@ -184,7 +184,7 @@ open_internal(Extension *in_plug, gpointer in_data) * Lastly, the save function is called in the module itself. */ void -save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension, bool check_overwrite, bool official) +save(Extension *key, Document *doc, gchar const *filename, bool setextension, bool check_overwrite, bool official) { Output *omod; if (key == NULL) { -- cgit v1.2.3 From 56cbd9ce3b1f5116c22250d74ead66a0feb3ffa5 Mon Sep 17 00:00:00 2001 From: johnce Date: Wed, 5 Aug 2009 06:05:12 +0000 Subject: SPDocument->Document (bzr r8406) --- src/extension/effect.h | 2 +- src/extension/extension.h | 26 +++++++++++++------------- src/extension/input.h | 2 +- src/extension/output.h | 4 ++-- src/extension/patheffect.h | 4 ++-- src/extension/print.h | 2 +- src/extension/system.h | 4 ++-- 7 files changed, 22 insertions(+), 22 deletions(-) (limited to 'src/extension') diff --git a/src/extension/effect.h b/src/extension/effect.h index c02ce542b..637d29c5c 100644 --- a/src/extension/effect.h +++ b/src/extension/effect.h @@ -21,7 +21,7 @@ #include "prefdialog.h" #include "extension.h" -struct SPDocument; +struct Document; namespace Inkscape { namespace UI { diff --git a/src/extension/extension.h b/src/extension/extension.h index 48ca86cf7..8dcd1b393 100644 --- a/src/extension/extension.h +++ b/src/extension/extension.h @@ -72,7 +72,7 @@ #define INKSCAPE_EXTENSION_NS_NC "extension" #define INKSCAPE_EXTENSION_NS "extension:" -struct SPDocument; +struct Document; namespace Inkscape { namespace Extension { @@ -173,42 +173,42 @@ private: #endif public: bool get_param_bool (const gchar * name, - const SPDocument * doc = NULL, + const Document * doc = NULL, const Inkscape::XML::Node * node = NULL); int get_param_int (const gchar * name, - const SPDocument * doc = NULL, + const Document * doc = NULL, const Inkscape::XML::Node * node = NULL); float get_param_float (const gchar * name, - const SPDocument * doc = NULL, + const Document * doc = NULL, const Inkscape::XML::Node * node = NULL); const gchar * get_param_string (const gchar * name, - const SPDocument * doc = NULL, + const Document * doc = NULL, const Inkscape::XML::Node * node = NULL); guint32 get_param_color (const gchar * name, - const SPDocument * doc = NULL, + const Document * doc = NULL, const Inkscape::XML::Node * node = NULL); const gchar * get_param_enum (const gchar * name, - const SPDocument * doc = NULL, + const Document * doc = NULL, const Inkscape::XML::Node * node = NULL); bool set_param_bool (const gchar * name, bool value, - SPDocument * doc = NULL, + Document * doc = NULL, Inkscape::XML::Node * node = NULL); int set_param_int (const gchar * name, int value, - SPDocument * doc = NULL, + Document * doc = NULL, Inkscape::XML::Node * node = NULL); float set_param_float (const gchar * name, float value, - SPDocument * doc = NULL, + Document * doc = NULL, Inkscape::XML::Node * node = NULL); const gchar * set_param_string (const gchar * name, const gchar * value, - SPDocument * doc = NULL, + Document * doc = NULL, Inkscape::XML::Node * node = NULL); guint32 set_param_color (const gchar * name, guint32 color, - SPDocument * doc = NULL, + Document * doc = NULL, Inkscape::XML::Node * node = NULL); /* Error file handling */ @@ -217,7 +217,7 @@ public: static void error_file_close (void); public: - Gtk::Widget * autogui (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal = NULL); + Gtk::Widget * autogui (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal = NULL); void paramListString (std::list & retlist); /* Extension editor dialog stuff */ diff --git a/src/extension/input.h b/src/extension/input.h index 55d807ce2..d2aac9376 100644 --- a/src/extension/input.h +++ b/src/extension/input.h @@ -37,7 +37,7 @@ public: Implementation::Implementation * in_imp); virtual ~Input (void); virtual bool check (void); - SPDocument * open (gchar const *uri); + Document * open (gchar const *uri); gchar * get_mimetype (void); gchar * get_extension (void); gchar * get_filetypename (void); diff --git a/src/extension/output.h b/src/extension/output.h index b52a96211..455b4a8ae 100644 --- a/src/extension/output.h +++ b/src/extension/output.h @@ -15,7 +15,7 @@ #include #include "extension.h" -struct SPDocument; +struct Document; namespace Inkscape { namespace Extension { @@ -36,7 +36,7 @@ public: Implementation::Implementation * in_imp); virtual ~Output (void); virtual bool check (void); - void save (SPDocument *doc, + void save (Document *doc, gchar const *uri); bool prefs (void); gchar * get_mimetype(void); diff --git a/src/extension/patheffect.h b/src/extension/patheffect.h index 0c00ae093..7ad875048 100644 --- a/src/extension/patheffect.h +++ b/src/extension/patheffect.h @@ -22,10 +22,10 @@ public: PathEffect (Inkscape::XML::Node * in_repr, Implementation::Implementation * in_imp); virtual ~PathEffect (void); - void processPath (SPDocument * doc, + void processPath (Document * doc, Inkscape::XML::Node * path, Inkscape::XML::Node * def); - static void processPathEffects (SPDocument * doc, + static void processPathEffects (Document * doc, Inkscape::XML::Node * path); }; /* PathEffect */ diff --git a/src/extension/print.h b/src/extension/print.h index 8ae71b8e6..3240942d7 100644 --- a/src/extension/print.h +++ b/src/extension/print.h @@ -36,7 +36,7 @@ public: unsigned int setup (void); unsigned int set_preview (void); - unsigned int begin (SPDocument *doc); + unsigned int begin (Document *doc); unsigned int finish (void); /* Rendering methods */ diff --git a/src/extension/system.h b/src/extension/system.h index 6c23b2f0d..ada5f799c 100644 --- a/src/extension/system.h +++ b/src/extension/system.h @@ -21,8 +21,8 @@ namespace Inkscape { namespace Extension { -SPDocument *open(Extension *key, gchar const *filename); -void save(Extension *key, SPDocument *doc, gchar const *filename, +Document *open(Extension *key, gchar const *filename); +void save(Extension *key, Document *doc, gchar const *filename, bool setextension, bool check_overwrite, bool official); Print *get_print(gchar const *key); Extension *build_from_file(gchar const *filename); -- cgit v1.2.3 From feea521541c5d36d23a5fefa579eb9c8323ac30e Mon Sep 17 00:00:00 2001 From: johnce Date: Wed, 5 Aug 2009 06:21:55 +0000 Subject: SPDocument->Document (bzr r8407) --- src/extension/implementation/implementation.h | 6 +++--- src/extension/implementation/script.h | 4 ++-- src/extension/implementation/xslt.h | 4 ++-- src/extension/internal/cairo-png-out.h | 2 +- src/extension/internal/cairo-ps-out.h | 4 ++-- src/extension/internal/cairo-renderer-pdf-out.h | 2 +- src/extension/internal/cairo-renderer.h | 4 ++-- src/extension/internal/emf-win32-inout.h | 4 ++-- src/extension/internal/emf-win32-print.h | 2 +- src/extension/internal/gdkpixbuf-input.h | 2 +- src/extension/internal/gimpgrad.h | 2 +- src/extension/internal/javafx-out.h | 10 +++++----- src/extension/internal/latex-pstricks-out.h | 2 +- src/extension/internal/latex-pstricks.h | 2 +- src/extension/internal/odf.h | 2 +- src/extension/internal/pdf-input-cairo.h | 2 +- src/extension/internal/pov-out.h | 8 ++++---- src/extension/internal/svg.h | 4 ++-- src/extension/internal/win32.h | 2 +- src/extension/internal/wpg-input.h | 2 +- src/extension/param/bool.h | 6 +++--- src/extension/param/color.h | 6 +++--- src/extension/param/description.h | 2 +- src/extension/param/enum.h | 6 +++--- src/extension/param/float.h | 6 +++--- src/extension/param/int.h | 6 +++--- src/extension/param/notebook.h | 6 +++--- src/extension/param/parameter.h | 26 ++++++++++++------------- src/extension/param/radiobutton.h | 6 +++--- src/extension/param/string.h | 6 +++--- 30 files changed, 73 insertions(+), 73 deletions(-) (limited to 'src/extension') diff --git a/src/extension/implementation/implementation.h b/src/extension/implementation/implementation.h index 9de70dce7..9f1894d95 100644 --- a/src/extension/implementation/implementation.h +++ b/src/extension/implementation/implementation.h @@ -70,13 +70,13 @@ public: virtual Gtk::Widget *prefs_input(Inkscape::Extension::Input *module, gchar const *filename); - virtual SPDocument *open(Inkscape::Extension::Input *module, + virtual Document *open(Inkscape::Extension::Input *module, gchar const *filename); /* ----- Output functions ----- */ /** Find out information about the file. */ virtual Gtk::Widget *prefs_output(Inkscape::Extension::Output *module); - virtual void save(Inkscape::Extension::Output *module, SPDocument *doc, gchar const *filename); + virtual void save(Inkscape::Extension::Output *module, Document *doc, gchar const *filename); /* ----- Effect functions ----- */ /** Find out information about the file. */ @@ -93,7 +93,7 @@ public: virtual unsigned set_preview(Inkscape::Extension::Print *module); virtual unsigned begin(Inkscape::Extension::Print *module, - SPDocument *doc); + Document *doc); virtual unsigned finish(Inkscape::Extension::Print *module); virtual bool textToPath(Inkscape::Extension::Print *ext); virtual bool fontEmbedded(Inkscape::Extension::Print * ext); diff --git a/src/extension/implementation/script.h b/src/extension/implementation/script.h index 8e25fb351..0769c9a18 100644 --- a/src/extension/implementation/script.h +++ b/src/extension/implementation/script.h @@ -73,7 +73,7 @@ public: /** * */ - virtual SPDocument *open(Inkscape::Extension::Input *module, + virtual Document *open(Inkscape::Extension::Input *module, gchar const *filename); /** @@ -85,7 +85,7 @@ public: * */ virtual void save(Inkscape::Extension::Output *module, - SPDocument *doc, + Document *doc, gchar const *filename); /** diff --git a/src/extension/implementation/xslt.h b/src/extension/implementation/xslt.h index 45befb529..df9467d9e 100644 --- a/src/extension/implementation/xslt.h +++ b/src/extension/implementation/xslt.h @@ -44,9 +44,9 @@ public: bool check(Inkscape::Extension::Extension *module); - SPDocument *open(Inkscape::Extension::Input *module, + Document *open(Inkscape::Extension::Input *module, gchar const *filename); - void save(Inkscape::Extension::Output *module, SPDocument *doc, gchar const *filename); + void save(Inkscape::Extension::Output *module, Document *doc, gchar const *filename); }; } /* Inkscape */ diff --git a/src/extension/internal/cairo-png-out.h b/src/extension/internal/cairo-png-out.h index 9b9bd6ffe..a062ec8df 100644 --- a/src/extension/internal/cairo-png-out.h +++ b/src/extension/internal/cairo-png-out.h @@ -27,7 +27,7 @@ class CairoRendererOutput : Inkscape::Extension::Implementation::Implementation public: bool check(Inkscape::Extension::Extension *module); void save(Inkscape::Extension::Output *mod, - SPDocument *doc, + Document *doc, gchar const *filename); static void init(); }; diff --git a/src/extension/internal/cairo-ps-out.h b/src/extension/internal/cairo-ps-out.h index 019b6b810..862571f0b 100644 --- a/src/extension/internal/cairo-ps-out.h +++ b/src/extension/internal/cairo-ps-out.h @@ -28,7 +28,7 @@ class CairoPsOutput : Inkscape::Extension::Implementation::Implementation { public: bool check(Inkscape::Extension::Extension *module); void save(Inkscape::Extension::Output *mod, - SPDocument *doc, + Document *doc, gchar const *filename); static void init(); bool textToPath(Inkscape::Extension::Print *ext); @@ -40,7 +40,7 @@ class CairoEpsOutput : Inkscape::Extension::Implementation::Implementation { public: bool check(Inkscape::Extension::Extension *module); void save(Inkscape::Extension::Output *mod, - SPDocument *doc, + Document *doc, gchar const *uri); static void init(); bool textToPath(Inkscape::Extension::Print *ext); diff --git a/src/extension/internal/cairo-renderer-pdf-out.h b/src/extension/internal/cairo-renderer-pdf-out.h index d76ffb4d4..f916eed49 100644 --- a/src/extension/internal/cairo-renderer-pdf-out.h +++ b/src/extension/internal/cairo-renderer-pdf-out.h @@ -27,7 +27,7 @@ class CairoRendererPdfOutput : Inkscape::Extension::Implementation::Implementati public: bool check(Inkscape::Extension::Extension *module); void save(Inkscape::Extension::Output *mod, - SPDocument *doc, + Document *doc, gchar const *filename); static void init(); }; diff --git a/src/extension/internal/cairo-renderer.h b/src/extension/internal/cairo-renderer.h index ab5d4cf58..4197c6784 100644 --- a/src/extension/internal/cairo-renderer.h +++ b/src/extension/internal/cairo-renderer.h @@ -50,9 +50,9 @@ public: void applyMask(CairoRenderContext *ctx, SPMask const *mask); /** Initializes the CairoRenderContext according to the specified - SPDocument. A set*Target function can only be called on the context + Document. A set*Target function can only be called on the context before setupDocument. */ - bool setupDocument(CairoRenderContext *ctx, SPDocument *doc, bool pageBoundingBox, SPItem *base); + bool setupDocument(CairoRenderContext *ctx, Document *doc, bool pageBoundingBox, SPItem *base); /** Traverses the object tree and invokes the render methods. */ void renderItem(CairoRenderContext *ctx, SPItem *item); diff --git a/src/extension/internal/emf-win32-inout.h b/src/extension/internal/emf-win32-inout.h index c62d7a4e9..544cd75db 100644 --- a/src/extension/internal/emf-win32-inout.h +++ b/src/extension/internal/emf-win32-inout.h @@ -28,10 +28,10 @@ public: bool check(Inkscape::Extension::Extension *module); //Can this module load (always yes for now) void save(Inkscape::Extension::Output *mod, // Save the given document to the given filename - SPDocument *doc, + Document *doc, gchar const *filename); - virtual SPDocument *open( Inkscape::Extension::Input *mod, + virtual Document *open( Inkscape::Extension::Input *mod, const gchar *uri ); static void init(void);//Initialize the class diff --git a/src/extension/internal/emf-win32-print.h b/src/extension/internal/emf-win32-print.h index 5c1d8439d..bec3f9582 100644 --- a/src/extension/internal/emf-win32-print.h +++ b/src/extension/internal/emf-win32-print.h @@ -55,7 +55,7 @@ public: /* Print functions */ virtual unsigned int setup (Inkscape::Extension::Print * module); - virtual unsigned int begin (Inkscape::Extension::Print * module, SPDocument *doc); + virtual unsigned int begin (Inkscape::Extension::Print * module, Document *doc); virtual unsigned int finish (Inkscape::Extension::Print * module); /* Rendering methods */ diff --git a/src/extension/internal/gdkpixbuf-input.h b/src/extension/internal/gdkpixbuf-input.h index 9d5e6ccf7..373d53da3 100644 --- a/src/extension/internal/gdkpixbuf-input.h +++ b/src/extension/internal/gdkpixbuf-input.h @@ -9,7 +9,7 @@ namespace Internal { class GdkpixbufInput : Inkscape::Extension::Implementation::Implementation { public: - SPDocument *open(Inkscape::Extension::Input *mod, + Document *open(Inkscape::Extension::Input *mod, gchar const *uri); static void init(); }; diff --git a/src/extension/internal/gimpgrad.h b/src/extension/internal/gimpgrad.h index 45b76dd6d..21ccfa215 100644 --- a/src/extension/internal/gimpgrad.h +++ b/src/extension/internal/gimpgrad.h @@ -26,7 +26,7 @@ class GimpGrad : public Inkscape::Extension::Implementation::Implementation { public: bool load(Inkscape::Extension::Extension *module); void unload(Inkscape::Extension::Extension *module); - SPDocument *open(Inkscape::Extension::Input *module, gchar const *filename); + Document *open(Inkscape::Extension::Input *module, gchar const *filename); static void init(); }; diff --git a/src/extension/internal/javafx-out.h b/src/extension/internal/javafx-out.h index 9c1c8778b..246172c23 100644 --- a/src/extension/internal/javafx-out.h +++ b/src/extension/internal/javafx-out.h @@ -56,7 +56,7 @@ public: * API call to perform the output to a file */ virtual void save(Inkscape::Extension::Output *mod, - SPDocument *doc, gchar const *filename); + Document *doc, gchar const *filename); /** * Inkscape runtime startup call. @@ -109,10 +109,10 @@ private: * Output the SVG document's curve data as JavaFX geometry types */ bool doCurve(SPItem *item, const String &id); - bool doTreeRecursive(SPDocument *doc, SPObject *obj); - bool doTree(SPDocument *doc); + bool doTreeRecursive(Document *doc, SPObject *obj); + bool doTree(Document *doc); - bool doBody(SPDocument *doc, SPObject *obj); + bool doBody(Document *doc, SPObject *obj); /** * Output the file footer @@ -124,7 +124,7 @@ private: /** * Actual method to save document */ - bool saveDocument(SPDocument *doc, gchar const *filename); + bool saveDocument(Document *doc, gchar const *filename); //For statistics int nrNodes; diff --git a/src/extension/internal/latex-pstricks-out.h b/src/extension/internal/latex-pstricks-out.h index a12cdc3c1..a9910f4cc 100644 --- a/src/extension/internal/latex-pstricks-out.h +++ b/src/extension/internal/latex-pstricks-out.h @@ -27,7 +27,7 @@ public: bool check(Inkscape::Extension::Extension *module); //Can this module load (always yes for now) void save(Inkscape::Extension::Output *mod, // Save the given document to the given filename - SPDocument *doc, + Document *doc, gchar const *filename); static void init(void);//Initialize the class diff --git a/src/extension/internal/latex-pstricks.h b/src/extension/internal/latex-pstricks.h index a33e169e8..4e310d6fd 100644 --- a/src/extension/internal/latex-pstricks.h +++ b/src/extension/internal/latex-pstricks.h @@ -43,7 +43,7 @@ public: /* Print functions */ virtual unsigned int setup (Inkscape::Extension::Print * module); - virtual unsigned int begin (Inkscape::Extension::Print * module, SPDocument *doc); + virtual unsigned int begin (Inkscape::Extension::Print * module, Document *doc); virtual unsigned int finish (Inkscape::Extension::Print * module); /* Rendering methods */ diff --git a/src/extension/internal/odf.h b/src/extension/internal/odf.h index 3854ddfe1..5ad1f1137 100644 --- a/src/extension/internal/odf.h +++ b/src/extension/internal/odf.h @@ -272,7 +272,7 @@ public: bool check (Inkscape::Extension::Extension * module); void save (Inkscape::Extension::Output *mod, - SPDocument *doc, + Document *doc, gchar const *filename); static void init (void); diff --git a/src/extension/internal/pdf-input-cairo.h b/src/extension/internal/pdf-input-cairo.h index 5715b57c9..15080bc14 100644 --- a/src/extension/internal/pdf-input-cairo.h +++ b/src/extension/internal/pdf-input-cairo.h @@ -27,7 +27,7 @@ namespace Internal { class PdfInputCairo: public Inkscape::Extension::Implementation::Implementation { PdfInputCairo () { }; public: - SPDocument *open( Inkscape::Extension::Input *mod, + Document *open( Inkscape::Extension::Input *mod, const gchar *uri ); static void init( void ); diff --git a/src/extension/internal/pov-out.h b/src/extension/internal/pov-out.h index 0c3b73a7f..02ba6da82 100644 --- a/src/extension/internal/pov-out.h +++ b/src/extension/internal/pov-out.h @@ -57,7 +57,7 @@ public: * API call to perform the output to a file */ void save(Inkscape::Extension::Output *mod, - SPDocument *doc, gchar const *filename); + Document *doc, gchar const *filename); /** * Inkscape runtime startup call. @@ -120,13 +120,13 @@ private: * Output the SVG document's curve data as POV curves */ bool doCurve(SPItem *item, const String &id); - bool doTreeRecursive(SPDocument *doc, SPObject *obj); - bool doTree(SPDocument *doc); + bool doTreeRecursive(Document *doc, SPObject *obj); + bool doTree(Document *doc); /** * Actual method to save document */ - void saveDocument(SPDocument *doc, gchar const *filename); + void saveDocument(Document *doc, gchar const *filename); /** diff --git a/src/extension/internal/svg.h b/src/extension/internal/svg.h index b97735dd8..48b57c8c5 100644 --- a/src/extension/internal/svg.h +++ b/src/extension/internal/svg.h @@ -25,9 +25,9 @@ class Svg : public Inkscape::Extension::Implementation::Implementation { public: virtual void save( Inkscape::Extension::Output *mod, - SPDocument *doc, + Document *doc, gchar const *filename ); - virtual SPDocument *open( Inkscape::Extension::Input *mod, + virtual Document *open( Inkscape::Extension::Input *mod, const gchar *uri ); static void init( void ); diff --git a/src/extension/internal/win32.h b/src/extension/internal/win32.h index 9462115c6..7f4b9352d 100644 --- a/src/extension/internal/win32.h +++ b/src/extension/internal/win32.h @@ -65,7 +65,7 @@ public: virtual unsigned int setup (Inkscape::Extension::Print * module); //virtual unsigned int set_preview (Inkscape::Extension::Print * module); - virtual unsigned int begin (Inkscape::Extension::Print * module, SPDocument *doc); + virtual unsigned int begin (Inkscape::Extension::Print * module, Document *doc); virtual unsigned int finish (Inkscape::Extension::Print * module); /* Rendering methods */ diff --git a/src/extension/internal/wpg-input.h b/src/extension/internal/wpg-input.h index ca882039b..e5c2838d5 100644 --- a/src/extension/internal/wpg-input.h +++ b/src/extension/internal/wpg-input.h @@ -24,7 +24,7 @@ namespace Internal { class WpgInput : public Inkscape::Extension::Implementation::Implementation { WpgInput () { }; public: - SPDocument *open( Inkscape::Extension::Input *mod, + Document *open( Inkscape::Extension::Input *mod, const gchar *uri ); static void init( void ); diff --git a/src/extension/param/bool.h b/src/extension/param/bool.h index a1cd4ce4a..23b15596d 100644 --- a/src/extension/param/bool.h +++ b/src/extension/param/bool.h @@ -22,9 +22,9 @@ private: bool _value; public: ParamBool(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); - bool get (const SPDocument * doc, const Inkscape::XML::Node * node); - bool set (bool in, SPDocument * doc, Inkscape::XML::Node * node); - Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + bool get (const Document * doc, const Inkscape::XML::Node * node); + bool set (bool in, Document * doc, Inkscape::XML::Node * node); + Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::string &string); }; diff --git a/src/extension/param/color.h b/src/extension/param/color.h index e6b44fbcb..89aac7be7 100644 --- a/src/extension/param/color.h +++ b/src/extension/param/color.h @@ -23,9 +23,9 @@ public: ParamColor(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); virtual ~ParamColor(void); /** \brief Returns \c _value, with a \i const to protect it. */ - guint32 get( const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/ ) { return _value; } - guint32 set (guint32 in, SPDocument * doc, Inkscape::XML::Node * node); - Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + guint32 get( const Document * /*doc*/, const Inkscape::XML::Node * /*node*/ ) { return _value; } + guint32 set (guint32 in, Document * doc, Inkscape::XML::Node * node); + Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::string &string); sigc::signal * _changeSignal; }; /* class ParamColor */ diff --git a/src/extension/param/description.h b/src/extension/param/description.h index c305ea6df..42441e5a9 100644 --- a/src/extension/param/description.h +++ b/src/extension/param/description.h @@ -23,7 +23,7 @@ private: gchar * _value; public: ParamDescription(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); - Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); }; } /* namespace Extension */ diff --git a/src/extension/param/enum.h b/src/extension/param/enum.h index 3f9707c34..e1af8fd2b 100644 --- a/src/extension/param/enum.h +++ b/src/extension/param/enum.h @@ -39,11 +39,11 @@ private: public: ParamComboBox(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); virtual ~ParamComboBox(void); - Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::string &string); - const gchar * get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } - const gchar * set (const gchar * in, SPDocument * doc, Inkscape::XML::Node * node); + const gchar * get (const Document * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } + const gchar * set (const gchar * in, Document * doc, Inkscape::XML::Node * node); void changed (void); }; /* class ParamComboBox */ diff --git a/src/extension/param/float.h b/src/extension/param/float.h index f105d8f0e..32ab7a796 100644 --- a/src/extension/param/float.h +++ b/src/extension/param/float.h @@ -26,12 +26,12 @@ private: public: ParamFloat (const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); /** \brief Returns \c _value */ - float get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } - float set (float in, SPDocument * doc, Inkscape::XML::Node * node); + float get (const Document * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } + float set (float in, Document * doc, Inkscape::XML::Node * node); float max (void) { return _max; } float min (void) { return _min; } float precision (void) { return _precision; } - Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::string &string); }; diff --git a/src/extension/param/int.h b/src/extension/param/int.h index a4eb54c81..6d44a10b3 100644 --- a/src/extension/param/int.h +++ b/src/extension/param/int.h @@ -25,11 +25,11 @@ private: public: ParamInt (const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); /** \brief Returns \c _value */ - int get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } - int set (int in, SPDocument * doc, Inkscape::XML::Node * node); + int get (const Document * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } + int set (int in, Document * doc, Inkscape::XML::Node * node); int max (void) { return _max; } int min (void) { return _min; } - Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::string &string); }; diff --git a/src/extension/param/notebook.h b/src/extension/param/notebook.h index 24d4ebfc1..6efd3c5f1 100644 --- a/src/extension/param/notebook.h +++ b/src/extension/param/notebook.h @@ -40,11 +40,11 @@ private: public: ParamNotebook(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); virtual ~ParamNotebook(void); - Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::list &list); - const gchar * get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } - const gchar * set (const int in, SPDocument * doc, Inkscape::XML::Node * node); + const gchar * get (const Document * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } + const gchar * set (const int in, Document * doc, Inkscape::XML::Node * node); }; /* class ParamNotebook */ diff --git a/src/extension/param/parameter.h b/src/extension/param/parameter.h index 54249c12e..a79b2fd6b 100644 --- a/src/extension/param/parameter.h +++ b/src/extension/param/parameter.h @@ -68,7 +68,7 @@ protected: /* **** funcs **** */ gchar * pref_name (void); Inkscape::XML::Node * find_child (Inkscape::XML::Node * adult); - Inkscape::XML::Node * document_param_node (SPDocument * doc); + Inkscape::XML::Node * document_param_node (Document * doc); Inkscape::XML::Node * new_child (Inkscape::XML::Node * parent); public: @@ -85,29 +85,29 @@ public: Parameter(name, guitext, NULL, Parameter::SCOPE_USER, false, NULL, ext); }; virtual ~Parameter (void); - bool get_bool (const SPDocument * doc, + bool get_bool (const Document * doc, const Inkscape::XML::Node * node); - int get_int (const SPDocument * doc, + int get_int (const Document * doc, const Inkscape::XML::Node * node); - float get_float (const SPDocument * doc, + float get_float (const Document * doc, const Inkscape::XML::Node * node); - const gchar * get_string (const SPDocument * doc, + const gchar * get_string (const Document * doc, const Inkscape::XML::Node * node); - guint32 get_color (const SPDocument * doc, + guint32 get_color (const Document * doc, const Inkscape::XML::Node * node); - const gchar * get_enum (const SPDocument * doc, + const gchar * get_enum (const Document * doc, const Inkscape::XML::Node * node); - bool set_bool (bool in, SPDocument * doc, Inkscape::XML::Node * node); - int set_int (int in, SPDocument * doc, Inkscape::XML::Node * node); - float set_float (float in, SPDocument * doc, Inkscape::XML::Node * node); - const gchar * set_string (const gchar * in, SPDocument * doc, Inkscape::XML::Node * node); - guint32 set_color (guint32 in, SPDocument * doc, Inkscape::XML::Node * node); + bool set_bool (bool in, Document * doc, Inkscape::XML::Node * node); + int set_int (int in, Document * doc, Inkscape::XML::Node * node); + float set_float (float in, Document * doc, Inkscape::XML::Node * node); + const gchar * set_string (const gchar * in, Document * doc, Inkscape::XML::Node * node); + guint32 set_color (guint32 in, Document * doc, Inkscape::XML::Node * node); const gchar * name (void) {return _name;} static Parameter * make (Inkscape::XML::Node * in_repr, Inkscape::Extension::Extension * in_ext); - virtual Gtk::Widget * get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + virtual Gtk::Widget * get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); gchar const * get_tooltip (void) { return _desc; } diff --git a/src/extension/param/radiobutton.h b/src/extension/param/radiobutton.h index ea8440de2..ec35c2c53 100644 --- a/src/extension/param/radiobutton.h +++ b/src/extension/param/radiobutton.h @@ -43,11 +43,11 @@ public: Inkscape::XML::Node * xml, AppearanceMode mode); virtual ~ParamRadioButton(void); - Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::string &string); - const gchar * get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } - const gchar * set (const gchar * in, SPDocument * doc, Inkscape::XML::Node * node); + const gchar * get (const Document * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } + const gchar * set (const gchar * in, Document * doc, Inkscape::XML::Node * node); private: /** \brief Internal value. This should point to a string that has diff --git a/src/extension/param/string.h b/src/extension/param/string.h index 10f45e5ac..0eb116a53 100644 --- a/src/extension/param/string.h +++ b/src/extension/param/string.h @@ -28,9 +28,9 @@ public: ParamString(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); virtual ~ParamString(void); /** \brief Returns \c _value, with a \i const to protect it. */ - const gchar * get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } - const gchar * set (const gchar * in, SPDocument * doc, Inkscape::XML::Node * node); - Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + const gchar * get (const Document * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } + const gchar * set (const gchar * in, Document * doc, Inkscape::XML::Node * node); + Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::string &string); void setMaxLength(int maxLenght) { _max_length = maxLenght; } int getMaxLength(void) { return _max_length; } -- cgit v1.2.3 From 4cd79453c07adefb912a4dbd0afb2e7c2722bd90 Mon Sep 17 00:00:00 2001 From: johnce Date: Wed, 5 Aug 2009 06:38:07 +0000 Subject: SPDocument->Document (bzr r8408) --- src/extension/implementation/implementation.cpp | 8 +++---- src/extension/implementation/script.cpp | 8 +++---- src/extension/implementation/xslt.cpp | 6 +++--- src/extension/internal/bitmap/imagemagick.cpp | 2 +- src/extension/internal/cairo-png-out.cpp | 4 ++-- src/extension/internal/cairo-ps-out.cpp | 6 +++--- src/extension/internal/cairo-render-context.cpp | 2 +- src/extension/internal/cairo-renderer-pdf-out.cpp | 4 ++-- src/extension/internal/cairo-renderer.cpp | 4 ++-- src/extension/internal/emf-win32-inout.cpp | 8 +++---- src/extension/internal/emf-win32-print.cpp | 2 +- src/extension/internal/gdkpixbuf-input.cpp | 4 ++-- src/extension/internal/gimpgrad.cpp | 4 ++-- src/extension/internal/grid.cpp | 4 ++-- src/extension/internal/javafx-out.cpp | 10 ++++----- src/extension/internal/latex-pstricks-out.cpp | 2 +- src/extension/internal/latex-pstricks.cpp | 2 +- src/extension/internal/odf.cpp | 2 +- src/extension/internal/pdf-input-cairo.cpp | 4 ++-- src/extension/internal/pdfinput/pdf-input.cpp | 4 ++-- src/extension/internal/pdfinput/svg-builder.cpp | 2 +- src/extension/internal/pov-out.cpp | 8 +++---- src/extension/internal/svg.cpp | 8 +++---- src/extension/internal/win32.cpp | 2 +- src/extension/internal/wpg-input.cpp | 4 ++-- src/extension/param/bool.cpp | 10 ++++----- src/extension/param/color.cpp | 4 ++-- src/extension/param/description.cpp | 2 +- src/extension/param/enum.cpp | 8 +++---- src/extension/param/float.cpp | 8 +++---- src/extension/param/int.cpp | 8 +++---- src/extension/param/notebook.cpp | 12 +++++------ src/extension/param/parameter.cpp | 26 +++++++++++------------ src/extension/param/radiobutton.cpp | 14 ++++++------ src/extension/param/string.cpp | 8 +++---- 35 files changed, 107 insertions(+), 107 deletions(-) (limited to 'src/extension') diff --git a/src/extension/implementation/implementation.cpp b/src/extension/implementation/implementation.cpp index 6090b72d0..e3421b26d 100644 --- a/src/extension/implementation/implementation.cpp +++ b/src/extension/implementation/implementation.cpp @@ -79,7 +79,7 @@ Implementation::prefs_input(Inkscape::Extension::Input *module, gchar const */*f return module->autogui(NULL, NULL); } /* Implementation::prefs_input */ -SPDocument * +Document * Implementation::open(Inkscape::Extension::Input */*module*/, gchar const */*filename*/) { /* throw open_failed(); */ return NULL; @@ -91,7 +91,7 @@ Implementation::prefs_output(Inkscape::Extension::Output *module) { } /* Implementation::prefs_output */ void -Implementation::save(Inkscape::Extension::Output */*module*/, SPDocument */*doc*/, gchar const */*filename*/) { +Implementation::save(Inkscape::Extension::Output */*module*/, Document */*doc*/, gchar const */*filename*/) { /* throw save_fail */ return; } /* Implementation::save */ @@ -100,7 +100,7 @@ Gtk::Widget * Implementation::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View * view, sigc::signal * changeSignal, ImplementationDocumentCache * docCache) { if (module->param_visible_count() == 0) return NULL; - SPDocument * current_document = view->doc(); + Document * current_document = view->doc(); using Inkscape::Util::GSListConstIterator; GSListConstIterator selected = @@ -134,7 +134,7 @@ Implementation::set_preview(Inkscape::Extension::Print */*module*/) unsigned int -Implementation::begin(Inkscape::Extension::Print */*module*/, SPDocument */*doc*/) +Implementation::begin(Inkscape::Extension::Print */*module*/, Document */*doc*/) { return 0; } diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index e6ce40bc0..d207c1a19 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -545,7 +545,7 @@ Script::prefs_output(Inkscape::Extension::Output *module) the incoming filename (so that it's not the temporary filename). That document is then returned from this function. */ -SPDocument * +Document * Script::open(Inkscape::Extension::Input *module, const gchar *filenameArg) { @@ -567,7 +567,7 @@ Script::open(Inkscape::Extension::Input *module, int data_read = execute(command, params, lfilename, fileout); fileout.toFile(tempfilename_out); - SPDocument * mydoc = NULL; + Document * mydoc = NULL; if (data_read > 10) { if (helper_extension.size()==0) { mydoc = Inkscape::Extension::open( @@ -623,7 +623,7 @@ Script::open(Inkscape::Extension::Input *module, */ void Script::save(Inkscape::Extension::Output *module, - SPDocument *doc, + Document *doc, const gchar *filenameArg) { std::list params; @@ -757,7 +757,7 @@ Script::effect(Inkscape::Extension::Effect *module, pump_events(); - SPDocument * mydoc = NULL; + Document * mydoc = NULL; if (data_read > 10) { mydoc = Inkscape::Extension::open( Inkscape::Extension::db.get(SP_MODULE_KEY_INPUT_SVG), diff --git a/src/extension/implementation/xslt.cpp b/src/extension/implementation/xslt.cpp index f34fea64a..9eea2dbeb 100644 --- a/src/extension/implementation/xslt.cpp +++ b/src/extension/implementation/xslt.cpp @@ -136,7 +136,7 @@ XSLT::unload(Inkscape::Extension::Extension *module) return; } -SPDocument * +Document * XSLT::open(Inkscape::Extension::Input */*module*/, gchar const *filename) { xmlDocPtr filein = xmlParseFile(filename); @@ -174,7 +174,7 @@ XSLT::open(Inkscape::Extension::Input */*module*/, gchar const *filename) } g_free(s); - SPDocument * doc = sp_document_create(rdoc, filename, base, name, true); + Document * doc = sp_document_create(rdoc, filename, base, name, true); g_free(base); g_free(name); @@ -182,7 +182,7 @@ XSLT::open(Inkscape::Extension::Input */*module*/, gchar const *filename) } void -XSLT::save(Inkscape::Extension::Output */*module*/, SPDocument *doc, gchar const *filename) +XSLT::save(Inkscape::Extension::Output */*module*/, Document *doc, gchar const *filename) { /* TODO: Should we assume filename to be in utf8 or to be a raw filename? * See JavaFXOutput::save for discussion. */ diff --git a/src/extension/internal/bitmap/imagemagick.cpp b/src/extension/internal/bitmap/imagemagick.cpp index e907612fd..75d53927d 100644 --- a/src/extension/internal/bitmap/imagemagick.cpp +++ b/src/extension/internal/bitmap/imagemagick.cpp @@ -221,7 +221,7 @@ ImageMagick::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::Vi Gtk::Widget * ImageMagick::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View * view, sigc::signal * changeSignal, Inkscape::Extension::Implementation::ImplementationDocumentCache * /*docCache*/) { - SPDocument * current_document = view->doc(); + Document * current_document = view->doc(); using Inkscape::Util::GSListConstIterator; GSListConstIterator selected = sp_desktop_selection((SPDesktop *)view)->itemList(); diff --git a/src/extension/internal/cairo-png-out.cpp b/src/extension/internal/cairo-png-out.cpp index c81fdd029..d849755b7 100644 --- a/src/extension/internal/cairo-png-out.cpp +++ b/src/extension/internal/cairo-png-out.cpp @@ -48,7 +48,7 @@ CairoRendererOutput::check (Inkscape::Extension::Extension * module) } static bool -png_render_document_to_file(SPDocument *doc, gchar const *filename) +png_render_document_to_file(Document *doc, gchar const *filename) { CairoRenderer *renderer; CairoRenderContext *ctx; @@ -92,7 +92,7 @@ png_render_document_to_file(SPDocument *doc, gchar const *filename) \param uri Filename to save to (probably will end in .png) */ void -CairoRendererOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filename) +CairoRendererOutput::save(Inkscape::Extension::Output *mod, Document *doc, gchar const *filename) { if (!png_render_document_to_file(doc, filename)) throw Inkscape::Extension::Output::save_failed(); diff --git a/src/extension/internal/cairo-ps-out.cpp b/src/extension/internal/cairo-ps-out.cpp index dff89c1ed..d9cac666c 100644 --- a/src/extension/internal/cairo-ps-out.cpp +++ b/src/extension/internal/cairo-ps-out.cpp @@ -61,7 +61,7 @@ CairoEpsOutput::check (Inkscape::Extension::Extension * module) } static bool -ps_print_document_to_file(SPDocument *doc, gchar const *filename, unsigned int level, bool texttopath, bool filtertobitmap, int resolution, const gchar * const exportId, bool exportDrawing, bool exportCanvas, bool eps = false) +ps_print_document_to_file(Document *doc, gchar const *filename, unsigned int level, bool texttopath, bool filtertobitmap, int resolution, const gchar * const exportId, bool exportDrawing, bool exportCanvas, bool eps = false) { sp_document_ensure_up_to_date(doc); @@ -124,7 +124,7 @@ ps_print_document_to_file(SPDocument *doc, gchar const *filename, unsigned int l \param filename Filename to save to (probably will end in .ps) */ void -CairoPsOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filename) +CairoPsOutput::save(Inkscape::Extension::Output *mod, Document *doc, gchar const *filename) { Inkscape::Extension::Extension * ext; unsigned int ret; @@ -188,7 +188,7 @@ CairoPsOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar con \param filename Filename to save to (probably will end in .ps) */ void -CairoEpsOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filename) +CairoEpsOutput::save(Inkscape::Extension::Output *mod, Document *doc, gchar const *filename) { Inkscape::Extension::Extension * ext; unsigned int ret; diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp index d1462e52e..28cf406f2 100644 --- a/src/extension/internal/cairo-render-context.cpp +++ b/src/extension/internal/cairo-render-context.cpp @@ -811,7 +811,7 @@ CairoRenderContext::_finishSurfaceSetup(cairo_surface_t *surface, cairo_matrix_t cairo_scale(_cr, PT_PER_PX, PT_PER_PX); } else if (cairo_surface_get_content(_surface) != CAIRO_CONTENT_ALPHA) { // set background color on non-alpha surfaces - // TODO: bgcolor should be derived from SPDocument + // TODO: bgcolor should be derived from Document cairo_set_source_rgb(_cr, 1.0, 1.0, 1.0); cairo_rectangle(_cr, 0, 0, _width, _height); cairo_fill(_cr); diff --git a/src/extension/internal/cairo-renderer-pdf-out.cpp b/src/extension/internal/cairo-renderer-pdf-out.cpp index b44e83449..1e5404c50 100644 --- a/src/extension/internal/cairo-renderer-pdf-out.cpp +++ b/src/extension/internal/cairo-renderer-pdf-out.cpp @@ -47,7 +47,7 @@ CairoRendererPdfOutput::check (Inkscape::Extension::Extension * module) } static bool -pdf_render_document_to_file(SPDocument *doc, gchar const *filename, unsigned int level, +pdf_render_document_to_file(Document *doc, gchar const *filename, unsigned int level, bool texttopath, bool filtertobitmap, int resolution, const gchar * const exportId, bool exportDrawing, bool exportCanvas) { @@ -118,7 +118,7 @@ pdf_render_document_to_file(SPDocument *doc, gchar const *filename, unsigned int tell the printing system to save to file. */ void -CairoRendererPdfOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filename) +CairoRendererPdfOutput::save(Inkscape::Extension::Output *mod, Document *doc, gchar const *filename) { Inkscape::Extension::Extension * ext; unsigned int ret; diff --git a/src/extension/internal/cairo-renderer.cpp b/src/extension/internal/cairo-renderer.cpp index da88a5eae..3414993e5 100644 --- a/src/extension/internal/cairo-renderer.cpp +++ b/src/extension/internal/cairo-renderer.cpp @@ -460,7 +460,7 @@ static void sp_asbitmap_render(SPItem *item, CairoRenderContext *ctx) Geom::Matrix t = t_on_document * t_item.inverse(); // Do the export - SPDocument *document = SP_OBJECT(item)->document; + Document *document = SP_OBJECT(item)->document; GSList *items = NULL; items = g_slist_append(items, item); @@ -567,7 +567,7 @@ CairoRenderer::renderItem(CairoRenderContext *ctx, SPItem *item) } bool -CairoRenderer::setupDocument(CairoRenderContext *ctx, SPDocument *doc, bool pageBoundingBox, SPItem *base) +CairoRenderer::setupDocument(CairoRenderContext *ctx, Document *doc, bool pageBoundingBox, SPItem *base) { g_assert( ctx != NULL ); diff --git a/src/extension/internal/emf-win32-inout.cpp b/src/extension/internal/emf-win32-inout.cpp index f400a3649..ffba5af81 100644 --- a/src/extension/internal/emf-win32-inout.cpp +++ b/src/extension/internal/emf-win32-inout.cpp @@ -101,7 +101,7 @@ EmfWin32::check (Inkscape::Extension::Extension * /*module*/) static void -emf_print_document_to_file(SPDocument *doc, gchar const *filename) +emf_print_document_to_file(Document *doc, gchar const *filename) { Inkscape::Extension::Print *mod; SPPrintContext context; @@ -147,7 +147,7 @@ emf_print_document_to_file(SPDocument *doc, gchar const *filename) void -EmfWin32::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filename) +EmfWin32::save(Inkscape::Extension::Output *mod, Document *doc, gchar const *filename) { Inkscape::Extension::Extension * ext; @@ -2162,7 +2162,7 @@ typedef struct #pragma pack( pop ) -SPDocument * +Document * EmfWin32::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri ) { EMF_CALLBACK_DATA d; @@ -2365,7 +2365,7 @@ EmfWin32::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri ) // std::cout << "SVG Output: " << std::endl << *(d.outsvg) << std::endl; - SPDocument *doc = sp_document_new_from_mem(d.outsvg->c_str(), d.outsvg->length(), TRUE); + Document *doc = sp_document_new_from_mem(d.outsvg->c_str(), d.outsvg->length(), TRUE); delete d.outsvg; delete d.path; diff --git a/src/extension/internal/emf-win32-print.cpp b/src/extension/internal/emf-win32-print.cpp index d098f6466..822a0577b 100644 --- a/src/extension/internal/emf-win32-print.cpp +++ b/src/extension/internal/emf-win32-print.cpp @@ -116,7 +116,7 @@ PrintEmfWin32::setup (Inkscape::Extension::Print * /*mod*/) unsigned int -PrintEmfWin32::begin (Inkscape::Extension::Print *mod, SPDocument *doc) +PrintEmfWin32::begin (Inkscape::Extension::Print *mod, Document *doc) { gchar const *utf8_fn = mod->get_param_string("destination"); diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp index 64a099c8a..2f52561d1 100644 --- a/src/extension/internal/gdkpixbuf-input.cpp +++ b/src/extension/internal/gdkpixbuf-input.cpp @@ -16,10 +16,10 @@ GdkPixbuf* pixbuf_new_from_file( char const *utf8name, GError **error ); namespace Extension { namespace Internal { -SPDocument * +Document * GdkpixbufInput::open(Inkscape::Extension::Input */*mod*/, char const *uri) { - SPDocument *doc = NULL; + PDocument *doc = NULL; GdkPixbuf *pb = Inkscape::IO::pixbuf_new_from_file( uri, NULL ); if (pb) { /* We are readable */ diff --git a/src/extension/internal/gimpgrad.cpp b/src/extension/internal/gimpgrad.cpp index 5b3e0c16e..9510b5ebd 100644 --- a/src/extension/internal/gimpgrad.cpp +++ b/src/extension/internal/gimpgrad.cpp @@ -95,7 +95,7 @@ stop_svg(ColorRGBA const in_color, double const location) } /** - \brief Actually open the gradient and turn it into an SPDocument + \brief Actually open the gradient and turn it into an Document \param module The input module being used \param filename The filename of the gradient to be opened \return A Document with the gradient in it. @@ -129,7 +129,7 @@ stop_svg(ColorRGBA const in_color, double const location) document using the \c sp_document_from_mem. That is then returned to Inkscape. */ -SPDocument * +Document * GimpGrad::open (Inkscape::Extension::Input */*module*/, gchar const *filename) { Inkscape::IO::dump_fopen_call(filename, "I"); diff --git a/src/extension/internal/grid.cpp b/src/extension/internal/grid.cpp index d4b35b261..5a0523ba8 100644 --- a/src/extension/internal/grid.cpp +++ b/src/extension/internal/grid.cpp @@ -81,7 +81,7 @@ Grid::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View *doc Geom::Rect bounding_area = Geom::Rect(Geom::Point(0,0), Geom::Point(100,100)); if (selection->isEmpty()) { /* get page size */ - SPDocument * doc = document->doc(); + Document * doc = document->doc(); bounding_area = Geom::Rect( Geom::Point(0,0), Geom::Point(sp_document_width(doc), sp_document_height(doc)) ); } else { @@ -171,7 +171,7 @@ PrefAdjustment::val_changed (void) Gtk::Widget * Grid::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View * view, sigc::signal * changeSignal, Inkscape::Extension::Implementation::ImplementationDocumentCache * /*docCache*/) { - SPDocument * current_document = view->doc(); + Document * current_document = view->doc(); using Inkscape::Util::GSListConstIterator; GSListConstIterator selected = sp_desktop_selection((SPDesktop *)view)->itemList(); diff --git a/src/extension/internal/javafx-out.cpp b/src/extension/internal/javafx-out.cpp index 417755e19..c1f057071 100644 --- a/src/extension/internal/javafx-out.cpp +++ b/src/extension/internal/javafx-out.cpp @@ -701,7 +701,7 @@ bool JavaFXOutput::doCurve(SPItem *item, const String &id) /** * Output the tree data to buffer */ -bool JavaFXOutput::doTreeRecursive(SPDocument *doc, SPObject *obj) +bool JavaFXOutput::doTreeRecursive(Document *doc, SPObject *obj) { /** * Check the type of node and process @@ -749,7 +749,7 @@ bool JavaFXOutput::doTreeRecursive(SPDocument *doc, SPObject *obj) /** * Output the curve data to buffer */ -bool JavaFXOutput::doTree(SPDocument *doc) +bool JavaFXOutput::doTree(Document *doc) { double bignum = 1000000.0; @@ -767,7 +767,7 @@ bool JavaFXOutput::doTree(SPDocument *doc) } -bool JavaFXOutput::doBody(SPDocument *doc, SPObject *obj) +bool JavaFXOutput::doBody(Document *doc, SPObject *obj) { /** * Check the type of node and process @@ -842,7 +842,7 @@ void JavaFXOutput::reset() /** * Saves the of an Inkscape SVG file as JavaFX spline definitions */ -bool JavaFXOutput::saveDocument(SPDocument *doc, gchar const *filename_utf8) +bool JavaFXOutput::saveDocument(Document *doc, gchar const *filename_utf8) { reset(); @@ -918,7 +918,7 @@ bool JavaFXOutput::saveDocument(SPDocument *doc, gchar const *filename_utf8) */ void JavaFXOutput::save(Inkscape::Extension::Output */*mod*/, - SPDocument *doc, gchar const *filename_utf8) + Document *doc, gchar const *filename_utf8) { /* N.B. The name `filename_utf8' represents the fact that we want it to be in utf8; whereas in * fact we know that some callers of Extension::save pass something in the filesystem's diff --git a/src/extension/internal/latex-pstricks-out.cpp b/src/extension/internal/latex-pstricks-out.cpp index 4a469a750..924f9697e 100644 --- a/src/extension/internal/latex-pstricks-out.cpp +++ b/src/extension/internal/latex-pstricks-out.cpp @@ -47,7 +47,7 @@ LatexOutput::check (Inkscape::Extension::Extension * module) void -LatexOutput::save(Inkscape::Extension::Output *mod2, SPDocument *doc, gchar const *filename) +LatexOutput::save(Inkscape::Extension::Output *mod2, Document *doc, gchar const *filename) { Inkscape::Extension::Print *mod; SPPrintContext context; diff --git a/src/extension/internal/latex-pstricks.cpp b/src/extension/internal/latex-pstricks.cpp index 789e5ea34..afc985e14 100644 --- a/src/extension/internal/latex-pstricks.cpp +++ b/src/extension/internal/latex-pstricks.cpp @@ -64,7 +64,7 @@ PrintLatex::setup (Inkscape::Extension::Print *mod) } unsigned int -PrintLatex::begin (Inkscape::Extension::Print *mod, SPDocument *doc) +PrintLatex::begin (Inkscape::Extension::Print *mod, Document *doc) { Inkscape::SVGOStringStream os; int res; diff --git a/src/extension/internal/odf.cpp b/src/extension/internal/odf.cpp index cc8489302..e7e22414a 100644 --- a/src/extension/internal/odf.cpp +++ b/src/extension/internal/odf.cpp @@ -2367,7 +2367,7 @@ OdfOutput::reset() * Descends into the SVG tree, mapping things to ODF when appropriate */ void -OdfOutput::save(Inkscape::Extension::Output */*mod*/, SPDocument *doc, gchar const *filename) +OdfOutput::save(Inkscape::Extension::Output */*mod*/, Document *doc, gchar const *filename) { reset(); diff --git a/src/extension/internal/pdf-input-cairo.cpp b/src/extension/internal/pdf-input-cairo.cpp index 937fefb11..76759259d 100644 --- a/src/extension/internal/pdf-input-cairo.cpp +++ b/src/extension/internal/pdf-input-cairo.cpp @@ -32,7 +32,7 @@ namespace Internal { static cairo_status_t _write_ustring_cb(void *closure, const unsigned char *data, unsigned int length); -SPDocument * +Document * PdfInputCairo::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri) { printf("Attempting to open using PdfInputCairo\n"); @@ -58,7 +58,7 @@ PdfInputCairo::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri) { cairo_destroy(cr); cairo_surface_destroy(surface); - SPDocument * doc = sp_document_new_from_mem(output->c_str(), output->length(), TRUE); + Document * doc = sp_document_new_from_mem(output->c_str(), output->length(), TRUE); delete output; g_object_unref(page); diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp index c2d417f2c..476f0daf6 100644 --- a/src/extension/internal/pdfinput/pdf-input.cpp +++ b/src/extension/internal/pdfinput/pdf-input.cpp @@ -589,7 +589,7 @@ void PdfImportDialog::_setPreviewPage(int page) { /** * Parses the selected page of the given PDF document using PdfParser. */ -SPDocument * +Document * PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) { // Initialize the globalParams variable for poppler @@ -661,7 +661,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) { Catalog *catalog = pdf_doc->getCatalog(); Page *page = catalog->getPage(page_num); - SPDocument *doc = sp_document_new(NULL, TRUE, TRUE); + Document *doc = sp_document_new(NULL, TRUE, TRUE); bool saved = sp_document_get_undo_sensitive(doc); sp_document_set_undo_sensitive(doc, false); // No need to undo in this temporary document diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp index 00bd8fa4d..686e44bb1 100644 --- a/src/extension/internal/pdfinput/svg-builder.cpp +++ b/src/extension/internal/pdfinput/svg-builder.cpp @@ -77,7 +77,7 @@ struct SvgTransparencyGroup { * */ -SvgBuilder::SvgBuilder(SPDocument *document, gchar *docname, XRef *xref) { +SvgBuilder::SvgBuilder(Document *document, gchar *docname, XRef *xref) { _is_top_level = true; _doc = document; _docname = docname; diff --git a/src/extension/internal/pov-out.cpp b/src/extension/internal/pov-out.cpp index f30cbc317..d3ed39d1f 100644 --- a/src/extension/internal/pov-out.cpp +++ b/src/extension/internal/pov-out.cpp @@ -417,7 +417,7 @@ bool PovOutput::doCurve(SPItem *item, const String &id) /** * Descend the svg tree recursively, translating data */ -bool PovOutput::doTreeRecursive(SPDocument *doc, SPObject *obj) +bool PovOutput::doTreeRecursive(Document *doc, SPObject *obj) { String id; @@ -454,7 +454,7 @@ bool PovOutput::doTreeRecursive(SPDocument *doc, SPObject *obj) /** * Output the curve data to buffer */ -bool PovOutput::doTree(SPDocument *doc) +bool PovOutput::doTree(Document *doc) { double bignum = 1000000.0; minx = bignum; @@ -576,7 +576,7 @@ void PovOutput::reset() /** * Saves the Shapes of an Inkscape SVG file as PovRay spline definitions */ -void PovOutput::saveDocument(SPDocument *doc, gchar const *filename_utf8) +void PovOutput::saveDocument(Document *doc, gchar const *filename_utf8) { reset(); @@ -641,7 +641,7 @@ void PovOutput::saveDocument(SPDocument *doc, gchar const *filename_utf8) */ void PovOutput::save(Inkscape::Extension::Output */*mod*/, - SPDocument *doc, gchar const *filename_utf8) + Document *doc, gchar const *filename_utf8) { /* See comments in JavaFSOutput::save re the name `filename_utf8'. */ saveDocument(doc, filename_utf8); diff --git a/src/extension/internal/svg.cpp b/src/extension/internal/svg.cpp index a3589e905..317811088 100644 --- a/src/extension/internal/svg.cpp +++ b/src/extension/internal/svg.cpp @@ -138,13 +138,13 @@ _load_uri (const gchar *uri) /** \return A new document just for you! \brief This function takes in a filename of a SVG document and - turns it into a SPDocument. + turns it into a Document. \param mod Module to use \param uri The path to the file (UTF-8) This function is really simple, it just calls sp_document_new... */ -SPDocument * +Document * Svg::open (Inkscape::Extension::Input */*mod*/, const gchar *uri) { #ifdef WITH_GNOME_VFS @@ -157,7 +157,7 @@ Svg::open (Inkscape::Extension::Input */*mod*/, const gchar *uri) g_warning("Error: Could not open file '%s' with VFS\n", uri); return NULL; } - SPDocument * doc = sp_document_new_from_mem(buffer, strlen(buffer), 1); + Document * doc = sp_document_new_from_mem(buffer, strlen(buffer), 1); g_free(buffer); return doc; @@ -191,7 +191,7 @@ Svg::open (Inkscape::Extension::Input */*mod*/, const gchar *uri) all of this code. I just stole it. */ void -Svg::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filename) +Svg::save(Inkscape::Extension::Output *mod, Document *doc, gchar const *filename) { g_return_if_fail(doc != NULL); g_return_if_fail(filename != NULL); diff --git a/src/extension/internal/win32.cpp b/src/extension/internal/win32.cpp index 21f278858..f272292b5 100644 --- a/src/extension/internal/win32.cpp +++ b/src/extension/internal/win32.cpp @@ -215,7 +215,7 @@ PrintWin32::setup (Inkscape::Extension::Print *mod) } unsigned int -PrintWin32::begin (Inkscape::Extension::Print *mod, SPDocument *doc) +PrintWin32::begin (Inkscape::Extension::Print *mod, Document *doc) { DOCINFO di = { sizeof (DOCINFO), diff --git a/src/extension/internal/wpg-input.cpp b/src/extension/internal/wpg-input.cpp index c37d5705b..e7177e5e3 100644 --- a/src/extension/internal/wpg-input.cpp +++ b/src/extension/internal/wpg-input.cpp @@ -59,7 +59,7 @@ namespace Extension { namespace Internal { -SPDocument * +Document * WpgInput::open(Inkscape::Extension::Input * mod, const gchar * uri) { WPXInputStream* input = new libwpg::WPGFileStream(uri); if (input->isOLEStream()) { @@ -86,7 +86,7 @@ WpgInput::open(Inkscape::Extension::Input * mod, const gchar * uri) { //printf("I've got a doc: \n%s", painter.document.c_str()); - SPDocument * doc = sp_document_new_from_mem(output.cstr(), strlen(output.cstr()), TRUE); + Document * doc = sp_document_new_from_mem(output.cstr(), strlen(output.cstr()), TRUE); delete input; return doc; } diff --git a/src/extension/param/bool.cpp b/src/extension/param/bool.cpp index 1dda3d73f..07170587a 100644 --- a/src/extension/param/bool.cpp +++ b/src/extension/param/bool.cpp @@ -53,7 +53,7 @@ ParamBool::ParamBool (const gchar * name, const gchar * guitext, const gchar * d and \c pref_name() are used. */ bool -ParamBool::set( bool in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/ ) +ParamBool::set( bool in, Document * /*doc*/, Inkscape::XML::Node * /*node*/ ) { _value = in; @@ -67,7 +67,7 @@ ParamBool::set( bool in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/ ) /** \brief Returns \c _value */ bool -ParamBool::get (const SPDocument * doc, const Inkscape::XML::Node * node) +ParamBool::get (const Document * doc, const Inkscape::XML::Node * node) { return _value; } @@ -79,7 +79,7 @@ class ParamBoolCheckButton : public Gtk::CheckButton { private: /** \brief Param to change */ ParamBool * _pref; - SPDocument * _doc; + Document * _doc; Inkscape::XML::Node * _node; sigc::signal * _changeSignal; public: @@ -89,7 +89,7 @@ public: This function sets the value of the checkbox to be that of the parameter, and then sets up a callback to \c on_toggle. */ - ParamBoolCheckButton (ParamBool * param, SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : + ParamBoolCheckButton (ParamBool * param, Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : Gtk::CheckButton(), _pref(param), _doc(doc), _node(node), _changeSignal(changeSignal) { this->set_active(_pref->get(NULL, NULL) /**\todo fix */); this->signal_toggled().connect(sigc::mem_fun(this, &ParamBoolCheckButton::on_toggle)); @@ -132,7 +132,7 @@ ParamBool::string (std::string &string) Builds a hbox with a label and a check button in it. */ Gtk::Widget * -ParamBool::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamBool::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4)); diff --git a/src/extension/param/color.cpp b/src/extension/param/color.cpp index 58db85748..080356e71 100644 --- a/src/extension/param/color.cpp +++ b/src/extension/param/color.cpp @@ -41,7 +41,7 @@ ParamColor::~ParamColor(void) } guint32 -ParamColor::set( guint32 in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/ ) +ParamColor::set( guint32 in, Document * /*doc*/, Inkscape::XML::Node * /*node*/ ) { _value = in; @@ -87,7 +87,7 @@ ParamColor::string (std::string &string) } Gtk::Widget * -ParamColor::get_widget( SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal * changeSignal ) +ParamColor::get_widget( Document * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal * changeSignal ) { if (_gui_hidden) return NULL; diff --git a/src/extension/param/description.cpp b/src/extension/param/description.cpp index 656e58c49..3641695cc 100644 --- a/src/extension/param/description.cpp +++ b/src/extension/param/description.cpp @@ -46,7 +46,7 @@ ParamDescription::ParamDescription (const gchar * name, const gchar * guitext, c /** \brief Create a label for the description */ Gtk::Widget * -ParamDescription::get_widget (SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal * /*changeSignal*/) +ParamDescription::get_widget (Document * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal * /*changeSignal*/) { if (_gui_hidden) return NULL; diff --git a/src/extension/param/enum.cpp b/src/extension/param/enum.cpp index 03c1f839b..9de3f60dd 100644 --- a/src/extension/param/enum.cpp +++ b/src/extension/param/enum.cpp @@ -129,7 +129,7 @@ ParamComboBox::~ParamComboBox (void) the passed in value is duplicated using \c g_strdup(). */ const gchar * -ParamComboBox::set (const gchar * in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/) +ParamComboBox::set (const gchar * in, Document * /*doc*/, Inkscape::XML::Node * /*node*/) { if (in == NULL) return NULL; /* Can't have NULL string */ @@ -177,7 +177,7 @@ ParamComboBox::string (std::string &string) class ParamComboBoxEntry : public Gtk::ComboBoxText { private: ParamComboBox * _pref; - SPDocument * _doc; + Document * _doc; Inkscape::XML::Node * _node; sigc::signal * _changeSignal; public: @@ -185,7 +185,7 @@ public: \param pref Where to get the string from, and where to put it when it changes. */ - ParamComboBoxEntry (ParamComboBox * pref, SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : + ParamComboBoxEntry (ParamComboBox * pref, Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : Gtk::ComboBoxText(), _pref(pref), _doc(doc), _node(node), _changeSignal(changeSignal) { this->signal_changed().connect(sigc::mem_fun(this, &ParamComboBoxEntry::changed)); }; @@ -211,7 +211,7 @@ ParamComboBoxEntry::changed (void) \brief Creates a combobox widget for an enumeration parameter */ Gtk::Widget * -ParamComboBox::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamComboBox::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; diff --git a/src/extension/param/float.cpp b/src/extension/param/float.cpp index 11e3a8d97..516249c3c 100644 --- a/src/extension/param/float.cpp +++ b/src/extension/param/float.cpp @@ -75,7 +75,7 @@ ParamFloat::ParamFloat (const gchar * name, const gchar * guitext, const gchar * and \c pref_name() are used. */ float -ParamFloat::set (float in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/) +ParamFloat::set (float in, Document * /*doc*/, Inkscape::XML::Node * /*node*/) { _value = in; if (_value > _max) _value = _max; @@ -103,13 +103,13 @@ ParamFloat::string (std::string &string) class ParamFloatAdjustment : public Gtk::Adjustment { /** The parameter to adjust */ ParamFloat * _pref; - SPDocument * _doc; + Document * _doc; Inkscape::XML::Node * _node; sigc::signal * _changeSignal; public: /** \brief Make the adjustment using an extension and the string describing the parameter. */ - ParamFloatAdjustment (ParamFloat * param, SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : + ParamFloatAdjustment (ParamFloat * param, Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : Gtk::Adjustment(0.0, param->min(), param->max(), 0.1, 0), _pref(param), _doc(doc), _node(node), _changeSignal(changeSignal) { this->set_value(_pref->get(NULL, NULL) /* \todo fix */); this->signal_value_changed().connect(sigc::mem_fun(this, &ParamFloatAdjustment::val_changed)); @@ -142,7 +142,7 @@ ParamFloatAdjustment::val_changed (void) Builds a hbox with a label and a float adjustment in it. */ Gtk::Widget * -ParamFloat::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamFloat::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; diff --git a/src/extension/param/int.cpp b/src/extension/param/int.cpp index 301d54ed0..2818bb57b 100644 --- a/src/extension/param/int.cpp +++ b/src/extension/param/int.cpp @@ -70,7 +70,7 @@ ParamInt::ParamInt (const gchar * name, const gchar * guitext, const gchar * des and \c pref_name() are used. */ int -ParamInt::set (int in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/) +ParamInt::set (int in, Document * /*doc*/, Inkscape::XML::Node * /*node*/) { _value = in; if (_value > _max) _value = _max; @@ -88,13 +88,13 @@ ParamInt::set (int in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/) class ParamIntAdjustment : public Gtk::Adjustment { /** The parameter to adjust */ ParamInt * _pref; - SPDocument * _doc; + Document * _doc; Inkscape::XML::Node * _node; sigc::signal * _changeSignal; public: /** \brief Make the adjustment using an extension and the string describing the parameter. */ - ParamIntAdjustment (ParamInt * param, SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : + ParamIntAdjustment (ParamInt * param, Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : Gtk::Adjustment(0.0, param->min(), param->max(), 1.0, 0), _pref(param), _doc(doc), _node(node), _changeSignal(changeSignal) { this->set_value(_pref->get(NULL, NULL) /* \todo fix */); this->signal_value_changed().connect(sigc::mem_fun(this, &ParamIntAdjustment::val_changed)); @@ -127,7 +127,7 @@ ParamIntAdjustment::val_changed (void) Builds a hbox with a label and a int adjustment in it. */ Gtk::Widget * -ParamInt::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamInt::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; diff --git a/src/extension/param/notebook.cpp b/src/extension/param/notebook.cpp index 1c30b7e0e..6ad338ffa 100644 --- a/src/extension/param/notebook.cpp +++ b/src/extension/param/notebook.cpp @@ -54,7 +54,7 @@ public: ParamNotebookPage(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); ~ParamNotebookPage(void); - Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void paramString (std::list &list); gchar * get_guitext (void) {return _text;}; @@ -196,7 +196,7 @@ ParamNotebookPage::makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension: Builds a notebook page (a vbox) and puts parameters on it. */ Gtk::Widget * -ParamNotebookPage::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamNotebookPage::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; @@ -295,7 +295,7 @@ ParamNotebook::~ParamNotebook (void) the passed in value is duplicated using \c g_strdup(). */ const gchar * -ParamNotebook::set (const int in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/) +ParamNotebook::set (const int in, Document * /*doc*/, Inkscape::XML::Node * /*node*/) { ParamNotebookPage * page = NULL; int i = 0; @@ -347,14 +347,14 @@ ParamNotebook::string (std::list &list) class ParamNotebookWdg : public Gtk::Notebook { private: ParamNotebook * _pref; - SPDocument * _doc; + Document * _doc; Inkscape::XML::Node * _node; public: /** \brief Build a notebookpage preference for the given parameter \param pref Where to get the string (pagename) from, and where to put it when it changes. */ - ParamNotebookWdg (ParamNotebook * pref, SPDocument * doc, Inkscape::XML::Node * node) : + ParamNotebookWdg (ParamNotebook * pref, Document * doc, Inkscape::XML::Node * node) : Gtk::Notebook(), _pref(pref), _doc(doc), _node(node), activated(false) { // don't have to set the correct page: this is done in ParamNotebook::get_widget. // hook function @@ -389,7 +389,7 @@ ParamNotebookWdg::changed_page(GtkNotebookPage */*page*/, Builds a notebook and puts pages in it. */ Gtk::Widget * -ParamNotebook::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamNotebook::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; diff --git a/src/extension/param/parameter.cpp b/src/extension/param/parameter.cpp index 2773af61d..1094a5d3f 100644 --- a/src/extension/param/parameter.cpp +++ b/src/extension/param/parameter.cpp @@ -156,7 +156,7 @@ Parameter::make (Inkscape::XML::Node * in_repr, Inkscape::Extension::Extension * /** \brief Wrapper to cast to the object and use it's function. */ bool -Parameter::get_bool (const SPDocument * doc, const Inkscape::XML::Node * node) +Parameter::get_bool (const Document * doc, const Inkscape::XML::Node * node) { ParamBool * boolpntr = dynamic_cast(this); if (boolpntr == NULL) @@ -166,7 +166,7 @@ Parameter::get_bool (const SPDocument * doc, const Inkscape::XML::Node * node) /** \brief Wrapper to cast to the object and use it's function. */ int -Parameter::get_int (const SPDocument * doc, const Inkscape::XML::Node * node) +Parameter::get_int (const Document * doc, const Inkscape::XML::Node * node) { ParamInt * intpntr = dynamic_cast(this); if (intpntr == NULL) @@ -176,7 +176,7 @@ Parameter::get_int (const SPDocument * doc, const Inkscape::XML::Node * node) /** \brief Wrapper to cast to the object and use it's function. */ float -Parameter::get_float (const SPDocument * doc, const Inkscape::XML::Node * node) +Parameter::get_float (const Document * doc, const Inkscape::XML::Node * node) { ParamFloat * floatpntr = dynamic_cast(this); if (floatpntr == NULL) @@ -186,7 +186,7 @@ Parameter::get_float (const SPDocument * doc, const Inkscape::XML::Node * node) /** \brief Wrapper to cast to the object and use it's function. */ const gchar * -Parameter::get_string (const SPDocument * doc, const Inkscape::XML::Node * node) +Parameter::get_string (const Document * doc, const Inkscape::XML::Node * node) { ParamString * stringpntr = dynamic_cast(this); if (stringpntr == NULL) @@ -196,7 +196,7 @@ Parameter::get_string (const SPDocument * doc, const Inkscape::XML::Node * node) /** \brief Wrapper to cast to the object and use it's function. */ const gchar * -Parameter::get_enum (const SPDocument * doc, const Inkscape::XML::Node * node) +Parameter::get_enum (const Document * doc, const Inkscape::XML::Node * node) { ParamComboBox * param = dynamic_cast(this); if (param == NULL) @@ -205,7 +205,7 @@ Parameter::get_enum (const SPDocument * doc, const Inkscape::XML::Node * node) } guint32 -Parameter::get_color(const SPDocument* doc, const Inkscape::XML::Node* node) +Parameter::get_color(const Document* doc, const Inkscape::XML::Node* node) { ParamColor* param = dynamic_cast(this); if (param == NULL) @@ -215,7 +215,7 @@ Parameter::get_color(const SPDocument* doc, const Inkscape::XML::Node* node) /** \brief Wrapper to cast to the object and use it's function. */ bool -Parameter::set_bool (bool in, SPDocument * doc, Inkscape::XML::Node * node) +Parameter::set_bool (bool in, Document * doc, Inkscape::XML::Node * node) { ParamBool * boolpntr = dynamic_cast(this); if (boolpntr == NULL) @@ -225,7 +225,7 @@ Parameter::set_bool (bool in, SPDocument * doc, Inkscape::XML::Node * node) /** \brief Wrapper to cast to the object and use it's function. */ int -Parameter::set_int (int in, SPDocument * doc, Inkscape::XML::Node * node) +Parameter::set_int (int in, Document * doc, Inkscape::XML::Node * node) { ParamInt * intpntr = dynamic_cast(this); if (intpntr == NULL) @@ -235,7 +235,7 @@ Parameter::set_int (int in, SPDocument * doc, Inkscape::XML::Node * node) /** \brief Wrapper to cast to the object and use it's function. */ float -Parameter::set_float (float in, SPDocument * doc, Inkscape::XML::Node * node) +Parameter::set_float (float in, Document * doc, Inkscape::XML::Node * node) { ParamFloat * floatpntr; floatpntr = dynamic_cast(this); @@ -246,7 +246,7 @@ Parameter::set_float (float in, SPDocument * doc, Inkscape::XML::Node * node) /** \brief Wrapper to cast to the object and use it's function. */ const gchar * -Parameter::set_string (const gchar * in, SPDocument * doc, Inkscape::XML::Node * node) +Parameter::set_string (const gchar * in, Document * doc, Inkscape::XML::Node * node) { ParamString * stringpntr = dynamic_cast(this); if (stringpntr == NULL) @@ -255,7 +255,7 @@ Parameter::set_string (const gchar * in, SPDocument * doc, Inkscape::XML::Node * } /** \brief Wrapper to cast to the object and use it's function. */ guint32 -Parameter::set_color (guint32 in, SPDocument * doc, Inkscape::XML::Node * node) +Parameter::set_color (guint32 in, Document * doc, Inkscape::XML::Node * node) { ParamColor* param = dynamic_cast(this); if (param == NULL) @@ -323,7 +323,7 @@ Parameter::new_child (Inkscape::XML::Node * parent) } Inkscape::XML::Node * -Parameter::document_param_node (SPDocument * doc) +Parameter::document_param_node (Document * doc) { Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); Inkscape::XML::Node * defs = SP_OBJECT_REPR(SP_DOCUMENT_DEFS(doc)); @@ -353,7 +353,7 @@ Parameter::document_param_node (SPDocument * doc) /** \brief Basically, if there is no widget pass a NULL. */ Gtk::Widget * -Parameter::get_widget (SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal * /*changeSignal*/) +Parameter::get_widget (Document * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal * /*changeSignal*/) { return NULL; } diff --git a/src/extension/param/radiobutton.cpp b/src/extension/param/radiobutton.cpp index c17839001..315984e17 100644 --- a/src/extension/param/radiobutton.cpp +++ b/src/extension/param/radiobutton.cpp @@ -149,7 +149,7 @@ ParamRadioButton::~ParamRadioButton (void) the passed in value is duplicated using \c g_strdup(). */ const gchar * -ParamRadioButton::set (const gchar * in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/) +ParamRadioButton::set (const gchar * in, Document * /*doc*/, Inkscape::XML::Node * /*node*/) { if (in == NULL) return NULL; /* Can't have NULL string */ @@ -189,7 +189,7 @@ ParamRadioButton::string (std::string &string) class ParamRadioButtonWdg : public Gtk::RadioButton { private: ParamRadioButton * _pref; - SPDocument * _doc; + Document * _doc; Inkscape::XML::Node * _node; sigc::signal * _changeSignal; public: @@ -197,12 +197,12 @@ public: \param pref Where to put the radiobutton's string when it is selected. */ ParamRadioButtonWdg ( Gtk::RadioButtonGroup& group, const Glib::ustring& label, - ParamRadioButton * pref, SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal ) : + ParamRadioButton * pref, Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal ) : Gtk::RadioButton(group, label), _pref(pref), _doc(doc), _node(node), _changeSignal(changeSignal) { add_changesignal(); }; ParamRadioButtonWdg ( const Glib::ustring& label, - ParamRadioButton * pref, SPDocument * doc, Inkscape::XML::Node * node , sigc::signal * changeSignal) : + ParamRadioButton * pref, Document * doc, Inkscape::XML::Node * node , sigc::signal * changeSignal) : Gtk::RadioButton(label), _pref(pref), _doc(doc), _node(node), _changeSignal(changeSignal) { add_changesignal(); }; @@ -232,7 +232,7 @@ ParamRadioButtonWdg::changed (void) class ComboWdg : public Gtk::ComboBoxText { public: - ComboWdg(ParamRadioButton* base, SPDocument * doc, Inkscape::XML::Node * node) : + ComboWdg(ParamRadioButton* base, Document * doc, Inkscape::XML::Node * node) : Gtk::ComboBoxText(), base(base), doc(doc), @@ -243,7 +243,7 @@ public: protected: ParamRadioButton* base; - SPDocument* doc; + Document* doc; Inkscape::XML::Node* node; virtual void on_changed() { @@ -257,7 +257,7 @@ protected: \brief Creates a combobox widget for an enumeration parameter */ Gtk::Widget * -ParamRadioButton::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamRadioButton::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; diff --git a/src/extension/param/string.cpp b/src/extension/param/string.cpp index e32224332..6427f6f76 100644 --- a/src/extension/param/string.cpp +++ b/src/extension/param/string.cpp @@ -42,7 +42,7 @@ ParamString::~ParamString(void) the passed in value is duplicated using \c g_strdup(). */ const gchar * -ParamString::set (const gchar * in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/) +ParamString::set (const gchar * in, Document * /*doc*/, Inkscape::XML::Node * /*node*/) { if (in == NULL) return NULL; /* Can't have NULL string */ @@ -96,7 +96,7 @@ ParamString::ParamString (const gchar * name, const gchar * guitext, const gchar class ParamStringEntry : public Gtk::Entry { private: ParamString * _pref; - SPDocument * _doc; + Document * _doc; Inkscape::XML::Node * _node; sigc::signal * _changeSignal; public: @@ -104,7 +104,7 @@ public: \param pref Where to get the string from, and where to put it when it changes. */ - ParamStringEntry (ParamString * pref, SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : + ParamStringEntry (ParamString * pref, Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : Gtk::Entry(), _pref(pref), _doc(doc), _node(node), _changeSignal(changeSignal) { if (_pref->get(NULL, NULL) != NULL) this->set_text(Glib::ustring(_pref->get(NULL, NULL))); @@ -137,7 +137,7 @@ ParamStringEntry::changed_text (void) Builds a hbox with a label and a text box in it. */ Gtk::Widget * -ParamString::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamString::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; -- cgit v1.2.3 From 4e52fb5a8a6644c0394b9aef689400fad81d24cc Mon Sep 17 00:00:00 2001 From: johnce Date: Wed, 5 Aug 2009 06:39:04 +0000 Subject: SPDocument->Document (bzr r8409) --- src/extension/internal/pdfinput/pdf-input.h | 2 +- src/extension/internal/pdfinput/svg-builder.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/extension') diff --git a/src/extension/internal/pdfinput/pdf-input.h b/src/extension/internal/pdfinput/pdf-input.h index 6bf0f11a2..968114ef3 100644 --- a/src/extension/internal/pdfinput/pdf-input.h +++ b/src/extension/internal/pdfinput/pdf-input.h @@ -113,7 +113,7 @@ private: class PdfInput: public Inkscape::Extension::Implementation::Implementation { PdfInput () { }; public: - SPDocument *open( Inkscape::Extension::Input *mod, + Document *open( Inkscape::Extension::Input *mod, const gchar *uri ); static void init( void ); diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h index 3b9192d31..1f84ffcc3 100644 --- a/src/extension/internal/pdfinput/svg-builder.h +++ b/src/extension/internal/pdfinput/svg-builder.h @@ -18,7 +18,7 @@ #ifdef HAVE_POPPLER -class SPDocument; +class Document; namespace Inkscape { namespace XML { class Document; @@ -95,7 +95,7 @@ struct SvgGlyph { */ class SvgBuilder { public: - SvgBuilder(SPDocument *document, gchar *docname, XRef *xref); + SvgBuilder(Document *document, gchar *docname, XRef *xref); SvgBuilder(SvgBuilder *parent, Inkscape::XML::Node *root); virtual ~SvgBuilder(); @@ -220,7 +220,7 @@ private: std::vector _availableFontNames; // Full names, used for matching font names (Bug LP #179589). bool _is_top_level; // Whether this SvgBuilder is the top-level one - SPDocument *_doc; + Document *_doc; gchar *_docname; // Basename of the URI from which this document is created XRef *_xref; // Cross-reference table from the PDF doc we're converting from Inkscape::XML::Document *_xml_doc; -- cgit v1.2.3 From a68dd35a31e54a4340d54a491a8f1b45d73352f4 Mon Sep 17 00:00:00 2001 From: johnce Date: Wed, 5 Aug 2009 17:25:25 +0000 Subject: SPDocument->Document (bzr r8416) --- src/extension/internal/gdkpixbuf-input.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/extension') diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp index 2f52561d1..2aea1cc64 100644 --- a/src/extension/internal/gdkpixbuf-input.cpp +++ b/src/extension/internal/gdkpixbuf-input.cpp @@ -19,7 +19,7 @@ namespace Internal { Document * GdkpixbufInput::open(Inkscape::Extension::Input */*mod*/, char const *uri) { - PDocument *doc = NULL; + Document *doc = NULL; GdkPixbuf *pb = Inkscape::IO::pixbuf_new_from_file( uri, NULL ); if (pb) { /* We are readable */ -- cgit v1.2.3 From 51c2905fd3e99955db2d823b79abb763d8097028 Mon Sep 17 00:00:00 2001 From: Maximilian Albert Date: Thu, 6 Aug 2009 14:17:17 +0000 Subject: Revert recent refactoring changes by johnce because they break the build, which cannot be fixed easily. (bzr r8422) --- src/extension/effect.cpp | 2 +- src/extension/effect.h | 2 +- src/extension/execution-env.cpp | 2 +- src/extension/extension.cpp | 24 ++++++++++----------- src/extension/extension.h | 26 +++++++++++------------ src/extension/implementation/implementation.cpp | 8 +++---- src/extension/implementation/implementation.h | 6 +++--- src/extension/implementation/script.cpp | 8 +++---- src/extension/implementation/script.h | 4 ++-- src/extension/implementation/xslt.cpp | 6 +++--- src/extension/implementation/xslt.h | 4 ++-- src/extension/input.cpp | 4 ++-- src/extension/input.h | 2 +- src/extension/internal/bitmap/imagemagick.cpp | 2 +- src/extension/internal/cairo-png-out.cpp | 4 ++-- src/extension/internal/cairo-png-out.h | 2 +- src/extension/internal/cairo-ps-out.cpp | 6 +++--- src/extension/internal/cairo-ps-out.h | 4 ++-- src/extension/internal/cairo-render-context.cpp | 2 +- src/extension/internal/cairo-renderer-pdf-out.cpp | 4 ++-- src/extension/internal/cairo-renderer-pdf-out.h | 2 +- src/extension/internal/cairo-renderer.cpp | 4 ++-- src/extension/internal/cairo-renderer.h | 4 ++-- src/extension/internal/emf-win32-inout.cpp | 8 +++---- src/extension/internal/emf-win32-inout.h | 4 ++-- src/extension/internal/emf-win32-print.cpp | 2 +- src/extension/internal/emf-win32-print.h | 2 +- src/extension/internal/gdkpixbuf-input.cpp | 4 ++-- src/extension/internal/gdkpixbuf-input.h | 2 +- src/extension/internal/gimpgrad.cpp | 4 ++-- src/extension/internal/gimpgrad.h | 2 +- src/extension/internal/grid.cpp | 4 ++-- src/extension/internal/javafx-out.cpp | 10 ++++----- src/extension/internal/javafx-out.h | 10 ++++----- src/extension/internal/latex-pstricks-out.cpp | 2 +- src/extension/internal/latex-pstricks-out.h | 2 +- src/extension/internal/latex-pstricks.cpp | 2 +- src/extension/internal/latex-pstricks.h | 2 +- src/extension/internal/odf.cpp | 2 +- src/extension/internal/odf.h | 2 +- src/extension/internal/pdf-input-cairo.cpp | 4 ++-- src/extension/internal/pdf-input-cairo.h | 2 +- src/extension/internal/pdfinput/pdf-input.cpp | 4 ++-- src/extension/internal/pdfinput/pdf-input.h | 2 +- src/extension/internal/pdfinput/svg-builder.cpp | 2 +- src/extension/internal/pdfinput/svg-builder.h | 6 +++--- src/extension/internal/pov-out.cpp | 8 +++---- src/extension/internal/pov-out.h | 8 +++---- src/extension/internal/svg.cpp | 8 +++---- src/extension/internal/svg.h | 4 ++-- src/extension/internal/win32.cpp | 2 +- src/extension/internal/win32.h | 2 +- src/extension/internal/wpg-input.cpp | 4 ++-- src/extension/internal/wpg-input.h | 2 +- src/extension/output.cpp | 2 +- src/extension/output.h | 4 ++-- src/extension/param/bool.cpp | 10 ++++----- src/extension/param/bool.h | 6 +++--- src/extension/param/color.cpp | 4 ++-- src/extension/param/color.h | 6 +++--- src/extension/param/description.cpp | 2 +- src/extension/param/description.h | 2 +- src/extension/param/enum.cpp | 8 +++---- src/extension/param/enum.h | 6 +++--- src/extension/param/float.cpp | 8 +++---- src/extension/param/float.h | 6 +++--- src/extension/param/int.cpp | 8 +++---- src/extension/param/int.h | 6 +++--- src/extension/param/notebook.cpp | 12 +++++------ src/extension/param/notebook.h | 6 +++--- src/extension/param/parameter.cpp | 26 +++++++++++------------ src/extension/param/parameter.h | 26 +++++++++++------------ src/extension/param/radiobutton.cpp | 14 ++++++------ src/extension/param/radiobutton.h | 6 +++--- src/extension/param/string.cpp | 8 +++---- src/extension/param/string.h | 6 +++--- src/extension/patheffect.cpp | 4 ++-- src/extension/patheffect.h | 4 ++-- src/extension/print.cpp | 2 +- src/extension/print.h | 2 +- src/extension/system.cpp | 6 +++--- src/extension/system.h | 4 ++-- 82 files changed, 229 insertions(+), 229 deletions(-) (limited to 'src/extension') diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp index c6b731a84..afc0668a9 100644 --- a/src/extension/effect.cpp +++ b/src/extension/effect.cpp @@ -358,7 +358,7 @@ void Effect::EffectVerb::perform( SPAction *action, void * data, void */*pdata*/ ) { Inkscape::UI::View::View * current_view = sp_action_get_view(action); -// Document * current_document = current_view->doc; +// SPDocument * current_document = current_view->doc; Effect::EffectVerb * ev = reinterpret_cast(data); Effect * effect = ev->_effect; diff --git a/src/extension/effect.h b/src/extension/effect.h index 637d29c5c..c02ce542b 100644 --- a/src/extension/effect.h +++ b/src/extension/effect.h @@ -21,7 +21,7 @@ #include "prefdialog.h" #include "extension.h" -struct Document; +struct SPDocument; namespace Inkscape { namespace UI { diff --git a/src/extension/execution-env.cpp b/src/extension/execution-env.cpp index a87cc6b64..4a13890d7 100644 --- a/src/extension/execution-env.cpp +++ b/src/extension/execution-env.cpp @@ -179,7 +179,7 @@ ExecutionEnv::commit (void) { void ExecutionEnv::reselect (void) { if (_doc == NULL) { return; } - Document * doc = _doc->doc(); + SPDocument * doc = _doc->doc(); if (doc == NULL) { return; } SPDesktop *desktop = (SPDesktop *)_doc; diff --git a/src/extension/extension.cpp b/src/extension/extension.cpp index c8dc30d8b..52d5f5148 100644 --- a/src/extension/extension.cpp +++ b/src/extension/extension.cpp @@ -423,7 +423,7 @@ param_shared (const gchar * name, GSList * list) found parameter. */ const gchar * -Extension::get_param_string (const gchar * name, const Document * doc, const Inkscape::XML::Node * node) +Extension::get_param_string (const gchar * name, const SPDocument * doc, const Inkscape::XML::Node * node) { Parameter * param; @@ -432,7 +432,7 @@ Extension::get_param_string (const gchar * name, const Document * doc, const Ink } const gchar * -Extension::get_param_enum (const gchar * name, const Document * doc, const Inkscape::XML::Node * node) +Extension::get_param_enum (const gchar * name, const SPDocument * doc, const Inkscape::XML::Node * node) { Parameter* param = param_shared(name, parameters); return param->get_enum(doc, node); @@ -450,7 +450,7 @@ Extension::get_param_enum (const gchar * name, const Document * doc, const Inksc found parameter. */ bool -Extension::get_param_bool (const gchar * name, const Document * doc, const Inkscape::XML::Node * node) +Extension::get_param_bool (const gchar * name, const SPDocument * doc, const Inkscape::XML::Node * node) { Parameter * param; @@ -470,7 +470,7 @@ Extension::get_param_bool (const gchar * name, const Document * doc, const Inksc found parameter. */ int -Extension::get_param_int (const gchar * name, const Document * doc, const Inkscape::XML::Node * node) +Extension::get_param_int (const gchar * name, const SPDocument * doc, const Inkscape::XML::Node * node) { Parameter * param; @@ -490,7 +490,7 @@ Extension::get_param_int (const gchar * name, const Document * doc, const Inksca found parameter. */ float -Extension::get_param_float (const gchar * name, const Document * doc, const Inkscape::XML::Node * node) +Extension::get_param_float (const gchar * name, const SPDocument * doc, const Inkscape::XML::Node * node) { Parameter * param; param = param_shared(name, parameters); @@ -509,7 +509,7 @@ Extension::get_param_float (const gchar * name, const Document * doc, const Inks found parameter. */ guint32 -Extension::get_param_color (const gchar * name, const Document * doc, const Inkscape::XML::Node * node) +Extension::get_param_color (const gchar * name, const SPDocument * doc, const Inkscape::XML::Node * node) { Parameter* param = param_shared(name, parameters); return param->get_color(doc, node); @@ -528,7 +528,7 @@ Extension::get_param_color (const gchar * name, const Document * doc, const Inks found parameter. */ bool -Extension::set_param_bool (const gchar * name, bool value, Document * doc, Inkscape::XML::Node * node) +Extension::set_param_bool (const gchar * name, bool value, SPDocument * doc, Inkscape::XML::Node * node) { Parameter * param; param = param_shared(name, parameters); @@ -548,7 +548,7 @@ Extension::set_param_bool (const gchar * name, bool value, Document * doc, Inksc found parameter. */ int -Extension::set_param_int (const gchar * name, int value, Document * doc, Inkscape::XML::Node * node) +Extension::set_param_int (const gchar * name, int value, SPDocument * doc, Inkscape::XML::Node * node) { Parameter * param; param = param_shared(name, parameters); @@ -568,7 +568,7 @@ Extension::set_param_int (const gchar * name, int value, Document * doc, Inkscap found parameter. */ float -Extension::set_param_float (const gchar * name, float value, Document * doc, Inkscape::XML::Node * node) +Extension::set_param_float (const gchar * name, float value, SPDocument * doc, Inkscape::XML::Node * node) { Parameter * param; param = param_shared(name, parameters); @@ -588,7 +588,7 @@ Extension::set_param_float (const gchar * name, float value, Document * doc, Ink found parameter. */ const gchar * -Extension::set_param_string (const gchar * name, const gchar * value, Document * doc, Inkscape::XML::Node * node) +Extension::set_param_string (const gchar * name, const gchar * value, SPDocument * doc, Inkscape::XML::Node * node) { Parameter * param; param = param_shared(name, parameters); @@ -608,7 +608,7 @@ Extension::set_param_string (const gchar * name, const gchar * value, Document * found parameter. */ guint32 -Extension::set_param_color (const gchar * name, guint32 color, Document * doc, Inkscape::XML::Node * node) +Extension::set_param_color (const gchar * name, guint32 color, SPDocument * doc, Inkscape::XML::Node * node) { Parameter* param = param_shared(name, parameters); return param->set_color(color, doc, node); @@ -671,7 +671,7 @@ public: If all parameters are gui_visible = false NULL is returned as well. */ Gtk::Widget * -Extension::autogui (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +Extension::autogui (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (param_visible_count() == 0) return NULL; diff --git a/src/extension/extension.h b/src/extension/extension.h index 8dcd1b393..48ca86cf7 100644 --- a/src/extension/extension.h +++ b/src/extension/extension.h @@ -72,7 +72,7 @@ #define INKSCAPE_EXTENSION_NS_NC "extension" #define INKSCAPE_EXTENSION_NS "extension:" -struct Document; +struct SPDocument; namespace Inkscape { namespace Extension { @@ -173,42 +173,42 @@ private: #endif public: bool get_param_bool (const gchar * name, - const Document * doc = NULL, + const SPDocument * doc = NULL, const Inkscape::XML::Node * node = NULL); int get_param_int (const gchar * name, - const Document * doc = NULL, + const SPDocument * doc = NULL, const Inkscape::XML::Node * node = NULL); float get_param_float (const gchar * name, - const Document * doc = NULL, + const SPDocument * doc = NULL, const Inkscape::XML::Node * node = NULL); const gchar * get_param_string (const gchar * name, - const Document * doc = NULL, + const SPDocument * doc = NULL, const Inkscape::XML::Node * node = NULL); guint32 get_param_color (const gchar * name, - const Document * doc = NULL, + const SPDocument * doc = NULL, const Inkscape::XML::Node * node = NULL); const gchar * get_param_enum (const gchar * name, - const Document * doc = NULL, + const SPDocument * doc = NULL, const Inkscape::XML::Node * node = NULL); bool set_param_bool (const gchar * name, bool value, - Document * doc = NULL, + SPDocument * doc = NULL, Inkscape::XML::Node * node = NULL); int set_param_int (const gchar * name, int value, - Document * doc = NULL, + SPDocument * doc = NULL, Inkscape::XML::Node * node = NULL); float set_param_float (const gchar * name, float value, - Document * doc = NULL, + SPDocument * doc = NULL, Inkscape::XML::Node * node = NULL); const gchar * set_param_string (const gchar * name, const gchar * value, - Document * doc = NULL, + SPDocument * doc = NULL, Inkscape::XML::Node * node = NULL); guint32 set_param_color (const gchar * name, guint32 color, - Document * doc = NULL, + SPDocument * doc = NULL, Inkscape::XML::Node * node = NULL); /* Error file handling */ @@ -217,7 +217,7 @@ public: static void error_file_close (void); public: - Gtk::Widget * autogui (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal = NULL); + Gtk::Widget * autogui (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal = NULL); void paramListString (std::list & retlist); /* Extension editor dialog stuff */ diff --git a/src/extension/implementation/implementation.cpp b/src/extension/implementation/implementation.cpp index e3421b26d..6090b72d0 100644 --- a/src/extension/implementation/implementation.cpp +++ b/src/extension/implementation/implementation.cpp @@ -79,7 +79,7 @@ Implementation::prefs_input(Inkscape::Extension::Input *module, gchar const */*f return module->autogui(NULL, NULL); } /* Implementation::prefs_input */ -Document * +SPDocument * Implementation::open(Inkscape::Extension::Input */*module*/, gchar const */*filename*/) { /* throw open_failed(); */ return NULL; @@ -91,7 +91,7 @@ Implementation::prefs_output(Inkscape::Extension::Output *module) { } /* Implementation::prefs_output */ void -Implementation::save(Inkscape::Extension::Output */*module*/, Document */*doc*/, gchar const */*filename*/) { +Implementation::save(Inkscape::Extension::Output */*module*/, SPDocument */*doc*/, gchar const */*filename*/) { /* throw save_fail */ return; } /* Implementation::save */ @@ -100,7 +100,7 @@ Gtk::Widget * Implementation::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View * view, sigc::signal * changeSignal, ImplementationDocumentCache * docCache) { if (module->param_visible_count() == 0) return NULL; - Document * current_document = view->doc(); + SPDocument * current_document = view->doc(); using Inkscape::Util::GSListConstIterator; GSListConstIterator selected = @@ -134,7 +134,7 @@ Implementation::set_preview(Inkscape::Extension::Print */*module*/) unsigned int -Implementation::begin(Inkscape::Extension::Print */*module*/, Document */*doc*/) +Implementation::begin(Inkscape::Extension::Print */*module*/, SPDocument */*doc*/) { return 0; } diff --git a/src/extension/implementation/implementation.h b/src/extension/implementation/implementation.h index 9f1894d95..9de70dce7 100644 --- a/src/extension/implementation/implementation.h +++ b/src/extension/implementation/implementation.h @@ -70,13 +70,13 @@ public: virtual Gtk::Widget *prefs_input(Inkscape::Extension::Input *module, gchar const *filename); - virtual Document *open(Inkscape::Extension::Input *module, + virtual SPDocument *open(Inkscape::Extension::Input *module, gchar const *filename); /* ----- Output functions ----- */ /** Find out information about the file. */ virtual Gtk::Widget *prefs_output(Inkscape::Extension::Output *module); - virtual void save(Inkscape::Extension::Output *module, Document *doc, gchar const *filename); + virtual void save(Inkscape::Extension::Output *module, SPDocument *doc, gchar const *filename); /* ----- Effect functions ----- */ /** Find out information about the file. */ @@ -93,7 +93,7 @@ public: virtual unsigned set_preview(Inkscape::Extension::Print *module); virtual unsigned begin(Inkscape::Extension::Print *module, - Document *doc); + SPDocument *doc); virtual unsigned finish(Inkscape::Extension::Print *module); virtual bool textToPath(Inkscape::Extension::Print *ext); virtual bool fontEmbedded(Inkscape::Extension::Print * ext); diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index d207c1a19..e6ce40bc0 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -545,7 +545,7 @@ Script::prefs_output(Inkscape::Extension::Output *module) the incoming filename (so that it's not the temporary filename). That document is then returned from this function. */ -Document * +SPDocument * Script::open(Inkscape::Extension::Input *module, const gchar *filenameArg) { @@ -567,7 +567,7 @@ Script::open(Inkscape::Extension::Input *module, int data_read = execute(command, params, lfilename, fileout); fileout.toFile(tempfilename_out); - Document * mydoc = NULL; + SPDocument * mydoc = NULL; if (data_read > 10) { if (helper_extension.size()==0) { mydoc = Inkscape::Extension::open( @@ -623,7 +623,7 @@ Script::open(Inkscape::Extension::Input *module, */ void Script::save(Inkscape::Extension::Output *module, - Document *doc, + SPDocument *doc, const gchar *filenameArg) { std::list params; @@ -757,7 +757,7 @@ Script::effect(Inkscape::Extension::Effect *module, pump_events(); - Document * mydoc = NULL; + SPDocument * mydoc = NULL; if (data_read > 10) { mydoc = Inkscape::Extension::open( Inkscape::Extension::db.get(SP_MODULE_KEY_INPUT_SVG), diff --git a/src/extension/implementation/script.h b/src/extension/implementation/script.h index 0769c9a18..8e25fb351 100644 --- a/src/extension/implementation/script.h +++ b/src/extension/implementation/script.h @@ -73,7 +73,7 @@ public: /** * */ - virtual Document *open(Inkscape::Extension::Input *module, + virtual SPDocument *open(Inkscape::Extension::Input *module, gchar const *filename); /** @@ -85,7 +85,7 @@ public: * */ virtual void save(Inkscape::Extension::Output *module, - Document *doc, + SPDocument *doc, gchar const *filename); /** diff --git a/src/extension/implementation/xslt.cpp b/src/extension/implementation/xslt.cpp index 9eea2dbeb..f34fea64a 100644 --- a/src/extension/implementation/xslt.cpp +++ b/src/extension/implementation/xslt.cpp @@ -136,7 +136,7 @@ XSLT::unload(Inkscape::Extension::Extension *module) return; } -Document * +SPDocument * XSLT::open(Inkscape::Extension::Input */*module*/, gchar const *filename) { xmlDocPtr filein = xmlParseFile(filename); @@ -174,7 +174,7 @@ XSLT::open(Inkscape::Extension::Input */*module*/, gchar const *filename) } g_free(s); - Document * doc = sp_document_create(rdoc, filename, base, name, true); + SPDocument * doc = sp_document_create(rdoc, filename, base, name, true); g_free(base); g_free(name); @@ -182,7 +182,7 @@ XSLT::open(Inkscape::Extension::Input */*module*/, gchar const *filename) } void -XSLT::save(Inkscape::Extension::Output */*module*/, Document *doc, gchar const *filename) +XSLT::save(Inkscape::Extension::Output */*module*/, SPDocument *doc, gchar const *filename) { /* TODO: Should we assume filename to be in utf8 or to be a raw filename? * See JavaFXOutput::save for discussion. */ diff --git a/src/extension/implementation/xslt.h b/src/extension/implementation/xslt.h index df9467d9e..45befb529 100644 --- a/src/extension/implementation/xslt.h +++ b/src/extension/implementation/xslt.h @@ -44,9 +44,9 @@ public: bool check(Inkscape::Extension::Extension *module); - Document *open(Inkscape::Extension::Input *module, + SPDocument *open(Inkscape::Extension::Input *module, gchar const *filename); - void save(Inkscape::Extension::Output *module, Document *doc, gchar const *filename); + void save(Inkscape::Extension::Output *module, SPDocument *doc, gchar const *filename); }; } /* Inkscape */ diff --git a/src/extension/input.cpp b/src/extension/input.cpp index ca5fdc29f..689c1286f 100644 --- a/src/extension/input.cpp +++ b/src/extension/input.cpp @@ -145,7 +145,7 @@ Input::check (void) Adobe Illustrator file can be transparent (not recommended, but transparent). This is all done with undo being turned off. */ -Document * +SPDocument * Input::open (const gchar *uri) { if (!loaded()) { @@ -156,7 +156,7 @@ Input::open (const gchar *uri) } timer->touch(); - Document *const doc = imp->open(this, uri); + SPDocument *const doc = imp->open(this, uri); if (doc != NULL) { Inkscape::XML::Node * repr = sp_document_repr_root(doc); bool saved = sp_document_get_undo_sensitive(doc); diff --git a/src/extension/input.h b/src/extension/input.h index d2aac9376..55d807ce2 100644 --- a/src/extension/input.h +++ b/src/extension/input.h @@ -37,7 +37,7 @@ public: Implementation::Implementation * in_imp); virtual ~Input (void); virtual bool check (void); - Document * open (gchar const *uri); + SPDocument * open (gchar const *uri); gchar * get_mimetype (void); gchar * get_extension (void); gchar * get_filetypename (void); diff --git a/src/extension/internal/bitmap/imagemagick.cpp b/src/extension/internal/bitmap/imagemagick.cpp index 75d53927d..e907612fd 100644 --- a/src/extension/internal/bitmap/imagemagick.cpp +++ b/src/extension/internal/bitmap/imagemagick.cpp @@ -221,7 +221,7 @@ ImageMagick::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::Vi Gtk::Widget * ImageMagick::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View * view, sigc::signal * changeSignal, Inkscape::Extension::Implementation::ImplementationDocumentCache * /*docCache*/) { - Document * current_document = view->doc(); + SPDocument * current_document = view->doc(); using Inkscape::Util::GSListConstIterator; GSListConstIterator selected = sp_desktop_selection((SPDesktop *)view)->itemList(); diff --git a/src/extension/internal/cairo-png-out.cpp b/src/extension/internal/cairo-png-out.cpp index d849755b7..c81fdd029 100644 --- a/src/extension/internal/cairo-png-out.cpp +++ b/src/extension/internal/cairo-png-out.cpp @@ -48,7 +48,7 @@ CairoRendererOutput::check (Inkscape::Extension::Extension * module) } static bool -png_render_document_to_file(Document *doc, gchar const *filename) +png_render_document_to_file(SPDocument *doc, gchar const *filename) { CairoRenderer *renderer; CairoRenderContext *ctx; @@ -92,7 +92,7 @@ png_render_document_to_file(Document *doc, gchar const *filename) \param uri Filename to save to (probably will end in .png) */ void -CairoRendererOutput::save(Inkscape::Extension::Output *mod, Document *doc, gchar const *filename) +CairoRendererOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filename) { if (!png_render_document_to_file(doc, filename)) throw Inkscape::Extension::Output::save_failed(); diff --git a/src/extension/internal/cairo-png-out.h b/src/extension/internal/cairo-png-out.h index a062ec8df..9b9bd6ffe 100644 --- a/src/extension/internal/cairo-png-out.h +++ b/src/extension/internal/cairo-png-out.h @@ -27,7 +27,7 @@ class CairoRendererOutput : Inkscape::Extension::Implementation::Implementation public: bool check(Inkscape::Extension::Extension *module); void save(Inkscape::Extension::Output *mod, - Document *doc, + SPDocument *doc, gchar const *filename); static void init(); }; diff --git a/src/extension/internal/cairo-ps-out.cpp b/src/extension/internal/cairo-ps-out.cpp index d9cac666c..dff89c1ed 100644 --- a/src/extension/internal/cairo-ps-out.cpp +++ b/src/extension/internal/cairo-ps-out.cpp @@ -61,7 +61,7 @@ CairoEpsOutput::check (Inkscape::Extension::Extension * module) } static bool -ps_print_document_to_file(Document *doc, gchar const *filename, unsigned int level, bool texttopath, bool filtertobitmap, int resolution, const gchar * const exportId, bool exportDrawing, bool exportCanvas, bool eps = false) +ps_print_document_to_file(SPDocument *doc, gchar const *filename, unsigned int level, bool texttopath, bool filtertobitmap, int resolution, const gchar * const exportId, bool exportDrawing, bool exportCanvas, bool eps = false) { sp_document_ensure_up_to_date(doc); @@ -124,7 +124,7 @@ ps_print_document_to_file(Document *doc, gchar const *filename, unsigned int lev \param filename Filename to save to (probably will end in .ps) */ void -CairoPsOutput::save(Inkscape::Extension::Output *mod, Document *doc, gchar const *filename) +CairoPsOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filename) { Inkscape::Extension::Extension * ext; unsigned int ret; @@ -188,7 +188,7 @@ CairoPsOutput::save(Inkscape::Extension::Output *mod, Document *doc, gchar const \param filename Filename to save to (probably will end in .ps) */ void -CairoEpsOutput::save(Inkscape::Extension::Output *mod, Document *doc, gchar const *filename) +CairoEpsOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filename) { Inkscape::Extension::Extension * ext; unsigned int ret; diff --git a/src/extension/internal/cairo-ps-out.h b/src/extension/internal/cairo-ps-out.h index 862571f0b..019b6b810 100644 --- a/src/extension/internal/cairo-ps-out.h +++ b/src/extension/internal/cairo-ps-out.h @@ -28,7 +28,7 @@ class CairoPsOutput : Inkscape::Extension::Implementation::Implementation { public: bool check(Inkscape::Extension::Extension *module); void save(Inkscape::Extension::Output *mod, - Document *doc, + SPDocument *doc, gchar const *filename); static void init(); bool textToPath(Inkscape::Extension::Print *ext); @@ -40,7 +40,7 @@ class CairoEpsOutput : Inkscape::Extension::Implementation::Implementation { public: bool check(Inkscape::Extension::Extension *module); void save(Inkscape::Extension::Output *mod, - Document *doc, + SPDocument *doc, gchar const *uri); static void init(); bool textToPath(Inkscape::Extension::Print *ext); diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp index 28cf406f2..d1462e52e 100644 --- a/src/extension/internal/cairo-render-context.cpp +++ b/src/extension/internal/cairo-render-context.cpp @@ -811,7 +811,7 @@ CairoRenderContext::_finishSurfaceSetup(cairo_surface_t *surface, cairo_matrix_t cairo_scale(_cr, PT_PER_PX, PT_PER_PX); } else if (cairo_surface_get_content(_surface) != CAIRO_CONTENT_ALPHA) { // set background color on non-alpha surfaces - // TODO: bgcolor should be derived from Document + // TODO: bgcolor should be derived from SPDocument cairo_set_source_rgb(_cr, 1.0, 1.0, 1.0); cairo_rectangle(_cr, 0, 0, _width, _height); cairo_fill(_cr); diff --git a/src/extension/internal/cairo-renderer-pdf-out.cpp b/src/extension/internal/cairo-renderer-pdf-out.cpp index 1e5404c50..b44e83449 100644 --- a/src/extension/internal/cairo-renderer-pdf-out.cpp +++ b/src/extension/internal/cairo-renderer-pdf-out.cpp @@ -47,7 +47,7 @@ CairoRendererPdfOutput::check (Inkscape::Extension::Extension * module) } static bool -pdf_render_document_to_file(Document *doc, gchar const *filename, unsigned int level, +pdf_render_document_to_file(SPDocument *doc, gchar const *filename, unsigned int level, bool texttopath, bool filtertobitmap, int resolution, const gchar * const exportId, bool exportDrawing, bool exportCanvas) { @@ -118,7 +118,7 @@ pdf_render_document_to_file(Document *doc, gchar const *filename, unsigned int l tell the printing system to save to file. */ void -CairoRendererPdfOutput::save(Inkscape::Extension::Output *mod, Document *doc, gchar const *filename) +CairoRendererPdfOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filename) { Inkscape::Extension::Extension * ext; unsigned int ret; diff --git a/src/extension/internal/cairo-renderer-pdf-out.h b/src/extension/internal/cairo-renderer-pdf-out.h index f916eed49..d76ffb4d4 100644 --- a/src/extension/internal/cairo-renderer-pdf-out.h +++ b/src/extension/internal/cairo-renderer-pdf-out.h @@ -27,7 +27,7 @@ class CairoRendererPdfOutput : Inkscape::Extension::Implementation::Implementati public: bool check(Inkscape::Extension::Extension *module); void save(Inkscape::Extension::Output *mod, - Document *doc, + SPDocument *doc, gchar const *filename); static void init(); }; diff --git a/src/extension/internal/cairo-renderer.cpp b/src/extension/internal/cairo-renderer.cpp index 3414993e5..da88a5eae 100644 --- a/src/extension/internal/cairo-renderer.cpp +++ b/src/extension/internal/cairo-renderer.cpp @@ -460,7 +460,7 @@ static void sp_asbitmap_render(SPItem *item, CairoRenderContext *ctx) Geom::Matrix t = t_on_document * t_item.inverse(); // Do the export - Document *document = SP_OBJECT(item)->document; + SPDocument *document = SP_OBJECT(item)->document; GSList *items = NULL; items = g_slist_append(items, item); @@ -567,7 +567,7 @@ CairoRenderer::renderItem(CairoRenderContext *ctx, SPItem *item) } bool -CairoRenderer::setupDocument(CairoRenderContext *ctx, Document *doc, bool pageBoundingBox, SPItem *base) +CairoRenderer::setupDocument(CairoRenderContext *ctx, SPDocument *doc, bool pageBoundingBox, SPItem *base) { g_assert( ctx != NULL ); diff --git a/src/extension/internal/cairo-renderer.h b/src/extension/internal/cairo-renderer.h index 4197c6784..ab5d4cf58 100644 --- a/src/extension/internal/cairo-renderer.h +++ b/src/extension/internal/cairo-renderer.h @@ -50,9 +50,9 @@ public: void applyMask(CairoRenderContext *ctx, SPMask const *mask); /** Initializes the CairoRenderContext according to the specified - Document. A set*Target function can only be called on the context + SPDocument. A set*Target function can only be called on the context before setupDocument. */ - bool setupDocument(CairoRenderContext *ctx, Document *doc, bool pageBoundingBox, SPItem *base); + bool setupDocument(CairoRenderContext *ctx, SPDocument *doc, bool pageBoundingBox, SPItem *base); /** Traverses the object tree and invokes the render methods. */ void renderItem(CairoRenderContext *ctx, SPItem *item); diff --git a/src/extension/internal/emf-win32-inout.cpp b/src/extension/internal/emf-win32-inout.cpp index ffba5af81..f400a3649 100644 --- a/src/extension/internal/emf-win32-inout.cpp +++ b/src/extension/internal/emf-win32-inout.cpp @@ -101,7 +101,7 @@ EmfWin32::check (Inkscape::Extension::Extension * /*module*/) static void -emf_print_document_to_file(Document *doc, gchar const *filename) +emf_print_document_to_file(SPDocument *doc, gchar const *filename) { Inkscape::Extension::Print *mod; SPPrintContext context; @@ -147,7 +147,7 @@ emf_print_document_to_file(Document *doc, gchar const *filename) void -EmfWin32::save(Inkscape::Extension::Output *mod, Document *doc, gchar const *filename) +EmfWin32::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filename) { Inkscape::Extension::Extension * ext; @@ -2162,7 +2162,7 @@ typedef struct #pragma pack( pop ) -Document * +SPDocument * EmfWin32::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri ) { EMF_CALLBACK_DATA d; @@ -2365,7 +2365,7 @@ EmfWin32::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri ) // std::cout << "SVG Output: " << std::endl << *(d.outsvg) << std::endl; - Document *doc = sp_document_new_from_mem(d.outsvg->c_str(), d.outsvg->length(), TRUE); + SPDocument *doc = sp_document_new_from_mem(d.outsvg->c_str(), d.outsvg->length(), TRUE); delete d.outsvg; delete d.path; diff --git a/src/extension/internal/emf-win32-inout.h b/src/extension/internal/emf-win32-inout.h index 544cd75db..c62d7a4e9 100644 --- a/src/extension/internal/emf-win32-inout.h +++ b/src/extension/internal/emf-win32-inout.h @@ -28,10 +28,10 @@ public: bool check(Inkscape::Extension::Extension *module); //Can this module load (always yes for now) void save(Inkscape::Extension::Output *mod, // Save the given document to the given filename - Document *doc, + SPDocument *doc, gchar const *filename); - virtual Document *open( Inkscape::Extension::Input *mod, + virtual SPDocument *open( Inkscape::Extension::Input *mod, const gchar *uri ); static void init(void);//Initialize the class diff --git a/src/extension/internal/emf-win32-print.cpp b/src/extension/internal/emf-win32-print.cpp index 822a0577b..d098f6466 100644 --- a/src/extension/internal/emf-win32-print.cpp +++ b/src/extension/internal/emf-win32-print.cpp @@ -116,7 +116,7 @@ PrintEmfWin32::setup (Inkscape::Extension::Print * /*mod*/) unsigned int -PrintEmfWin32::begin (Inkscape::Extension::Print *mod, Document *doc) +PrintEmfWin32::begin (Inkscape::Extension::Print *mod, SPDocument *doc) { gchar const *utf8_fn = mod->get_param_string("destination"); diff --git a/src/extension/internal/emf-win32-print.h b/src/extension/internal/emf-win32-print.h index bec3f9582..5c1d8439d 100644 --- a/src/extension/internal/emf-win32-print.h +++ b/src/extension/internal/emf-win32-print.h @@ -55,7 +55,7 @@ public: /* Print functions */ virtual unsigned int setup (Inkscape::Extension::Print * module); - virtual unsigned int begin (Inkscape::Extension::Print * module, Document *doc); + virtual unsigned int begin (Inkscape::Extension::Print * module, SPDocument *doc); virtual unsigned int finish (Inkscape::Extension::Print * module); /* Rendering methods */ diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp index 2aea1cc64..64a099c8a 100644 --- a/src/extension/internal/gdkpixbuf-input.cpp +++ b/src/extension/internal/gdkpixbuf-input.cpp @@ -16,10 +16,10 @@ GdkPixbuf* pixbuf_new_from_file( char const *utf8name, GError **error ); namespace Extension { namespace Internal { -Document * +SPDocument * GdkpixbufInput::open(Inkscape::Extension::Input */*mod*/, char const *uri) { - Document *doc = NULL; + SPDocument *doc = NULL; GdkPixbuf *pb = Inkscape::IO::pixbuf_new_from_file( uri, NULL ); if (pb) { /* We are readable */ diff --git a/src/extension/internal/gdkpixbuf-input.h b/src/extension/internal/gdkpixbuf-input.h index 373d53da3..9d5e6ccf7 100644 --- a/src/extension/internal/gdkpixbuf-input.h +++ b/src/extension/internal/gdkpixbuf-input.h @@ -9,7 +9,7 @@ namespace Internal { class GdkpixbufInput : Inkscape::Extension::Implementation::Implementation { public: - Document *open(Inkscape::Extension::Input *mod, + SPDocument *open(Inkscape::Extension::Input *mod, gchar const *uri); static void init(); }; diff --git a/src/extension/internal/gimpgrad.cpp b/src/extension/internal/gimpgrad.cpp index 9510b5ebd..5b3e0c16e 100644 --- a/src/extension/internal/gimpgrad.cpp +++ b/src/extension/internal/gimpgrad.cpp @@ -95,7 +95,7 @@ stop_svg(ColorRGBA const in_color, double const location) } /** - \brief Actually open the gradient and turn it into an Document + \brief Actually open the gradient and turn it into an SPDocument \param module The input module being used \param filename The filename of the gradient to be opened \return A Document with the gradient in it. @@ -129,7 +129,7 @@ stop_svg(ColorRGBA const in_color, double const location) document using the \c sp_document_from_mem. That is then returned to Inkscape. */ -Document * +SPDocument * GimpGrad::open (Inkscape::Extension::Input */*module*/, gchar const *filename) { Inkscape::IO::dump_fopen_call(filename, "I"); diff --git a/src/extension/internal/gimpgrad.h b/src/extension/internal/gimpgrad.h index 21ccfa215..45b76dd6d 100644 --- a/src/extension/internal/gimpgrad.h +++ b/src/extension/internal/gimpgrad.h @@ -26,7 +26,7 @@ class GimpGrad : public Inkscape::Extension::Implementation::Implementation { public: bool load(Inkscape::Extension::Extension *module); void unload(Inkscape::Extension::Extension *module); - Document *open(Inkscape::Extension::Input *module, gchar const *filename); + SPDocument *open(Inkscape::Extension::Input *module, gchar const *filename); static void init(); }; diff --git a/src/extension/internal/grid.cpp b/src/extension/internal/grid.cpp index 5a0523ba8..d4b35b261 100644 --- a/src/extension/internal/grid.cpp +++ b/src/extension/internal/grid.cpp @@ -81,7 +81,7 @@ Grid::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View *doc Geom::Rect bounding_area = Geom::Rect(Geom::Point(0,0), Geom::Point(100,100)); if (selection->isEmpty()) { /* get page size */ - Document * doc = document->doc(); + SPDocument * doc = document->doc(); bounding_area = Geom::Rect( Geom::Point(0,0), Geom::Point(sp_document_width(doc), sp_document_height(doc)) ); } else { @@ -171,7 +171,7 @@ PrefAdjustment::val_changed (void) Gtk::Widget * Grid::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View * view, sigc::signal * changeSignal, Inkscape::Extension::Implementation::ImplementationDocumentCache * /*docCache*/) { - Document * current_document = view->doc(); + SPDocument * current_document = view->doc(); using Inkscape::Util::GSListConstIterator; GSListConstIterator selected = sp_desktop_selection((SPDesktop *)view)->itemList(); diff --git a/src/extension/internal/javafx-out.cpp b/src/extension/internal/javafx-out.cpp index c1f057071..417755e19 100644 --- a/src/extension/internal/javafx-out.cpp +++ b/src/extension/internal/javafx-out.cpp @@ -701,7 +701,7 @@ bool JavaFXOutput::doCurve(SPItem *item, const String &id) /** * Output the tree data to buffer */ -bool JavaFXOutput::doTreeRecursive(Document *doc, SPObject *obj) +bool JavaFXOutput::doTreeRecursive(SPDocument *doc, SPObject *obj) { /** * Check the type of node and process @@ -749,7 +749,7 @@ bool JavaFXOutput::doTreeRecursive(Document *doc, SPObject *obj) /** * Output the curve data to buffer */ -bool JavaFXOutput::doTree(Document *doc) +bool JavaFXOutput::doTree(SPDocument *doc) { double bignum = 1000000.0; @@ -767,7 +767,7 @@ bool JavaFXOutput::doTree(Document *doc) } -bool JavaFXOutput::doBody(Document *doc, SPObject *obj) +bool JavaFXOutput::doBody(SPDocument *doc, SPObject *obj) { /** * Check the type of node and process @@ -842,7 +842,7 @@ void JavaFXOutput::reset() /** * Saves the of an Inkscape SVG file as JavaFX spline definitions */ -bool JavaFXOutput::saveDocument(Document *doc, gchar const *filename_utf8) +bool JavaFXOutput::saveDocument(SPDocument *doc, gchar const *filename_utf8) { reset(); @@ -918,7 +918,7 @@ bool JavaFXOutput::saveDocument(Document *doc, gchar const *filename_utf8) */ void JavaFXOutput::save(Inkscape::Extension::Output */*mod*/, - Document *doc, gchar const *filename_utf8) + SPDocument *doc, gchar const *filename_utf8) { /* N.B. The name `filename_utf8' represents the fact that we want it to be in utf8; whereas in * fact we know that some callers of Extension::save pass something in the filesystem's diff --git a/src/extension/internal/javafx-out.h b/src/extension/internal/javafx-out.h index 246172c23..9c1c8778b 100644 --- a/src/extension/internal/javafx-out.h +++ b/src/extension/internal/javafx-out.h @@ -56,7 +56,7 @@ public: * API call to perform the output to a file */ virtual void save(Inkscape::Extension::Output *mod, - Document *doc, gchar const *filename); + SPDocument *doc, gchar const *filename); /** * Inkscape runtime startup call. @@ -109,10 +109,10 @@ private: * Output the SVG document's curve data as JavaFX geometry types */ bool doCurve(SPItem *item, const String &id); - bool doTreeRecursive(Document *doc, SPObject *obj); - bool doTree(Document *doc); + bool doTreeRecursive(SPDocument *doc, SPObject *obj); + bool doTree(SPDocument *doc); - bool doBody(Document *doc, SPObject *obj); + bool doBody(SPDocument *doc, SPObject *obj); /** * Output the file footer @@ -124,7 +124,7 @@ private: /** * Actual method to save document */ - bool saveDocument(Document *doc, gchar const *filename); + bool saveDocument(SPDocument *doc, gchar const *filename); //For statistics int nrNodes; diff --git a/src/extension/internal/latex-pstricks-out.cpp b/src/extension/internal/latex-pstricks-out.cpp index 924f9697e..4a469a750 100644 --- a/src/extension/internal/latex-pstricks-out.cpp +++ b/src/extension/internal/latex-pstricks-out.cpp @@ -47,7 +47,7 @@ LatexOutput::check (Inkscape::Extension::Extension * module) void -LatexOutput::save(Inkscape::Extension::Output *mod2, Document *doc, gchar const *filename) +LatexOutput::save(Inkscape::Extension::Output *mod2, SPDocument *doc, gchar const *filename) { Inkscape::Extension::Print *mod; SPPrintContext context; diff --git a/src/extension/internal/latex-pstricks-out.h b/src/extension/internal/latex-pstricks-out.h index a9910f4cc..a12cdc3c1 100644 --- a/src/extension/internal/latex-pstricks-out.h +++ b/src/extension/internal/latex-pstricks-out.h @@ -27,7 +27,7 @@ public: bool check(Inkscape::Extension::Extension *module); //Can this module load (always yes for now) void save(Inkscape::Extension::Output *mod, // Save the given document to the given filename - Document *doc, + SPDocument *doc, gchar const *filename); static void init(void);//Initialize the class diff --git a/src/extension/internal/latex-pstricks.cpp b/src/extension/internal/latex-pstricks.cpp index afc985e14..789e5ea34 100644 --- a/src/extension/internal/latex-pstricks.cpp +++ b/src/extension/internal/latex-pstricks.cpp @@ -64,7 +64,7 @@ PrintLatex::setup (Inkscape::Extension::Print *mod) } unsigned int -PrintLatex::begin (Inkscape::Extension::Print *mod, Document *doc) +PrintLatex::begin (Inkscape::Extension::Print *mod, SPDocument *doc) { Inkscape::SVGOStringStream os; int res; diff --git a/src/extension/internal/latex-pstricks.h b/src/extension/internal/latex-pstricks.h index 4e310d6fd..a33e169e8 100644 --- a/src/extension/internal/latex-pstricks.h +++ b/src/extension/internal/latex-pstricks.h @@ -43,7 +43,7 @@ public: /* Print functions */ virtual unsigned int setup (Inkscape::Extension::Print * module); - virtual unsigned int begin (Inkscape::Extension::Print * module, Document *doc); + virtual unsigned int begin (Inkscape::Extension::Print * module, SPDocument *doc); virtual unsigned int finish (Inkscape::Extension::Print * module); /* Rendering methods */ diff --git a/src/extension/internal/odf.cpp b/src/extension/internal/odf.cpp index e7e22414a..cc8489302 100644 --- a/src/extension/internal/odf.cpp +++ b/src/extension/internal/odf.cpp @@ -2367,7 +2367,7 @@ OdfOutput::reset() * Descends into the SVG tree, mapping things to ODF when appropriate */ void -OdfOutput::save(Inkscape::Extension::Output */*mod*/, Document *doc, gchar const *filename) +OdfOutput::save(Inkscape::Extension::Output */*mod*/, SPDocument *doc, gchar const *filename) { reset(); diff --git a/src/extension/internal/odf.h b/src/extension/internal/odf.h index 5ad1f1137..3854ddfe1 100644 --- a/src/extension/internal/odf.h +++ b/src/extension/internal/odf.h @@ -272,7 +272,7 @@ public: bool check (Inkscape::Extension::Extension * module); void save (Inkscape::Extension::Output *mod, - Document *doc, + SPDocument *doc, gchar const *filename); static void init (void); diff --git a/src/extension/internal/pdf-input-cairo.cpp b/src/extension/internal/pdf-input-cairo.cpp index 76759259d..937fefb11 100644 --- a/src/extension/internal/pdf-input-cairo.cpp +++ b/src/extension/internal/pdf-input-cairo.cpp @@ -32,7 +32,7 @@ namespace Internal { static cairo_status_t _write_ustring_cb(void *closure, const unsigned char *data, unsigned int length); -Document * +SPDocument * PdfInputCairo::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri) { printf("Attempting to open using PdfInputCairo\n"); @@ -58,7 +58,7 @@ PdfInputCairo::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri) { cairo_destroy(cr); cairo_surface_destroy(surface); - Document * doc = sp_document_new_from_mem(output->c_str(), output->length(), TRUE); + SPDocument * doc = sp_document_new_from_mem(output->c_str(), output->length(), TRUE); delete output; g_object_unref(page); diff --git a/src/extension/internal/pdf-input-cairo.h b/src/extension/internal/pdf-input-cairo.h index 15080bc14..5715b57c9 100644 --- a/src/extension/internal/pdf-input-cairo.h +++ b/src/extension/internal/pdf-input-cairo.h @@ -27,7 +27,7 @@ namespace Internal { class PdfInputCairo: public Inkscape::Extension::Implementation::Implementation { PdfInputCairo () { }; public: - Document *open( Inkscape::Extension::Input *mod, + SPDocument *open( Inkscape::Extension::Input *mod, const gchar *uri ); static void init( void ); diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp index 476f0daf6..c2d417f2c 100644 --- a/src/extension/internal/pdfinput/pdf-input.cpp +++ b/src/extension/internal/pdfinput/pdf-input.cpp @@ -589,7 +589,7 @@ void PdfImportDialog::_setPreviewPage(int page) { /** * Parses the selected page of the given PDF document using PdfParser. */ -Document * +SPDocument * PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) { // Initialize the globalParams variable for poppler @@ -661,7 +661,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) { Catalog *catalog = pdf_doc->getCatalog(); Page *page = catalog->getPage(page_num); - Document *doc = sp_document_new(NULL, TRUE, TRUE); + SPDocument *doc = sp_document_new(NULL, TRUE, TRUE); bool saved = sp_document_get_undo_sensitive(doc); sp_document_set_undo_sensitive(doc, false); // No need to undo in this temporary document diff --git a/src/extension/internal/pdfinput/pdf-input.h b/src/extension/internal/pdfinput/pdf-input.h index 968114ef3..6bf0f11a2 100644 --- a/src/extension/internal/pdfinput/pdf-input.h +++ b/src/extension/internal/pdfinput/pdf-input.h @@ -113,7 +113,7 @@ private: class PdfInput: public Inkscape::Extension::Implementation::Implementation { PdfInput () { }; public: - Document *open( Inkscape::Extension::Input *mod, + SPDocument *open( Inkscape::Extension::Input *mod, const gchar *uri ); static void init( void ); diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp index 686e44bb1..00bd8fa4d 100644 --- a/src/extension/internal/pdfinput/svg-builder.cpp +++ b/src/extension/internal/pdfinput/svg-builder.cpp @@ -77,7 +77,7 @@ struct SvgTransparencyGroup { * */ -SvgBuilder::SvgBuilder(Document *document, gchar *docname, XRef *xref) { +SvgBuilder::SvgBuilder(SPDocument *document, gchar *docname, XRef *xref) { _is_top_level = true; _doc = document; _docname = docname; diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h index 1f84ffcc3..3b9192d31 100644 --- a/src/extension/internal/pdfinput/svg-builder.h +++ b/src/extension/internal/pdfinput/svg-builder.h @@ -18,7 +18,7 @@ #ifdef HAVE_POPPLER -class Document; +class SPDocument; namespace Inkscape { namespace XML { class Document; @@ -95,7 +95,7 @@ struct SvgGlyph { */ class SvgBuilder { public: - SvgBuilder(Document *document, gchar *docname, XRef *xref); + SvgBuilder(SPDocument *document, gchar *docname, XRef *xref); SvgBuilder(SvgBuilder *parent, Inkscape::XML::Node *root); virtual ~SvgBuilder(); @@ -220,7 +220,7 @@ private: std::vector _availableFontNames; // Full names, used for matching font names (Bug LP #179589). bool _is_top_level; // Whether this SvgBuilder is the top-level one - Document *_doc; + SPDocument *_doc; gchar *_docname; // Basename of the URI from which this document is created XRef *_xref; // Cross-reference table from the PDF doc we're converting from Inkscape::XML::Document *_xml_doc; diff --git a/src/extension/internal/pov-out.cpp b/src/extension/internal/pov-out.cpp index d3ed39d1f..f30cbc317 100644 --- a/src/extension/internal/pov-out.cpp +++ b/src/extension/internal/pov-out.cpp @@ -417,7 +417,7 @@ bool PovOutput::doCurve(SPItem *item, const String &id) /** * Descend the svg tree recursively, translating data */ -bool PovOutput::doTreeRecursive(Document *doc, SPObject *obj) +bool PovOutput::doTreeRecursive(SPDocument *doc, SPObject *obj) { String id; @@ -454,7 +454,7 @@ bool PovOutput::doTreeRecursive(Document *doc, SPObject *obj) /** * Output the curve data to buffer */ -bool PovOutput::doTree(Document *doc) +bool PovOutput::doTree(SPDocument *doc) { double bignum = 1000000.0; minx = bignum; @@ -576,7 +576,7 @@ void PovOutput::reset() /** * Saves the Shapes of an Inkscape SVG file as PovRay spline definitions */ -void PovOutput::saveDocument(Document *doc, gchar const *filename_utf8) +void PovOutput::saveDocument(SPDocument *doc, gchar const *filename_utf8) { reset(); @@ -641,7 +641,7 @@ void PovOutput::saveDocument(Document *doc, gchar const *filename_utf8) */ void PovOutput::save(Inkscape::Extension::Output */*mod*/, - Document *doc, gchar const *filename_utf8) + SPDocument *doc, gchar const *filename_utf8) { /* See comments in JavaFSOutput::save re the name `filename_utf8'. */ saveDocument(doc, filename_utf8); diff --git a/src/extension/internal/pov-out.h b/src/extension/internal/pov-out.h index 02ba6da82..0c3b73a7f 100644 --- a/src/extension/internal/pov-out.h +++ b/src/extension/internal/pov-out.h @@ -57,7 +57,7 @@ public: * API call to perform the output to a file */ void save(Inkscape::Extension::Output *mod, - Document *doc, gchar const *filename); + SPDocument *doc, gchar const *filename); /** * Inkscape runtime startup call. @@ -120,13 +120,13 @@ private: * Output the SVG document's curve data as POV curves */ bool doCurve(SPItem *item, const String &id); - bool doTreeRecursive(Document *doc, SPObject *obj); - bool doTree(Document *doc); + bool doTreeRecursive(SPDocument *doc, SPObject *obj); + bool doTree(SPDocument *doc); /** * Actual method to save document */ - void saveDocument(Document *doc, gchar const *filename); + void saveDocument(SPDocument *doc, gchar const *filename); /** diff --git a/src/extension/internal/svg.cpp b/src/extension/internal/svg.cpp index 317811088..a3589e905 100644 --- a/src/extension/internal/svg.cpp +++ b/src/extension/internal/svg.cpp @@ -138,13 +138,13 @@ _load_uri (const gchar *uri) /** \return A new document just for you! \brief This function takes in a filename of a SVG document and - turns it into a Document. + turns it into a SPDocument. \param mod Module to use \param uri The path to the file (UTF-8) This function is really simple, it just calls sp_document_new... */ -Document * +SPDocument * Svg::open (Inkscape::Extension::Input */*mod*/, const gchar *uri) { #ifdef WITH_GNOME_VFS @@ -157,7 +157,7 @@ Svg::open (Inkscape::Extension::Input */*mod*/, const gchar *uri) g_warning("Error: Could not open file '%s' with VFS\n", uri); return NULL; } - Document * doc = sp_document_new_from_mem(buffer, strlen(buffer), 1); + SPDocument * doc = sp_document_new_from_mem(buffer, strlen(buffer), 1); g_free(buffer); return doc; @@ -191,7 +191,7 @@ Svg::open (Inkscape::Extension::Input */*mod*/, const gchar *uri) all of this code. I just stole it. */ void -Svg::save(Inkscape::Extension::Output *mod, Document *doc, gchar const *filename) +Svg::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filename) { g_return_if_fail(doc != NULL); g_return_if_fail(filename != NULL); diff --git a/src/extension/internal/svg.h b/src/extension/internal/svg.h index 48b57c8c5..b97735dd8 100644 --- a/src/extension/internal/svg.h +++ b/src/extension/internal/svg.h @@ -25,9 +25,9 @@ class Svg : public Inkscape::Extension::Implementation::Implementation { public: virtual void save( Inkscape::Extension::Output *mod, - Document *doc, + SPDocument *doc, gchar const *filename ); - virtual Document *open( Inkscape::Extension::Input *mod, + virtual SPDocument *open( Inkscape::Extension::Input *mod, const gchar *uri ); static void init( void ); diff --git a/src/extension/internal/win32.cpp b/src/extension/internal/win32.cpp index f272292b5..21f278858 100644 --- a/src/extension/internal/win32.cpp +++ b/src/extension/internal/win32.cpp @@ -215,7 +215,7 @@ PrintWin32::setup (Inkscape::Extension::Print *mod) } unsigned int -PrintWin32::begin (Inkscape::Extension::Print *mod, Document *doc) +PrintWin32::begin (Inkscape::Extension::Print *mod, SPDocument *doc) { DOCINFO di = { sizeof (DOCINFO), diff --git a/src/extension/internal/win32.h b/src/extension/internal/win32.h index 7f4b9352d..9462115c6 100644 --- a/src/extension/internal/win32.h +++ b/src/extension/internal/win32.h @@ -65,7 +65,7 @@ public: virtual unsigned int setup (Inkscape::Extension::Print * module); //virtual unsigned int set_preview (Inkscape::Extension::Print * module); - virtual unsigned int begin (Inkscape::Extension::Print * module, Document *doc); + virtual unsigned int begin (Inkscape::Extension::Print * module, SPDocument *doc); virtual unsigned int finish (Inkscape::Extension::Print * module); /* Rendering methods */ diff --git a/src/extension/internal/wpg-input.cpp b/src/extension/internal/wpg-input.cpp index e7177e5e3..c37d5705b 100644 --- a/src/extension/internal/wpg-input.cpp +++ b/src/extension/internal/wpg-input.cpp @@ -59,7 +59,7 @@ namespace Extension { namespace Internal { -Document * +SPDocument * WpgInput::open(Inkscape::Extension::Input * mod, const gchar * uri) { WPXInputStream* input = new libwpg::WPGFileStream(uri); if (input->isOLEStream()) { @@ -86,7 +86,7 @@ WpgInput::open(Inkscape::Extension::Input * mod, const gchar * uri) { //printf("I've got a doc: \n%s", painter.document.c_str()); - Document * doc = sp_document_new_from_mem(output.cstr(), strlen(output.cstr()), TRUE); + SPDocument * doc = sp_document_new_from_mem(output.cstr(), strlen(output.cstr()), TRUE); delete input; return doc; } diff --git a/src/extension/internal/wpg-input.h b/src/extension/internal/wpg-input.h index e5c2838d5..ca882039b 100644 --- a/src/extension/internal/wpg-input.h +++ b/src/extension/internal/wpg-input.h @@ -24,7 +24,7 @@ namespace Internal { class WpgInput : public Inkscape::Extension::Implementation::Implementation { WpgInput () { }; public: - Document *open( Inkscape::Extension::Input *mod, + SPDocument *open( Inkscape::Extension::Input *mod, const gchar *uri ); static void init( void ); diff --git a/src/extension/output.cpp b/src/extension/output.cpp index 8e2fa5486..742e938de 100644 --- a/src/extension/output.cpp +++ b/src/extension/output.cpp @@ -212,7 +212,7 @@ Output::prefs (void) could be changed, and old files will still work properly. */ void -Output::save(Document *doc, gchar const *filename) +Output::save(SPDocument *doc, gchar const *filename) { try { imp->save(this, doc, filename); diff --git a/src/extension/output.h b/src/extension/output.h index 455b4a8ae..b52a96211 100644 --- a/src/extension/output.h +++ b/src/extension/output.h @@ -15,7 +15,7 @@ #include #include "extension.h" -struct Document; +struct SPDocument; namespace Inkscape { namespace Extension { @@ -36,7 +36,7 @@ public: Implementation::Implementation * in_imp); virtual ~Output (void); virtual bool check (void); - void save (Document *doc, + void save (SPDocument *doc, gchar const *uri); bool prefs (void); gchar * get_mimetype(void); diff --git a/src/extension/param/bool.cpp b/src/extension/param/bool.cpp index 07170587a..1dda3d73f 100644 --- a/src/extension/param/bool.cpp +++ b/src/extension/param/bool.cpp @@ -53,7 +53,7 @@ ParamBool::ParamBool (const gchar * name, const gchar * guitext, const gchar * d and \c pref_name() are used. */ bool -ParamBool::set( bool in, Document * /*doc*/, Inkscape::XML::Node * /*node*/ ) +ParamBool::set( bool in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/ ) { _value = in; @@ -67,7 +67,7 @@ ParamBool::set( bool in, Document * /*doc*/, Inkscape::XML::Node * /*node*/ ) /** \brief Returns \c _value */ bool -ParamBool::get (const Document * doc, const Inkscape::XML::Node * node) +ParamBool::get (const SPDocument * doc, const Inkscape::XML::Node * node) { return _value; } @@ -79,7 +79,7 @@ class ParamBoolCheckButton : public Gtk::CheckButton { private: /** \brief Param to change */ ParamBool * _pref; - Document * _doc; + SPDocument * _doc; Inkscape::XML::Node * _node; sigc::signal * _changeSignal; public: @@ -89,7 +89,7 @@ public: This function sets the value of the checkbox to be that of the parameter, and then sets up a callback to \c on_toggle. */ - ParamBoolCheckButton (ParamBool * param, Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : + ParamBoolCheckButton (ParamBool * param, SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : Gtk::CheckButton(), _pref(param), _doc(doc), _node(node), _changeSignal(changeSignal) { this->set_active(_pref->get(NULL, NULL) /**\todo fix */); this->signal_toggled().connect(sigc::mem_fun(this, &ParamBoolCheckButton::on_toggle)); @@ -132,7 +132,7 @@ ParamBool::string (std::string &string) Builds a hbox with a label and a check button in it. */ Gtk::Widget * -ParamBool::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamBool::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4)); diff --git a/src/extension/param/bool.h b/src/extension/param/bool.h index 23b15596d..a1cd4ce4a 100644 --- a/src/extension/param/bool.h +++ b/src/extension/param/bool.h @@ -22,9 +22,9 @@ private: bool _value; public: ParamBool(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); - bool get (const Document * doc, const Inkscape::XML::Node * node); - bool set (bool in, Document * doc, Inkscape::XML::Node * node); - Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + bool get (const SPDocument * doc, const Inkscape::XML::Node * node); + bool set (bool in, SPDocument * doc, Inkscape::XML::Node * node); + Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::string &string); }; diff --git a/src/extension/param/color.cpp b/src/extension/param/color.cpp index 080356e71..58db85748 100644 --- a/src/extension/param/color.cpp +++ b/src/extension/param/color.cpp @@ -41,7 +41,7 @@ ParamColor::~ParamColor(void) } guint32 -ParamColor::set( guint32 in, Document * /*doc*/, Inkscape::XML::Node * /*node*/ ) +ParamColor::set( guint32 in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/ ) { _value = in; @@ -87,7 +87,7 @@ ParamColor::string (std::string &string) } Gtk::Widget * -ParamColor::get_widget( Document * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal * changeSignal ) +ParamColor::get_widget( SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal * changeSignal ) { if (_gui_hidden) return NULL; diff --git a/src/extension/param/color.h b/src/extension/param/color.h index 89aac7be7..e6b44fbcb 100644 --- a/src/extension/param/color.h +++ b/src/extension/param/color.h @@ -23,9 +23,9 @@ public: ParamColor(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); virtual ~ParamColor(void); /** \brief Returns \c _value, with a \i const to protect it. */ - guint32 get( const Document * /*doc*/, const Inkscape::XML::Node * /*node*/ ) { return _value; } - guint32 set (guint32 in, Document * doc, Inkscape::XML::Node * node); - Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + guint32 get( const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/ ) { return _value; } + guint32 set (guint32 in, SPDocument * doc, Inkscape::XML::Node * node); + Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::string &string); sigc::signal * _changeSignal; }; /* class ParamColor */ diff --git a/src/extension/param/description.cpp b/src/extension/param/description.cpp index 3641695cc..656e58c49 100644 --- a/src/extension/param/description.cpp +++ b/src/extension/param/description.cpp @@ -46,7 +46,7 @@ ParamDescription::ParamDescription (const gchar * name, const gchar * guitext, c /** \brief Create a label for the description */ Gtk::Widget * -ParamDescription::get_widget (Document * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal * /*changeSignal*/) +ParamDescription::get_widget (SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal * /*changeSignal*/) { if (_gui_hidden) return NULL; diff --git a/src/extension/param/description.h b/src/extension/param/description.h index 42441e5a9..c305ea6df 100644 --- a/src/extension/param/description.h +++ b/src/extension/param/description.h @@ -23,7 +23,7 @@ private: gchar * _value; public: ParamDescription(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); - Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); }; } /* namespace Extension */ diff --git a/src/extension/param/enum.cpp b/src/extension/param/enum.cpp index 9de3f60dd..03c1f839b 100644 --- a/src/extension/param/enum.cpp +++ b/src/extension/param/enum.cpp @@ -129,7 +129,7 @@ ParamComboBox::~ParamComboBox (void) the passed in value is duplicated using \c g_strdup(). */ const gchar * -ParamComboBox::set (const gchar * in, Document * /*doc*/, Inkscape::XML::Node * /*node*/) +ParamComboBox::set (const gchar * in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/) { if (in == NULL) return NULL; /* Can't have NULL string */ @@ -177,7 +177,7 @@ ParamComboBox::string (std::string &string) class ParamComboBoxEntry : public Gtk::ComboBoxText { private: ParamComboBox * _pref; - Document * _doc; + SPDocument * _doc; Inkscape::XML::Node * _node; sigc::signal * _changeSignal; public: @@ -185,7 +185,7 @@ public: \param pref Where to get the string from, and where to put it when it changes. */ - ParamComboBoxEntry (ParamComboBox * pref, Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : + ParamComboBoxEntry (ParamComboBox * pref, SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : Gtk::ComboBoxText(), _pref(pref), _doc(doc), _node(node), _changeSignal(changeSignal) { this->signal_changed().connect(sigc::mem_fun(this, &ParamComboBoxEntry::changed)); }; @@ -211,7 +211,7 @@ ParamComboBoxEntry::changed (void) \brief Creates a combobox widget for an enumeration parameter */ Gtk::Widget * -ParamComboBox::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamComboBox::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; diff --git a/src/extension/param/enum.h b/src/extension/param/enum.h index e1af8fd2b..3f9707c34 100644 --- a/src/extension/param/enum.h +++ b/src/extension/param/enum.h @@ -39,11 +39,11 @@ private: public: ParamComboBox(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); virtual ~ParamComboBox(void); - Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::string &string); - const gchar * get (const Document * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } - const gchar * set (const gchar * in, Document * doc, Inkscape::XML::Node * node); + const gchar * get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } + const gchar * set (const gchar * in, SPDocument * doc, Inkscape::XML::Node * node); void changed (void); }; /* class ParamComboBox */ diff --git a/src/extension/param/float.cpp b/src/extension/param/float.cpp index 516249c3c..11e3a8d97 100644 --- a/src/extension/param/float.cpp +++ b/src/extension/param/float.cpp @@ -75,7 +75,7 @@ ParamFloat::ParamFloat (const gchar * name, const gchar * guitext, const gchar * and \c pref_name() are used. */ float -ParamFloat::set (float in, Document * /*doc*/, Inkscape::XML::Node * /*node*/) +ParamFloat::set (float in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/) { _value = in; if (_value > _max) _value = _max; @@ -103,13 +103,13 @@ ParamFloat::string (std::string &string) class ParamFloatAdjustment : public Gtk::Adjustment { /** The parameter to adjust */ ParamFloat * _pref; - Document * _doc; + SPDocument * _doc; Inkscape::XML::Node * _node; sigc::signal * _changeSignal; public: /** \brief Make the adjustment using an extension and the string describing the parameter. */ - ParamFloatAdjustment (ParamFloat * param, Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : + ParamFloatAdjustment (ParamFloat * param, SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : Gtk::Adjustment(0.0, param->min(), param->max(), 0.1, 0), _pref(param), _doc(doc), _node(node), _changeSignal(changeSignal) { this->set_value(_pref->get(NULL, NULL) /* \todo fix */); this->signal_value_changed().connect(sigc::mem_fun(this, &ParamFloatAdjustment::val_changed)); @@ -142,7 +142,7 @@ ParamFloatAdjustment::val_changed (void) Builds a hbox with a label and a float adjustment in it. */ Gtk::Widget * -ParamFloat::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamFloat::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; diff --git a/src/extension/param/float.h b/src/extension/param/float.h index 32ab7a796..f105d8f0e 100644 --- a/src/extension/param/float.h +++ b/src/extension/param/float.h @@ -26,12 +26,12 @@ private: public: ParamFloat (const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); /** \brief Returns \c _value */ - float get (const Document * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } - float set (float in, Document * doc, Inkscape::XML::Node * node); + float get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } + float set (float in, SPDocument * doc, Inkscape::XML::Node * node); float max (void) { return _max; } float min (void) { return _min; } float precision (void) { return _precision; } - Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::string &string); }; diff --git a/src/extension/param/int.cpp b/src/extension/param/int.cpp index 2818bb57b..301d54ed0 100644 --- a/src/extension/param/int.cpp +++ b/src/extension/param/int.cpp @@ -70,7 +70,7 @@ ParamInt::ParamInt (const gchar * name, const gchar * guitext, const gchar * des and \c pref_name() are used. */ int -ParamInt::set (int in, Document * /*doc*/, Inkscape::XML::Node * /*node*/) +ParamInt::set (int in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/) { _value = in; if (_value > _max) _value = _max; @@ -88,13 +88,13 @@ ParamInt::set (int in, Document * /*doc*/, Inkscape::XML::Node * /*node*/) class ParamIntAdjustment : public Gtk::Adjustment { /** The parameter to adjust */ ParamInt * _pref; - Document * _doc; + SPDocument * _doc; Inkscape::XML::Node * _node; sigc::signal * _changeSignal; public: /** \brief Make the adjustment using an extension and the string describing the parameter. */ - ParamIntAdjustment (ParamInt * param, Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : + ParamIntAdjustment (ParamInt * param, SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : Gtk::Adjustment(0.0, param->min(), param->max(), 1.0, 0), _pref(param), _doc(doc), _node(node), _changeSignal(changeSignal) { this->set_value(_pref->get(NULL, NULL) /* \todo fix */); this->signal_value_changed().connect(sigc::mem_fun(this, &ParamIntAdjustment::val_changed)); @@ -127,7 +127,7 @@ ParamIntAdjustment::val_changed (void) Builds a hbox with a label and a int adjustment in it. */ Gtk::Widget * -ParamInt::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamInt::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; diff --git a/src/extension/param/int.h b/src/extension/param/int.h index 6d44a10b3..a4eb54c81 100644 --- a/src/extension/param/int.h +++ b/src/extension/param/int.h @@ -25,11 +25,11 @@ private: public: ParamInt (const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); /** \brief Returns \c _value */ - int get (const Document * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } - int set (int in, Document * doc, Inkscape::XML::Node * node); + int get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } + int set (int in, SPDocument * doc, Inkscape::XML::Node * node); int max (void) { return _max; } int min (void) { return _min; } - Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::string &string); }; diff --git a/src/extension/param/notebook.cpp b/src/extension/param/notebook.cpp index 6ad338ffa..1c30b7e0e 100644 --- a/src/extension/param/notebook.cpp +++ b/src/extension/param/notebook.cpp @@ -54,7 +54,7 @@ public: ParamNotebookPage(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); ~ParamNotebookPage(void); - Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void paramString (std::list &list); gchar * get_guitext (void) {return _text;}; @@ -196,7 +196,7 @@ ParamNotebookPage::makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension: Builds a notebook page (a vbox) and puts parameters on it. */ Gtk::Widget * -ParamNotebookPage::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamNotebookPage::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; @@ -295,7 +295,7 @@ ParamNotebook::~ParamNotebook (void) the passed in value is duplicated using \c g_strdup(). */ const gchar * -ParamNotebook::set (const int in, Document * /*doc*/, Inkscape::XML::Node * /*node*/) +ParamNotebook::set (const int in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/) { ParamNotebookPage * page = NULL; int i = 0; @@ -347,14 +347,14 @@ ParamNotebook::string (std::list &list) class ParamNotebookWdg : public Gtk::Notebook { private: ParamNotebook * _pref; - Document * _doc; + SPDocument * _doc; Inkscape::XML::Node * _node; public: /** \brief Build a notebookpage preference for the given parameter \param pref Where to get the string (pagename) from, and where to put it when it changes. */ - ParamNotebookWdg (ParamNotebook * pref, Document * doc, Inkscape::XML::Node * node) : + ParamNotebookWdg (ParamNotebook * pref, SPDocument * doc, Inkscape::XML::Node * node) : Gtk::Notebook(), _pref(pref), _doc(doc), _node(node), activated(false) { // don't have to set the correct page: this is done in ParamNotebook::get_widget. // hook function @@ -389,7 +389,7 @@ ParamNotebookWdg::changed_page(GtkNotebookPage */*page*/, Builds a notebook and puts pages in it. */ Gtk::Widget * -ParamNotebook::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamNotebook::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; diff --git a/src/extension/param/notebook.h b/src/extension/param/notebook.h index 6efd3c5f1..24d4ebfc1 100644 --- a/src/extension/param/notebook.h +++ b/src/extension/param/notebook.h @@ -40,11 +40,11 @@ private: public: ParamNotebook(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); virtual ~ParamNotebook(void); - Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::list &list); - const gchar * get (const Document * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } - const gchar * set (const int in, Document * doc, Inkscape::XML::Node * node); + const gchar * get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } + const gchar * set (const int in, SPDocument * doc, Inkscape::XML::Node * node); }; /* class ParamNotebook */ diff --git a/src/extension/param/parameter.cpp b/src/extension/param/parameter.cpp index 1094a5d3f..2773af61d 100644 --- a/src/extension/param/parameter.cpp +++ b/src/extension/param/parameter.cpp @@ -156,7 +156,7 @@ Parameter::make (Inkscape::XML::Node * in_repr, Inkscape::Extension::Extension * /** \brief Wrapper to cast to the object and use it's function. */ bool -Parameter::get_bool (const Document * doc, const Inkscape::XML::Node * node) +Parameter::get_bool (const SPDocument * doc, const Inkscape::XML::Node * node) { ParamBool * boolpntr = dynamic_cast(this); if (boolpntr == NULL) @@ -166,7 +166,7 @@ Parameter::get_bool (const Document * doc, const Inkscape::XML::Node * node) /** \brief Wrapper to cast to the object and use it's function. */ int -Parameter::get_int (const Document * doc, const Inkscape::XML::Node * node) +Parameter::get_int (const SPDocument * doc, const Inkscape::XML::Node * node) { ParamInt * intpntr = dynamic_cast(this); if (intpntr == NULL) @@ -176,7 +176,7 @@ Parameter::get_int (const Document * doc, const Inkscape::XML::Node * node) /** \brief Wrapper to cast to the object and use it's function. */ float -Parameter::get_float (const Document * doc, const Inkscape::XML::Node * node) +Parameter::get_float (const SPDocument * doc, const Inkscape::XML::Node * node) { ParamFloat * floatpntr = dynamic_cast(this); if (floatpntr == NULL) @@ -186,7 +186,7 @@ Parameter::get_float (const Document * doc, const Inkscape::XML::Node * node) /** \brief Wrapper to cast to the object and use it's function. */ const gchar * -Parameter::get_string (const Document * doc, const Inkscape::XML::Node * node) +Parameter::get_string (const SPDocument * doc, const Inkscape::XML::Node * node) { ParamString * stringpntr = dynamic_cast(this); if (stringpntr == NULL) @@ -196,7 +196,7 @@ Parameter::get_string (const Document * doc, const Inkscape::XML::Node * node) /** \brief Wrapper to cast to the object and use it's function. */ const gchar * -Parameter::get_enum (const Document * doc, const Inkscape::XML::Node * node) +Parameter::get_enum (const SPDocument * doc, const Inkscape::XML::Node * node) { ParamComboBox * param = dynamic_cast(this); if (param == NULL) @@ -205,7 +205,7 @@ Parameter::get_enum (const Document * doc, const Inkscape::XML::Node * node) } guint32 -Parameter::get_color(const Document* doc, const Inkscape::XML::Node* node) +Parameter::get_color(const SPDocument* doc, const Inkscape::XML::Node* node) { ParamColor* param = dynamic_cast(this); if (param == NULL) @@ -215,7 +215,7 @@ Parameter::get_color(const Document* doc, const Inkscape::XML::Node* node) /** \brief Wrapper to cast to the object and use it's function. */ bool -Parameter::set_bool (bool in, Document * doc, Inkscape::XML::Node * node) +Parameter::set_bool (bool in, SPDocument * doc, Inkscape::XML::Node * node) { ParamBool * boolpntr = dynamic_cast(this); if (boolpntr == NULL) @@ -225,7 +225,7 @@ Parameter::set_bool (bool in, Document * doc, Inkscape::XML::Node * node) /** \brief Wrapper to cast to the object and use it's function. */ int -Parameter::set_int (int in, Document * doc, Inkscape::XML::Node * node) +Parameter::set_int (int in, SPDocument * doc, Inkscape::XML::Node * node) { ParamInt * intpntr = dynamic_cast(this); if (intpntr == NULL) @@ -235,7 +235,7 @@ Parameter::set_int (int in, Document * doc, Inkscape::XML::Node * node) /** \brief Wrapper to cast to the object and use it's function. */ float -Parameter::set_float (float in, Document * doc, Inkscape::XML::Node * node) +Parameter::set_float (float in, SPDocument * doc, Inkscape::XML::Node * node) { ParamFloat * floatpntr; floatpntr = dynamic_cast(this); @@ -246,7 +246,7 @@ Parameter::set_float (float in, Document * doc, Inkscape::XML::Node * node) /** \brief Wrapper to cast to the object and use it's function. */ const gchar * -Parameter::set_string (const gchar * in, Document * doc, Inkscape::XML::Node * node) +Parameter::set_string (const gchar * in, SPDocument * doc, Inkscape::XML::Node * node) { ParamString * stringpntr = dynamic_cast(this); if (stringpntr == NULL) @@ -255,7 +255,7 @@ Parameter::set_string (const gchar * in, Document * doc, Inkscape::XML::Node * n } /** \brief Wrapper to cast to the object and use it's function. */ guint32 -Parameter::set_color (guint32 in, Document * doc, Inkscape::XML::Node * node) +Parameter::set_color (guint32 in, SPDocument * doc, Inkscape::XML::Node * node) { ParamColor* param = dynamic_cast(this); if (param == NULL) @@ -323,7 +323,7 @@ Parameter::new_child (Inkscape::XML::Node * parent) } Inkscape::XML::Node * -Parameter::document_param_node (Document * doc) +Parameter::document_param_node (SPDocument * doc) { Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); Inkscape::XML::Node * defs = SP_OBJECT_REPR(SP_DOCUMENT_DEFS(doc)); @@ -353,7 +353,7 @@ Parameter::document_param_node (Document * doc) /** \brief Basically, if there is no widget pass a NULL. */ Gtk::Widget * -Parameter::get_widget (Document * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal * /*changeSignal*/) +Parameter::get_widget (SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal * /*changeSignal*/) { return NULL; } diff --git a/src/extension/param/parameter.h b/src/extension/param/parameter.h index a79b2fd6b..54249c12e 100644 --- a/src/extension/param/parameter.h +++ b/src/extension/param/parameter.h @@ -68,7 +68,7 @@ protected: /* **** funcs **** */ gchar * pref_name (void); Inkscape::XML::Node * find_child (Inkscape::XML::Node * adult); - Inkscape::XML::Node * document_param_node (Document * doc); + Inkscape::XML::Node * document_param_node (SPDocument * doc); Inkscape::XML::Node * new_child (Inkscape::XML::Node * parent); public: @@ -85,29 +85,29 @@ public: Parameter(name, guitext, NULL, Parameter::SCOPE_USER, false, NULL, ext); }; virtual ~Parameter (void); - bool get_bool (const Document * doc, + bool get_bool (const SPDocument * doc, const Inkscape::XML::Node * node); - int get_int (const Document * doc, + int get_int (const SPDocument * doc, const Inkscape::XML::Node * node); - float get_float (const Document * doc, + float get_float (const SPDocument * doc, const Inkscape::XML::Node * node); - const gchar * get_string (const Document * doc, + const gchar * get_string (const SPDocument * doc, const Inkscape::XML::Node * node); - guint32 get_color (const Document * doc, + guint32 get_color (const SPDocument * doc, const Inkscape::XML::Node * node); - const gchar * get_enum (const Document * doc, + const gchar * get_enum (const SPDocument * doc, const Inkscape::XML::Node * node); - bool set_bool (bool in, Document * doc, Inkscape::XML::Node * node); - int set_int (int in, Document * doc, Inkscape::XML::Node * node); - float set_float (float in, Document * doc, Inkscape::XML::Node * node); - const gchar * set_string (const gchar * in, Document * doc, Inkscape::XML::Node * node); - guint32 set_color (guint32 in, Document * doc, Inkscape::XML::Node * node); + bool set_bool (bool in, SPDocument * doc, Inkscape::XML::Node * node); + int set_int (int in, SPDocument * doc, Inkscape::XML::Node * node); + float set_float (float in, SPDocument * doc, Inkscape::XML::Node * node); + const gchar * set_string (const gchar * in, SPDocument * doc, Inkscape::XML::Node * node); + guint32 set_color (guint32 in, SPDocument * doc, Inkscape::XML::Node * node); const gchar * name (void) {return _name;} static Parameter * make (Inkscape::XML::Node * in_repr, Inkscape::Extension::Extension * in_ext); - virtual Gtk::Widget * get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + virtual Gtk::Widget * get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); gchar const * get_tooltip (void) { return _desc; } diff --git a/src/extension/param/radiobutton.cpp b/src/extension/param/radiobutton.cpp index 315984e17..c17839001 100644 --- a/src/extension/param/radiobutton.cpp +++ b/src/extension/param/radiobutton.cpp @@ -149,7 +149,7 @@ ParamRadioButton::~ParamRadioButton (void) the passed in value is duplicated using \c g_strdup(). */ const gchar * -ParamRadioButton::set (const gchar * in, Document * /*doc*/, Inkscape::XML::Node * /*node*/) +ParamRadioButton::set (const gchar * in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/) { if (in == NULL) return NULL; /* Can't have NULL string */ @@ -189,7 +189,7 @@ ParamRadioButton::string (std::string &string) class ParamRadioButtonWdg : public Gtk::RadioButton { private: ParamRadioButton * _pref; - Document * _doc; + SPDocument * _doc; Inkscape::XML::Node * _node; sigc::signal * _changeSignal; public: @@ -197,12 +197,12 @@ public: \param pref Where to put the radiobutton's string when it is selected. */ ParamRadioButtonWdg ( Gtk::RadioButtonGroup& group, const Glib::ustring& label, - ParamRadioButton * pref, Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal ) : + ParamRadioButton * pref, SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal ) : Gtk::RadioButton(group, label), _pref(pref), _doc(doc), _node(node), _changeSignal(changeSignal) { add_changesignal(); }; ParamRadioButtonWdg ( const Glib::ustring& label, - ParamRadioButton * pref, Document * doc, Inkscape::XML::Node * node , sigc::signal * changeSignal) : + ParamRadioButton * pref, SPDocument * doc, Inkscape::XML::Node * node , sigc::signal * changeSignal) : Gtk::RadioButton(label), _pref(pref), _doc(doc), _node(node), _changeSignal(changeSignal) { add_changesignal(); }; @@ -232,7 +232,7 @@ ParamRadioButtonWdg::changed (void) class ComboWdg : public Gtk::ComboBoxText { public: - ComboWdg(ParamRadioButton* base, Document * doc, Inkscape::XML::Node * node) : + ComboWdg(ParamRadioButton* base, SPDocument * doc, Inkscape::XML::Node * node) : Gtk::ComboBoxText(), base(base), doc(doc), @@ -243,7 +243,7 @@ public: protected: ParamRadioButton* base; - Document* doc; + SPDocument* doc; Inkscape::XML::Node* node; virtual void on_changed() { @@ -257,7 +257,7 @@ protected: \brief Creates a combobox widget for an enumeration parameter */ Gtk::Widget * -ParamRadioButton::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamRadioButton::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; diff --git a/src/extension/param/radiobutton.h b/src/extension/param/radiobutton.h index ec35c2c53..ea8440de2 100644 --- a/src/extension/param/radiobutton.h +++ b/src/extension/param/radiobutton.h @@ -43,11 +43,11 @@ public: Inkscape::XML::Node * xml, AppearanceMode mode); virtual ~ParamRadioButton(void); - Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::string &string); - const gchar * get (const Document * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } - const gchar * set (const gchar * in, Document * doc, Inkscape::XML::Node * node); + const gchar * get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } + const gchar * set (const gchar * in, SPDocument * doc, Inkscape::XML::Node * node); private: /** \brief Internal value. This should point to a string that has diff --git a/src/extension/param/string.cpp b/src/extension/param/string.cpp index 6427f6f76..e32224332 100644 --- a/src/extension/param/string.cpp +++ b/src/extension/param/string.cpp @@ -42,7 +42,7 @@ ParamString::~ParamString(void) the passed in value is duplicated using \c g_strdup(). */ const gchar * -ParamString::set (const gchar * in, Document * /*doc*/, Inkscape::XML::Node * /*node*/) +ParamString::set (const gchar * in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/) { if (in == NULL) return NULL; /* Can't have NULL string */ @@ -96,7 +96,7 @@ ParamString::ParamString (const gchar * name, const gchar * guitext, const gchar class ParamStringEntry : public Gtk::Entry { private: ParamString * _pref; - Document * _doc; + SPDocument * _doc; Inkscape::XML::Node * _node; sigc::signal * _changeSignal; public: @@ -104,7 +104,7 @@ public: \param pref Where to get the string from, and where to put it when it changes. */ - ParamStringEntry (ParamString * pref, Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : + ParamStringEntry (ParamString * pref, SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : Gtk::Entry(), _pref(pref), _doc(doc), _node(node), _changeSignal(changeSignal) { if (_pref->get(NULL, NULL) != NULL) this->set_text(Glib::ustring(_pref->get(NULL, NULL))); @@ -137,7 +137,7 @@ ParamStringEntry::changed_text (void) Builds a hbox with a label and a text box in it. */ Gtk::Widget * -ParamString::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamString::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; diff --git a/src/extension/param/string.h b/src/extension/param/string.h index 0eb116a53..10f45e5ac 100644 --- a/src/extension/param/string.h +++ b/src/extension/param/string.h @@ -28,9 +28,9 @@ public: ParamString(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); virtual ~ParamString(void); /** \brief Returns \c _value, with a \i const to protect it. */ - const gchar * get (const Document * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } - const gchar * set (const gchar * in, Document * doc, Inkscape::XML::Node * node); - Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + const gchar * get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } + const gchar * set (const gchar * in, SPDocument * doc, Inkscape::XML::Node * node); + Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::string &string); void setMaxLength(int maxLenght) { _max_length = maxLenght; } int getMaxLength(void) { return _max_length; } diff --git a/src/extension/patheffect.cpp b/src/extension/patheffect.cpp index f6fa84f5b..8e3fc13f1 100644 --- a/src/extension/patheffect.cpp +++ b/src/extension/patheffect.cpp @@ -28,14 +28,14 @@ PathEffect::~PathEffect (void) } void -PathEffect::processPath (Document * /*doc*/, Inkscape::XML::Node * /*path*/, Inkscape::XML::Node * /*def*/) +PathEffect::processPath (SPDocument * /*doc*/, Inkscape::XML::Node * /*path*/, Inkscape::XML::Node * /*def*/) { } void -PathEffect::processPathEffects (Document * doc, Inkscape::XML::Node * path) +PathEffect::processPathEffects (SPDocument * doc, Inkscape::XML::Node * path) { gchar const * patheffectlist = path->attribute("inkscape:path-effects"); if (patheffectlist == NULL) diff --git a/src/extension/patheffect.h b/src/extension/patheffect.h index 7ad875048..0c00ae093 100644 --- a/src/extension/patheffect.h +++ b/src/extension/patheffect.h @@ -22,10 +22,10 @@ public: PathEffect (Inkscape::XML::Node * in_repr, Implementation::Implementation * in_imp); virtual ~PathEffect (void); - void processPath (Document * doc, + void processPath (SPDocument * doc, Inkscape::XML::Node * path, Inkscape::XML::Node * def); - static void processPathEffects (Document * doc, + static void processPathEffects (SPDocument * doc, Inkscape::XML::Node * path); }; /* PathEffect */ diff --git a/src/extension/print.cpp b/src/extension/print.cpp index f6f6bb1e5..2d4177d60 100644 --- a/src/extension/print.cpp +++ b/src/extension/print.cpp @@ -49,7 +49,7 @@ Print::set_preview (void) } unsigned int -Print::begin (Document *doc) +Print::begin (SPDocument *doc) { return imp->begin(this, doc); } diff --git a/src/extension/print.h b/src/extension/print.h index 3240942d7..8ae71b8e6 100644 --- a/src/extension/print.h +++ b/src/extension/print.h @@ -36,7 +36,7 @@ public: unsigned int setup (void); unsigned int set_preview (void); - unsigned int begin (Document *doc); + unsigned int begin (SPDocument *doc); unsigned int finish (void); /* Rendering methods */ diff --git a/src/extension/system.cpp b/src/extension/system.cpp index ad49c3d2a..d7e0eebf3 100644 --- a/src/extension/system.cpp +++ b/src/extension/system.cpp @@ -59,7 +59,7 @@ static Extension *build_from_reprdoc(Inkscape::XML::Document *doc, Implementatio * * Lastly, the open function is called in the module itself. */ -Document * +SPDocument * open(Extension *key, gchar const *filename) { Input *imod = NULL; @@ -91,7 +91,7 @@ open(Extension *key, gchar const *filename) if (!imod->prefs(filename)) return NULL; - Document *doc = imod->open(filename); + SPDocument *doc = imod->open(filename); if (!doc) { throw Input::open_failed(); } @@ -184,7 +184,7 @@ open_internal(Extension *in_plug, gpointer in_data) * Lastly, the save function is called in the module itself. */ void -save(Extension *key, Document *doc, gchar const *filename, bool setextension, bool check_overwrite, bool official) +save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension, bool check_overwrite, bool official) { Output *omod; if (key == NULL) { diff --git a/src/extension/system.h b/src/extension/system.h index ada5f799c..6c23b2f0d 100644 --- a/src/extension/system.h +++ b/src/extension/system.h @@ -21,8 +21,8 @@ namespace Inkscape { namespace Extension { -Document *open(Extension *key, gchar const *filename); -void save(Extension *key, Document *doc, gchar const *filename, +SPDocument *open(Extension *key, gchar const *filename); +void save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension, bool check_overwrite, bool official); Print *get_print(gchar const *key); Extension *build_from_file(gchar const *filename); -- cgit v1.2.3 From f6646a2f88c4e071e79bd5c173903fe8f89fde14 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Thu, 6 Aug 2009 15:31:08 +0000 Subject: Make PDF, PS, and EPS dialogs consistent. Change "Canvas" to "Page" to be consistent with other dialogs and menu items. (bzr r8423) --- src/extension/internal/cairo-ps-out.cpp | 8 ++++---- src/extension/internal/cairo-renderer-pdf-out.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/extension') diff --git a/src/extension/internal/cairo-ps-out.cpp b/src/extension/internal/cairo-ps-out.cpp index dff89c1ed..209d1e9b9 100644 --- a/src/extension/internal/cairo-ps-out.cpp +++ b/src/extension/internal/cairo-ps-out.cpp @@ -279,11 +279,11 @@ CairoPsOutput::init (void) "<_item value='PS2'>" N_("PostScript level 2") "\n" #endif "\n" - "true\n" - "true\n" "false\n" "true\n" "90\n" + "true\n" + "true\n" "\n" "\n" ".ps\n" @@ -316,11 +316,11 @@ CairoEpsOutput::init (void) "<_item value='PS2'>" N_("PostScript level 2") "\n" #endif "\n" - "true\n" - "true\n" "false\n" "true\n" "90\n" + "true\n" + "true\n" "\n" "\n" ".eps\n" diff --git a/src/extension/internal/cairo-renderer-pdf-out.cpp b/src/extension/internal/cairo-renderer-pdf-out.cpp index b44e83449..b8af3b177 100644 --- a/src/extension/internal/cairo-renderer-pdf-out.cpp +++ b/src/extension/internal/cairo-renderer-pdf-out.cpp @@ -219,8 +219,8 @@ CairoRendererPdfOutput::init (void) "false\n" "true\n" "90\n" - "false\n" - "false\n" + "false\n" + "false\n" "\n" "\n" ".pdf\n" -- cgit v1.2.3 From 63d1a47c13905391b0c3ee3e72ee8df74fbf012a Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Fri, 7 Aug 2009 12:53:15 +0000 Subject: Change "canvas" to "page" to be consistent with use in all other dialogs and menus. '-C' is kept, as '-P' is used for PostScript export. (bzr r8438) --- src/extension/internal/cairo-ps-out.cpp | 16 ++++++++-------- src/extension/internal/cairo-renderer-pdf-out.cpp | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/extension') diff --git a/src/extension/internal/cairo-ps-out.cpp b/src/extension/internal/cairo-ps-out.cpp index 209d1e9b9..9ac19326f 100644 --- a/src/extension/internal/cairo-ps-out.cpp +++ b/src/extension/internal/cairo-ps-out.cpp @@ -156,9 +156,9 @@ CairoPsOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar con new_bitmapResolution = mod->get_param_int("resolution"); } catch(...) {} - bool new_areaCanvas = true; + bool new_areaPage = true; try { - new_areaCanvas = mod->get_param_bool("areaCanvas"); + new_areaPage = mod->get_param_bool("areaPage"); } catch(...) {} bool new_areaDrawing = true; @@ -173,7 +173,7 @@ CairoPsOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar con gchar * final_name; final_name = g_strdup_printf("> %s", filename); - ret = ps_print_document_to_file(doc, final_name, level, new_textToPath, new_blurToBitmap, new_bitmapResolution, new_exportId, new_areaDrawing, new_areaCanvas); + ret = ps_print_document_to_file(doc, final_name, level, new_textToPath, new_blurToBitmap, new_bitmapResolution, new_exportId, new_areaDrawing, new_areaPage); g_free(final_name); if (!ret) @@ -220,9 +220,9 @@ CairoEpsOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar co new_bitmapResolution = mod->get_param_int("resolution"); } catch(...) {} - bool new_areaCanvas = true; + bool new_areaPage = true; try { - new_areaCanvas = mod->get_param_bool("areaCanvas"); + new_areaPage = mod->get_param_bool("areaPage"); } catch(...) {} bool new_areaDrawing = true; @@ -237,7 +237,7 @@ CairoEpsOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar co gchar * final_name; final_name = g_strdup_printf("> %s", filename); - ret = ps_print_document_to_file(doc, final_name, level, new_textToPath, new_blurToBitmap, new_bitmapResolution, new_exportId, new_areaDrawing, new_areaCanvas, true); + ret = ps_print_document_to_file(doc, final_name, level, new_textToPath, new_blurToBitmap, new_bitmapResolution, new_exportId, new_areaDrawing, new_areaPage, true); g_free(final_name); if (!ret) @@ -283,7 +283,7 @@ CairoPsOutput::init (void) "true\n" "90\n" "true\n" - "true\n" + "true\n" "\n" "\n" ".ps\n" @@ -320,7 +320,7 @@ CairoEpsOutput::init (void) "true\n" "90\n" "true\n" - "true\n" + "true\n" "\n" "\n" ".eps\n" diff --git a/src/extension/internal/cairo-renderer-pdf-out.cpp b/src/extension/internal/cairo-renderer-pdf-out.cpp index b8af3b177..0598c388a 100644 --- a/src/extension/internal/cairo-renderer-pdf-out.cpp +++ b/src/extension/internal/cairo-renderer-pdf-out.cpp @@ -180,7 +180,7 @@ CairoRendererPdfOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, bool new_exportCanvas = FALSE; try { - new_exportCanvas = mod->get_param_bool("areaCanvas"); + new_exportCanvas = mod->get_param_bool("areaPage"); } catch(...) { g_warning("Parameter might not exist"); @@ -220,7 +220,7 @@ CairoRendererPdfOutput::init (void) "true\n" "90\n" "false\n" - "false\n" + "false\n" "\n" "\n" ".pdf\n" -- cgit v1.2.3 From 606ebb35498c3d750bb2906954195baaa0fbcad6 Mon Sep 17 00:00:00 2001 From: Maximilian Albert Date: Sun, 9 Aug 2009 14:23:52 +0000 Subject: Fix remaining glitches in the behaviour of the Save dialogs (w.r.t. remembering the last file type and folder). As part of the cleanup inkscape:output_extension was removed, too. (bzr r8454) --- src/extension/implementation/script.cpp | 13 ++-- src/extension/input.cpp | 13 ---- src/extension/system.cpp | 102 ++++++++++++++++++++++++++++++-- src/extension/system.h | 53 ++++++++++++++++- 4 files changed, 154 insertions(+), 27 deletions(-) (limited to 'src/extension') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index e6ce40bc0..5f1bef8d1 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -477,7 +477,7 @@ ScriptDocCache::ScriptDocCache (Inkscape::UI::View::View * view) : Inkscape::Extension::save( Inkscape::Extension::db.get(SP_MODULE_KEY_OUTPUT_SVG_INKSCAPE), - view->doc(), _filename.c_str(), false, false, false); + view->doc(), _filename.c_str(), false, false, false, Inkscape::Extension::FILE_SAVE_METHOD_TEMPORARY); return; } @@ -641,11 +641,13 @@ Script::save(Inkscape::Extension::Output *module, if (helper_extension.size() == 0) { Inkscape::Extension::save( Inkscape::Extension::db.get(SP_MODULE_KEY_OUTPUT_SVG_INKSCAPE), - doc, tempfilename_in.c_str(), false, false, false); + doc, tempfilename_in.c_str(), false, false, false, + Inkscape::Extension::FILE_SAVE_METHOD_TEMPORARY); } else { Inkscape::Extension::save( Inkscape::Extension::db.get(helper_extension.c_str()), - doc, tempfilename_in.c_str(), false, false, false); + doc, tempfilename_in.c_str(), false, false, false, + Inkscape::Extension::FILE_SAVE_METHOD_TEMPORARY); } @@ -714,8 +716,6 @@ Script::effect(Inkscape::Extension::Effect *module, SPDesktop *desktop = (SPDesktop *)doc; sp_namedview_document_from_window(desktop); - gchar * orig_output_extension = g_strdup(sp_document_repr_root(desktop->doc())->attribute("inkscape:output_extension")); - std::list params; module->paramListString(params); @@ -779,10 +779,7 @@ Script::effect(Inkscape::Extension::Effect *module, doc->doc()->emitReconstructionFinish(); mydoc->release(); sp_namedview_update_layers_from_document(desktop); - - sp_document_repr_root(desktop->doc())->setAttribute("inkscape:output_extension", orig_output_extension); } - g_free(orig_output_extension); return; } diff --git a/src/extension/input.cpp b/src/extension/input.cpp index 689c1286f..b4599dbd0 100644 --- a/src/extension/input.cpp +++ b/src/extension/input.cpp @@ -138,12 +138,6 @@ Input::check (void) from a file. The first thing that this does is make sure that the file actually exists. If it doesn't, a NULL is returned. If the file exits, then it is opened using the implmentation of this extension. - - After opening the document the output_extension is set. What this - accomplishes is that save can try to use an extension that supports - the same fileformat. So something like opening and saveing an - Adobe Illustrator file can be transparent (not recommended, but - transparent). This is all done with undo being turned off. */ SPDocument * Input::open (const gchar *uri) @@ -157,13 +151,6 @@ Input::open (const gchar *uri) timer->touch(); SPDocument *const doc = imp->open(this, uri); - if (doc != NULL) { - Inkscape::XML::Node * repr = sp_document_repr_root(doc); - bool saved = sp_document_get_undo_sensitive(doc); - sp_document_set_undo_sensitive (doc, false); - repr->setAttribute("inkscape:output_extension", output_extension); - sp_document_set_undo_sensitive (doc, saved); - } return doc; } diff --git a/src/extension/system.cpp b/src/extension/system.cpp index d7e0eebf3..2251ac7b6 100644 --- a/src/extension/system.cpp +++ b/src/extension/system.cpp @@ -20,6 +20,8 @@ #include +#include "system.h" +#include "preferences.h" #include "extension.h" #include "db.h" #include "input.h" @@ -184,7 +186,8 @@ open_internal(Extension *in_plug, gpointer in_data) * Lastly, the save function is called in the module itself. */ void -save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension, bool check_overwrite, bool official) +save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension, bool check_overwrite, bool official, + Inkscape::Extension::FileSaveMethod save_method) { Output *omod; if (key == NULL) { @@ -254,7 +257,7 @@ save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension, gchar *saved_output_extension = NULL; gchar *saved_dataloss = NULL; saved_modified = doc->isModifiedSinceSave(); - saved_output_extension = g_strdup(repr->attribute("inkscape:output_extension")); + saved_output_extension = g_strdup(get_file_save_extension(save_method).c_str()); saved_dataloss = g_strdup(repr->attribute("inkscape:dataloss")); if (official) { /* The document is changing name/uri. */ @@ -267,7 +270,7 @@ save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension, sp_document_set_undo_sensitive(doc, false); { // also save the extension for next use - repr->setAttribute("inkscape:output_extension", omod->get_id()); + store_file_extension_in_prefs (omod->get_id(), save_method); // set the "dataloss" attribute if the chosen extension is lossy repr->setAttribute("inkscape:dataloss", NULL); if (omod->causes_dataloss()) { @@ -287,7 +290,7 @@ save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension, bool const saved = sp_document_get_undo_sensitive(doc); sp_document_set_undo_sensitive(doc, false); { - repr->setAttribute("inkscape:output_extension", saved_output_extension); + store_file_extension_in_prefs (saved_output_extension, save_method); repr->setAttribute("inkscape:dataloss", saved_dataloss); } sp_document_set_undo_sensitive(doc, saved); @@ -309,7 +312,7 @@ save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension, bool const saved = sp_document_get_undo_sensitive(doc); sp_document_set_undo_sensitive(doc, false); { - repr->setAttribute("inkscape:output_extension", saved_output_extension); + store_file_extension_in_prefs (saved_output_extension, save_method); repr->setAttribute("inkscape:dataloss", saved_dataloss); } sp_document_set_undo_sensitive(doc, saved); @@ -544,6 +547,95 @@ build_from_mem(gchar const *buffer, Implementation::Implementation *in_imp) return ext; } +/* + * TODO: Is it guaranteed that the returned extension is valid? If so, we can remove the check for + * filename_extension in sp_file_save_dialog(). + */ +Glib::ustring +get_file_save_extension (Inkscape::Extension::FileSaveMethod method) { + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + Glib::ustring extension; + switch (method) { + case FILE_SAVE_METHOD_SAVE_AS: + case FILE_SAVE_METHOD_TEMPORARY: + extension = prefs->getString("/dialogs/save_as/default"); + break; + case FILE_SAVE_METHOD_SAVE_COPY: + extension = prefs->getString("/dialogs/save_copy/default"); + break; + case FILE_SAVE_METHOD_INKSCAPE_SVG: + extension = SP_MODULE_KEY_OUTPUT_SVG_INKSCAPE; + break; + } + + // this is probably unnecessary, but just to be on the safe side ... + if(extension.empty()) + extension = SP_MODULE_KEY_OUTPUT_SVG_INKSCAPE; + + return extension; +} + +Glib::ustring +get_file_save_path (SPDocument *doc, FileSaveMethod method) { + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + Glib::ustring path; + switch (method) { + case FILE_SAVE_METHOD_SAVE_AS: + case FILE_SAVE_METHOD_TEMPORARY: + path = prefs->getString("/dialogs/save_as/path"); + break; + case FILE_SAVE_METHOD_SAVE_COPY: + path = prefs->getString("/dialogs/save_copy/path"); + break; + case FILE_SAVE_METHOD_INKSCAPE_SVG: + if (doc->uri) { + path = Glib::path_get_dirname(doc->uri); + } else { + // FIXME: should we use the save_as path here or the current directory or even something else? + path = prefs->getString("/dialogs/save_as/path"); + } + } + + // this is probably unnecessary, but just to be on the safe side ... + if(path.empty()) + path = g_get_current_dir(); // is this the most sensible solution? + + return path; +} + +void +store_file_extension_in_prefs (Glib::ustring extension, FileSaveMethod method) { + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + switch (method) { + case FILE_SAVE_METHOD_SAVE_AS: + case FILE_SAVE_METHOD_TEMPORARY: + prefs->setString("/dialogs/save_as/default", extension); + break; + case FILE_SAVE_METHOD_SAVE_COPY: + prefs->setString("/dialogs/save_copy/default", extension); + break; + case FILE_SAVE_METHOD_INKSCAPE_SVG: + // do nothing + break; + } +} + +void +store_save_path_in_prefs (Glib::ustring path, FileSaveMethod method) { + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + switch (method) { + case FILE_SAVE_METHOD_SAVE_AS: + case FILE_SAVE_METHOD_TEMPORARY: + prefs->setString("/dialogs/save_as/path", path); + break; + case FILE_SAVE_METHOD_SAVE_COPY: + prefs->setString("/dialogs/save_copy/path", path); + break; + case FILE_SAVE_METHOD_INKSCAPE_SVG: + // do nothing + break; + } +} } } /* namespace Inkscape::Extension */ diff --git a/src/extension/system.h b/src/extension/system.h index 6c23b2f0d..b6740e109 100644 --- a/src/extension/system.h +++ b/src/extension/system.h @@ -21,13 +21,64 @@ namespace Inkscape { namespace Extension { +/** + * Used to distinguish between the various invocations of the save dialogs (and thus to determine + * the file type and save path offered in the dialog) + */ +enum FileSaveMethod { + FILE_SAVE_METHOD_SAVE_AS, + FILE_SAVE_METHOD_SAVE_COPY, + FILE_SAVE_METHOD_EXPORT, + // Fallback for special cases (e.g., when saving a document for the first time or after saving + // it in a lossy format) + FILE_SAVE_METHOD_INKSCAPE_SVG, + // For saving temporary files; we return the same data as for FILE_SAVE_METHOD_SAVE_AS + FILE_SAVE_METHOD_TEMPORARY, +}; + SPDocument *open(Extension *key, gchar const *filename); void save(Extension *key, SPDocument *doc, gchar const *filename, - bool setextension, bool check_overwrite, bool official); + bool setextension, bool check_overwrite, bool official, + Inkscape::Extension::FileSaveMethod save_method); Print *get_print(gchar const *key); Extension *build_from_file(gchar const *filename); Extension *build_from_mem(gchar const *buffer, Implementation::Implementation *in_imp); +/** + * Determine the desired default file extension depending on the given file save method. + * The returned string is guaranteed to be non-empty. + * + * @param method the file save method of the dialog + * @return the corresponding default file extension + */ +Glib::ustring get_file_save_extension (FileSaveMethod method); + +/** + * Determine the desired default save path depending on the given FileSaveMethod. + * The returned string is guaranteed to be non-empty. + * + * @param method the file save method of the dialog + * @param doc the file's document + * @return the corresponding default save path + */ +Glib::ustring get_file_save_path (SPDocument *doc, FileSaveMethod method); + +/** + * Write the given file extension back to prefs so that it can be used later on. + * + * @param extension the file extension which should be written to prefs + * @param method the file save mathod of the dialog + */ +void store_file_extension_in_prefs (Glib::ustring extension, FileSaveMethod method); + +/** + * Write the given path back to prefs so that it can be used later on. + * + * @param path the path which should be written to prefs + * @param method the file save mathod of the dialog + */ +void store_save_path_in_prefs (Glib::ustring path, FileSaveMethod method); + } } /* namespace Inkscape::Extension */ #endif /* INKSCAPE_EXTENSION_SYSTEM_H__ */ -- cgit v1.2.3 From 3df4d57cdf2cecad461fffb4bc386cf7c08fe144 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Tue, 11 Aug 2009 13:02:58 +0000 Subject: Maximum value of alpha is 255 (not 256). (bzr r8467) --- src/extension/internal/javafx-out.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/extension') diff --git a/src/extension/internal/javafx-out.cpp b/src/extension/internal/javafx-out.cpp index 417755e19..a2f387406 100644 --- a/src/extension/internal/javafx-out.cpp +++ b/src/extension/internal/javafx-out.cpp @@ -141,7 +141,7 @@ static JavaFXOutput::String rgba(guint32 rgba) unsigned int a = SP_RGBA32_A_U(rgba); char buf[80]; snprintf(buf, 79, "Color.rgb(0x%02x, 0x%02x, 0x%02x, %s)", - r, g, b, DSTR((double)a/256.0)); + r, g, b, DSTR((double)a/255.0)); JavaFXOutput::String s = buf; return s; } -- cgit v1.2.3 From 9f9e21dec8cc697d91646924da431fc04a2b78bd Mon Sep 17 00:00:00 2001 From: Maximilian Albert Date: Wed, 12 Aug 2009 13:18:51 +0000 Subject: Don't open 'Save as ...' dialog inside the application bundle on OS X when it is invoked for the first time (bzr r8472) --- src/extension/system.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/extension') diff --git a/src/extension/system.cpp b/src/extension/system.cpp index 2251ac7b6..365ea925b 100644 --- a/src/extension/system.cpp +++ b/src/extension/system.cpp @@ -568,7 +568,6 @@ get_file_save_extension (Inkscape::Extension::FileSaveMethod method) { break; } - // this is probably unnecessary, but just to be on the safe side ... if(extension.empty()) extension = SP_MODULE_KEY_OUTPUT_SVG_INKSCAPE; @@ -591,14 +590,17 @@ get_file_save_path (SPDocument *doc, FileSaveMethod method) { if (doc->uri) { path = Glib::path_get_dirname(doc->uri); } else { - // FIXME: should we use the save_as path here or the current directory or even something else? + // FIXME: should we use the save_as path here or something else? Maybe we should + // leave this as a choice to the user. path = prefs->getString("/dialogs/save_as/path"); } } - // this is probably unnecessary, but just to be on the safe side ... if(path.empty()) - path = g_get_current_dir(); // is this the most sensible solution? + path = g_get_home_dir(); // Is this the most sensible solution? Note that we should avoid + // g_get_current_dir because this leads to problems on OS X where + // Inkscape opens the dialog inside application bundle when it is + // invoked for the first teim. return path; } -- cgit v1.2.3 From ef549e445f821e4472c71d1c43f3738c7857bafc Mon Sep 17 00:00:00 2001 From: bulia byak Date: Sat, 5 Sep 2009 23:58:47 +0000 Subject: patch by Adib for 406470 (bzr r8562) --- src/extension/internal/cairo-render-context.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/extension') diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp index d1462e52e..364dfcfa8 100644 --- a/src/extension/internal/cairo-render-context.cpp +++ b/src/extension/internal/cairo-render-context.cpp @@ -192,6 +192,8 @@ CairoRenderContext::cloneMe(double width, double height) const (int)ceil(width), (int)ceil(height)); new_context->_cr = cairo_create(surface); new_context->_surface = surface; + new_context->_width = width; + new_context->_height = height; new_context->_is_valid = TRUE; return new_context; @@ -749,6 +751,9 @@ CairoRenderContext::setupSurface(double width, double height) if (_vector_based_target && _stream == NULL) return false; + _width = width; + _height = height; + cairo_surface_t *surface = NULL; switch (_target) { case CAIRO_SURFACE_TYPE_IMAGE: @@ -796,13 +801,16 @@ bool CairoRenderContext::_finishSurfaceSetup(cairo_surface_t *surface, cairo_matrix_t *ctm) { if(surface == NULL) { - return FALSE; + return false; } if(CAIRO_STATUS_SUCCESS != cairo_surface_status(surface)) { - return FALSE; + return false; } _cr = cairo_create(surface); + if(CAIRO_STATUS_SUCCESS != cairo_status(_cr)) { + return false; + } if (ctm) cairo_set_matrix(_cr, ctm); _surface = surface; -- cgit v1.2.3 From 89abf2d35ba202b184df4e791da3903c16d1d91c Mon Sep 17 00:00:00 2001 From: bulia byak Date: Sun, 6 Sep 2009 02:34:31 +0000 Subject: textual patch from bug 408093 (bzr r8563) --- src/extension/execution-env.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/extension') diff --git a/src/extension/execution-env.cpp b/src/extension/execution-env.cpp index 4a13890d7..e8d7c4baf 100644 --- a/src/extension/execution-env.cpp +++ b/src/extension/execution-env.cpp @@ -131,7 +131,7 @@ ExecutionEnv::createWorkingDialog (void) { return; Gtk::Window *window = Glib::wrap(GTK_WINDOW(toplevel), false); - gchar * dlgmessage = g_strdup_printf(_("'%s' working, please wait..."), _effect->get_name()); + gchar * dlgmessage = g_strdup_printf(_("'%s' working, please wait..."), _(_effect->get_name())); _visibleDialog = new Gtk::MessageDialog(*window, dlgmessage, false, // use markup -- cgit v1.2.3 From 1807c74cbec5204385b71b3a120ebcd40f80c18e Mon Sep 17 00:00:00 2001 From: Josh Andler Date: Wed, 16 Sep 2009 02:04:50 +0000 Subject: Fix by Adib for 353847 (bzr r8601) --- src/extension/output.h | 1 + src/extension/system.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) (limited to 'src/extension') diff --git a/src/extension/output.h b/src/extension/output.h index b52a96211..584fafda8 100644 --- a/src/extension/output.h +++ b/src/extension/output.h @@ -31,6 +31,7 @@ public: class save_failed {}; /**< Generic failure for an undescribed reason */ class save_cancelled {}; /**< Saving was cancelled */ class no_extension_found {}; /**< Failed because we couldn't find an extension to match the filename */ + class file_read_only {}; /**< The existing file can not be opened for writing */ Output (Inkscape::XML::Node * in_repr, Implementation::Implementation * in_imp); diff --git a/src/extension/system.cpp b/src/extension/system.cpp index 365ea925b..43e7af494 100644 --- a/src/extension/system.cpp +++ b/src/extension/system.cpp @@ -32,6 +32,7 @@ #include "implementation/script.h" #include "implementation/xslt.h" #include "xml/rebase-hrefs.h" +#include "io/sys.h" /* #include "implementation/plugin.h" */ namespace Inkscape { @@ -248,6 +249,13 @@ save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension, throw Output::no_overwrite(); } + // test if the file exists and is writable + // the test only checks the file attributes and might pass where ACL does not allow to write + if (Inkscape::IO::file_test(filename, G_FILE_TEST_EXISTS) && !Inkscape::IO::file_is_writable(filename)) { + g_free(fileName); + throw Output::file_read_only(); + } + Inkscape::XML::Node *repr = sp_document_repr_root(doc); -- cgit v1.2.3 From 6413ea1f0bc64210933ddc237aaea4c8ed10f859 Mon Sep 17 00:00:00 2001 From: Josh Andler Date: Tue, 22 Sep 2009 05:16:43 +0000 Subject: Fix by Adib for 430804. (bzr r8628) --- src/extension/internal/filter/filter.cpp | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'src/extension') diff --git a/src/extension/internal/filter/filter.cpp b/src/extension/internal/filter/filter.cpp index 048207332..d98f8e9a2 100644 --- a/src/extension/internal/filter/filter.cpp +++ b/src/extension/internal/filter/filter.cpp @@ -70,7 +70,7 @@ Filter::get_filter (Inkscape::Extension::Extension * ext) { return sp_repr_read_mem(filter, strlen(filter), NULL); } -void +void Filter::merge_filters (Inkscape::XML::Node * to, Inkscape::XML::Node * from, Inkscape::XML::Document * doc, gchar * srcGraphic, gchar * srcGraphicAlpha) { if (from == NULL) return; @@ -99,7 +99,7 @@ Filter::merge_filters (Inkscape::XML::Node * to, Inkscape::XML::Node * from, Ink from_child != NULL ; from_child = from_child->next()) { Glib::ustring name = "svg:"; name += from_child->name(); - + Inkscape::XML::Node * to_child = doc->createElement(name.c_str()); to->appendChild(to_child); merge_filters(to_child, from_child, doc, srcGraphic, srcGraphicAlpha); @@ -149,7 +149,7 @@ Filter::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View *d Glib::ustring url = "url(#"; url += newfilterroot->attribute("id"); url += ")"; merge_filters(newfilterroot, filterdoc->root(), xmldoc); - + Inkscape::GC::release(newfilterroot); sp_repr_css_set_property(css, "filter", url.c_str()); @@ -170,21 +170,29 @@ Filter::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View *d } g_free(lfilter); + // no filter if (filternode == NULL) { + g_warning("no assoziating filter found!"); continue; } - filternode->lastChild()->setAttribute("result", FILTER_SRC_GRAPHIC); + if (filternode->lastChild() == NULL) { + // empty filter, we insert + merge_filters(filternode, filterdoc->root(), xmldoc); + } else { + // existing filter, we merge + filternode->lastChild()->setAttribute("result", FILTER_SRC_GRAPHIC); + Inkscape::XML::Node * alpha = xmldoc->createElement("svg:feColorMatrix"); + alpha->setAttribute("result", FILTER_SRC_GRAPHIC_ALPHA); + alpha->setAttribute("in", FILTER_SRC_GRAPHIC); // not required, but we're being explicit + alpha->setAttribute("values", "0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"); - Inkscape::XML::Node * alpha = xmldoc->createElement("svg:feColorMatrix"); - alpha->setAttribute("result", FILTER_SRC_GRAPHIC_ALPHA); - alpha->setAttribute("in", FILTER_SRC_GRAPHIC); // not required, but we're being explicit - alpha->setAttribute("values", "0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"); - filternode->appendChild(alpha); + filternode->appendChild(alpha); - merge_filters(filternode, filterdoc->root(), xmldoc, FILTER_SRC_GRAPHIC, FILTER_SRC_GRAPHIC_ALPHA); + merge_filters(filternode, filterdoc->root(), xmldoc, FILTER_SRC_GRAPHIC, FILTER_SRC_GRAPHIC_ALPHA); - Inkscape::GC::release(alpha); + Inkscape::GC::release(alpha); + } } } -- cgit v1.2.3 From b8bb0a85a88308222a457c3d017a62eaa57c0524 Mon Sep 17 00:00:00 2001 From: Josh Andler Date: Sun, 27 Sep 2009 17:31:38 +0000 Subject: Patch from Adrian for 437550. (bzr r8658) --- src/extension/internal/cairo-render-context.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/extension') diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp index 364dfcfa8..cae496543 100644 --- a/src/extension/internal/cairo-render-context.cpp +++ b/src/extension/internal/cairo-render-context.cpp @@ -755,6 +755,8 @@ CairoRenderContext::setupSurface(double width, double height) _height = height; cairo_surface_t *surface = NULL; + cairo_matrix_t ctm; + cairo_matrix_init_identity (&ctm); switch (_target) { case CAIRO_SURFACE_TYPE_IMAGE: surface = cairo_image_surface_create(_target_format, (int)ceil(width), (int)ceil(height)); @@ -766,11 +768,19 @@ CairoRenderContext::setupSurface(double width, double height) #endif #ifdef CAIRO_HAS_PS_SURFACE case CAIRO_SURFACE_TYPE_PS: - surface = cairo_ps_surface_create_for_stream(Inkscape::Extension::Internal::_write_callback, _stream, width, height); -#if (CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 5, 2)) + if (!_eps && width > height) { + surface = cairo_ps_surface_create_for_stream(Inkscape::Extension::Internal::_write_callback, _stream, height, width); + cairo_matrix_init (&ctm, 0, -1, 1, 0, 0, 0); + cairo_matrix_translate (&ctm, -width, 0); + cairo_ps_surface_dsc_begin_page_setup (surface); + cairo_ps_surface_dsc_comment (surface, "%%PageOrientation: Landscape"); + } else { + surface = cairo_ps_surface_create_for_stream(Inkscape::Extension::Internal::_write_callback, _stream, width, height); + } if(CAIRO_STATUS_SUCCESS != cairo_surface_status(surface)) { return FALSE; } +#if (CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 5, 2)) cairo_ps_surface_restrict_to_level (surface, (cairo_ps_level_t)_ps_level); cairo_ps_surface_set_eps (surface, (cairo_bool_t) _eps); #endif @@ -781,7 +791,7 @@ CairoRenderContext::setupSurface(double width, double height) break; } - return _finishSurfaceSetup (surface); + return _finishSurfaceSetup (surface, &ctm); } bool -- cgit v1.2.3 From dc1d762c9e37b7932411fe513d5222c2928a2251 Mon Sep 17 00:00:00 2001 From: Josh Andler Date: Fri, 2 Oct 2009 21:17:41 +0000 Subject: Patch by Max to add option for better Save As behavior. (bzr r8697) --- src/extension/system.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/extension') diff --git a/src/extension/system.cpp b/src/extension/system.cpp index 43e7af494..f41217959 100644 --- a/src/extension/system.cpp +++ b/src/extension/system.cpp @@ -588,6 +588,15 @@ get_file_save_path (SPDocument *doc, FileSaveMethod method) { Glib::ustring path; switch (method) { case FILE_SAVE_METHOD_SAVE_AS: + { + bool use_current_dir = prefs->getBool("/dialogs/save_as/use_current_dir"); + if (doc->uri && use_current_dir) { + path = Glib::path_get_dirname(doc->uri); + } else { + path = prefs->getString("/dialogs/save_as/path"); + } + break; + } case FILE_SAVE_METHOD_TEMPORARY: path = prefs->getString("/dialogs/save_as/path"); break; -- cgit v1.2.3 From ec444a1a2619f5b984170583e42c2980afe787e9 Mon Sep 17 00:00:00 2001 From: Josh Andler Date: Wed, 14 Oct 2009 21:53:02 +0000 Subject: Patch by Tavmjong for 451588 (bzr r8771) --- src/extension/internal/pov-out.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'src/extension') diff --git a/src/extension/internal/pov-out.cpp b/src/extension/internal/pov-out.cpp index f30cbc317..f8916655d 100644 --- a/src/extension/internal/pov-out.cpp +++ b/src/extension/internal/pov-out.cpp @@ -306,10 +306,12 @@ bool PovOutput::doCurve(SPItem *item, const String &id) //Count the NR_CURVETOs/LINETOs (including closing line segment) int segmentCount = 0; for(Geom::PathVector::const_iterator it = pathv.begin(); it != pathv.end(); ++it) - { + { segmentCount += (*it).size(); - if (it->closed()) - segmentCount += 1; + + // If segment not closed, add space for a closing segment. + if (!it->closed()) segmentCount += 1; + } out("/*###################################################\n"); @@ -340,10 +342,14 @@ bool PovOutput::doCurve(SPItem *item, const String &id) cminmax.expandTo(pit->initialPoint()); /** - * For all segments in the subpath + * For all segments in the subpath, including extra closing segment defined by 2geom */ for (Geom::Path::const_iterator cit = pit->begin(); cit != pit->end_closed(); ++cit) - { + { + + // If path is closed, we don't need extra closing segment. + if( pit->closed() && cit == pit->end() ) + continue; if( is_straight_curve(*cit) ) { @@ -374,6 +380,11 @@ bool PovOutput::doCurve(SPItem *item, const String &id) out(",\n"); else out("\n"); + if (segmentNr > segmentCount) + { + err("Too many segments"); + return false; + } cminmax.expandTo(cit->finalPoint()); -- cgit v1.2.3 From d1e778ca433a52ab65916e2a6c4d36f78faddbf1 Mon Sep 17 00:00:00 2001 From: Josh Andler Date: Fri, 16 Oct 2009 22:28:40 +0000 Subject: More proper fix for 451588 by Tavmjong (bzr r8788) --- src/extension/internal/pov-out.cpp | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'src/extension') diff --git a/src/extension/internal/pov-out.cpp b/src/extension/internal/pov-out.cpp index f8916655d..1cb14fb58 100644 --- a/src/extension/internal/pov-out.cpp +++ b/src/extension/internal/pov-out.cpp @@ -303,16 +303,28 @@ bool PovOutput::doCurve(SPItem *item, const String &id) Geom::Matrix tf = sp_item_i2d_affine(item); Geom::PathVector pathv = pathv_to_linear_and_cubic_beziers( curve->get_pathvector() * tf ); - //Count the NR_CURVETOs/LINETOs (including closing line segment) + /* + * We need to know the number of segments (NR_CURVETOs/LINETOs, including + * closing line segment) before we write out segment data. Since we are + * going to skip degenerate (zero length) paths, we need to loop over all + * subpaths and segments first. + */ int segmentCount = 0; - for(Geom::PathVector::const_iterator it = pathv.begin(); it != pathv.end(); ++it) + /** + * For all Subpaths in the + */ + for (Geom::PathVector::const_iterator pit = pathv.begin(); pit != pathv.end(); ++pit) + { + /** + * For all segments in the subpath, including extra closing segment defined by 2geom + */ + for (Geom::Path::const_iterator cit = pit->begin(); cit != pit->end_closed(); ++cit) { - segmentCount += (*it).size(); - - // If segment not closed, add space for a closing segment. - if (!it->closed()) segmentCount += 1; + // Skip zero length segments. + if( !cit->isDegenerate() ) ++segmentCount; } + } out("/*###################################################\n"); out("### PRISM: %s\n", id.c_str()); @@ -347,8 +359,8 @@ bool PovOutput::doCurve(SPItem *item, const String &id) for (Geom::Path::const_iterator cit = pit->begin(); cit != pit->end_closed(); ++cit) { - // If path is closed, we don't need extra closing segment. - if( pit->closed() && cit == pit->end() ) + // Skip zero length segments + if( cit->isDegenerate() ) continue; if( is_straight_curve(*cit) ) @@ -371,7 +383,7 @@ bool PovOutput::doCurve(SPItem *item, const String &id) nrNodes += 8; } else - { + { err("logical error, because pathv_to_linear_and_cubic_beziers was used"); return false; } -- cgit v1.2.3 From 62696234b51b95b6da2b2612162cc4f185481a47 Mon Sep 17 00:00:00 2001 From: Josh Andler Date: Sun, 18 Oct 2009 19:17:16 +0000 Subject: Patch by Adib for 429529 (bzr r8792) --- src/extension/system.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/extension') diff --git a/src/extension/system.cpp b/src/extension/system.cpp index f41217959..6ffa7f57f 100644 --- a/src/extension/system.cpp +++ b/src/extension/system.cpp @@ -206,7 +206,7 @@ save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension, } /* If autodetect fails, save as Inkscape SVG */ if (omod == NULL) { - omod = dynamic_cast(db.get(SP_MODULE_KEY_OUTPUT_SVG_INKSCAPE)); + // omod = dynamic_cast(db.get(SP_MODULE_KEY_OUTPUT_SVG_INKSCAPE)); use exception and let user choose } } else { omod = dynamic_cast(key); -- cgit v1.2.3 From 7e9866358d46080aa5c4adeb830fbad43896724d Mon Sep 17 00:00:00 2001 From: bulia byak Date: Sat, 7 Nov 2009 23:59:36 +0000 Subject: revert the PS rotation part of Adrian's patch for 437550, see discussion in the bug (bzr r8820) --- src/extension/internal/cairo-render-context.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/extension') diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp index cae496543..1594ced7d 100644 --- a/src/extension/internal/cairo-render-context.cpp +++ b/src/extension/internal/cairo-render-context.cpp @@ -768,15 +768,7 @@ CairoRenderContext::setupSurface(double width, double height) #endif #ifdef CAIRO_HAS_PS_SURFACE case CAIRO_SURFACE_TYPE_PS: - if (!_eps && width > height) { - surface = cairo_ps_surface_create_for_stream(Inkscape::Extension::Internal::_write_callback, _stream, height, width); - cairo_matrix_init (&ctm, 0, -1, 1, 0, 0, 0); - cairo_matrix_translate (&ctm, -width, 0); - cairo_ps_surface_dsc_begin_page_setup (surface); - cairo_ps_surface_dsc_comment (surface, "%%PageOrientation: Landscape"); - } else { - surface = cairo_ps_surface_create_for_stream(Inkscape::Extension::Internal::_write_callback, _stream, width, height); - } + surface = cairo_ps_surface_create_for_stream(Inkscape::Extension::Internal::_write_callback, _stream, width, height); if(CAIRO_STATUS_SUCCESS != cairo_surface_status(surface)) { return FALSE; } -- cgit v1.2.3 From ed4a352d52944eb8a4695762c2075f2f12fab562 Mon Sep 17 00:00:00 2001 From: bulia byak Date: Sun, 8 Nov 2009 00:09:18 +0000 Subject: Krzysztof's patch for 388257 (bzr r8821) --- src/extension/internal/cairo-render-context.cpp | 33 ++++++++++++++----------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'src/extension') diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp index 1594ced7d..721d3addc 100644 --- a/src/extension/internal/cairo-render-context.cpp +++ b/src/extension/internal/cairo-render-context.cpp @@ -1450,7 +1450,7 @@ CairoRenderContext::renderImage(guchar *px, unsigned int w, unsigned int h, unsi #define GLYPH_ARRAY_SIZE 64 unsigned int -CairoRenderContext::_showGlyphs(cairo_t *cr, PangoFont *font, std::vector const &glyphtext, bool is_stroke) +CairoRenderContext::_showGlyphs(cairo_t *cr, PangoFont *font, std::vector const &glyphtext, bool path) { cairo_glyph_t glyph_array[GLYPH_ARRAY_SIZE]; cairo_glyph_t *glyphs = glyph_array; @@ -1474,15 +1474,10 @@ CairoRenderContext::_showGlyphs(cairo_t *cr, PangoFont *font, std::vector GLYPH_ARRAY_SIZE) @@ -1544,20 +1539,30 @@ CairoRenderContext::renderGlyphtext(PangoFont *font, Geom::Matrix const *font_ma _showGlyphs(_cr, font, glyphtext, TRUE); } } else { - + bool fill = false, stroke = false, have_path = false; if (style->fill.isColor() || style->fill.isPaintserver()) { // set fill style _setFillStyle(style, NULL); - - _showGlyphs(_cr, font, glyphtext, FALSE); + fill = true; } if (style->stroke.isColor() || style->stroke.isPaintserver()) { // set stroke style _setStrokeStyle(style, NULL); - - // paint stroke - _showGlyphs(_cr, font, glyphtext, TRUE); + stroke = true; + } + if (fill) { + if (_is_texttopath) { + _showGlyphs(_cr, font, glyphtext, true); + have_path = true; + if (stroke) cairo_fill_preserve(_cr); + else cairo_fill(_cr); + } else { + _showGlyphs(_cr, font, glyphtext, false); + } + } + if (stroke) { + if (!have_path) _showGlyphs(_cr, font, glyphtext, true); cairo_stroke(_cr); } } -- cgit v1.2.3 From 1fae37c51a93b9df8e59703d23c0aa295dd0a4d3 Mon Sep 17 00:00:00 2001 From: Josh Andler Date: Sun, 8 Nov 2009 01:29:06 +0000 Subject: Patch for 456148 by Johan (bzr r8825) --- src/extension/internal/cairo-renderer.cpp | 80 ++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 29 deletions(-) (limited to 'src/extension') diff --git a/src/extension/internal/cairo-renderer.cpp b/src/extension/internal/cairo-renderer.cpp index da88a5eae..8cc386135 100644 --- a/src/extension/internal/cairo-renderer.cpp +++ b/src/extension/internal/cairo-renderer.cpp @@ -192,11 +192,28 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx) ctx->renderPathVector(pathv, style, &pbox); - for(Geom::PathVector::const_iterator path_it = pathv.begin(); path_it != pathv.end(); ++path_it) { - // START position - for (int i = 0; i < 2; i++) { // SP_MARKER_LOC and SP_MARKER_LOC_START - if ( shape->marker[i] ) { - SPMarker* marker = SP_MARKER (shape->marker[i]); + // START marker + for (int i = 0; i < 2; i++) { // SP_MARKER_LOC and SP_MARKER_LOC_START + if ( shape->marker[i] ) { + SPMarker* marker = SP_MARKER (shape->marker[i]); + Geom::Matrix tr; + if (marker->orient_auto) { + tr = 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)); + } + sp_shape_render_invoke_marker_rendering(marker, tr, style, ctx); + } + } + // MID marker + for (int i = 0; i < 3; i += 2) { // SP_MARKER_LOC and SP_MARKER_LOC_MID + if ( !shape->marker[i] ) continue; + SPMarker* marker = SP_MARKER (shape->marker[i]); + for(Geom::PathVector::const_iterator path_it = pathv.begin(); path_it != pathv.end(); ++path_it) { + // START position + if ( path_it != pathv.begin() + && ! ((path_it == (pathv.end()-1)) && (path_it->size_default() == 0)) ) // if this is the last path and it is a moveto-only, there is no mid marker there + { Geom::Matrix tr; if (marker->orient_auto) { tr = sp_shape_marker_get_transform_at_start(path_it->front()); @@ -205,11 +222,8 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx) } sp_shape_render_invoke_marker_rendering(marker, tr, style, ctx); } - } - - // MID position - for (int i = 0; i < 3; i += 2) { // SP_MARKER_LOC and SP_MARKER_LOC_MID - if ( shape->marker[i] && (path_it->size_default() > 1) ) { + // MID position + if (path_it->size_default() > 1) { Geom::Path::const_iterator curve_it1 = path_it->begin(); // incoming curve Geom::Path::const_iterator curve_it2 = ++(path_it->begin()); // outgoing curve while (curve_it2 != path_it->end_default()) @@ -217,9 +231,6 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx) /* Put marker between curve_it1 and curve_it2. * Loop to end_default (so including closing segment), because when a path is closed, * there should be a midpoint marker between last segment and closing straight line segment */ - - SPMarker* marker = SP_MARKER (shape->marker[i]); - Geom::Matrix tr; if (marker->orient_auto) { tr = sp_shape_marker_get_transform(*curve_it1, *curve_it2); @@ -233,32 +244,43 @@ static void sp_shape_render (SPItem *item, CairoRenderContext *ctx) ++curve_it2; } } - } - - // END position - for (int i = 0; i < 4; i += 3) { // SP_MARKER_LOC and SP_MARKER_LOC_END - if ( shape->marker[i] ) { - SPMarker* marker = SP_MARKER (shape->marker[i]); - - /* Get reference to last curve in the path. - * For moveto-only path, this returns the "closing line segment". */ - unsigned int index = path_it->size_default(); - if (index > 0) { - index--; - } - Geom::Curve const &lastcurve = (*path_it)[index]; - + // END position + if ( path_it != (pathv.end()-1) && !path_it->empty()) { + Geom::Curve const &lastcurve = path_it->back_default(); Geom::Matrix tr; if (marker->orient_auto) { tr = sp_shape_marker_get_transform_at_end(lastcurve); } else { tr = Geom::Rotate::from_degrees(marker->orient) * Geom::Translate(lastcurve.pointAt(1)); } - sp_shape_render_invoke_marker_rendering(marker, tr, style, ctx); } } } + // END marker + for (int i = 0; i < 4; i += 3) { // SP_MARKER_LOC and SP_MARKER_LOC_END + if ( shape->marker[i] ) { + SPMarker* marker = SP_MARKER (shape->marker[i]); + + /* Get reference to last curve in the path. + * For moveto-only path, this returns the "closing line segment". */ + Geom::Path const &path_last = pathv.back(); + unsigned int index = path_last.size_default(); + if (index > 0) { + index--; + } + Geom::Curve const &lastcurve = path_last[index]; + + Geom::Matrix tr; + if (marker->orient_auto) { + tr = sp_shape_marker_get_transform_at_end(lastcurve); + } else { + tr = Geom::Rotate::from_degrees(marker->orient) * Geom::Translate(lastcurve.pointAt(1)); + } + + sp_shape_render_invoke_marker_rendering(marker, tr, style, ctx); + } + } } static void sp_group_render(SPItem *item, CairoRenderContext *ctx) -- cgit v1.2.3 From f8320ca81e834951f4fb9b3d4dcf48f2db5d6fc3 Mon Sep 17 00:00:00 2001 From: bulia byak Date: Mon, 9 Nov 2009 17:14:07 +0000 Subject: regression patch from 388257 (bzr r8826) --- src/extension/internal/cairo-render-context.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/extension') diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp index 721d3addc..023a9b837 100644 --- a/src/extension/internal/cairo-render-context.cpp +++ b/src/extension/internal/cairo-render-context.cpp @@ -1541,17 +1541,14 @@ CairoRenderContext::renderGlyphtext(PangoFont *font, Geom::Matrix const *font_ma } else { bool fill = false, stroke = false, have_path = false; if (style->fill.isColor() || style->fill.isPaintserver()) { - // set fill style - _setFillStyle(style, NULL); fill = true; } if (style->stroke.isColor() || style->stroke.isPaintserver()) { - // set stroke style - _setStrokeStyle(style, NULL); stroke = true; } if (fill) { + _setFillStyle(style, NULL); if (_is_texttopath) { _showGlyphs(_cr, font, glyphtext, true); have_path = true; @@ -1562,6 +1559,7 @@ CairoRenderContext::renderGlyphtext(PangoFont *font, Geom::Matrix const *font_ma } } if (stroke) { + _setStrokeStyle(style, NULL); if (!have_path) _showGlyphs(_cr, font, glyphtext, true); cairo_stroke(_cr); } -- cgit v1.2.3 From 77c6c3e159eaf8d10a3aee72756bddb197d707cd Mon Sep 17 00:00:00 2001 From: Josh Andler Date: Mon, 9 Nov 2009 21:52:06 +0000 Subject: Patch by Adib for 271695 (bzr r8829) --- src/extension/internal/cairo-render-context.cpp | 44 ++++++++++++++++++------- src/extension/internal/cairo-render-context.h | 3 ++ 2 files changed, 35 insertions(+), 12 deletions(-) (limited to 'src/extension') diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp index 023a9b837..c33beab8a 100644 --- a/src/extension/internal/cairo-render-context.cpp +++ b/src/extension/internal/cairo-render-context.cpp @@ -125,14 +125,27 @@ CairoRenderContext::CairoRenderContext(CairoRenderer *parent) : _renderer(parent), _render_mode(RENDER_MODE_NORMAL), _clip_mode(CLIP_MODE_MASK) -{} +{ + font_table = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, font_data_free); +} CairoRenderContext::~CairoRenderContext(void) { + if(font_table != NULL) { + g_hash_table_remove_all(font_table); + } + if (_cr) cairo_destroy(_cr); if (_surface) cairo_surface_destroy(_surface); if (_layout) g_object_unref(_layout); } +void CairoRenderContext::font_data_free(gpointer data) +{ + cairo_font_face_t *font_face = (cairo_font_face_t *)data; + if (font_face) { + cairo_font_face_destroy(font_face); + } +} CairoRenderer* CairoRenderContext::getRenderer(void) const @@ -612,7 +625,7 @@ CairoRenderContext::popLayer(void) // copy over the correct CTM // It must be stored in item_transform of current state after pushState. - Geom::Matrix item_transform; + Geom::Matrix item_transform; if (_state->parent_has_userspace) item_transform = getParentState()->transform * _state->item_transform; else @@ -1015,7 +1028,7 @@ CairoRenderContext::_createPatternPainter(SPPaintServer const *const paintserver } - // Calculate the size of the surface which has to be created + // Calculate the size of the surface which has to be created #define SUBPIX_SCALE 100 // Cairo requires an integer pattern surface width/height. // Subtract 0.5 to prevent small rounding errors from increasing pattern size by one pixel. @@ -1323,7 +1336,7 @@ CairoRenderContext::renderPathVector(Geom::PathVector const & pathv, SPStyle con } bool no_fill = style->fill.isNone() || style->fill_opacity.value == 0; - bool no_stroke = style->stroke.isNone() || style->stroke_width.computed < 1e-9 || + bool no_stroke = style->stroke.isNone() || style->stroke_width.computed < 1e-9 || style->stroke_opacity.value == 0; if (no_fill && no_stroke) @@ -1492,10 +1505,11 @@ CairoRenderContext::renderGlyphtext(PangoFont *font, Geom::Matrix const *font_ma { // create a cairo_font_face from PangoFont double size = style->font_size.computed; - cairo_font_face_t *font_face = NULL; + gpointer fonthash = (gpointer)font; + cairo_font_face_t *font_face = (cairo_font_face_t *)g_hash_table_lookup(font_table, fonthash); FcPattern *fc_pattern = NULL; - + #ifdef USE_PANGO_WIN32 # ifdef CAIRO_HAS_WIN32_FONT LOGFONTA *lfa = pango_win32_font_logfont(font); @@ -1504,17 +1518,23 @@ CairoRenderContext::renderGlyphtext(PangoFont *font, Geom::Matrix const *font_ma ZeroMemory(&lfw, sizeof(LOGFONTW)); memcpy(&lfw, lfa, sizeof(LOGFONTA)); MultiByteToWideChar(CP_OEMCP, MB_PRECOMPOSED, lfa->lfFaceName, LF_FACESIZE, lfw.lfFaceName, LF_FACESIZE); - - font_face = cairo_win32_font_face_create_for_logfontw(&lfw); + + if(font_face == NULL) { + font_face = cairo_win32_font_face_create_for_logfontw(&lfw); + g_hash_table_insert(font_table, fonthash, font_face); + } # endif #else # ifdef CAIRO_HAS_FT_FONT PangoFcFont *fc_font = PANGO_FC_FONT(font); fc_pattern = fc_font->font_pattern; - font_face = cairo_ft_font_face_create_for_pattern(fc_pattern); + if(font_face == NULL) { + font_face = cairo_ft_font_face_create_for_pattern(fc_pattern); + g_hash_table_insert(font_table, fonthash, font_face); + } # endif #endif - + cairo_save(_cr); cairo_set_font_face(_cr, font_face); @@ -1567,8 +1587,8 @@ CairoRenderContext::renderGlyphtext(PangoFont *font, Geom::Matrix const *font_ma cairo_restore(_cr); - if (font_face) - cairo_font_face_destroy(font_face); +// if (font_face) +// cairo_font_face_destroy(font_face); return true; } diff --git a/src/extension/internal/cairo-render-context.h b/src/extension/internal/cairo-render-context.h index 930668e03..e6f2d698e 100644 --- a/src/extension/internal/cairo-render-context.h +++ b/src/extension/internal/cairo-render-context.h @@ -195,6 +195,9 @@ protected: void _concatTransform(cairo_t *cr, double xx, double yx, double xy, double yy, double x0, double y0); void _concatTransform(cairo_t *cr, Geom::Matrix const *transform); + GHashTable *font_table; + static void font_data_free(gpointer data); + CairoRenderState *_createState(void); }; -- cgit v1.2.3