~valavanisalex/ubuntu/oneiric/inkscape/inkscape_0.48.1-2ubuntu4

« back to all changes in this revision

Viewing changes to src/shape-editor.h

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook, Kees Cook, Ted Gould
  • Date: 2008-02-10 14:20:16 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20080210142016-vcnb2zqyhszu0xvb
Tags: 0.46~pre1-0ubuntu1
[ Kees Cook ]
* debian/control:
  - add libgtkspell-dev build-dep to gain GtkSpell features (LP: #183547).
  - update Standards version (no changes needed).
  - add Vcs and Homepage fields.
  - switch to new python-lxml dep.
* debian/{control,rules}: switch from dpatch to quilt for more sanity.
* debian/patches/20_fix_glib_and_gxx43_ftbfs.patch:
  - merged against upstream fixes.
  - added additional fixes for newly written code.
* debian/rules: enable parallel building.

[ Ted Gould ]
* Updating POTFILES.in to make it so things build correctly.
* debian/control:
  - add ImageMagick++ and libboost-dev to build-deps

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __SHAPE_EDITOR_H__
 
2
#define __SHAPE_EDITOR_H__
 
3
 
 
4
/*
 
5
 * Inkscape::ShapeEditor
 
6
 *
 
7
 * This is a container class which contains either knotholder (for shapes) or nodepath (for
 
8
 * paths). It is attached to a single item so only one of these is active at a time.
 
9
 *
 
10
 * Authors:
 
11
 *   bulia byak <buliabyak@users.sf.net>
 
12
 *
 
13
 */
 
14
 
 
15
#include <forward.h>
 
16
 
 
17
namespace Inkscape {
 
18
namespace NodePath {
 
19
class Path;
 
20
}
 
21
}
 
22
 
 
23
#include "libnr/nr-path-code.h"
 
24
#include "libnr/nr-point.h"
 
25
#include "libnr/nr-maybe.h"
 
26
 
 
27
class SPKnotHolder;
 
28
class SPDesktop;
 
29
class SPNodeContext;
 
30
class ShapeEditorsCollective;
 
31
 
 
32
class ShapeEditor {
 
33
public:
 
34
 
 
35
    ShapeEditor(SPDesktop *desktop);
 
36
    ~ShapeEditor();
 
37
 
 
38
    void set_item (SPItem *item);
 
39
    void set_item_livepatheffect_parameter(SPItem *item, SPObject *lpeobject, const char * key);
 
40
    void reset_item ();
 
41
    void unset_item ();
 
42
 
 
43
    SPItem *get_item ();
 
44
 
 
45
    bool has_nodepath ();
 
46
    bool has_knotholder ();
 
47
 
 
48
    bool has_local_change ();
 
49
    void decrement_local_change ();
 
50
 
 
51
    GList *save_nodepath_selection ();
 
52
    void restore_nodepath_selection (GList *saved);
 
53
 
 
54
    void nodepath_destroyed ();
 
55
 
 
56
    void update_statusbar ();
 
57
 
 
58
    bool is_over_stroke (NR::Point event_p, bool remember);
 
59
 
 
60
    void add_node_near_point(); // uses the shapeeditor's remembered point, if any
 
61
 
 
62
    void select_segment_near_point(bool toggle); // uses the shapeeditor's remembered point, if any
 
63
 
 
64
    void cancel_hit ();
 
65
 
 
66
    bool hits_curve ();
 
67
 
 
68
    void curve_drag (gdouble eventx, gdouble eventy);
 
69
 
 
70
    void finish_drag ();
 
71
 
 
72
    void select_rect (NR::Rect  const &rect, bool add);
 
73
 
 
74
    bool has_selection ();
 
75
    void deselect ();
 
76
 
 
77
    Inkscape::NodePath::Path *get_nodepath() {return nodepath;} //((deprecated))
 
78
    ShapeEditorsCollective *get_container() {return container;}
 
79
 
 
80
    void add_node();
 
81
 
 
82
    void delete_nodes();
 
83
    void delete_nodes_preserving_shape();
 
84
    void delete_segment();
 
85
 
 
86
    void set_node_type(int type);
 
87
 
 
88
    void break_at_nodes();
 
89
    void join_nodes();
 
90
    void join_segments();
 
91
 
 
92
    void duplicate_nodes();
 
93
 
 
94
    void set_type_of_segments(NRPathcode code);
 
95
 
 
96
    void move_nodes(gdouble dx, gdouble dy);
 
97
    void move_nodes_screen(gdouble dx, gdouble dy);
 
98
 
 
99
    void rotate_nodes(gdouble angle, int which, bool screen);
 
100
 
 
101
    void scale_nodes(gdouble const grow, int const which);
 
102
    void scale_nodes_screen(gdouble const grow, int const which);
 
103
 
 
104
    void select_all (bool invert);
 
105
    void select_all_from_subpath (bool invert);
 
106
    void select_next ();
 
107
    void select_prev ();
 
108
 
 
109
    void show_handles (bool show);
 
110
 
 
111
    void flip (NR::Dim2 axis, NR::Maybe<NR::Point> center = NR::Nothing());
 
112
 
 
113
    void distribute (NR::Dim2 axis);
 
114
    void align (NR::Dim2 axis);
 
115
 
 
116
    bool nodepath_edits_repr_key(gchar const *name);
 
117
 
 
118
private:
 
119
    SPDesktop *desktop;
 
120
 
 
121
    Inkscape::NodePath::Path *nodepath;
 
122
    SPKnotHolder *knotholder;
 
123
 
 
124
    ShapeEditorsCollective *container;
 
125
 
 
126
    //Inkscape::XML::Node *lidtened_repr;
 
127
 
 
128
    double grab_t;
 
129
    int grab_node; // number of node grabbed by sp_node_context_is_over_stroke
 
130
    bool hit;
 
131
    NR::Point curvepoint_event; // int coords from event
 
132
    NR::Point curvepoint_doc; // same, in doc coords
 
133
};
 
134
 
 
135
 
 
136
/* As the next stage, this will be a collection of multiple ShapeEditors,
 
137
with the same interface as the single ShapeEditor, passing the actions to all its
 
138
contained ShapeEditors. Thus it should be easy to switch node context from 
 
139
using a single ShapeEditor to using a ShapeEditorsCollective. */
 
140
 
 
141
class ShapeEditorsCollective {
 
142
public:
 
143
 
 
144
    ShapeEditorsCollective(SPDesktop *desktop);
 
145
    ~ShapeEditorsCollective();
 
146
 
 
147
    void update_statusbar();
 
148
 
 
149
private:
 
150
    std::vector<ShapeEditor> editors;
 
151
 
 
152
    SPNodeContext *nc; // who holds us
 
153
};
 
154
 
 
155
#endif
 
156
 
 
157
 
 
158
/*
 
159
  Local Variables:
 
160
  mode:c++
 
161
  c-file-style:"stroustrup"
 
162
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
 
163
  indent-tabs-mode:nil
 
164
  fill-column:99
 
165
  End:
 
166
*/
 
167
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
 
168