//>>built
define("dojox/gfx/svg_mask",["dojo/_base/declare","dojo/_base/lang","./_base","./shape","./svg"],function(e,c,h,g,d){c.extend(d.Shape,{mask:null,setMask:function(a){var f=this.rawNode;a?(f.setAttribute("mask","url(#"+a.shape.id+")"),this.mask=a):(f.removeAttribute("mask"),this.mask=null);return this},getMask:function(){return this.mask}});var b=d.Mask=e("dojox.gfx.svg.Mask",d.Shape,{constructor:function(){g.Container._init.call(this);this.shape=b.defaultMask},setRawNode:function(a){this.rawNode=a},
setShape:function(a){a.id||(a=c.mixin({id:h._base._getUniqueId()},a));this.inherited(arguments,[a])}});b.nodeType="mask";b.defaultMask={id:null,x:0,y:0,width:1,height:1,maskUnits:"objectBoundingBox",maskContentUnits:"userSpaceOnUse"};c.extend(b,d.Container);c.extend(b,g.Creator);c.extend(b,d.Creator);e=d.Surface;var k=e.prototype.add,l=e.prototype.remove;c.extend(e,{createMask:function(a){return this.createObject(b,a)},add:function(a){a instanceof b?(this.defNode.appendChild(a.rawNode),a.parent=this):
k.apply(this,arguments);return this},remove:function(a,f){a instanceof b&&this.defNode==a.rawNode.parentNode?(this.defNode.removeChild(a.rawNode),a.parent=null):l.apply(this,arguments);return this}})});