sp-mask.cpp revision 9916339c54c3b82435984fdfd645c561724fc25c
617e2443dfc17fe44fd44c0675d6aad2ffc9df42Mark Logan * SVG <mask> implementation
617e2443dfc17fe44fd44c0675d6aad2ffc9df42Mark Logan * Lauris Kaplinski <lauris@kaplinski.com>
617e2443dfc17fe44fd44c0675d6aad2ffc9df42Mark Logan * Copyright (C) 2003 authors
617e2443dfc17fe44fd44c0675d6aad2ffc9df42Mark Logan * Released under GNU GPL, read the file 'COPYING' for more information
617e2443dfc17fe44fd44c0675d6aad2ffc9df42Mark Logan unsigned int key;
617e2443dfc17fe44fd44c0675d6aad2ffc9df42Mark Loganstatic void sp_mask_class_init (SPMaskClass *klass);
617e2443dfc17fe44fd44c0675d6aad2ffc9df42Mark Loganstatic void sp_mask_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
617e2443dfc17fe44fd44c0675d6aad2ffc9df42Mark Loganstatic void sp_mask_set (SPObject *object, unsigned int key, const gchar *value);
617e2443dfc17fe44fd44c0675d6aad2ffc9df42Mark Loganstatic void sp_mask_child_added (SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref);
617e2443dfc17fe44fd44c0675d6aad2ffc9df42Mark Loganstatic void sp_mask_update (SPObject *object, SPCtx *ctx, guint flags);
617e2443dfc17fe44fd44c0675d6aad2ffc9df42Mark Loganstatic void sp_mask_modified (SPObject *object, guint flags);
617e2443dfc17fe44fd44c0675d6aad2ffc9df42Mark Loganstatic Inkscape::XML::Node *sp_mask_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
617e2443dfc17fe44fd44c0675d6aad2ffc9df42Mark LoganSPMaskView *sp_mask_view_new_prepend (SPMaskView *list, unsigned int key, NRArenaItem *arenaitem);
617e2443dfc17fe44fd44c0675d6aad2ffc9df42Mark LoganSPMaskView *sp_mask_view_list_remove (SPMaskView *list, SPMaskView *view);
617e2443dfc17fe44fd44c0675d6aad2ffc9df42Mark Logan type = g_type_register_static (SP_TYPE_OBJECTGROUP, "SPMask", &info, (GTypeFlags)0);
617e2443dfc17fe44fd44c0675d6aad2ffc9df42Mark Logan parent_class = (SPObjectGroupClass*) g_type_class_ref (SP_TYPE_OBJECTGROUP);
617e2443dfc17fe44fd44c0675d6aad2ffc9df42Mark Logan SPObjectClass *sp_object_class = (SPObjectClass *) klass;
617e2443dfc17fe44fd44c0675d6aad2ffc9df42Mark Logan sp_object_class->child_added = sp_mask_child_added;
617e2443dfc17fe44fd44c0675d6aad2ffc9df42Mark Logan mask->maskUnits = SP_CONTENT_UNITS_OBJECTBOUNDINGBOX;
617e2443dfc17fe44fd44c0675d6aad2ffc9df42Mark Logan mask->maskContentUnits = SP_CONTENT_UNITS_USERSPACEONUSE;
617e2443dfc17fe44fd44c0675d6aad2ffc9df42Mark Logansp_mask_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
switch (key) {
case SP_ATTR_MASKUNITS:
if (value) {
case SP_ATTR_MASKCONTENTUNITS:
if (value) {
v->key,
if (ac) {
for (SPObject *child = sp_object_first_child(SP_OBJECT(og)); child != NULL; child = SP_OBJECT_NEXT(child)) {
l = g_slist_reverse (l);
NRMatrix t;
for (SPObject *child = sp_object_first_child(SP_OBJECT(og)); child != NULL; child = SP_OBJECT_NEXT(child)) {
l = g_slist_reverse (l);
return repr;
const gchar *
return mask_id;
for (SPObject *child = sp_object_first_child(SP_OBJECT(mask)) ; child != NULL; child = SP_OBJECT_NEXT(child)) {
if (ac) {
NRMatrix t;
nr_matrix_set_scale (&t, mask->display->bbox.x1 - mask->display->bbox.x0, mask->display->bbox.y1 - mask->display->bbox.y0);
return ai;
for (SPObject *child = sp_object_first_child(SP_OBJECT(cp)); child != NULL; child = SP_OBJECT_NEXT(child)) {
return new_mask_view;
return list;