Code

Filter effects dialog:
[inkscape.git] / src / sp-item.h
index 9aee4b30af63b415f403f387276797144aff4e4b..89a74ceafd65f8982b4674b60c4168b4f36a2bb2 100644 (file)
@@ -91,8 +91,11 @@ struct SPItemCtx {
 /** Abstract base class for all visible shapes. */
 struct SPItem : public SPObject {
     enum BBoxType {
-        APPROXIMATE_BBOX,
+        // legacy behavior: includes crude stroke, markers; excludes long miters, blur margin; is known to be wrong for caps
+        APPROXIMATE_BBOX, 
+        // includes only the bare path bbox, no stroke, no nothing
         GEOMETRIC_BBOX,
+        // includes everything: correctly done stroke (with proper miters and caps), markers, filter margins (e.g. blur)
         RENDERING_BBOX
     };
 
@@ -135,7 +138,7 @@ struct SPItem : public SPObject {
     void setCenter(NR::Point object_centre);
     void unsetCenter();
     bool isCenterSet();
-    NR::Point getCenter();
+    NR::Point getCenter() const;
 
     bool isVisibleAndUnlocked() const;
     
@@ -204,7 +207,7 @@ struct SPItemClass {
 
 /* Methods */
 
-void sp_item_invoke_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsigned const clear);
+void sp_item_invoke_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsigned const clear, SPItem::BBoxType type = SPItem::APPROXIMATE_BBOX);
 void sp_item_invoke_bbox_full(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsigned const flags, unsigned const clear);
 
 unsigned sp_item_pos_in_parent(SPItem *item);
@@ -236,8 +239,8 @@ gint sp_item_event (SPItem *item, SPEvent *event);
 
 NRArenaItem *sp_item_get_arenaitem(SPItem *item, unsigned int key);
 
-void sp_item_bbox_desktop(SPItem *item, NRRect *bbox) __attribute__ ((deprecated));
-NR::Rect sp_item_bbox_desktop(SPItem *item);
+void sp_item_bbox_desktop(SPItem *item, NRRect *bbox, SPItem::BBoxType type = SPItem::APPROXIMATE_BBOX) __attribute__ ((deprecated));
+NR::Maybe<NR::Rect> sp_item_bbox_desktop(SPItem *item, SPItem::BBoxType type = SPItem::APPROXIMATE_BBOX);
 
 NR::Matrix i2anc_affine(SPObject const *item, SPObject const *ancestor);
 NR::Matrix i2i_affine(SPObject const *src, SPObject const *dest);