sp-mask.cpp revision 094dc7c249a0253b9bbed67205e341a05b59eca7
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen * SVG <mask> implementation
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen * Lauris Kaplinski <lauris@kaplinski.com>
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti * Copyright (C) 2003 authors
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti * Released under GNU GPL, read the file 'COPYING' for more information
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti unsigned int key;
6e16a663ee96cd1329e48518138efb415046d9f6mcecchettistatic void sp_mask_class_init (SPMaskClass *klass);
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelenstatic void sp_mask_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelenstatic void sp_mask_release (SPObject * object);
6e16a663ee96cd1329e48518138efb415046d9f6mcecchettistatic void sp_mask_set (SPObject *object, unsigned int key, const gchar *value);
6e16a663ee96cd1329e48518138efb415046d9f6mcecchettistatic void sp_mask_child_added (SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref);
6e16a663ee96cd1329e48518138efb415046d9f6mcecchettistatic void sp_mask_update (SPObject *object, SPCtx *ctx, guint flags);
6e16a663ee96cd1329e48518138efb415046d9f6mcecchettistatic void sp_mask_modified (SPObject *object, guint flags);
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelenstatic Inkscape::XML::Node *sp_mask_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
d37634d73670180f99a3e0ea583621373d90ec4fJohan EngelenSPMaskView *sp_mask_view_new_prepend (SPMaskView *list, unsigned int key, NRArenaItem *arenaitem);
d37634d73670180f99a3e0ea583621373d90ec4fJohan EngelenSPMaskView *sp_mask_view_list_remove (SPMaskView *list, SPMaskView *view);
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen type = g_type_register_static (SP_TYPE_OBJECTGROUP, "SPMask", &info, (GTypeFlags)0);
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen parent_class = (SPObjectGroupClass*) g_type_class_ref (SP_TYPE_OBJECTGROUP);
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen SPObjectClass *sp_object_class = (SPObjectClass *) klass;
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen sp_object_class->child_added = sp_mask_child_added;
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen mask->maskUnits = SP_CONTENT_UNITS_OBJECTBOUNDINGBOX;
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen mask->maskContentUnits = SP_CONTENT_UNITS_USERSPACEONUSE;
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelensp_mask_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen if (((SPObjectClass *) parent_class)->build) {
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen ((SPObjectClass *) parent_class)->build (object, document, repr);
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti /* Register ourselves */
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti /* Unregister ourselves */
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti SP_OBJECT_DOCUMENT (object)->remove_resource ("mask", object);
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti /* We simply unref and let item manage this in handler */
6e16a663ee96cd1329e48518138efb415046d9f6mcecchetti cp->display = sp_mask_view_list_remove (cp->display, cp->display);
switch (key) {
case SP_ATTR_MASKUNITS:
if (value) {
case SP_ATTR_MASKCONTENTUNITS:
if (value) {
v->key,
if (ac) {
for (SPObject *child = SP_OBJECT(og)->first_child(); child != NULL; child = SP_OBJECT_NEXT(child)) {
l = g_slist_reverse (l);
for (SPObject *child = SP_OBJECT(og)->first_child(); child != NULL; child = SP_OBJECT_NEXT(child)) {
l = g_slist_reverse (l);
sp_mask_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
return repr;
const gchar *
return mask_id;
for (SPObject *child = SP_OBJECT(mask)->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child)) {
if (ac) {
Geom::Matrix t(Geom::Scale(mask->display->bbox.x1 - mask->display->bbox.x0, mask->display->bbox.y1 - mask->display->bbox.y0));
return ai;
for (SPObject *child = SP_OBJECT(cp)->first_child(); child != NULL; child = SP_OBJECT_NEXT(child)) {
return new_mask_view;
return list;