nr-arena-item.h revision ef494f75ca77f36881ad59e94263a07c146c3649
/*
* RGBA display list system for inkscape
*
* Author:
* Lauris Kaplinski <lauris@kaplinski.com>
*
* Copyright (C) 2001-2002 Lauris Kaplinski
* Copyright (C) 2001 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifndef SEEN_DISPLAY_NR_ARENA_ITEM_H
#define SEEN_DISPLAY_NR_ARENA_ITEM_H
#include <cairo.h>
#include "libnr/nr-forward.h"
#include "libnr/nr-rect-l.h"
#include "libnr/nr-object.h"
#include "gc-soft-ptr.h"
#include "nr-arena-forward.h"
} }
#define NR_TYPE_ARENA_ITEM (nr_arena_item_get_type ())
/*
* NRArenaItem state flags
*/
/*
* NR_ARENA_ITEM_STATE_INVALID
*
* If set or retuned indicates, that given object is in error.
* Calling method has to return immediately, with appropriate
* error flag.
*/
#define NR_ARENA_ITEM_STATE_INVALID (1 << 0)
#define NR_ARENA_ITEM_STATE_NONE 0x0000
#define NR_ARENA_ITEM_STATE_ALL 0x01fe
#define NR_ARENA_ITEM_RENDER_NO_CACHE (1 << 0)
struct NRGC {
};
/* Item state */
unsigned int state : 16;
unsigned int propagate : 1;
unsigned int sensitive : 1;
unsigned int visible : 1;
/* Whether items renders opacity itself */
unsigned int render_opacity : 1;
/* Opacity itself */
unsigned int opacity : 8;
unsigned int key; ///< Some SPItems can have more than one NRArenaItem,
///this value is a hack used to distinguish between them
Geom::Affine *transform; ///< Incremental transform of this item, as given by the transform= attribute
unsigned char *px; ///< Render cache; unused
void *data; ///< Anonymous data member - this is used to associate SPItems with arena items
bool background_new;
}
};
unsigned int (* update) (NRArenaItem *item, NRRectL *area, NRGC *gc, unsigned int state, unsigned int reset);
unsigned int (* render) (cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags);
};
NRType nr_arena_item_get_type (void);
/*
* Invoke update to given state, if item is inside area
*
* area == NULL is infinite
* gc is PARENT gc for invoke, CHILD gc in corresponding virtual method
* state - requested to state (bitwise or of requested flags)
* reset - reset to state (bitwise or of flags to reset)
*/
unsigned int nr_arena_item_invoke_update (NRArenaItem *item, NRRectL *area, NRGC *gc, unsigned int state, unsigned int reset);
unsigned int nr_arena_item_invoke_render(cairo_t *ct, NRArenaItem *item, NRRectL const *area, NRPixBlock *pb, unsigned int flags);
NRArenaItem *nr_arena_item_invoke_pick (NRArenaItem *item, Geom::Point p, double delta, unsigned int sticky);
/* Public */
/* Helpers */
NRArenaItem *nr_arena_item_attach (NRArenaItem *parent, NRArenaItem *child, NRArenaItem *prev, NRArenaItem *next);
#endif /* !SEEN_DISPLAY_NR_ARENA_ITEM_H */
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :