Logo Search packages:      
Sourcecode: inkscape version File versions

SPRepr * SPObject::updateRepr ( SPRepr *  repr,
unsigned int  flags 
) [inherited]

Updates the given repr based on the object's state.

This method updates the given repr to reflect the object's current state. There are several flags that affect this:

SP_OBJECT_WRITE_BUILD - create new reprs

SP_OBJECT_WRITE_EXT - write elements and attributes which are not part of pure SVG (i.e. the Inkscape and Sodipodi namespaces)

SP_OBJECT_WRITE_ALL - create all nodes and attributes, even those which might be redundant

Parameters:
repr the repr to update
flags object write flags that apply to this update
Returns:
the updated repr

Definition at line 934 of file sp-object.cpp.

                                                             {
      if (SP_OBJECT_IS_CLONED(this)) {
            /* cloned objects have no repr */
            return NULL;
      }
      if (((SPObjectClass *) G_OBJECT_GET_CLASS(this))->write) {
            if (!(flags & SP_OBJECT_WRITE_BUILD) && !repr) {
                  repr = SP_OBJECT_REPR (this);
            }
            return ((SPObjectClass *) G_OBJECT_GET_CLASS(this))->write (this, repr, flags);
      } else {
            g_warning ("Class %s does not implement ::write", G_OBJECT_TYPE_NAME (this));
            if (!repr) {
                  if (flags & SP_OBJECT_WRITE_BUILD) {
                        repr = sp_repr_duplicate (SP_OBJECT_REPR (this));
                  }
                  /* fixme: else probably error (Lauris) */
            } else {
                  sp_repr_merge (repr, SP_OBJECT_REPR (this), "id");
            }
            return repr;
      }
}


Generated by  Doxygen 1.6.0   Back to index