Code

Implement object-snapping for clones (see bug #1511260)
[inkscape.git] / src / sp-fecolormatrix.cpp
index 98333cc5188ee1d1eb10f3064ef001f15b677c34..747ceeb4f1195470fd7ed3c3fc438fa975397e3b 100644 (file)
 #include "sp-fecolormatrix.h"
 #include "xml/repr.h"
 
-//#define SP_MACROS_SILENT
-//#include "macros.h"
-
-#define DEBUG_FECOLORMATRIX
-#ifdef DEBUG_FECOLORMATRIX
-# define debug(f, a...) { g_print("%s(%d) %s:", \
-                                  __FILE__,__LINE__,__FUNCTION__); \
-                          g_print(f, ## a); \
-                          g_print("\n"); \
-                        }
-#else
-# define debug(f, a...) /**/
-#endif
 
 /* FeColorMatrix base class */
 
@@ -47,7 +34,7 @@ static void sp_feColorMatrix_set(SPObject *object, unsigned int key, gchar const
 static void sp_feColorMatrix_update(SPObject *object, SPCtx *ctx, guint flags);
 static Inkscape::XML::Node *sp_feColorMatrix_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
 
-static SPObjectClass *feColorMatrix_parent_class;
+static SPFilterPrimitiveClass *feColorMatrix_parent_class;
 
 GType
 sp_feColorMatrix_get_type()
@@ -65,7 +52,7 @@ sp_feColorMatrix_get_type()
             (GInstanceInitFunc) sp_feColorMatrix_init,
             NULL,    /* value_table */
         };
-        feColorMatrix_type = g_type_register_static(SP_TYPE_OBJECT, "SPFeColorMatrix", &feColorMatrix_info, (GTypeFlags)0);
+        feColorMatrix_type = g_type_register_static(SP_TYPE_FILTER_PRIMITIVE, "SPFeColorMatrix", &feColorMatrix_info, (GTypeFlags)0);
     }
     return feColorMatrix_type;
 }
@@ -75,7 +62,7 @@ sp_feColorMatrix_class_init(SPFeColorMatrixClass *klass)
 {
     SPObjectClass *sp_object_class = (SPObjectClass *)klass;
 
-    feColorMatrix_parent_class = (SPObjectClass*)g_type_class_peek_parent(klass);
+    feColorMatrix_parent_class = (SPFilterPrimitiveClass*)g_type_class_peek_parent(klass);
 
     sp_object_class->build = sp_feColorMatrix_build;
     sp_object_class->release = sp_feColorMatrix_release;
@@ -87,7 +74,6 @@ sp_feColorMatrix_class_init(SPFeColorMatrixClass *klass)
 static void
 sp_feColorMatrix_init(SPFeColorMatrix *feColorMatrix)
 {
-    debug("0x%p",feColorMatrix);
 }
 
 /**
@@ -98,7 +84,6 @@ sp_feColorMatrix_init(SPFeColorMatrix *feColorMatrix)
 static void
 sp_feColorMatrix_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
 {
-    debug("0x%p",object);
     if (((SPObjectClass *) feColorMatrix_parent_class)->build) {
         ((SPObjectClass *) feColorMatrix_parent_class)->build(object, document, repr);
     }
@@ -112,8 +97,6 @@ sp_feColorMatrix_build(SPObject *object, SPDocument *document, Inkscape::XML::No
 static void
 sp_feColorMatrix_release(SPObject *object)
 {
-    debug("0x%p",object);
-
     if (((SPObjectClass *) feColorMatrix_parent_class)->release)
         ((SPObjectClass *) feColorMatrix_parent_class)->release(object);
 }
@@ -124,11 +107,10 @@ sp_feColorMatrix_release(SPObject *object)
 static void
 sp_feColorMatrix_set(SPObject *object, unsigned int key, gchar const *value)
 {
-    debug("0x%p %s(%u): '%s'",object,
-            sp_attribute_name(key),key,value);
     SPFeColorMatrix *feColorMatrix = SP_FECOLORMATRIX(object);
+    (void)feColorMatrix;
 
-    switch(key) {\r
+    switch(key) {
        /*DEAL WITH SETTING ATTRIBUTES HERE*/
         default:
             if (((SPObjectClass *) feColorMatrix_parent_class)->set)
@@ -144,8 +126,6 @@ sp_feColorMatrix_set(SPObject *object, unsigned int key, gchar const *value)
 static void
 sp_feColorMatrix_update(SPObject *object, SPCtx *ctx, guint flags)
 {
-    debug("0x%p",object);
-
     if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG |
                  SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
 
@@ -164,15 +144,13 @@ sp_feColorMatrix_update(SPObject *object, SPCtx *ctx, guint flags)
 static Inkscape::XML::Node *
 sp_feColorMatrix_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
 {
-    debug("0x%p",object);
-
     // Inkscape-only object, not copied during an "plain SVG" dump:
     if (flags & SP_OBJECT_WRITE_EXT) {
         if (repr) {
             // is this sane?
             repr->mergeFrom(SP_OBJECT_REPR(object), "id");
         } else {
-            repr = SP_OBJECT_REPR(object)->duplicate();
+            repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
         }
     }