From cca66b9ec4e494c1d919bff0f71a820d8afab1fa Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:24:48 +0200 Subject: Adding upstream version 1.2.2. Signed-off-by: Daniel Baumann --- src/selection-chemistry.h | 125 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 src/selection-chemistry.h (limited to 'src/selection-chemistry.h') diff --git a/src/selection-chemistry.h b/src/selection-chemistry.h new file mode 100644 index 0000000..34ff6a4 --- /dev/null +++ b/src/selection-chemistry.h @@ -0,0 +1,125 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +#ifndef SEEN_SELECTION_CHEMISTRY_H +#define SEEN_SELECTION_CHEMISTRY_H + +/* + * Miscellaneous operations on selected items + * + * Authors: + * Lauris Kaplinski + * Frank Felfe + * bulia byak + * Jon A. Cruz + * Abhishek Sharma + * + * Copyright (C) 1999-2012 authors + * Copyright (C) 2001-2002 Ximian, Inc. + * + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + +#include <2geom/forward.h> +#include +#include + +class SPCSSAttr; +class SPDesktop; +class SPDocument; +class SPItem; +class SPObject; + +namespace Inkscape { + +class Selection; +class ObjectSet; + +namespace LivePathEffect { + class PathParam; +} + + class SelectionHelper { + public: + static void selectAll(SPDesktop *desktop); + static void selectAllInAll(SPDesktop *desktop); + static void selectNone(SPDesktop *desktop); + static void selectSameFillStroke(SPDesktop *dt); + static void selectSameFillColor(SPDesktop *dt); + static void selectSameStrokeColor(SPDesktop *dt); + static void selectSameStrokeStyle(SPDesktop *dt); + static void selectSameObjectType(SPDesktop *dt); + static void invert(SPDesktop *desktop); + static void invertAllInAll(SPDesktop *desktop); + static void reverse(SPDesktop *dt); + static void fixSelection(SPDesktop *desktop); + }; +} // namespace Inkscape + +void sp_edit_clear_all(Inkscape::Selection *selection); + +void sp_edit_select_all(SPDesktop *desktop); +void sp_edit_select_all_in_all_layers (SPDesktop *desktop); +void sp_edit_invert (SPDesktop *desktop); +void sp_edit_invert_in_all_layers (SPDesktop *desktop); + + +SPCSSAttr *take_style_from_item (SPObject *object); + +void sp_selection_paste(SPDesktop *desktop, bool in_place); + +void sp_set_style_clipboard (SPCSSAttr *css); + + +void sp_selection_item_next (SPDesktop *desktop); +void sp_selection_item_prev (SPDesktop *desktop); + +void sp_selection_next_patheffect_param(SPDesktop * dt); + +//void sp_selection_edit_clip_or_mask(SPDesktop * dt, bool clip); + +enum SPSelectStrokeStyleType { + SP_FILL_COLOR = 0, + SP_STROKE_COLOR = 1, + SP_STROKE_STYLE_WIDTH = 2, + SP_STROKE_STYLE_DASHES = 3, + SP_STROKE_STYLE_MARKERS = 4, + SP_STROKE_STYLE_ALL = 5, + SP_STYLE_ALL = 6 +}; + +void sp_select_same_fill_stroke_style(SPDesktop *desktop, gboolean fill, gboolean strok, gboolean style); +void sp_select_same_object_type(SPDesktop *desktop); + +std::vector sp_get_same_style(SPItem *sel, std::vector &src, SPSelectStrokeStyleType type=SP_STYLE_ALL); +std::vector sp_get_same_object_type(SPItem *sel, std::vector &src); + +void scroll_to_show_item(SPDesktop *desktop, SPItem *item); + +void sp_undo (SPDesktop *desktop, SPDocument *doc); +void sp_redo (SPDesktop *desktop, SPDocument *doc); + +bool fit_canvas_to_drawing(SPDocument *, bool with_margins = false); +void fit_canvas_to_drawing(SPDesktop *); + +void unlock_all(SPDesktop *dt); +void unlock_all_in_all_layers(SPDesktop *dt); +void unhide_all(SPDesktop *dt); +void unhide_all_in_all_layers(SPDesktop *dt); + +std::vector &get_all_items(std::vector &list, SPObject *from, SPDesktop *desktop, bool onlyvisible, bool onlysensitive, bool ingroups, std::vector const &exclude); + +std::vector sp_degroup_list (std::vector &items); + +/* selection cycling */ +enum SPCycleType +{ + SP_CYCLE_SIMPLE, + SP_CYCLE_VISIBLE, // cycle only visible items + SP_CYCLE_FOCUS // readjust visible area to view selected item +}; + + + +// TODO FIXME: This should be moved into preference repr +extern SPCycleType SP_CYCLING; + +#endif // SEEN_SELECTION_CHEMISTRY_H -- cgit v1.2.3