Code

Merge and cleanup of GSoC C++-ification project.
[inkscape.git] / src / selection-chemistry.h
1 #ifndef SEEN_SELECTION_CHEMISTRY_H
2 #define SEEN_SELECTION_CHEMISTRY_H
4 /*
5  * Miscellanous operations on selected items
6  *
7  * Authors:
8  *   Lauris Kaplinski <lauris@kaplinski.com>
9  *   Frank Felfe <innerspace@iname.com>
10  *   bulia byak <buliabyak@users.sf.net>
11  *   Jon A. Cruz <jon@joncruz.org>
12  *   Abhishek Sharma
13  *
14  * Copyright (C) 1999-2010 authors
15  * Copyright (C) 2001-2002 Ximian, Inc.
16  *
17  * Released under GNU GPL, read the file 'COPYING' for more information
18  */
20 #include "forward.h"
21 #include "sp-item.h"
22 #include "2geom/forward.h"
24 namespace Inkscape { class Selection; }
26 namespace Inkscape {
27 namespace LivePathEffect {
28     class PathParam;
29 }
30 }
32 class SPCSSAttr;
34 namespace Inkscape {
35     class SelectionHelper {
36     public:
37         static void selectAll(SPDesktop *desktop);
38         static void selectAllInAll(SPDesktop *desktop);
39         static void selectNone(SPDesktop *desktop);
40         static void invert(SPDesktop *desktop);
41         static void invertAllInAll(SPDesktop *desktop);
42         static void reverse(SPDesktop *dt);
43         static void selectNext(SPDesktop *desktop);
44         static void selectPrev(SPDesktop *desktop);
45     };
46 } // namespace Inkscape
48 void sp_selection_delete(SPDesktop *desktop);
49 void sp_selection_duplicate(SPDesktop *desktop, bool suppressDone = false);
50 void sp_edit_clear_all(SPDesktop *desktop);
52 void sp_edit_select_all(SPDesktop *desktop);
53 void sp_edit_select_all_in_all_layers (SPDesktop *desktop);
54 void sp_edit_invert (SPDesktop *desktop);
55 void sp_edit_invert_in_all_layers (SPDesktop *desktop);
57 void sp_selection_clone(SPDesktop *desktop);
58 void sp_selection_unlink(SPDesktop *desktop);
59 void sp_selection_relink(SPDesktop *desktop);
60 void sp_select_clone_original(SPDesktop *desktop);
62 void sp_selection_to_marker(SPDesktop *desktop, bool apply = true);
63 void sp_selection_to_guides(SPDesktop *desktop);
65 void sp_selection_tile(SPDesktop *desktop, bool apply = true);
66 void sp_selection_untile(SPDesktop *desktop);
68 //void sp_selection_group_impl(GSList const *reprs_to_group, Inkscape::XML::Node *group, Inkscape::XML::Document *xml_doc, SPDocument *doc);
69 void sp_selection_group(SPDesktop *desktop);
70 void sp_selection_ungroup(SPDesktop *desktop);
72 void sp_selection_raise(SPDesktop *desktop);
73 void sp_selection_raise_to_top(SPDesktop *desktop);
74 void sp_selection_lower(SPDesktop *desktop);
75 void sp_selection_lower_to_bottom(SPDesktop *desktop);
77 SPCSSAttr *take_style_from_item (SPItem *item);
79 void sp_selection_cut(SPDesktop *desktop);
80 void sp_selection_copy(SPDesktop *desktop);
81 void sp_selection_paste(SPDesktop *desktop, bool in_place);
82 void sp_selection_paste_style(SPDesktop *desktop);
83 void sp_selection_paste_livepatheffect(SPDesktop *desktop);
84 void sp_selection_remove_livepatheffect(SPDesktop *desktop);
86 void sp_selection_remove_filter(SPDesktop *desktop);
88 void sp_set_style_clipboard (SPCSSAttr *css);
90 void sp_selection_paste_size(SPDesktop *desktop, bool apply_x, bool apply_y);
91 void sp_selection_paste_size_separately(SPDesktop *desktop, bool apply_x, bool apply_y);
93 void sp_selection_to_next_layer( SPDesktop *desktop, bool suppressDone = false );
94 void sp_selection_to_prev_layer( SPDesktop *desktop, bool suppressDone = false );
96 void sp_selection_apply_affine(Inkscape::Selection *selection, Geom::Matrix const &affine, bool set_i2d = true, bool compensate = true);
97 void sp_selection_remove_transform (SPDesktop *desktop);
98 void sp_selection_scale_absolute (Inkscape::Selection *selection, double x0, double x1, double y0, double y1);
99 void sp_selection_scale_relative(Inkscape::Selection *selection, Geom::Point const &align, Geom::Scale const &scale);
100 void sp_selection_rotate_relative (Inkscape::Selection *selection, Geom::Point const &center, gdouble angle);
101 void sp_selection_skew_relative (Inkscape::Selection *selection, Geom::Point const &align, double dx, double dy);
102 void sp_selection_move_relative (Inkscape::Selection *selection, Geom::Point const &move, bool compensate = true);
103 void sp_selection_move_relative (Inkscape::Selection *selection, double dx, double dy);
105 void sp_selection_rotate_90 (SPDesktop *desktop, bool ccw);
106 void sp_selection_rotate (Inkscape::Selection *selection, gdouble angle);
107 void sp_selection_rotate_screen (Inkscape::Selection *selection, gdouble angle);
109 void sp_selection_scale (Inkscape::Selection *selection, gdouble grow);
110 void sp_selection_scale_screen (Inkscape::Selection *selection, gdouble grow_pixels);
111 void sp_selection_scale_times (Inkscape::Selection *selection, gdouble times);
113 void sp_selection_move (SPDesktop *desktop, gdouble dx, gdouble dy);
114 void sp_selection_move_screen (SPDesktop *desktop, gdouble dx, gdouble dy);
116 void sp_selection_item_next (SPDesktop *desktop);
117 void sp_selection_item_prev (SPDesktop *desktop);
119 void sp_selection_next_patheffect_param(SPDesktop * dt);
121 void sp_selection_edit_clip_or_mask(SPDesktop * dt, bool clip);
123 void scroll_to_show_item(SPDesktop *desktop, SPItem *item);
125 void sp_undo (SPDesktop *desktop, SPDocument *doc);
126 void sp_redo (SPDesktop *desktop, SPDocument *doc);
128 void sp_selection_get_export_hints (Inkscape::Selection *selection, const char **filename, float *xdpi, float *ydpi);
129 void sp_document_get_export_hints (SPDocument * doc, const char **filename, float *xdpi, float *ydpi);
131 void sp_selection_create_bitmap_copy (SPDesktop *desktop);
133 void sp_selection_set_mask(SPDesktop *desktop, bool apply_clip_path, bool apply_to_layer);
134 void sp_selection_unset_mask(SPDesktop *desktop, bool apply_clip_path);
136 bool fit_canvas_to_selection(SPDesktop *, bool with_margins = false);
137 void verb_fit_canvas_to_selection(SPDesktop *);
138 bool fit_canvas_to_drawing(SPDocument *, bool with_margins = false);
139 void verb_fit_canvas_to_drawing(SPDesktop *);
140 void fit_canvas_to_selection_or_drawing(SPDesktop *);
142 void unlock_all(SPDesktop *dt);
143 void unlock_all_in_all_layers(SPDesktop *dt);
144 void unhide_all(SPDesktop *dt);
145 void unhide_all_in_all_layers(SPDesktop *dt);
147 GSList *sp_degroup_list (GSList *items);
149 /* selection cycling */
150 typedef enum
152     SP_CYCLE_SIMPLE,
153     SP_CYCLE_VISIBLE, // cycle only visible items
154     SP_CYCLE_FOCUS // readjust visible area to view selected item
155 } SPCycleType;
159 // TOOD fixme: This should be moved into preference repr
160 extern SPCycleType SP_CYCLING;
162 #endif // SEEN_SELECTION_CHEMISTRY_H