Code

Fix ef spam when adjusting pattern on text - patch from Adonis Papaderos
[inkscape.git] / src / sp-object.h
index 2932da728583d4e491d63edeb14ebdab34931856..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)
@@ -149,13 +149,21 @@ struct SPObject : public GObject {
     SPIXmlSpace xml_space;
     unsigned int hrefcount; /* number of xlink:href references */
     unsigned int _total_hrefcount; /* our hrefcount + total descendants */
-    Document *document; /* Document we are part of */
+    SPDocument *document; /* Document we are part of */
     SPObject *parent; /* Our parent (only one allowed) */
     SPObject *children; /* Our children */
     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; }
@@ -429,7 +440,7 @@ struct SPObject : public GObject {
 
     /** @brief Updates the object's display immediately
      *
-     *  This method is called during the idle loop by Document in order to update the object's
+     *  This method is called during the idle loop by SPDocument in order to update the object's
      *  display.
      *
      *  One additional flag is legal here:
@@ -495,13 +506,15 @@ private:
     gchar * getTitleOrDesc(gchar const *svg_tagname) const;
     SPObject * findFirstChild(gchar const *tagname) const;
     GString * textualContent() const;
+
+    friend class SPObjectImpl;
 };
 
 /// The SPObject vtable.
 struct SPObjectClass {
     GObjectClass parent_class;
 
-    void (* build) (SPObject *object, Document *doc, Inkscape::XML::Node *repr);
+    void (* build) (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr);
     void (* release) (SPObject *object);
 
     /* Virtual handlers of repr signals */
@@ -536,7 +549,7 @@ inline SPObject *sp_object_first_child(SPObject *parent) {
 }
 SPObject *sp_object_get_child_by_repr(SPObject *object, Inkscape::XML::Node *repr);
 
-void sp_object_invoke_build(SPObject *object, Document *document, Inkscape::XML::Node *repr, unsigned int cloned);
+void sp_object_invoke_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr, unsigned int cloned);
 
 void sp_object_set(SPObject *object, unsigned int key, gchar const *value);
 
@@ -571,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 :