diff options
| author | Liam P. White <inkscapebronyat-signgmaildotcom> | 2014-03-07 02:05:19 +0000 |
|---|---|---|
| committer | Liam P. White <inkscapebronyat-signgmaildotcom> | 2014-03-07 02:05:19 +0000 |
| commit | c3edf2beebfdf0cbb505d2accbddc4fec17dff7d (patch) | |
| tree | 2460d35a42dcf459353842f1f54782126524d1a1 | |
| parent | Fixed size of swatches widget (diff) | |
| download | inkscape-c3edf2beebfdf0cbb505d2accbddc4fec17dff7d.tar.gz inkscape-c3edf2beebfdf0cbb505d2accbddc4fec17dff7d.zip | |
Start cleanup for merge into trunk
(bzr r13090.1.20)
42 files changed, 61 insertions, 2515 deletions
diff --git a/configure.ac b/configure.ac index abfdb0348..0d32691f8 100644 --- a/configure.ac +++ b/configure.ac @@ -1100,7 +1100,6 @@ share/icons/application/256x256/Makefile share/keys/Makefile share/markers/Makefile share/palettes/Makefile -share/palettes/MLP/Makefile share/patterns/Makefile share/screens/Makefile share/symbols/Makefile diff --git a/share/palettes/MLP/All.gpl b/share/palettes/MLP/All.gpl deleted file mode 100644 index d408e0c10..000000000 --- a/share/palettes/MLP/All.gpl +++ /dev/null @@ -1,10 +0,0 @@ -GIMP Palette -Name: All -Columns: 0 -# -255 255 255 White - 0 0 0 Black -255 255 255 Teeth Fill -185 224 247 Teeth Stroke -197 52 116 Mouth -246 112 51 Tongue diff --git a/share/palettes/MLP/Applejack.gpl b/share/palettes/MLP/Applejack.gpl deleted file mode 100644 index 03845416f..000000000 --- a/share/palettes/MLP/Applejack.gpl +++ /dev/null @@ -1,18 +0,0 @@ -GIMP Palette -Name: Applejack -Columns: 0 -# -250 186 97 Body Fill -242 171 84 Body Shadow -233 113 53 Body Stroke -245 239 179 Mane Fill -229 215 97 Mane Stroke -234 64 63 Hair Band -203 154 91 Hat Fill -176 134 79 Hat Stroke - 96 189 80 Eye Grad Light - 38 119 22 Eye Grad Dark -125 217 103 Eye Accent -209 236 201 Eye Highlight -234 64 63 Cutie Mark Apple - 96 189 80 Cutie Mark Stem diff --git a/share/palettes/MLP/Daisy.gpl b/share/palettes/MLP/Daisy.gpl deleted file mode 100644 index deab92e56..000000000 --- a/share/palettes/MLP/Daisy.gpl +++ /dev/null @@ -1,16 +0,0 @@ -GIMP Palette -Name: Daisy -Columns: 0 -# -255 170 250 Body Fill -250 148 242 Body fill Shadow -242 104 219 Body stroke -203 244 140 Mane Fill -153 222 60 Mane Stroke - 58 183 109 Eye Grad Light - 39 95 76 Eye Grad Dark -111 229 144 Eye Accent -198 243 193 Eye Highlight -255 255 255 CM Fill -194 192 193 CM Stroke -255 255 1 CM Centre diff --git a/share/palettes/MLP/Fluttershy.gpl b/share/palettes/MLP/Fluttershy.gpl deleted file mode 100644 index cf525b5a9..000000000 --- a/share/palettes/MLP/Fluttershy.gpl +++ /dev/null @@ -1,15 +0,0 @@ -GIMP Palette -Name: Fluttershy -Columns: 0 -# -253 246 175 Body Fill -254 231 133 Body Shadow -234 212 99 Body Stroke -243 185 216 Mane Fill -235 129 180 Mane Stroke - 0 173 168 Eye Grad Light - 3 83 80 Eye Grad Dark -104 200 198 Eye Accent -158 216 213 Eye Highlight -104 200 198 Cutie Mark Body -243 185 216 Cutie Mark Wings diff --git a/share/palettes/MLP/Lily.gpl b/share/palettes/MLP/Lily.gpl deleted file mode 100644 index 3ec72fe16..000000000 --- a/share/palettes/MLP/Lily.gpl +++ /dev/null @@ -1,18 +0,0 @@ -GIMP Palette -Name: Lily -Columns: 0 -# -239 148 186 Body Fill -231 129 174 Body fill Shadow -211 90 138 Body stroke -247 225 141 Mane Fill -220 197 97 Mane Stroke -250 236 181 Mane Highlight -251 244 172 Eye Grad Light -246 181 65 Eye Grad Dark -235 227 103 Eye Accent -255 255 254 Eye Highlight -251 252 250 CM Fill -192 220 232 CM Stroke -246 212 68 CM stem -243 155 63 CM pollin diff --git a/share/palettes/MLP/Makefile.am b/share/palettes/MLP/Makefile.am deleted file mode 100644 index 00695478c..000000000 --- a/share/palettes/MLP/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ - -MLPdir = $(datadir)/inkscape/palettes/MLP - -MLP_DATA = \ - All.gpl \ - Applejack.gpl \ - Daisy.gpl \ - Fluttershy.gpl \ - Lily.gpl \ - Pinkie.gpl \ - Rainbow-Dash.gpl \ - Rarity.gpl \ - Roseluck.gpl \ - Silver-Rains.gpl \ - Spike.gpl \ - Twilight-Sparkle.gpl - -EXTRA_DIST = $(MLP_DATA) diff --git a/share/palettes/MLP/Pinkie.gpl b/share/palettes/MLP/Pinkie.gpl deleted file mode 100644 index ca7b46d4d..000000000 --- a/share/palettes/MLP/Pinkie.gpl +++ /dev/null @@ -1,15 +0,0 @@ -GIMP Palette -Name: Pinkie -Columns: 0 -# -249 184 210 Body Fill -237 157 194 Body Shadow -234 128 176 Body Stroke -240 67 140 Mane Fill -192 27 117 Mane Stroke -127 210 244 Eye Grad Light - 24 113 149 Eye Grad Dark -157 226 249 Eye Accent -223 249 254 Eye Highlight -255 247 173 Cutie Mark Yellow -123 212 249 Cutie Mark Blue diff --git a/share/palettes/MLP/Rainbow-Dash.gpl b/share/palettes/MLP/Rainbow-Dash.gpl deleted file mode 100644 index 7f398cf23..000000000 --- a/share/palettes/MLP/Rainbow-Dash.gpl +++ /dev/null @@ -1,23 +0,0 @@ -GIMP Palette -Name: Rainbow Dash -Columns: 0 -# -157 217 248 Body Fill -145 190 231 Body Shadow -106 170 221 Body Stroke -241 62 50 Mane Red -246 118 52 Mane Orange -245 235 126 Mane Yellow -122 194 64 Mane Green - 1 147 207 Mane Blue -102 46 138 Mane Purple - 1 147 207 Mane Stroke -198 0 111 Eye Grad Light - 87 0 48 Eye Grad Dark -214 74 153 Eye Accent -240 174 208 Eye Highlight -255 255 255 Cutie Mark Cloud Fill - 1 147 207 Cutie Mark Cloud Stroke -241 62 50 Cutie Mark Red -245 235 126 Cutie Mark Yellow - 1 147 207 Cutie Mark Blue diff --git a/share/palettes/MLP/Rarity.gpl b/share/palettes/MLP/Rarity.gpl deleted file mode 100644 index 9ecbd2bed..000000000 --- a/share/palettes/MLP/Rarity.gpl +++ /dev/null @@ -1,18 +0,0 @@ -GIMP Palette -Name: Rarity -Columns: 0 -# -240 242 243 Body Fill -226 228 230 Body Shadow -194 197 198 Body Stroke - 94 81 163 Mane Fill - 75 21 102 Mane Stroke -126 74 153 Mane Grad Light - 75 21 102 Mane Grad Dark - 55 119 190 Eye Grad Light - 26 70 106 Eye Grad Dark - 85 149 211 Eye Accent -122 172 236 Eye Highlight -188 228 247 Eyeshadow -115 212 253 Cutie Mark Fill - 44 143 183 Cutie Mark Stroke diff --git a/share/palettes/MLP/Roseluck.gpl b/share/palettes/MLP/Roseluck.gpl deleted file mode 100644 index 9ca484f94..000000000 --- a/share/palettes/MLP/Roseluck.gpl +++ /dev/null @@ -1,21 +0,0 @@ -GIMP Palette -Name: Roseluck -Columns: 0 -# -255 255 217 Body Fill -226 226 195 Body Fill Shadow -201 192 148 Body Stroke -187 42 87 Mane Fill -152 35 69 Mane Stroke -227 131 159 Mane Highlight -221 104 139 Mane Highlight Stroke -189 232 135 Eye Grad Light - 57 84 31 Eye Grad Dark -253 255 246 Eye Highlight -214 237 178 Eye Accent - 73 118 36 CM Stem -110 162 55 CM leaf stroke -151 205 99 CM leaf fill -211 54 102 CM Rose fill -152 35 69 CM rose Stroke -187 42 87 CM rose Shadow fill diff --git a/share/palettes/MLP/Silver-Rains.gpl b/share/palettes/MLP/Silver-Rains.gpl deleted file mode 100644 index 8affb0e7c..000000000 --- a/share/palettes/MLP/Silver-Rains.gpl +++ /dev/null @@ -1,17 +0,0 @@ -GIMP Palette -Name: Silver Rains -Columns: 0 -# -201 201 201 Body Fill -190 190 190 Body Shadow -168 168 168 Body Stroke -151 177 250 Mane Fill -120 142 202 Mane Streak - 74 100 174 Mane Stroke -118 244 192 Eye Grad Light - 2 198 161 Eye Grad Dark -180 252 226 Eye Accent -205 249 233 Eye Highlight -154 160 177 Cutie Mark Cloud -138 195 255 Cutie Mark Drops - 52 93 136 Cutie Mark Notes diff --git a/share/palettes/MLP/Spike.gpl b/share/palettes/MLP/Spike.gpl deleted file mode 100644 index 91b827a3b..000000000 --- a/share/palettes/MLP/Spike.gpl +++ /dev/null @@ -1,17 +0,0 @@ -GIMP Palette -Name: Spike -Columns: 0 -# -198 147 201 Body Fill -176 116 185 Body Shadow -153 95 160 Body Stroke -219 236 180 Body Green Fill -152 210 124 Body Green Stroke - 82 196 88 Spike Fill - 44 151 47 Spike Stroke -178 217 100 Ear Fill -226 236 139 Ear Stroke - 98 187 77 Eye Grad Light - 39 117 20 Eye Grad Dark -127 217 104 Eye Accent -203 240 196 Eye Highlight diff --git a/share/palettes/MLP/Twilight-Sparkle.gpl b/share/palettes/MLP/Twilight-Sparkle.gpl deleted file mode 100644 index 59acf5dac..000000000 --- a/share/palettes/MLP/Twilight-Sparkle.gpl +++ /dev/null @@ -1,17 +0,0 @@ -GIMP Palette -Name: Twilight Sparkle -Columns: 0 -# -212 164 232 Body Fill -174 133 193 Body Shadow -166 110 190 Body Stroke - 39 55 113 Mane Fill - 19 32 66 Mane Stroke - 98 46 134 Mane Highlight Purple -230 69 139 Mane Highlight Pink - 99 49 131 Eye Grad Light - 41 10 75 Eye Grad Dark -150 107 171 Eye Accent -206 183 215 Eye Highlight -230 69 139 Cutie Mark Pink -255 255 255 Cutie Mark White diff --git a/share/palettes/Makefile.am b/share/palettes/Makefile.am index 91e72ea84..de11f67be 100644 --- a/share/palettes/Makefile.am +++ b/share/palettes/Makefile.am @@ -1,4 +1,3 @@ -SUBDIRS = MLP palettesdir = $(datadir)/inkscape/palettes diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 17b229352..2ffff153c 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -47,7 +47,7 @@ #include "live_effects/lpe-extrude.h" #include "live_effects/lpe-powerstroke.h" #include "live_effects/lpe-clone-original.h" -#include "live_effects/lpe-attach-path.h" +//#include "live_effects/lpe-attach-path.h" #include "live_effects/lpe-fill-between-strokes.h" #include "live_effects/lpe-fill-between-many.h" #include "live_effects/lpe-ellipse_5pts.h" @@ -130,7 +130,7 @@ const Util::EnumData<EffectType> LPETypeData[] = { {POWERSTROKE, N_("Power stroke"), "powerstroke"}, {CLONE_ORIGINAL, N_("Clone original path"), "clone_original"}, /* Ponyscape */ - {ATTACH_PATH, N_("Attach path"), "attach_path"}, +// {ATTACH_PATH, N_("Attach path"), "attach_path"}, {FILL_BETWEEN_STROKES, N_("Fill between strokes"), "fill_between_strokes"}, {FILL_BETWEEN_MANY, N_("Fill between many"), "fill_between_many"}, {ELLIPSE_5PTS, N_("Ellipse by 5 points"), "ellipse_5pts"}, @@ -258,9 +258,9 @@ Effect::New(EffectType lpenr, LivePathEffectObject *lpeobj) case CLONE_ORIGINAL: neweffect = static_cast<Effect*> ( new LPECloneOriginal(lpeobj) ); break; - case ATTACH_PATH: + /*case ATTACH_PATH: neweffect = static_cast<Effect*> ( new LPEAttachPath(lpeobj) ); - break; + break;*/ case FILL_BETWEEN_STROKES: neweffect = static_cast<Effect*> ( new LPEFillBetweenStrokes(lpeobj) ); break; diff --git a/src/live_effects/lpe-fill-between-many.cpp b/src/live_effects/lpe-fill-between-many.cpp index 00cc1fed5..7cf354044 100644 --- a/src/live_effects/lpe-fill-between-many.cpp +++ b/src/live_effects/lpe-fill-between-many.cpp @@ -4,7 +4,6 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include <glibmm/i18n.h> #include <gtkmm/box.h> #include "live_effects/lpe-fill-between-many.h" @@ -16,6 +15,8 @@ #include "sp-text.h" #include "2geom/bezier-curve.h" +#include <glibmm/i18n.h> + namespace Inkscape { namespace LivePathEffect { diff --git a/src/live_effects/lpe-jointype.cpp b/src/live_effects/lpe-jointype.cpp index 97c0a1b8a..93e645783 100644 --- a/src/live_effects/lpe-jointype.cpp +++ b/src/live_effects/lpe-jointype.cpp @@ -12,6 +12,9 @@ #include <math.h> +#include "live_effects/parameter/enum.h" +#include "live_effects/pathoutlineprovider.h" + #include "sp-shape.h" #include "style.h" #include "xml/repr.h" @@ -20,11 +23,9 @@ #include "desktop-style.h" #include "svg/css-ostringstream.h" #include "display/curve.h" -#include "live_effects/parameter/enum.h" #include <2geom/path.h> #include <2geom/svg-elliptical-arc.h> -#include "live_effects/pathoutlineprovider.h" #include "lpe-jointype.h" diff --git a/src/live_effects/parameter/originalpatharray.cpp b/src/live_effects/parameter/originalpatharray.cpp index 29e4c409c..ed47db28d 100644 --- a/src/live_effects/parameter/originalpatharray.cpp +++ b/src/live_effects/parameter/originalpatharray.cpp @@ -4,6 +4,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 <glibmm/threads.h> +#endif + #include "live_effects/parameter/originalpatharray.h" #include <gtkmm/widget.h> @@ -89,9 +97,11 @@ OriginalPathArrayParam::OriginalPathArrayParam( const Glib::ustring& label, _toggle_renderer->signal_toggled().connect(sigc::mem_fun(*this, &OriginalPathArrayParam::on_reverse_toggled)); col->add_attribute(_toggle_renderer->property_active(), _model->_colReverse); + //quick little hack -- new versions of gtk did not give the item enough space + _scroller.property_height_request() = 120; _scroller.add(_tree); _scroller.set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC ); - _scroller.set_shadow_type(Gtk::SHADOW_IN); + //_scroller.set_shadow_type(Gtk::SHADOW_IN); oncanvas_editable = true; diff --git a/src/live_effects/parameter/powerstrokepointarray.cpp b/src/live_effects/parameter/powerstrokepointarray.cpp index ac0000b1a..7fa837689 100644 --- a/src/live_effects/parameter/powerstrokepointarray.cpp +++ b/src/live_effects/parameter/powerstrokepointarray.cpp @@ -4,8 +4,6 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include <glibmm/i18n.h> - #include "ui/dialog/lpe-powerstroke-properties.h" #include "live_effects/parameter/powerstrokepointarray.h" @@ -22,6 +20,8 @@ #include "desktop.h" #include "live_effects/lpeobject.h" +#include <glibmm/i18n.h> + namespace Inkscape { namespace LivePathEffect { @@ -145,7 +145,7 @@ public: virtual Geom::Point knot_get() const; virtual void knot_click(guint state); - /** Checks whether the index falls within the size of the parameter's vector / + // Checks whether the index falls within the size of the parameter's vector bool valid_index(unsigned int index) const { return (_pparam->_vector.size() > index); }; diff --git a/src/live_effects/parameter/transformedpoint.cpp b/src/live_effects/parameter/transformedpoint.cpp index f5b01e267..0d03432c3 100644 --- a/src/live_effects/parameter/transformedpoint.cpp +++ b/src/live_effects/parameter/transformedpoint.cpp @@ -4,8 +4,6 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include <glibmm/i18n.h> - #include "ui/widget/registered-widget.h" #include "live_effects/parameter/transformedpoint.h" #include "sp-lpe-item.h" @@ -17,6 +15,8 @@ #include "desktop.h" #include "verbs.h" +#include <glibmm/i18n.h> + namespace Inkscape { namespace LivePathEffect { diff --git a/src/sp-gradient-fns.h b/src/sp-gradient-fns.h deleted file mode 100644 index e57877256..000000000 --- a/src/sp-gradient-fns.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef SEEN_SP_GRADIENT_FNS_H -#define SEEN_SP_GRADIENT_FNS_H - -/** \file - * Macros and fn declarations related to gradients. - */ - -#include <glib.h> -#include <glib-object.h> -#include <2geom/forward.h> -#include "sp-gradient-spread.h" -#include "sp-gradient-units.h" - -class SPGradient; -class SPMeshGradient; - -SPGradientSpread sp_gradient_get_spread (SPGradient *gradient); - -/* Gradient repr methods */ -void sp_gradient_repr_write_vector(SPGradient *gr); -void sp_gradient_repr_clear_vector(SPGradient *gr); - -void sp_meshgradient_repr_write(SPMeshGradient *mg); - -cairo_pattern_t *sp_gradient_create_preview_pattern(SPGradient *gradient, double width); - -/** Transforms to/from gradient position space in given environment */ -Geom::Affine sp_gradient_get_g2d_matrix(SPGradient const *gr, Geom::Affine const &ctm, - Geom::Rect const &bbox); -Geom::Affine sp_gradient_get_gs2d_matrix(SPGradient const *gr, Geom::Affine const &ctm, - Geom::Rect const &bbox); -void sp_gradient_set_gs2d_matrix(SPGradient *gr, Geom::Affine const &ctm, Geom::Rect const &bbox, - Geom::Affine const &gs2d); - - -#endif /* !SEEN_SP_GRADIENT_FNS_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 : diff --git a/src/sp-tag-use-reference.cpp b/src/sp-tag-use-reference.cpp deleted file mode 100644 index 8e48c0285..000000000 --- a/src/sp-tag-use-reference.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/* - * The reference corresponding to href of <inkscape:tagref> element. - * - * Copyright (C) Theodore Janeczko 2012 <flutterguy317@gmail.com> - * - * Released under GNU GPL, read the file 'COPYING' for more information. - */ - -#include <cstring> -#include <string> -#include <string.h> - -#include "enums.h" -#include "sp-tag-use-reference.h" - -#include "display/curve.h" -#include "livarot/Path.h" -#include "preferences.h" -#include "sp-shape.h" -#include "sp-text.h" -#include "uri.h" - - - -bool SPTagUseReference::_acceptObject(SPObject * const obj) const -{ - if (SP_IS_ITEM(obj)) { - SPObject * const owner = getOwner(); - // Refuse references to us or to an ancestor. - for ( SPObject *iter = owner ; iter ; iter = iter->parent ) { - if ( iter == obj ) { - return false; - } - } - return true; - } else { - return false; - } -} - - -static void sp_usepath_href_changed(SPObject *old_ref, SPObject *ref, SPTagUsePath *offset); -static void sp_usepath_delete_self(SPObject *deleted, SPTagUsePath *offset); - -SPTagUsePath::SPTagUsePath(SPObject* i_owner):SPTagUseReference(i_owner) -{ - owner=i_owner; - originalPath = NULL; - sourceDirty=false; - sourceHref = NULL; - sourceRepr = NULL; - sourceObject = NULL; - _changed_connection = changedSignal().connect(sigc::bind(sigc::ptr_fun(sp_usepath_href_changed), this)); // listening to myself, this should be virtual instead - - user_unlink = NULL; -} - -SPTagUsePath::~SPTagUsePath(void) -{ - delete originalPath; - originalPath = NULL; - - _changed_connection.disconnect(); // to do before unlinking - - quit_listening(); - unlink(); -} - -void -SPTagUsePath::link(char *to) -{ - if ( to == NULL ) { - quit_listening(); - unlink(); - } else { - if ( !sourceHref || ( strcmp(to, sourceHref) != 0 ) ) { - g_free(sourceHref); - sourceHref = g_strdup(to); - try { - attach(Inkscape::URI(to)); - } catch (Inkscape::BadURIException &e) { - /* TODO: Proper error handling as per - * http://www.w3.org/TR/SVG11/implnote.html#ErrorProcessing. - */ - g_warning("%s", e.what()); - detach(); - } - } - } -} - -void -SPTagUsePath::unlink(void) -{ - g_free(sourceHref); - sourceHref = NULL; - detach(); -} - -void -SPTagUsePath::start_listening(SPObject* to) -{ - if ( to == NULL ) { - return; - } - sourceObject = to; - sourceRepr = to->getRepr(); - _delete_connection = to->connectDelete(sigc::bind(sigc::ptr_fun(&sp_usepath_delete_self), this)); -} - -void -SPTagUsePath::quit_listening(void) -{ - if ( sourceObject == NULL ) { - return; - } - _delete_connection.disconnect(); - sourceRepr = NULL; - sourceObject = NULL; -} - -static void -sp_usepath_href_changed(SPObject */*old_ref*/, SPObject */*ref*/, SPTagUsePath *offset) -{ - offset->quit_listening(); - SPItem *refobj = offset->getObject(); - if ( refobj ) { - offset->start_listening(refobj); - } -} - -static void -sp_usepath_delete_self(SPObject */*deleted*/, SPTagUsePath *offset) -{ - offset->owner->deleteObject(); -} - -/* - 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 : diff --git a/src/sp-tag-use-reference.h b/src/sp-tag-use-reference.h deleted file mode 100644 index 039d2fd7d..000000000 --- a/src/sp-tag-use-reference.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef SEEN_SP_TAG_USE_REFERENCE_H -#define SEEN_SP_TAG_USE_REFERENCE_H - -/* - * The reference corresponding to href of <inkscape:tagref> element. - * - * Copyright (C) Theodore Janeczko 2012 <flutterguy317@gmail.com> - * - * Released under GNU GPL, read the file 'COPYING' for more information. - */ - -#include "sp-object.h" -#include "sp-item.h" -#include <uri-references.h> -#include <stddef.h> -#include <sigc++/sigc++.h> - -class Path; - -namespace Inkscape { -namespace XML { - struct Node; -} -} - - -class SPTagUseReference : public Inkscape::URIReference { -public: - SPTagUseReference(SPObject *owner) : URIReference(owner) {} - - SPItem *getObject() const { - return static_cast<SPItem *>(URIReference::getObject()); - } - -protected: - virtual bool _acceptObject(SPObject * const obj) const; - -}; - - -class SPTagUsePath : public SPTagUseReference { -public: - Path *originalPath; - bool sourceDirty; - - SPObject *owner; - gchar *sourceHref; - Inkscape::XML::Node *sourceRepr; - SPObject *sourceObject; - - sigc::connection _delete_connection; - sigc::connection _changed_connection; - - SPTagUsePath(SPObject* i_owner); - ~SPTagUsePath(void); - - void link(char* to); - void unlink(void); - void start_listening(SPObject* to); - void quit_listening(void); - void refresh_source(void); - - void (*user_unlink) (SPObject *user); -}; - -#endif /* !SEEN_SP_USE_REFERENCE_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 : diff --git a/src/sp-tag-use.cpp b/src/sp-tag-use.cpp deleted file mode 100644 index 4c5171bbb..000000000 --- a/src/sp-tag-use.cpp +++ /dev/null @@ -1,281 +0,0 @@ -/* - * SVG <inkscape:tagref> implementation - * - * Authors: - * Theodore Janeczko - * - * Copyright (C) Theodore Janeczko 2012 <flutterguy317@gmail.com> - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <cstring> -#include <string> - -#include <glibmm/i18n.h> -#include "display/drawing-group.h" -#include "attributes.h" -#include "document.h" -#include "sp-object-repr.h" -#include "uri.h" -#include "xml/repr.h" -#include "preferences.h" -#include "style.h" -#include "sp-symbol.h" -#include "sp-tag-use.h" -#include "sp-tag-use-reference.h" - -/* fixme: */ - -static void sp_tag_use_class_init(SPTagUseClass *classname); -static void sp_tag_use_init(SPTagUse *use); -static void sp_tag_use_finalize(GObject *obj); - -static void sp_tag_use_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); -static void sp_tag_use_release(SPObject *object); -static void sp_tag_use_set(SPObject *object, unsigned key, gchar const *value); -static Inkscape::XML::Node *sp_tag_use_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); -static void sp_tag_use_update(SPObject *object, SPCtx *ctx, guint flags); - -static void sp_tag_use_href_changed(SPObject *old_ref, SPObject *ref, SPTagUse *use); - -static SPObjectClass *parent_class; - - -GType -sp_tag_use_get_type(void) -{ - static GType use_type = 0; - if (!use_type) { - GTypeInfo use_info = { - sizeof(SPTagUseClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) sp_tag_use_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof(SPTagUse), - 16, /* n_preallocs */ - (GInstanceInitFunc) sp_tag_use_init, - NULL, /* value_table */ - }; - use_type = g_type_register_static(SP_TYPE_OBJECT, "SPTagUse", &use_info, (GTypeFlags)0); - } - return use_type; -} - -static void -sp_tag_use_class_init(SPTagUseClass *classname) -{ - GObjectClass *gobject_class = (GObjectClass *) classname; - SPObjectClass *sp_object_class = (SPObjectClass *) classname; - - parent_class = (SPObjectClass*)g_type_class_peek_parent(classname); - - gobject_class->finalize = sp_tag_use_finalize; - - sp_object_class->build = sp_tag_use_build; - sp_object_class->release = sp_tag_use_release; - sp_object_class->set = sp_tag_use_set; - sp_object_class->write = sp_tag_use_write; - sp_object_class->update = sp_tag_use_update; -} - -static void -sp_tag_use_init(SPTagUse *use) -{ - use->href = NULL; - - new (&use->_changed_connection) sigc::connection(); - - use->ref = new SPTagUseReference(use); - - use->_changed_connection = use->ref->changedSignal().connect(sigc::bind(sigc::ptr_fun(sp_tag_use_href_changed), use)); -} - -static void -sp_tag_use_finalize(GObject *obj) -{ - SPTagUse *use = reinterpret_cast<SPTagUse *>(obj); - - if (use->child) { - use->detach(use->child); - use->child = NULL; - } - - use->ref->detach(); - delete use->ref; - use->ref = 0; - - use->_changed_connection.~connection(); - -} - -static void -sp_tag_use_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) -{ - if (((SPObjectClass *) parent_class)->build) { - (* ((SPObjectClass *) parent_class)->build)(object, document, repr); - } - - object->readAttr( "xlink:href" ); - - // We don't need to create child here: - // reading xlink:href will attach ref, and that will cause the changed signal to be emitted, - // which will call sp_tag_use_href_changed, and that will take care of the child -} - -static void -sp_tag_use_release(SPObject *object) -{ - SPTagUse *use = SP_TAG_USE(object); - - if (use->child) { - object->detach(use->child); - use->child = NULL; - } - - use->_changed_connection.disconnect(); - - g_free(use->href); - use->href = NULL; - - use->ref->detach(); - - if (((SPObjectClass *) parent_class)->release) { - ((SPObjectClass *) parent_class)->release(object); - } -} - -static void -sp_tag_use_set(SPObject *object, unsigned key, gchar const *value) -{ - SPTagUse *use = SP_TAG_USE(object); - - switch (key) { - case SP_ATTR_XLINK_HREF: { - if ( value && use->href && ( strcmp(value, use->href) == 0 ) ) { - /* No change, do nothing. */ - } else { - g_free(use->href); - use->href = NULL; - if (value) { - // First, set the href field, because sp_tag_use_href_changed will need it. - use->href = g_strdup(value); - - // Now do the attaching, which emits the changed signal. - try { - use->ref->attach(Inkscape::URI(value)); - } catch (Inkscape::BadURIException &e) { - g_warning("%s", e.what()); - use->ref->detach(); - } - } else { - use->ref->detach(); - } - } - break; - } - - default: - if (((SPObjectClass *) parent_class)->set) { - ((SPObjectClass *) parent_class)->set(object, key, value); - } - break; - } -} - -static Inkscape::XML::Node * -sp_tag_use_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) -{ - SPTagUse *use = SP_TAG_USE(object); - - if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) { - repr = xml_doc->createElement("inkscape:tagref"); - } - - if (((SPObjectClass *) (parent_class))->write) { - ((SPObjectClass *) (parent_class))->write(object, xml_doc, repr, flags); - } - - if (use->ref->getURI()) { - gchar *uri_string = use->ref->getURI()->toString(); - repr->setAttribute("xlink:href", uri_string); - g_free(uri_string); - } - - return repr; -} - -/** - * Returns the ultimate original of a SPTagUse (i.e. the first object in the chain of its originals - * which is not an SPTagUse). If no original is found, NULL is returned (it is the responsibility - * of the caller to make sure that this is handled correctly). - * - * Note that the returned is the clone object, i.e. the child of an SPTagUse (of the argument one for - * the trivial case) and not the "true original". - */ -SPItem * -sp_tag_use_root(SPTagUse *use) -{ - SPObject *orig = use->child; - while (orig && SP_IS_TAG_USE(orig)) { - orig = SP_TAG_USE(orig)->child; - } - if (!orig || !SP_IS_ITEM(orig)) - return NULL; - return SP_ITEM(orig); -} - -static void -sp_tag_use_href_changed(SPObject */*old_ref*/, SPObject */*ref*/, SPTagUse *use) -{ - if (use->href) { - SPItem *refobj = use->ref->getObject(); - if (refobj) { - Inkscape::XML::Node *childrepr = refobj->getRepr(); - GType type = sp_repr_type_lookup(childrepr); - g_return_if_fail(type > G_TYPE_NONE); - if (g_type_is_a(type, SP_TYPE_ITEM)) { - use->child = (SPObject*) g_object_new(type, 0); - use->attach(use->child, use->lastChild()); - sp_object_unref(use->child, use); - (use->child)->invoke_build(use->document, childrepr, TRUE); - - } - } - } -} - -static void -sp_tag_use_update(SPObject *object, SPCtx *ctx, unsigned flags) -{ - if (((SPObjectClass *) (parent_class))->update) - ((SPObjectClass *) (parent_class))->update(object, ctx, flags); -} - -SPItem *sp_tag_use_get_original(SPTagUse *use) -{ - SPItem *ref = NULL; - if (use){ - if (use->ref){ - ref = use->ref->getObject(); - } - } - return ref; -} - -/* - 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 : diff --git a/src/sp-tag-use.h b/src/sp-tag-use.h deleted file mode 100644 index 6e068fc21..000000000 --- a/src/sp-tag-use.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef __SP_TAG_USE_H__ -#define __SP_TAG_USE_H__ - -/* - * SVG <inkscape:tagref> implementation - * - * Authors: - * Theodore Janeczko - * - * Copyright (C) Theodore Janeczko 2012 <flutterguy317@gmail.com> - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#include <stddef.h> -#include <sigc++/sigc++.h> -#include "svg/svg-length.h" -#include "sp-object.h" - - -#define SP_TYPE_TAG_USE (sp_tag_use_get_type ()) -#define SP_TAG_USE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_TAG_USE, SPTagUse)) -#define SP_TAG_USE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_TAG_USE, SPTagUseClass)) -#define SP_IS_TAG_USE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_TAG_USE)) -#define SP_IS_TAG_USE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_TAG_USE)) - -class SPTagUse; -class SPTagUseClass; -class SPTagUseReference; - -struct SPTagUse : public SPObject { - // item built from the original's repr (the visible clone) - // relative to the SPUse itself, it is treated as a child, similar to a grouped item relative to its group - SPObject *child; - - gchar *href; - - // the reference to the original object - SPTagUseReference *ref; - sigc::connection _changed_connection; -}; - -struct SPTagUseClass { - SPObjectClass parent_class; -}; - -GType sp_tag_use_get_type (void); - -SPItem *sp_tag_use_unlink (SPTagUse *use); -SPItem *sp_tag_use_get_original (SPTagUse *use); - -SPItem *sp_tag_use_root(SPTagUse *use); -#endif diff --git a/src/sp-tag.cpp b/src/sp-tag.cpp deleted file mode 100644 index eef55d628..000000000 --- a/src/sp-tag.cpp +++ /dev/null @@ -1,240 +0,0 @@ -/** \file - * SVG <inkscape:tag> implementation - * - * Authors: - * Theodore Janeczko - * - * Copyright (C) Theodore Janeczko 2012 <flutterguy317@gmail.com> - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "attributes.h" -#include "sp-tag.h" -#include "xml/repr.h" -#include <cstring> - -#define DEBUG_TAG -#ifdef DEBUG_TAG -# define debug(f, a...) { g_print("%s(%d) %s:", \ - __FILE__,__LINE__,__FUNCTION__); \ - g_print(f, ## a); \ - g_print("\n"); \ - } -#else -# define debug(f, a...) /**/ -#endif - -/* Tag base class */ - -static void sp_tag_class_init(SPTagClass *klass); -static void sp_tag_init(SPTag *tag); - -static void sp_tag_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); -static void sp_tag_release(SPObject *object); -static void sp_tag_set(SPObject *object, unsigned int key, gchar const *value); -static void sp_tag_update(SPObject *object, SPCtx *ctx, guint flags); -static Inkscape::XML::Node *sp_tag_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); - -static SPObjectClass *tag_parent_class; - -GType -sp_tag_get_type() -{ - static GType tag_type = 0; - - if (!tag_type) { - GTypeInfo tag_info = { - sizeof(SPTagClass), - NULL, NULL, - (GClassInitFunc) sp_tag_class_init, - NULL, NULL, - sizeof(SPTag), - 16, - (GInstanceInitFunc) sp_tag_init, - NULL, /* value_table */ - }; - tag_type = g_type_register_static(SP_TYPE_OBJECT, "SPTag", &tag_info, (GTypeFlags)0); - } - return tag_type; -} - -static void -sp_tag_class_init(SPTagClass *klass) -{ - //GObjectClass *gobject_class = (GObjectClass *)klass; - SPObjectClass *sp_object_class = (SPObjectClass *)klass; - - tag_parent_class = (SPObjectClass*)g_type_class_peek_parent(klass); - - sp_object_class->build = sp_tag_build; - sp_object_class->release = sp_tag_release; - sp_object_class->write = sp_tag_write; - sp_object_class->set = sp_tag_set; - sp_object_class->update = sp_tag_update; -} - -static void -sp_tag_init(SPTag *tag) -{ -} - -/* - * Move this SPItem into or after another SPItem in the doc - * \param target - the SPItem to move into or after - * \param intoafter - move to after the target (false), move inside (sublayer) of the target (true) - */ -void SPTag::moveTo(SPObject *target, gboolean intoafter) { - - Inkscape::XML::Node *target_ref = ( target ? target->getRepr() : NULL ); - Inkscape::XML::Node *our_ref = getRepr(); - gboolean first = FALSE; - - if (target_ref == our_ref) { - // Move to ourself ignore - return; - } - - if (!target_ref) { - // Assume move to the "first" in the top node, find the top node - target_ref = our_ref; - while (target_ref->parent() != target_ref->root()) { - target_ref = target_ref->parent(); - } - first = TRUE; - } - - if (intoafter) { - // Move this inside of the target at the end - our_ref->parent()->removeChild(our_ref); - target_ref->addChild(our_ref, NULL); - } else if (target_ref->parent() != our_ref->parent()) { - // Change in parent, need to remove and add - our_ref->parent()->removeChild(our_ref); - target_ref->parent()->addChild(our_ref, target_ref); - } else if (!first) { - // Same parent, just move - our_ref->parent()->changeOrder(our_ref, target_ref); - } -} - -/** - * Reads the Inkscape::XML::Node, and initializes SPTag variables. For this to get called, - * our name must be associated with a repr via "sp_object_type_register". Best done through - * sp-object-repr.cpp's repr_name_entries array. - */ -static void -sp_tag_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) -{ - object->readAttr( "inkscape:expanded" ); - - if (((SPObjectClass *) tag_parent_class)->build) { - ((SPObjectClass *) tag_parent_class)->build(object, document, repr); - } -} - -/** - * Drops any allocated memory. - */ -static void -sp_tag_release(SPObject *object) -{ - /* deal with our children and our selves here */ - - if (((SPObjectClass *) tag_parent_class)->release) - ((SPObjectClass *) tag_parent_class)->release(object); -} - -/** - * Sets a specific value in the SPTag. - */ -static void -sp_tag_set(SPObject *object, unsigned int key, gchar const *value) -{ - SPTag *tag = SP_TAG(object); - - switch (key) - { - case SP_ATTR_INKSCAPE_EXPANDED: - if ( value && !strcmp(value, "true") ) { - tag->setExpanded(true); - } - break; - default: - if (((SPObjectClass *) tag_parent_class)->set) { - ((SPObjectClass *) tag_parent_class)->set(object, key, value); - } - break; - } -} - -void SPTag::setExpanded(bool isexpanded) { - if ( _expanded != isexpanded ){ - _expanded = isexpanded; - } -} - -/** - * Receives update notifications. - */ -static void -sp_tag_update(SPObject *object, SPCtx *ctx, guint flags) -{ - //SPTag *tag = SP_TAG(object); - - if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG | - SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) { - - /* do something to trigger redisplay, updates? */ - - } - - if (((SPObjectClass *) tag_parent_class)->update) { - ((SPObjectClass *) tag_parent_class)->update(object, ctx, flags); - } -} - -/** - * Writes its settings to an incoming repr object, if any. - */ -static Inkscape::XML::Node * -sp_tag_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags) -{ - SPTag *tag = SP_TAG(object); - - if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) { - repr = doc->createElement("inkscape:tag"); - } - - // Inkscape-only object, not copied during an "plain SVG" dump: - if (flags & SP_OBJECT_WRITE_EXT) { - - if (tag->_expanded) { - repr->setAttribute("inkscape:expanded", "true"); - } else { - repr->setAttribute("inkscape:expanded", NULL); - } - } - - if (((SPObjectClass *) tag_parent_class)->write) { - ((SPObjectClass *) tag_parent_class)->write(object, doc, repr, flags); - } - - return repr; -} - - -/* - 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 : diff --git a/src/sp-tag.h b/src/sp-tag.h deleted file mode 100644 index c5eec785a..000000000 --- a/src/sp-tag.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef SP_TAG_H_SEEN -#define SP_TAG_H_SEEN - -/** \file - * SVG <inkscape:tag> implementation - * - * Authors: - * Theodore Janeczko - * - * Copyright (C) Theodore Janeczko 2012 <flutterguy317@gmail.com> - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#include "sp-object.h" - -/* Skeleton base class */ - -#define SP_TYPE_TAG (sp_tag_get_type()) -#define SP_TAG(o) (G_TYPE_CHECK_INSTANCE_CAST((o), SP_TYPE_TAG, SPTag)) -#define SP_IS_TAG(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), SP_TYPE_TAG)) - -class SPTag; -class SPTagClass; - -class SPTag : public SPObject { -public: - bool _expanded; - - bool expanded() const { return _expanded; } - void setExpanded(bool isexpanded); - - void moveTo(SPObject *target, gboolean intoafter); - -}; - -struct SPTagClass { - SPObjectClass parent_class; -}; - -GType sp_tag_get_type(); - - -#endif /* !SP_SKELETON_H_SEEN */ - -/* - 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 : diff --git a/src/ui/dialog/color-item.cpp b/src/ui/dialog/color-item.cpp index 6eece0c17..a1951ec48 100644 --- a/src/ui/dialog/color-item.cpp +++ b/src/ui/dialog/color-item.cpp @@ -12,7 +12,6 @@ */ #include <errno.h> -#include <glibmm/i18n.h> #include <gtkmm/label.h> #include <cairo.h> #include <gtk/gtk.h> @@ -40,6 +39,7 @@ #include "color.h" // for SP_RGBA32_U_COMPOSE +#include <glibmm/i18n.h> namespace Inkscape { namespace UI { diff --git a/src/ui/dialog/dialog-manager.cpp b/src/ui/dialog/dialog-manager.cpp index 1fddbf007..ddf41e0c8 100644 --- a/src/ui/dialog/dialog-manager.cpp +++ b/src/ui/dialog/dialog-manager.cpp @@ -111,7 +111,7 @@ DialogManager::DialogManager() { registerFactory("InkscapePreferences", &create<InkscapePreferences, FloatingBehavior>); registerFactory("LayersPanel", &create<LayersPanel, FloatingBehavior>); registerFactory("ObjectsPanel", &create<ObjectsPanel, FloatingBehavior>); - //registerFactory("TagsPanel", &create<TagsPanel, FloatingBehavior>); +// registerFactory("TagsPanel", &create<TagsPanel, FloatingBehavior>); registerFactory("LivePathEffect", &create<LivePathEffectEditor, FloatingBehavior>); registerFactory("Memory", &create<Memory, FloatingBehavior>); registerFactory("Messages", &create<Messages, FloatingBehavior>); @@ -147,7 +147,7 @@ DialogManager::DialogManager() { registerFactory("InkscapePreferences", &create<InkscapePreferences, DockBehavior>); registerFactory("LayersPanel", &create<LayersPanel, DockBehavior>); registerFactory("ObjectsPanel", &create<ObjectsPanel, DockBehavior>); - //registerFactory("TagsPanel", &create<TagsPanel, FloatingBehavior>); +// registerFactory("TagsPanel", &create<TagsPanel, DockBehavior>); registerFactory("LivePathEffect", &create<LivePathEffectEditor, DockBehavior>); registerFactory("Memory", &create<Memory, DockBehavior>); registerFactory("Messages", &create<Messages, DockBehavior>); diff --git a/src/ui/dialog/lpe-powerstroke-properties.cpp b/src/ui/dialog/lpe-powerstroke-properties.cpp index cef6f494e..c34351511 100644 --- a/src/ui/dialog/lpe-powerstroke-properties.cpp +++ b/src/ui/dialog/lpe-powerstroke-properties.cpp @@ -13,6 +13,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 <glibmm/threads.h> +#endif + #include "lpe-powerstroke-properties.h" #include <boost/lexical_cast.hpp> #include <gtkmm/stock.h> diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp index c3889db46..34885a971 100644 --- a/src/ui/dialog/swatches.cpp +++ b/src/ui/dialog/swatches.cpp @@ -43,7 +43,6 @@ #include "path-prefix.h" #include "preferences.h" #include "sp-item.h" -#include "sp-gradient-fns.h" #include "sp-gradient.h" #include "sp-gradient-vector.h" #include "style.h" diff --git a/src/ui/dialog/tags.cpp b/src/ui/dialog/tags.cpp deleted file mode 100644 index 116f9eb0b..000000000 --- a/src/ui/dialog/tags.cpp +++ /dev/null @@ -1,1182 +0,0 @@ -/* - * A simple panel for tags - * - * Authors: - * Theodore Janeczko - * - * Copyright (C) Theodore Janeczko 2012 <flutterguy317@gmail.com> - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include "tags.h" -#include <gtkmm/widget.h> -#include <gtkmm/icontheme.h> -#include <gtkmm/imagemenuitem.h> -#include <gtkmm/separatormenuitem.h> - -#include <glibmm/i18n.h> - -#include "desktop.h" -#include "desktop-style.h" -#include "document.h" -#include "document-undo.h" -#include "helper/action.h" -#include "inkscape.h" -#include "layer-fns.h" -#include "layer-manager.h" -#include "preferences.h" -#include "sp-item.h" -#include "sp-object.h" -#include "sp-shape.h" -#include "svg/css-ostringstream.h" -#include "ui/icon-names.h" -#include "ui/widget/layertypeicon.h" -#include "ui/widget/addtoicon.h" -#include "verbs.h" -#include "widgets/icon.h" -#include "xml/node.h" -#include "xml/node-observer.h" -#include "xml/repr.h" -#include "sp-root.h" -//#include "event-context.h" -#include "selection.h" -#include "dialogs/dialog-events.h" -#include "widgets/sp-color-notebook.h" -#include "style.h" -#include "filter-chemistry.h" -#include "filters/blend.h" -#include "filters/gaussian-blur.h" -#include "sp-clippath.h" -#include "sp-mask.h" -#include "sp-tag.h" -#include "sp-defs.h" -#include "sp-tag-use.h" -#include "sp-tag-use-reference.h" - -//#define DUMP_LAYERS 1 - -namespace Inkscape { -namespace UI { -namespace Dialog { - -using Inkscape::XML::Node; - -TagsPanel& TagsPanel::getInstance() -{ - return *new TagsPanel(); -} - -enum { - COL_ADD = 1 -}; - -enum { - BUTTON_NEW = 0, - BUTTON_TOP, - BUTTON_BOTTOM, - BUTTON_UP, - BUTTON_DOWN, - BUTTON_DELETE, - DRAGNDROP -}; - -class TagsPanel::ObjectWatcher : public Inkscape::XML::NodeObserver { -public: - ObjectWatcher(TagsPanel* pnl, SPObject* obj, Inkscape::XML::Node * repr) : - _pnl(pnl), - _obj(obj), - _repr(repr), - _labelAttr(g_quark_from_string("inkscape:label")) - {} - - ObjectWatcher(TagsPanel* pnl, SPObject* obj) : - _pnl(pnl), - _obj(obj), - _repr(obj->getRepr()), - _labelAttr(g_quark_from_string("inkscape:label")) - {} - - virtual void notifyChildAdded( Node &/*node*/, Node &/*child*/, Node */*prev*/ ) - { - if ( _pnl && _obj ) { - _pnl->_objectsChanged( _obj ); - } - } - virtual void notifyChildRemoved( Node &/*node*/, Node &/*child*/, Node */*prev*/ ) - { - if ( _pnl && _obj ) { - _pnl->_objectsChanged( _obj ); - } - } - virtual void notifyChildOrderChanged( Node &/*node*/, Node &/*child*/, Node */*old_prev*/, Node */*new_prev*/ ) - { - if ( _pnl && _obj ) { - _pnl->_objectsChanged( _obj ); - } - } - virtual void notifyContentChanged( Node &/*node*/, Util::ptr_shared<char> /*old_content*/, Util::ptr_shared<char> /*new_content*/ ) {} - virtual void notifyAttributeChanged( Node &/*node*/, GQuark name, Util::ptr_shared<char> /*old_value*/, Util::ptr_shared<char> /*new_value*/ ) { - if ( _pnl && _obj ) { - if ( name == _labelAttr ) { - _pnl->_updateObject( _obj); - } - } - } - - TagsPanel* _pnl; - SPObject* _obj; - Inkscape::XML::Node* _repr; - GQuark _labelAttr; -}; - -class TagsPanel::InternalUIBounce -{ -public: - int _actionCode; -}; - -void TagsPanel::_styleButton( Gtk::Button& btn, SPDesktop *desktop, unsigned int code, char const* iconName, char const* tooltip ) -{ - bool set = false; - - if ( iconName ) { - GtkWidget *child = sp_icon_new( Inkscape::ICON_SIZE_SMALL_TOOLBAR, iconName ); - gtk_widget_show( child ); - btn.add( *manage(Glib::wrap(child)) ); - btn.set_relief(Gtk::RELIEF_NONE); - set = true; - } - - if ( desktop ) { - Verb *verb = Verb::get( code ); - if ( verb ) { - SPAction *action = verb->get_action(desktop); - if ( !set && action && action->image ) { - GtkWidget *child = sp_icon_new( Inkscape::ICON_SIZE_SMALL_TOOLBAR, action->image ); - gtk_widget_show( child ); - btn.add( *manage(Glib::wrap(child)) ); - set = true; - } - } - } - - btn.set_tooltip_text (tooltip); -} - - -Gtk::MenuItem& TagsPanel::_addPopupItem( SPDesktop *desktop, unsigned int code, char const* iconName, char const* fallback, int id ) -{ - GtkWidget* iconWidget = 0; - const char* label = 0; - - if ( iconName ) { - iconWidget = sp_icon_new( Inkscape::ICON_SIZE_MENU, iconName ); - } - - if ( desktop ) { - Verb *verb = Verb::get( code ); - if ( verb ) { - SPAction *action = verb->get_action(desktop); - if ( !iconWidget && action && action->image ) { - iconWidget = sp_icon_new( Inkscape::ICON_SIZE_MENU, action->image ); - } - - if ( action ) { - label = action->name; - } - } - } - - if ( !label && fallback ) { - label = fallback; - } - - Gtk::Widget* wrapped = 0; - if ( iconWidget ) { - wrapped = manage(Glib::wrap(iconWidget)); - wrapped->show(); - } - - - Gtk::MenuItem* item = 0; - - if (wrapped) { - item = Gtk::manage(new Gtk::ImageMenuItem(*wrapped, label, true)); - } else { - item = Gtk::manage(new Gtk::MenuItem(label, true)); - } - - item->signal_activate().connect(sigc::bind(sigc::mem_fun(*this, &TagsPanel::_takeAction), id)); - _popupMenu.append(*item); - - return *item; -} - -void TagsPanel::_fireAction( unsigned int code ) -{ - if ( _desktop ) { - Verb *verb = Verb::get( code ); - if ( verb ) { - SPAction *action = verb->get_action(_desktop); - if ( action ) { - sp_action_perform( action, NULL ); - } - } - } -} - -void TagsPanel::_takeAction( int val ) -{ - if ( !_pending ) { - _pending = new InternalUIBounce(); - _pending->_actionCode = val; - Glib::signal_timeout().connect( sigc::mem_fun(*this, &TagsPanel::_executeAction), 0 ); - } -} - -bool TagsPanel::_executeAction() -{ - // Make sure selected layer hasn't changed since the action was triggered - if ( _pending) - { - int val = _pending->_actionCode; -// SPObject* target = _pending->_target; - - switch ( val ) { - case BUTTON_NEW: - { - _fireAction( SP_VERB_TAG_NEW ); - } - break; - case BUTTON_TOP: - { - if (_desktop->selection->isEmpty()) - { - _fireAction( SP_VERB_LAYER_TO_TOP ); - } - else - { - _fireAction( SP_VERB_SELECTION_TO_FRONT); - } - } - break; - case BUTTON_BOTTOM: - { - if (_desktop->selection->isEmpty()) - { - _fireAction( SP_VERB_LAYER_TO_BOTTOM ); - } - else - { - _fireAction( SP_VERB_SELECTION_TO_BACK); - } - } - break; - case BUTTON_UP: - { - if (_desktop->selection->isEmpty()) - { - _fireAction( SP_VERB_LAYER_RAISE ); - } - else - { - _fireAction( SP_VERB_SELECTION_RAISE ); - } - } - break; - case BUTTON_DOWN: - { - if (_desktop->selection->isEmpty()) - { - _fireAction( SP_VERB_LAYER_LOWER ); - } - else - { - _fireAction( SP_VERB_SELECTION_LOWER ); - } - } - break; - case BUTTON_DELETE: - { - std::vector<SPObject *> todelete; - _tree.get_selection()->selected_foreach_iter(sigc::bind<std::vector<SPObject *>*>(sigc::mem_fun(*this, &TagsPanel::_checkForDeleted), &todelete)); - for (std::vector<SPObject *>::iterator iter = todelete.begin(); iter != todelete.end(); ++iter) { - SPObject * obj = *iter; - if (obj && obj->parent && obj->getRepr() && obj->parent->getRepr()) { - obj->parent->getRepr()->removeChild(obj->getRepr()); - } - } - DocumentUndo::done(_document, SP_VERB_DIALOG_TAGS, _("Remove from tags")); - } - break; - case DRAGNDROP: - { - _doTreeMove( ); - } - break; - } - - delete _pending; - _pending = 0; - } - - return false; -} - - -class TagsPanel::ModelColumns : public Gtk::TreeModel::ColumnRecord -{ -public: - - ModelColumns() - { - add(_colParentObject); - add(_colObject); - add(_colLabel); - add(_colAddRemove); - add(_colAllowAddRemove); - } - virtual ~ModelColumns() {} - - Gtk::TreeModelColumn<SPObject*> _colParentObject; - Gtk::TreeModelColumn<SPObject*> _colObject; - Gtk::TreeModelColumn<Glib::ustring> _colLabel; - Gtk::TreeModelColumn<bool> _colAddRemove; - Gtk::TreeModelColumn<bool> _colAllowAddRemove; -}; - -void TagsPanel::_checkForDeleted(const Gtk::TreeIter& iter, std::vector<SPObject *>* todelete) -{ - Gtk::TreeRow row = *iter; - SPObject * obj = row[_model->_colObject]; - if (obj && obj->parent) { - todelete->push_back(obj); - } -} - -void TagsPanel::_updateObject( SPObject *obj ) { - _store->foreach( sigc::bind<SPObject*>(sigc::mem_fun(*this, &TagsPanel::_checkForUpdated), obj) ); -} - -bool TagsPanel::_checkForUpdated(const Gtk::TreePath &/*path*/, const Gtk::TreeIter& iter, SPObject* obj) -{ - Gtk::TreeModel::Row row = *iter; - if ( obj == row[_model->_colObject] ) - { - /* - * We get notified of layer update here (from layer->setLabel()) before layer->label() is set - * with the correct value (sp-object bug?). So use the inkscape:label attribute instead which - * has the correct value (bug #168351) - */ - //row[_model->_colLabel] = layer->label() ? layer->label() : layer->getId(); - gchar const *label; - SPTagUse * use = SP_IS_TAG_USE(obj) ? SP_TAG_USE(obj) : 0; - if (use && use->ref->isAttached()) { - label = use->ref->getObject()->getAttribute("inkscape:label"); - } else { - label = obj->getAttribute("inkscape:label"); - } - row[_model->_colLabel] = label ? label : obj->getId(); - row[_model->_colAddRemove] = SP_IS_TAG(obj); - } - - return false; -} - -void TagsPanel::_objectsSelected( Selection *sel ) { - - _selectedConnection.block(); - _tree.get_selection()->unselect_all(); - for (const GSList * iter = sel->list(); iter != NULL; iter = iter->next) - { - SPObject *obj = reinterpret_cast<SPObject *>(iter->data); - _store->foreach(sigc::bind<SPObject *>( sigc::mem_fun(*this, &TagsPanel::_checkForSelected), obj)); - } - _selectedConnection.unblock(); - _checkTreeSelection(); -} - -bool TagsPanel::_checkForSelected(const Gtk::TreePath &path, const Gtk::TreeIter& iter, SPObject* obj) -{ - Gtk::TreeModel::Row row = *iter; - SPObject * it = row[_model->_colObject]; - if ( it && SP_IS_TAG_USE(it) && SP_TAG_USE(it)->ref->getObject() == obj ) - { - Glib::RefPtr<Gtk::TreeSelection> select = _tree.get_selection(); - - select->select(iter); - } - return false; -} - -void TagsPanel::_objectsChanged(SPObject* root) -{ - while (!_objectWatchers.empty()) - { - TagsPanel::ObjectWatcher *w = _objectWatchers.back(); - w->_repr->removeObserver(*w); - _objectWatchers.pop_back(); - delete w; - } - - if (_desktop) { - SPDocument* document = _desktop->doc(); - SPDefs* root = document->getDefs(); - if ( root ) { - _selectedConnection.block(); - _store->clear(); - _addObject( document, root, 0 ); - _selectedConnection.unblock(); - _objectsSelected(_desktop->selection); - _checkTreeSelection(); - } - } -} - -void TagsPanel::_addObject( SPDocument* doc, SPObject* obj, Gtk::TreeModel::Row* parentRow ) -{ - if ( _desktop && obj ) { - for ( SPObject *child = obj->children; child != NULL; child = child->next) { - if (SP_IS_TAG(child)) - { - Gtk::TreeModel::iterator iter = parentRow ? _store->prepend(parentRow->children()) : _store->prepend(); - Gtk::TreeModel::Row row = *iter; - row[_model->_colObject] = child; - row[_model->_colParentObject] = NULL; - row[_model->_colLabel] = child->label() ? child->label() : child->getId(); - row[_model->_colAddRemove] = true; - row[_model->_colAllowAddRemove] = true; - - _tree.expand_to_path( _store->get_path(iter) ); - - TagsPanel::ObjectWatcher *w = new TagsPanel::ObjectWatcher(this, child); - child->getRepr()->addObserver(*w); - _objectWatchers.push_back(w); - _addObject( doc, child, &row ); - } - } - if (SP_IS_TAG(obj) && obj->children) - { - Gtk::TreeModel::iterator iteritems = parentRow ? _store->append(parentRow->children()) : _store->prepend(); - Gtk::TreeModel::Row rowitems = *iteritems; - rowitems[_model->_colObject] = NULL; - rowitems[_model->_colParentObject] = obj; - rowitems[_model->_colLabel] = _("Items"); - rowitems[_model->_colAddRemove] = false; - rowitems[_model->_colAllowAddRemove] = false; - - _tree.expand_to_path( _store->get_path(iteritems) ); - - for ( SPObject *child = obj->children; child != NULL; child = child->next) { - if (SP_IS_TAG_USE(child)) - { - SPItem *item = SP_TAG_USE(child)->ref->getObject(); - Gtk::TreeModel::iterator iter = _store->prepend(rowitems->children()); - Gtk::TreeModel::Row row = *iter; - row[_model->_colObject] = child; - row[_model->_colParentObject] = NULL; - row[_model->_colLabel] = item ? (item->label() ? item->label() : item->getId()) : SP_TAG_USE(child)->href; - row[_model->_colAddRemove] = false; - row[_model->_colAllowAddRemove] = true; - - if (SP_TAG(obj)->expanded()) { - _tree.expand_to_path( _store->get_path(iter) ); - } - - if (item) { - TagsPanel::ObjectWatcher *w = new TagsPanel::ObjectWatcher(this, child, item->getRepr()); - item->getRepr()->addObserver(*w); - _objectWatchers.push_back(w); - } - } - } - } - } -} - -void TagsPanel::_select_tag( SPTag * tag ) -{ - for (SPObject * child = tag->children; child != NULL; child = child->next) - { - if (SP_IS_TAG(child)) { - _select_tag(SP_TAG(child)); - } else if (SP_IS_TAG_USE(child)) { - SPObject * obj = SP_TAG_USE(child)->ref->getObject(); - if (obj) { - if (_desktop->selection->isEmpty()) _desktop->setCurrentLayer(obj->parent); - _desktop->selection->add(obj); - } - } - } -} - -void TagsPanel::_selected_row_callback( const Gtk::TreeModel::iterator& iter ) -{ - if (iter) { - Gtk::TreeModel::Row row = *iter; - SPObject *obj = row[_model->_colObject]; - if (obj) { - if (SP_IS_TAG(obj)) { - _select_tag(SP_TAG(obj)); - } else if (SP_IS_TAG_USE(obj)) { - SPObject * item = SP_TAG_USE(obj)->ref->getObject(); - if (item) { - if (_desktop->selection->isEmpty()) _desktop->setCurrentLayer(item->parent); - _desktop->selection->add(item); - } - } - } - } -} - -void TagsPanel::_pushTreeSelectionToCurrent() -{ - _selectionChangedConnection.block(); - // TODO hunt down the possible API abuse in getting NULL - if ( _desktop && _desktop->currentRoot() ) { - _desktop->selection->clear(); - _tree.get_selection()->selected_foreach_iter( sigc::mem_fun(*this, &TagsPanel::_selected_row_callback)); - } - _selectionChangedConnection.unblock(); - - _checkTreeSelection(); -} - -void TagsPanel::_checkTreeSelection() -{ - bool sensitive = _tree.get_selection()->count_selected_rows() > 0; - bool sensitiveNonTop = true; - bool sensitiveNonBottom = true; -// if ( _tree.get_selection()->count_selected_rows() > 0 ) { -// sensitive = true; -// -// SPObject* inTree = _selectedLayer(); -// if ( inTree ) { -// -// sensitiveNonTop = (Inkscape::Nex(inTree->parent, inTree) != 0); -// sensitiveNonBottom = (Inkscape::previous_layer(inTree->parent, inTree) != 0); -// -// } -// } - - - for ( std::vector<Gtk::Widget*>::iterator it = _watching.begin(); it != _watching.end(); ++it ) { - (*it)->set_sensitive( sensitive ); - } - for ( std::vector<Gtk::Widget*>::iterator it = _watchingNonTop.begin(); it != _watchingNonTop.end(); ++it ) { - (*it)->set_sensitive( sensitiveNonTop ); - } - for ( std::vector<Gtk::Widget*>::iterator it = _watchingNonBottom.begin(); it != _watchingNonBottom.end(); ++it ) { - (*it)->set_sensitive( sensitiveNonBottom ); - } -} - -bool TagsPanel::_handleKeyEvent(GdkEventKey *event) -{ - - switch (get_group0_keyval(event)) { - case GDK_KEY_Return: - case GDK_KEY_KP_Enter: - case GDK_KEY_F2: { - Gtk::TreeModel::iterator iter = _tree.get_selection()->get_selected(); - if (iter && !_text_renderer->property_editable()) { - Gtk::TreeRow row = *iter; - SPObject * obj = row[_model->_colObject]; - if (obj && SP_IS_TAG(obj)) { - Gtk::TreeModel::Path *path = new Gtk::TreeModel::Path(iter); - // Edit the layer label - _text_renderer->property_editable() = true; - _tree.set_cursor(*path, *_name_column, true); - grab_focus(); - return true; - } - } - } - case GDK_KEY_Delete: { - std::vector<SPObject *> todelete; - _tree.get_selection()->selected_foreach_iter(sigc::bind<std::vector<SPObject *>*>(sigc::mem_fun(*this, &TagsPanel::_checkForDeleted), &todelete)); - if (!todelete.empty()) { - for (std::vector<SPObject *>::iterator iter = todelete.begin(); iter != todelete.end(); ++iter) { - SPObject * obj = *iter; - if (obj && obj->parent && obj->getRepr() && obj->parent->getRepr()) { - obj->parent->getRepr()->removeChild(obj->getRepr()); - } - } - DocumentUndo::done(_document, SP_VERB_DIALOG_TAGS, _("Remove from tags")); - } - return true; - } - break; - } - return false; -} - -bool TagsPanel::_handleButtonEvent(GdkEventButton* event) -{ - static unsigned doubleclick = 0; - - if ( (event->type == GDK_BUTTON_PRESS) && (event->button == 3) ) { - // TODO - fix to a better is-popup function - Gtk::TreeModel::Path path; - int x = static_cast<int>(event->x); - int y = static_cast<int>(event->y); - if ( _tree.get_path_at_pos( x, y, path ) ) { - _checkTreeSelection(); - _popupMenu.popup(event->button, event->time); - if (_tree.get_selection()->is_selected(path)) { - return true; - } - } - } - - if ( (event->type == GDK_BUTTON_PRESS) && (event->button == 1)) { - // Alt left click on the visible/lock columns - eat this event to keep row selection - Gtk::TreeModel::Path path; - Gtk::TreeViewColumn* col = 0; - int x = static_cast<int>(event->x); - int y = static_cast<int>(event->y); - int x2 = 0; - int y2 = 0; - if ( _tree.get_path_at_pos( x, y, path, col, x2, y2 ) ) { - if (col == _tree.get_column(COL_ADD-1)) { - down_at_add = true; - return true; - } else if ( !(event->state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK)) & _tree.get_selection()->is_selected(path) ) { - _tree.get_selection()->set_select_function(sigc::mem_fun(*this, &TagsPanel::_noSelection)); - _defer_target = path; - } else { - down_at_add = false; - } - } else { - down_at_add = false; - } - } - - if ( event->type == GDK_BUTTON_RELEASE) { - _tree.get_selection()->set_select_function(sigc::mem_fun(*this, &TagsPanel::_rowSelectFunction)); - } - - // TODO - ImageToggler doesn't seem to handle Shift/Alt clicks - so we deal with them here. - if ( (event->type == GDK_BUTTON_RELEASE) && (event->button == 1)) { - - Gtk::TreeModel::Path path; - Gtk::TreeViewColumn* col = 0; - int x = static_cast<int>(event->x); - int y = static_cast<int>(event->y); - int x2 = 0; - int y2 = 0; - if ( _tree.get_path_at_pos( x, y, path, col, x2, y2 ) ) { - if (_defer_target) { - if (_defer_target == path && !(event->x == 0 && event->y == 0)) - { - _tree.set_cursor(path, *col, false); - } - _defer_target = Gtk::TreeModel::Path(); - } else { - Gtk::TreeModel::Children::iterator iter = _tree.get_model()->get_iter(path); - Gtk::TreeModel::Row row = *iter; - - SPObject* obj = row[_model->_colObject]; - - if (obj) { - if (col == _tree.get_column(COL_ADD - 1) && down_at_add) { - if (SP_IS_TAG(obj)) { - bool wasadded = false; - for (const GSList * iter = _desktop->selection->itemList(); iter != NULL; iter = iter->next) - { - SPObject *newobj = reinterpret_cast<SPObject *>(iter->data); - bool addchild = true; - for ( SPObject *child = obj->children; child != NULL; child = child->next) { - if (SP_IS_TAG_USE(child) && SP_TAG_USE(child)->ref->getObject() == newobj) { - addchild = false; - } - } - if (addchild) { - Inkscape::XML::Node *clone = _document->getReprDoc()->createElement("inkscape:tagref"); - clone->setAttribute("xlink:href", g_strdup_printf("#%s", newobj->getRepr()->attribute("id")), false); - obj->appendChild(clone); - wasadded = true; - } - } - if (wasadded) { - DocumentUndo::done(_document, SP_VERB_DIALOG_TAGS, _("Add selection to tag")); - } - } else { - std::vector<SPObject *> todelete; - _tree.get_selection()->selected_foreach_iter(sigc::bind<std::vector<SPObject *>*>(sigc::mem_fun(*this, &TagsPanel::_checkForDeleted), &todelete)); - if (!todelete.empty()) { - for (std::vector<SPObject *>::iterator iter = todelete.begin(); iter != todelete.end(); ++iter) { - SPObject * tobj = *iter; - if (tobj && tobj->parent && tobj->getRepr() && tobj->parent->getRepr()) { - tobj->parent->getRepr()->removeChild(tobj->getRepr()); - } - } - } else if (obj && obj->parent && obj->getRepr() && obj->parent->getRepr()) { - obj->parent->getRepr()->removeChild(obj->getRepr()); - } - DocumentUndo::done(_document, SP_VERB_DIALOG_TAGS, _("Remove from tags")); - } - } - } - } - } - } - - - if ( (event->type == GDK_2BUTTON_PRESS) && (event->button == 1) ) { - doubleclick = 1; - } - - if ( event->type == GDK_BUTTON_RELEASE && doubleclick) { - doubleclick = 0; - Gtk::TreeModel::Path path; - Gtk::TreeViewColumn* col = 0; - int x = static_cast<int>(event->x); - int y = static_cast<int>(event->y); - int x2 = 0; - int y2 = 0; - if ( _tree.get_path_at_pos( x, y, path, col, x2, y2 ) && col == _name_column) { - Gtk::TreeModel::Children::iterator iter = _tree.get_model()->get_iter(path); - Gtk::TreeModel::Row row = *iter; - - SPObject* obj = row[_model->_colObject]; - if (obj && (SP_IS_TAG(obj) || (SP_IS_TAG_USE(obj) && SP_TAG_USE(obj)->ref->getObject()))) { - // Double click on the Layer name, enable editing - _text_renderer->property_editable() = true; - _tree.set_cursor (path, *_name_column, true); - grab_focus(); - } - } - } - - return false; -} - -void TagsPanel::_storeDragSource(const Gtk::TreeModel::iterator& iter) -{ - Gtk::TreeModel::Row row = *iter; - SPObject* obj = row[_model->_colObject]; - SPTag* item = ( obj && SP_IS_TAG(obj) ) ? SP_TAG(obj) : 0; - if (item) - { - _dnd_source.push_back(item); - } -} - -/* - * Drap and drop within the tree - * Save the drag source and drop target SPObjects and if its a drag between layers or into (sublayer) a layer - */ -bool TagsPanel::_handleDragDrop(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time) -{ - int cell_x = 0, cell_y = 0; - Gtk::TreeModel::Path target_path; - Gtk::TreeView::Column *target_column; - - _dnd_into = true; - _dnd_target = _document->getDefs(); - _dnd_source.clear(); - _tree.get_selection()->selected_foreach_iter(sigc::mem_fun(*this, &TagsPanel::_storeDragSource)); - - if (_dnd_source.empty()) { - return true; - } - - if (_tree.get_path_at_pos (x, y, target_path, target_column, cell_x, cell_y)) { - // Are we before, inside or after the drop layer - Gdk::Rectangle rect; - _tree.get_background_area (target_path, *target_column, rect); - int cell_height = rect.get_height(); - _dnd_into = (cell_y > (int)(cell_height * 1/3) && cell_y <= (int)(cell_height * 2/3)); - if (cell_y > (int)(cell_height * 2/3)) { - Gtk::TreeModel::Path next_path = target_path; - next_path.next(); - if (_store->iter_is_valid(_store->get_iter(next_path))) { - target_path = next_path; - } else { - // Dragging to the "end" - Gtk::TreeModel::Path up_path = target_path; - up_path.up(); - if (_store->iter_is_valid(_store->get_iter(up_path))) { - // Drop into parent - target_path = up_path; - _dnd_into = true; - } else { - // Drop into the top level - _dnd_target = _document->getDefs(); - _dnd_into = true; - } - } - } - Gtk::TreeModel::iterator iter = _store->get_iter(target_path); - if (_store->iter_is_valid(iter)) { - Gtk::TreeModel::Row row = *iter; - SPObject *obj = row[_model->_colObject]; - SPObject *pobj = row[_model->_colParentObject]; - if (obj) { - if (SP_IS_TAG(obj)) { - _dnd_target = SP_TAG(obj); - } else if (SP_IS_TAG(obj->parent)) { - _dnd_target = SP_TAG(obj->parent); - _dnd_into = true; - } - } else if (pobj && SP_IS_TAG(pobj)) { - _dnd_target = SP_TAG(pobj); - _dnd_into = true; - } else { - return true; - } - } - } - - _takeAction(DRAGNDROP); - - return false; -} - -/* - * Move a layer in response to a drag & drop action - */ -void TagsPanel::_doTreeMove( ) -{ - if (_dnd_target) { - for (std::vector<SPTag *>::iterator iter = _dnd_source.begin(); iter != _dnd_source.end(); ++iter) - { - SPTag *src = *iter; - if (src != _dnd_target) { - src->moveTo(_dnd_target, _dnd_into); - } - } - _desktop->selection->clear(); - while (!_dnd_source.empty()) - { - SPTag *src = _dnd_source.back(); - _select_tag(src); - _dnd_source.pop_back(); - } - DocumentUndo::done( _desktop->doc() , SP_VERB_DIALOG_TAGS, - _("Moved tags")); - } -} - - -void TagsPanel::_handleEdited(const Glib::ustring& path, const Glib::ustring& new_text) -{ - Gtk::TreeModel::iterator iter = _tree.get_model()->get_iter(path); - Gtk::TreeModel::Row row = *iter; - - _renameObject(row, new_text); - _text_renderer->property_editable() = false; -} - -void TagsPanel::_handleEditingCancelled() -{ - _text_renderer->property_editable() = false; -} - -void TagsPanel::_renameObject(Gtk::TreeModel::Row row, const Glib::ustring& name) -{ - if ( row && _desktop) { - SPObject* obj = row[_model->_colObject]; - if ( obj ) { - if (SP_IS_TAG(obj)) { - gchar const* oldLabel = obj->label(); - if ( !name.empty() && (!oldLabel || name != oldLabel) ) { - obj->setLabel(name.c_str()); - DocumentUndo::done( _desktop->doc() , SP_VERB_NONE, - _("Rename object")); - } - } else if (SP_IS_TAG_USE(obj) && (obj = SP_TAG_USE(obj)->ref->getObject())) { - gchar const* oldLabel = obj->label(); - if ( !name.empty() && (!oldLabel || name != oldLabel) ) { - obj->setLabel(name.c_str()); - DocumentUndo::done( _desktop->doc() , SP_VERB_NONE, - _("Rename object")); - } - } - } - } -} - -bool TagsPanel::_noSelection( Glib::RefPtr<Gtk::TreeModel> const & /*model*/, Gtk::TreeModel::Path const & /*path*/, bool currentlySelected ) -{ - return false; -} - -bool TagsPanel::_rowSelectFunction( Glib::RefPtr<Gtk::TreeModel> const & /*model*/, Gtk::TreeModel::Path const & /*path*/, bool currentlySelected ) -{ - bool val = true; - if ( !currentlySelected && _toggleEvent ) - { - GdkEvent* event = gtk_get_current_event(); - if ( event ) { - // (keep these checks separate, so we know when to call gdk_event_free() - if ( event->type == GDK_BUTTON_PRESS ) { - GdkEventButton const* target = reinterpret_cast<GdkEventButton const*>(_toggleEvent); - GdkEventButton const* evtb = reinterpret_cast<GdkEventButton const*>(event); - - if ( (evtb->window == target->window) - && (evtb->send_event == target->send_event) - && (evtb->time == target->time) - && (evtb->state == target->state) - ) - { - // Ooooh! It's a magic one - val = false; - } - } - gdk_event_free(event); - } - } - return val; -} - -void TagsPanel::_setExpanded(const Gtk::TreeModel::iterator& iter, const Gtk::TreeModel::Path& /*path*/, bool isexpanded) -{ - Gtk::TreeModel::Row row = *iter; - - SPObject* obj = row[_model->_colParentObject]; - if (obj && SP_IS_TAG(obj)) - { - SP_TAG(obj)->setExpanded(isexpanded); - obj->updateRepr(SP_OBJECT_WRITE_NO_CHILDREN | SP_OBJECT_WRITE_EXT); - } -} - -/** - * Constructor - */ -TagsPanel::TagsPanel() : - UI::Widget::Panel("", "/dialogs/tags", SP_VERB_DIALOG_TAGS), - _rootWatcher(0), - deskTrack(), - _desktop(0), - _document(0), - _model(0), - _pending(0), - _toggleEvent(0), - _defer_target(), - desktopChangeConn() -{ - //Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - - ModelColumns *zoop = new ModelColumns(); - _model = zoop; - - _store = Gtk::TreeStore::create( *zoop ); - - _tree.set_model( _store ); - _tree.set_headers_visible(false); - _tree.set_reorderable(true); - _tree.enable_model_drag_dest (Gdk::ACTION_MOVE); - - Inkscape::UI::Widget::AddToIcon * addRenderer = manage( new Inkscape::UI::Widget::AddToIcon()); - int addColNum = _tree.append_column("type", *addRenderer) - 1; - Gtk::TreeViewColumn *col = _tree.get_column(addColNum); - if ( col ) { - col->add_attribute( addRenderer->property_active(), _model->_colAddRemove ); - col->add_attribute( addRenderer->property_visible(), _model->_colAllowAddRemove ); - } - - _text_renderer = manage(new Gtk::CellRendererText()); - int nameColNum = _tree.append_column("Name", *_text_renderer) - 1; - _name_column = _tree.get_column(nameColNum); - _name_column->add_attribute(_text_renderer->property_text(), _model->_colLabel); - - _tree.set_expander_column( *_tree.get_column(nameColNum) ); - - _tree.get_selection()->set_mode(Gtk::SELECTION_MULTIPLE); - _selectedConnection = _tree.get_selection()->signal_changed().connect( sigc::mem_fun(*this, &TagsPanel::_pushTreeSelectionToCurrent) ); - _tree.get_selection()->set_select_function( sigc::mem_fun(*this, &TagsPanel::_rowSelectFunction) ); - - _tree.signal_drag_drop().connect( sigc::mem_fun(*this, &TagsPanel::_handleDragDrop), false); - _collapsedConnection = _tree.signal_row_collapsed().connect( sigc::bind<bool>(sigc::mem_fun(*this, &TagsPanel::_setExpanded), false)); - _expandedConnection = _tree.signal_row_expanded().connect( sigc::bind<bool>(sigc::mem_fun(*this, &TagsPanel::_setExpanded), true)); - - _text_renderer->signal_edited().connect( sigc::mem_fun(*this, &TagsPanel::_handleEdited) ); - _text_renderer->signal_editing_canceled().connect( sigc::mem_fun(*this, &TagsPanel::_handleEditingCancelled) ); - - _tree.signal_button_press_event().connect( sigc::mem_fun(*this, &TagsPanel::_handleButtonEvent), false ); - _tree.signal_button_release_event().connect( sigc::mem_fun(*this, &TagsPanel::_handleButtonEvent), false ); - _tree.signal_key_press_event().connect( sigc::mem_fun(*this, &TagsPanel::_handleKeyEvent), false ); - - _scroller.add( _tree ); - _scroller.set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC ); - _scroller.set_shadow_type(Gtk::SHADOW_IN); - Gtk::Requisition sreq; -#if WITH_GTKMM_3_0 - Gtk::Requisition sreq_natural; - _scroller.get_preferred_size(sreq_natural, sreq); -#else - sreq = _scroller.size_request(); -#endif - int minHeight = 70; - if (sreq.height < minHeight) { - // Set a min height to see the layers when used with Ubuntu liboverlay-scrollbar - _scroller.set_size_request(sreq.width, minHeight); - } - - _layersPage.pack_start( _scroller, Gtk::PACK_EXPAND_WIDGET ); - - _layersPage.pack_end(_buttonsRow, Gtk::PACK_SHRINK); - - _getContents()->pack_start(_layersPage, Gtk::PACK_EXPAND_WIDGET); - - SPDesktop* targetDesktop = getDesktop(); - - Gtk::Button* btn = manage( new Gtk::Button() ); - _styleButton( *btn, targetDesktop, SP_VERB_TAG_NEW, GTK_STOCK_ADD, _("Add a new tag") ); - btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &TagsPanel::_takeAction), (int)BUTTON_NEW) ); - _buttonsSecondary.pack_start(*btn, Gtk::PACK_SHRINK); - -// btn = manage( new Gtk::Button("Dup") ); -// btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_DUPLICATE) ); -// _buttonsRow.add( *btn ); - - btn = manage( new Gtk::Button() ); - _styleButton( *btn, targetDesktop, SP_VERB_LAYER_DELETE, GTK_STOCK_REMOVE, _("Remove Item/Tag") ); - btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &TagsPanel::_takeAction), (int)BUTTON_DELETE) ); - _watching.push_back( btn ); - _buttonsSecondary.pack_start(*btn, Gtk::PACK_SHRINK); - - _buttonsRow.pack_start(_buttonsSecondary, Gtk::PACK_EXPAND_WIDGET); - _buttonsRow.pack_end(_buttonsPrimary, Gtk::PACK_EXPAND_WIDGET); - - // ------------------------------------------------------- - { - _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_TAG_NEW, 0, "New", (int)BUTTON_NEW ) ); - - _popupMenu.show_all_children(); - } - // ------------------------------------------------------- - - - - for ( std::vector<Gtk::Widget*>::iterator it = _watching.begin(); it != _watching.end(); ++it ) { - (*it)->set_sensitive( false ); - } - for ( std::vector<Gtk::Widget*>::iterator it = _watchingNonTop.begin(); it != _watchingNonTop.end(); ++it ) { - (*it)->set_sensitive( false ); - } - for ( std::vector<Gtk::Widget*>::iterator it = _watchingNonBottom.begin(); it != _watchingNonBottom.end(); ++it ) { - (*it)->set_sensitive( false ); - } - - setDesktop( targetDesktop ); - - show_all_children(); - - // restorePanelPrefs(); - - // Connect this up last - desktopChangeConn = deskTrack.connectDesktopChanged( sigc::mem_fun(*this, &TagsPanel::setDesktop) ); - deskTrack.connect(GTK_WIDGET(gobj())); -} - -TagsPanel::~TagsPanel() -{ - - setDesktop(NULL); - - if ( _model ) - { - delete _model; - _model = 0; - } - - if (_pending) { - delete _pending; - _pending = 0; - } - - if ( _toggleEvent ) - { - gdk_event_free( _toggleEvent ); - _toggleEvent = 0; - } - - desktopChangeConn.disconnect(); - deskTrack.disconnect(); -} - -void TagsPanel::setDocument(SPDesktop* /*desktop*/, SPDocument* document) -{ - while (!_objectWatchers.empty()) - { - TagsPanel::ObjectWatcher *w = _objectWatchers.back(); - w->_repr->removeObserver(*w); - _objectWatchers.pop_back(); - delete w; - } - - if (_rootWatcher) - { - _rootWatcher->_repr->removeObserver(*_rootWatcher); - delete _rootWatcher; - _rootWatcher = NULL; - } - - _document = document; - - if (document && document->getDefs() && document->getDefs()->getRepr()) - { - _rootWatcher = new TagsPanel::ObjectWatcher(this, document->getDefs()); - document->getDefs()->getRepr()->addObserver(*_rootWatcher); - _objectsChanged(document->getDefs()); - } -} - -void TagsPanel::setDesktop( SPDesktop* desktop ) -{ - Panel::setDesktop(desktop); - - if ( desktop != _desktop ) { - _documentChangedConnection.disconnect(); - _selectionChangedConnection.disconnect(); - if ( _desktop ) { - _desktop = 0; - } - - _desktop = Panel::getDesktop(); - if ( _desktop ) { - //setLabel( _desktop->doc()->name ); - _documentChangedConnection = _desktop->connectDocumentReplaced( sigc::mem_fun(*this, &TagsPanel::setDocument)); - _selectionChangedConnection = _desktop->selection->connectChanged( sigc::mem_fun(*this, &TagsPanel::_objectsSelected)); - - setDocument(_desktop, _desktop->doc()); - } - } -/* - GSList const *layers = _desktop->doc()->getResourceList( "layer" ); - g_message( "layers list starts at %p", layers ); - for ( GSList const *iter=layers ; iter ; iter = iter->next ) { - SPObject *layer=static_cast<SPObject *>(iter->data); - g_message(" {%s} [%s]", layer->id, layer->label() ); - } -*/ - deskTrack.setBase(desktop); -} - - - - - -} //namespace Dialogs -} //namespace UI -} //namespace Inkscape - - -/* - 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 : diff --git a/src/ui/dialog/tags.h b/src/ui/dialog/tags.h deleted file mode 100644 index d35dfba01..000000000 --- a/src/ui/dialog/tags.h +++ /dev/null @@ -1,181 +0,0 @@ -/* - * A simple dialog for tags UI. - * - * Authors: - * Theodore Janeczko - * - * Copyright (C) Theodore Janeczko 2012 <flutterguy317@gmail.com> - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#ifndef SEEN_TAGS_PANEL_H -#define SEEN_TAGS_PANEL_H - -#include <gtkmm/box.h> -#include <gtkmm/treeview.h> -#include <gtkmm/treestore.h> -#include <gtkmm/scrolledwindow.h> -#include <gtkmm/dialog.h> -#include "ui/widget/spinbutton.h" -#include "ui/widget/panel.h" -#include "ui/widget/object-composite-settings.h" -#include "desktop-tracker.h" -#include "ui/widget/style-subject.h" -#include "selection.h" -#include "ui/widget/filter-effect-chooser.h" - -class SPObject; -class SPTag; -struct SPColorSelector; - -namespace Inkscape { - -namespace UI { -namespace Dialog { - - -/** - * A panel that displays layers. - */ -class TagsPanel : public UI::Widget::Panel -{ -public: - TagsPanel(); - virtual ~TagsPanel(); - - //virtual void setOrientation( Gtk::AnchorType how ); - - static TagsPanel& getInstance(); - - void setDesktop( SPDesktop* desktop ); - void setDocument( SPDesktop* desktop, SPDocument* document); - -protected: - //virtual void _handleAction( int setId, int itemId ); - friend void sp_highlight_picker_color_mod(SPColorSelector *csel, GObject *cp); -private: - class ModelColumns; - class InternalUIBounce; - class ObjectWatcher; - - TagsPanel(TagsPanel const &); // no copy - TagsPanel &operator=(TagsPanel const &); // no assign - - void _styleButton( Gtk::Button& btn, SPDesktop *desktop, unsigned int code, char const* iconName, char const* tooltip ); - void _fireAction( unsigned int code ); - Gtk::MenuItem& _addPopupItem( SPDesktop *desktop, unsigned int code, char const* iconName, char const* fallback, int id ); - - bool _handleButtonEvent(GdkEventButton *event); - bool _handleKeyEvent(GdkEventKey *event); - - void _storeDragSource(const Gtk::TreeModel::iterator& iter); - bool _handleDragDrop(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time); - void _handleEdited(const Glib::ustring& path, const Glib::ustring& new_text); - void _handleEditingCancelled(); - - void _doTreeMove(); - void _renameObject(Gtk::TreeModel::Row row, const Glib::ustring& name); - - void _pushTreeSelectionToCurrent(); - void _selected_row_callback( const Gtk::TreeModel::iterator& iter ); - void _select_tag( SPTag * tag ); - - void _checkTreeSelection(); - - void _takeAction( int val ); - bool _executeAction(); - - void _setExpanded( const Gtk::TreeModel::iterator& iter, const Gtk::TreeModel::Path& path, bool isexpanded ); - - bool _noSelection( Glib::RefPtr<Gtk::TreeModel> const & model, Gtk::TreeModel::Path const & path, bool b ); - bool _rowSelectFunction( Glib::RefPtr<Gtk::TreeModel> const & model, Gtk::TreeModel::Path const & path, bool b ); - - void _updateObject(SPObject *obj); - bool _checkForUpdated(const Gtk::TreePath &path, const Gtk::TreeIter& iter, SPObject* obj); - - void _objectsSelected(Selection *sel); - bool _checkForSelected(const Gtk::TreePath& path, const Gtk::TreeIter& iter, SPObject* layer); - - void _objectsChanged(SPObject *root); - void _addObject( SPDocument* doc, SPObject* obj, Gtk::TreeModel::Row* parentRow ); - - void _checkForDeleted(const Gtk::TreeIter& iter, std::vector<SPObject *>* todelete); - -// std::vector<sigc::connection> groupConnections; - TagsPanel::ObjectWatcher* _rootWatcher; - std::vector<TagsPanel::ObjectWatcher*> _objectWatchers; - - // Hooked to the layer manager: - sigc::connection _documentChangedConnection; - sigc::connection _selectionChangedConnection; - - sigc::connection _changedConnection; - sigc::connection _addedConnection; - sigc::connection _removedConnection; - - // Internal - sigc::connection _selectedConnection; - sigc::connection _expandedConnection; - sigc::connection _collapsedConnection; - - DesktopTracker deskTrack; - SPDesktop* _desktop; - SPDocument* _document; - ModelColumns* _model; - InternalUIBounce* _pending; - gboolean _dnd_into; - std::vector<SPTag*> _dnd_source; - SPObject* _dnd_target; - - GdkEvent* _toggleEvent; - bool down_at_add; - - Gtk::TreeModel::Path _defer_target; - - Glib::RefPtr<Gtk::TreeStore> _store; - std::vector<Gtk::Widget*> _watching; - std::vector<Gtk::Widget*> _watchingNonTop; - std::vector<Gtk::Widget*> _watchingNonBottom; - - Gtk::TreeView _tree; - Gtk::CellRendererText *_text_renderer; - Gtk::TreeView::Column *_name_column; -#if WITH_GTKMM_3_0 - Gtk::Box _buttonsRow; - Gtk::Box _buttonsPrimary; - Gtk::Box _buttonsSecondary; -#else - Gtk::HBox _buttonsRow; - Gtk::HBox _buttonsPrimary; - Gtk::HBox _buttonsSecondary; -#endif - Gtk::ScrolledWindow _scroller; - Gtk::Menu _popupMenu; - Inkscape::UI::Widget::SpinButton _spinBtn; - Gtk::VBox _layersPage; - - sigc::connection desktopChangeConn; - -}; - - - -} //namespace Dialogs -} //namespace UI -} //namespace Inkscape - - - -#endif // SEEN_OBJECTS_PANEL_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 : diff --git a/src/ui/widget/addtoicon.h b/src/ui/widget/addtoicon.h index aa8b4148e..9c134d231 100644 --- a/src/ui/widget/addtoicon.h +++ b/src/ui/widget/addtoicon.h @@ -13,9 +13,9 @@ #include "config.h" #endif -#include <glibmm/property.h> #include <gtkmm/cellrendererpixbuf.h> #include <gtkmm/widget.h> +#include <glibmm/property.h> namespace Inkscape { namespace UI { diff --git a/src/ui/widget/clipmaskicon.h b/src/ui/widget/clipmaskicon.h index f1c1e7628..eca852a83 100644 --- a/src/ui/widget/clipmaskicon.h +++ b/src/ui/widget/clipmaskicon.h @@ -13,9 +13,9 @@ #include "config.h" #endif -#include <glibmm/property.h> #include <gtkmm/cellrendererpixbuf.h> #include <gtkmm/widget.h> +#include <glibmm/property.h> namespace Inkscape { namespace UI { diff --git a/src/ui/widget/highlight-picker.cpp b/src/ui/widget/highlight-picker.cpp index bf93fa960..2afdc02a6 100644 --- a/src/ui/widget/highlight-picker.cpp +++ b/src/ui/widget/highlight-picker.cpp @@ -7,7 +7,14 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include <glibmm/i18n.h> +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H +#include <glibmm/threads.h> +#endif + #include "display/cairo-utils.h" #include <gtkmm/icontheme.h> @@ -16,6 +23,7 @@ #include "widgets/icon.h" #include "widgets/toolbox.h" #include "ui/icon-names.h" +#include <glibmm/i18n.h> namespace Inkscape { namespace UI { diff --git a/src/ui/widget/highlight-picker.h b/src/ui/widget/highlight-picker.h index 2d7dbc14e..c5fe4c02c 100644 --- a/src/ui/widget/highlight-picker.h +++ b/src/ui/widget/highlight-picker.h @@ -13,9 +13,9 @@ #include "config.h" #endif -#include <glibmm/property.h> #include <gtkmm/cellrendererpixbuf.h> #include <gtkmm/widget.h> +#include <glibmm/property.h> namespace Inkscape { namespace UI { diff --git a/src/ui/widget/insertordericon.cpp b/src/ui/widget/insertordericon.cpp index 9002a99c2..2f06225bc 100644 --- a/src/ui/widget/insertordericon.cpp +++ b/src/ui/widget/insertordericon.cpp @@ -7,6 +7,13 @@ * 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 <glibmm/threads.h> +#endif #include "ui/widget/insertordericon.h" diff --git a/src/ui/widget/layertypeicon.h b/src/ui/widget/layertypeicon.h index 4ad3f16fb..6c71ce361 100644 --- a/src/ui/widget/layertypeicon.h +++ b/src/ui/widget/layertypeicon.h @@ -13,9 +13,9 @@ #include "config.h" #endif -#include <glibmm/property.h> #include <gtkmm/cellrendererpixbuf.h> #include <gtkmm/widget.h> +#include <glibmm/property.h> namespace Inkscape { namespace UI { diff --git a/src/verbs.cpp b/src/verbs.cpp index 9c0908e93..26e5ce531 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -2043,9 +2043,9 @@ void DialogVerb::perform(SPAction *action, void *data) case SP_VERB_DIALOG_OBJECTS: dt->_dlg_mgr->showDialog("ObjectsPanel"); break; - case SP_VERB_DIALOG_TAGS: + /*case SP_VERB_DIALOG_TAGS: dt->_dlg_mgr->showDialog("TagsPanel"); - break; + break;*/ //in a moment my dear case SP_VERB_DIALOG_LIVE_PATH_EFFECT: dt->_dlg_mgr->showDialog("LivePathEffect"); break; @@ -2866,8 +2866,8 @@ Verb *Verb::_base_verbs[] = { N_("View Layers"), INKSCAPE_ICON("dialog-layers")), new DialogVerb(SP_VERB_DIALOG_OBJECTS, "DialogObjects", N_("Object_s..."), N_("View Objects"), INKSCAPE_ICON("dialog-layers")), - new DialogVerb(SP_VERB_DIALOG_TAGS, "DialogObjects", N_("Ta_gs..."), - N_("View Tags"), INKSCAPE_ICON("edit-select-all-layers")), + /*new DialogVerb(SP_VERB_DIALOG_TAGS, "DialogObjects", N_("Ta_gs..."), + N_("View Tags"), INKSCAPE_ICON("edit-select-all-layers")),*/ new DialogVerb(SP_VERB_DIALOG_LIVE_PATH_EFFECT, "DialogLivePathEffect", N_("Path E_ffects ..."), N_("Manage, edit, and apply path effects"), NULL), new DialogVerb(SP_VERB_DIALOG_FILTER_EFFECTS, "DialogFilterEffects", N_("Filter _Editor..."), diff --git a/src/verbs.h b/src/verbs.h index b8a0b1fd5..1533bbd50 100644 --- a/src/verbs.h +++ b/src/verbs.h @@ -290,7 +290,7 @@ enum { SP_VERB_DIALOG_EXTENSIONEDITOR, SP_VERB_DIALOG_LAYERS, SP_VERB_DIALOG_OBJECTS, - SP_VERB_DIALOG_TAGS, +// SP_VERB_DIALOG_TAGS, SP_VERB_DIALOG_LIVE_PATH_EFFECT, SP_VERB_DIALOG_FILTER_EFFECTS, SP_VERB_DIALOG_SVG_FONTS, |
