Code

Node tool: correctly save node skewing to undo history
[inkscape.git] / src / sp-item-group.h
index 5af7a7b946f248570c80e20752e94389783a8274..932241a42f6b8eaae25ed798764c01dd45ef7e93 100644 (file)
 #define SP_IS_GROUP(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_GROUP))
 #define SP_IS_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_GROUP))
 
-class CGroup;
+#define SP_IS_LAYER(obj)         (SP_IS_GROUP(obj) && SP_GROUP(obj)->layerMode() == SPGroup::LAYER)
 
-namespace NR{ struct translate; }
+class CGroup;
 
 struct SPGroup : public SPLPEItem {
-       enum LayerMode { GROUP, LAYER };
+    enum LayerMode { GROUP, LAYER, MASK_HELPER };
 
-       LayerMode _layer_mode;
-       std::map<unsigned int, LayerMode> _display_modes;
+    LayerMode _layer_mode;
+    std::map<unsigned int, LayerMode> _display_modes;
 
-       LayerMode layerMode() const { return _layer_mode; }
-       void setLayerMode(LayerMode mode);
+    LayerMode layerMode() const { return _layer_mode; }
+    void setLayerMode(LayerMode mode);
 
-       LayerMode effectiveLayerMode(unsigned int display_key) const {
-               if ( _layer_mode == LAYER ) {
-                       return LAYER;
-               } else {
-                       return layerDisplayMode(display_key);
-               }
-       }
+    LayerMode effectiveLayerMode(unsigned int display_key) const {
+        if ( _layer_mode == LAYER ) {
+            return LAYER;
+        } else {
+            return layerDisplayMode(display_key);
+        }
+    }
 
-       LayerMode layerDisplayMode(unsigned int display_key) const;
-       void setLayerDisplayMode(unsigned int display_key, LayerMode mode);
-       void translateChildItems(NR::translate const &tr);
+    LayerMode layerDisplayMode(unsigned int display_key) const;
+    void setLayerDisplayMode(unsigned int display_key, LayerMode mode);
+    void translateChildItems(Geom::Translate const &tr);
 
     CGroup *group;
     
 private:
-       void _updateLayerMode(unsigned int display_key=0);
+    void _updateLayerMode(unsigned int display_key=0);
 };
 
 struct SPGroupClass {
-       SPLPEItemClass parent_class;
+    SPLPEItemClass parent_class;
 };
 
 /*
@@ -69,7 +69,7 @@ public:
     virtual void onChildRemoved(Inkscape::XML::Node *child);
     virtual void onUpdate(SPCtx *ctx, unsigned int flags);
     virtual void onModified(guint flags);
-    virtual void calculateBBox(NRRect *bbox, NR::Matrix const &transform, unsigned const flags);
+    virtual void calculateBBox(NRRect *bbox, Geom::Matrix const &transform, unsigned const flags);
     virtual void onPrint(SPPrintContext *ctx);
     virtual void onOrderChanged(Inkscape::XML::Node *child, Inkscape::XML::Node *old_ref, Inkscape::XML::Node *new_ref);
     virtual gchar *getDescription();
@@ -93,3 +93,14 @@ GSList *sp_item_group_item_list (SPGroup *group);
 SPObject *sp_item_group_get_child_by_name (SPGroup *group, SPObject *ref, const gchar *name);
 
 #endif
+
+/*
+  Local Variables:
+  mode:c++
+  c-file-style:"stroustrup"
+  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+  indent-tabs-mode:nil
+  fill-column:99
+  End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :