diff options
Diffstat (limited to 'src/extension')
| -rw-r--r-- | src/extension/CMakeLists.txt | 10 | ||||
| -rw-r--r-- | src/extension/error-file.cpp | 4 | ||||
| -rw-r--r-- | src/extension/extension.cpp | 26 | ||||
| -rw-r--r-- | src/extension/extension.h | 10 | ||||
| -rw-r--r-- | src/extension/implementation/script.cpp | 15 | ||||
| -rw-r--r-- | src/extension/implementation/script.h | 3 | ||||
| -rw-r--r-- | src/extension/internal/filter/paint.h | 2 | ||||
| -rw-r--r-- | src/extension/internal/odf.cpp | 32 | ||||
| -rw-r--r-- | src/extension/internal/pdf-input-cairo.cpp | 10 | ||||
| -rw-r--r-- | src/extension/internal/pdf-input-cairo.h | 11 | ||||
| -rw-r--r-- | src/extension/internal/pdfinput/pdf-input.cpp | 10 | ||||
| -rw-r--r-- | src/extension/internal/pdfinput/pdf-input.h | 7 | ||||
| -rw-r--r-- | src/extension/prefdialog.cpp | 15 | ||||
| -rw-r--r-- | src/extension/system.cpp | 35 |
14 files changed, 115 insertions, 75 deletions
diff --git a/src/extension/CMakeLists.txt b/src/extension/CMakeLists.txt index 273067e80..f6311721d 100644 --- a/src/extension/CMakeLists.txt +++ b/src/extension/CMakeLists.txt @@ -36,10 +36,9 @@ set(extension_SRC internal/cairo-render-context.cpp internal/cairo-renderer.cpp internal/cairo-renderer-pdf-out.cpp + internal/cdr-input.cpp internal/emf-inout.cpp internal/emf-print.cpp - internal/wmf-inout.cpp - internal/wmf-print.cpp internal/gdkpixbuf-input.cpp internal/gimpgrad.cpp internal/grid.cpp @@ -54,6 +53,8 @@ set(extension_SRC internal/svg.cpp internal/svgz.cpp internal/vsd-input.cpp + internal/wmf-inout.cpp + internal/wmf-print.cpp internal/filter/filter-all.cpp internal/filter/filter-file.cpp @@ -102,11 +103,10 @@ set(extension_SRC internal/cairo-render-context.h internal/cairo-renderer-pdf-out.h internal/cairo-renderer.h + internal/cdr-input.h internal/clear-n_.h internal/emf-inout.h internal/emf-print.h - internal/wmf-inout.h - internal/wmf-print.h internal/filter/bevels.h internal/filter/blurs.h internal/filter/bumps.h @@ -138,6 +138,8 @@ set(extension_SRC internal/svg.h internal/svgz.h internal/vsd-input.h + internal/wmf-inout.h + internal/wmf-print.h script/InkscapeScript.h ) diff --git a/src/extension/error-file.cpp b/src/extension/error-file.cpp index 2a56f55e8..778295f47 100644 --- a/src/extension/error-file.cpp +++ b/src/extension/error-file.cpp @@ -56,7 +56,11 @@ ErrorFileNotice::ErrorFileNotice (void) : g_free(ext_error_file); set_message(dialog_text, true); +#if WITH_GTKMM_3_0 + Gtk::Box * vbox = get_content_area(); +#else Gtk::Box * vbox = get_vbox(); +#endif /* This is some filler text, needs to change before relase */ Inkscape::Preferences *prefs = Inkscape::Preferences::get(); diff --git a/src/extension/extension.cpp b/src/extension/extension.cpp index 4e2c5b9e4..28f556e75 100644 --- a/src/extension/extension.cpp +++ b/src/extension/extension.cpp @@ -19,12 +19,16 @@ # include "config.h" #endif - #include <glibmm/i18n.h> #include <gtkmm/box.h> #include <gtkmm/label.h> #include <gtkmm/frame.h> -#include <gtkmm/table.h> + +#if WITH_GTKMM_3_0 +# include <gtkmm/grid.h> +#else +# include <gtkmm/table.h> +#endif #include "inkscape.h" #include "extension/implementation/implementation.h" @@ -720,7 +724,12 @@ Extension::get_info_widget(void) Gtk::Frame * info = Gtk::manage(new Gtk::Frame("General Extension Information")); retval->pack_start(*info, true, true, 5); +#if WITH_GTKMM_3_0 + Gtk::Grid * table = Gtk::manage(new Gtk::Grid()); +#else Gtk::Table * table = Gtk::manage(new Gtk::Table()); +#endif + info->add(*table); int row = 0; @@ -733,8 +742,11 @@ Extension::get_info_widget(void) return retval; } -void -Extension::add_val(Glib::ustring labelstr, Glib::ustring valuestr, Gtk::Table * table, int * row) +#if WITH_GTKMM_3_0 +void Extension::add_val(Glib::ustring labelstr, Glib::ustring valuestr, Gtk::Grid * table, int * row) +#else +void Extension::add_val(Glib::ustring labelstr, Glib::ustring valuestr, Gtk::Table * table, int * row) +#endif { Gtk::Label * label; Gtk::Label * value; @@ -742,8 +754,14 @@ Extension::add_val(Glib::ustring labelstr, Glib::ustring valuestr, Gtk::Table * (*row)++; label = Gtk::manage(new Gtk::Label(labelstr)); value = Gtk::manage(new Gtk::Label(valuestr)); + +#if WITH_GTKMM_3_0 + table->attach(*label, 0, (*row) - 1, 1, 1); + table->attach(*value, 1, (*row) - 1, 1, 1); +#else table->attach(*label, 0, 1, (*row) - 1, *row); table->attach(*value, 1, 2, (*row) - 1, *row); +#endif label->show(); value->show(); diff --git a/src/extension/extension.h b/src/extension/extension.h index 78999631a..dcabb3df7 100644 --- a/src/extension/extension.h +++ b/src/extension/extension.h @@ -22,7 +22,12 @@ #include <sigc++/signal.h> namespace Gtk { +#if WITH_GTKMM_3_0 + class Grid; +#else class Table; +#endif + class VBox; class Widget; } @@ -285,8 +290,11 @@ public: Gtk::VBox * get_help_widget(void); Gtk::VBox * get_params_widget(void); protected: +#if WITH_GTKMM_3_0 + inline static void add_val(Glib::ustring labelstr, Glib::ustring valuestr, Gtk::Grid * table, int * row); +#else inline static void add_val(Glib::ustring labelstr, Glib::ustring valuestr, Gtk::Table * table, int * row); - +#endif }; diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index d3aeace55..3ac1e06ab 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -23,6 +23,8 @@ #include <gtkmm/main.h> #include <gtkmm/scrolledwindow.h> #include <gtkmm/textview.h> +#include <glibmm/miscutils.h> +#include <glibmm/convert.h> #include <unistd.h> #include <errno.h> @@ -852,7 +854,11 @@ void Script::checkStderr (const Glib::ustring &data, GtkWidget *dlg = GTK_WIDGET(warning.gobj()); sp_transientize(dlg); +#if WITH_GTKMM_3_0 + Gtk::Box * vbox = warning.get_content_area(); +#else Gtk::Box * vbox = warning.get_vbox(); +#endif /* Gtk::TextView * textview = new Gtk::TextView(Gtk::TextBuffer::create()); */ Gtk::TextView * textview = new Gtk::TextView(); @@ -956,7 +962,14 @@ int Script::execute (const std::list<std::string> &in_command, // assemble the rest of argv std::copy(in_params.begin(), in_params.end(), std::back_inserter(argv)); if (!filein.empty()) { - argv.push_back(filein); + if(Glib::path_is_absolute(filein)) + argv.push_back(filein); + else { + std::vector<std::string> buildargs; + buildargs.push_back(Glib::get_current_dir()); + buildargs.push_back(filein); + argv.push_back(Glib::build_filename(buildargs)); + } } int stdout_pipe, stderr_pipe; diff --git a/src/extension/implementation/script.h b/src/extension/implementation/script.h index f52683623..270c361af 100644 --- a/src/extension/implementation/script.h +++ b/src/extension/implementation/script.h @@ -15,6 +15,9 @@ #include "implementation.h" #include <gtkmm/enums.h> +#include <glibmm/main.h> +#include <glibmm/spawn.h> +#include <glibmm/fileutils.h> namespace Inkscape { namespace XML { diff --git a/src/extension/internal/filter/paint.h b/src/extension/internal/filter/paint.h index ad396e08f..f04dd92f9 100644 --- a/src/extension/internal/filter/paint.h +++ b/src/extension/internal/filter/paint.h @@ -88,7 +88,7 @@ public: "<param name=\"noise\" gui-text=\"" N_("Noise reduction:") "\" type=\"int\" appearance=\"full\" min=\"1\" max=\"1000\">10</param>\n" "<param name=\"smooth\" gui-text=\"" N_("Smoothness:") "\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0.01\" max=\"10.00\">1</param>\n" "</page>\n" - "<page name=\"graintab\" _gui-text=\""N_("Grain") "\">\n" + "<page name=\"graintab\" _gui-text=\"" N_("Grain") "\">\n" "<param name=\"grain\" gui-text=\"" N_("Grain mode") "\" type=\"boolean\" >true</param>\n" "<param name=\"grainxf\" gui-text=\"" N_("Horizontal frequency:") "\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0\" max=\"1000\">1000</param>\n" "<param name=\"grainyf\" gui-text=\"" N_("Vertical frequency:") "\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0\" max=\"1000\">1000</param>\n" diff --git a/src/extension/internal/odf.cpp b/src/extension/internal/odf.cpp index 0639ae8d0..bd74ba47c 100644 --- a/src/extension/internal/odf.cpp +++ b/src/extension/internal/odf.cpp @@ -83,8 +83,8 @@ #include "dom/io/stringstream.h" +#include "inkscape-version.h" #include "document.h" - #include "extension/extension.h" @@ -1240,7 +1240,8 @@ bool OdfOutput::writeMeta(ZipFile &zf) outs.printf("xmlns:anim=\"urn:oasis:names:tc:opendocument:xmlns:animation:1.0\"\n"); outs.printf("office:version=\"1.0\">\n"); outs.printf("<office:meta>\n"); - outs.printf(" <meta:generator>Inkscape.org - 0.45</meta:generator>\n"); + Glib::ustring tmp = Glib::ustring(" <meta:generator>Inkscape.org - ") + Inkscape::version_string + "</meta:generator>\n"; + outs.writeString(tmp); outs.printf(" <meta:initial-creator>%#s</meta:initial-creator>\n", creator.c_str()); outs.printf(" <meta:creation-date>%#s</meta:creation-date>\n", date.c_str()); @@ -1465,7 +1466,7 @@ bool OdfOutput::writeStyle(ZipFile &zf) outs.printf("<!--\n"); outs.printf("*************************************************************************\n"); outs.printf(" E N D O F F I L E\n"); - outs.printf(" Have a nice day - ishmal\n"); + outs.printf(" Have a nice day\n"); outs.printf("*************************************************************************\n"); outs.printf("-->\n"); outs.printf("\n"); @@ -2170,7 +2171,7 @@ bool OdfOutput::writeStyleFooter(Writer &outs) outs.printf("<!--\n"); outs.printf("*************************************************************************\n"); outs.printf(" E N D O F F I L E\n"); - outs.printf(" Have a nice day - ishmal\n"); + outs.printf(" Have a nice day\n"); outs.printf("*************************************************************************\n"); outs.printf("-->\n"); outs.printf("\n"); @@ -2281,7 +2282,7 @@ bool OdfOutput::writeContentFooter(Writer &outs) outs.printf("<!--\n"); outs.printf("*************************************************************************\n"); outs.printf(" E N D O F F I L E\n"); - outs.printf(" Have a nice day - ishmal\n"); + outs.printf(" Have a nice day\n"); outs.printf("*************************************************************************\n"); outs.printf("-->\n"); outs.printf("\n"); @@ -2441,27 +2442,6 @@ OdfOutput::check (Inkscape::Extension::Extension */*module*/) -//######################################################################## -//# I N P U T -//######################################################################## - - - -//####################### -//# L A T E R !!! :-) -//####################### - - - - - - - - - - - - } //namespace Internal } //namespace Extension diff --git a/src/extension/internal/pdf-input-cairo.cpp b/src/extension/internal/pdf-input-cairo.cpp index 0a9dd8399..c83ebad82 100644 --- a/src/extension/internal/pdf-input-cairo.cpp +++ b/src/extension/internal/pdf-input-cairo.cpp @@ -108,7 +108,7 @@ PdfImportCairoDialog::PdfImportCairoDialog(PopplerDocument *doc) #if WITH_GTKMM_3_0 _fallbackPrecisionSlider_adj = Gtk::Adjustment::create(2, 1, 256, 1, 10, 10); - _fallbackPrecisionSlider = Gtk::manage(new Gtk::HScale(_fallbackPrecisionSlider_adj)); + _fallbackPrecisionSlider = Gtk::manage(new Gtk::Scale(_fallbackPrecisionSlider_adj)); #else _fallbackPrecisionSlider_adj = Gtk::manage(new class Gtk::Adjustment(2, 1, 256, 1, 10, 10)); _fallbackPrecisionSlider = Gtk::manage(new class Gtk::HScale(*_fallbackPrecisionSlider_adj)); @@ -224,9 +224,17 @@ PdfImportCairoDialog::PdfImportCairoDialog(PopplerDocument *doc) vbox1->pack_start(*_importSettingsFrame, Gtk::PACK_EXPAND_PADDING, 0); hbox1->pack_start(*vbox1); hbox1->pack_start(*_previewArea, Gtk::PACK_EXPAND_WIDGET, 4); + +#if WITH_GTKMM_3_0 + get_content_area()->set_homogeneous(false); + get_content_area()->set_spacing(0); + get_content_area()->pack_start(*hbox1); +#else this->get_vbox()->set_homogeneous(false); this->get_vbox()->set_spacing(0); this->get_vbox()->pack_start(*hbox1); +#endif + this->set_title(_("PDF Import Settings")); this->set_modal(true); sp_transientize(GTK_WIDGET(this->gobj())); //Make transient diff --git a/src/extension/internal/pdf-input-cairo.h b/src/extension/internal/pdf-input-cairo.h index 81e9a8f00..66f1e5e7e 100644 --- a/src/extension/internal/pdf-input-cairo.h +++ b/src/extension/internal/pdf-input-cairo.h @@ -37,6 +37,14 @@ #include "../implementation/implementation.h" +namespace Gtk { +#if WITH_GTKMM_3_0 + class Scale; +#else + class HScale; +#endif +} + namespace Inkscape { namespace UI { @@ -85,10 +93,11 @@ private: class Inkscape::UI::Widget::Frame * _pageSettingsFrame; class Gtk::Label * _labelPrecision; class Gtk::Label * _labelPrecisionWarning; - class Gtk::HScale * _fallbackPrecisionSlider; #if WITH_GTKMM_3_0 + class Gtk::Scale * _fallbackPrecisionSlider; Glib::RefPtr<Gtk::Adjustment> _fallbackPrecisionSlider_adj; #else + class Gtk::HScale * _fallbackPrecisionSlider; class Gtk::Adjustment *_fallbackPrecisionSlider_adj; #endif class Gtk::Label * _labelPrecisionComment; diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp index 90d53c6b0..531cda20a 100644 --- a/src/extension/internal/pdfinput/pdf-input.cpp +++ b/src/extension/internal/pdfinput/pdf-input.cpp @@ -124,7 +124,7 @@ PdfImportDialog::PdfImportDialog(PDFDoc *doc, const gchar */*uri*/) #if WITH_GTKMM_3_0 _fallbackPrecisionSlider_adj = Gtk::Adjustment::create(2, 1, 256, 1, 10, 10); - _fallbackPrecisionSlider = Gtk::manage(new class Gtk::HScale(_fallbackPrecisionSlider_adj)); + _fallbackPrecisionSlider = Gtk::manage(new class Gtk::Scale(_fallbackPrecisionSlider_adj)); #else _fallbackPrecisionSlider_adj = Gtk::manage(new class Gtk::Adjustment(2, 1, 256, 1, 10, 10)); _fallbackPrecisionSlider = Gtk::manage(new class Gtk::HScale(*_fallbackPrecisionSlider_adj)); @@ -240,9 +240,17 @@ PdfImportDialog::PdfImportDialog(PDFDoc *doc, const gchar */*uri*/) vbox1->pack_start(*_importSettingsFrame, Gtk::PACK_EXPAND_PADDING, 0); hbox1->pack_start(*vbox1); hbox1->pack_start(*_previewArea, Gtk::PACK_EXPAND_WIDGET, 4); + +#if WITH_GTKMM_3_0 + get_content_area()->set_homogeneous(false); + get_content_area()->set_spacing(0); + get_content_area()->pack_start(*hbox1); +#else this->get_vbox()->set_homogeneous(false); this->get_vbox()->set_spacing(0); this->get_vbox()->pack_start(*hbox1); +#endif + this->set_title(_("PDF Import Settings")); this->set_modal(true); sp_transientize(GTK_WIDGET(this->gobj())); //Make transient diff --git a/src/extension/internal/pdfinput/pdf-input.h b/src/extension/internal/pdfinput/pdf-input.h index e9da5b27c..3710e4667 100644 --- a/src/extension/internal/pdfinput/pdf-input.h +++ b/src/extension/internal/pdfinput/pdf-input.h @@ -39,7 +39,11 @@ namespace Gtk { class DrawingArea; class Frame; class HBox; +#if WITH_GTKMM_3_0 + class Scale; +#else class HScale; +#endif class VBox; class Label; } @@ -95,10 +99,11 @@ private: class Inkscape::UI::Widget::Frame * _pageSettingsFrame; class Gtk::Label * _labelPrecision; class Gtk::Label * _labelPrecisionWarning; - class Gtk::HScale * _fallbackPrecisionSlider; #if WITH_GTKMM_3_0 + class Gtk::Scale * _fallbackPrecisionSlider; Glib::RefPtr<Gtk::Adjustment> _fallbackPrecisionSlider_adj; #else + class Gtk::HScale * _fallbackPrecisionSlider; class Gtk::Adjustment *_fallbackPrecisionSlider_adj; #endif class Gtk::Label * _labelPrecisionComment; diff --git a/src/extension/prefdialog.cpp b/src/extension/prefdialog.cpp index 649dc398a..f3c6508af 100644 --- a/src/extension/prefdialog.cpp +++ b/src/extension/prefdialog.cpp @@ -67,7 +67,12 @@ PrefDialog::PrefDialog (Glib::ustring name, gchar const * help, Gtk::Widget * co hbox->pack_start(*controls, true, true, 6); hbox->show(); + +#if WITH_GTKMM_3_0 + this->get_content_area()->pack_start(*hbox, true, true, 6); +#else this->get_vbox()->pack_start(*hbox, true, true, 6); +#endif /* Gtk::Button * help_button = add_button(Gtk::Stock::HELP, Gtk::RESPONSE_HELP); @@ -95,14 +100,24 @@ PrefDialog::PrefDialog (Glib::ustring name, gchar const * help, Gtk::Widget * co #endif sep->show(); + +#if WITH_GTKMM_3_0 + this->get_content_area()->pack_start(*sep, true, true, 4); +#else this->get_vbox()->pack_start(*sep, true, true, 4); +#endif hbox = Gtk::manage(new Gtk::HBox()); _button_preview = _param_preview->get_widget(NULL, NULL, &_signal_preview); _button_preview->show(); hbox->pack_start(*_button_preview, true, true,6); hbox->show(); + +#if WITH_GTKMM_3_0 + this->get_content_area()->pack_start(*hbox, true, true, 6); +#else this->get_vbox()->pack_start(*hbox, true, true, 6); +#endif Gtk::Box * hbox = dynamic_cast<Gtk::Box *>(_button_preview); if (hbox != NULL) { diff --git a/src/extension/system.cpp b/src/extension/system.cpp index 60cd21d71..56cc6d1af 100644 --- a/src/extension/system.cpp +++ b/src/extension/system.cpp @@ -22,6 +22,7 @@ #include <interface.h> #include <unistd.h> +#include <glibmm/miscutils.h> #include "system.h" #include "preferences.h" @@ -69,34 +70,6 @@ static Extension *build_from_reprdoc(Inkscape::XML::Document *doc, Implementatio */ SPDocument *open(Extension *key, gchar const *filename) { - // Convert to absolute pathname to tolerate chdir(). - bool relpath = (filename[0] != '/'); -#ifdef WIN32 - relpath &= (filename[0] != '\\') && !(isalpha(filename[0]) && (filename[1] == ':')); -#endif - - // Do not consider an URI as a relative path. - if (relpath) { - gchar const * cp = filename; - - while (isalpha(*cp) || isdigit(*cp) || *cp == '+' || *cp == '-' || *cp == '.') - cp++; - - relpath = *cp != ':' || cp[1] != '/' || cp[2] != '/'; - } - - if (relpath) { - gchar * curdir = NULL; -#ifndef WIN32 - curdir = getcwd(NULL, 0); -#else - curdir = _getcwd(NULL, 0); -#endif - - filename = g_build_filename(curdir, filename, NULL); - free(curdir); - } - Input *imod = NULL; if (key == NULL) { @@ -138,9 +111,6 @@ SPDocument *open(Extension *key, gchar const *filename) } if (!imod->prefs(filename)) { - if (relpath){ - free((void *) filename); - } return NULL; } @@ -163,9 +133,6 @@ SPDocument *open(Extension *key, gchar const *filename) imod->set_gui(true); } - if (relpath){ - free((void *) filename); - } return doc; } |
