Logo Search packages:      
Sourcecode: inkscape version File versions

void SPObject::updateDisplay ( SPCtx ctx,
unsigned int  flags 
) [inherited]

Updates the object's display immediately.

This method is called during the idle loop by SPDocument in order to update the object's display.

One additional flag is legal here:

SP_OBJECT_PARENT_MODIFIED_FLAG - the parent has been modified

Parameters:
ctx an SPCtx which accumulates various state during the recursive update -- beware! some subclasses try to cast this to an SPItemCtx *
flags flags indicating what to update (in addition to any already set flags)
Update views

Todo:
I am not sure whether we should check only propagated flag. We are currently assuming that style parsing is done immediately. I think this is correct (Lauris).

Todo:
in case of catching an exception we need to inform the user somehow that the document is corrupted maybe by implementing an document flag documentOk or by a modal error dialog

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

References sp_style_merge_from_parent(), and SPObject::style.

Referenced by SPDocument::_updateDocument(), and sp_tref_update().

{
    g_return_if_fail(!(flags & ~SP_OBJECT_MODIFIED_CASCADE));

    update_in_progress ++;

#ifdef SP_OBJECT_DEBUG_CASCADE
    g_print("Update %s:%s %x %x %x\n", g_type_name_from_instance((GTypeInstance *) this), SP_OBJECT_ID(this), flags, this->uflags, this->mflags);
#endif

    /* Get this flags */
    flags |= this->uflags;
    /* Copy flags to modified cascade for later processing */
    this->mflags |= this->uflags;
    /* We have to clear flags here to allow rescheduling update */
    this->uflags = 0;

    // Merge style if we have good reasons to think that parent style is changed */
    /** \todo
     * I am not sure whether we should check only propagated
     * flag. We are currently assuming that style parsing is
     * done immediately. I think this is correct (Lauris).
     */
    if ((flags & SP_OBJECT_STYLE_MODIFIED_FLAG) && (flags & SP_OBJECT_PARENT_MODIFIED_FLAG)) {
        if (this->style && this->parent) {
            sp_style_merge_from_parent(this->style, this->parent->style);
        }
    }

    try
    {
        if (((SPObjectClass *) G_OBJECT_GET_CLASS(this))->update)
            ((SPObjectClass *) G_OBJECT_GET_CLASS(this))->update(this, ctx, flags);
    }
    catch(...)
    {
        /** \todo 
        * in case of catching an exception we need to inform the user somehow that the document is corrupted
        * maybe by implementing an document flag documentOk
        * or by a modal error dialog
        */
        g_warning("SPObject::updateDisplay(SPCtx *ctx, unsigned int flags) : throw in ((SPObjectClass *) G_OBJECT_GET_CLASS(this))->update(this, ctx, flags);");
    }

    update_in_progress --;
}


Generated by  Doxygen 1.6.0   Back to index