Code

Fix ef spam when adjusting pattern on text - patch from Adonis Papaderos
[inkscape.git] / src / sp-object.h
index ccc063d5f1d688ab323bc609aa8b36867861881a..59cab2328252d99cebe84bf2b760a5620f6360fd 100644 (file)
@@ -45,7 +45,7 @@
 #define SP_OBJECT_WRITE_ALL (1 << 2)
 
 /* Convenience stuff */
-#define SP_OBJECT_ID(o) (((SPObject *) (o))->id)
+#define SP_OBJECT_ID(o) (((SPObject *) (o))->getId())
 #define SP_OBJECT_REPR(o) (((SPObject *) (o))->repr)
 #define SP_OBJECT_DOCUMENT(o) (((SPObject *) (o))->document)
 #define SP_OBJECT_PARENT(o) (((SPObject *) (o))->parent)
@@ -155,7 +155,15 @@ struct SPObject : public GObject {
     SPObject *_last_child; /* Remembered last child */
     SPObject *next; /* Next object in linked list */
     Inkscape::XML::Node *repr; /* Our xml representation */
+
+private:
     gchar *id; /* Our very own unique id */
+public:
+
+    /**
+     * Returns the objects current ID string.
+     */
+    gchar const* getId() const;
 
     /** @brief cleans up an SPObject, releasing its references and
      *         requesting that references to it be released
@@ -213,6 +221,9 @@ struct SPObject : public GObject {
     /* A non-const version can be similarly constructed if you want one.
      * (Don't just cast away the constness, which would be ill-formed.) */
 
+    SPObject *getNext();
+    SPObject *getPrev();
+
     bool hasChildren() const { return ( children != NULL ); }
 
     SPObject *firstChild() { return children; }
@@ -241,12 +252,12 @@ struct SPObject : public GObject {
     /** Retrieves the title of this object */
     gchar *title() const;
     /** Sets the title of this object */
-    void setTitle(gchar const *title);
+    bool setTitle(gchar const *title, bool verbatim=false);
 
     /** Retrieves the description of this object */
     gchar *desc() const;
     /** Sets the description of this object */
-    void setDesc(gchar const *desc);
+    bool setDesc(gchar const *desc, bool verbatim=false);
 
     /** @brief Set the policy under which this object will be
      *         orphan-collected.
@@ -491,10 +502,12 @@ struct SPObject : public GObject {
 private:
     // Private member functions used in the definitions of setTitle(),
     // setDesc(), title() and desc().
-    void setTitleOrDesc(gchar const *value, gchar const *svg_tagname);
+    bool setTitleOrDesc(gchar const *value, gchar const *svg_tagname, bool verbatim);
     gchar * getTitleOrDesc(gchar const *svg_tagname) const;
     SPObject * findFirstChild(gchar const *tagname) const;
     GString * textualContent() const;
+
+    friend class SPObjectImpl;
 };
 
 /// The SPObject vtable.
@@ -554,8 +567,6 @@ void sp_object_removeAttribute(SPObject *object, gchar const *key, SPException *
 gchar const *sp_object_get_style_property(SPObject const *object,
                                           gchar const *key, gchar const *def);
 
-Inkscape::Version sp_object_get_sodipodi_version(SPObject *object);
-
 int sp_object_compare_position(SPObject const *first, SPObject const *second);
 
 SPObject *sp_object_prev(SPObject *child);
@@ -573,4 +584,4 @@ SPObject *sp_object_prev(SPObject *child);
   fill-column:99
   End:
 */
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :