From ccf75a138802b61ef2a8bbca81430d8402875028 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Wed, 29 May 2013 13:56:17 +0200 Subject: Fix for command line EPS/PS export (bug 1173776). Patch from Vinipsmaker. (bzr r12345) --- src/extension/internal/cairo-ps-out.cpp | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/extension/internal/cairo-ps-out.cpp b/src/extension/internal/cairo-ps-out.cpp index 983c9dfb5..5ce9a21f3 100644 --- a/src/extension/internal/cairo-ps-out.cpp +++ b/src/extension/internal/cairo-ps-out.cpp @@ -66,7 +66,7 @@ bool CairoEpsOutput::check (Inkscape::Extension::Extension * /*module*/) static bool ps_print_document_to_file(SPDocument *doc, gchar const *filename, unsigned int level, bool texttopath, bool omittext, - bool filtertobitmap, int resolution, const gchar * const exportId, bool exportDrawing, bool exportCanvas, bool eps = false) + bool filtertobitmap, int resolution, const gchar * const exportId, bool exportDrawing, bool exportCanvas, float bleedmargin_px, bool eps = false) { doc->ensureUpToDate(); @@ -104,7 +104,7 @@ ps_print_document_to_file(SPDocument *doc, gchar const *filename, unsigned int l bool ret = ctx->setPsTarget(filename); if(ret) { /* Render document */ - ret = renderer->setupDocument(ctx, doc, pageBoundingBox, 0., base); + ret = renderer->setupDocument(ctx, doc, pageBoundingBox, bleedmargin_px, base); if (ret) { renderer->renderItem(ctx, base); ret = ctx->finish(); @@ -174,6 +174,11 @@ CairoPsOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar con bool new_areaDrawing = !new_areaPage; + float bleedmargin_px = 0.; + try { + bleedmargin_px = ext->get_param_float("bleed"); + } catch(...) {} + const gchar *new_exportId = NULL; try { new_exportId = mod->get_param_string("exportId"); @@ -183,7 +188,11 @@ 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_textToLaTeX, new_blurToBitmap, new_bitmapResolution, new_exportId, new_areaDrawing, new_areaPage); + ret = ps_print_document_to_file(doc, final_name, level, new_textToPath, + new_textToLaTeX, new_blurToBitmap, + new_bitmapResolution, new_exportId, + new_areaDrawing, new_areaPage, + bleedmargin_px); g_free(final_name); if (!ret) @@ -254,6 +263,11 @@ CairoEpsOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar co bool new_areaDrawing = !new_areaPage; + float bleedmargin_px = 0.; + try { + bleedmargin_px = ext->get_param_float("bleed"); + } catch(...) {} + const gchar *new_exportId = NULL; try { new_exportId = mod->get_param_string("exportId"); @@ -263,7 +277,11 @@ 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_textToLaTeX, new_blurToBitmap, new_bitmapResolution, new_exportId, new_areaDrawing, new_areaPage, true); + ret = ps_print_document_to_file(doc, final_name, level, new_textToPath, + new_textToLaTeX, new_blurToBitmap, + new_bitmapResolution, new_exportId, + new_areaDrawing, new_areaPage, + bleedmargin_px, true); g_free(final_name); if (!ret) @@ -322,6 +340,7 @@ CairoPsOutput::init (void) "<_option value=\"page\">" N_("Use document's page size") "" "<_option value=\"drawing\">" N_("Use exported object's size") "" "" + "0\n" "\n" "\n" ".ps\n" @@ -362,6 +381,7 @@ CairoEpsOutput::init (void) "<_option value=\"page\">" N_("Use document's page size") "" "<_option value=\"drawing\">" N_("Use exported object's size") "" "" + "0\n" "\n" "\n" ".eps\n" -- cgit v1.2.3 From 3c82e8251460b21c8046a418a9fefb700db0a164 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Tue, 4 Jun 2013 01:52:40 -0700 Subject: Correct to compile against recent gtkmm, including updated macports versions. Fixes bug #1179338. Fixed bugs: - https://launchpad.net/bugs/1179338 (bzr r12346.1.1) --- src/dialogs/dialog-events.cpp | 2 ++ src/display/canvas-axonomgrid.cpp | 2 ++ src/display/canvas-grid.cpp | 2 ++ src/event-context.cpp | 2 ++ src/event-log.h | 1 + src/extension/execution-env.cpp | 2 ++ src/extension/extension.cpp | 2 ++ src/extension/implementation/script.cpp | 2 ++ src/extension/internal/grid.cpp | 2 ++ src/extension/internal/pdf-input-cairo.h | 2 ++ src/extension/internal/pdfinput/pdf-input.h | 2 ++ src/extension/param/bool.cpp | 2 ++ src/extension/param/color.cpp | 2 ++ src/extension/param/description.cpp | 2 ++ src/extension/param/enum.cpp | 2 ++ src/extension/param/float.cpp | 2 ++ src/extension/param/int.cpp | 2 ++ src/extension/param/notebook.cpp | 1 + src/extension/param/radiobutton.cpp | 2 ++ src/extension/param/string.cpp | 2 ++ src/extension/prefdialog.h | 2 ++ src/helper/window.cpp | 3 +++ src/inkscape.cpp | 3 +++ src/interface.h | 2 ++ src/live_effects/parameter/originalpath.cpp | 2 ++ src/ui/dialog/aboutbox.h | 2 ++ src/ui/dialog/calligraphic-profile-rename.h | 2 ++ src/ui/dialog/color-item.cpp | 3 +++ src/ui/dialog/debug.cpp | 2 ++ src/ui/dialog/export.cpp | 2 ++ src/ui/dialog/filedialogimpl-gtkmm.h | 4 ++++ src/ui/dialog/floating-behavior.cpp | 2 ++ src/ui/dialog/font-substitution.cpp | 2 ++ src/ui/dialog/guides.h | 1 + src/ui/dialog/icon-preview.cpp | 2 ++ src/ui/dialog/layer-properties.h | 2 ++ src/ui/dialog/layers.h | 2 ++ src/ui/dialog/livepatheffect-add.h | 2 ++ src/ui/dialog/messages.h | 2 ++ src/ui/dialog/ocaldialogs.h | 2 ++ src/ui/dialog/spellcheck.h | 2 ++ src/ui/dialog/symbols.cpp | 2 ++ src/ui/dialog/text-edit.h | 2 ++ src/ui/dialog/tile.h | 2 ++ src/ui/dialog/transformation.cpp | 2 ++ src/ui/previewholder.h | 2 ++ src/ui/widget/button.h | 2 ++ src/ui/widget/color-picker.h | 3 +++ src/ui/widget/color-preview.h | 2 ++ src/ui/widget/dock-item.h | 1 + src/ui/widget/dock.h | 2 ++ src/ui/widget/entity-entry.cpp | 2 ++ src/ui/widget/filter-effect-chooser.h | 2 ++ src/ui/widget/frame.h | 2 ++ src/ui/widget/imageicon.h | 2 ++ src/ui/widget/imagetoggler.h | 2 ++ src/ui/widget/labelled.h | 1 + src/ui/widget/licensor.h | 2 ++ src/ui/widget/notebook-page.h | 2 ++ src/ui/widget/object-composite-settings.h | 2 ++ src/ui/widget/panel.cpp | 2 ++ src/ui/widget/panel.h | 2 ++ src/ui/widget/preferences-widget.cpp | 2 ++ src/ui/widget/preferences-widget.h | 3 +++ src/ui/widget/rotateable.cpp | 2 ++ src/ui/widget/selected-style.h | 2 ++ src/ui/widget/spin-scale.cpp | 3 ++- src/ui/widget/spin-scale.h | 2 ++ src/ui/widget/spin-slider.h | 2 ++ src/ui/widget/spinbutton.h | 2 ++ src/ui/widget/style-swatch.h | 2 ++ src/ui/widget/tolerance-slider.cpp | 2 ++ src/ui/widget/unit-menu.h | 2 ++ src/verbs.cpp | 2 ++ src/widgets/dash-selector.h | 2 ++ src/widgets/desktop-widget.h | 1 + src/widgets/fill-style.cpp | 2 ++ src/widgets/gradient-selector.h | 2 ++ src/widgets/gradient-vector.h | 2 ++ src/widgets/icon.cpp | 2 ++ src/widgets/icon.h | 1 + src/widgets/paint-selector.cpp | 1 + src/widgets/shrink-wrap-button.cpp | 2 ++ src/widgets/sp-attribute-widget.h | 2 ++ src/widgets/spw-utilities.cpp | 2 ++ src/widgets/stroke-marker-selector.h | 2 ++ src/widgets/swatch-selector.h | 2 ++ src/widgets/toolbox.cpp | 2 ++ 88 files changed, 175 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/dialogs/dialog-events.cpp b/src/dialogs/dialog-events.cpp index 6a12d973a..f0ea82075 100644 --- a/src/dialogs/dialog-events.cpp +++ b/src/dialogs/dialog-events.cpp @@ -15,6 +15,8 @@ # include "config.h" #endif +#include + #include #include #include diff --git a/src/display/canvas-axonomgrid.cpp b/src/display/canvas-axonomgrid.cpp index 170684328..2d3064649 100644 --- a/src/display/canvas-axonomgrid.cpp +++ b/src/display/canvas-axonomgrid.cpp @@ -17,6 +17,8 @@ # include "config.h" #endif +#include + #include #include diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp index 88da22835..ac7f53411 100644 --- a/src/display/canvas-grid.cpp +++ b/src/display/canvas-grid.cpp @@ -17,6 +17,8 @@ # include "config.h" #endif +#include + #include #include diff --git a/src/event-context.cpp b/src/event-context.cpp index cec3a6e68..4a0608d62 100644 --- a/src/event-context.cpp +++ b/src/event-context.cpp @@ -18,6 +18,8 @@ # include "config.h" #endif +#include + #include "shortcuts.h" #include "file.h" #include "event-context.h" diff --git a/src/event-log.h b/src/event-log.h index cabc3ae9a..55f31bea5 100644 --- a/src/event-log.h +++ b/src/event-log.h @@ -10,6 +10,7 @@ #ifndef INKSCAPE_EVENT_LOG_H #define INKSCAPE_EVENT_LOG_H +#include #include #include #include diff --git a/src/extension/execution-env.cpp b/src/extension/execution-env.cpp index 4058fd787..14b397532 100644 --- a/src/extension/execution-env.cpp +++ b/src/extension/execution-env.cpp @@ -10,6 +10,8 @@ #include +#include + #include "gtkmm/messagedialog.h" #include "execution-env.h" diff --git a/src/extension/extension.cpp b/src/extension/extension.cpp index f9cf70960..0d91c7491 100644 --- a/src/extension/extension.cpp +++ b/src/extension/extension.cpp @@ -19,6 +19,8 @@ # include "config.h" #endif +#include + #include #include #include diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 69ce982d0..ce18d2108 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -19,6 +19,8 @@ # include #endif +#include + #include #include #include diff --git a/src/extension/internal/grid.cpp b/src/extension/internal/grid.cpp index 56bce2fe8..474f8b08d 100644 --- a/src/extension/internal/grid.cpp +++ b/src/extension/internal/grid.cpp @@ -11,6 +11,8 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include + #include #include #include diff --git a/src/extension/internal/pdf-input-cairo.h b/src/extension/internal/pdf-input-cairo.h index 66f1e5e7e..ee2dc4cee 100644 --- a/src/extension/internal/pdf-input-cairo.h +++ b/src/extension/internal/pdf-input-cairo.h @@ -16,6 +16,8 @@ # include #endif +#include + #include #include #include diff --git a/src/extension/internal/pdfinput/pdf-input.h b/src/extension/internal/pdfinput/pdf-input.h index 3710e4667..24924adb9 100644 --- a/src/extension/internal/pdfinput/pdf-input.h +++ b/src/extension/internal/pdfinput/pdf-input.h @@ -16,6 +16,8 @@ #ifdef HAVE_POPPLER +#include + #include #include "../../implementation/implementation.h" diff --git a/src/extension/param/bool.cpp b/src/extension/param/bool.cpp index de9b1c586..354ac6f64 100644 --- a/src/extension/param/bool.cpp +++ b/src/extension/param/bool.cpp @@ -10,6 +10,8 @@ # include "config.h" #endif +#include + #include #include #include diff --git a/src/extension/param/color.cpp b/src/extension/param/color.cpp index d8c78c97d..0da3d4a28 100644 --- a/src/extension/param/color.cpp +++ b/src/extension/param/color.cpp @@ -14,6 +14,8 @@ #include #include +#include + #include #include #include diff --git a/src/extension/param/description.cpp b/src/extension/param/description.cpp index ae2d88ab3..a43fd624d 100644 --- a/src/extension/param/description.cpp +++ b/src/extension/param/description.cpp @@ -13,6 +13,8 @@ # include "config.h" #endif +#include + #include #include #include diff --git a/src/extension/param/enum.cpp b/src/extension/param/enum.cpp index 18a73beb6..292e677a7 100644 --- a/src/extension/param/enum.cpp +++ b/src/extension/param/enum.cpp @@ -18,6 +18,8 @@ # include "config.h" #endif +#include + #include #include #include diff --git a/src/extension/param/float.cpp b/src/extension/param/float.cpp index 81508f6c0..e9c02e91b 100644 --- a/src/extension/param/float.cpp +++ b/src/extension/param/float.cpp @@ -10,6 +10,8 @@ # include "config.h" #endif +#include + #include #include #include diff --git a/src/extension/param/int.cpp b/src/extension/param/int.cpp index c286018fd..7898b66b1 100644 --- a/src/extension/param/int.cpp +++ b/src/extension/param/int.cpp @@ -10,6 +10,8 @@ # include "config.h" #endif +#include + #include #include #include diff --git a/src/extension/param/notebook.cpp b/src/extension/param/notebook.cpp index 85cb5d04c..b887be717 100644 --- a/src/extension/param/notebook.cpp +++ b/src/extension/param/notebook.cpp @@ -16,6 +16,7 @@ # include "config.h" #endif +#include #include #include diff --git a/src/extension/param/radiobutton.cpp b/src/extension/param/radiobutton.cpp index e6e4d64e9..15fc711d0 100644 --- a/src/extension/param/radiobutton.cpp +++ b/src/extension/param/radiobutton.cpp @@ -18,6 +18,8 @@ # include "config.h" #endif +#include + #include #include #include diff --git a/src/extension/param/string.cpp b/src/extension/param/string.cpp index 4e525ff73..cedc6b1a9 100644 --- a/src/extension/param/string.cpp +++ b/src/extension/param/string.cpp @@ -10,6 +10,8 @@ # include "config.h" #endif +#include + #include #include #include diff --git a/src/extension/prefdialog.h b/src/extension/prefdialog.h index e1999791f..eb57fb6f2 100644 --- a/src/extension/prefdialog.h +++ b/src/extension/prefdialog.h @@ -10,6 +10,8 @@ #ifndef INKSCAPE_EXTENSION_DIALOG_H__ #define INKSCAPE_EXTENSION_DIALOG_H__ +#include + #include #include #include diff --git a/src/helper/window.cpp b/src/helper/window.cpp index 444e1d8b0..5109a9cbf 100644 --- a/src/helper/window.cpp +++ b/src/helper/window.cpp @@ -12,6 +12,9 @@ #ifdef HAVE_CONFIG_H # include #endif + +#include + #include #include "inkscape.h" diff --git a/src/inkscape.cpp b/src/inkscape.cpp index eca19c4b9..15720ade5 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -19,6 +19,9 @@ #include #include + +#include + #include #include "debug/simple-event.h" #include "debug/event-tracker.h" diff --git a/src/interface.h b/src/interface.h index 2e9e7fc2e..ae3ced8ea 100644 --- a/src/interface.h +++ b/src/interface.h @@ -17,6 +17,8 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include + #include class SPItem; diff --git a/src/live_effects/parameter/originalpath.cpp b/src/live_effects/parameter/originalpath.cpp index 71ab006d6..8a87ebce0 100644 --- a/src/live_effects/parameter/originalpath.cpp +++ b/src/live_effects/parameter/originalpath.cpp @@ -4,6 +4,8 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include + #include #include "live_effects/parameter/originalpath.h" diff --git a/src/ui/dialog/aboutbox.h b/src/ui/dialog/aboutbox.h index 622b1324f..e4a87f265 100644 --- a/src/ui/dialog/aboutbox.h +++ b/src/ui/dialog/aboutbox.h @@ -15,6 +15,8 @@ #ifndef INKSCAPE_UI_DIALOG_ABOUTBOX_H #define INKSCAPE_UI_DIALOG_ABOUTBOX_H +#include + #include namespace Inkscape { diff --git a/src/ui/dialog/calligraphic-profile-rename.h b/src/ui/dialog/calligraphic-profile-rename.h index 4ef71900b..d2e09f075 100644 --- a/src/ui/dialog/calligraphic-profile-rename.h +++ b/src/ui/dialog/calligraphic-profile-rename.h @@ -15,6 +15,8 @@ # include "config.h" #endif +#include + #include #include #include diff --git a/src/ui/dialog/color-item.cpp b/src/ui/dialog/color-item.cpp index e09d9b1d1..762a534d9 100644 --- a/src/ui/dialog/color-item.cpp +++ b/src/ui/dialog/color-item.cpp @@ -12,6 +12,9 @@ */ #include + +#include + #include #include #include diff --git a/src/ui/dialog/debug.cpp b/src/ui/dialog/debug.cpp index d127261c0..20865bce6 100644 --- a/src/ui/dialog/debug.cpp +++ b/src/ui/dialog/debug.cpp @@ -13,6 +13,8 @@ # include #endif +#include + #include #include #include diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index fe15a4e86..fa9f57e48 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -20,6 +20,8 @@ // This has to be included prior to anything that includes setjmp.h, it croaks otherwise #include +#include + #include #include #include diff --git a/src/ui/dialog/filedialogimpl-gtkmm.h b/src/ui/dialog/filedialogimpl-gtkmm.h index 7501b5e14..2b1b7c200 100644 --- a/src/ui/dialog/filedialogimpl-gtkmm.h +++ b/src/ui/dialog/filedialogimpl-gtkmm.h @@ -17,6 +17,10 @@ #ifndef __FILE_DIALOGIMPL_H__ #define __FILE_DIALOGIMPL_H__ +#include + +#include + //Gtk includes #include #include diff --git a/src/ui/dialog/floating-behavior.cpp b/src/ui/dialog/floating-behavior.cpp index d70c5f187..f8ddaac06 100644 --- a/src/ui/dialog/floating-behavior.cpp +++ b/src/ui/dialog/floating-behavior.cpp @@ -10,6 +10,8 @@ * Released under GNU GPL. Read the file 'COPYING' for more information. */ +#include + #include #include #include diff --git a/src/ui/dialog/font-substitution.cpp b/src/ui/dialog/font-substitution.cpp index 9fa94ca8f..124a1970a 100644 --- a/src/ui/dialog/font-substitution.cpp +++ b/src/ui/dialog/font-substitution.cpp @@ -10,6 +10,8 @@ # include #endif +#include + #include #include #include diff --git a/src/ui/dialog/guides.h b/src/ui/dialog/guides.h index a15667152..2be6e5aed 100644 --- a/src/ui/dialog/guides.h +++ b/src/ui/dialog/guides.h @@ -15,6 +15,7 @@ # include #endif +#include #include #if WITH_GTKMM_3_0 diff --git a/src/ui/dialog/icon-preview.cpp b/src/ui/dialog/icon-preview.cpp index 1a52410b8..5cfc883c8 100644 --- a/src/ui/dialog/icon-preview.cpp +++ b/src/ui/dialog/icon-preview.cpp @@ -17,6 +17,8 @@ # include #endif +#include + #include #include diff --git a/src/ui/dialog/layer-properties.h b/src/ui/dialog/layer-properties.h index 0e2f8ed94..b94cdf878 100644 --- a/src/ui/dialog/layer-properties.h +++ b/src/ui/dialog/layer-properties.h @@ -16,6 +16,8 @@ # include #endif +#include + #include #include #include diff --git a/src/ui/dialog/layers.h b/src/ui/dialog/layers.h index e9fd9ebc6..befecf9d6 100644 --- a/src/ui/dialog/layers.h +++ b/src/ui/dialog/layers.h @@ -12,6 +12,8 @@ #ifndef SEEN_LAYERS_PANEL_H #define SEEN_LAYERS_PANEL_H +#include + #include #include #include diff --git a/src/ui/dialog/livepatheffect-add.h b/src/ui/dialog/livepatheffect-add.h index 00f58b038..7a41b8351 100644 --- a/src/ui/dialog/livepatheffect-add.h +++ b/src/ui/dialog/livepatheffect-add.h @@ -11,6 +11,8 @@ #ifndef INKSCAPE_DIALOG_LIVEPATHEFFECT_ADD_H #define INKSCAPE_DIALOG_LIVEPATHEFFECT_ADD_H +#include + #include #include #include diff --git a/src/ui/dialog/messages.h b/src/ui/dialog/messages.h index 6ed246ece..c5797dc34 100644 --- a/src/ui/dialog/messages.h +++ b/src/ui/dialog/messages.h @@ -16,6 +16,8 @@ #ifndef INKSCAPE_UI_DIALOG_MESSAGES_H #define INKSCAPE_UI_DIALOG_MESSAGES_H +#include + #include #include #include diff --git a/src/ui/dialog/ocaldialogs.h b/src/ui/dialog/ocaldialogs.h index 8cb247766..592d5144c 100644 --- a/src/ui/dialog/ocaldialogs.h +++ b/src/ui/dialog/ocaldialogs.h @@ -13,6 +13,8 @@ #ifndef __OCAL_DIALOG_H__ #define __OCAL_DIALOG_H__ +#include + //Gtk includes #include #include diff --git a/src/ui/dialog/spellcheck.h b/src/ui/dialog/spellcheck.h index ab75809f3..026f2a349 100644 --- a/src/ui/dialog/spellcheck.h +++ b/src/ui/dialog/spellcheck.h @@ -12,6 +12,8 @@ #ifndef SEEN_SPELLCHECK_H #define SEEN_SPELLCHECK_H +#include + #include #include #include diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index 103302f41..aa7859f3a 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -18,6 +18,8 @@ #include #include +#include + #include #include diff --git a/src/ui/dialog/text-edit.h b/src/ui/dialog/text-edit.h index 0e3ebafa7..e409ad73b 100644 --- a/src/ui/dialog/text-edit.h +++ b/src/ui/dialog/text-edit.h @@ -18,6 +18,8 @@ #ifndef INKSCAPE_UI_DIALOG_TEXT_EDIT_H #define INKSCAPE_UI_DIALOG_TEXT_EDIT_H +#include + #include #include #include diff --git a/src/ui/dialog/tile.h b/src/ui/dialog/tile.h index 86dbd25a9..5724596c5 100644 --- a/src/ui/dialog/tile.h +++ b/src/ui/dialog/tile.h @@ -19,6 +19,8 @@ # include #endif +#include + #include #include #include diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index c071fcf95..d2604553d 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -15,6 +15,8 @@ # include #endif +#include + #include #include #include <2geom/transforms.h> diff --git a/src/ui/previewholder.h b/src/ui/previewholder.h index f6d1985cc..bc0bc8609 100644 --- a/src/ui/previewholder.h +++ b/src/ui/previewholder.h @@ -16,6 +16,8 @@ # include "config.h" #endif +#include + #include #include diff --git a/src/ui/widget/button.h b/src/ui/widget/button.h index efadfad07..671c3b00f 100644 --- a/src/ui/widget/button.h +++ b/src/ui/widget/button.h @@ -10,6 +10,8 @@ #ifndef INKSCAPE_UI_WIDGET_BUTTON_H #define INKSCAPE_UI_WIDGET_BUTTON_H +#include + #include #include diff --git a/src/ui/widget/color-picker.h b/src/ui/widget/color-picker.h index e20212615..b449d55d1 100644 --- a/src/ui/widget/color-picker.h +++ b/src/ui/widget/color-picker.h @@ -14,6 +14,9 @@ #define __COLOR_PICKER_H__ #include + +#include + #include #include #include diff --git a/src/ui/widget/color-preview.h b/src/ui/widget/color-preview.h index caddfb9a2..57b9a2440 100644 --- a/src/ui/widget/color-preview.h +++ b/src/ui/widget/color-preview.h @@ -15,6 +15,8 @@ # include #endif +#include + #include namespace Inkscape { diff --git a/src/ui/widget/dock-item.h b/src/ui/widget/dock-item.h index 608badb62..b3ab161c4 100644 --- a/src/ui/widget/dock-item.h +++ b/src/ui/widget/dock-item.h @@ -11,6 +11,7 @@ #ifndef INKSCAPE_UI_WIGET_DOCK_ITEM_H #define INKSCAPE_UI_WIGET_DOCK_ITEM_H +#include #include #include #include diff --git a/src/ui/widget/dock.h b/src/ui/widget/dock.h index 28ab42740..e9cd8d4fd 100644 --- a/src/ui/widget/dock.h +++ b/src/ui/widget/dock.h @@ -12,6 +12,8 @@ #ifndef INKSCAPE_UI_WIDGET_DOCK_H #define INKSCAPE_UI_WIDGET_DOCK_H +#include + #include #include #include "ui/widget/dock-item.h" diff --git a/src/ui/widget/entity-entry.cpp b/src/ui/widget/entity-entry.cpp index c622796b2..6b14f2841 100644 --- a/src/ui/widget/entity-entry.cpp +++ b/src/ui/widget/entity-entry.cpp @@ -17,6 +17,8 @@ # include #endif +#include + #include #include diff --git a/src/ui/widget/filter-effect-chooser.h b/src/ui/widget/filter-effect-chooser.h index ae3ec07c4..8623083ac 100644 --- a/src/ui/widget/filter-effect-chooser.h +++ b/src/ui/widget/filter-effect-chooser.h @@ -12,6 +12,8 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include + #include #include diff --git a/src/ui/widget/frame.h b/src/ui/widget/frame.h index a04666651..1d8f618c4 100644 --- a/src/ui/widget/frame.h +++ b/src/ui/widget/frame.h @@ -10,6 +10,8 @@ #ifndef INKSCAPE_UI_WIDGET_FRAME_H #define INKSCAPE_UI_WIDGET_FRAME_H +#include + #include #include #include diff --git a/src/ui/widget/imageicon.h b/src/ui/widget/imageicon.h index 2ea8b8533..9025786a9 100644 --- a/src/ui/widget/imageicon.h +++ b/src/ui/widget/imageicon.h @@ -12,6 +12,8 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include + #include #include diff --git a/src/ui/widget/imagetoggler.h b/src/ui/widget/imagetoggler.h index 7b02fa4dc..564f0c296 100644 --- a/src/ui/widget/imagetoggler.h +++ b/src/ui/widget/imagetoggler.h @@ -14,6 +14,8 @@ #include "config.h" #endif +#include + #include #include #include diff --git a/src/ui/widget/labelled.h b/src/ui/widget/labelled.h index 88eb3ce19..5a775a3b1 100644 --- a/src/ui/widget/labelled.h +++ b/src/ui/widget/labelled.h @@ -11,6 +11,7 @@ #ifndef INKSCAPE_UI_WIDGET_LABELLED_H #define INKSCAPE_UI_WIDGET_LABELLED_H +#include #include namespace Gtk { diff --git a/src/ui/widget/licensor.h b/src/ui/widget/licensor.h index ab6abd0a4..f71870330 100644 --- a/src/ui/widget/licensor.h +++ b/src/ui/widget/licensor.h @@ -10,6 +10,8 @@ #ifndef INKSCAPE_UI_WIDGET_LICENSOR_H #define INKSCAPE_UI_WIDGET_LICENSOR_H +#include + #include class SPDocument; diff --git a/src/ui/widget/notebook-page.h b/src/ui/widget/notebook-page.h index d8b8fb0c4..0913af0f4 100644 --- a/src/ui/widget/notebook-page.h +++ b/src/ui/widget/notebook-page.h @@ -14,6 +14,8 @@ # include #endif +#include + #include namespace Gtk { diff --git a/src/ui/widget/object-composite-settings.h b/src/ui/widget/object-composite-settings.h index bee9f09b9..58505d023 100644 --- a/src/ui/widget/object-composite-settings.h +++ b/src/ui/widget/object-composite-settings.h @@ -11,6 +11,8 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include + #include #include #include diff --git a/src/ui/widget/panel.cpp b/src/ui/widget/panel.cpp index 7eb114d0a..732df4222 100644 --- a/src/ui/widget/panel.cpp +++ b/src/ui/widget/panel.cpp @@ -15,6 +15,8 @@ # include #endif +#include + #include // for Gtk::RESPONSE_* #include #include diff --git a/src/ui/widget/panel.h b/src/ui/widget/panel.h index 5bb054577..6867f119c 100644 --- a/src/ui/widget/panel.h +++ b/src/ui/widget/panel.h @@ -17,6 +17,8 @@ # include #endif +#include + #include #include #include diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp index d32de6871..1881f1415 100644 --- a/src/ui/widget/preferences-widget.cpp +++ b/src/ui/widget/preferences-widget.cpp @@ -18,6 +18,8 @@ #include #endif +#include + #include #include #include diff --git a/src/ui/widget/preferences-widget.h b/src/ui/widget/preferences-widget.h index e3968045d..2eee85aac 100644 --- a/src/ui/widget/preferences-widget.h +++ b/src/ui/widget/preferences-widget.h @@ -17,6 +17,9 @@ #include #include + +#include + #include #include "ui/widget/spinbutton.h" #include diff --git a/src/ui/widget/rotateable.cpp b/src/ui/widget/rotateable.cpp index 1d91515e5..f48217fba 100644 --- a/src/ui/widget/rotateable.cpp +++ b/src/ui/widget/rotateable.cpp @@ -7,6 +7,8 @@ * Released under GNU GPL. Read the file 'COPYING' for more information. */ +#include + #include #include #include diff --git a/src/ui/widget/selected-style.h b/src/ui/widget/selected-style.h index 9b78cb17f..12dc5d9f6 100644 --- a/src/ui/widget/selected-style.h +++ b/src/ui/widget/selected-style.h @@ -15,6 +15,8 @@ # include "config.h" #endif +#include + #include #if WITH_GTKMM_3_0 diff --git a/src/ui/widget/spin-scale.cpp b/src/ui/widget/spin-scale.cpp index 548e9a6a6..ade3d1e60 100644 --- a/src/ui/widget/spin-scale.cpp +++ b/src/ui/widget/spin-scale.cpp @@ -6,11 +6,12 @@ * Released under GNU GPL. Read the file 'COPYING' for more information. */ +#include "spin-scale.h" + #include #include #include -#include "spin-scale.h" #include "ui/widget/gimpspinscale.h" namespace Inkscape { diff --git a/src/ui/widget/spin-scale.h b/src/ui/widget/spin-scale.h index a8403307f..a1debd6f4 100644 --- a/src/ui/widget/spin-scale.h +++ b/src/ui/widget/spin-scale.h @@ -9,6 +9,8 @@ #ifndef INKSCAPE_UI_WIDGET_SPIN_SCALE_H #define INKSCAPE_UI_WIDGET_SPIN_SCALE_H +#include + #include #include #include diff --git a/src/ui/widget/spin-slider.h b/src/ui/widget/spin-slider.h index 8a45299e5..2597fdea0 100644 --- a/src/ui/widget/spin-slider.h +++ b/src/ui/widget/spin-slider.h @@ -10,6 +10,8 @@ #ifndef INKSCAPE_UI_WIDGET_SPIN_SLIDER_H #define INKSCAPE_UI_WIDGET_SPIN_SLIDER_H +#include + #include #include #include diff --git a/src/ui/widget/spinbutton.h b/src/ui/widget/spinbutton.h index 57c48369e..96cc4e2b9 100644 --- a/src/ui/widget/spinbutton.h +++ b/src/ui/widget/spinbutton.h @@ -10,6 +10,8 @@ #ifndef INKSCAPE_UI_WIDGET_SPINBUTTON_H #define INKSCAPE_UI_WIDGET_SPINBUTTON_H +#include + #include namespace Inkscape { diff --git a/src/ui/widget/style-swatch.h b/src/ui/widget/style-swatch.h index d7bab3732..da6bb67e7 100644 --- a/src/ui/widget/style-swatch.h +++ b/src/ui/widget/style-swatch.h @@ -17,6 +17,8 @@ # include "config.h" #endif +#include + #include #include #include diff --git a/src/ui/widget/tolerance-slider.cpp b/src/ui/widget/tolerance-slider.cpp index f92a08d0a..605ae8e71 100644 --- a/src/ui/widget/tolerance-slider.cpp +++ b/src/ui/widget/tolerance-slider.cpp @@ -12,6 +12,8 @@ # include #endif +#include + #include #include #include diff --git a/src/ui/widget/unit-menu.h b/src/ui/widget/unit-menu.h index 142b11186..e821e1806 100644 --- a/src/ui/widget/unit-menu.h +++ b/src/ui/widget/unit-menu.h @@ -10,6 +10,8 @@ #ifndef INKSCAPE_UI_WIDGET_UNIT_H #define INKSCAPE_UI_WIDGET_UNIT_H +#include + #include #include "util/units.h" diff --git a/src/verbs.cpp b/src/verbs.cpp index ec7cad8dd..8d275aeb7 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -32,6 +32,8 @@ #include #include +#include + #include #include #include diff --git a/src/widgets/dash-selector.h b/src/widgets/dash-selector.h index 0a572f4de..d3eab643a 100644 --- a/src/widgets/dash-selector.h +++ b/src/widgets/dash-selector.h @@ -10,6 +10,8 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include + #include #include #include diff --git a/src/widgets/desktop-widget.h b/src/widgets/desktop-widget.h index 9188838b3..8e828ca94 100644 --- a/src/widgets/desktop-widget.h +++ b/src/widgets/desktop-widget.h @@ -12,6 +12,7 @@ * ? -2004 */ +#include #include #include "message.h" #include "ui/view/view-widget.h" diff --git a/src/widgets/fill-style.cpp b/src/widgets/fill-style.cpp index 60e115f54..6882e263e 100644 --- a/src/widgets/fill-style.cpp +++ b/src/widgets/fill-style.cpp @@ -22,6 +22,8 @@ # include "config.h" #endif +#include + #include #include diff --git a/src/widgets/gradient-selector.h b/src/widgets/gradient-selector.h index ea83ff819..2bca6a64f 100644 --- a/src/widgets/gradient-selector.h +++ b/src/widgets/gradient-selector.h @@ -15,6 +15,8 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include + #include #include diff --git a/src/widgets/gradient-vector.h b/src/widgets/gradient-vector.h index 463d77912..9e3792c06 100644 --- a/src/widgets/gradient-vector.h +++ b/src/widgets/gradient-vector.h @@ -15,6 +15,8 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include + #include #include diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp index 7580d9602..c661ae41c 100644 --- a/src/widgets/icon.cpp +++ b/src/widgets/icon.cpp @@ -16,6 +16,8 @@ # include "config.h" #endif +#include + #include #include #include diff --git a/src/widgets/icon.h b/src/widgets/icon.h index 6bce2e330..3c4d91748 100644 --- a/src/widgets/icon.h +++ b/src/widgets/icon.h @@ -14,6 +14,7 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include #include #include "icon-size.h" diff --git a/src/widgets/paint-selector.cpp b/src/widgets/paint-selector.cpp index 08058d60d..9084188b1 100644 --- a/src/widgets/paint-selector.cpp +++ b/src/widgets/paint-selector.cpp @@ -24,6 +24,7 @@ #include #include +#include #include "widgets/swatch-selector.h" #include "../sp-pattern.h" diff --git a/src/widgets/shrink-wrap-button.cpp b/src/widgets/shrink-wrap-button.cpp index 941a0466c..fed792adb 100644 --- a/src/widgets/shrink-wrap-button.cpp +++ b/src/widgets/shrink-wrap-button.cpp @@ -13,6 +13,8 @@ #include "config.h" #endif +#include + #include #include diff --git a/src/widgets/sp-attribute-widget.h b/src/widgets/sp-attribute-widget.h index d9b972201..a48d2643d 100644 --- a/src/widgets/sp-attribute-widget.h +++ b/src/widgets/sp-attribute-widget.h @@ -19,6 +19,8 @@ # include "config.h" #endif +#include + #include #include #include diff --git a/src/widgets/spw-utilities.cpp b/src/widgets/spw-utilities.cpp index 7fca56f56..c1a54c1ed 100644 --- a/src/widgets/spw-utilities.cpp +++ b/src/widgets/spw-utilities.cpp @@ -17,6 +17,8 @@ #include #include +#include + #include #include diff --git a/src/widgets/stroke-marker-selector.h b/src/widgets/stroke-marker-selector.h index 02038ea42..d855fab06 100644 --- a/src/widgets/stroke-marker-selector.h +++ b/src/widgets/stroke-marker-selector.h @@ -10,6 +10,8 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include + #include #include #include diff --git a/src/widgets/swatch-selector.h b/src/widgets/swatch-selector.h index 4b7aa483f..c2fd1255c 100644 --- a/src/widgets/swatch-selector.h +++ b/src/widgets/swatch-selector.h @@ -1,6 +1,8 @@ #ifndef SEEN_SP_SWATCH_SELECTOR_H #define SEEN_SP_SWATCH_SELECTOR_H +#include + #include class SPDocument; diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index f03835e17..92fe8a1ff 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -29,6 +29,8 @@ # include "config.h" #endif +#include + #include #include #include -- cgit v1.2.3 From 4cec6d0c7d401ed0616e91a923a7ec4caf806f3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20dos=20Santos=20Oliveira?= Date: Wed, 5 Jun 2013 16:03:06 -0300 Subject: Add command line option to specify PDF export version. Patch from schwieni. From the patch's author: Additional command line option added to export to different PDF-versions supported by cairo (currently only "PDF 1.4" and "PDF 1.5"). The user must provide the exact string found in the PDF-export dialog of Inkscape. This feature was previously only accessible via the GUI of Inkscape. This option is useful for people opting for PDF-a conformance in their PDFs. Moreover, the Extension and Parameter classes are extended by setters for enum parameters (used in combo boxes). (bzr r12348) --- src/extension/extension.cpp | 22 ++++++++++++++++++++++ src/extension/extension.h | 10 ++++++++++ src/extension/param/enum.cpp | 18 ++++++++++++++++++ src/extension/param/enum.h | 5 +++++ src/extension/param/parameter.cpp | 18 ++++++++++++++++++ src/extension/param/parameter.h | 6 +++++- src/main.cpp | 36 ++++++++++++++++++++++++++++++++++++ 7 files changed, 114 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/extension/extension.cpp b/src/extension/extension.cpp index 0d91c7491..2f78b5397 100644 --- a/src/extension/extension.cpp +++ b/src/extension/extension.cpp @@ -429,6 +429,21 @@ Extension::get_param_enum (const gchar * name, const SPDocument * doc, const Ink return param->get_enum(doc, node); } +/** + * This is useful to find out, if a given string \c value is selectable in a ComboBox named \cname. + * + * @param name The name of the enum parameter to get. + * @param doc The document to look in for document specific parameters. + * @param node The node to look in for a specific parameter. + * @return true if value exists, false if not + */ +bool +Extension::get_param_enum_contains(gchar const * name, gchar const * value, SPDocument * doc, Inkscape::XML::Node * node) +{ + Parameter * param = get_param(name); + return param->get_enum_contains(value, doc, node); +} + gchar const * Extension::get_param_optiongroup( gchar const * name, SPDocument const * doc, Inkscape::XML::Node const * node) { @@ -599,6 +614,13 @@ Extension::set_param_optiongroup(gchar const * name, gchar const * value, SPDocu return param->set_optiongroup(value, doc, node); } +gchar const * +Extension::set_param_enum(gchar const * name, gchar const * value, SPDocument * doc, Inkscape::XML::Node * node) +{ + Parameter * param = get_param(name); + return param->set_enum(value, doc, node); +} + /** \return The passed in value diff --git a/src/extension/extension.h b/src/extension/extension.h index b6b4c51ed..23ed818ba 100644 --- a/src/extension/extension.h +++ b/src/extension/extension.h @@ -244,6 +244,11 @@ public: SPDocument const * doc = 0, Inkscape::XML::Node const * node = 0); + bool get_param_enum_contains(gchar const * name, + gchar const * value, + SPDocument * doc = 0x0, + Inkscape::XML::Node * node = 0x0); + bool set_param_bool (const gchar * name, bool value, SPDocument * doc = NULL, @@ -269,6 +274,11 @@ public: SPDocument * doc = 0, Inkscape::XML::Node * node = 0); + gchar const * set_param_enum (gchar const * name, + gchar const * value, + SPDocument * doc = 0x0, + Inkscape::XML::Node * node = 0x0); + guint32 set_param_color (const gchar * name, guint32 color, SPDocument * doc = NULL, diff --git a/src/extension/param/enum.cpp b/src/extension/param/enum.cpp index 292e677a7..9cdc05049 100644 --- a/src/extension/param/enum.cpp +++ b/src/extension/param/enum.cpp @@ -175,6 +175,24 @@ const gchar *ParamComboBox::set(const gchar * in, SPDocument * /*doc*/, Inkscape return _value; } +/** + * function to test if \c guitext is selectable + */ +bool ParamComboBox::contains(const gchar * guitext, SPDocument const * /*doc*/, Inkscape::XML::Node const * /*node*/) const +{ + if (guitext == NULL) { + return false; /* Can't have NULL string */ + } + + for (GSList * list = choices; list != NULL; list = g_slist_next(list)) { + enumentry * entr = reinterpret_cast(list->data); + if ( !entr->guitext.compare(guitext) ) + return true; + } + // if we did not find the guitext in this ParamComboBox: + return false; +} + void ParamComboBox::changed (void) { diff --git a/src/extension/param/enum.h b/src/extension/param/enum.h index ac7d72abd..52e018469 100644 --- a/src/extension/param/enum.h +++ b/src/extension/param/enum.h @@ -51,6 +51,11 @@ public: const gchar * set (const gchar * in, SPDocument * doc, Inkscape::XML::Node * node); + /** + * @returns true if guitext is part of this enum + */ + bool contains(const gchar * guitext, SPDocument const * /*doc*/, Inkscape::XML::Node const * /*node*/) const; + void changed (void); }; /* class ParamComboBox */ diff --git a/src/extension/param/parameter.cpp b/src/extension/param/parameter.cpp index 97e4f9d8c..202b8110f 100644 --- a/src/extension/param/parameter.cpp +++ b/src/extension/param/parameter.cpp @@ -183,6 +183,15 @@ gchar const *Parameter::get_enum(SPDocument const *doc, Inkscape::XML::Node cons return param->get(doc, node); } +bool Parameter::get_enum_contains(gchar const * value, SPDocument const *doc, Inkscape::XML::Node const *node) const +{ + ParamComboBox const *param = dynamic_cast(this); + if (!param) { + throw Extension::param_not_enum_param(); + } + return param->contains(value, doc, node); +} + gchar const *Parameter::get_optiongroup(SPDocument const *doc, Inkscape::XML::Node const * node) const { ParamRadioButton const *param = dynamic_cast(this); @@ -247,6 +256,15 @@ gchar const * Parameter::set_optiongroup( gchar const * in, SPDocument * doc, In return param->set(in, doc, node); } +gchar const *Parameter::set_enum( gchar const * in, SPDocument * doc, Inkscape::XML::Node * node ) +{ + ParamComboBox *param = dynamic_cast(this); + if (!param) { + throw Extension::param_not_enum_param(); + } + return param->set(in, doc, node); +} + /** Wrapper to cast to the object and use it's function. */ guint32 diff --git a/src/extension/param/parameter.h b/src/extension/param/parameter.h index d08efc554..5e1e3897f 100644 --- a/src/extension/param/parameter.h +++ b/src/extension/param/parameter.h @@ -88,8 +88,10 @@ public: gchar const *get_enum(SPDocument const *doc, Inkscape::XML::Node const *node) const; /** Wrapper to cast to the object and use it's function. */ - gchar const *get_optiongroup(SPDocument const * doc, Inkscape::XML::Node const *node) const; + bool get_enum_contains(gchar const * value, SPDocument const *doc, Inkscape::XML::Node const *node) const; + /** Wrapper to cast to the object and use it's function. */ + gchar const *get_optiongroup(SPDocument const * doc, Inkscape::XML::Node const *node) const; /** Wrapper to cast to the object and use it's function. */ bool set_bool(bool in, SPDocument * doc, Inkscape::XML::Node * node); @@ -101,6 +103,8 @@ public: gchar const *set_optiongroup(gchar const *in, SPDocument * doc, Inkscape::XML::Node *node); + gchar const *set_enum(gchar const * in, SPDocument * doc, Inkscape::XML::Node *node); + gchar const *set_string(gchar const * in, SPDocument * doc, Inkscape::XML::Node * node); guint32 set_color(guint32 in, SPDocument * doc, Inkscape::XML::Node * node); diff --git a/src/main.cpp b/src/main.cpp index 5bb42d405..d9e731912 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -148,6 +148,7 @@ enum { SP_ARG_EXPORT_PS, SP_ARG_EXPORT_EPS, SP_ARG_EXPORT_PDF, + SP_ARG_EXPORT_PDF_VERSION, SP_ARG_EXPORT_LATEX, #ifdef WIN32 SP_ARG_EXPORT_EMF, @@ -201,6 +202,7 @@ static gchar *sp_export_svg = NULL; static gchar *sp_export_ps = NULL; static gchar *sp_export_eps = NULL; static gchar *sp_export_pdf = NULL; +static gchar *sp_export_pdf_version = NULL; #ifdef WIN32 static gchar *sp_export_emf = NULL; #endif //WIN32 @@ -245,6 +247,7 @@ static void resetCommandlineGlobals() { sp_export_ps = NULL; sp_export_eps = NULL; sp_export_pdf = NULL; + sp_export_pdf_version = NULL; #ifdef WIN32 sp_export_emf = NULL; #endif //WIN32 @@ -386,6 +389,12 @@ struct poptOption options[] = { N_("Export document to a PDF file"), N_("FILENAME")}, + {"export-pdf-version", 0, + POPT_ARG_STRING, &sp_export_pdf_version, SP_ARG_EXPORT_PDF_VERSION, + // TRANSLATORS: "--export-pdf-version" is an Inkscape command line option; see "inkscape --help" + N_("Export PDF to given version. (hint: make sure to input the exact string found in the PDF export dialog, e.g. \"PDF 1.4\" which is PDF-a conformant)"), + N_("PDF_VERSION")}, + {"export-latex", 0, POPT_ARG_NONE, &sp_export_latex, SP_ARG_EXPORT_LATEX, N_("Export PDF/PS/EPS without text. Besides the PDF/PS/EPS, a LaTeX file is exported, putting the text on top of the PDF/PS/EPS file. Include the result in LaTeX like: \\input{latexfile.tex}"), @@ -1638,6 +1647,33 @@ static int do_export_ps_pdf(SPDocument* doc, gchar const* uri, char const* mime) } (*i)->set_param_float("bleed", margin); + // handle --export-pdf-version + bool set_export_pdf_version_fail=true; + const gchar *pdfver_param_name="PDFversion"; + if(sp_export_pdf_version) { + // combine "PDF " and the given command line + std::string version_gui_string=std::string("PDF ")+sp_export_pdf_version; + try{ + // first, check if the given pdf version is selectable in the ComboBox + if((*i)->get_param_enum_contains("PDFversion", version_gui_string.c_str())) { + (*i)->set_param_enum(pdfver_param_name, version_gui_string.c_str()); + set_export_pdf_version_fail=false; + } else { + g_warning("Desired PDF export version \"%s\" not supported! Hint: input one of the versions found in the pdf export dialog e.g. \"1.4\".", + sp_export_pdf_version); + } + } catch (...) { + // can be thrown along the way: + // throw Extension::param_not_exist(); + // throw Extension::param_not_enum_param(); + g_warning("Parameter or Enum \"%s\" might not exist",pdfver_param_name); + } + } + // set default pdf export version to 1.4, also if something went wrong + if(set_export_pdf_version_fail) { + (*i)->set_param_enum(pdfver_param_name, "PDF 1.4"); + } + //check if specified directory exists if (!Inkscape::IO::file_directory_exists(uri)) { g_warning("File path \"%s\" includes directory that doesn't exist.\n", uri); -- cgit v1.2.3 From 1407663a0edf2cc3e75468035ee1128dfefc5be1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20dos=20Santos=20Oliveira?= Date: Wed, 5 Jun 2013 16:53:08 -0300 Subject: Refactor: Changed some functions from Extension to const. The functions changed to const: * get_param_color * get_param_enum * get_param_optiongroup * get_param_enum_contains (bzr r12349) --- src/extension/extension.cpp | 16 ++++++++-------- src/extension/extension.h | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/extension/extension.cpp b/src/extension/extension.cpp index 2f78b5397..43d3d9cc6 100644 --- a/src/extension/extension.cpp +++ b/src/extension/extension.cpp @@ -423,9 +423,9 @@ gchar const *Extension::get_param_string(gchar const *name, SPDocument const *do } 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 SPDocument * doc, const Inkscape::XML::Node * node) const { - Parameter* param = get_param(name); + Parameter const *param = get_param(name); return param->get_enum(doc, node); } @@ -438,16 +438,16 @@ Extension::get_param_enum (const gchar * name, const SPDocument * doc, const Ink * @return true if value exists, false if not */ bool -Extension::get_param_enum_contains(gchar const * name, gchar const * value, SPDocument * doc, Inkscape::XML::Node * node) +Extension::get_param_enum_contains(gchar const * name, gchar const * value, SPDocument * doc, Inkscape::XML::Node * node) const { - Parameter * param = get_param(name); + Parameter const *param = get_param(name); return param->get_enum_contains(value, doc, node); } gchar const * -Extension::get_param_optiongroup( gchar const * name, SPDocument const * doc, Inkscape::XML::Node const * node) +Extension::get_param_optiongroup( gchar const * name, SPDocument const * doc, Inkscape::XML::Node const * node) const { - Parameter* param = get_param(name); + Parameter const*param = get_param(name); return param->get_optiongroup(doc, node); } @@ -521,9 +521,9 @@ 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 SPDocument * doc, const Inkscape::XML::Node * node) const { - Parameter* param = get_param(name); + Parameter const *param = get_param(name); return param->get_color(doc, node); } diff --git a/src/extension/extension.h b/src/extension/extension.h index 23ed818ba..079276936 100644 --- a/src/extension/extension.h +++ b/src/extension/extension.h @@ -234,20 +234,20 @@ public: guint32 get_param_color (const gchar * name, const SPDocument * doc = NULL, - const Inkscape::XML::Node * node = NULL); + const Inkscape::XML::Node * node = NULL) const; const gchar * get_param_enum (const gchar * name, const SPDocument * doc = NULL, - const Inkscape::XML::Node * node = NULL); + const Inkscape::XML::Node * node = NULL) const; gchar const *get_param_optiongroup( gchar const * name, SPDocument const * doc = 0, - Inkscape::XML::Node const * node = 0); + Inkscape::XML::Node const * node = 0) const; bool get_param_enum_contains(gchar const * name, gchar const * value, SPDocument * doc = 0x0, - Inkscape::XML::Node * node = 0x0); + Inkscape::XML::Node * node = 0x0) const; bool set_param_bool (const gchar * name, bool value, -- cgit v1.2.3 From 1e90e0e6556d48e6e100cf6d5d9752b06c0f5bdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20dos=20Santos=20Oliveira?= Date: Wed, 5 Jun 2013 18:01:35 -0300 Subject: Add option to set --export-ps-level. Fixes bug #669748. Moreover, a bug in --export-pdf-version was fixed. The bug made Inkscape crash if someone try to export a ps file. (bzr r12350) --- src/main.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index d9e731912..e77c748b7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -147,6 +147,7 @@ enum { SP_ARG_EXPORT_SVG, SP_ARG_EXPORT_PS, SP_ARG_EXPORT_EPS, + SP_ARG_EXPORT_PS_LEVEL, SP_ARG_EXPORT_PDF, SP_ARG_EXPORT_PDF_VERSION, SP_ARG_EXPORT_LATEX, @@ -201,6 +202,7 @@ static gboolean sp_export_id_only = FALSE; static gchar *sp_export_svg = NULL; static gchar *sp_export_ps = NULL; static gchar *sp_export_eps = NULL; +static gint sp_export_ps_level = 2; static gchar *sp_export_pdf = NULL; static gchar *sp_export_pdf_version = NULL; #ifdef WIN32 @@ -246,6 +248,7 @@ static void resetCommandlineGlobals() { sp_export_svg = NULL; sp_export_ps = NULL; sp_export_eps = NULL; + sp_export_ps_level = 2; sp_export_pdf = NULL; sp_export_pdf_version = NULL; #ifdef WIN32 @@ -384,6 +387,12 @@ struct poptOption options[] = { N_("Export document to an EPS file"), N_("FILENAME")}, + {"export-ps-level", 0, + POPT_ARG_INT, &sp_export_ps_level, SP_ARG_EXPORT_PS_LEVEL, + N_("Choose the PostScript Level used to export. Possible choices are" + " 2 (the default) and 3"), + N_("PS Level")}, + {"export-pdf", 'A', POPT_ARG_STRING, &sp_export_pdf, SP_ARG_EXPORT_PDF, N_("Export document to a PDF file"), @@ -1669,8 +1678,9 @@ static int do_export_ps_pdf(SPDocument* doc, gchar const* uri, char const* mime) g_warning("Parameter or Enum \"%s\" might not exist",pdfver_param_name); } } + // set default pdf export version to 1.4, also if something went wrong - if(set_export_pdf_version_fail) { + if(sp_export_pdf_version && set_export_pdf_version_fail) { (*i)->set_param_enum(pdfver_param_name, "PDF 1.4"); } @@ -1680,6 +1690,18 @@ static int do_export_ps_pdf(SPDocument* doc, gchar const* uri, char const* mime) return 1; } + if ( g_strcmp0(mime, "image/x-postscript") == 0 + || g_strcmp0(mime, "image/x-e-postscript") == 0 ) { + if ( sp_export_ps_level < 2 || sp_export_ps_level > 3 ) { + g_warning("Only supported PostScript levels are 2 and 3." + " Defaulting to 2."); + sp_export_ps_level = 2; + } + + (*i)->set_param_enum("PSlevel", (sp_export_ps_level == 3) + ? "PostScript level 3" : "PostScript level 2"); + } + (*i)->save(doc, uri); return 0; } -- cgit v1.2.3 From 183d5c461eb9c3481747e71a086f1e1bc5939771 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Wed, 5 Jun 2013 22:50:49 -0400 Subject: Fix symbol-title missing crash (bzr r12351) --- src/ui/dialog/symbols.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index aa7859f3a..8e7f45514 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -487,6 +487,9 @@ void SymbolsDialog::get_symbols() { symbol_doc = SPDocument::createNewDoc( fullname, FALSE ); if( symbol_doc ) { gchar *title = symbol_doc->getRoot()->title(); + if( title == NULL ) { + title = _("Unnamed Symbols"); + } symbolSets[Glib::ustring(title)] = symbol_doc; symbolSet->append(title); } -- cgit v1.2.3 From fddea897e18dbeab5c205725a896e27f9763906b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20dos=20Santos=20Oliveira?= Date: Thu, 6 Jun 2013 05:32:48 -0300 Subject: Fixes r12348 and r12350. Typo error (sp_export_pdf_version instead sp_export_pdf). (bzr r12352) --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index e77c748b7..28ec719f3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1680,7 +1680,7 @@ static int do_export_ps_pdf(SPDocument* doc, gchar const* uri, char const* mime) } // set default pdf export version to 1.4, also if something went wrong - if(sp_export_pdf_version && set_export_pdf_version_fail) { + if(sp_export_pdf && set_export_pdf_version_fail) { (*i)->set_param_enum(pdfver_param_name, "PDF 1.4"); } -- cgit v1.2.3 From 72d8e897c6b67e46b2a613c4743ef9c13de25059 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Thu, 6 Jun 2013 06:44:11 -0700 Subject: Added configure/ifdef guards to only bring in the needed #include if glibmm has it. (bzr r12353) --- src/dialogs/dialog-events.cpp | 2 ++ src/display/canvas-axonomgrid.cpp | 2 ++ src/display/canvas-grid.cpp | 2 ++ src/event-context.cpp | 2 ++ src/event-log.h | 3 +++ src/extension/execution-env.cpp | 2 ++ src/extension/extension.cpp | 2 ++ src/extension/implementation/script.cpp | 2 ++ src/extension/internal/grid.cpp | 2 ++ src/extension/internal/pdf-input-cairo.h | 2 ++ src/extension/internal/pdfinput/pdf-input.h | 2 ++ src/extension/param/bool.cpp | 2 ++ src/extension/param/color.cpp | 2 ++ src/extension/param/description.cpp | 2 ++ src/extension/param/enum.cpp | 2 ++ src/extension/param/float.cpp | 2 ++ src/extension/param/int.cpp | 2 ++ src/extension/param/notebook.cpp | 2 ++ src/extension/param/radiobutton.cpp | 2 ++ src/extension/param/string.cpp | 2 ++ src/extension/prefdialog.h | 2 ++ src/helper/window.cpp | 2 ++ src/inkscape.cpp | 2 ++ src/interface.h | 2 ++ src/live_effects/parameter/originalpath.cpp | 2 ++ src/ui/dialog/aboutbox.h | 2 ++ src/ui/dialog/calligraphic-profile-rename.h | 2 ++ src/ui/dialog/color-item.cpp | 2 ++ src/ui/dialog/debug.cpp | 2 ++ src/ui/dialog/export.cpp | 2 ++ src/ui/dialog/filedialogimpl-gtkmm.h | 2 ++ src/ui/dialog/filedialogimpl-win32.h | 3 +++ src/ui/dialog/floating-behavior.cpp | 2 ++ src/ui/dialog/font-substitution.cpp | 2 ++ src/ui/dialog/guides.h | 3 +++ src/ui/dialog/icon-preview.cpp | 2 ++ src/ui/dialog/layer-properties.h | 2 ++ src/ui/dialog/layers.h | 2 ++ src/ui/dialog/livepatheffect-add.h | 2 ++ src/ui/dialog/messages.h | 2 ++ src/ui/dialog/ocaldialogs.h | 2 ++ src/ui/dialog/spellcheck.h | 2 ++ src/ui/dialog/symbols.cpp | 2 ++ src/ui/dialog/text-edit.h | 2 ++ src/ui/dialog/tile.h | 2 ++ src/ui/dialog/transformation.cpp | 2 ++ src/ui/previewholder.h | 2 ++ src/ui/widget/button.h | 2 ++ src/ui/widget/color-picker.h | 2 ++ src/ui/widget/color-preview.h | 2 ++ src/ui/widget/dock-item.h | 3 +++ src/ui/widget/dock.h | 2 ++ src/ui/widget/entity-entry.cpp | 2 ++ src/ui/widget/filter-effect-chooser.h | 2 ++ src/ui/widget/frame.h | 2 ++ src/ui/widget/imageicon.h | 2 ++ src/ui/widget/imagetoggler.h | 2 ++ src/ui/widget/labelled.h | 3 +++ src/ui/widget/licensor.h | 2 ++ src/ui/widget/notebook-page.h | 2 ++ src/ui/widget/object-composite-settings.h | 2 ++ src/ui/widget/panel.cpp | 2 ++ src/ui/widget/panel.h | 2 ++ src/ui/widget/preferences-widget.cpp | 2 ++ src/ui/widget/preferences-widget.h | 2 ++ src/ui/widget/rotateable.cpp | 2 ++ src/ui/widget/selected-style.h | 2 ++ src/ui/widget/spin-scale.h | 2 ++ src/ui/widget/spin-slider.h | 2 ++ src/ui/widget/spinbutton.h | 2 ++ src/ui/widget/style-swatch.h | 2 ++ src/ui/widget/tolerance-slider.cpp | 2 ++ src/ui/widget/unit-menu.h | 2 ++ src/verbs.cpp | 2 ++ src/widgets/dash-selector.h | 2 ++ src/widgets/desktop-widget.h | 3 +++ src/widgets/fill-style.cpp | 2 ++ src/widgets/gradient-selector.h | 2 ++ src/widgets/gradient-vector.h | 2 ++ src/widgets/icon.cpp | 2 ++ src/widgets/icon.h | 3 +++ src/widgets/paint-selector.cpp | 2 ++ src/widgets/shrink-wrap-button.cpp | 2 ++ src/widgets/sp-attribute-widget.h | 2 ++ src/widgets/spw-utilities.cpp | 2 ++ src/widgets/stroke-marker-selector.h | 2 ++ src/widgets/swatch-selector.h | 2 ++ src/widgets/toolbox.cpp | 2 ++ 88 files changed, 183 insertions(+) (limited to 'src') diff --git a/src/dialogs/dialog-events.cpp b/src/dialogs/dialog-events.cpp index f0ea82075..4fbf26f94 100644 --- a/src/dialogs/dialog-events.cpp +++ b/src/dialogs/dialog-events.cpp @@ -15,7 +15,9 @@ # include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/display/canvas-axonomgrid.cpp b/src/display/canvas-axonomgrid.cpp index 2d3064649..1eadd3fd2 100644 --- a/src/display/canvas-axonomgrid.cpp +++ b/src/display/canvas-axonomgrid.cpp @@ -17,7 +17,9 @@ # include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp index ac7f53411..ee5ad0945 100644 --- a/src/display/canvas-grid.cpp +++ b/src/display/canvas-grid.cpp @@ -17,7 +17,9 @@ # include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/event-context.cpp b/src/event-context.cpp index 4a0608d62..628380a2c 100644 --- a/src/event-context.cpp +++ b/src/event-context.cpp @@ -18,7 +18,9 @@ # include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include "shortcuts.h" #include "file.h" diff --git a/src/event-log.h b/src/event-log.h index 55f31bea5..d1e63b1dc 100644 --- a/src/event-log.h +++ b/src/event-log.h @@ -10,7 +10,10 @@ #ifndef INKSCAPE_EVENT_LOG_H #define INKSCAPE_EVENT_LOG_H +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif + #include #include #include diff --git a/src/extension/execution-env.cpp b/src/extension/execution-env.cpp index 14b397532..343f87cdb 100644 --- a/src/extension/execution-env.cpp +++ b/src/extension/execution-env.cpp @@ -10,7 +10,9 @@ #include +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include "gtkmm/messagedialog.h" diff --git a/src/extension/extension.cpp b/src/extension/extension.cpp index 43d3d9cc6..d63ec7485 100644 --- a/src/extension/extension.cpp +++ b/src/extension/extension.cpp @@ -19,7 +19,9 @@ # include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index ce18d2108..f0fd3711b 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -19,7 +19,9 @@ # include #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/extension/internal/grid.cpp b/src/extension/internal/grid.cpp index 474f8b08d..812c383b4 100644 --- a/src/extension/internal/grid.cpp +++ b/src/extension/internal/grid.cpp @@ -11,7 +11,9 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/extension/internal/pdf-input-cairo.h b/src/extension/internal/pdf-input-cairo.h index ee2dc4cee..b65d22f48 100644 --- a/src/extension/internal/pdf-input-cairo.h +++ b/src/extension/internal/pdf-input-cairo.h @@ -16,7 +16,9 @@ # include #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/extension/internal/pdfinput/pdf-input.h b/src/extension/internal/pdfinput/pdf-input.h index 24924adb9..f22a783ff 100644 --- a/src/extension/internal/pdfinput/pdf-input.h +++ b/src/extension/internal/pdfinput/pdf-input.h @@ -16,7 +16,9 @@ #ifdef HAVE_POPPLER +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include diff --git a/src/extension/param/bool.cpp b/src/extension/param/bool.cpp index 354ac6f64..548dec4fa 100644 --- a/src/extension/param/bool.cpp +++ b/src/extension/param/bool.cpp @@ -10,7 +10,9 @@ # include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/extension/param/color.cpp b/src/extension/param/color.cpp index 0da3d4a28..0a2598c56 100644 --- a/src/extension/param/color.cpp +++ b/src/extension/param/color.cpp @@ -14,7 +14,9 @@ #include #include +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/extension/param/description.cpp b/src/extension/param/description.cpp index a43fd624d..c9cea73d4 100644 --- a/src/extension/param/description.cpp +++ b/src/extension/param/description.cpp @@ -13,7 +13,9 @@ # include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/extension/param/enum.cpp b/src/extension/param/enum.cpp index 9cdc05049..bb50c06e1 100644 --- a/src/extension/param/enum.cpp +++ b/src/extension/param/enum.cpp @@ -18,7 +18,9 @@ # include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/extension/param/float.cpp b/src/extension/param/float.cpp index e9c02e91b..464938f03 100644 --- a/src/extension/param/float.cpp +++ b/src/extension/param/float.cpp @@ -10,7 +10,9 @@ # include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/extension/param/int.cpp b/src/extension/param/int.cpp index 7898b66b1..819c75693 100644 --- a/src/extension/param/int.cpp +++ b/src/extension/param/int.cpp @@ -10,7 +10,9 @@ # include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/extension/param/notebook.cpp b/src/extension/param/notebook.cpp index b887be717..97002e33f 100644 --- a/src/extension/param/notebook.cpp +++ b/src/extension/param/notebook.cpp @@ -16,7 +16,9 @@ # include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/extension/param/radiobutton.cpp b/src/extension/param/radiobutton.cpp index 15fc711d0..75d5a40e3 100644 --- a/src/extension/param/radiobutton.cpp +++ b/src/extension/param/radiobutton.cpp @@ -18,7 +18,9 @@ # include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/extension/param/string.cpp b/src/extension/param/string.cpp index cedc6b1a9..d6e438db5 100644 --- a/src/extension/param/string.cpp +++ b/src/extension/param/string.cpp @@ -10,7 +10,9 @@ # include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/extension/prefdialog.h b/src/extension/prefdialog.h index eb57fb6f2..4761b2100 100644 --- a/src/extension/prefdialog.h +++ b/src/extension/prefdialog.h @@ -10,7 +10,9 @@ #ifndef INKSCAPE_EXTENSION_DIALOG_H__ #define INKSCAPE_EXTENSION_DIALOG_H__ +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/helper/window.cpp b/src/helper/window.cpp index 5109a9cbf..cf6fb12ec 100644 --- a/src/helper/window.cpp +++ b/src/helper/window.cpp @@ -13,7 +13,9 @@ # include #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 15720ade5..7e570deb7 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -20,7 +20,9 @@ #include +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include "debug/simple-event.h" diff --git a/src/interface.h b/src/interface.h index ae3ced8ea..98d041edc 100644 --- a/src/interface.h +++ b/src/interface.h @@ -17,7 +17,9 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include diff --git a/src/live_effects/parameter/originalpath.cpp b/src/live_effects/parameter/originalpath.cpp index 8a87ebce0..0cb44954b 100644 --- a/src/live_effects/parameter/originalpath.cpp +++ b/src/live_effects/parameter/originalpath.cpp @@ -4,7 +4,9 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include "live_effects/parameter/originalpath.h" diff --git a/src/ui/dialog/aboutbox.h b/src/ui/dialog/aboutbox.h index e4a87f265..cd58c8988 100644 --- a/src/ui/dialog/aboutbox.h +++ b/src/ui/dialog/aboutbox.h @@ -15,7 +15,9 @@ #ifndef INKSCAPE_UI_DIALOG_ABOUTBOX_H #define INKSCAPE_UI_DIALOG_ABOUTBOX_H +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include diff --git a/src/ui/dialog/calligraphic-profile-rename.h b/src/ui/dialog/calligraphic-profile-rename.h index d2e09f075..3256338eb 100644 --- a/src/ui/dialog/calligraphic-profile-rename.h +++ b/src/ui/dialog/calligraphic-profile-rename.h @@ -15,7 +15,9 @@ # include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/dialog/color-item.cpp b/src/ui/dialog/color-item.cpp index 762a534d9..633b3f4c5 100644 --- a/src/ui/dialog/color-item.cpp +++ b/src/ui/dialog/color-item.cpp @@ -13,7 +13,9 @@ #include +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/dialog/debug.cpp b/src/ui/dialog/debug.cpp index 20865bce6..9e2287f80 100644 --- a/src/ui/dialog/debug.cpp +++ b/src/ui/dialog/debug.cpp @@ -13,7 +13,9 @@ # include #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index fa9f57e48..a851503fe 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -20,7 +20,9 @@ // This has to be included prior to anything that includes setjmp.h, it croaks otherwise #include +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/dialog/filedialogimpl-gtkmm.h b/src/ui/dialog/filedialogimpl-gtkmm.h index 2b1b7c200..79007596f 100644 --- a/src/ui/dialog/filedialogimpl-gtkmm.h +++ b/src/ui/dialog/filedialogimpl-gtkmm.h @@ -17,7 +17,9 @@ #ifndef __FILE_DIALOGIMPL_H__ #define __FILE_DIALOGIMPL_H__ +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include diff --git a/src/ui/dialog/filedialogimpl-win32.h b/src/ui/dialog/filedialogimpl-win32.h index 0839be8a8..2e6bb4bb8 100644 --- a/src/ui/dialog/filedialogimpl-win32.h +++ b/src/ui/dialog/filedialogimpl-win32.h @@ -15,7 +15,10 @@ #ifdef WIN32 #if WITH_GLIBMM_2_32 +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H # include +#endif + #endif #include "gc-core.h" #include diff --git a/src/ui/dialog/floating-behavior.cpp b/src/ui/dialog/floating-behavior.cpp index f8ddaac06..f0c799adf 100644 --- a/src/ui/dialog/floating-behavior.cpp +++ b/src/ui/dialog/floating-behavior.cpp @@ -10,7 +10,9 @@ * Released under GNU GPL. Read the file 'COPYING' for more information. */ +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/dialog/font-substitution.cpp b/src/ui/dialog/font-substitution.cpp index 124a1970a..bf9133086 100644 --- a/src/ui/dialog/font-substitution.cpp +++ b/src/ui/dialog/font-substitution.cpp @@ -10,7 +10,9 @@ # include #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/dialog/guides.h b/src/ui/dialog/guides.h index 2be6e5aed..422fed7fe 100644 --- a/src/ui/dialog/guides.h +++ b/src/ui/dialog/guides.h @@ -15,7 +15,10 @@ # include #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif + #include #if WITH_GTKMM_3_0 diff --git a/src/ui/dialog/icon-preview.cpp b/src/ui/dialog/icon-preview.cpp index 5cfc883c8..468e85d36 100644 --- a/src/ui/dialog/icon-preview.cpp +++ b/src/ui/dialog/icon-preview.cpp @@ -17,7 +17,9 @@ # include #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/dialog/layer-properties.h b/src/ui/dialog/layer-properties.h index b94cdf878..d38b8edf5 100644 --- a/src/ui/dialog/layer-properties.h +++ b/src/ui/dialog/layer-properties.h @@ -16,7 +16,9 @@ # include #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/dialog/layers.h b/src/ui/dialog/layers.h index befecf9d6..1f3f7c377 100644 --- a/src/ui/dialog/layers.h +++ b/src/ui/dialog/layers.h @@ -12,7 +12,9 @@ #ifndef SEEN_LAYERS_PANEL_H #define SEEN_LAYERS_PANEL_H +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/dialog/livepatheffect-add.h b/src/ui/dialog/livepatheffect-add.h index 7a41b8351..41b1bdd2b 100644 --- a/src/ui/dialog/livepatheffect-add.h +++ b/src/ui/dialog/livepatheffect-add.h @@ -11,7 +11,9 @@ #ifndef INKSCAPE_DIALOG_LIVEPATHEFFECT_ADD_H #define INKSCAPE_DIALOG_LIVEPATHEFFECT_ADD_H +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/dialog/messages.h b/src/ui/dialog/messages.h index c5797dc34..92ada9046 100644 --- a/src/ui/dialog/messages.h +++ b/src/ui/dialog/messages.h @@ -16,7 +16,9 @@ #ifndef INKSCAPE_UI_DIALOG_MESSAGES_H #define INKSCAPE_UI_DIALOG_MESSAGES_H +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/dialog/ocaldialogs.h b/src/ui/dialog/ocaldialogs.h index 592d5144c..72d184969 100644 --- a/src/ui/dialog/ocaldialogs.h +++ b/src/ui/dialog/ocaldialogs.h @@ -13,7 +13,9 @@ #ifndef __OCAL_DIALOG_H__ #define __OCAL_DIALOG_H__ +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif //Gtk includes #include diff --git a/src/ui/dialog/spellcheck.h b/src/ui/dialog/spellcheck.h index 026f2a349..f08c0669f 100644 --- a/src/ui/dialog/spellcheck.h +++ b/src/ui/dialog/spellcheck.h @@ -12,7 +12,9 @@ #ifndef SEEN_SPELLCHECK_H #define SEEN_SPELLCHECK_H +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index 8e7f45514..3468d984d 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -18,7 +18,9 @@ #include #include +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/dialog/text-edit.h b/src/ui/dialog/text-edit.h index e409ad73b..eb0811e5d 100644 --- a/src/ui/dialog/text-edit.h +++ b/src/ui/dialog/text-edit.h @@ -18,7 +18,9 @@ #ifndef INKSCAPE_UI_DIALOG_TEXT_EDIT_H #define INKSCAPE_UI_DIALOG_TEXT_EDIT_H +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/dialog/tile.h b/src/ui/dialog/tile.h index 5724596c5..6e41723fd 100644 --- a/src/ui/dialog/tile.h +++ b/src/ui/dialog/tile.h @@ -19,7 +19,9 @@ # include #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index d2604553d..4aa972296 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -15,7 +15,9 @@ # include #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/previewholder.h b/src/ui/previewholder.h index bc0bc8609..f9f923be4 100644 --- a/src/ui/previewholder.h +++ b/src/ui/previewholder.h @@ -16,7 +16,9 @@ # include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/widget/button.h b/src/ui/widget/button.h index 671c3b00f..e8030d937 100644 --- a/src/ui/widget/button.h +++ b/src/ui/widget/button.h @@ -10,7 +10,9 @@ #ifndef INKSCAPE_UI_WIDGET_BUTTON_H #define INKSCAPE_UI_WIDGET_BUTTON_H +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/widget/color-picker.h b/src/ui/widget/color-picker.h index b449d55d1..8264a9175 100644 --- a/src/ui/widget/color-picker.h +++ b/src/ui/widget/color-picker.h @@ -15,7 +15,9 @@ #include +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/widget/color-preview.h b/src/ui/widget/color-preview.h index 57b9a2440..959b5e09b 100644 --- a/src/ui/widget/color-preview.h +++ b/src/ui/widget/color-preview.h @@ -15,7 +15,9 @@ # include #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include diff --git a/src/ui/widget/dock-item.h b/src/ui/widget/dock-item.h index b3ab161c4..a0660ca21 100644 --- a/src/ui/widget/dock-item.h +++ b/src/ui/widget/dock-item.h @@ -11,7 +11,10 @@ #ifndef INKSCAPE_UI_WIGET_DOCK_ITEM_H #define INKSCAPE_UI_WIGET_DOCK_ITEM_H +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif + #include #include #include diff --git a/src/ui/widget/dock.h b/src/ui/widget/dock.h index e9cd8d4fd..e9b6be73d 100644 --- a/src/ui/widget/dock.h +++ b/src/ui/widget/dock.h @@ -12,7 +12,9 @@ #ifndef INKSCAPE_UI_WIDGET_DOCK_H #define INKSCAPE_UI_WIDGET_DOCK_H +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/widget/entity-entry.cpp b/src/ui/widget/entity-entry.cpp index 6b14f2841..0f526f77a 100644 --- a/src/ui/widget/entity-entry.cpp +++ b/src/ui/widget/entity-entry.cpp @@ -17,7 +17,9 @@ # include #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/widget/filter-effect-chooser.h b/src/ui/widget/filter-effect-chooser.h index 8623083ac..3dfcb24a4 100644 --- a/src/ui/widget/filter-effect-chooser.h +++ b/src/ui/widget/filter-effect-chooser.h @@ -12,7 +12,9 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/widget/frame.h b/src/ui/widget/frame.h index 1d8f618c4..ab20ee121 100644 --- a/src/ui/widget/frame.h +++ b/src/ui/widget/frame.h @@ -10,7 +10,9 @@ #ifndef INKSCAPE_UI_WIDGET_FRAME_H #define INKSCAPE_UI_WIDGET_FRAME_H +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/widget/imageicon.h b/src/ui/widget/imageicon.h index 9025786a9..fba01fdc0 100644 --- a/src/ui/widget/imageicon.h +++ b/src/ui/widget/imageicon.h @@ -12,7 +12,9 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/widget/imagetoggler.h b/src/ui/widget/imagetoggler.h index 564f0c296..df6eb7ded 100644 --- a/src/ui/widget/imagetoggler.h +++ b/src/ui/widget/imagetoggler.h @@ -14,7 +14,9 @@ #include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/widget/labelled.h b/src/ui/widget/labelled.h index 5a775a3b1..c49908e6d 100644 --- a/src/ui/widget/labelled.h +++ b/src/ui/widget/labelled.h @@ -11,7 +11,10 @@ #ifndef INKSCAPE_UI_WIDGET_LABELLED_H #define INKSCAPE_UI_WIDGET_LABELLED_H +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif + #include namespace Gtk { diff --git a/src/ui/widget/licensor.h b/src/ui/widget/licensor.h index f71870330..978b81af9 100644 --- a/src/ui/widget/licensor.h +++ b/src/ui/widget/licensor.h @@ -10,7 +10,9 @@ #ifndef INKSCAPE_UI_WIDGET_LICENSOR_H #define INKSCAPE_UI_WIDGET_LICENSOR_H +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include diff --git a/src/ui/widget/notebook-page.h b/src/ui/widget/notebook-page.h index 0913af0f4..38ae9e054 100644 --- a/src/ui/widget/notebook-page.h +++ b/src/ui/widget/notebook-page.h @@ -14,7 +14,9 @@ # include #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include diff --git a/src/ui/widget/object-composite-settings.h b/src/ui/widget/object-composite-settings.h index 58505d023..7eb6b9ae7 100644 --- a/src/ui/widget/object-composite-settings.h +++ b/src/ui/widget/object-composite-settings.h @@ -11,7 +11,9 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/widget/panel.cpp b/src/ui/widget/panel.cpp index 732df4222..d60eeefe0 100644 --- a/src/ui/widget/panel.cpp +++ b/src/ui/widget/panel.cpp @@ -15,7 +15,9 @@ # include #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include // for Gtk::RESPONSE_* #include diff --git a/src/ui/widget/panel.h b/src/ui/widget/panel.h index 6867f119c..0c3d822b8 100644 --- a/src/ui/widget/panel.h +++ b/src/ui/widget/panel.h @@ -17,7 +17,9 @@ # include #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp index 1881f1415..567f29f91 100644 --- a/src/ui/widget/preferences-widget.cpp +++ b/src/ui/widget/preferences-widget.cpp @@ -18,7 +18,9 @@ #include #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/widget/preferences-widget.h b/src/ui/widget/preferences-widget.h index 2eee85aac..3ab918f1b 100644 --- a/src/ui/widget/preferences-widget.h +++ b/src/ui/widget/preferences-widget.h @@ -18,7 +18,9 @@ #include #include +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include "ui/widget/spinbutton.h" diff --git a/src/ui/widget/rotateable.cpp b/src/ui/widget/rotateable.cpp index f48217fba..dcbebf5ce 100644 --- a/src/ui/widget/rotateable.cpp +++ b/src/ui/widget/rotateable.cpp @@ -7,7 +7,9 @@ * Released under GNU GPL. Read the file 'COPYING' for more information. */ +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/widget/selected-style.h b/src/ui/widget/selected-style.h index 12dc5d9f6..e5bc4f883 100644 --- a/src/ui/widget/selected-style.h +++ b/src/ui/widget/selected-style.h @@ -15,7 +15,9 @@ # include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include diff --git a/src/ui/widget/spin-scale.h b/src/ui/widget/spin-scale.h index a1debd6f4..d0c34f70b 100644 --- a/src/ui/widget/spin-scale.h +++ b/src/ui/widget/spin-scale.h @@ -9,7 +9,9 @@ #ifndef INKSCAPE_UI_WIDGET_SPIN_SCALE_H #define INKSCAPE_UI_WIDGET_SPIN_SCALE_H +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/widget/spin-slider.h b/src/ui/widget/spin-slider.h index 2597fdea0..6b1182e1d 100644 --- a/src/ui/widget/spin-slider.h +++ b/src/ui/widget/spin-slider.h @@ -10,7 +10,9 @@ #ifndef INKSCAPE_UI_WIDGET_SPIN_SLIDER_H #define INKSCAPE_UI_WIDGET_SPIN_SLIDER_H +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/widget/spinbutton.h b/src/ui/widget/spinbutton.h index 96cc4e2b9..9f40ed3dc 100644 --- a/src/ui/widget/spinbutton.h +++ b/src/ui/widget/spinbutton.h @@ -10,7 +10,9 @@ #ifndef INKSCAPE_UI_WIDGET_SPINBUTTON_H #define INKSCAPE_UI_WIDGET_SPINBUTTON_H +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include diff --git a/src/ui/widget/style-swatch.h b/src/ui/widget/style-swatch.h index da6bb67e7..6bdb5e248 100644 --- a/src/ui/widget/style-swatch.h +++ b/src/ui/widget/style-swatch.h @@ -17,7 +17,9 @@ # include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/widget/tolerance-slider.cpp b/src/ui/widget/tolerance-slider.cpp index 605ae8e71..d166e3831 100644 --- a/src/ui/widget/tolerance-slider.cpp +++ b/src/ui/widget/tolerance-slider.cpp @@ -12,7 +12,9 @@ # include #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/ui/widget/unit-menu.h b/src/ui/widget/unit-menu.h index e821e1806..001e890eb 100644 --- a/src/ui/widget/unit-menu.h +++ b/src/ui/widget/unit-menu.h @@ -10,7 +10,9 @@ #ifndef INKSCAPE_UI_WIDGET_UNIT_H #define INKSCAPE_UI_WIDGET_UNIT_H +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include "util/units.h" diff --git a/src/verbs.cpp b/src/verbs.cpp index 8d275aeb7..6f83b3dfb 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -32,7 +32,9 @@ #include #include +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/widgets/dash-selector.h b/src/widgets/dash-selector.h index d3eab643a..4004d4089 100644 --- a/src/widgets/dash-selector.h +++ b/src/widgets/dash-selector.h @@ -10,7 +10,9 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/widgets/desktop-widget.h b/src/widgets/desktop-widget.h index 8e828ca94..a93852803 100644 --- a/src/widgets/desktop-widget.h +++ b/src/widgets/desktop-widget.h @@ -12,7 +12,10 @@ * ? -2004 */ +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif + #include #include "message.h" #include "ui/view/view-widget.h" diff --git a/src/widgets/fill-style.cpp b/src/widgets/fill-style.cpp index 6882e263e..d9d62d3ec 100644 --- a/src/widgets/fill-style.cpp +++ b/src/widgets/fill-style.cpp @@ -22,7 +22,9 @@ # include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/widgets/gradient-selector.h b/src/widgets/gradient-selector.h index 2bca6a64f..a5a9dcfc2 100644 --- a/src/widgets/gradient-selector.h +++ b/src/widgets/gradient-selector.h @@ -15,7 +15,9 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/widgets/gradient-vector.h b/src/widgets/gradient-vector.h index 9e3792c06..e90dc9af3 100644 --- a/src/widgets/gradient-vector.h +++ b/src/widgets/gradient-vector.h @@ -15,7 +15,9 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp index c661ae41c..d613ca55d 100644 --- a/src/widgets/icon.cpp +++ b/src/widgets/icon.cpp @@ -16,7 +16,9 @@ # include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/widgets/icon.h b/src/widgets/icon.h index 3c4d91748..123809a41 100644 --- a/src/widgets/icon.h +++ b/src/widgets/icon.h @@ -14,7 +14,10 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif + #include #include "icon-size.h" diff --git a/src/widgets/paint-selector.cpp b/src/widgets/paint-selector.cpp index 9084188b1..40d2fb9f3 100644 --- a/src/widgets/paint-selector.cpp +++ b/src/widgets/paint-selector.cpp @@ -24,7 +24,9 @@ #include #include +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include "widgets/swatch-selector.h" #include "../sp-pattern.h" diff --git a/src/widgets/shrink-wrap-button.cpp b/src/widgets/shrink-wrap-button.cpp index fed792adb..3558780ed 100644 --- a/src/widgets/shrink-wrap-button.cpp +++ b/src/widgets/shrink-wrap-button.cpp @@ -13,7 +13,9 @@ #include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/widgets/sp-attribute-widget.h b/src/widgets/sp-attribute-widget.h index a48d2643d..4bd6c6959 100644 --- a/src/widgets/sp-attribute-widget.h +++ b/src/widgets/sp-attribute-widget.h @@ -19,7 +19,9 @@ # include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/widgets/spw-utilities.cpp b/src/widgets/spw-utilities.cpp index c1a54c1ed..87ca80f2f 100644 --- a/src/widgets/spw-utilities.cpp +++ b/src/widgets/spw-utilities.cpp @@ -17,7 +17,9 @@ #include #include +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/widgets/stroke-marker-selector.h b/src/widgets/stroke-marker-selector.h index d855fab06..6f5ee56c4 100644 --- a/src/widgets/stroke-marker-selector.h +++ b/src/widgets/stroke-marker-selector.h @@ -10,7 +10,9 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include diff --git a/src/widgets/swatch-selector.h b/src/widgets/swatch-selector.h index c2fd1255c..45015593c 100644 --- a/src/widgets/swatch-selector.h +++ b/src/widgets/swatch-selector.h @@ -1,7 +1,9 @@ #ifndef SEEN_SP_SWATCH_SELECTOR_H #define SEEN_SP_SWATCH_SELECTOR_H +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 92fe8a1ff..0fdf36d5f 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -29,7 +29,9 @@ # include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include -- cgit v1.2.3 From 07dcea8f0ee2631331ed3475c9fc38db3e6df16f Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Thu, 6 Jun 2013 20:18:19 -0700 Subject: Adding inclusion of config.h where needed for threads.h check. (bzr r12355) --- src/event-log.h | 4 ++++ src/extension/execution-env.cpp | 4 ++++ src/extension/internal/grid.cpp | 4 ++++ src/extension/prefdialog.h | 4 ++++ src/interface.h | 4 ++++ src/live_effects/parameter/originalpath.cpp | 4 ++++ src/ui/dialog/aboutbox.h | 4 ++++ src/ui/dialog/color-item.cpp | 4 ++++ src/ui/dialog/filedialogimpl-gtkmm.h | 6 ++++-- src/ui/dialog/floating-behavior.cpp | 4 ++++ src/ui/dialog/layers.h | 4 ++++ src/ui/dialog/livepatheffect-add.h | 4 ++++ src/ui/dialog/messages.h | 4 ++++ src/ui/dialog/ocaldialogs.h | 4 ++++ src/ui/dialog/spellcheck.h | 4 ++++ src/ui/dialog/text-edit.h | 4 ++++ src/ui/widget/button.h | 4 ++++ src/ui/widget/color-picker.h | 4 ++++ src/ui/widget/dock-item.h | 4 ++++ src/ui/widget/dock.h | 4 ++++ src/ui/widget/filter-effect-chooser.h | 4 ++++ src/ui/widget/frame.h | 4 ++++ src/ui/widget/imageicon.h | 4 ++++ src/ui/widget/labelled.h | 4 ++++ src/ui/widget/licensor.h | 4 ++++ src/ui/widget/object-composite-settings.h | 4 ++++ src/ui/widget/preferences-widget.h | 4 ++++ src/ui/widget/rotateable.cpp | 4 ++++ src/ui/widget/spin-scale.h | 4 ++++ src/ui/widget/spin-slider.h | 4 ++++ src/ui/widget/spinbutton.h | 4 ++++ src/ui/widget/unit-menu.h | 4 ++++ src/widgets/dash-selector.h | 4 ++++ src/widgets/desktop-widget.h | 4 ++++ src/widgets/gradient-selector.h | 4 ++++ src/widgets/gradient-vector.h | 4 ++++ src/widgets/icon.h | 4 ++++ src/widgets/stroke-marker-selector.h | 4 ++++ src/widgets/swatch-selector.h | 4 ++++ 39 files changed, 156 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/event-log.h b/src/event-log.h index d1e63b1dc..78f0ae5d1 100644 --- a/src/event-log.h +++ b/src/event-log.h @@ -10,6 +10,10 @@ #ifndef INKSCAPE_EVENT_LOG_H #define INKSCAPE_EVENT_LOG_H +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/extension/execution-env.cpp b/src/extension/execution-env.cpp index 343f87cdb..d4b5fd187 100644 --- a/src/extension/execution-env.cpp +++ b/src/extension/execution-env.cpp @@ -10,6 +10,10 @@ #include +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/extension/internal/grid.cpp b/src/extension/internal/grid.cpp index 812c383b4..820d1c9d3 100644 --- a/src/extension/internal/grid.cpp +++ b/src/extension/internal/grid.cpp @@ -11,6 +11,10 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/extension/prefdialog.h b/src/extension/prefdialog.h index 4761b2100..905d35744 100644 --- a/src/extension/prefdialog.h +++ b/src/extension/prefdialog.h @@ -10,6 +10,10 @@ #ifndef INKSCAPE_EXTENSION_DIALOG_H__ #define INKSCAPE_EXTENSION_DIALOG_H__ +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/interface.h b/src/interface.h index 98d041edc..13fbaf9ac 100644 --- a/src/interface.h +++ b/src/interface.h @@ -17,6 +17,10 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/live_effects/parameter/originalpath.cpp b/src/live_effects/parameter/originalpath.cpp index 0cb44954b..6e1d9476d 100644 --- a/src/live_effects/parameter/originalpath.cpp +++ b/src/live_effects/parameter/originalpath.cpp @@ -4,6 +4,10 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/ui/dialog/aboutbox.h b/src/ui/dialog/aboutbox.h index cd58c8988..7b3308672 100644 --- a/src/ui/dialog/aboutbox.h +++ b/src/ui/dialog/aboutbox.h @@ -15,6 +15,10 @@ #ifndef INKSCAPE_UI_DIALOG_ABOUTBOX_H #define INKSCAPE_UI_DIALOG_ABOUTBOX_H +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/ui/dialog/color-item.cpp b/src/ui/dialog/color-item.cpp index 633b3f4c5..2292b66fc 100644 --- a/src/ui/dialog/color-item.cpp +++ b/src/ui/dialog/color-item.cpp @@ -11,6 +11,10 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H diff --git a/src/ui/dialog/filedialogimpl-gtkmm.h b/src/ui/dialog/filedialogimpl-gtkmm.h index 79007596f..6687915d7 100644 --- a/src/ui/dialog/filedialogimpl-gtkmm.h +++ b/src/ui/dialog/filedialogimpl-gtkmm.h @@ -17,11 +17,13 @@ #ifndef __FILE_DIALOGIMPL_H__ #define __FILE_DIALOGIMPL_H__ -#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H -#include +#ifdef HAVE_CONFIG_H +# include #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif //Gtk includes #include diff --git a/src/ui/dialog/floating-behavior.cpp b/src/ui/dialog/floating-behavior.cpp index f0c799adf..dd07f009a 100644 --- a/src/ui/dialog/floating-behavior.cpp +++ b/src/ui/dialog/floating-behavior.cpp @@ -10,6 +10,10 @@ * Released under GNU GPL. Read the file 'COPYING' for more information. */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/ui/dialog/layers.h b/src/ui/dialog/layers.h index 1f3f7c377..ae0ac6040 100644 --- a/src/ui/dialog/layers.h +++ b/src/ui/dialog/layers.h @@ -12,6 +12,10 @@ #ifndef SEEN_LAYERS_PANEL_H #define SEEN_LAYERS_PANEL_H +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/ui/dialog/livepatheffect-add.h b/src/ui/dialog/livepatheffect-add.h index 41b1bdd2b..7fa766272 100644 --- a/src/ui/dialog/livepatheffect-add.h +++ b/src/ui/dialog/livepatheffect-add.h @@ -11,6 +11,10 @@ #ifndef INKSCAPE_DIALOG_LIVEPATHEFFECT_ADD_H #define INKSCAPE_DIALOG_LIVEPATHEFFECT_ADD_H +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/ui/dialog/messages.h b/src/ui/dialog/messages.h index 92ada9046..54ca84f47 100644 --- a/src/ui/dialog/messages.h +++ b/src/ui/dialog/messages.h @@ -16,6 +16,10 @@ #ifndef INKSCAPE_UI_DIALOG_MESSAGES_H #define INKSCAPE_UI_DIALOG_MESSAGES_H +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/ui/dialog/ocaldialogs.h b/src/ui/dialog/ocaldialogs.h index 72d184969..e21030bcd 100644 --- a/src/ui/dialog/ocaldialogs.h +++ b/src/ui/dialog/ocaldialogs.h @@ -13,6 +13,10 @@ #ifndef __OCAL_DIALOG_H__ #define __OCAL_DIALOG_H__ +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/ui/dialog/spellcheck.h b/src/ui/dialog/spellcheck.h index f08c0669f..27b89e34e 100644 --- a/src/ui/dialog/spellcheck.h +++ b/src/ui/dialog/spellcheck.h @@ -12,6 +12,10 @@ #ifndef SEEN_SPELLCHECK_H #define SEEN_SPELLCHECK_H +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/ui/dialog/text-edit.h b/src/ui/dialog/text-edit.h index eb0811e5d..8683d80a3 100644 --- a/src/ui/dialog/text-edit.h +++ b/src/ui/dialog/text-edit.h @@ -18,6 +18,10 @@ #ifndef INKSCAPE_UI_DIALOG_TEXT_EDIT_H #define INKSCAPE_UI_DIALOG_TEXT_EDIT_H +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/ui/widget/button.h b/src/ui/widget/button.h index e8030d937..a214dd881 100644 --- a/src/ui/widget/button.h +++ b/src/ui/widget/button.h @@ -10,6 +10,10 @@ #ifndef INKSCAPE_UI_WIDGET_BUTTON_H #define INKSCAPE_UI_WIDGET_BUTTON_H +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/ui/widget/color-picker.h b/src/ui/widget/color-picker.h index 8264a9175..b4da5dbf2 100644 --- a/src/ui/widget/color-picker.h +++ b/src/ui/widget/color-picker.h @@ -13,6 +13,10 @@ #ifndef __COLOR_PICKER_H__ #define __COLOR_PICKER_H__ +#ifdef HAVE_CONFIG_H +# include +#endif + #include #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H diff --git a/src/ui/widget/dock-item.h b/src/ui/widget/dock-item.h index a0660ca21..cc0c13eea 100644 --- a/src/ui/widget/dock-item.h +++ b/src/ui/widget/dock-item.h @@ -11,6 +11,10 @@ #ifndef INKSCAPE_UI_WIGET_DOCK_ITEM_H #define INKSCAPE_UI_WIGET_DOCK_ITEM_H +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/ui/widget/dock.h b/src/ui/widget/dock.h index e9b6be73d..611c10f46 100644 --- a/src/ui/widget/dock.h +++ b/src/ui/widget/dock.h @@ -12,6 +12,10 @@ #ifndef INKSCAPE_UI_WIDGET_DOCK_H #define INKSCAPE_UI_WIDGET_DOCK_H +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/ui/widget/filter-effect-chooser.h b/src/ui/widget/filter-effect-chooser.h index 3dfcb24a4..6f0c2f26e 100644 --- a/src/ui/widget/filter-effect-chooser.h +++ b/src/ui/widget/filter-effect-chooser.h @@ -12,6 +12,10 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/ui/widget/frame.h b/src/ui/widget/frame.h index ab20ee121..55638ad40 100644 --- a/src/ui/widget/frame.h +++ b/src/ui/widget/frame.h @@ -10,6 +10,10 @@ #ifndef INKSCAPE_UI_WIDGET_FRAME_H #define INKSCAPE_UI_WIDGET_FRAME_H +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/ui/widget/imageicon.h b/src/ui/widget/imageicon.h index fba01fdc0..8faf13cb1 100644 --- a/src/ui/widget/imageicon.h +++ b/src/ui/widget/imageicon.h @@ -12,6 +12,10 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/ui/widget/labelled.h b/src/ui/widget/labelled.h index c49908e6d..5334454bc 100644 --- a/src/ui/widget/labelled.h +++ b/src/ui/widget/labelled.h @@ -11,6 +11,10 @@ #ifndef INKSCAPE_UI_WIDGET_LABELLED_H #define INKSCAPE_UI_WIDGET_LABELLED_H +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/ui/widget/licensor.h b/src/ui/widget/licensor.h index 978b81af9..0ac3e5ab8 100644 --- a/src/ui/widget/licensor.h +++ b/src/ui/widget/licensor.h @@ -10,6 +10,10 @@ #ifndef INKSCAPE_UI_WIDGET_LICENSOR_H #define INKSCAPE_UI_WIDGET_LICENSOR_H +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/ui/widget/object-composite-settings.h b/src/ui/widget/object-composite-settings.h index 7eb6b9ae7..19a6cb2a5 100644 --- a/src/ui/widget/object-composite-settings.h +++ b/src/ui/widget/object-composite-settings.h @@ -11,6 +11,10 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/ui/widget/preferences-widget.h b/src/ui/widget/preferences-widget.h index 3ab918f1b..cb4ce17d1 100644 --- a/src/ui/widget/preferences-widget.h +++ b/src/ui/widget/preferences-widget.h @@ -15,6 +15,10 @@ #ifndef INKSCAPE_UI_WIDGET_INKSCAPE_PREFERENCES_H #define INKSCAPE_UI_WIDGET_INKSCAPE_PREFERENCES_H +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include diff --git a/src/ui/widget/rotateable.cpp b/src/ui/widget/rotateable.cpp index dcbebf5ce..18d53bf5c 100644 --- a/src/ui/widget/rotateable.cpp +++ b/src/ui/widget/rotateable.cpp @@ -7,6 +7,10 @@ * Released under GNU GPL. Read the file 'COPYING' for more information. */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/ui/widget/spin-scale.h b/src/ui/widget/spin-scale.h index d0c34f70b..5fec8b1d8 100644 --- a/src/ui/widget/spin-scale.h +++ b/src/ui/widget/spin-scale.h @@ -9,6 +9,10 @@ #ifndef INKSCAPE_UI_WIDGET_SPIN_SCALE_H #define INKSCAPE_UI_WIDGET_SPIN_SCALE_H +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/ui/widget/spin-slider.h b/src/ui/widget/spin-slider.h index 6b1182e1d..5f86fd15a 100644 --- a/src/ui/widget/spin-slider.h +++ b/src/ui/widget/spin-slider.h @@ -10,6 +10,10 @@ #ifndef INKSCAPE_UI_WIDGET_SPIN_SLIDER_H #define INKSCAPE_UI_WIDGET_SPIN_SLIDER_H +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/ui/widget/spinbutton.h b/src/ui/widget/spinbutton.h index 9f40ed3dc..fe5d699e7 100644 --- a/src/ui/widget/spinbutton.h +++ b/src/ui/widget/spinbutton.h @@ -10,6 +10,10 @@ #ifndef INKSCAPE_UI_WIDGET_SPINBUTTON_H #define INKSCAPE_UI_WIDGET_SPINBUTTON_H +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/ui/widget/unit-menu.h b/src/ui/widget/unit-menu.h index 001e890eb..3104d5aef 100644 --- a/src/ui/widget/unit-menu.h +++ b/src/ui/widget/unit-menu.h @@ -10,6 +10,10 @@ #ifndef INKSCAPE_UI_WIDGET_UNIT_H #define INKSCAPE_UI_WIDGET_UNIT_H +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/widgets/dash-selector.h b/src/widgets/dash-selector.h index 4004d4089..faa667ac7 100644 --- a/src/widgets/dash-selector.h +++ b/src/widgets/dash-selector.h @@ -10,6 +10,10 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/widgets/desktop-widget.h b/src/widgets/desktop-widget.h index a93852803..9031ac854 100644 --- a/src/widgets/desktop-widget.h +++ b/src/widgets/desktop-widget.h @@ -12,6 +12,10 @@ * ? -2004 */ +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/widgets/gradient-selector.h b/src/widgets/gradient-selector.h index a5a9dcfc2..c88666b06 100644 --- a/src/widgets/gradient-selector.h +++ b/src/widgets/gradient-selector.h @@ -15,6 +15,10 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/widgets/gradient-vector.h b/src/widgets/gradient-vector.h index e90dc9af3..64e40a35b 100644 --- a/src/widgets/gradient-vector.h +++ b/src/widgets/gradient-vector.h @@ -15,6 +15,10 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/widgets/icon.h b/src/widgets/icon.h index 123809a41..87dd943c4 100644 --- a/src/widgets/icon.h +++ b/src/widgets/icon.h @@ -14,6 +14,10 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/widgets/stroke-marker-selector.h b/src/widgets/stroke-marker-selector.h index 6f5ee56c4..d9732038e 100644 --- a/src/widgets/stroke-marker-selector.h +++ b/src/widgets/stroke-marker-selector.h @@ -10,6 +10,10 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif diff --git a/src/widgets/swatch-selector.h b/src/widgets/swatch-selector.h index 45015593c..c8c9983a6 100644 --- a/src/widgets/swatch-selector.h +++ b/src/widgets/swatch-selector.h @@ -1,6 +1,10 @@ #ifndef SEEN_SP_SWATCH_SELECTOR_H #define SEEN_SP_SWATCH_SELECTOR_H +#ifdef HAVE_CONFIG_H +# include +#endif + #if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include #endif -- cgit v1.2.3 From be62ee4a8567deb8679d413c8342e30114058d0c Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Thu, 6 Jun 2013 21:57:04 -0700 Subject: Glibmm 2.32+ fix extended to optional components. Fixes bug #1179338. Fixed bugs: - https://launchpad.net/bugs/1179338 (bzr r12356) --- src/extension/internal/bitmap/imagemagick.cpp | 8 ++++++++ src/extension/internal/cdr-input.h | 4 ++++ src/extension/internal/vsd-input.h | 4 ++++ 3 files changed, 16 insertions(+) (limited to 'src') diff --git a/src/extension/internal/bitmap/imagemagick.cpp b/src/extension/internal/bitmap/imagemagick.cpp index 728c38dea..0d47240d4 100644 --- a/src/extension/internal/bitmap/imagemagick.cpp +++ b/src/extension/internal/bitmap/imagemagick.cpp @@ -8,6 +8,14 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H +#include +#endif + #include #include diff --git a/src/extension/internal/cdr-input.h b/src/extension/internal/cdr-input.h index 10af41d5a..3de6c1ed0 100644 --- a/src/extension/internal/cdr-input.h +++ b/src/extension/internal/cdr-input.h @@ -19,6 +19,10 @@ #ifdef WITH_LIBCDR +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H +#include +#endif + #include #include "../implementation/implementation.h" diff --git a/src/extension/internal/vsd-input.h b/src/extension/internal/vsd-input.h index acc52debf..3414e0ec9 100644 --- a/src/extension/internal/vsd-input.h +++ b/src/extension/internal/vsd-input.h @@ -19,6 +19,10 @@ #ifdef WITH_LIBVISIO +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H +#include +#endif + #include #include "../implementation/implementation.h" -- cgit v1.2.3 From bfd18a3735059a4f308d540cd3d7d388ccb5d3ce Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Fri, 7 Jun 2013 00:52:11 -0700 Subject: Check for value in range before dereferencing. (bzr r12357) --- src/widgets/sp-color-notebook.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/widgets/sp-color-notebook.cpp b/src/widgets/sp-color-notebook.cpp index f75521e2c..c709e9775 100644 --- a/src/widgets/sp-color-notebook.cpp +++ b/src/widgets/sp-color-notebook.cpp @@ -651,8 +651,11 @@ void ColorNotebook::_updateRgbaEntry( const SPColor& color, gfloat alpha ) void ColorNotebook::_setCurrentPage(int i) { - gtk_notebook_set_current_page (GTK_NOTEBOOK (_book), i); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(_buttons[i]), TRUE); + gtk_notebook_set_current_page(GTK_NOTEBOOK(_book), i); + + if (_buttons && _trackerList && (static_cast(i) < _trackerList->len) ) { + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(_buttons[i]), TRUE); + } } void ColorNotebook::_buttonClicked(GtkWidget *widget, SPColorNotebook *colorbook) -- cgit v1.2.3 From c805d69e8c709f2348e1c6d9507a28ef03e22136 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Fri, 7 Jun 2013 01:10:07 -0700 Subject: C++ conversion of parallel arrays to vector of class instances. (bzr r12358) --- src/widgets/sp-color-icc-selector.cpp | 226 +++++++++++++++++++++------------- 1 file changed, 137 insertions(+), 89 deletions(-) (limited to 'src') diff --git a/src/widgets/sp-color-icc-selector.cpp b/src/widgets/sp-color-icc-selector.cpp index 69677257d..394b5cb28 100644 --- a/src/widgets/sp-color-icc-selector.cpp +++ b/src/widgets/sp-color-icc-selector.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include "../dialogs/dialog-events.h" @@ -73,9 +74,33 @@ static void sp_color_icc_selector_dispose(GObject *object); static void sp_color_icc_selector_show_all (GtkWidget *widget); static void sp_color_icc_selector_hide(GtkWidget *widget); - G_END_DECLS +/** + * Class containing the parts for a single color component's UI presence. + */ +class ComponentUI +{ +public: + ComponentUI() : + _adj(0), + _slider(0), + _btn(0), + _label(0), + _map(0) + { + } + + GtkAdjustment *_adj; // Component adjustment + GtkWidget *_slider; + GtkWidget *_btn; // spinbutton + GtkWidget *_label; // Label + guchar *_map; +}; + +/** + * Class that implements the internals of the selector. + */ class ColorICCSelectorImpl { public: @@ -109,13 +134,9 @@ public: GtkWidget* _fixupBtn; GtkWidget* _profileSel; - guint _fooCount; std::vector _fooScales; - GtkAdjustment** _fooAdj; - GtkWidget** _fooSlider; - GtkWidget** _fooBtn; - GtkWidget** _fooLabel; - guchar** _fooMap; + + std::vector _compUI; GtkAdjustment* _adj; // Channel adjustment GtkWidget* _slider; @@ -136,7 +157,23 @@ static SPColorSelectorClass *parent_class; #define XPAD 4 #define YPAD 1 -GType sp_color_icc_selector_get_type (void) +namespace +{ + +size_t maxColorspaceComponentCount = 0; + +#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) + +/** + * Internal variable to track all known colorspaces. + */ +std::set knownColorspaces; + +#endif + +} // namespace + +GType sp_color_icc_selector_get_type(void) { static GType type = 0; if (!type) { @@ -275,6 +312,12 @@ std::vector colorspace::getColorSpaceInfo( uint32_t space sets[cmsSigCmyData].push_back(Component(_("_C:"), _("Cyan"), 1)); // TYPE_CMY_16 sets[cmsSigCmyData].push_back(Component(_("_M:"), _("Magenta"), 1)); sets[cmsSigCmyData].push_back(Component(_("_Y:"), _("Yellow"), 1)); + + for (std::map >::iterator it = sets.begin(); it != sets.end(); ++it) + { + knownColorspaces.insert(it->first); + maxColorspaceComponentCount = std::max(maxColorspaceComponentCount, it->second.size()); + } } std::vector target; @@ -301,12 +344,8 @@ ColorICCSelectorImpl::ColorICCSelectorImpl(ColorICCSelector *owner) : _fixupNeeded(0), _fixupBtn(0), _profileSel(0), - _fooCount(4), - _fooAdj(new GtkAdjustment*[_fooCount]), - _fooSlider(new GtkWidget*[_fooCount]), - _fooBtn(new GtkWidget*[_fooCount]), - _fooLabel(new GtkWidget*[_fooCount]), - _fooMap(new guchar*[_fooCount]), + _fooScales(), + _compUI(), _adj(0), _slider(0), _sbtn(0), @@ -353,6 +392,7 @@ void ColorICCSelector::init() _impl->_fooScales.push_back(it->scale); } #endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) + _impl->_compUI.clear(); // Create components row = 0; @@ -409,24 +449,32 @@ void ColorICCSelector::init() row++; - for ( guint i = 0; i < _impl->_fooCount; i++ ) { + // populate the data for colorspaces and channels: +#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) + colorspace::getColorSpaceInfo(cmsSigCmykData); +#endif + + for ( size_t i = 0; i < maxColorspaceComponentCount; i++ ) { + _impl->_compUI.push_back(ComponentUI()); + // Label #if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) - _impl->_fooLabel[i] = gtk_label_new_with_mnemonic( (i < things.size()) ? things[i].name.c_str() : "" ); + std::string labelStr = (i < things.size()) ? things[i].name.c_str() : ""; #else - _impl->_fooLabel[i] = gtk_label_new_with_mnemonic( "." ); + std::string labelStr = "."; #endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) - gtk_misc_set_alignment( GTK_MISC (_impl->_fooLabel[i]), 1.0, 0.5 ); - gtk_widget_show( _impl->_fooLabel[i] ); + _impl->_compUI[i]._label = gtk_label_new_with_mnemonic( labelStr.c_str() ); + gtk_misc_set_alignment( GTK_MISC (_impl->_compUI[i]._label), 1.0, 0.5 ); + gtk_widget_show( _impl->_compUI[i]._label ); #if GTK_CHECK_VERSION(3,0,0) - gtk_widget_set_margin_left(_impl->_fooLabel[i], XPAD); - gtk_widget_set_margin_right(_impl->_fooLabel[i], XPAD); - gtk_widget_set_margin_top(_impl->_fooLabel[i], YPAD); - gtk_widget_set_margin_bottom(_impl->_fooLabel[i], YPAD); - gtk_grid_attach(GTK_GRID(t), _impl->_fooLabel[i], 0, row, 1, 1); + gtk_widget_set_margin_left(_impl->_compUI[i]._label, XPAD); + gtk_widget_set_margin_right(_impl->_compUI[i]._label, XPAD); + gtk_widget_set_margin_top(_impl->_compUI[i]._label, YPAD); + gtk_widget_set_margin_bottom(_impl->_compUI[i]._label, YPAD); + gtk_grid_attach(GTK_GRID(t), _impl->_compUI[i]._label, 0, row, 1, 1); #else - gtk_table_attach( GTK_TABLE (t), _impl->_fooLabel[i], 0, 1, row, row + 1, GTK_FILL, GTK_FILL, XPAD, YPAD ); + gtk_table_attach( GTK_TABLE (t), _impl->_compUI[i]._label, 0, 1, row, row + 1, GTK_FILL, GTK_FILL, XPAD, YPAD ); #endif // Adjustment @@ -434,60 +482,60 @@ void ColorICCSelector::init() gdouble step = static_cast(scaleValue) / 100.0; gdouble page = static_cast(scaleValue) / 10.0; gint digits = (step > 0.9) ? 0 : 2; - _impl->_fooAdj[i] = GTK_ADJUSTMENT( gtk_adjustment_new( 0.0, 0.0, scaleValue, step, page, page ) ); + _impl->_compUI[i]._adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0.0, 0.0, scaleValue, step, page, page ) ); // Slider - _impl->_fooSlider[i] = sp_color_slider_new( _impl->_fooAdj[i] ); + _impl->_compUI[i]._slider = sp_color_slider_new( _impl->_compUI[i]._adj ); #if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) - gtk_widget_set_tooltip_text( _impl->_fooSlider[i], (i < things.size()) ? things[i].tip.c_str() : "" ); + gtk_widget_set_tooltip_text( _impl->_compUI[i]._slider, (i < things.size()) ? things[i].tip.c_str() : "" ); #else - gtk_widget_set_tooltip_text( _impl->_fooSlider[i], "." ); + gtk_widget_set_tooltip_text( _impl->_compUI[i]._slider, "." ); #endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) - gtk_widget_show( _impl->_fooSlider[i] ); + gtk_widget_show( _impl->_compUI[i]._slider ); #if GTK_CHECK_VERSION(3,0,0) - gtk_widget_set_margin_left(_impl->_fooSlider[i], XPAD); - gtk_widget_set_margin_right(_impl->_fooSlider[i], XPAD); - gtk_widget_set_margin_top(_impl->_fooSlider[i], YPAD); - gtk_widget_set_margin_bottom(_impl->_fooSlider[i], YPAD); - gtk_widget_set_hexpand(_impl->_fooSlider[i], TRUE); - gtk_grid_attach(GTK_GRID(t), _impl->_fooSlider[i], 1, row, 1, 1); + gtk_widget_set_margin_left(_impl->_compUI[i]._slider, XPAD); + gtk_widget_set_margin_right(_impl->_compUI[i]._slider, XPAD); + gtk_widget_set_margin_top(_impl->_compUI[i]._slider, YPAD); + gtk_widget_set_margin_bottom(_impl->_compUI[i]._slider, YPAD); + gtk_widget_set_hexpand(_impl->_compUI[i]._slider, TRUE); + gtk_grid_attach(GTK_GRID(t), _impl->_compUI[i]._slider, 1, row, 1, 1); #else - gtk_table_attach( GTK_TABLE (t), _impl->_fooSlider[i], 1, 2, row, row + 1, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), GTK_FILL, XPAD, YPAD ); + gtk_table_attach( GTK_TABLE (t), _impl->_compUI[i]._slider, 1, 2, row, row + 1, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), GTK_FILL, XPAD, YPAD ); #endif - _impl->_fooBtn[i] = gtk_spin_button_new( _impl->_fooAdj[i], step, digits ); + _impl->_compUI[i]._btn = gtk_spin_button_new( _impl->_compUI[i]._adj, step, digits ); #if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) - gtk_widget_set_tooltip_text( _impl->_fooBtn[i], (i < things.size()) ? things[i].tip.c_str() : "" ); + gtk_widget_set_tooltip_text( _impl->_compUI[i]._btn, (i < things.size()) ? things[i].tip.c_str() : "" ); #else - gtk_widget_set_tooltip_text( _impl->_fooBtn[i], "." ); + gtk_widget_set_tooltip_text( _impl->_compUI[i]._btn, "." ); #endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) - sp_dialog_defocus_on_enter( _impl->_fooBtn[i] ); - gtk_label_set_mnemonic_widget( GTK_LABEL(_impl->_fooLabel[i]), _impl->_fooBtn[i] ); - gtk_widget_show( _impl->_fooBtn[i] ); + sp_dialog_defocus_on_enter( _impl->_compUI[i]._btn ); + gtk_label_set_mnemonic_widget( GTK_LABEL(_impl->_compUI[i]._label), _impl->_compUI[i]._btn ); + gtk_widget_show( _impl->_compUI[i]._btn ); #if GTK_CHECK_VERSION(3,0,0) - gtk_widget_set_margin_left(_impl->_fooBtn[i], XPAD); - gtk_widget_set_margin_right(_impl->_fooBtn[i], XPAD); - gtk_widget_set_margin_top(_impl->_fooBtn[i], YPAD); - gtk_widget_set_margin_bottom(_impl->_fooBtn[i], YPAD); - gtk_widget_set_halign(_impl->_fooBtn[i], GTK_ALIGN_CENTER); - gtk_widget_set_valign(_impl->_fooBtn[i], GTK_ALIGN_CENTER); - gtk_grid_attach(GTK_GRID(t), _impl->_fooBtn[i], 2, row, 1, 1); + gtk_widget_set_margin_left(_impl->_compUI[i]._btn, XPAD); + gtk_widget_set_margin_right(_impl->_compUI[i]._btn, XPAD); + gtk_widget_set_margin_top(_impl->_compUI[i]._btn, YPAD); + gtk_widget_set_margin_bottom(_impl->_compUI[i]._btn, YPAD); + gtk_widget_set_halign(_impl->_compUI[i]._btn, GTK_ALIGN_CENTER); + gtk_widget_set_valign(_impl->_compUI[i]._btn, GTK_ALIGN_CENTER); + gtk_grid_attach(GTK_GRID(t), _impl->_compUI[i]._btn, 2, row, 1, 1); #else - gtk_table_attach( GTK_TABLE (t), _impl->_fooBtn[i], 2, 3, row, row + 1, (GtkAttachOptions)0, (GtkAttachOptions)0, XPAD, YPAD ); + gtk_table_attach( GTK_TABLE (t), _impl->_compUI[i]._btn, 2, 3, row, row + 1, (GtkAttachOptions)0, (GtkAttachOptions)0, XPAD, YPAD ); #endif - _impl->_fooMap[i] = g_new( guchar, 4 * 1024 ); - memset( _impl->_fooMap[i], 0x0ff, 1024 * 4 ); + _impl->_compUI[i]._map = g_new( guchar, 4 * 1024 ); + memset( _impl->_compUI[i]._map, 0x0ff, 1024 * 4 ); // Signals - g_signal_connect( G_OBJECT( _impl->_fooAdj[i] ), "value_changed", G_CALLBACK( ColorICCSelectorImpl::_adjustmentChanged ), _csel ); + g_signal_connect( G_OBJECT( _impl->_compUI[i]._adj ), "value_changed", G_CALLBACK( ColorICCSelectorImpl::_adjustmentChanged ), _csel ); - g_signal_connect( G_OBJECT( _impl->_fooSlider[i] ), "grabbed", G_CALLBACK( ColorICCSelectorImpl::_sliderGrabbed ), _csel ); - g_signal_connect( G_OBJECT( _impl->_fooSlider[i] ), "released", G_CALLBACK( ColorICCSelectorImpl::_sliderReleased ), _csel ); - g_signal_connect( G_OBJECT( _impl->_fooSlider[i] ), "changed", G_CALLBACK( ColorICCSelectorImpl::_sliderChanged ), _csel ); + g_signal_connect( G_OBJECT( _impl->_compUI[i]._slider ), "grabbed", G_CALLBACK( ColorICCSelectorImpl::_sliderGrabbed ), _csel ); + g_signal_connect( G_OBJECT( _impl->_compUI[i]._slider ), "released", G_CALLBACK( ColorICCSelectorImpl::_sliderReleased ), _csel ); + g_signal_connect( G_OBJECT( _impl->_compUI[i]._slider ), "changed", G_CALLBACK( ColorICCSelectorImpl::_sliderChanged ), _csel ); row++; } @@ -592,7 +640,7 @@ void ColorICCSelectorImpl::_fixupHit( GtkWidget* /*src*/, gpointer data ) { ColorICCSelectorImpl* self = reinterpret_cast(data); gtk_widget_set_sensitive( self->_fixupBtn, FALSE ); - self->_adjustmentChanged( self->_fooAdj[0], SP_COLOR_ICC_SELECTOR(self->_owner->_csel) ); + self->_adjustmentChanged( self->_compUI[0]._adj, SP_COLOR_ICC_SELECTOR(self->_owner->_csel) ); } #if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) @@ -704,7 +752,7 @@ void ColorICCSelectorImpl::_switchToProfile( gchar const* name ) g_message("+ new color is [%s]", tmp.toString().c_str()); #endif // DEBUG_LCMS _setProfile( tmp.icc ); - //_adjustmentChanged( _fooAdj[0], SP_COLOR_ICC_SELECTOR(_csel) ); + //_adjustmentChanged( _compUI[0]._adj, SP_COLOR_ICC_SELECTOR(_csel) ); _owner->setColorAlpha( tmp, _owner->_alpha, true ); #ifdef DEBUG_LCMS g_message("+_________________"); @@ -840,10 +888,10 @@ void ColorICCSelectorImpl::_setProfile( SVGICCColor* profile ) profChanged = true; } - for ( guint i = 0; i < _fooCount; i++ ) { - gtk_widget_hide( _fooLabel[i] ); - gtk_widget_hide( _fooSlider[i] ); - gtk_widget_hide( _fooBtn[i] ); + for ( size_t i = 0; i < _compUI.size(); i++ ) { + gtk_widget_hide( _compUI[i]._label ); + gtk_widget_hide( _compUI[i]._slider ); + gtk_widget_hide( _compUI[i]._btn ); } if ( profile ) { @@ -862,33 +910,33 @@ void ColorICCSelectorImpl::_setProfile( SVGICCColor* profile ) } if ( profChanged ) { for ( guint i = 0; i < _profChannelCount; i++ ) { - gtk_label_set_text_with_mnemonic( GTK_LABEL(_fooLabel[i]), (i < things.size()) ? things[i].name.c_str() : ""); + gtk_label_set_text_with_mnemonic( GTK_LABEL(_compUI[i]._label), (i < things.size()) ? things[i].name.c_str() : ""); - gtk_widget_set_tooltip_text( _fooSlider[i], (i < things.size()) ? things[i].tip.c_str() : "" ); - gtk_widget_set_tooltip_text( _fooBtn[i], (i < things.size()) ? things[i].tip.c_str() : "" ); + gtk_widget_set_tooltip_text( _compUI[i]._slider, (i < things.size()) ? things[i].tip.c_str() : "" ); + gtk_widget_set_tooltip_text( _compUI[i]._btn, (i < things.size()) ? things[i].tip.c_str() : "" ); - sp_color_slider_set_colors( SP_COLOR_SLIDER(_fooSlider[i]), + sp_color_slider_set_colors( SP_COLOR_SLIDER(_compUI[i]._slider), SPColor(0.0, 0.0, 0.0).toRGBA32(0xff), SPColor(0.5, 0.5, 0.5).toRGBA32(0xff), SPColor(1.0, 1.0, 1.0).toRGBA32(0xff) ); /* - _fooAdj[i] = GTK_ADJUSTMENT( gtk_adjustment_new( val, 0.0, _fooScales[i], step, page, page ) ); - g_signal_connect( G_OBJECT( _fooAdj[i] ), "value_changed", G_CALLBACK( _adjustmentChanged ), _csel ); + _compUI[i]._adj = GTK_ADJUSTMENT( gtk_adjustment_new( val, 0.0, _fooScales[i], step, page, page ) ); + g_signal_connect( G_OBJECT( _compUI[i]._adj ), "value_changed", G_CALLBACK( _adjustmentChanged ), _csel ); - sp_color_slider_set_adjustment( SP_COLOR_SLIDER(_fooSlider[i]), _fooAdj[i] ); - gtk_spin_button_set_adjustment( GTK_SPIN_BUTTON(_fooBtn[i]), _fooAdj[i] ); - gtk_spin_button_set_digits( GTK_SPIN_BUTTON(_fooBtn[i]), digits ); + sp_color_slider_set_adjustment( SP_COLOR_SLIDER(_compUI[i]._slider), _compUI[i]._adj ); + gtk_spin_button_set_adjustment( GTK_SPIN_BUTTON(_compUI[i]._btn), _compUI[i]._adj ); + gtk_spin_button_set_digits( GTK_SPIN_BUTTON(_compUI[i]._btn), digits ); */ - gtk_widget_show( _fooLabel[i] ); - gtk_widget_show( _fooSlider[i] ); - gtk_widget_show( _fooBtn[i] ); - //gtk_adjustment_set_value( _fooAdj[i], 0.0 ); - //gtk_adjustment_set_value( _fooAdj[i], val ); + gtk_widget_show( _compUI[i]._label ); + gtk_widget_show( _compUI[i]._slider ); + gtk_widget_show( _compUI[i]._btn ); + //gtk_adjustment_set_value( _compUI[i]._adj, 0.0 ); + //gtk_adjustment_set_value( _compUI[i]._adj, val ); } - for ( guint i = _profChannelCount; i < _fooCount; i++ ) { - gtk_widget_hide( _fooLabel[i] ); - gtk_widget_hide( _fooSlider[i] ); - gtk_widget_hide( _fooBtn[i] ); + for ( size_t i = _profChannelCount; i < _compUI.size(); i++ ) { + gtk_widget_hide( _compUI[i]._label ); + gtk_widget_hide( _compUI[i]._slider ); + gtk_widget_hide( _compUI[i]._btn ); } } } else { @@ -917,7 +965,7 @@ void ColorICCSelectorImpl::_updateSliders( gint ignore ) val = _owner->_color.icc->colors[i] / static_cast(_fooScales[i]); } } - gtk_adjustment_set_value( _fooAdj[i], val ); + gtk_adjustment_set_value( _compUI[i]._adj, val ); } if ( _prof ) { @@ -927,7 +975,7 @@ void ColorICCSelectorImpl::_updateSliders( gint ignore ) cmsUInt16Number* scratch = getScratch(); cmsUInt16Number filler[4] = {0, 0, 0, 0}; for ( guint j = 0; j < _profChannelCount; j++ ) { - filler[j] = 0x0ffff * ColorScales::getScaled( _fooAdj[j] ); + filler[j] = 0x0ffff * ColorScales::getScaled( _compUI[j]._adj ); } cmsUInt16Number* p = scratch; @@ -943,8 +991,8 @@ void ColorICCSelectorImpl::_updateSliders( gint ignore ) cmsHTRANSFORM trans = _prof->getTransfToSRGB8(); if ( trans ) { - cmsDoTransform( trans, scratch, _fooMap[i], 1024 ); - sp_color_slider_set_map( SP_COLOR_SLIDER(_fooSlider[i]), _fooMap[i] ); + cmsDoTransform( trans, scratch, _compUI[i]._map, 1024 ); + sp_color_slider_set_map( SP_COLOR_SLIDER(_compUI[i]._slider), _compUI[i]._map ); } } } @@ -992,8 +1040,8 @@ void ColorICCSelectorImpl::_adjustmentChanged( GtkAdjustment *adjustment, SPColo #endif // DEBUG_LCMS } else { #if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) - for ( guint i = 0; i < iccSelector->_impl->_fooCount; i++ ) { - if ( iccSelector->_impl->_fooAdj[i] == adjustment ) { + for ( size_t i = 0; i < iccSelector->_impl->_compUI.size(); i++ ) { + if ( iccSelector->_impl->_compUI[i]._adj == adjustment ) { match = i; break; } @@ -1007,7 +1055,7 @@ void ColorICCSelectorImpl::_adjustmentChanged( GtkAdjustment *adjustment, SPColo cmsUInt16Number tmp[4]; for ( guint i = 0; i < 4; i++ ) { - tmp[i] = ColorScales::getScaled( iccSelector->_impl->_fooAdj[i] ) * 0x0ffff; + tmp[i] = ColorScales::getScaled( iccSelector->_impl->_compUI[i]._adj ) * 0x0ffff; } guchar post[4] = {0,0,0,0}; @@ -1033,7 +1081,7 @@ void ColorICCSelectorImpl::_adjustmentChanged( GtkAdjustment *adjustment, SPColo newColor = other; newColor.icc->colors.clear(); for ( guint i = 0; i < iccSelector->_impl->_profChannelCount; i++ ) { - gdouble val = ColorScales::getScaled( iccSelector->_impl->_fooAdj[i] ); + gdouble val = ColorScales::getScaled( iccSelector->_impl->_compUI[i]._adj ); if ( i < iccSelector->_impl->_fooScales.size() ) { val *= iccSelector->_impl->_fooScales[i]; if ( iccSelector->_impl->_fooScales[i] == 256 ) { -- cgit v1.2.3 From 51d3a81afab97d564174dfc816b5feacc564e965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20dos=20Santos=20Oliveira?= Date: Fri, 7 Jun 2013 13:44:44 -0300 Subject: Refactor --export-pdf-version detection. If the user try to export the pdf and ps versions at one run, the sp_export_pdf detection would fail. A better approach (this commit) is to check the mime argument. (bzr r12359) --- src/main.cpp | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 28ec719f3..19ea3f181 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1657,31 +1657,33 @@ static int do_export_ps_pdf(SPDocument* doc, gchar const* uri, char const* mime) (*i)->set_param_float("bleed", margin); // handle --export-pdf-version - bool set_export_pdf_version_fail=true; - const gchar *pdfver_param_name="PDFversion"; - if(sp_export_pdf_version) { - // combine "PDF " and the given command line - std::string version_gui_string=std::string("PDF ")+sp_export_pdf_version; - try{ - // first, check if the given pdf version is selectable in the ComboBox - if((*i)->get_param_enum_contains("PDFversion", version_gui_string.c_str())) { - (*i)->set_param_enum(pdfver_param_name, version_gui_string.c_str()); - set_export_pdf_version_fail=false; - } else { - g_warning("Desired PDF export version \"%s\" not supported! Hint: input one of the versions found in the pdf export dialog e.g. \"1.4\".", - sp_export_pdf_version); + if (g_strcmp0(mime, "application/pdf") == 0) { + bool set_export_pdf_version_fail=true; + const gchar *pdfver_param_name="PDFversion"; + if(sp_export_pdf_version) { + // combine "PDF " and the given command line + std::string version_gui_string=std::string("PDF ")+sp_export_pdf_version; + try{ + // first, check if the given pdf version is selectable in the ComboBox + if((*i)->get_param_enum_contains("PDFversion", version_gui_string.c_str())) { + (*i)->set_param_enum(pdfver_param_name, version_gui_string.c_str()); + set_export_pdf_version_fail=false; + } else { + g_warning("Desired PDF export version \"%s\" not supported! Hint: input one of the versions found in the pdf export dialog e.g. \"1.4\".", + sp_export_pdf_version); + } + } catch (...) { + // can be thrown along the way: + // throw Extension::param_not_exist(); + // throw Extension::param_not_enum_param(); + g_warning("Parameter or Enum \"%s\" might not exist",pdfver_param_name); } - } catch (...) { - // can be thrown along the way: - // throw Extension::param_not_exist(); - // throw Extension::param_not_enum_param(); - g_warning("Parameter or Enum \"%s\" might not exist",pdfver_param_name); } - } - // set default pdf export version to 1.4, also if something went wrong - if(sp_export_pdf && set_export_pdf_version_fail) { - (*i)->set_param_enum(pdfver_param_name, "PDF 1.4"); + // set default pdf export version to 1.4, also if something went wrong + if(set_export_pdf_version_fail) { + (*i)->set_param_enum(pdfver_param_name, "PDF 1.4"); + } } //check if specified directory exists -- cgit v1.2.3 From eb4ab15680b39638f368b681ffe8bee51291d9a3 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sun, 9 Jun 2013 02:17:19 -0700 Subject: Replace multiple copies of GTK2/GTK3 #ifdef code with single helper function. (bzr r12360) --- src/widgets/sp-color-icc-selector.cpp | 130 ++++++++++++++-------------------- 1 file changed, 52 insertions(+), 78 deletions(-) (limited to 'src') diff --git a/src/widgets/sp-color-icc-selector.cpp b/src/widgets/sp-color-icc-selector.cpp index 394b5cb28..e999753d4 100644 --- a/src/widgets/sp-color-icc-selector.cpp +++ b/src/widgets/sp-color-icc-selector.cpp @@ -171,6 +171,50 @@ std::set knownColorspaces; #endif + +/** + * Simple helper to allow bitwise or on GtkAttachOptions. + */ +GtkAttachOptions operator|(GtkAttachOptions lhs, GtkAttachOptions rhs) +{ + return static_cast(static_cast(lhs) | static_cast(rhs)); +} + +/** + * Helper function to handle GTK2/GTK3 attachment #ifdef code. + */ +void attachToGridOrTable(GtkWidget *parent, + GtkWidget *child, + guint left, + guint top, + guint width, + guint height, + bool hexpand = false, + bool centered = false, + guint xpadding = XPAD, + guint ypadding = YPAD) +{ +#if GTK_CHECK_VERSION(3,0,0) + gtk_widget_set_margin_left( child, xpadding ); + gtk_widget_set_margin_right( child, xpadding ); + gtk_widget_set_margin_top( child, ypadding ); + gtk_widget_set_margin_bottom( child, ypadding ); + if (hexpand) { + gtk_widget_set_hexpand(child, TRUE); + } + if (centered) { + gtk_widget_set_halign( child, GTK_ALIGN_CENTER ); + gtk_widget_set_valign( child, GTK_ALIGN_CENTER ); + } + gtk_grid_attach( GTK_GRID(parent), child, left, top, width, height ); +#else + GtkAttachOptions xoptions = centered ? static_cast(0) : hexpand ? (GTK_EXPAND | GTK_FILL) : GTK_FILL; + GtkAttachOptions yoptions = centered ? static_cast(0) : GTK_FILL; + + gtk_table_attach( GTK_TABLE(parent), child, left, left + width, top, top + height, xoptions, yoptions, xpadding, ypadding ); +#endif +} + } // namespace GType sp_color_icc_selector_get_type(void) @@ -405,15 +449,7 @@ void ColorICCSelector::init() //gtk_misc_set_alignment( GTK_MISC (_impl->_fixupBtn), 1.0, 0.5 ); gtk_widget_show( _impl->_fixupBtn ); -#if GTK_CHECK_VERSION(3,0,0) - gtk_widget_set_margin_left(_impl->_fixupBtn, XPAD); - gtk_widget_set_margin_right(_impl->_fixupBtn, XPAD); - gtk_widget_set_margin_top(_impl->_fixupBtn, YPAD); - gtk_widget_set_margin_bottom(_impl->_fixupBtn, YPAD); - gtk_grid_attach(GTK_GRID(t), _impl->_fixupBtn, 0, row, 1, 1); -#else - gtk_table_attach( GTK_TABLE (t), _impl->_fixupBtn, 0, 1, row, row + 1, GTK_FILL, GTK_FILL, XPAD, YPAD ); -#endif + attachToGridOrTable(t, _impl->_fixupBtn, 0, row, 1, 1); // Combobox and store with 2 columns : label (0) and full name (1) GtkListStore *store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING); @@ -430,15 +466,7 @@ void ColorICCSelector::init() gtk_widget_show( _impl->_profileSel ); gtk_combo_box_set_active( GTK_COMBO_BOX(_impl->_profileSel), 0 ); -#if GTK_CHECK_VERSION(3,0,0) - gtk_widget_set_margin_left(_impl->_profileSel, XPAD); - gtk_widget_set_margin_right(_impl->_profileSel, XPAD); - gtk_widget_set_margin_top(_impl->_profileSel, YPAD); - gtk_widget_set_margin_bottom(_impl->_profileSel, YPAD); - gtk_grid_attach(GTK_GRID(t), _impl->_profileSel, 1, row, 1, 1); -#else - gtk_table_attach( GTK_TABLE(t), _impl->_profileSel, 1, 2, row, row + 1, GTK_FILL, GTK_FILL, XPAD, YPAD ); -#endif + attachToGridOrTable(t, _impl->_profileSel, 1, row, 1, 1); #if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) _impl->_profChangedID = g_signal_connect( G_OBJECT(_impl->_profileSel), "changed", G_CALLBACK(ColorICCSelectorImpl::_profileSelected), (gpointer)_impl ); @@ -467,15 +495,7 @@ void ColorICCSelector::init() gtk_misc_set_alignment( GTK_MISC (_impl->_compUI[i]._label), 1.0, 0.5 ); gtk_widget_show( _impl->_compUI[i]._label ); -#if GTK_CHECK_VERSION(3,0,0) - gtk_widget_set_margin_left(_impl->_compUI[i]._label, XPAD); - gtk_widget_set_margin_right(_impl->_compUI[i]._label, XPAD); - gtk_widget_set_margin_top(_impl->_compUI[i]._label, YPAD); - gtk_widget_set_margin_bottom(_impl->_compUI[i]._label, YPAD); - gtk_grid_attach(GTK_GRID(t), _impl->_compUI[i]._label, 0, row, 1, 1); -#else - gtk_table_attach( GTK_TABLE (t), _impl->_compUI[i]._label, 0, 1, row, row + 1, GTK_FILL, GTK_FILL, XPAD, YPAD ); -#endif + attachToGridOrTable(t, _impl->_compUI[i]._label, 0, row, 1, 1); // Adjustment guint scaleValue = (i < _impl->_fooScales.size()) ? _impl->_fooScales[i] : 1; @@ -493,16 +513,7 @@ void ColorICCSelector::init() #endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) gtk_widget_show( _impl->_compUI[i]._slider ); -#if GTK_CHECK_VERSION(3,0,0) - gtk_widget_set_margin_left(_impl->_compUI[i]._slider, XPAD); - gtk_widget_set_margin_right(_impl->_compUI[i]._slider, XPAD); - gtk_widget_set_margin_top(_impl->_compUI[i]._slider, YPAD); - gtk_widget_set_margin_bottom(_impl->_compUI[i]._slider, YPAD); - gtk_widget_set_hexpand(_impl->_compUI[i]._slider, TRUE); - gtk_grid_attach(GTK_GRID(t), _impl->_compUI[i]._slider, 1, row, 1, 1); -#else - gtk_table_attach( GTK_TABLE (t), _impl->_compUI[i]._slider, 1, 2, row, row + 1, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), GTK_FILL, XPAD, YPAD ); -#endif + attachToGridOrTable(t, _impl->_compUI[i]._slider, 1, row, 1, 1, true); _impl->_compUI[i]._btn = gtk_spin_button_new( _impl->_compUI[i]._adj, step, digits ); #if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) @@ -514,17 +525,7 @@ void ColorICCSelector::init() gtk_label_set_mnemonic_widget( GTK_LABEL(_impl->_compUI[i]._label), _impl->_compUI[i]._btn ); gtk_widget_show( _impl->_compUI[i]._btn ); -#if GTK_CHECK_VERSION(3,0,0) - gtk_widget_set_margin_left(_impl->_compUI[i]._btn, XPAD); - gtk_widget_set_margin_right(_impl->_compUI[i]._btn, XPAD); - gtk_widget_set_margin_top(_impl->_compUI[i]._btn, YPAD); - gtk_widget_set_margin_bottom(_impl->_compUI[i]._btn, YPAD); - gtk_widget_set_halign(_impl->_compUI[i]._btn, GTK_ALIGN_CENTER); - gtk_widget_set_valign(_impl->_compUI[i]._btn, GTK_ALIGN_CENTER); - gtk_grid_attach(GTK_GRID(t), _impl->_compUI[i]._btn, 2, row, 1, 1); -#else - gtk_table_attach( GTK_TABLE (t), _impl->_compUI[i]._btn, 2, 3, row, row + 1, (GtkAttachOptions)0, (GtkAttachOptions)0, XPAD, YPAD ); -#endif + attachToGridOrTable(t, _impl->_compUI[i]._btn, 2, row, 1, 1, false, true); _impl->_compUI[i]._map = g_new( guchar, 4 * 1024 ); memset( _impl->_compUI[i]._map, 0x0ff, 1024 * 4 ); @@ -545,15 +546,7 @@ void ColorICCSelector::init() gtk_misc_set_alignment(GTK_MISC(_impl->_label), 1.0, 0.5); gtk_widget_show(_impl->_label); -#if GTK_CHECK_VERSION(3,0,0) - gtk_widget_set_margin_left(_impl->_label, XPAD); - gtk_widget_set_margin_right(_impl->_label, XPAD); - gtk_widget_set_margin_top(_impl->_label, YPAD); - gtk_widget_set_margin_bottom(_impl->_label, YPAD); - gtk_grid_attach(GTK_GRID(t), _impl->_label, 0, row, 1, 1); -#else - gtk_table_attach(GTK_TABLE (t), _impl->_label, 0, 1, row, row + 1, GTK_FILL, GTK_FILL, XPAD, YPAD); -#endif + attachToGridOrTable(t, _impl->_label, 0, row, 1, 1); // Adjustment _impl->_adj = GTK_ADJUSTMENT(gtk_adjustment_new(0.0, 0.0, 255.0, 1.0, 10.0, 10.0)); @@ -563,16 +556,7 @@ void ColorICCSelector::init() gtk_widget_set_tooltip_text(_impl->_slider, _("Alpha (opacity)")); gtk_widget_show(_impl->_slider); -#if GTK_CHECK_VERSION(3,0,0) - gtk_widget_set_margin_left(_impl->_slider, XPAD); - gtk_widget_set_margin_right(_impl->_slider, XPAD); - gtk_widget_set_margin_top(_impl->_slider, YPAD); - gtk_widget_set_margin_bottom(_impl->_slider, YPAD); - gtk_widget_set_hexpand(_impl->_slider, TRUE); - gtk_grid_attach(GTK_GRID(t), _impl->_slider, 1, row, 1, 1); -#else - gtk_table_attach (GTK_TABLE (t), _impl->_slider, 1, 2, row, row + 1, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), GTK_FILL, XPAD, YPAD); -#endif + attachToGridOrTable(t, _impl->_slider, 1, row, 1, 1, true); sp_color_slider_set_colors( SP_COLOR_SLIDER( _impl->_slider ), SP_RGBA32_F_COMPOSE( 1.0, 1.0, 1.0, 0.0 ), @@ -587,17 +571,7 @@ void ColorICCSelector::init() gtk_label_set_mnemonic_widget(GTK_LABEL(_impl->_label), _impl->_sbtn); gtk_widget_show(_impl->_sbtn); -#if GTK_CHECK_VERSION(3,0,0) - gtk_widget_set_margin_left(_impl->_sbtn, XPAD); - gtk_widget_set_margin_right(_impl->_sbtn, XPAD); - gtk_widget_set_margin_top(_impl->_sbtn, YPAD); - gtk_widget_set_margin_bottom(_impl->_sbtn, YPAD); - gtk_widget_set_halign(_impl->_sbtn, GTK_ALIGN_CENTER); - gtk_widget_set_valign(_impl->_sbtn, GTK_ALIGN_CENTER); - gtk_grid_attach(GTK_GRID(t), _impl->_sbtn, 2, row, 1, 1); -#else - gtk_table_attach(GTK_TABLE (t), _impl->_sbtn, 2, 3, row, row + 1, (GtkAttachOptions)0, (GtkAttachOptions)0, XPAD, YPAD); -#endif + attachToGridOrTable(t, _impl->_sbtn, 2, row, 1, 1, false, true); // Signals g_signal_connect(G_OBJECT(_impl->_adj), "value_changed", G_CALLBACK(ColorICCSelectorImpl::_adjustmentChanged), _csel); -- cgit v1.2.3 From 7fade807fba73090abe970b940f13bee962133db Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sun, 9 Jun 2013 12:26:39 -0700 Subject: Remove use of separate array for scale values. (bzr r12361) --- src/colorspace.h | 1 + src/widgets/sp-color-icc-selector.cpp | 81 ++++++++++++++++++++--------------- 2 files changed, 48 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/colorspace.h b/src/colorspace.h index 58d12b4c8..9b7af55e5 100644 --- a/src/colorspace.h +++ b/src/colorspace.h @@ -35,6 +35,7 @@ namespace colorspace class Component { public: + Component(); Component(std::string const &name, std::string const &tip, guint scale); std::string name; diff --git a/src/widgets/sp-color-icc-selector.cpp b/src/widgets/sp-color-icc-selector.cpp index e999753d4..00b00ce38 100644 --- a/src/widgets/sp-color-icc-selector.cpp +++ b/src/widgets/sp-color-icc-selector.cpp @@ -83,6 +83,7 @@ class ComponentUI { public: ComponentUI() : + _component(), _adj(0), _slider(0), _btn(0), @@ -91,6 +92,17 @@ public: { } + ComponentUI(colorspace::Component const &component) : + _component(component), + _adj(0), + _slider(0), + _btn(0), + _label(0), + _map(0) + { + } + + colorspace::Component _component; GtkAdjustment *_adj; // Component adjustment GtkWidget *_slider; GtkWidget *_btn; // spinbutton @@ -134,8 +146,6 @@ public: GtkWidget* _fixupBtn; GtkWidget* _profileSel; - std::vector _fooScales; - std::vector _compUI; GtkAdjustment* _adj; // Channel adjustment @@ -304,6 +314,13 @@ static cmsUInt16Number* getScratch() { return scritch; } +colorspace::Component::Component() : + name(), + tip(), + scale(1) +{ +} + colorspace::Component::Component(std::string const &name, std::string const &tip, guint scale) : name(name), tip(tip), @@ -388,7 +405,6 @@ ColorICCSelectorImpl::ColorICCSelectorImpl(ColorICCSelector *owner) : _fixupNeeded(0), _fixupBtn(0), _profileSel(0), - _fooScales(), _compUI(), _adj(0), _slider(0), @@ -428,14 +444,6 @@ void ColorICCSelector::init() gtk_widget_show (t); gtk_box_pack_start (GTK_BOX (_csel), t, TRUE, TRUE, 4); -#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) - //guint partCount = _cmsChannelsOf( icSigRgbData ); - std::vector things = colorspace::getColorSpaceInfo( cmsSigRgbData ); - _impl->_fooScales.clear(); - for (std::vector::iterator it = things.begin(); it != things.end(); ++it) { - _impl->_fooScales.push_back(it->scale); - } -#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) _impl->_compUI.clear(); // Create components @@ -479,18 +487,24 @@ void ColorICCSelector::init() // populate the data for colorspaces and channels: #if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) - colorspace::getColorSpaceInfo(cmsSigCmykData); -#endif + std::vector things = colorspace::getColorSpaceInfo( cmsSigRgbData ); +#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) for ( size_t i = 0; i < maxColorspaceComponentCount; i++ ) { - _impl->_compUI.push_back(ComponentUI()); - - // Label #if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) + if (i < things.size()) { + _impl->_compUI.push_back(ComponentUI(things[i])); + } else { + _impl->_compUI.push_back(ComponentUI()); + } + std::string labelStr = (i < things.size()) ? things[i].name.c_str() : ""; #else + _impl->_compUI.push_back(ComponentUI()); + std::string labelStr = "."; -#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) +#endif + _impl->_compUI[i]._label = gtk_label_new_with_mnemonic( labelStr.c_str() ); gtk_misc_set_alignment( GTK_MISC (_impl->_compUI[i]._label), 1.0, 0.5 ); gtk_widget_show( _impl->_compUI[i]._label ); @@ -498,7 +512,7 @@ void ColorICCSelector::init() attachToGridOrTable(t, _impl->_compUI[i]._label, 0, row, 1, 1); // Adjustment - guint scaleValue = (i < _impl->_fooScales.size()) ? _impl->_fooScales[i] : 1; + guint scaleValue = _impl->_compUI[i]._component.scale; gdouble step = static_cast(scaleValue) / 100.0; gdouble page = static_cast(scaleValue) / 10.0; gint digits = (step > 0.9) ? 0 : 2; @@ -808,10 +822,10 @@ void ColorICCSelector::_colorChanged() for ( guint i = 0; i < _impl->_profChannelCount; i++ ) { gdouble val = 0.0; if ( _color.icc->colors.size() > i ) { - if ( _impl->_fooScales[i] == 256 ) { - val = (_color.icc->colors[i] + 128.0) / static_cast(_impl->_fooScales[i]); + if ( _impl->_compUI[i]._component.scale == 256 ) { + val = (_color.icc->colors[i] + 128.0) / static_cast(_impl->_compUI[i]._component.scale); } else { - val = _color.icc->colors[i] / static_cast(_impl->_fooScales[i]); + val = _color.icc->colors[i] / static_cast(_impl->_compUI[i]._component.scale); } } tmp[i] = val * 0x0ffff; @@ -877,12 +891,13 @@ void ColorICCSelectorImpl::_setProfile( SVGICCColor* profile ) _profChannelCount = cmsChannelsOf( asICColorSpaceSig(_prof->getColorSpace()) ); #endif - std::vector things = colorspace::getColorSpaceInfo(asICColorSpaceSig(_prof->getColorSpace())); - _fooScales.clear(); - for (std::vector::iterator it = things.begin(); it != things.end(); ++it) { - _fooScales.push_back(it->scale); - } if ( profChanged ) { + std::vector things = colorspace::getColorSpaceInfo(asICColorSpaceSig(_prof->getColorSpace())); + for (size_t i = 0; (i < things.size()) && (i < _profChannelCount); ++i) + { + _compUI[i]._component = things[i]; + } + for ( guint i = 0; i < _profChannelCount; i++ ) { gtk_label_set_text_with_mnemonic( GTK_LABEL(_compUI[i]._label), (i < things.size()) ? things[i].name.c_str() : ""); @@ -933,10 +948,10 @@ void ColorICCSelectorImpl::_updateSliders( gint ignore ) for ( guint i = 0; i < _profChannelCount; i++ ) { gdouble val = 0.0; if ( _owner->_color.icc->colors.size() > i ) { - if ( _fooScales[i] == 256 ) { - val = (_owner->_color.icc->colors[i] + 128.0) / static_cast(_fooScales[i]); + if ( _compUI[i]._component.scale == 256 ) { + val = (_owner->_color.icc->colors[i] + 128.0) / static_cast(_compUI[i]._component.scale); } else { - val = _owner->_color.icc->colors[i] / static_cast(_fooScales[i]); + val = _owner->_color.icc->colors[i] / static_cast(_compUI[i]._component.scale); } } gtk_adjustment_set_value( _compUI[i]._adj, val ); @@ -1056,11 +1071,9 @@ void ColorICCSelectorImpl::_adjustmentChanged( GtkAdjustment *adjustment, SPColo newColor.icc->colors.clear(); for ( guint i = 0; i < iccSelector->_impl->_profChannelCount; i++ ) { gdouble val = ColorScales::getScaled( iccSelector->_impl->_compUI[i]._adj ); - if ( i < iccSelector->_impl->_fooScales.size() ) { - val *= iccSelector->_impl->_fooScales[i]; - if ( iccSelector->_impl->_fooScales[i] == 256 ) { - val -= 128; - } + val *= iccSelector->_impl->_compUI[i]._component.scale; + if ( iccSelector->_impl->_compUI[i]._component.scale == 256 ) { + val -= 128; } newColor.icc->colors.push_back( val ); } -- cgit v1.2.3 From f7c8895ed8dafb5ce4785b8eb825dba39d7e19c5 Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Mon, 10 Jun 2013 18:31:48 -0400 Subject: use visual bbox in calculation of filter area (Bug 1188336) Fixed bugs: - https://launchpad.net/bugs/1188336 (bzr r12362) --- src/display/nr-filter.cpp | 6 ++++-- src/sp-item.cpp | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/display/nr-filter.cpp b/src/display/nr-filter.cpp index eeba94d7c..f0965c460 100644 --- a/src/display/nr-filter.cpp +++ b/src/display/nr-filter.cpp @@ -114,7 +114,8 @@ int Filter::render(Inkscape::DrawingItem const *item, DrawingContext &graphic, D Geom::Affine trans = item->ctm(); - Geom::OptRect filter_area = filter_effect_area(item->itemBounds()); +// Geom::OptRect filter_area = filter_effect_area(item->itemBounds()); // disabled, already done in visualBounds + Geom::OptRect filter_area = item->itemBounds(); // see LP Bug 1188336 if (!filter_area) return 1; FilterUnits units(_filter_units, _primitive_units); @@ -221,7 +222,8 @@ void Filter::area_enlarge(Geom::IntRect &bbox, Inkscape::DrawingItem const *item Geom::OptIntRect Filter::compute_drawbox(Inkscape::DrawingItem const *item, Geom::OptRect const &item_bbox) { - Geom::OptRect enlarged = filter_effect_area(item_bbox); +// Geom::OptRect enlarged = filter_effect_area(item_bbox); // disabled, already done in visualBounds + Geom::OptRect enlarged = item_bbox; // see LP Bug 1188336 if (enlarged) { *enlarged *= item->ctm(); diff --git a/src/sp-item.cpp b/src/sp-item.cpp index 19d71ed44..a4070c9b3 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -646,7 +646,7 @@ sp_item_update(SPObject *object, SPCtx *ctx, guint flags) /* Update bounding box data used by filters */ if (item->style->filter.set && item->display) { - Geom::OptRect item_bbox = item->geometricBounds(); + Geom::OptRect item_bbox = item->visualBounds(); SPItemView *itemview = item->display; do { @@ -1089,6 +1089,9 @@ Inkscape::DrawingItem *SPItem::invoke_show(Inkscape::Drawing &drawing, unsigned sp_mask_set_bbox(SP_MASK(mask), mask_key, item_bbox); mask->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } + if (style->filter.set && display) { + item_bbox = visualBounds(); + } ai->setData(this); ai->setItemBounds(item_bbox); } -- cgit v1.2.3 From 00904e48823b29873f52854d95b5c2f83b15108b Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Tue, 11 Jun 2013 11:49:46 -0400 Subject: Change marker layout in stroke-widget so they are all on one line. (bzr r12363) --- src/ui/dialog/symbols.cpp | 60 ++++++++++++++++++++++++++++++++++ src/widgets/stroke-marker-selector.cpp | 10 ------ src/widgets/stroke-marker-selector.h | 2 -- src/widgets/stroke-style.cpp | 41 +++++------------------ 4 files changed, 68 insertions(+), 45 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index 3468d984d..52f4ea6e2 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -44,6 +44,7 @@ #include "ui/cache/svg_preview_cache.h" #include "ui/clipboard.h" +#include "ui/icon-names.h" #include "symbols.h" @@ -55,6 +56,7 @@ #include "sp-use.h" #include "sp-defs.h" #include "sp-symbol.h" +#include "widgets/icon.h" #ifdef WITH_LIBVISIO #include @@ -180,6 +182,64 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) : table->attach(*Gtk::manage(scroller),0,2,row,row+1,Gtk::EXPAND|Gtk::FILL,Gtk::EXPAND|Gtk::FILL); #endif + ++row; + + /******************** Tools *******************************/ + Gtk::Button* button; + Gtk::HBox* tools = new Gtk::HBox(); + + //tools->set_layout( Gtk::BUTTONBOX_END ); +#if WITH_GTKMM_3_0 + scroller->set_hexpand(); + table->attach(*Gtk::manage(tools),0,row,2,1); +#else + table->attach(*Gtk::manage(tools),0,2,row,row+1,Gtk::EXPAND|Gtk::FILL,Gtk::FILL); +#endif + + button = Gtk::manage(new Gtk::Button()); + button->add(*Gtk::manage(Glib::wrap( + sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("symbol-add")))) ); + button->set_tooltip_text(_("Add Symbol from the current document.")); + button->set_relief( Gtk::RELIEF_NONE ); + tools->pack_start(* Gtk::manage(button), Gtk::PACK_SHRINK); + + button = Gtk::manage(new Gtk::Button()); + button->add(*Gtk::manage(Glib::wrap( + sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("symbol-remove")))) ); + button->set_tooltip_text(_("Remove Symbol from the current document.")); + button->set_relief( Gtk::RELIEF_NONE ); + tools->pack_start(* Gtk::manage(button), Gtk::PACK_SHRINK); + + Gtk::Label* spacer = Gtk::manage(new Gtk::Label("")); + tools->pack_start(* Gtk::manage(spacer)); //, Gtk::EXPAND|Gtk::FILL); + + button = Gtk::manage(new Gtk::Button()); + button->add(*Gtk::manage(Glib::wrap( + sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("zoom-in")))) ); + button->set_tooltip_text(_("Make Icons bigger by zooming in.")); + button->set_relief( Gtk::RELIEF_NONE ); + tools->pack_start(* Gtk::manage(button), Gtk::PACK_SHRINK); + + Gtk::ToggleButton* toggle = Gtk::manage(new Gtk::ToggleButton()); + toggle->add(*Gtk::manage(Glib::wrap( + sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("zoom-fit-page")))) ); + toggle->set_tooltip_text(_("Toggle 'fit' symbols in icon space.")); + toggle->set_relief( Gtk::RELIEF_NONE ); + tools->pack_start(* Gtk::manage(toggle), Gtk::PACK_SHRINK); + + button = Gtk::manage(new Gtk::Button()); + button->add(*Gtk::manage(Glib::wrap( + sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("zoom-out")))) ); + button->set_tooltip_text(_("Make Icons smaller by zooming out.")); + button->set_relief( Gtk::RELIEF_NONE ); + tools->pack_start(* Gtk::manage(button), Gtk::PACK_SHRINK); + + + + + + + ++row; /******************** Preview Scale ***********************/ diff --git a/src/widgets/stroke-marker-selector.cpp b/src/widgets/stroke-marker-selector.cpp index 62fa47603..5ac6d5f34 100644 --- a/src/widgets/stroke-marker-selector.cpp +++ b/src/widgets/stroke-marker-selector.cpp @@ -56,10 +56,6 @@ MarkerComboBox::MarkerComboBox(gchar const *id, int l) : marker_store = Gtk::ListStore::create(marker_columns); set_model(marker_store); pack_start(image_renderer, false); - pack_end(label_renderer, true); - label_renderer.set_padding(2, 0); - image_renderer.set_padding(2, 0); - set_cell_data_func(label_renderer, sigc::mem_fun(*this, &MarkerComboBox::prepareLabelRenderer)); set_cell_data_func(image_renderer, sigc::mem_fun(*this, &MarkerComboBox::prepareImageRenderer)); gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(gobj()), MarkerComboBox::separator_cb, NULL, NULL); @@ -559,12 +555,6 @@ MarkerComboBox::create_marker_image(unsigned psize, gchar const *mname, return pb; } -void MarkerComboBox::prepareLabelRenderer( Gtk::TreeModel::const_iterator const &row ) { - Glib::ustring name=(*row)[marker_columns.label]; - label_renderer.property_markup() = name.c_str(); - label_renderer.property_scale() = 0.8; -} - void MarkerComboBox::prepareImageRenderer( Gtk::TreeModel::const_iterator const &row ) { Gtk::Image *image = (*row)[marker_columns.image]; diff --git a/src/widgets/stroke-marker-selector.h b/src/widgets/stroke-marker-selector.h index d9732038e..27ac76d6f 100644 --- a/src/widgets/stroke-marker-selector.h +++ b/src/widgets/stroke-marker-selector.h @@ -68,7 +68,6 @@ private: SPDocument *doc; SPDocument *sandbox; Gtk::Image *empty_image; - Gtk::CellRendererText label_renderer; Gtk::CellRendererPixbuf image_renderer; class MarkerColumns : public Gtk::TreeModel::ColumnRecord { @@ -99,7 +98,6 @@ private: /* * Callbacks for drawing the combo box */ - void prepareLabelRenderer( Gtk::TreeModel::const_iterator const &row ); void prepareImageRenderer( Gtk::TreeModel::const_iterator const &row ); static gboolean separator_cb (GtkTreeModel *model, GtkTreeIter *iter, gpointer data); diff --git a/src/widgets/stroke-style.cpp b/src/widgets/stroke-style.cpp index c6934f0a6..0a5b3781b 100644 --- a/src/widgets/stroke-style.cpp +++ b/src/widgets/stroke-style.cpp @@ -342,62 +342,37 @@ StrokeStyle::StrokeStyle() : // TRANSLATORS: Path markers are an SVG feature that allows you to attach arbitrary shapes // (arrowheads, bullets, faces, whatever) to the start, end, or middle nodes of a path. + spw_label(table, _("Markers:"), 0, i, NULL); + + hb = spw_hbox(table, 1, 1, i); + i++; + startMarkerCombo = manage(new MarkerComboBox("marker-start", SP_MARKER_LOC_START)); - spw_label(table, _("_Start Markers:"), 0, i, startMarkerCombo); startMarkerCombo->set_tooltip_text(_("Start Markers are drawn on the first node of a path or shape")); startMarkerConn = startMarkerCombo->signal_changed().connect( sigc::bind( sigc::ptr_fun(&StrokeStyle::markerSelectCB), startMarkerCombo, this, SP_MARKER_LOC_START)); startMarkerCombo->show(); -#if WITH_GTKMM_3_0 - startMarkerCombo->set_hexpand(); - startMarkerCombo->set_halign(Gtk::ALIGN_FILL); - startMarkerCombo->set_valign(Gtk::ALIGN_CENTER); - table->attach(*startMarkerCombo, 1, i, 3, 1); -#else - table->attach(*startMarkerCombo, 1, 4, i, i+1, (Gtk::EXPAND | Gtk::FILL), static_cast(0), 0, 0); -#endif - - i++; + hb->pack_start(*startMarkerCombo, true, true, 0); midMarkerCombo = manage(new MarkerComboBox("marker-mid", SP_MARKER_LOC_MID)); - spw_label(table, _("_Mid Markers:"), 0, i, midMarkerCombo); midMarkerCombo->set_tooltip_text(_("Mid Markers are drawn on every node of a path or shape except the first and last nodes")); midMarkerConn = midMarkerCombo->signal_changed().connect( sigc::bind( sigc::ptr_fun(&StrokeStyle::markerSelectCB), midMarkerCombo, this, SP_MARKER_LOC_MID)); midMarkerCombo->show(); -#if WITH_GTKMM_3_0 - midMarkerCombo->set_hexpand(); - midMarkerCombo->set_halign(Gtk::ALIGN_FILL); - midMarkerCombo->set_valign(Gtk::ALIGN_CENTER); - table->attach(*midMarkerCombo, 1, i, 3, 1); -#else - table->attach(*midMarkerCombo, 1, 4, i, i+1, (Gtk::EXPAND | Gtk::FILL), static_cast(0), 0, 0); -#endif - - i++; + hb->pack_start(*midMarkerCombo, true, true, 0); endMarkerCombo = manage(new MarkerComboBox("marker-end", SP_MARKER_LOC_END)); - spw_label(table, _("_End Markers:"), 0, i, endMarkerCombo); endMarkerCombo->set_tooltip_text(_("End Markers are drawn on the last node of a path or shape")); endMarkerConn = endMarkerCombo->signal_changed().connect( sigc::bind( sigc::ptr_fun(&StrokeStyle::markerSelectCB), endMarkerCombo, this, SP_MARKER_LOC_END)); endMarkerCombo->show(); -#if WITH_GTKMM_3_0 - endMarkerCombo->set_hexpand(); - endMarkerCombo->set_halign(Gtk::ALIGN_FILL); - endMarkerCombo->set_valign(Gtk::ALIGN_CENTER); - table->attach(*endMarkerCombo, 1, i, 3, 1); -#else - table->attach(*endMarkerCombo, 1, 4, i, i+1, (Gtk::EXPAND | Gtk::FILL), static_cast(0), 0, 0); -#endif - - i++; + hb->pack_start(*endMarkerCombo, true, true, 0); setDesktop(desktop); updateLine(); -- cgit v1.2.3 From 0dbd19748a058c88f9a693ed08ddabf223d0524d Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Tue, 11 Jun 2013 16:14:43 -0400 Subject: Fix new bug with No-Marker having no icon, use Stock GTK::Remove icon for No-Marker. (bzr r12364) --- src/widgets/stroke-marker-selector.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/widgets/stroke-marker-selector.cpp b/src/widgets/stroke-marker-selector.cpp index 5ac6d5f34..dd00ed703 100644 --- a/src/widgets/stroke-marker-selector.cpp +++ b/src/widgets/stroke-marker-selector.cpp @@ -38,6 +38,7 @@ #include "helper/stock-items.h" #include "gradient-vector.h" +#include #include #include "ui/widget/spinbutton.h" #include "stroke-style.h" @@ -151,7 +152,8 @@ MarkerComboBox::init_combo() Gtk::TreeModel::Row row = *(marker_store->append()); row[marker_columns.label] = _("No document selected"); row[marker_columns.marker] = g_strdup("None"); - row[marker_columns.image] = NULL; + Glib::RefPtr iconTheme = Gtk::IconTheme::get_default(); + row[marker_columns.image] = new Gtk::Image( iconTheme->load_icon("gtk-remove", 22) ); row[marker_columns.stock] = false; row[marker_columns.history] = false; row[marker_columns.separator] = false; @@ -386,7 +388,8 @@ void MarkerComboBox::add_markers (GSList *marker_list, SPDocument *source, gbool row[marker_columns.label] = _("None"); row[marker_columns.stock] = false; row[marker_columns.marker] = g_strdup("None"); - row[marker_columns.image] = NULL; + Glib::RefPtr iconTheme = Gtk::IconTheme::get_default(); + row[marker_columns.image] = new Gtk::Image( iconTheme->load_icon("gtk-remove", 22) ); row[marker_columns.history] = true; row[marker_columns.separator] = false; } -- cgit v1.2.3 From cd6b7f49054415a6ad7ad71f36e7987bd8af1657 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Tue, 11 Jun 2013 17:29:07 -0400 Subject: Fix bug where symbols weren't identified as such Fixed bugs: - https://launchpad.net/bugs/1179224 (bzr r12366) --- src/selection-describer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/selection-describer.cpp b/src/selection-describer.cpp index 968a8bd22..dd64e6232 100644 --- a/src/selection-describer.cpp +++ b/src/selection-describer.cpp @@ -38,8 +38,9 @@ #include "sp-spiral.h" static const gchar * -type2term(GType type) +type2term(SPItem *item) { + GType type = G_OBJECT_TYPE( item ); if (type == SP_TYPE_ANCHOR) //TRANSLATORS: "Link" means internet link (anchor) { return C_("Web", "Link"); } @@ -68,6 +69,8 @@ type2term(GType type) if (type == SP_TYPE_TEXT) { return C_("Object", "Text"); } if (type == SP_TYPE_USE) + if (SP_IS_SYMBOL(item->firstChild())) + { return C_("Object", "Symbol"); } // TRANSLATORS: "Clone" is a noun, type of object { return C_("Object", "Clone"); } if (type == SP_TYPE_ARC) @@ -85,7 +88,7 @@ static GSList *collect_terms (GSList *items) { GSList *r = NULL; for (GSList *i = items; i != NULL; i = i->next) { - const gchar *term = type2term (G_OBJECT_TYPE(i->data)); + const gchar *term = type2term ( SP_ITEM(i->data) ); if (term != NULL && g_slist_find (r, term) == NULL) r = g_slist_prepend (r, (void *) term); } -- cgit v1.2.3 From 2f7a1c5a360c192e60fa25adcb8b838fd33c4d40 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Tue, 11 Jun 2013 18:55:31 -0400 Subject: Change back to using NULL and fix windows theme error by checking (bzr r12367) --- src/widgets/stroke-marker-selector.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/widgets/stroke-marker-selector.cpp b/src/widgets/stroke-marker-selector.cpp index dd00ed703..82cd81e9f 100644 --- a/src/widgets/stroke-marker-selector.cpp +++ b/src/widgets/stroke-marker-selector.cpp @@ -60,7 +60,12 @@ MarkerComboBox::MarkerComboBox(gchar const *id, int l) : set_cell_data_func(image_renderer, sigc::mem_fun(*this, &MarkerComboBox::prepareImageRenderer)); gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(gobj()), MarkerComboBox::separator_cb, NULL, NULL); - empty_image = new Gtk::Image(); + Glib::RefPtr iconTheme = Gtk::IconTheme::get_default(); + if(iconTheme->has_icon("gtk-remove")) { + empty_image = new Gtk::Image( iconTheme->load_icon("gtk-remove", 22) ); + } else { + empty_image = new Gtk::Image(); + } sandbox = ink_markers_preview_doc (); desktop = inkscape_active_desktop(); @@ -152,8 +157,7 @@ MarkerComboBox::init_combo() Gtk::TreeModel::Row row = *(marker_store->append()); row[marker_columns.label] = _("No document selected"); row[marker_columns.marker] = g_strdup("None"); - Glib::RefPtr iconTheme = Gtk::IconTheme::get_default(); - row[marker_columns.image] = new Gtk::Image( iconTheme->load_icon("gtk-remove", 22) ); + row[marker_columns.image] = NULL; row[marker_columns.stock] = false; row[marker_columns.history] = false; row[marker_columns.separator] = false; @@ -388,8 +392,7 @@ void MarkerComboBox::add_markers (GSList *marker_list, SPDocument *source, gbool row[marker_columns.label] = _("None"); row[marker_columns.stock] = false; row[marker_columns.marker] = g_strdup("None"); - Glib::RefPtr iconTheme = Gtk::IconTheme::get_default(); - row[marker_columns.image] = new Gtk::Image( iconTheme->load_icon("gtk-remove", 22) ); + row[marker_columns.image] = NULL; row[marker_columns.history] = true; row[marker_columns.separator] = false; } -- cgit v1.2.3 From 295d11627ae7750369d72022e63c8d7ce761ef8a Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Tue, 11 Jun 2013 20:04:45 -0400 Subject: Use 'remove' instead of 'gtk-remove' for theme. Fixed bugs: - https://launchpad.net/bugs/1190072 (bzr r12369) --- src/widgets/stroke-marker-selector.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/widgets/stroke-marker-selector.cpp b/src/widgets/stroke-marker-selector.cpp index 82cd81e9f..8e252f5e1 100644 --- a/src/widgets/stroke-marker-selector.cpp +++ b/src/widgets/stroke-marker-selector.cpp @@ -61,8 +61,8 @@ MarkerComboBox::MarkerComboBox(gchar const *id, int l) : gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(gobj()), MarkerComboBox::separator_cb, NULL, NULL); Glib::RefPtr iconTheme = Gtk::IconTheme::get_default(); - if(iconTheme->has_icon("gtk-remove")) { - empty_image = new Gtk::Image( iconTheme->load_icon("gtk-remove", 22) ); + if(iconTheme->has_icon("remove")) { + empty_image = new Gtk::Image( iconTheme->load_icon("remove", 22) ); } else { empty_image = new Gtk::Image(); } -- cgit v1.2.3 From c34892c61ec3c5af7aae2cd3f5b64ddafd47e81c Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Tue, 11 Jun 2013 23:48:35 -0400 Subject: Fix Apache2 license conflict with GPL with re-license from SOIX upstream Fixed bugs: - https://launchpad.net/bugs/357043 (bzr r12370) --- src/trace/siox.cpp | 14 ++------------ src/trace/siox.h | 12 +----------- 2 files changed, 3 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/trace/siox.cpp b/src/trace/siox.cpp index 1a1426b83..8c9130412 100644 --- a/src/trace/siox.cpp +++ b/src/trace/siox.cpp @@ -2,18 +2,8 @@ Copyright 2005, 2006 by Gerald Friedland, Kristian Jantz and Lars Knipping Conversion to C++ for Inkscape by Bob Jamison - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + + Released under GNU GPL, read the file 'COPYING' for more information */ #include "siox.h" diff --git a/src/trace/siox.h b/src/trace/siox.h index 9a44ce1cf..fa18ac238 100644 --- a/src/trace/siox.h +++ b/src/trace/siox.h @@ -5,17 +5,7 @@ * * Conversion to C++ for Inkscape by Bob Jamison * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Released under GNU GPL, read the file 'COPYING' for more information */ /* -- cgit v1.2.3 From 384c21c3bccef3a2f8f50236f87b87df29aa9e95 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Wed, 12 Jun 2013 11:14:48 -0400 Subject: Use fixed inkscape icon for 'no-marker' instead of gtk theme icon (bzr r12371) --- src/widgets/icon.cpp | 7 +++++++ src/widgets/icon.h | 2 +- src/widgets/stroke-marker-selector.cpp | 8 ++------ 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp index d613ca55d..dda453bc4 100644 --- a/src/widgets/icon.cpp +++ b/src/widgets/icon.cpp @@ -867,6 +867,13 @@ GtkWidget *sp_icon_new( Inkscape::IconSize lsize, gchar const *name ) return IconImpl::newFull( lsize, name ); } +// PUBLIC CALL for when you REALLY need a pixbuf +GdkPixbuf *sp_pixbuf_new( Inkscape::IconSize lsize, gchar const *name ) +{ + int psize = IconImpl::getPhysSize(lsize); + return IconImpl::renderup(name, lsize, psize); +} + // PUBLIC CALL: Gtk::Widget *sp_icon_get_icon( Glib::ustring const &oid, Inkscape::IconSize size ) { diff --git a/src/widgets/icon.h b/src/widgets/icon.h index 87dd943c4..e1dae0d6a 100644 --- a/src/widgets/icon.h +++ b/src/widgets/icon.h @@ -53,7 +53,7 @@ struct SPIcon { GtkWidget *sp_icon_new( Inkscape::IconSize size, const gchar *name ); - +GdkPixbuf *sp_pixbuf_new( Inkscape::IconSize size, const gchar *name ); // Might return a wrapped SPIcon, or Gtk::Image Gtk::Widget *sp_icon_get_icon( const Glib::ustring &oid, Inkscape::IconSize size = Inkscape::ICON_SIZE_BUTTON ); diff --git a/src/widgets/stroke-marker-selector.cpp b/src/widgets/stroke-marker-selector.cpp index 8e252f5e1..2d1c932d3 100644 --- a/src/widgets/stroke-marker-selector.cpp +++ b/src/widgets/stroke-marker-selector.cpp @@ -60,12 +60,8 @@ MarkerComboBox::MarkerComboBox(gchar const *id, int l) : set_cell_data_func(image_renderer, sigc::mem_fun(*this, &MarkerComboBox::prepareImageRenderer)); gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(gobj()), MarkerComboBox::separator_cb, NULL, NULL); - Glib::RefPtr iconTheme = Gtk::IconTheme::get_default(); - if(iconTheme->has_icon("remove")) { - empty_image = new Gtk::Image( iconTheme->load_icon("remove", 22) ); - } else { - empty_image = new Gtk::Image(); - } + empty_image = new Gtk::Image( Glib::wrap( + sp_pixbuf_new( Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("no-marker") ) ) ); sandbox = ink_markers_preview_doc (); desktop = inkscape_active_desktop(); -- cgit v1.2.3 From 4905eea9e87b0ee6709dd838f1378409ea1250a3 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Thu, 13 Jun 2013 22:36:04 -0400 Subject: Do not allow markers for children of markers (prevent loop) Fixed bugs: - https://launchpad.net/bugs/261786 (bzr r12372) --- src/sp-shape.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp index be9f5388c..38ffbb20c 100644 --- a/src/sp-shape.cpp +++ b/src/sp-shape.cpp @@ -868,6 +868,13 @@ int SPShape::hasMarkers() const all three settings. This should be fixed later such that if 'marker' is specified, then all three should appear. */ + // Ignore markers for objects which are inside markers themselves. + for (SPObject *parent = this->parent; parent != NULL; parent = parent->parent) { + if(SP_IS_MARKER(parent)) { + return 0; + } + } + return ( this->_curve && (this->_marker[SP_MARKER_LOC] || -- cgit v1.2.3 From a1d971856661b0655ed798941195f100aadf3dc4 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Fri, 14 Jun 2013 06:39:11 -0400 Subject: Allow svg elements to be ungrouped Fixed bugs: - https://launchpad.net/bugs/166327 (bzr r12373) --- src/selection-chemistry.cpp | 6 ++++-- src/sp-item-group.cpp | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index cd0001175..0fea43e30 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -784,8 +784,10 @@ void sp_selection_ungroup(SPDesktop *desktop) continue; } - /* We do not allow ungrouping etc. (lauris) */ - if (strcmp(group->getRepr()->name(), "svg:g") && strcmp(group->getRepr()->name(), "svg:switch")) { + // This check reflects the g_return_if_fail in sp_item_group_ungroup and + // may be a redundent. It also allows ungrouping of 'a' tags and we dont + if (strcmp(group->getRepr()->name(), "svg:g") && strcmp(group->getRepr()->name(), "svg:switch") && + strcmp(group->getRepr()->name(), "svg:svg")) { // keep the non-group item in the new selection new_select = g_slist_append(new_select, group); continue; diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index 3ba1ecd5f..a2eda6625 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -324,7 +324,10 @@ sp_item_group_ungroup (SPGroup *group, GSList **children, bool do_done) SPItem *gitem = group; Inkscape::XML::Node *grepr = gitem->getRepr(); - g_return_if_fail (!strcmp (grepr->name(), "svg:g") || !strcmp (grepr->name(), "svg:a") || !strcmp (grepr->name(), "svg:switch")); + g_return_if_fail (!strcmp (grepr->name(), "svg:g") + || !strcmp (grepr->name(), "svg:a") + || !strcmp (grepr->name(), "svg:switch") + || !strcmp (grepr->name(), "svg:svg")); // this converts the gradient/pattern fill/stroke on the group, if any, to userSpaceOnUse gitem->adjust_paint_recursive (Geom::identity(), Geom::identity(), false); -- cgit v1.2.3 From c403397e07cf418588296f1f6fb479aca862c518 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Sat, 15 Jun 2013 09:29:48 -0400 Subject: Big change in symbols ui and selection chemistry. (bzr r12374) --- src/menus-skeleton.h | 4 - src/selection-chemistry.cpp | 10 +- src/sp-symbol.cpp | 7 +- src/ui/dialog/symbols.cpp | 281 +++++++++++++++++++++----------------------- src/ui/dialog/symbols.h | 17 ++- 5 files changed, 154 insertions(+), 165 deletions(-) (limited to 'src') diff --git a/src/menus-skeleton.h b/src/menus-skeleton.h index 694619089..77e781763 100644 --- a/src/menus-skeleton.h +++ b/src/menus-skeleton.h @@ -199,10 +199,6 @@ static char const menus_skeleton[] = " \n" " \n" " \n" -" \n" -" \n" -" \n" -" \n" " \n" " \n" " \n" diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 0fea43e30..56923859b 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -3032,19 +3032,17 @@ void sp_selection_unsymbol(SPDesktop *desktop) return; } - SPObject* use = selection->single(); + SPObject* symbol = selection->single(); // Make sure we have only one object in selection. // Require that we really have a that references a . - if( use == NULL || ( !SP_IS_USE( use ) && !SP_IS_SYMBOL( use->firstChild() ))) { + if( symbol == NULL || !SP_IS_SYMBOL( symbol )) { desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select only one symbol to convert to group.")); return; } doc->ensureUpToDate(); - SPObject* symbol = use->firstChild(); - Inkscape::XML::Node *group = xml_doc->createElement("svg:g"); group->setAttribute("style", symbol->getAttribute("style")); group->setAttribute("title", symbol->getAttribute("title")); @@ -3062,14 +3060,14 @@ void sp_selection_unsymbol(SPDesktop *desktop) child->deleteObject(true); } - SPObject* parent = use->parent; // So we insert next to (easier to find) + // So we insert inside the current layer + SPObject *parent = desktop->currentLayer(); // Need to delete ; all other elements that referenced should // auto-magically reference . symbol->deleteObject(true); group->setAttribute("id",id.c_str()); // After we delete symbol with same id. parent->getRepr()->appendChild(group); - //use->deleteObject(true); SPItem *group_item = static_cast(sp_desktop_document(desktop)->getObjectByRepr(group)); Inkscape::GC::release(group); diff --git a/src/sp-symbol.cpp b/src/sp-symbol.cpp index 989a5b7f3..a56de2e5a 100644 --- a/src/sp-symbol.cpp +++ b/src/sp-symbol.cpp @@ -371,6 +371,8 @@ static Geom::OptRect sp_symbol_bbox(SPItem const *item, Geom::Affine const &tran SPSymbol const *symbol = SP_SYMBOL(item); Geom::OptRect bbox; + // We don't need a bounding box for Symbols dialog when selecting + // symbols. They have no canvas location. But cloned symbols are. if (symbol->cloned) { // Cloned is actually renderable @@ -378,11 +380,6 @@ static Geom::OptRect sp_symbol_bbox(SPItem const *item, Geom::Affine const &tran Geom::Affine const a( symbol->c2p * transform ); bbox = ((SPItemClass *) (sp_symbol_parent_class))->bbox(item, a, type); } - } else { - // Need bounding box for Symbols dialog - - Geom::Affine const a; - bbox = ((SPItemClass *) (sp_symbol_parent_class))->bbox(item, a, type); } return bbox; } diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index 52f4ea6e2..cac01c657 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -48,6 +48,7 @@ #include "symbols.h" +#include "selection.h" #include "desktop.h" #include "desktop-handles.h" #include "document.h" @@ -64,6 +65,7 @@ #endif #include "verbs.h" +#include "helper/action.h" #include "xml/repr.h" namespace Inkscape { @@ -102,8 +104,6 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) : UI::Widget::Panel("", prefsPath, SP_VERB_DIALOG_SYMBOLS), store(Gtk::ListStore::create(*getColumns())), iconView(0), - previewScale(0), - previewSize(0), currentDesktop(0), deskTrack(), currentDocument(0), @@ -142,8 +142,8 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) : table->attach(*Gtk::manage(symbolSet),1,2,row,row+1,Gtk::FILL|Gtk::EXPAND,Gtk::SHRINK); #endif - sigc::connection connSet = - symbolSet->signal_changed().connect(sigc::mem_fun(*this, &SymbolsDialog::rebuild)); + sigc::connection connSet = symbolSet->signal_changed().connect( + sigc::mem_fun(*this, &SymbolsDialog::rebuild)); instanceConns.push_back(connSet); ++row; @@ -154,7 +154,7 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) : iconView = new Gtk::IconView(static_cast >(store)); //iconView->set_text_column( columns->symbol_id ); iconView->set_tooltip_column( 1 ); - iconView->set_pixbuf_column( columns->symbol_image ); + iconView->set_pixbuf_column( columns->symbol_image ); // Giving the iconview a small minimum size will help users understand // What the dialog does. iconView->set_size_request( 100, 200 ); @@ -163,11 +163,12 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) : targets.push_back(Gtk::TargetEntry( "application/x-inkscape-paste")); iconView->enable_model_drag_source (targets, Gdk::BUTTON1_MASK, Gdk::ACTION_COPY); - iconView->signal_drag_data_get().connect(sigc::mem_fun(*this, &SymbolsDialog::iconDragDataGet)); + iconView->signal_drag_data_get().connect( + sigc::mem_fun(*this, &SymbolsDialog::iconDragDataGet)); sigc::connection connIconChanged; - connIconChanged = - iconView->signal_selection_changed().connect(sigc::mem_fun(*this, &SymbolsDialog::iconChanged)); + connIconChanged = iconView->signal_selection_changed().connect( + sigc::mem_fun(*this, &SymbolsDialog::iconChanged)); instanceConns.push_back(connIconChanged); Gtk::ScrolledWindow *scroller = new Gtk::ScrolledWindow(); @@ -196,109 +197,56 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) : table->attach(*Gtk::manage(tools),0,2,row,row+1,Gtk::EXPAND|Gtk::FILL,Gtk::FILL); #endif - button = Gtk::manage(new Gtk::Button()); - button->add(*Gtk::manage(Glib::wrap( + addSymbol = Gtk::manage(new Gtk::Button()); + addSymbol->add(*Gtk::manage(Glib::wrap( sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("symbol-add")))) ); - button->set_tooltip_text(_("Add Symbol from the current document.")); - button->set_relief( Gtk::RELIEF_NONE ); - tools->pack_start(* Gtk::manage(button), Gtk::PACK_SHRINK); - - button = Gtk::manage(new Gtk::Button()); - button->add(*Gtk::manage(Glib::wrap( + addSymbol->set_tooltip_text(_("Add Symbol from the current document.")); + addSymbol->set_relief( Gtk::RELIEF_NONE ); + addSymbol->set_focus_on_click( false ); + addSymbol->signal_clicked().connect(sigc::mem_fun(*this, &SymbolsDialog::insertSymbol)); + tools->pack_start(* addSymbol, Gtk::PACK_SHRINK); + + removeSymbol = Gtk::manage(new Gtk::Button()); + removeSymbol->add(*Gtk::manage(Glib::wrap( sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("symbol-remove")))) ); - button->set_tooltip_text(_("Remove Symbol from the current document.")); - button->set_relief( Gtk::RELIEF_NONE ); - tools->pack_start(* Gtk::manage(button), Gtk::PACK_SHRINK); + removeSymbol->set_tooltip_text(_("Remove Symbol from the current document.")); + removeSymbol->set_relief( Gtk::RELIEF_NONE ); + removeSymbol->set_focus_on_click( false ); + removeSymbol->signal_clicked().connect(sigc::mem_fun(*this, &SymbolsDialog::revertSymbol)); + tools->pack_start(* removeSymbol, Gtk::PACK_SHRINK); Gtk::Label* spacer = Gtk::manage(new Gtk::Label("")); - tools->pack_start(* Gtk::manage(spacer)); //, Gtk::EXPAND|Gtk::FILL); + tools->pack_start(* Gtk::manage(spacer)); + in_sizes = 2; // Default 32px button = Gtk::manage(new Gtk::Button()); button->add(*Gtk::manage(Glib::wrap( sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("zoom-in")))) ); button->set_tooltip_text(_("Make Icons bigger by zooming in.")); button->set_relief( Gtk::RELIEF_NONE ); - tools->pack_start(* Gtk::manage(button), Gtk::PACK_SHRINK); - - Gtk::ToggleButton* toggle = Gtk::manage(new Gtk::ToggleButton()); - toggle->add(*Gtk::manage(Glib::wrap( - sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("zoom-fit-page")))) ); - toggle->set_tooltip_text(_("Toggle 'fit' symbols in icon space.")); - toggle->set_relief( Gtk::RELIEF_NONE ); - tools->pack_start(* Gtk::manage(toggle), Gtk::PACK_SHRINK); + button->set_focus_on_click( false ); + button->signal_clicked().connect(sigc::mem_fun(*this, &SymbolsDialog::zoomin)); + tools->pack_start(* button, Gtk::PACK_SHRINK); button = Gtk::manage(new Gtk::Button()); button->add(*Gtk::manage(Glib::wrap( sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("zoom-out")))) ); button->set_tooltip_text(_("Make Icons smaller by zooming out.")); button->set_relief( Gtk::RELIEF_NONE ); - tools->pack_start(* Gtk::manage(button), Gtk::PACK_SHRINK); - - - - - - - - ++row; - - /******************** Preview Scale ***********************/ - Gtk::Label* labelScale = new Gtk::Label(_("Preview scale: ")); - -#if WITH_GTKMM_3_0 - table->attach(*Gtk::manage(labelScale),0,row,1,1); -#else - table->attach(*Gtk::manage(labelScale),0,1,row,row+1,Gtk::SHRINK,Gtk::SHRINK); -#endif - - previewScale = new Gtk::ComboBoxText(); - const gchar *scales[] = - {_("Fit"), _("Fit to width"), _("Fit to height"), "0.1", "0.2", "0.5", "1.0", "2.0", "5.0", NULL}; - for( int i = 0; scales[i]; ++i ) { - previewScale->append(scales[i]); - } - previewScale->set_active_text(scales[0]); - -#if WITH_GTKMM_3_0 - previewScale->set_hexpand(); - table->attach(*Gtk::manage(previewScale),1,row,1,1); -#else - table->attach(*Gtk::manage(previewScale),1,2,row,row+1,Gtk::FILL|Gtk::EXPAND,Gtk::SHRINK); -#endif - - sigc::connection connScale = - previewScale->signal_changed().connect(sigc::mem_fun(*this, &SymbolsDialog::rebuild)); - instanceConns.push_back(connScale); - - ++row; - - /******************** Preview Size ************************/ - Gtk::Label* labelSize = new Gtk::Label(_("Preview size: ")); + button->set_focus_on_click( false ); + button->signal_clicked().connect(sigc::mem_fun(*this, &SymbolsDialog::zoomout)); + tools->pack_start(* button, Gtk::PACK_SHRINK); -#if WITH_GTKMM_3_0 - table->attach(*Gtk::manage(labelSize),0,row,1,1); -#else - table->attach(*Gtk::manage(labelSize),0,1,row,row+1,Gtk::SHRINK,Gtk::SHRINK); -#endif - - previewSize = new Gtk::ComboBoxText(); - const gchar *sizes[] = {"16", "24", "32", "48", "64", NULL}; - for( int i = 0; sizes[i]; ++i ) { - previewSize->append(sizes[i]); - } - previewSize->set_active_text(sizes[2]); - -#if WITH_GTKMM_3_0 - previewSize->set_hexpand(); - table->attach(*Gtk::manage(previewSize),1,row,1,1); -#else - table->attach(*Gtk::manage(previewSize),1,2,row,row+1,Gtk::FILL|Gtk::EXPAND,Gtk::SHRINK); -#endif + fitSymbol = Gtk::manage(new Gtk::ToggleButton()); + fitSymbol->add(*Gtk::manage(Glib::wrap( + sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("zoom-fit-page")))) ); + fitSymbol->set_tooltip_text(_("Toggle 'fit' symbols in icon space.")); + fitSymbol->set_relief( Gtk::RELIEF_NONE ); + fitSymbol->set_focus_on_click( false ); + fitSymbol->set_active( true ); + fitSymbol->signal_clicked().connect(sigc::mem_fun(*this, &SymbolsDialog::rebuild)); + tools->pack_start(* fitSymbol, Gtk::PACK_SHRINK); - sigc::connection connSize = - previewSize->signal_changed().connect(sigc::mem_fun(*this, &SymbolsDialog::rebuild)); - instanceConns.push_back(connSize); - ++row; /**********************************************************/ @@ -317,6 +265,10 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) : sigc::mem_fun(*this, &SymbolsDialog::defsModified)); instanceConns.push_back(defsModifiedConn); + sigc::connection selectionChangedConn = currentDesktop->selection->connectChanged( + sigc::mem_fun(*this, &SymbolsDialog::selectionChanged)); + instanceConns.push_back(selectionChangedConn); + get_symbols(); draw_symbols( currentDocument ); /* Defaults to current document */ @@ -341,6 +293,20 @@ SymbolsDialog& SymbolsDialog::getInstance() return *new SymbolsDialog(); } +void SymbolsDialog::zoomin() { + if(in_sizes < 4) { + in_sizes++; + rebuild(); + } +} + +void SymbolsDialog::zoomout() { + if(in_sizes > 0) { + in_sizes--; + rebuild(); + } +} + void SymbolsDialog::rebuild() { store->clear(); @@ -351,10 +317,27 @@ void SymbolsDialog::rebuild() { // Symbol must be from Current Document (this method of // checking should be language independent). symbolDocument = currentDocument; + addSymbol->set_sensitive( true ); + removeSymbol->set_sensitive( true ); + } else { + addSymbol->set_sensitive( false ); + removeSymbol->set_sensitive( false ); } draw_symbols( symbolDocument ); } +void SymbolsDialog::insertSymbol() { + Inkscape::Verb *verb = Inkscape::Verb::get( SP_VERB_EDIT_SYMBOL ); + SPAction *action = verb->get_action((Inkscape::UI::View::View *) this->currentDesktop); + sp_action_perform (action, NULL); +} + +void SymbolsDialog::revertSymbol() { + Inkscape::Verb *verb = Inkscape::Verb::get( SP_VERB_EDIT_UNSYMBOL ); + SPAction *action = verb->get_action((Inkscape::UI::View::View *) this->currentDesktop); + sp_action_perform (action, NULL); +} + void SymbolsDialog::iconDragDataGet(const Glib::RefPtr& /*context*/, Gtk::SelectionData& data, guint /*info*/, guint /*time*/) { #if WITH_GTKMM_3_0 @@ -383,48 +366,66 @@ void SymbolsDialog::defsModified(SPObject * /*object*/, guint /*flags*/) } } -void SymbolsDialog::iconChanged() { -#if WITH_GTKMM_3_0 - std::vector iconArray = iconView->get_selected_items(); -#else - Gtk::IconView::ArrayHandle_TreePaths iconArray = iconView->get_selected_items(); -#endif +void SymbolsDialog::selectionChanged(Inkscape::Selection *selection) { + Glib::ustring symbol_id = selectedSymbolId(); + SPDocument* symbolDocument = selectedSymbols(); + SPObject* symbol = symbolDocument->getObjectById(symbol_id); - if( iconArray.empty() ) { - //std::cout << " iconArray empty: huh? " << std::endl; - } else { + if(symbol && !selection->includes(symbol)) { + iconView->unselect_all(); + } +} + +SPDocument* SymbolsDialog::selectedSymbols() { + /* OK, we know symbol name... now we need to copy it to clipboard, bon chance! */ + Glib::ustring symbolSetString = symbolSet->get_active_text(); + + SPDocument* symbolDocument = symbolSets[symbolSetString]; + if( !symbolDocument ) { + // Symbol must be from Current Document (this method of checking should be language independent). + return currentDocument; + } + return symbolDocument; +} + +Glib::ustring SymbolsDialog::selectedSymbolId() { + #if WITH_GTKMM_3_0 + std::vector iconArray = iconView->get_selected_items(); + #else + Gtk::IconView::ArrayHandle_TreePaths iconArray = iconView->get_selected_items(); + #endif + if( !iconArray.empty() ) { Gtk::TreeModel::Path const & path = *iconArray.begin(); Gtk::ListStore::iterator row = store->get_iter(path); - Glib::ustring symbol_id = (*row)[getColumns()->symbol_id]; + return (*row)[getColumns()->symbol_id]; + } + return Glib::ustring(""); +} - /* OK, we know symbol name... now we need to copy it to clipboard, bon chance! */ - Glib::ustring symbolSetString = symbolSet->get_active_text(); +void SymbolsDialog::iconChanged() { - SPDocument* symbolDocument = symbolSets[symbolSetString]; - if( !symbolDocument ) { - // Symbol must be from Current Document (this method of - // checking should be language independent). - symbolDocument = currentDocument; + Glib::ustring symbol_id = selectedSymbolId(); + SPDocument* symbolDocument = selectedSymbols(); + SPObject* symbol = symbolDocument->getObjectById(symbol_id); + + if( symbol ) { + // Select the symbol on the canvas so it can be manipulated + currentDesktop->selection->set( symbol, false ); + + // Find style for use in + // First look for default style stored in + gchar const* style = symbol->getAttribute("inkscape:symbol-style"); + if( !style ) { + // If no default style in , look in documents. + if( symbolDocument == currentDocument ) { + style = style_from_use( symbol_id.c_str(), currentDocument ); + } else { + style = symbolDocument->getReprRoot()->attribute("style"); + } } - SPObject* symbol = symbolDocument->getObjectById(symbol_id); - if( symbol ) { - - // Find style for use in - // First look for default style stored in - gchar const* style = symbol->getAttribute("inkscape:symbol-style"); - if( !style ) { - // If no default style in , look in documents. - if( symbolDocument == currentDocument ) { - style = style_from_use( symbol_id.c_str(), currentDocument ); - } else { - style = symbolDocument->getReprRoot()->attribute("style"); - } - } - - ClipboardManager *cm = ClipboardManager::get(); - cm->copySymbol(symbol->getRepr(), style); - } + ClipboardManager *cm = ClipboardManager::get(); + cm->copySymbol(symbol->getRepr(), style); } } @@ -739,11 +740,7 @@ SymbolsDialog::create_symbol_image(gchar const *symbol_id, SPObject *symbol) SPItem *item = SP_ITEM(object_temp); - Glib::ustring previewSizeString = previewSize->get_active_text(); - unsigned psize = atol( previewSizeString.c_str() ); - - Glib::ustring previewScaleString = previewScale->get_active_text(); - int previewScaleRow = previewScale->get_active_row_number(); + unsigned psize = SYMBOL_ICON_SIZES[in_sizes]; /* Update to renderable state */ Glib::ustring key = svg_preview_cache.cache_key(previewDocument->getURI(), symbol_id, psize); @@ -774,21 +771,9 @@ SymbolsDialog::create_symbol_image(gchar const *symbol_id, SPObject *symbol) height = 1.0; } - switch (previewScaleRow) { - case 0: - /* Fit */ - scale = psize/std::max(width,height); - break; - case 1: - /* Fit width */ - scale = psize/width; - break; - case 2: - /* Fit height */ - scale = psize/height; - break; - default: - scale = atof( previewScaleString.c_str() ); + if( fitSymbol->get_active() ) { + /* Fit */ + scale = psize/std::max(width,height); } pixbuf = Glib::wrap(render_pixbuf(renderDrawing, scale, *dbox, psize)); diff --git a/src/ui/dialog/symbols.h b/src/ui/dialog/symbols.h index 352d24ec0..54b1a3ab0 100644 --- a/src/ui/dialog/symbols.h +++ b/src/ui/dialog/symbols.h @@ -48,6 +48,9 @@ class SymbolColumns; // For Gtk::ListStore * new symbols documents to be constructed and if saved in the prefs folder will * make those symbols available for all future documents. */ + +const int SYMBOL_ICON_SIZES[] = {16, 24, 32, 48, 64}; + class SymbolsDialog : public UI::Widget::Panel { public: @@ -62,8 +65,15 @@ private: static SymbolColumns *getColumns(); + void zoomin(); + void zoomout(); void rebuild(); + void insertSymbol(); + void revertSymbol(); void defsModified(SPObject *object, guint flags); + void selectionChanged(Inkscape::Selection *selection); + SPDocument* selectedSymbols(); + Glib::ustring selectedSymbolId(); void iconChanged(); void iconDragDataGet(const Glib::RefPtr& context, Gtk::SelectionData& selection_data, guint info, guint time); @@ -84,12 +94,15 @@ private: /* Keep track of all symbol template documents */ std::map symbolSets; + // Index into sizes which is selected + int in_sizes; Glib::RefPtr store; Gtk::ComboBoxText* symbolSet; Gtk::IconView* iconView; - Gtk::ComboBoxText* previewScale; - Gtk::ComboBoxText* previewSize; + Gtk::Button* addSymbol; + Gtk::Button* removeSymbol; + Gtk::ToggleButton* fitSymbol; void setTargetDesktop(SPDesktop *desktop); SPDesktop* currentDesktop; -- cgit v1.2.3 From 29122a95f5a88f56e11d499863a8bce8a35ba855 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Sat, 15 Jun 2013 16:48:44 -0400 Subject: Fix crash for external symbol documents, should never select these items. (bzr r12375) --- src/ui/dialog/symbols.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index cac01c657..5649a7ee6 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -409,8 +409,10 @@ void SymbolsDialog::iconChanged() { SPObject* symbol = symbolDocument->getObjectById(symbol_id); if( symbol ) { - // Select the symbol on the canvas so it can be manipulated - currentDesktop->selection->set( symbol, false ); + if( symbolDocument == currentDocument ) { + // Select the symbol on the canvas so it can be manipulated + currentDesktop->selection->set( symbol, false ); + } // Find style for use in // First look for default style stored in -- cgit v1.2.3 From f00a6c14f8a159429ded3d6ca1918e2981698ef0 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Sat, 15 Jun 2013 17:18:59 -0400 Subject: Improve icons for symbols dialog (bzr r12376) --- src/ui/dialog/symbols.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index 5649a7ee6..5eb7084d6 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -221,7 +221,7 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) : in_sizes = 2; // Default 32px button = Gtk::manage(new Gtk::Button()); button->add(*Gtk::manage(Glib::wrap( - sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("zoom-in")))) ); + sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("symbol-bigger")))) ); button->set_tooltip_text(_("Make Icons bigger by zooming in.")); button->set_relief( Gtk::RELIEF_NONE ); button->set_focus_on_click( false ); @@ -230,7 +230,7 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) : button = Gtk::manage(new Gtk::Button()); button->add(*Gtk::manage(Glib::wrap( - sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("zoom-out")))) ); + sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("symbol-smaller")))) ); button->set_tooltip_text(_("Make Icons smaller by zooming out.")); button->set_relief( Gtk::RELIEF_NONE ); button->set_focus_on_click( false ); @@ -239,7 +239,7 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) : fitSymbol = Gtk::manage(new Gtk::ToggleButton()); fitSymbol->add(*Gtk::manage(Glib::wrap( - sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("zoom-fit-page")))) ); + sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("symbol-fit")))) ); fitSymbol->set_tooltip_text(_("Toggle 'fit' symbols in icon space.")); fitSymbol->set_relief( Gtk::RELIEF_NONE ); fitSymbol->set_focus_on_click( false ); -- cgit v1.2.3 From 61dbeecfd62c733fc3f59dfa8e767b986a08caf3 Mon Sep 17 00:00:00 2001 From: John Smith Date: Sun, 16 Jun 2013 08:18:48 +0900 Subject: Revert Fix for 600285 : Zoom slider (bzr r12377) --- src/widgets/desktop-widget.cpp | 20 ++++++-------------- src/widgets/widget-sizes.h | 2 +- 2 files changed, 7 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 6c62a8f0d..1584ccde1 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -55,7 +55,6 @@ #include "ui/widget/dock.h" #include "ui/widget/layer-selector.h" #include "ui/widget/selected-style.h" -#include "ui/widget/gimpspinscale.h" #include "ui/uxmanager.h" #include "util/ege-appear-time-tracker.h" #include "sp-root.h" @@ -628,14 +627,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw ) gtk_box_pack_end (GTK_BOX (dtw->statusbar), statusbar_tail, FALSE, FALSE, 0); // zoom status spinbutton -#if WITH_GTKMM_3_0 - Glib::RefPtr _adjustment = Gtk::Adjustment::create(100.0, log(SP_DESKTOP_ZOOM_MIN)/log(2), log(SP_DESKTOP_ZOOM_MAX)/log(2), 0.1, 1.0); -#else - Gtk::Adjustment *_adjustment = new Gtk::Adjustment(100.0, log(SP_DESKTOP_ZOOM_MIN)/log(2), log(SP_DESKTOP_ZOOM_MAX)/log(2), 0.1, 1.0); -#endif - dtw->zoom_status = gimp_spin_scale_new (_adjustment->gobj(), _("Zoom"), 1); - - //dtw->zoom_status = gtk_spin_button_new_with_range (log(SP_DESKTOP_ZOOM_MIN)/log(2), log(SP_DESKTOP_ZOOM_MAX)/log(2), 0.1); + dtw->zoom_status = gtk_spin_button_new_with_range (log(SP_DESKTOP_ZOOM_MIN)/log(2), log(SP_DESKTOP_ZOOM_MAX)/log(2), 0.1); gtk_widget_set_tooltip_text (dtw->zoom_status, _("Zoom")); gtk_widget_set_size_request (dtw->zoom_status, STATUS_ZOOM_WIDTH, -1); gtk_entry_set_width_chars (GTK_ENTRY (dtw->zoom_status), 6); @@ -696,18 +688,18 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw ) dtw->coord_status_y = gtk_label_new(NULL); gtk_label_set_markup( GTK_LABEL(dtw->coord_status_y), " 0.00 " ); gtk_misc_set_alignment (GTK_MISC(dtw->coord_status_y), 1.0, 0.5); - //GtkWidget* label_z = gtk_label_new(_("Z:")); + GtkWidget* label_z = gtk_label_new(_("Z:")); #if GTK_CHECK_VERSION(3,0,0) gtk_grid_attach(GTK_GRID(dtw->coord_status), dtw->coord_status_x, 2, 0, 1, 1); gtk_grid_attach(GTK_GRID(dtw->coord_status), dtw->coord_status_y, 2, 1, 1, 1); - //gtk_grid_attach(GTK_GRID(dtw->coord_status), label_z, 3, 0, 1, 2); - gtk_grid_attach(GTK_GRID(dtw->coord_status), dtw->zoom_status, 3, 0, 1, 2); + gtk_grid_attach(GTK_GRID(dtw->coord_status), label_z, 3, 0, 1, 2); + gtk_grid_attach(GTK_GRID(dtw->coord_status), dtw->zoom_status, 4, 0, 1, 2); #else gtk_table_attach(GTK_TABLE(dtw->coord_status), dtw->coord_status_x, 2,3, 0,1, GTK_FILL, GTK_FILL, 0, 0); gtk_table_attach(GTK_TABLE(dtw->coord_status), dtw->coord_status_y, 2,3, 1,2, GTK_FILL, GTK_FILL, 0, 0); - //gtk_table_attach(GTK_TABLE(dtw->coord_status), label_z, 3,4, 0,2, GTK_FILL, GTK_FILL, 0, 0); - gtk_table_attach(GTK_TABLE(dtw->coord_status), dtw->zoom_status, 3,4, 0,2, GTK_FILL, GTK_FILL, 0, 0); + gtk_table_attach(GTK_TABLE(dtw->coord_status), label_z, 3,4, 0,2, GTK_FILL, GTK_FILL, 0, 0); + gtk_table_attach(GTK_TABLE(dtw->coord_status), dtw->zoom_status, 4,5, 0,2, GTK_FILL, GTK_FILL, 0, 0); #endif sp_set_font_size_smaller (dtw->coord_status); diff --git a/src/widgets/widget-sizes.h b/src/widgets/widget-sizes.h index 8db036734..87c7ca2e0 100644 --- a/src/widgets/widget-sizes.h +++ b/src/widgets/widget-sizes.h @@ -27,7 +27,7 @@ #define STATUS_BAR_FONT_SIZE 10000 -#define STATUS_ZOOM_WIDTH 100 +#define STATUS_ZOOM_WIDTH 57 #define SELECTED_STYLE_SB_WIDTH 48 #define SELECTED_STYLE_WIDTH 190 -- cgit v1.2.3 From 11b8456422decef853e6bb46f4d8e16c5ce6d645 Mon Sep 17 00:00:00 2001 From: John Smith Date: Sun, 16 Jun 2013 09:08:17 +0900 Subject: Fix for 1184408 : Additional zoom levels in zoom context menu (bzr r12378) --- src/widgets/desktop-widget.cpp | 113 ++++++++++++++++++++++++++++------------- 1 file changed, 78 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 1584ccde1..814298041 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -1885,6 +1885,67 @@ sp_dtw_zoom_value_changed (GtkSpinButton *spin, gpointer data) spinbutton_defocus (GTK_WIDGET(spin)); } + +static void +sp_dtw_zoom_10 (GtkMenuItem */*item*/, gpointer data) +{ + sp_dtw_zoom_menu_handler (static_cast(data), 0.1); +} + +static void +sp_dtw_zoom_25 (GtkMenuItem */*item*/, gpointer data) +{ + sp_dtw_zoom_menu_handler (static_cast(data), 0.25); +} + +static void +sp_dtw_zoom_50 (GtkMenuItem */*item*/, gpointer data) +{ + sp_dtw_zoom_menu_handler (static_cast(data), 0.5); +} + +static void +sp_dtw_zoom_100 (GtkMenuItem */*item*/, gpointer data) +{ + sp_dtw_zoom_menu_handler (static_cast(data), 1.0); +} + +static void +sp_dtw_zoom_200 (GtkMenuItem */*item*/, gpointer data) +{ + sp_dtw_zoom_menu_handler (static_cast(data), 2.0); +} + +static void +sp_dtw_zoom_500 (GtkMenuItem */*item*/, gpointer data) +{ + sp_dtw_zoom_menu_handler (static_cast(data), 5.0); +} + +static void +sp_dtw_zoom_1000 (GtkMenuItem */*item*/, gpointer data) +{ + sp_dtw_zoom_menu_handler (static_cast(data), 10.0); +} + +static void +sp_dtw_zoom_page (GtkMenuItem */*item*/, gpointer data) +{ + static_cast(data)->zoom_page(); +} + +static void +sp_dtw_zoom_drawing (GtkMenuItem */*item*/, gpointer data) +{ + static_cast(data)->zoom_drawing(); +} + +static void +sp_dtw_zoom_selection (GtkMenuItem */*item*/, gpointer data) +{ + static_cast(data)->zoom_selection(); +} + static void sp_dtw_zoom_populate_popup (GtkEntry */*entry*/, GtkMenu *menu, gpointer data) { @@ -1898,6 +1959,14 @@ sp_dtw_zoom_populate_popup (GtkEntry */*entry*/, GtkMenu *menu, gpointer data) } g_list_free (children); + item = gtk_menu_item_new_with_label ("1000%"); + g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (sp_dtw_zoom_1000), dt); + gtk_widget_show (item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + item = gtk_menu_item_new_with_label ("500%"); + g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (sp_dtw_zoom_500), dt); + gtk_widget_show (item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); item = gtk_menu_item_new_with_label ("200%"); g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (sp_dtw_zoom_200), dt); gtk_widget_show (item); @@ -1909,6 +1978,15 @@ sp_dtw_zoom_populate_popup (GtkEntry */*entry*/, GtkMenu *menu, gpointer data) item = gtk_menu_item_new_with_label ("50%"); g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (sp_dtw_zoom_50), dt); gtk_widget_show (item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + item = gtk_menu_item_new_with_label ("25%"); + g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (sp_dtw_zoom_25), dt); + gtk_widget_show (item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + item = gtk_menu_item_new_with_label ("10%"); + g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (sp_dtw_zoom_10), dt); + gtk_widget_show (item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); item = gtk_separator_menu_item_new (); @@ -1936,41 +2014,6 @@ sp_dtw_zoom_menu_handler (SPDesktop *dt, gdouble factor) dt->zoom_absolute(d.midpoint()[Geom::X], d.midpoint()[Geom::Y], factor); } -static void -sp_dtw_zoom_50 (GtkMenuItem */*item*/, gpointer data) -{ - sp_dtw_zoom_menu_handler (static_cast(data), 0.5); -} - -static void -sp_dtw_zoom_100 (GtkMenuItem */*item*/, gpointer data) -{ - sp_dtw_zoom_menu_handler (static_cast(data), 1.0); -} - -static void -sp_dtw_zoom_200 (GtkMenuItem */*item*/, gpointer data) -{ - sp_dtw_zoom_menu_handler (static_cast(data), 2.0); -} - -static void -sp_dtw_zoom_page (GtkMenuItem */*item*/, gpointer data) -{ - static_cast(data)->zoom_page(); -} - -static void -sp_dtw_zoom_drawing (GtkMenuItem */*item*/, gpointer data) -{ - static_cast(data)->zoom_drawing(); -} - -static void -sp_dtw_zoom_selection (GtkMenuItem */*item*/, gpointer data) -{ - static_cast(data)->zoom_selection(); -} static void sp_dtw_sticky_zoom_toggled (GtkMenuItem *, gpointer data) -- cgit v1.2.3 From 5cd0fcd53cf3734cd5e0a52454ce0443fa6754ad Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Sun, 16 Jun 2013 09:48:12 -0400 Subject: Fix layer selection so defs don't change layers, updated symbol text. (bzr r12379) --- src/desktop.cpp | 4 ++++ src/selection-describer.cpp | 8 ++++++++ 2 files changed, 12 insertions(+) (limited to 'src') diff --git a/src/desktop.cpp b/src/desktop.cpp index 0bf442b7a..17548ee56 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -70,6 +70,7 @@ #include "sp-item-group.h" #include "sp-namedview.h" #include "sp-root.h" +#include "sp-defs.h" #include "widgets/desktop-widget.h" #include "xml/repr.h" #include "helper/action.h" //sp_action_perform @@ -595,6 +596,9 @@ SPObject *SPDesktop::layerForObject(SPObject *object) { SPObject *root=currentRoot(); object = object->parent; while ( object && object != root && !isLayer(object) ) { + // Objects in defs have no layer and are NOT in the root layer + if(SP_IS_DEFS(object)) + return NULL; object = object->parent; } return object; diff --git a/src/selection-describer.cpp b/src/selection-describer.cpp index dd64e6232..e65a88f2e 100644 --- a/src/selection-describer.cpp +++ b/src/selection-describer.cpp @@ -151,6 +151,8 @@ void SelectionDescriber::_updateMessageFromSelection(Inkscape::Selection *select gchar *layer_name; if (layer == root) { layer_name = g_strdup(_("root")); + } else if(!layer) { + layer_name = g_strdup(_("none")); } else { char const *layer_label; bool is_label = false; @@ -183,6 +185,8 @@ void SelectionDescriber::_updateMessageFromSelection(Inkscape::Selection *select if (num_parents == 1) { if (layer == parent) in_phrase = g_strdup_printf(_(" in %s"), layer_name); + else if (!layer) + in_phrase = g_strdup_printf(_(" hidden in definitions")); else in_phrase = g_strdup_printf(_(" in group %s (%s)"), parent_name, layer_name); } else { @@ -200,6 +204,10 @@ void SelectionDescriber::_updateMessageFromSelection(Inkscape::Selection *select _context.setF(Inkscape::NORMAL_MESSAGE, "%s%s. %s. %s.", item_desc, in_phrase, _("Convert symbol to group to edit"), _when_selected); + } else if (SP_IS_SYMBOL(item)) { + _context.setF(Inkscape::NORMAL_MESSAGE, "%s%s. %s.", + item_desc, in_phrase, + _("Select clone to edit symbol")); } else if (SP_IS_USE(item) || (SP_IS_OFFSET(item) && SP_OFFSET(item)->sourceHref)) { _context.setF(Inkscape::NORMAL_MESSAGE, "%s%s. %s. %s.", item_desc, in_phrase, -- cgit v1.2.3 From 18632069f19fc1255f509bffb6077cf9d00455ac Mon Sep 17 00:00:00 2001 From: Christoffer Holmstedt Date: Mon, 17 Jun 2013 19:16:47 +0200 Subject: Removed hard coded keybinding from event-context.cpp and added the appropiate function call in verbs.cpp (bzr r12379.1.1) --- src/event-context.cpp | 7 ------- src/verbs.cpp | 3 ++- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/event-context.cpp b/src/event-context.cpp index 628380a2c..4bbb012e0 100644 --- a/src/event-context.cpp +++ b/src/event-context.cpp @@ -590,13 +590,6 @@ static gint sp_event_context_private_root_handler( ret = sp_shortcut_invoke(shortcut, desktop); break; - case GDK_KEY_D: - case GDK_KEY_d: - if (!MOD__SHIFT(event) && !MOD__CTRL(event) && !MOD__ALT(event)) { - sp_toggle_dropper(desktop); - ret = TRUE; - } - break; case GDK_KEY_Q: case GDK_KEY_q: if (desktop->quick_zoomed()) { diff --git a/src/verbs.cpp b/src/verbs.cpp index 6f83b3dfb..3fdb97365 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -47,6 +47,7 @@ #include "document.h" #include "draw-context.h" #include "extension/effect.h" +#include "event-context.h" #include "file.h" #include "gradient-drag.h" #include "helper/action.h" @@ -1560,7 +1561,7 @@ void ContextVerb::perform(SPAction *action, void *data) tools_switch(dt, TOOLS_MEASURE); break; case SP_VERB_CONTEXT_DROPPER: - tools_switch(dt, TOOLS_DROPPER); + sp_toggle_dropper(dt); // Functionality defined in event-context.cpp break; case SP_VERB_CONTEXT_CONNECTOR: tools_switch(dt, TOOLS_CONNECTOR); -- cgit v1.2.3 From 7b18559bf25c2b1f6255babf8ec07e4753843dd8 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Mon, 17 Jun 2013 18:53:50 -0400 Subject: Fix my own mis-credit and some symbols labels (bzr r12380) --- src/selection-describer.cpp | 2 +- src/ui/dialog/aboutbox.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/selection-describer.cpp b/src/selection-describer.cpp index e65a88f2e..72467c187 100644 --- a/src/selection-describer.cpp +++ b/src/selection-describer.cpp @@ -207,7 +207,7 @@ void SelectionDescriber::_updateMessageFromSelection(Inkscape::Selection *select } else if (SP_IS_SYMBOL(item)) { _context.setF(Inkscape::NORMAL_MESSAGE, "%s%s. %s.", item_desc, in_phrase, - _("Select clone to edit symbol")); + _("Remove from symbols tray to edit symbol")); } else if (SP_IS_USE(item) || (SP_IS_OFFSET(item) && SP_OFFSET(item)->sourceHref)) { _context.setF(Inkscape::NORMAL_MESSAGE, "%s%s. %s. %s.", item_desc, in_phrase, diff --git a/src/ui/dialog/aboutbox.cpp b/src/ui/dialog/aboutbox.cpp index ba9670d86..6f1137e46 100644 --- a/src/ui/dialog/aboutbox.cpp +++ b/src/ui/dialog/aboutbox.cpp @@ -359,7 +359,7 @@ void AboutBox::initStrings() { "Nick\n" "Andreas Nilsson\n" "Mitsuru Oka\n" -"Marten Owens\n" +"Martin Owens\n" "Alvin Penner\n" "Jon Phillips\n" "Zdenko Podobny\n" -- cgit v1.2.3 From 80174b60033b8439eb06256f7ce9a51a26c6f7ed Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Fri, 21 Jun 2013 22:44:07 +0200 Subject: cppcheck (bzr r12382) --- src/sp-string.cpp | 8 ++++---- src/ui/dialog/align-and-distribute.cpp | 4 ++-- src/ui/dialog/transformation.cpp | 4 ++-- src/unicoderange.cpp | 8 +++++--- src/widgets/sp-color-icc-selector.cpp | 6 ++++-- 5 files changed, 17 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/sp-string.cpp b/src/sp-string.cpp index 2fe84ac6a..457c248bc 100644 --- a/src/sp-string.cpp +++ b/src/sp-string.cpp @@ -132,10 +132,10 @@ sp_string_update(SPObject *object, SPCtx *ctx, unsigned flags) if (((SPObjectClass *) sp_string_parent_class)->update) ((SPObjectClass *) sp_string_parent_class)->update(object, ctx, flags); - if (flags & (SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_MODIFIED_FLAG)) { - /* Parent style or we ourselves changed, so recalculate */ - flags &= ~SP_OBJECT_USER_MODIFIED_FLAG_B; // won't be "just a transformation" anymore, we're going to recompute "x" and "y" attributes - } + // if (flags & (SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_MODIFIED_FLAG)) { + // /* Parent style or we ourselves changed, so recalculate */ + // flags &= ~SP_OBJECT_USER_MODIFIED_FLAG_B; // won't be "just a transformation" anymore, we're going to recompute "x" and "y" attributes + // } } diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp index dbd06d9e8..7f88824f7 100644 --- a/src/ui/dialog/align-and-distribute.cpp +++ b/src/ui/dialog/align-and-distribute.cpp @@ -195,7 +195,7 @@ void ActionAlign::do_action(SPDesktop *desktop, int index) { //Move each item in the selected list separately for (std::list::iterator it(selected.begin()); it != selected.end(); - it++) + ++it) { sp_desktop_document (desktop)->ensureUpToDate(); if (!sel_as_group) @@ -347,7 +347,7 @@ private : float pos = sorted.front().bbox.min()[_orientation]; for ( std::vector ::iterator it (sorted.begin()); it < sorted.end(); - it ++ ) + ++it ) { if (!Geom::are_near(pos, it->bbox.min()[_orientation], 1e-6)) { Geom::Point t(0.0, 0.0); diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index 4aa972296..2ae98beda 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -762,7 +762,7 @@ void Transformation::applyPageMove(Inkscape::Selection *selection) double move = x; for ( std::vector ::iterator it (sorted.begin()); it < sorted.end(); - it ++ ) + ++it ) { sp_item_move_rel(it->item, Geom::Translate(move, 0)); // move each next object by x relative to previous @@ -786,7 +786,7 @@ void Transformation::applyPageMove(Inkscape::Selection *selection) double move = y; for ( std::vector ::iterator it (sorted.begin()); it < sorted.end(); - it ++ ) + ++it ) { sp_item_move_rel(it->item, Geom::Translate(0, move)); // move each next object by x relative to previous diff --git a/src/unicoderange.cpp b/src/unicoderange.cpp index dcf461214..67239d0d2 100644 --- a/src/unicoderange.cpp +++ b/src/unicoderange.cpp @@ -37,8 +37,10 @@ int UnicodeRange::add_range(gchar* val){ Urange r; int i=0, count=0; - while(val[i]!='\0' && val[i]!='-' && val[i]!=' ' && val[i]!=',') i++; - r.start = (gchar*) malloc((i+1)*sizeof(gchar*)); + while(val[i]!='\0' && val[i]!='-' && val[i]!=' ' && val[i]!=','){ + i++; + } + r.start = (gchar*) malloc((i+1)*sizeof(gchar*)); strncpy(r.start, val, i); r.start[i] = '\0'; val+=i; @@ -50,7 +52,7 @@ UnicodeRange::add_range(gchar* val){ r.end = (gchar*) malloc((i+1)*sizeof(gchar*)); strncpy(r.end, val, i); r.end[i] = '\0'; - val+=i; + // val+=i; count+=i; } else { r.end=NULL; diff --git a/src/widgets/sp-color-icc-selector.cpp b/src/widgets/sp-color-icc-selector.cpp index 00b00ce38..53e73dd57 100644 --- a/src/widgets/sp-color-icc-selector.cpp +++ b/src/widgets/sp-color-icc-selector.cpp @@ -272,7 +272,8 @@ static void sp_color_icc_selector_class_init(SPColorICCSelectorClass *klass) ColorICCSelector::ColorICCSelector( SPColorSelector* csel ) - : ColorSelector( csel ) + : ColorSelector( csel ), + _impl(NULL) { } @@ -429,7 +430,8 @@ ColorICCSelectorImpl::~ColorICCSelectorImpl() void ColorICCSelector::init() { - _impl = new ColorICCSelectorImpl(this); + if (_impl) delete(_impl); + _impl = new ColorICCSelectorImpl(this); gint row = 0; _impl->_updating = FALSE; -- cgit v1.2.3 From df46631f0e183b8e4cc6f87b45ae8a4cfcc33a78 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Fri, 21 Jun 2013 22:45:22 +0200 Subject: odf metadata - let's begin with a first step to full ODF compatibility (bzr r12383) --- src/extension/internal/odf.cpp | 44 ++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/extension/internal/odf.cpp b/src/extension/internal/odf.cpp index b23378fc3..9f745cdea 100644 --- a/src/extension/internal/odf.cpp +++ b/src/extension/internal/odf.cpp @@ -1191,16 +1191,29 @@ bool OdfOutput::writeMeta(ZipFile &zf) { creator = iter->second; } - Glib::ustring date = ""; + + Glib::ustring date; + Glib::ustring moddate; + char buf [80]; + time_t rawtime; + struct tm * timeinfo; + time (&rawtime); + timeinfo = localtime (&rawtime); + strftime (buf,80,"%Y-%m-%d %H:%M:%S",timeinfo); + moddate = Glib::ustring(buf); + iter = metadata.find("dc:date"); if (iter != metadata.end()) { date = iter->second; } + else + { + date = moddate; + } outs.writeString("\n"); outs.writeString("\n"); - outs.writeString("\n"); outs.writeString("\n"); outs.writeString("\n"); - outs.writeString("\n"); outs.writeString("\n"); outs.writeString("\n"); - Glib::ustring tmp = Glib::ustring(" ") + InkscapeVersion + "\n"; + Glib::ustring tmp = Glib::ustring::compose(" %1\n", InkscapeVersion); + tmp += Glib::ustring::compose(" %1\n", creator); + tmp += Glib::ustring::compose(" %1\n", date); + tmp += Glib::ustring::compose(" %1\n", moddate); outs.writeUString(tmp); - outs.printf(" %s\n", creator.c_str()); - outs.printf(" %s\n", date.c_str()); for (iter = metadata.begin() ; iter != metadata.end() ; ++iter) { Glib::ustring name = iter->first; @@ -1235,18 +1248,15 @@ bool OdfOutput::writeMeta(ZipFile &zf) outs.writeUString(tmp); } } - outs.writeString(" 2\n"); - outs.writeString(" PT56S\n"); - outs.writeString(" \n"); - outs.writeString(" \n"); - outs.writeString(" \n"); - outs.writeString(" \n"); - outs.writeString(" \n"); + // outs.writeString(" 2\n"); + // outs.writeString(" PT56S\n"); + // outs.writeString(" \n"); + // outs.writeString(" \n"); + // outs.writeString(" \n"); + // outs.writeString(" \n"); + // outs.writeString(" \n"); outs.writeString("\n"); outs.writeString("\n"); - outs.writeString("\n"); - outs.writeString("\n"); - outs.close(); //Make our entry @@ -1533,7 +1543,7 @@ bool OdfOutput::processGradient(SPItem *item, gradientTable.push_back(gi); gradientLookupTable[id] = gradientName; - int gradientCount = gradientTable.size(); + // int gradientCount = gradientTable.size(); char buf[128]; if (gi.style == "linear") { -- cgit v1.2.3 From b70b0336a827e9db4c091a321b32add41dc22941 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sun, 23 Jun 2013 21:45:37 +0200 Subject: Remove unused file memeq.h (bzr r12385) --- src/CMakeLists.txt | 1 - src/Makefile_insert | 1 - src/doxygen-main.cpp | 2 +- src/memeq.h | 25 ------------------------- 4 files changed, 1 insertion(+), 28 deletions(-) delete mode 100644 src/memeq.h (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a8925e24f..49f32fdea 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -407,7 +407,6 @@ set(inkscape_SRC marker.h measure-context.h media.h - memeq.h menus-skeleton.h mesh-context.h message-context.h diff --git a/src/Makefile_insert b/src/Makefile_insert index c6955c92a..87b2545c8 100644 --- a/src/Makefile_insert +++ b/src/Makefile_insert @@ -99,7 +99,6 @@ ink_common_sources += \ main-cmdlineact.cpp main-cmdlineact.h \ marker.cpp marker.h \ media.cpp media.h \ - memeq.h \ menus-skeleton.h \ mesh-context.cpp mesh-context.h \ message-context.cpp message-context.h \ diff --git a/src/doxygen-main.cpp b/src/doxygen-main.cpp index 71cd49dae..04e5ab33e 100644 --- a/src/doxygen-main.cpp +++ b/src/doxygen-main.cpp @@ -303,7 +303,7 @@ namespace XML {} * SPGuide [\ref sp-guide.cpp, \ref sp-guide.h, \ref satisfied-guide-cns.cpp, \ref sp-guide-attachment.h, \ref sp-guide-constraint.h] * * [\ref help.cpp] [\ref inkscape.cpp] [\ref inkscape-stock.cpp] - * [\ref interface.cpp, \ref memeq.h] [\ref main.cpp, \ref winmain.cpp] + * [\ref interface.cpp] [\ref main.cpp, \ref winmain.cpp] * [\ref menus-skeleton.h, \ref preferences-skeleton.h] * [\ref select-toolbar.cpp] [\ref shortcuts.cpp] * [\ref sp-cursor.cpp] [\ref text-edit.cpp] [\ref toolbox.cpp] diff --git a/src/memeq.h b/src/memeq.h deleted file mode 100644 index ebccc3c9e..000000000 --- a/src/memeq.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef INKSCAPE_MEMEQ_H -#define INKSCAPE_MEMEQ_H - -#include - -/** Convenience/readability wrapper for memcmp(a,b,n)==0. */ -inline bool -memeq(void const *a, void const *b, size_t n) -{ - return std::memcmp(a, b, n) == 0; -} - - -#endif /* !INKSCAPE_MEMEQ_H */ - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : -- cgit v1.2.3 From e4bbe51f2155809c639e86d7b49b24165101638c Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sun, 23 Jun 2013 21:51:39 +0200 Subject: Documentation spelling fix (bzr r12386) --- src/winconsole.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/winconsole.cpp b/src/winconsole.cpp index 1515d2062..085fb441c 100644 --- a/src/winconsole.cpp +++ b/src/winconsole.cpp @@ -5,13 +5,13 @@ * Windows has two types of executables: GUI and console. * The GUI executables detach immediately when run from the command * prompt (cmd.exe), and whatever you write to standard output - * disappears into a black hole. Console executables handle + * disappears into a black hole. Console executables * do display standard output and take standard input from the console, * but when you run them from the GUI, an extra console window appears. - * It's possible to hide it, but it still flashes from a fraction + * It's possible to hide it, but it still flashes for a fraction * of a second. * - * To provide an Unix-like experienve, where the application will behave + * To provide an Unix-like experience, where the application will behave * correctly in command line mode and at the same time won't create * the ugly console window when run from the GUI, we have to have two * executables. The first one, inkscape.exe, is the GUI application. @@ -31,7 +31,7 @@ *//* * Authors: * Jos Hirth - * Krzysztof Kosiński + * Krzysztof Kosinski * * Copyright (C) 2008-2010 Authors * -- cgit v1.2.3 From 6a68e8a63540ffda15050908d80f776d94b43b41 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Wed, 26 Jun 2013 07:55:59 -0400 Subject: Using CC0 link instead of old Public Domain link Fixed bugs: - https://launchpad.net/bugs/1194372 (bzr r12389) --- src/rdf.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/rdf.cpp b/src/rdf.cpp index 017de42c1..72aea4898 100644 --- a/src/rdf.cpp +++ b/src/rdf.cpp @@ -202,8 +202,8 @@ struct rdf_license_t rdf_licenses [] = { rdf_license_cc_a_nc_nd, }, - { N_("Public Domain"), - "http://creativecommons.org/licenses/publicdomain/", + { N_("CC0 Public Domain Dedication"), + "http://creativecommons.org/publicdomain/zero/1.0/", rdf_license_pd, }, -- cgit v1.2.3 From 1fa9ac15ea93f1ba4017d17d1950c0e3ae5c4fb8 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Wed, 26 Jun 2013 09:44:37 -0400 Subject: Fix Gtk3 build by including togglebutton header (bzr r12390) --- src/ui/dialog/symbols.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index 5eb7084d6..b71686a17 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -26,6 +26,7 @@ #include #if WITH_GTKMM_3_0 +# include # include #else # include -- cgit v1.2.3 From 9c54e4ae9e74a13735989977a477141c7a5535cf Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Wed, 26 Jun 2013 11:18:52 -0400 Subject: Add render rack gear extension from bug#1174800, modify gears location to render sub-menu Fixed bugs: - https://launchpad.net/bugs/1174800 (bzr r12391) --- src/libavoid/makefile | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 src/libavoid/makefile (limited to 'src') diff --git a/src/libavoid/makefile b/src/libavoid/makefile deleted file mode 100644 index e4f83a52d..000000000 --- a/src/libavoid/makefile +++ /dev/null @@ -1,17 +0,0 @@ -# Convenience stub makefile to call the real Makefile. - - - -OBJEXT = o - -# Explicit so that it's the default rule. -all: - cd .. && $(MAKE) libavoid/all - -clean %.a %.$(OBJEXT): - cd .. && $(MAKE) libavoid/$@ - -.PHONY: all clean - -.SUFFIXES: -.SUFFIXES: .a .$(OBJEXT) -- cgit v1.2.3 From 092b5a984f57e348a9dba7afa731ca0109be9b79 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Thu, 27 Jun 2013 23:28:22 -0400 Subject: Add the ability to reorder filters using drag-drop in the gtklist Fixed bugs: - https://launchpad.net/bugs/1168814 (bzr r12394) --- src/ui/dialog/filter-effects-dialog.cpp | 15 ++++++++++++++- src/ui/dialog/filter-effects-dialog.h | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp index 4c289d54e..4401d5658 100644 --- a/src/ui/dialog/filter-effects-dialog.cpp +++ b/src/ui/dialog/filter-effects-dialog.cpp @@ -1155,7 +1155,13 @@ FilterEffectsDialog::FilterModifier::FilterModifier(FilterEffectsDialog& d) sw->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); _list.get_column(1)->set_resizable(true); - + _list.set_reorderable(true); + + // We can track the drag/drop reordering from the row_delete (occurs after + // row_inserted and may occur many times when adding a new item) + _model->signal_row_deleted().connect( + sigc::mem_fun(*this, &FilterModifier::on_filter_reorder)); + sw->set_shadow_type(Gtk::SHADOW_IN); show_all_children(); _add.signal_clicked().connect(sigc::mem_fun(*this, &FilterModifier::add_filter)); @@ -1301,6 +1307,13 @@ void FilterEffectsDialog::FilterModifier::on_name_edited(const Glib::ustring& pa } } +void FilterEffectsDialog::FilterModifier::on_filter_reorder(const Gtk::TreeModel::Path& path) { + for(Gtk::TreeModel::iterator i = _model->children().begin(); i != _model->children().end(); ++i) { + SPObject* object = (*i)[_columns.filter]; + object->getRepr()->setPosition(0); + } +} + void FilterEffectsDialog::FilterModifier::on_selection_toggled(const Glib::ustring& path) { Gtk::TreeIter iter = _model->get_iter(path); diff --git a/src/ui/dialog/filter-effects-dialog.h b/src/ui/dialog/filter-effects-dialog.h index 658aac790..a2a2a3c6e 100644 --- a/src/ui/dialog/filter-effects-dialog.h +++ b/src/ui/dialog/filter-effects-dialog.h @@ -86,6 +86,7 @@ private: void on_filter_selection_changed(); void on_name_edited(const Glib::ustring&, const Glib::ustring&); + void on_filter_reorder(const Gtk::TreeModel::Path& path); void on_selection_toggled(const Glib::ustring&); void update_filters(); -- cgit v1.2.3 From 6ba58cf2eb05a8e44f21f853dc638a41b6cc59b2 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Fri, 28 Jun 2013 00:45:10 -0400 Subject: Fix crash when undoing/redoing a duplicate layer. Fixed bugs: - https://launchpad.net/bugs/1183206 (bzr r12395) --- src/ui/dialog/layers.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp index 5cc9578f1..ce923f6b4 100644 --- a/src/ui/dialog/layers.cpp +++ b/src/ui/dialog/layers.cpp @@ -404,13 +404,13 @@ void LayersPanel::_addLayer( SPDocument* doc, SPObject* layer, Gtk::TreeModel::R SPObject *child = _desktop->layer_manager->nthChildOf(layer, i); if ( child ) { #if DUMP_LAYERS - g_message(" %3d layer:%p {%s} [%s]", level, child, child->id, child->label() ); + g_message(" %3d layer:%p {%s} [%s]", level, child, child->getId(), child->label() ); #endif // DUMP_LAYERS Gtk::TreeModel::iterator iter = parentRow ? _store->prepend(parentRow->children()) : _store->prepend(); Gtk::TreeModel::Row row = *iter; row[_model->_colObject] = child; - row[_model->_colLabel] = child->label() ? child->label() : child->getId(); + row[_model->_colLabel] = child->defaultLabel(); row[_model->_colVisible] = SP_IS_ITEM(child) ? !SP_ITEM(child)->isHidden() : false; row[_model->_colLocked] = SP_IS_ITEM(child) ? SP_ITEM(child)->isLocked() : false; -- cgit v1.2.3 From fefbd8cbb7c09c8c6241c7ef52413e37d4d5e6eb Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Sat, 29 Jun 2013 11:43:12 -0400 Subject: Make DAMN sure paths with zero nodes do not cause a crash. Fixed bugs: - https://launchpad.net/bugs/710637 (bzr r12396) --- src/ui/tool/multi-path-manipulator.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp index 70bd0e859..5d5ea2adc 100644 --- a/src/ui/tool/multi-path-manipulator.cpp +++ b/src/ui/tool/multi-path-manipulator.cpp @@ -224,10 +224,12 @@ void MultiPathManipulator::shiftSelection(int dir) SubpathList::iterator last_j; NodeList::iterator last_k; bool anything_found = false; + bool anynode_found = false; for (MapType::iterator i = _mmap.begin(); i != _mmap.end(); ++i) { SubpathList &sp = i->second->subpathList(); for (SubpathList::iterator j = sp.begin(); j != sp.end(); ++j) { + anynode_found = true; for (NodeList::iterator k = (*j)->begin(); k != (*j)->end(); ++k) { if (k->selected()) { last_i = i; @@ -249,10 +251,12 @@ void MultiPathManipulator::shiftSelection(int dir) if (!anything_found) { // select first / last node // this should never fail because there must be at least 1 non-empty manipulator - if (dir == 1) { + if (anynode_found) { + if (dir == 1) { _selection.insert((*_mmap.begin()->second->subpathList().begin())->begin().ptr()); - } else { + } else { _selection.insert((--(*--(--_mmap.end())->second->subpathList().end())->end()).ptr()); + } } return; } -- cgit v1.2.3 From 4638e6b967c2ab156602847ff50e0e0ff09b76c2 Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Sat, 29 Jun 2013 15:22:01 -0400 Subject: Transform dialog. do not use singular transforms. (Bug 1189446) Fixed bugs: - https://launchpad.net/bugs/1189446 (bzr r12397) --- src/ui/dialog/transformation.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'src') diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index 2ae98beda..ce8af3f1f 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -31,6 +31,7 @@ #include "inkscape.h" #include "selection.h" #include "selection-chemistry.h" +#include "message-stack.h" #include "verbs.h" #include "preferences.h" #include "sp-namedview.h" @@ -902,10 +903,21 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection) if (!_units_skew.isAbsolute()) { // percentage double skewX = _scalar_skew_horizontal.getValue("%"); double skewY = _scalar_skew_vertical.getValue("%"); + if (fabs(0.01*skewX*0.01*skewY - 1.0) < Geom::EPSILON) { + sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, not used.")); + return; + } sp_item_skew_rel (item, 0.01*skewX, 0.01*skewY); } else if (_units_skew.isRadial()) { //deg or rad double angleX = _scalar_skew_horizontal.getValue("rad"); double angleY = _scalar_skew_vertical.getValue("rad"); + if ((fabs(angleX - angleY + M_PI/2) < Geom::EPSILON) + || (fabs(angleX - angleY - M_PI/2) < Geom::EPSILON) + || (fabs((angleX - angleY)/3 + M_PI/2) < Geom::EPSILON) + || (fabs((angleX - angleY)/3 - M_PI/2) < Geom::EPSILON)) { + sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, not used.")); + return; + } double skewX = tan(-angleX); double skewY = tan(angleY); sp_item_skew_rel (item, skewX, skewY); @@ -916,6 +928,10 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection) if (bbox) { double width = bbox->dimensions()[Geom::X]; double height = bbox->dimensions()[Geom::Y]; + if (fabs(skewX*skewY - width*height) < Geom::EPSILON) { + sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, not used.")); + return; + } sp_item_skew_rel (item, skewX/height, skewY/width); } } @@ -931,16 +947,31 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection) if (!_units_skew.isAbsolute()) { // percentage double skewX = _scalar_skew_horizontal.getValue("%"); double skewY = _scalar_skew_vertical.getValue("%"); + if (fabs(0.01*skewX*0.01*skewY - 1.0) < Geom::EPSILON) { + sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, not used.")); + return; + } sp_selection_skew_relative(selection, *center, 0.01*skewX, 0.01*skewY); } else if (_units_skew.isRadial()) { //deg or rad double angleX = _scalar_skew_horizontal.getValue("rad"); double angleY = _scalar_skew_vertical.getValue("rad"); + if ((fabs(angleX - angleY + M_PI/2) < Geom::EPSILON) + || (fabs(angleX - angleY - M_PI/2) < Geom::EPSILON) + || (fabs((angleX - angleY)/3 + M_PI/2) < Geom::EPSILON) + || (fabs((angleX - angleY)/3 - M_PI/2) < Geom::EPSILON)) { + sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, not used.")); + return; + } double skewX = tan(-angleX); double skewY = tan(angleY); sp_selection_skew_relative(selection, *center, skewX, skewY); } else { // absolute displacement double skewX = _scalar_skew_horizontal.getValue("px"); double skewY = _scalar_skew_vertical.getValue("px"); + if (fabs(skewX*skewY - width*height) < Geom::EPSILON) { + sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, not used.")); + return; + } sp_selection_skew_relative(selection, *center, skewX/height, skewY/width); } } @@ -961,6 +992,10 @@ void Transformation::applyPageTransform(Inkscape::Selection *selection) double f = _scalar_transform_f.getValue(); Geom::Affine displayed(a, b, c, d, e, f); + if (displayed.isSingular()) { + sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, not used.")); + return; + } if (_check_replace_matrix.get_active()) { for (GSList const *l = selection->itemList(); l != NULL; l = l->next) { -- cgit v1.2.3 From 4847a7f261731ebbd9396d56c12244f721b006d7 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 1 Jul 2013 23:05:45 +0200 Subject: LPE bend path: fix crash on "uskeleton.cuts.back()" because of empty uskeleton. Fixed bugs: - https://launchpad.net/bugs/616198 (bzr r12398) --- src/live_effects/lpe-bendpath.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/live_effects/lpe-bendpath.cpp b/src/live_effects/lpe-bendpath.cpp index 49660c91b..eaf9fe4a6 100644 --- a/src/live_effects/lpe-bendpath.cpp +++ b/src/live_effects/lpe-bendpath.cpp @@ -94,6 +94,10 @@ LPEBendPath::doEffect_pwd2 (Geom::Piecewise > const & pwd bend_path.changed = false; } + if (uskeleton.empty()) { + return pwd2_in; /// \todo or throw an exception instead? might be better to throw an exception so that the UI can display an error message or smth + } + D2 > patternd2 = make_cuts_independent(pwd2_in); Piecewise x = vertical_pattern.get_value() ? Piecewise(patternd2[1]) : Piecewise(patternd2[0]); Piecewise y = vertical_pattern.get_value() ? Piecewise(patternd2[0]) : Piecewise(patternd2[1]); @@ -105,9 +109,9 @@ LPEBendPath::doEffect_pwd2 (Geom::Piecewise > const & pwd x-= bboxHorizontal.min(); y-= bboxVertical.middle(); - double scaling = uskeleton.cuts.back()/bboxHorizontal.extent(); + double scaling = uskeleton.cuts.back()/bboxHorizontal.extent(); - if (scaling != 1.0) { + if (scaling != 1.0) { x*=scaling; } @@ -117,7 +121,6 @@ LPEBendPath::doEffect_pwd2 (Geom::Piecewise > const & pwd if (prop_scale != 1.0) y *= prop_scale; } - Piecewise > output = compose(uskeleton,x) + y*compose(n,x); return output; } -- cgit v1.2.3 From ced7761e69301a40944684fd295a04ea9e736c24 Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Mon, 1 Jul 2013 17:51:53 -0400 Subject: Shape calculations. do not quantize the coordinates. (Bug 168158) Fixed bugs: - https://launchpad.net/bugs/168158 (bzr r12399) --- src/livarot/Shape.cpp | 8 ++++---- src/livarot/Shape.h | 8 ++++---- src/livarot/ShapeMisc.cpp | 12 ++++++------ src/livarot/ShapeSweep.cpp | 8 ++++---- 4 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/livarot/Shape.cpp b/src/livarot/Shape.cpp index c29444a33..130b1b03a 100644 --- a/src/livarot/Shape.cpp +++ b/src/livarot/Shape.cpp @@ -334,8 +334,8 @@ Shape::AddPoint (const Geom::Point x) pData[n].nextLinkedPoint = -1; pData[n].askForWindingS = NULL; pData[n].askForWindingB = -1; - pData[n].rx[0] = Round(p.x[0]); - pData[n].rx[1] = Round(p.x[1]); + pData[n].rx[0] = /*Round*/ (p.x[0]); + pData[n].rx[1] = /*Round*/ (p.x[1]); } if (_has_voronoi_data) { @@ -2116,8 +2116,8 @@ void Shape::initialisePointData() pData[i].pending = 0; pData[i].edgeOnLeft = -1; pData[i].nextLinkedPoint = -1; - pData[i].rx[0] = Round(getPoint(i).x[0]); - pData[i].rx[1] = Round(getPoint(i).x[1]); + pData[i].rx[0] = /*Round*/ (getPoint(i).x[0]); + pData[i].rx[1] = /*Round*/ (getPoint(i).x[1]); } _point_data_initialised = true; diff --git a/src/livarot/Shape.h b/src/livarot/Shape.h index dcd172da2..b999b9dca 100644 --- a/src/livarot/Shape.h +++ b/src/livarot/Shape.h @@ -266,10 +266,10 @@ public: // be careful when using this function // the coordinate rounding function - inline static double Round(double x) - { - return ldexp(rint(ldexp(x, 5)), -5); - } +// inline static double Round(double x) +// { +// return ldexp(rint(ldexp(x, 5)), -5); +// } // 2 miscannellous variations on it, to scale to and back the rounding grid inline static double HalfRound(double x) diff --git a/src/livarot/ShapeMisc.cpp b/src/livarot/ShapeMisc.cpp index 6fd40790f..5bb8a25ef 100644 --- a/src/livarot/ShapeMisc.cpp +++ b/src/livarot/ShapeMisc.cpp @@ -49,8 +49,8 @@ Shape::ConvertToForme (Path * dest) for (int i = 0; i < numberOfPoints(); i++) { - pData[i].rx[0] = Round (getPoint(i).x[0]); - pData[i].rx[1] = Round (getPoint(i).x[1]); + pData[i].rx[0] = /*Round*/ (getPoint(i).x[0]); + pData[i].rx[1] = /*Round*/ (getPoint(i).x[1]); } for (int i = 0; i < numberOfEdges(); i++) { @@ -199,8 +199,8 @@ Shape::ConvertToForme (Path * dest, int nbP, Path * *orig, bool splitWhenForced) for (int i = 0; i < numberOfPoints(); i++) { - pData[i].rx[0] = Round (getPoint(i).x[0]); - pData[i].rx[1] = Round (getPoint(i).x[1]); + pData[i].rx[0] = /*Round*/ (getPoint(i).x[0]); + pData[i].rx[1] = /*Round*/ (getPoint(i).x[1]); } for (int i = 0; i < numberOfEdges(); i++) { @@ -352,8 +352,8 @@ Shape::ConvertToFormeNested (Path * dest, int nbP, Path * *orig, int wildPath,in for (int i = 0; i < numberOfPoints(); i++) { - pData[i].rx[0] = Round (getPoint(i).x[0]); - pData[i].rx[1] = Round (getPoint(i).x[1]); + pData[i].rx[0] = /*Round*/ (getPoint(i).x[0]); + pData[i].rx[1] = /*Round*/ (getPoint(i).x[1]); } for (int i = 0; i < numberOfEdges(); i++) { diff --git a/src/livarot/ShapeSweep.cpp b/src/livarot/ShapeSweep.cpp index c2fd83e31..ffe5a9d73 100644 --- a/src/livarot/ShapeSweep.cpp +++ b/src/livarot/ShapeSweep.cpp @@ -250,8 +250,8 @@ Shape::ConvertToShape (Shape * a, FillRule directed, bool invert) } Geom::Point rPtX; - rPtX[0]= Round (ptX[0]); - rPtX[1]= Round (ptX[1]); + rPtX[0]= /*Round*/ (ptX[0]); + rPtX[1]= /*Round*/ (ptX[1]); int lastPointNo = -1; lastPointNo = AddPoint (rPtX); pData[lastPointNo].rx = rPtX; @@ -1051,8 +1051,8 @@ Shape::Booleen (Shape * a, Shape * b, BooleanOp mod,int cutPathID) } Geom::Point rPtX; - rPtX[0]= Round (ptX[0]); - rPtX[1]= Round (ptX[1]); + rPtX[0]= /*Round*/ (ptX[0]); + rPtX[1]= /*Round*/ (ptX[1]); int lastPointNo = -1; lastPointNo = AddPoint (rPtX); pData[lastPointNo].rx = rPtX; -- cgit v1.2.3