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

« back to all changes in this revision

Viewing changes to src/selection.h

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook, Ted Gould, Kees Cook
  • Date: 2009-06-24 14:00:43 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090624140043-07stp20mry48hqup
Tags: 0.47~pre0-0ubuntu1
* New upstream release

[ Ted Gould ]
* debian/control: Adding libgsl0 and removing version specifics on boost

[ Kees Cook ]
* debian/watch: updated to run uupdate and mangle pre-release versions.
* Dropped patches that have been taken upstream:
  - 01_mips
  - 02-poppler-0.8.3
  - 03-chinese-inkscape
  - 05_fix_latex_patch
  - 06_gcc-4.4
  - 07_cdr2svg
  - 08_skip-bad-utf-on-pdf-import
  - 09_gtk-clist
  - 10_belarussian
  - 11_libpng
  - 12_desktop
  - 13_slider
  - 100_svg_import_improvements
  - 102_sp_pattern_painter_free
  - 103_bitmap_type_print

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
#include <vector>
20
20
#include <map>
 
21
#include <list>
21
22
#include <sigc++/sigc++.h>
22
23
 
23
 
#include "libnr/nr-rect.h"
 
24
//#include "libnr/nr-rect.h"
24
25
#include "libnr/nr-convex-hull.h"
25
26
#include "forward.h"
26
27
#include "gc-managed.h"
29
30
#include "gc-soft-ptr.h"
30
31
#include "util/list.h"
31
32
#include "sp-item.h"
 
33
#include "snapped-point.h"
32
34
 
33
35
class SPItem;
 
36
class SPBox3D;
 
37
class Persp3D;
34
38
 
35
39
namespace Inkscape {
36
40
namespace XML {
54
58
 * at the given desktop. Both SPItem and SPRepr lists can be retrieved
55
59
 * from the selection. Many actions operate on the selection, so it is
56
60
 * widely used throughout the code.
57
 
 * It also implements its own asynchronous notification signals that 
 
61
 * It also implements its own asynchronous notification signals that
58
62
 * UI elements can listen to.
59
63
 */
60
64
class Selection : public Inkscape::GC::Managed<>,
225
229
    ///      method for that
226
230
    GSList const *reprList();
227
231
 
 
232
    /* list of all perspectives which have a 3D box in the current selection
 
233
       (these may also be nested in groups) */
 
234
    std::list<Persp3D *> const perspList();
 
235
 
 
236
    std::list<SPBox3D *> const box3DList();
 
237
 
228
238
    /** @brief Returns the number of layers in which there are selected objects */
229
239
    guint numberOfLayers();
230
240
 
234
244
    /** @brief Returns the bounding rectangle of the selection */
235
245
    NRRect *bounds(NRRect *dest, SPItem::BBoxType type = SPItem::APPROXIMATE_BBOX) const;
236
246
    /** @brief Returns the bounding rectangle of the selection */
237
 
    NR::Maybe<NR::Rect> bounds(SPItem::BBoxType type = SPItem::APPROXIMATE_BBOX) const;
 
247
    Geom::OptRect bounds(SPItem::BBoxType type = SPItem::APPROXIMATE_BBOX) const;
238
248
 
239
249
    /**
240
250
     * @brief Returns the bounding rectangle of the selection
241
251
     *
242
252
     * \todo how is this different from bounds()?
243
 
     */ 
 
253
     */
244
254
    NRRect *boundsInDocument(NRRect *dest, SPItem::BBoxType type = SPItem::APPROXIMATE_BBOX) const;
245
255
 
246
256
    /**
248
258
     *
249
259
     * \todo how is this different from bounds()?
250
260
     */
251
 
    NR::Maybe<NR::Rect> boundsInDocument(SPItem::BBoxType type = SPItem::APPROXIMATE_BBOX) const;
 
261
    Geom::OptRect boundsInDocument(SPItem::BBoxType type = SPItem::APPROXIMATE_BBOX) const;
252
262
 
253
263
    /**
254
264
     * @brief Returns the rotation/skew center of the selection
255
265
     */
256
 
    NR::Maybe<NR::Point> center() const;
 
266
    boost::optional<Geom::Point> center() const;
257
267
 
258
268
    /**
259
269
     * @brief Gets the selection's snap points.
260
270
     * @return Selection's snap points
261
271
     */
262
 
    std::vector<NR::Point> getSnapPoints(bool includeItemCenter) const;
 
272
    std::vector<std::pair<Geom::Point, int> > getSnapPoints(SnapPreferences const *snapprefs) const;
263
273
 
264
274
    /**
265
275
     * @brief Gets the snap points of a selection that form a convex hull.
266
276
     * @return Selection's convex hull points
267
277
     */
268
 
    std::vector<NR::Point> getSnapPointsConvexHull() const;
 
278
    std::vector<std::pair<Geom::Point, int> > getSnapPointsConvexHull(SnapPreferences const *snapprefs) const;
269
279
 
270
280
    /**
271
281
     * @brief Connects a slot to be notified of selection changes
282
292
    }
283
293
 
284
294
    /**
285
 
     * @brief Connects a slot to be notified of selected 
286
 
     *        object modifications 
 
295
     * @brief Connects a slot to be notified of selected
 
296
     *        object modifications
287
297
     *
288
298
     * This method connects the given slot such that it will
289
299
     * receive notifications whenever any selected item is
336
346
    mutable GSList *_reprs;
337
347
    mutable GSList *_items;
338
348
 
 
349
    void add_box_perspective(SPBox3D *box);
 
350
    void add_3D_boxes_recursively(SPObject *obj);
 
351
    void remove_box_perspective(SPBox3D *box);
 
352
    void remove_3D_boxes_recursively(SPObject *obj);
 
353
 
 
354
    std::map<Persp3D *, unsigned int> _persps;
 
355
    std::list<SPBox3D *> _3dboxes;
 
356
 
339
357
    GC::soft_ptr<SPDesktop> _desktop;
340
358
    SPObject* _selection_context;
341
359
    guint _flags;