From 77ff64899055fbf116b55e2eca4c53ad75c7124f Mon Sep 17 00:00:00 2001 From: johanengelen Date: Sun, 18 May 2008 13:47:34 +0000 Subject: [PATCH] add SVG Output preferences --- src/ui/dialog/inkscape-preferences.cpp | 38 ++++++++++++++++++++++++++ src/ui/dialog/inkscape-preferences.h | 14 +++++++++- 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index f8e7b8e08..e179f1581 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -106,6 +106,7 @@ InkscapePreferences::InkscapePreferences() initPageImportExport(); initPageCMS(); initPageGrids(); + initPageSVGOutput(); initPageMisc(); signalPresent().connect(sigc::mem_fun(*this, &InkscapePreferences::_presentPages)); @@ -889,6 +890,43 @@ void InkscapePreferences::initPageGrids() this->AddPage(_page_grids, _("Grids"), PREFS_PAGE_GRIDS); } +void InkscapePreferences::initPageSVGOutput() +{ + _svgoutput_usenamedcolors.init( _("Use named colors"), "options.svgoutput", "usenamedcolors", false); + _page_svgoutput.add_line( false, "", _svgoutput_usenamedcolors, "", _("If set, write the CSS name of the color instead of it's numeric value."), false); + + _page_svgoutput.add_group_header( _("XML looks")); + + _svgoutput_inlineattrs.init( _("Inline attributes"), "options.svgoutput", "inlineattrs", false); + _page_svgoutput.add_line( false, "", _svgoutput_inlineattrs, "", _("Inline the XML attributes"), false); + + _svgoutput_indent.init("options.svgoutput", "indent", 0.0, 1000.0, 1.0, 2.0, 2.0, true, false); + _page_svgoutput.add_line( false, _("Indent spaces"), _svgoutput_indent, "", _("The number of spaces to use for indentation."), false); + + _page_svgoutput.add_group_header( _("Path string")); + + _svgoutput_allowrelativecoordinates.init( _("Allow relative coordinates"), "options.svgoutput", "allowrelativecoordinates", true); + _page_svgoutput.add_line( false, "", _svgoutput_allowrelativecoordinates, "", _("If set, relative coordinates may be used in path data"), false); + + /* seems this is never used in Inkscape code + _svgoutput_allowshorthands.init( _("Allow shorthands"), "options.svgoutput", "allowshorthands", true); + _page_svgoutput.add_line( false, "", _svgoutput_allowshorthands, "", _(""), false); + */ + + _svgoutput_forcerepeatcommands.init( _("Force repeat commands"), "options.svgoutput", "forcerepeatcommands", false); + _page_svgoutput.add_line( false, "", _svgoutput_forcerepeatcommands, "", _("If set, force repeating of the same command (i.e. output 'L 1,2 L 3,4' instead of 'L 1,2 3,4')."), false); + + _page_svgoutput.add_group_header( _("Numeric data")); + + _svgoutput_numericprecision.init("options.svgoutput", "numericprecision", 0.0, 1000.0, 1.0, 2.0, 8.0, true, false); + _page_svgoutput.add_line( false, _("Numeric precision"), _svgoutput_numericprecision, "", _("The number of digits to use behind the comma."), false); + + _svgoutput_minimumexponent.init("options.svgoutput", "minimumexponent", -100.0, 100.0, 1.0, 2.0, -8.0, true, false); + _page_svgoutput.add_line( false, _("Minimum exponent"), _svgoutput_minimumexponent, "", _("The minimum size of a number (10 to the power of this exponent), smaller numbers will be written as zero."), false); + + this->AddPage(_page_svgoutput, _("SVG Output"), PREFS_PAGE_SVGOUTPUT); +} + void InkscapePreferences::initPageMisc() { _misc_comment.init( _("Add label comments to printing output"), "printing.debug", "show-label-comments", false); diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index 5202e09d3..ac378bf98 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -68,6 +68,7 @@ enum { PREFS_PAGE_IMPORTEXPORT, PREFS_PAGE_CMS, PREFS_PAGE_GRIDS, + PREFS_PAGE_SVGOUTPUT, PREFS_PAGE_MISC }; @@ -106,7 +107,7 @@ protected: DialogPage _page_mouse, _page_scrolling, _page_steps, _page_tools, _page_windows, _page_clones, _page_mask, _page_transforms, _page_filters, _page_select, - _page_importexport, _page_cms, _page_grids, _page_misc; + _page_importexport, _page_cms, _page_grids, _page_svgoutput, _page_misc; DialogPage _page_selector, _page_node, _page_tweak, _page_zoom, _page_shapes, _page_pencil, _page_pen, _page_calligraphy, _page_text, _page_gradient, _page_connector, _page_dropper; DialogPage _page_rectangle, _page_3dbox, _page_ellipse, _page_star, _page_spiral, _page_paintbucket, _page_eraser; @@ -205,6 +206,16 @@ protected: PrefColorPicker _grids_axonom_empcolor; PrefSpinButton _grids_axonom_empspacing; + // SVG Output page: + PrefCheckButton _svgoutput_usenamedcolors; + PrefSpinButton _svgoutput_numericprecision; + PrefSpinButton _svgoutput_minimumexponent; + PrefCheckButton _svgoutput_inlineattrs; + PrefSpinButton _svgoutput_indent; + PrefCheckButton _svgoutput_allowrelativecoordinates; + PrefCheckButton _svgoutput_allowshorthands; + PrefCheckButton _svgoutput_forcerepeatcommands; + PrefEntryButtonHBox _importexport_ocal_url; PrefEntry _importexport_ocal_username; PrefEntry _importexport_ocal_password; @@ -239,6 +250,7 @@ protected: void initPageImportExport(); void initPageCMS(); void initPageGrids(); + void initPageSVGOutput(); void initPageMisc(); void _presentPages(); -- 2.30.2