sp-item.cpp revision 329a7abc72967b2db04c3c0a2ba4c5e830859e95
851N/A#define __SP_ITEM_C__
517N/A#ifdef HAVE_CONFIG_H
851N/A#include "display/nr-arena.h"
705N/A#include "display/nr-arena-item.h"
517N/A#include "attributes.h"
517N/A#include "document.h"
517N/A#include "sp-clippath.h"
517N/A#include "sp-item-rm-unsatisfied-cns.h"
517N/A#include "sp-pattern.h"
517N/A#include "gradient-chemistry.h"
517N/A#include "prefs-utils.h"
517N/A#include "conn-avoid-ref.h"
705N/A#include "libnr/nr-matrix-div.h"
517N/A#include "libnr/nr-matrix-fns.h"
517N/A#include "libnr/nr-matrix-scale-ops.h"
517N/A#include "libnr/nr-matrix-translate-ops.h"
517N/A#include "libnr/nr-scale-translate-ops.h"
517N/A#include "libnr/nr-translate-scale-ops.h"
517N/A#include "algorithms/find-last-if.h"
517N/A#include "util/reverse-list.h"
606N/A#define noSP_ITEM_DEBUG_IDLE
606N/Astatic Inkscape::XML::Node *sp_item_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
517N/Astatic SPItemView *sp_item_view_new_prepend(SPItemView *list, SPItem *item, unsigned flags, unsigned key, NRArenaItem *arenaitem);
sp_item_get_type(void)
if (!type) {
sizeof(SPItemClass),
sizeof(SPItem),
return type;
updateRepr();
updateRepr();
this->updateRepr();
if (topmost) {
if (next_higher) {
if (next_lower) {
++next_lower;
if (bottom) {
++bottom;
switch (key) {
case SP_ATTR_TRANSFORM: {
case SP_PROP_CLIP_PATH: {
if (uri) {
case SP_PROP_MASK: {
if (uri) {
case SP_ATTR_STYLE:
case SP_ATTR_CONNECTOR_AVOID:
if (old_clip) {
SPItemView *v;
if (old_mask) {
if (flags & (SP_OBJECT_CHILD_MODIFIED_FLAG | SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG)) {
if (clip_path) {
if (mask) {
if (parent) {
if (obj_style) {
g_free(s);
if (!style_str) {
return repr;
NRRect r;
sp_item_invoke_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsigned const clear)
sp_item_invoke_bbox_full(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsigned const flags, unsigned const clear)
if (clear) {
unsigned pos=0;
return pos;
pos++;
static gchar *
gchar *
return NULL;
static unsigned dkey = 0;
if (!item->display->arenaitem->key) NR_ARENA_ITEM_SET_KEY(item->display->arenaitem, sp_item_display_key_new(3));
ac = sp_clippath_show(item->clip_ref->getObject(), arena, NR_ARENA_ITEM_GET_KEY(item->display->arenaitem));
if (!item->display->arenaitem->key) NR_ARENA_ITEM_SET_KEY(item->display->arenaitem, sp_item_display_key_new(3));
ac = sp_mask_show(item->mask_ref->getObject(), arena, NR_ARENA_ITEM_GET_KEY(item->display->arenaitem));
return ai;
while (v != NULL) {
if (!ref) {
g_free(v);
ref = v;
v = next;
if (t_attr) {
t_old = t;
return t_old;
if (SP_IS_ITEM(o))
if (SP_IS_ITEM(o))
sp_item_adjust_paint_recursive (SPItem *item, NR::Matrix advertized_transform, NR::Matrix t_ancestors, bool is_pattern)
// _After_ full pattern/gradient transform: t_paint_new * t_item * t_ancestors * advertised_transform
NR::Matrix paint_delta = t_item * t_ancestors * advertized_transform * t_ancestors.inverse() * t_item.inverse();
if (is_pattern)
if (SP_IS_ITEM(o)) {
sp_item_adjust_paint_recursive (SP_ITEM(o), advertized_transform, t_item * t_ancestors, is_pattern);
sp_item_write_transform(SPItem *item, Inkscape::XML::Node *repr, NRMatrix const *transform, NR::Matrix const *adv)
sp_item_write_transform(SPItem *item, Inkscape::XML::Node *repr, NR::Matrix const &transform, NR::Matrix const *adv)
/// \todo FIXME: add the same else branch as for gradients below, to convert patterns to userSpaceOnUse as well
return FALSE;
return ret;
* Returns the accumulated transformation of the item and all its ancestors, including root's viewport.
* Returns the accumulated transformation of the item and all its ancestors, but excluding root's viewport.
return ret;
return ret;
return ret;
return ret;
return ret;
static SPItemView *
sp_item_view_new_prepend(SPItemView *list, SPItem *item, unsigned flags, unsigned key, NRArenaItem *arenaitem)
return new_view;
static SPItemView *
return list;
return NULL;
SPItem *
return NULL;