nr-arena-item.h revision 9b00d76637485b69ec18c05dd4ec38200491ed7e
#ifndef __NR_ARENA_ITEM_H__
#define __NR_ARENA_ITEM_H__
/*
* 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
*/
#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)
#include <libnr/nr-matrix.h>
#include <libnr/nr-rect-l.h>
#include <libnr/nr-pixblock.h>
#include <libnr/nr-object.h>
#include "gc-soft-ptr.h"
#include "nr-arena-forward.h"
#include "display/nr-filter.h"
// My testing shows that disabling cache reduces the amount
// of leaked memory when many documents are loaded one from the other,
// while there's no noticeable change in speed
//#define arena_item_tile_cache
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;
/* Key for secondary rendering */
unsigned int key;
#ifdef arena_item_tile_cache
bool skipCaching;
double activity;
#endif
/* BBox in grid coordinates */
/* Our affine */
/* Clip item */
/* Mask item */
/* Filter to be applied after rendering this object, NULL if none */
/* Rendered buffer */
unsigned char *px;
/* Single data member */
void *data;
/* Current Transformation Matrix */
}
};
unsigned int (* update) (NRArenaItem *item, NRRectL *area, NRGC *gc, unsigned int state, unsigned int reset);
};
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(NRArenaItem *item, NRRectL const *area, NRPixBlock *pb, unsigned int flags);
NRArenaItem *nr_arena_item_invoke_pick (NRArenaItem *item, NR::Point p, double delta, unsigned int sticky);
/* Public */
/* Helpers */
NRArenaItem *nr_arena_item_attach (NRArenaItem *parent, NRArenaItem *child, NRArenaItem *prev, NRArenaItem *next);
#endif