From: Jeff R. <jef...@us...> - 2005-11-19 03:15:53
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorScripting/SharpVectors/Scripting/Wrapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12937/src/SharpVectorScripting/SharpVectors/Scripting/Wrapping Added Files: Css.cs CssWrapper.cs Dom.cs DomWrapper.cs Events.cs EventsWrapper.cs ScriptWrapper.cs Smil.cs SmilWrapper.cs StyleSheets.cs StyleSheetsWrapper.cs Svg.cs SvgWrapper.cs Views.cs ViewsWrapper.cs Window.cs WindowWrapper.cs Log Message: Scripting Library wrappers and monitors initial add --- NEW FILE: EventsWrapper.cs --- using System; using SharpVectors.Dom; using SharpVectors.Dom.Css; using SharpVectors.Dom.Events; using SharpVectors.Dom.Stylesheets; using SharpVectors.Dom.Svg; using SharpVectors.Dom.Views; namespace SharpVectors.Scripting { /// <summary> /// Implementation wrapper for IScriptableEventTarget /// </summary> public class ScriptableEventTarget : ScriptableObject, IScriptableEventTarget { public ScriptableEventTarget(object baseObject) : base (baseObject) { } #region Methods - IScriptableEventTarget public void addEventListener(string type, object listener, bool useCapture) { if (listener is Microsoft.JScript.Closure) { ClosureEventMonitor mon = ClosureEventMonitor.CreateMonitor((Microsoft.JScript.Closure)listener); ((IEventTarget)baseObject).AddEventListener(type, new EventListener(mon.EventHandler), useCapture); } } public void removeEventListener(string type, object listener, bool useCapture) { if (listener is Microsoft.JScript.Closure) { ClosureEventMonitor mon = ClosureEventMonitor.CreateMonitor((Microsoft.JScript.Closure)listener); ((IEventTarget)baseObject).RemoveEventListener(type, new EventListener(mon.EventHandler), useCapture); } } public bool dispatchEvent(IScriptableEvent evt) { return ((IEventTarget)baseObject).DispatchEvent(((IEvent)((ScriptableEvent)evt).baseObject)); } #endregion } /// <summary> /// Implementation wrapper for IScriptableEventListener /// </summary> public class ScriptableEventListener : ScriptableObject, IScriptableEventListener { public ScriptableEventListener(object baseObject) : base (baseObject) { } #region Methods - IScriptableEventListener public void handleEvent(IScriptableEvent evt) { throw new NotImplementedException(); //((IEventListener)baseObject).HandleEvent(((IEvent)((ScriptableEvent)evt).baseObject)); } #endregion } /// <summary> /// Implementation wrapper for IScriptableEvent /// </summary> public class ScriptableEvent : ScriptableObject, IScriptableEvent { const ushort CAPTURING_PHASE = 1; const ushort AT_TARGET = 2; const ushort BUBBLING_PHASE = 3; public ScriptableEvent(object baseObject) : base (baseObject) { } #region Methods - IScriptableEvent public void stopPropagation() { ((IEvent)baseObject).StopPropagation(); } public void preventDefault() { ((IEvent)baseObject).PreventDefault(); } public void initEvent(string eventTypeArg, bool canBubbleArg, bool cancelableArg) { ((IEvent)baseObject).InitEvent(eventTypeArg, canBubbleArg, cancelableArg); } #endregion #region Properties - IScriptableEvent public string type { get { return ((IEvent)baseObject).Type; } } public IScriptableEventTarget target { get { object result = ((IEvent)baseObject).Target; return (result != null) ? (IScriptableEventTarget)ScriptableObject.CreateWrapper(result) : null; } } public IScriptableEventTarget currentTarget { get { object result = ((IEvent)baseObject).CurrentTarget; return (result != null) ? (IScriptableEventTarget)ScriptableObject.CreateWrapper(result) : null; } } public ushort eventPhase { get { return (ushort)((IEvent)baseObject).EventPhase; } } public bool bubbles { get { return ((IEvent)baseObject).Bubbles; } } public bool cancelable { get { return ((IEvent)baseObject).Cancelable; } } public IScriptableDomTimeStamp timeStamp { get { object result = ((IEvent)baseObject).TimeStamp; return (result != null) ? (IScriptableDomTimeStamp)ScriptableObject.CreateWrapper(result) : null; } } #endregion } /// <summary> /// Implementation wrapper for IScriptableDocumentEvent /// </summary> public class ScriptableDocumentEvent : ScriptableObject, IScriptableDocumentEvent { public ScriptableDocumentEvent(object baseObject) : base (baseObject) { } #region Methods - IScriptableDocumentEvent public IScriptableEvent createEvent(string eventType) { object result = ((IDocumentEvent)baseObject).CreateEvent(eventType); return (result != null) ? (IScriptableEvent)ScriptableObject.CreateWrapper(result) : null; } #endregion } /// <summary> /// Implementation wrapper for IScriptableUiEvent /// </summary> public class ScriptableUiEvent : ScriptableEvent, IScriptableUiEvent { public ScriptableUiEvent(object baseObject) : base (baseObject) { } #region Methods - IScriptableUiEvent public void initUIEvent(string typeArg, bool canBubbleArg, bool cancelableArg, IScriptableAbstractView viewArg, long detailArg) { ((IUiEvent)baseObject).InitUiEvent(typeArg, canBubbleArg, cancelableArg, ((IAbstractView)((ScriptableAbstractView)viewArg).baseObject), detailArg); } #endregion #region Properties - IScriptableUiEvent public IScriptableAbstractView view { get { object result = ((IUiEvent)baseObject).View; return (result != null) ? (IScriptableAbstractView)ScriptableObject.CreateWrapper(result) : null; } } public long detail { get { return ((IUiEvent)baseObject).Detail; } } #endregion } /// <summary> /// Implementation wrapper for IScriptableMouseEvent /// </summary> public class ScriptableMouseEvent : ScriptableUiEvent, IScriptableMouseEvent { public ScriptableMouseEvent(object baseObject) : base (baseObject) { } #region Methods - IScriptableMouseEvent public void initMouseEvent(string typeArg, bool canBubbleArg, bool cancelableArg, IScriptableAbstractView viewArg, long detailArg, long screenXArg, long screenYArg, long clientXArg, long clientYArg, bool ctrlKeyArg, bool altKeyArg, bool shiftKeyArg, bool metaKeyArg, ushort buttonArg, IScriptableEventTarget relatedTargetArg) { ((IMouseEvent)baseObject).InitMouseEvent(typeArg, canBubbleArg, cancelableArg, ((IAbstractView)((ScriptableAbstractView)viewArg).baseObject), detailArg, screenXArg, screenYArg, clientXArg, clientYArg, ctrlKeyArg, altKeyArg, shiftKeyArg, metaKeyArg, buttonArg, ((IEventTarget)((ScriptableEventTarget)relatedTargetArg).baseObject)); } #endregion #region Properties - IScriptableMouseEvent public long screenX { get { return ((IMouseEvent)baseObject).ScreenX; } } public long screenY { get { return ((IMouseEvent)baseObject).ScreenY; } } public long clientX { get { return ((IMouseEvent)baseObject).ClientX; } } public long clientY { get { return ((IMouseEvent)baseObject).ClientY; } } public bool ctrlKey { get { return ((IMouseEvent)baseObject).CtrlKey; } } public bool shiftKey { get { return ((IMouseEvent)baseObject).ShiftKey; } } public bool altKey { get { return ((IMouseEvent)baseObject).AltKey; } } public bool metaKey { get { return ((IMouseEvent)baseObject).MetaKey; } } public ushort button { get { return ((IMouseEvent)baseObject).Button; } } public IScriptableEventTarget relatedTarget { get { object result = ((IMouseEvent)baseObject).RelatedTarget; return (result != null) ? (IScriptableEventTarget)ScriptableObject.CreateWrapper(result) : null; } } #endregion } /// <summary> /// Implementation wrapper for IScriptableMutationEvent /// </summary> public class ScriptableMutationEvent : ScriptableEvent, IScriptableMutationEvent { const ushort MODIFICATION = 1; const ushort ADDITION = 2; const ushort REMOVAL = 3; public ScriptableMutationEvent(object baseObject) : base (baseObject) { } #region Methods - IScriptableMutationEvent public void initMutationEvent(string typeArg, bool canBubbleArg, bool cancelableArg, IScriptableNode relatedNodeArg, string prevValueArg, string newValueArg, string attrNameArg, ushort attrChangeArg) { ((IMutationEvent)baseObject).InitMutationEvent(typeArg, canBubbleArg, cancelableArg, ((INode)((ScriptableNode)relatedNodeArg).baseObject), prevValueArg, newValueArg, attrNameArg, (AttrChangeType)attrChangeArg); } #endregion #region Properties - IScriptableMutationEvent public IScriptableNode relatedNode { get { object result = ((IMutationEvent)baseObject).RelatedNode; return (result != null) ? (IScriptableNode)ScriptableObject.CreateWrapper(result) : null; } } public string prevValue { get { return ((IMutationEvent)baseObject).PrevValue; } } public string newValue { get { return ((IMutationEvent)baseObject).NewValue; } } public string attrName { get { return ((IMutationEvent)baseObject).AttrName; } } public ushort attrChange { get { return (ushort)((IMutationEvent)baseObject).AttrChange; } } #endregion } } --- NEW FILE: Events.cs --- using System; namespace SharpVectors.Scripting { /// <summary> /// IScriptableEventTarget /// </summary> public interface IScriptableEventTarget { void addEventListener(string type, object listener, bool useCapture); void removeEventListener(string type, object listener, bool useCapture); bool dispatchEvent(IScriptableEvent evt); } /// <summary> /// IScriptableEventListener /// </summary> public interface IScriptableEventListener { void handleEvent(IScriptableEvent evt); } /// <summary> /// IScriptableEvent /// </summary> public interface IScriptableEvent { void stopPropagation(); void preventDefault(); void initEvent(string eventTypeArg, bool canBubbleArg, bool cancelableArg); string type { get; } IScriptableEventTarget target { get; } IScriptableEventTarget currentTarget { get; } ushort eventPhase { get; } bool bubbles { get; } bool cancelable { get; } IScriptableDomTimeStamp timeStamp { get; } } /// <summary> /// IScriptableDocumentEvent /// </summary> public interface IScriptableDocumentEvent { IScriptableEvent createEvent(string eventType); } /// <summary> /// IScriptableUiEvent /// </summary> public interface IScriptableUiEvent : IScriptableEvent { void initUIEvent(string typeArg, bool canBubbleArg, bool cancelableArg, IScriptableAbstractView viewArg, long detailArg); IScriptableAbstractView view { get; } long detail { get; } } /// <summary> /// IScriptableMouseEvent /// </summary> public interface IScriptableMouseEvent : IScriptableUiEvent { void initMouseEvent(string typeArg, bool canBubbleArg, bool cancelableArg, IScriptableAbstractView viewArg, long detailArg, long screenXArg, long screenYArg, long clientXArg, long clientYArg, bool ctrlKeyArg, bool altKeyArg, bool shiftKeyArg, bool metaKeyArg, ushort buttonArg, IScriptableEventTarget relatedTargetArg); long screenX { get; } long screenY { get; } long clientX { get; } long clientY { get; } bool ctrlKey { get; } bool shiftKey { get; } bool altKey { get; } bool metaKey { get; } ushort button { get; } IScriptableEventTarget relatedTarget { get; } } /// <summary> /// IScriptableMutationEvent /// </summary> public interface IScriptableMutationEvent : IScriptableEvent { void initMutationEvent(string typeArg, bool canBubbleArg, bool cancelableArg, IScriptableNode relatedNodeArg, string prevValueArg, string newValueArg, string attrNameArg, ushort attrChangeArg); IScriptableNode relatedNode { get; } string prevValue { get; } string newValue { get; } string attrName { get; } ushort attrChange { get; } } } --- NEW FILE: Window.cs --- using System; namespace SharpVectors.Scripting { /// <summary> /// IScriptableSvgWindow /// </summary> public interface IScriptableSvgWindow { string setTimeout(object scriptOrClosure, ulong delay); void clearTimeout(string token); string setInterval(object scriptOrClosure, ulong delay); void clearInterval(string token); void alert(string message); void setSrc(string newURL); string getSrc(); string printNode(IScriptableNode node); IScriptableNode parseXML(string xml, IScriptableDocument owner); IScriptableSvgDocument document { get; } IScriptableSvgDocument svgDocument { get; } IScriptableStyleSheet defaultStyleSheet{get;} long innerWidth { get; } long innerHeight { get; } void registerEval(object closure); } } --- NEW FILE: Smil.cs --- using System; namespace SharpVectors.Scripting { /// <summary> /// IScriptableElementTimeControl /// </summary> public interface IScriptableElementTimeControl { void beginElement(); void beginElementAt(float offset); void endElement(); void endElementAt(float offset); } /// <summary> /// IScriptableTimeEvent /// </summary> public interface IScriptableTimeEvent : IScriptableEvent { void initTimeEvent(string typeArg, IScriptableAbstractView viewArg, long detailArg); IScriptableAbstractView view { get; } long detail { get; } } } --- NEW FILE: StyleSheets.cs --- using System; namespace SharpVectors.Scripting { /// <summary> /// IScriptableStyleSheet /// </summary> public interface IScriptableStyleSheet { string type { get; } bool disabled { get; set; } IScriptableNode ownerNode { get; } IScriptableStyleSheet parentStyleSheet { get; } string href { get; } string title { get; } IScriptableMediaList media { get; } } /// <summary> /// IScriptableStyleSheetList /// </summary> public interface IScriptableStyleSheetList { IScriptableStyleSheet item(ulong index); ulong length { get; } } /// <summary> /// IScriptableMediaList /// </summary> public interface IScriptableMediaList { string item(ulong index); void deleteMedium(string oldMedium); void appendMedium(string newMedium); string mediaText { get; set; } ulong length { get; } } /// <summary> /// IScriptableLinkStyle /// </summary> public interface IScriptableLinkStyle { IScriptableStyleSheet sheet { get; } } /// <summary> /// IScriptableDocumentStyle /// </summary> public interface IScriptableDocumentStyle { IScriptableStyleSheetList styleSheets { get; } } } --- NEW FILE: Views.cs --- using System; namespace SharpVectors.Scripting { /// <summary> /// IScriptableAbstractView /// </summary> public interface IScriptableAbstractView { IScriptableDocumentView document { get; } } /// <summary> /// IScriptableDocumentView /// </summary> public interface IScriptableDocumentView { IScriptableAbstractView defaultView { get; } } } --- NEW FILE: CssWrapper.cs --- using System; using SharpVectors.Dom; using SharpVectors.Dom.Css; using SharpVectors.Dom.Events; using SharpVectors.Dom.Stylesheets; using SharpVectors.Dom.Svg; using SharpVectors.Dom.Views; using System.Xml; namespace SharpVectors.Scripting { /// <summary> /// Implementation wrapper for IScriptableCssRuleList /// </summary> public class ScriptableCssRuleList : ScriptableObject, IScriptableCssRuleList { public ScriptableCssRuleList(object baseObject) : base (baseObject) { } [...1303 lines suppressed...] } /// <summary> /// Implementation wrapper for IScriptableDomImplementationCss /// </summary> public class ScriptableDomImplementationCss : ScriptableDomImplementation, IScriptableDomImplementationCss { public ScriptableDomImplementationCss(object baseObject) : base (baseObject) { } #region Methods - IScriptableDomImplementationCss public IScriptableCssStyleSheet createCSSStyleSheet(string title, string media) { object result = ((IDomImplementationCss)baseObject).CreateCssStyleSheet(title, media); return (result != null) ? (IScriptableCssStyleSheet)ScriptableObject.CreateWrapper(result) : null; } #endregion } } --- NEW FILE: Svg.cs --- using System; namespace SharpVectors.Scripting { /// <summary> /// IScriptableSvgElement /// </summary> public interface IScriptableSvgElement : IScriptableElement { string id { get; set; } string xmlbase { get; set; } IScriptableSvgSvgElement ownerSVGElement { get; } IScriptableSvgElement viewportElement { get; } } /// <summary> /// IScriptableSvgAnimatedBoolean [...1600 lines suppressed...] /// <summary> /// IScriptableSvgMetadataElement /// </summary> public interface IScriptableSvgMetadataElement : IScriptableSvgElement { } /// <summary> /// IScriptableSvgForeignObjectElement /// </summary> public interface IScriptableSvgForeignObjectElement : IScriptableSvgElement, IScriptableSvgTests, IScriptableSvgLangSpace, IScriptableSvgExternalResourcesRequired, IScriptableSvgStylable, IScriptableSvgTransformable, IScriptableEventTarget { IScriptableSvgAnimatedLength x { get; } IScriptableSvgAnimatedLength y { get; } IScriptableSvgAnimatedLength width { get; } IScriptableSvgAnimatedLength height { get; } } } --- NEW FILE: Css.cs --- using System; namespace SharpVectors.Scripting { /// <summary> /// IScriptableCssRuleList /// </summary> public interface IScriptableCssRuleList { IScriptableCssRule item(ulong index); ulong length { get; } } /// <summary> /// IScriptableCssRule /// </summary> public interface IScriptableCssRule { ushort type { get; } string cssText { get; set; } IScriptableCssStyleSheet parentStyleSheet { get; } IScriptableCssRule parentRule { get; } } /// <summary> /// IScriptableCssStyleRule /// </summary> public interface IScriptableCssStyleRule : IScriptableCssRule { string selectorText { get; set; } IScriptableCssStyleDeclaration style { get; } } /// <summary> /// IScriptableCssMediaRule /// </summary> public interface IScriptableCssMediaRule : IScriptableCssRule { ulong insertRule(string rule, ulong index); void deleteRule(ulong index); IScriptableMediaList media { get; } IScriptableCssRuleList cssRules { get; } } /// <summary> /// IScriptableCssFontFaceRule /// </summary> public interface IScriptableCssFontFaceRule : IScriptableCssRule { IScriptableCssStyleDeclaration style { get; } } /// <summary> /// IScriptableCssPageRule /// </summary> public interface IScriptableCssPageRule : IScriptableCssRule { string selectorText { get; set; } IScriptableCssStyleDeclaration style { get; } } /// <summary> /// IScriptableCssImportRule /// </summary> public interface IScriptableCssImportRule : IScriptableCssRule { string href { get; } IScriptableMediaList media { get; } IScriptableCssStyleSheet styleSheet { get; } } /// <summary> /// IScriptableCssCharsetRule /// </summary> public interface IScriptableCssCharsetRule : IScriptableCssRule { string encoding { get; set; } } /// <summary> /// IScriptableCssUnknownRule /// </summary> public interface IScriptableCssUnknownRule : IScriptableCssRule { } /// <summary> /// IScriptableCssStyleDeclaration /// </summary> public interface IScriptableCssStyleDeclaration { string getPropertyValue(string propertyName); IScriptableCssValue getPropertyCSSValue(string propertyName); string removeProperty(string propertyName); string getPropertyPriority(string propertyName); void setProperty(string propertyName, string value, string priority); string item(ulong index); string cssText { get; set; } ulong length { get; } IScriptableCssRule parentRule { get; } } /// <summary> /// IScriptableCssValue /// </summary> public interface IScriptableCssValue { string cssText { get; set; } ushort cssValueType { get; } } /// <summary> /// IScriptableCssPrimitiveValue /// </summary> public interface IScriptableCssPrimitiveValue : IScriptableCssValue { void setFloatValue(ushort unitType, float floatValue); float getFloatValue(ushort unitType); void setStringValue(ushort stringType, string stringValue); string getStringValue(); IScriptableCounter getCounterValue(); IScriptableRect getRectValue(); IScriptableRgbColor getRGBColorValue(); ushort primitiveType { get; } } /// <summary> /// IScriptableCssValueList /// </summary> public interface IScriptableCssValueList : IScriptableCssValue { IScriptableCssValue item(ulong index); ulong length { get; } } /// <summary> /// IScriptableRgbColor /// </summary> public interface IScriptableRgbColor { IScriptableCssPrimitiveValue red { get; } IScriptableCssPrimitiveValue green { get; } IScriptableCssPrimitiveValue blue { get; } } /// <summary> /// IScriptableRect /// </summary> public interface IScriptableRect { IScriptableCssPrimitiveValue top { get; } IScriptableCssPrimitiveValue right { get; } IScriptableCssPrimitiveValue bottom { get; } IScriptableCssPrimitiveValue left { get; } } /// <summary> /// IScriptableCounter /// </summary> public interface IScriptableCounter { string identifier { get; } string listStyle { get; } string separator { get; } } /// <summary> /// IScriptableElementCssInlineStyle /// </summary> public interface IScriptableElementCssInlineStyle { IScriptableCssStyleDeclaration style { get; } } /// <summary> /// IScriptableCss2Properties /// </summary> public interface IScriptableCss2Properties { string azimuth { get; set; } string background { get; set; } string backgroundAttachment { get; set; } string backgroundColor { get; set; } string backgroundImage { get; set; } string backgroundPosition { get; set; } string backgroundRepeat { get; set; } string border { get; set; } string borderCollapse { get; set; } string borderColor { get; set; } string borderSpacing { get; set; } string borderStyle { get; set; } string borderTop { get; set; } string borderRight { get; set; } string borderBottom { get; set; } string borderLeft { get; set; } string borderTopColor { get; set; } string borderRightColor { get; set; } string borderBottomColor { get; set; } string borderLeftColor { get; set; } string borderTopStyle { get; set; } string borderRightStyle { get; set; } string borderBottomStyle { get; set; } string borderLeftStyle { get; set; } string borderTopWidth { get; set; } string borderRightWidth { get; set; } string borderBottomWidth { get; set; } string borderLeftWidth { get; set; } string borderWidth { get; set; } string bottom { get; set; } string captionSide { get; set; } string clear { get; set; } string clip { get; set; } string color { get; set; } string content { get; set; } string counterIncrement { get; set; } string counterReset { get; set; } string cue { get; set; } string cueAfter { get; set; } string cueBefore { get; set; } string cursor { get; set; } string direction { get; set; } string display { get; set; } string elevation { get; set; } string emptyCells { get; set; } string cssFloat { get; set; } string font { get; set; } string fontFamily { get; set; } string fontSize { get; set; } string fontSizeAdjust { get; set; } string fontStretch { get; set; } string fontStyle { get; set; } string fontVariant { get; set; } string fontWeight { get; set; } string height { get; set; } string left { get; set; } string letterSpacing { get; set; } string lineHeight { get; set; } string listStyle { get; set; } string listStyleImage { get; set; } string listStylePosition { get; set; } string listStyleType { get; set; } string margin { get; set; } string marginTop { get; set; } string marginRight { get; set; } string marginBottom { get; set; } string marginLeft { get; set; } string markerOffset { get; set; } string marks { get; set; } string maxHeight { get; set; } string maxWidth { get; set; } string minHeight { get; set; } string minWidth { get; set; } string orphans { get; set; } string outline { get; set; } string outlineColor { get; set; } string outlineStyle { get; set; } string outlineWidth { get; set; } string overflow { get; set; } string padding { get; set; } string paddingTop { get; set; } string paddingRight { get; set; } string paddingBottom { get; set; } string paddingLeft { get; set; } string page { get; set; } string pageBreakAfter { get; set; } string pageBreakBefore { get; set; } string pageBreakInside { get; set; } string pause { get; set; } string pauseAfter { get; set; } string pauseBefore { get; set; } string pitch { get; set; } string pitchRange { get; set; } string playDuring { get; set; } string position { get; set; } string quotes { get; set; } string richness { get; set; } string right { get; set; } string size { get; set; } string speak { get; set; } string speakHeader { get; set; } string speakNumeral { get; set; } string speakPunctuation { get; set; } string speechRate { get; set; } string stress { get; set; } string tableLayout { get; set; } string textAlign { get; set; } string textDecoration { get; set; } string textIndent { get; set; } string textShadow { get; set; } string textTransform { get; set; } string top { get; set; } string unicodeBidi { get; set; } string verticalAlign { get; set; } string visibility { get; set; } string voiceFamily { get; set; } string volume { get; set; } string whiteSpace { get; set; } string widows { get; set; } string width { get; set; } string wordSpacing { get; set; } string zIndex { get; set; } } /// <summary> /// IScriptableCssStyleSheet /// </summary> public interface IScriptableCssStyleSheet : IScriptableStyleSheet { ulong insertRule(string rule, ulong index); void deleteRule(ulong index); IScriptableCssRule ownerRule { get; } IScriptableCssRuleList cssRules { get; } } /// <summary> /// IScriptableViewCss /// </summary> public interface IScriptableViewCss : IScriptableAbstractView { IScriptableCssStyleDeclaration getComputedStyle(IScriptableElement elt, string pseudoElt); } /// <summary> /// IScriptableDocumentCss /// </summary> public interface IScriptableDocumentCss : IScriptableDocumentStyle { IScriptableCssStyleDeclaration getOverrideStyle(IScriptableElement elt, string pseudoElt); } /// <summary> /// IScriptableDomImplementationCss /// </summary> public interface IScriptableDomImplementationCss : IScriptableDomImplementation { IScriptableCssStyleSheet createCSSStyleSheet(string title, string media); } } --- NEW FILE: SmilWrapper.cs --- using System; using SharpVectors.Dom; using SharpVectors.Dom.Css; using SharpVectors.Dom.Events; using SharpVectors.Dom.Stylesheets; using SharpVectors.Dom.Svg; using SharpVectors.Dom.Views; namespace SharpVectors.Scripting { /// <summary> /// Implementation wrapper for IScriptableElementTimeControl /// </summary> public class ScriptableElementTimeControl : ScriptableObject, IScriptableElementTimeControl { public ScriptableElementTimeControl(object baseObject) : base (baseObject) { } #region Methods - IScriptableElementTimeControl public void beginElement() { throw new NotImplementedException(); //((IElementTimeControl)baseObject).BeginElement(); } public void beginElementAt(float offset) { throw new NotImplementedException(); //((IElementTimeControl)baseObject).BeginElementAt(offset); } public void endElement() { throw new NotImplementedException(); //((IElementTimeControl)baseObject).EndElement(); } public void endElementAt(float offset) { throw new NotImplementedException(); //((IElementTimeControl)baseObject).EndElementAt(offset); } #endregion } /// <summary> /// Implementation wrapper for IScriptableTimeEvent /// </summary> public class ScriptableTimeEvent : ScriptableEvent, IScriptableTimeEvent { public ScriptableTimeEvent(object baseObject) : base (baseObject) { } #region Methods - IScriptableTimeEvent public void initTimeEvent(string typeArg, IScriptableAbstractView viewArg, long detailArg) { throw new NotImplementedException(); //((ITimeEvent)baseObject).InitTimeEvent(typeArg, ((IAbstractView)((ScriptableAbstractView)viewArg).baseObject), detailArg); } #endregion #region Properties - IScriptableTimeEvent public IScriptableAbstractView view { get { throw new NotImplementedException(); }//object result = ((ITimeEvent)baseObject).View; return (result != null) ? (IScriptableAbstractView)ScriptableObject.CreateWrapper(result) : null; } } public long detail { get { throw new NotImplementedException(); }//return ((ITimeEvent)baseObject).Detail; } } #endregion } } --- NEW FILE: WindowWrapper.cs --- using System; using SharpVectors.Dom; using SharpVectors.Dom.Css; using SharpVectors.Dom.Events; using SharpVectors.Dom.Stylesheets; using SharpVectors.Dom.Svg; using SharpVectors.Dom.Views; using SharpVectors.Scripting; using System.Xml; using Microsoft.JScript; namespace SharpVectors.Scripting { /// <summary> /// Implementation wrapper for IScriptableSvgWindow /// </summary> public class ScriptableSvgWindow : ScriptableObject, IScriptableSvgWindow { public ScriptableSvgWindow(object baseObject, ScriptEngine engine) : base (baseObject) { this.Engine = engine; } public ScriptEngine Engine; #region Methods - IScriptableSvgWindow public string setTimeout(object scriptOrClosure, ulong delay) { return ScriptTimerMonitor.CreateMonitor((VsaScriptEngine)Engine, (ISvgWindow)baseObject, scriptOrClosure, delay, false); } public void clearTimeout(string token) { ScriptTimerMonitor.ClearMonitor(token); } public string setInterval(object scriptOrClosure, ulong delay) { return ScriptTimerMonitor.CreateMonitor((VsaScriptEngine)Engine, (ISvgWindow)baseObject, scriptOrClosure, delay, true); } public void clearInterval(string token) { ScriptTimerMonitor.ClearMonitor(token); } public void alert(string message) { ((ISvgWindow)baseObject).Alert(message); } public void setSrc(string newURL) { ((ISvgWindow)baseObject).Src = newURL; } public string getSrc() { return ((ISvgWindow)baseObject).Src; } public string printNode(IScriptableNode node) { return ((ISvgWindow)baseObject).PrintNode(((XmlNode)((ScriptableNode)node).baseObject)); } public IScriptableNode parseXML(string xml, IScriptableDocument owner) { object result = ((ISvgWindow)baseObject).ParseXML(xml, ((XmlDocument)((ScriptableDocument)owner).baseObject)); return (result != null) ? (IScriptableNode)ScriptableObject.CreateWrapper(result) : null; } public void registerEval(object scriptFunction) { JScriptEngine js = ((JScriptEngine)Engine); js.EvaluateFunction = (ScriptFunction)scriptFunction; } #endregion #region Properties - IScriptableWindow public IScriptableSvgDocument document { get { object result = ((ISvgWindow)baseObject).Document; return (result != null) ? (IScriptableSvgDocument)ScriptableObject.CreateWrapper(result) : null; } } public IScriptableSvgDocument svgDocument { get { object result = ((ISvgWindow)baseObject).Document; return (result != null) ? (IScriptableSvgDocument)ScriptableObject.CreateWrapper(result) : null; } } public IScriptableStyleSheet defaultStyleSheet { get { object result = ((ISvgWindow)baseObject).DefaultStyleSheet; return (result != null) ? (IScriptableStyleSheet)ScriptableObject.CreateWrapper(result) : null; } } public long innerWidth { get { return ((ISvgWindow)baseObject).InnerWidth; } } public long innerHeight { get { return ((ISvgWindow)baseObject).InnerHeight; } } #endregion } } --- NEW FILE: ViewsWrapper.cs --- using System; using SharpVectors.Dom; using SharpVectors.Dom.Css; using SharpVectors.Dom.Events; using SharpVectors.Dom.Stylesheets; using SharpVectors.Dom.Svg; using SharpVectors.Dom.Views; namespace SharpVectors.Scripting { /// <summary> /// Implementation wrapper for IScriptableAbstractView /// </summary> public class ScriptableAbstractView : ScriptableObject, IScriptableAbstractView { public ScriptableAbstractView(object baseObject) : base (baseObject) { } #region Properties - IScriptableAbstractView public IScriptableDocumentView document { get { object result = ((IAbstractView)baseObject).Document; return (result != null) ? (IScriptableDocumentView)ScriptableObject.CreateWrapper(result) : null; } } #endregion } /// <summary> /// Implementation wrapper for IScriptableDocumentView /// </summary> public class ScriptableDocumentView : ScriptableObject, IScriptableDocumentView { public ScriptableDocumentView(object baseObject) : base (baseObject) { } #region Properties - IScriptableDocumentView public IScriptableAbstractView defaultView { get { object result = ((IDocumentView)baseObject).DefaultView; return (result != null) ? (IScriptableAbstractView)ScriptableObject.CreateWrapper(result) : null; } } #endregion } } --- NEW FILE: ScriptWrapper.cs --- using System; using System.Collections; using SharpVectors.Dom; using SharpVectors.Dom.Css; using SharpVectors.Dom.Events; using SharpVectors.Dom.Stylesheets; using SharpVectors.Dom.Svg; using SharpVectors.Dom.Views; using SharpVectors.Xml; using SharpVectors.Collections; namespace SharpVectors.Scripting { /// /// Base class for all wrappers /// public class ScriptableObject { internal object baseObject = null; /// <summary> /// Base constructor, if used you must assign the baseObject after the call. /// This constructor should only be called internally. Higher order classes should construct /// new wrappers using the CreateWrapper function to allow for type lookups. /// </summary> public ScriptableObject() { this.baseObject = null; } /// <summary> /// Base constructor, accepts the baseObject that will be wrapped with all inherited calls. /// This constructor should only be called internally. Higher order classes should construct /// new wrappers using the CreateWrapper function to allow for type lookups. /// </summary> /// <param name="baseObject">The object to wrap with a scriptable object.</param> public ScriptableObject(object baseObject) { this.baseObject = baseObject; } ~ScriptableObject() { // We need to remove the item from the global hash table ScriptableObject.RemoveWrapper(baseObject); } private static Object[] args = new Object[1]; private static Hashtable wrappers = new Hashtable(); /// <summary> /// Creates a new scriptable wrapper for the specified object. Use this function instead /// of calling the ScriptableObject constructor. /// </summary> /// <param name="wrappableObject">The object to wrap. It's type will be used as a key /// in a lookup for creating the correct wrappable type.</param> /// <returns>A new scriptable object that has been created with a type corresponding /// to the wrappableObject's type.</returns> public static ScriptableObject CreateWrapper(object wrappableObject) { // return null if we get null if (wrappableObject == null) return null; // Check that the static table is built if (wrapperTypes == null) InitializeWrapperTypes(); // Do we already have a wrapper for this object? WeakReference weak = (WeakReference)wrappers[wrappableObject]; ScriptableObject so = null; if (weak != null) { so = (ScriptableObject)weak.Target; if (so != null) return so; } // Return a new instance try { // Normal try { args[0] = wrappableObject; so = (ScriptableObject)wrapperTypes.CreateInstance(wrappableObject.GetType().Name, args); wrappers[wrappableObject] = new WeakReference(so); return so; } catch (Exception) { // Try the ancestor so = (ScriptableObject)wrapperTypes.CreateInstance(wrappableObject.GetType().BaseType.Name, args); wrappers[wrappableObject] = new WeakReference(so); return so; } } catch(Exception e) { throw new SvgException(SvgExceptionType.SvgWrongTypeErr, "Could not create wrappable type for " + wrappableObject.GetType().FullName, e); } } /// <summary> /// Removes the wrapper and base object key value pair. This function is called by the ScriptableObject destructor. /// </summary> /// <param name="baseObject"></param> public static void RemoveWrapper(object wrappableObject) { if (wrappableObject == null) return; // Remove it wrappers.Remove(wrappableObject); } // The table of key types to wrappable type values private static TypeDictionary wrapperTypes = null; /// <summary> /// Builds the wrapper type table for static lookups /// </summary> private static void InitializeWrapperTypes() { wrapperTypes = new TypeDictionary(); // CSS Types wrapperTypes[typeof(CssRuleList).Name] = typeof(ScriptableCssRuleList); wrapperTypes[typeof(CssRule).Name] = typeof(ScriptableCssRule); wrapperTypes[typeof(CssStyleRule).Name] = typeof(ScriptableCssStyleRule); wrapperTypes[typeof(CssMediaRule).Name] = typeof(ScriptableCssMediaRule); wrapperTypes[typeof(CssFontFaceRule).Name] = typeof(ScriptableCssFontFaceRule); wrapperTypes[typeof(CssPageRule).Name] = typeof(ScriptableCssPageRule); wrapperTypes[typeof(CssImportRule).Name] = typeof(ScriptableCssImportRule); wrapperTypes[typeof(CssCharsetRule).Name] = typeof(ScriptableCssCharsetRule); wrapperTypes[typeof(CssUnknownRule).Name] = typeof(ScriptableCssUnknownRule); wrapperTypes[typeof(CssStyleDeclaration).Name] = typeof(ScriptableCssStyleDeclaration); wrapperTypes[typeof(CssValue).Name] = typeof(ScriptableCssValue); wrapperTypes[typeof(CssPrimitiveValue).Name] = typeof(ScriptableCssPrimitiveValue); //TODO wrapperTypes[typeof(CssValueList).Name] = typeof(ScriptableCssValueList); wrapperTypes[typeof(RgbColor).Name] = typeof(ScriptableRgbColor); wrapperTypes[typeof(Rect).Name] = typeof(ScriptableRect); //TODO wrapperTypes[typeof(Counter).Name] = typeof(ScriptableCounter); //TODO wrapperTypes[typeof(ElementCssInlineStyle).Name] = typeof(ScriptableElementCssInlineStyle); //TODO wrapperTypes[typeof(Css2Properties).Name] = typeof(ScriptableCss2Properties); wrapperTypes[typeof(CssStyleSheet).Name] = typeof(ScriptableCssStyleSheet); //TODO wrapperTypes[typeof(ViewCss).Name] = typeof(ScriptableViewCss); //TODO wrapperTypes[typeof(DocumentCss).Name] = typeof(ScriptableDocumentCss); //TODO wrapperTypes[typeof(DomImplementationCss).Name] = typeof(ScriptableDomImplementationCss); // DOM Types wrapperTypes[typeof(SharpVectors.Dom.DomImplementation).Name] = typeof(ScriptableDomImplementation); wrapperTypes[typeof(System.Xml.XmlNode).Name] = typeof(ScriptableNode); wrapperTypes[typeof(SharpVectors.Dom.NodeListAdapter).Name] = typeof(ScriptableNodeList); wrapperTypes[typeof(System.Xml.XmlNodeList).Name] = typeof(ScriptableNodeList); wrapperTypes[typeof(SharpVectors.Dom.NodeListAdapter).Name] = typeof(ScriptableNodeList); wrapperTypes[typeof(System.Xml.XmlNamedNodeMap).Name] = typeof(ScriptableNamedNodeMap); wrapperTypes[typeof(System.Xml.XmlCDataSection).Name] = typeof(ScriptableCharacterData); wrapperTypes[typeof(SharpVectors.Dom.Attribute).Name] = typeof(ScriptableAttr); wrapperTypes[typeof(SharpVectors.Dom.Element).Name] = typeof(ScriptableElement); wrapperTypes[typeof(SharpVectors.Dom.Text).Name] = typeof(ScriptableText); wrapperTypes[typeof(SharpVectors.Dom.Comment).Name] = typeof(ScriptableComment); wrapperTypes[typeof(SharpVectors.Dom.CDataSection).Name] = typeof(ScriptableCDataSection); wrapperTypes[typeof(SharpVectors.Dom.DocumentType).Name] = typeof(ScriptableDocumentType); wrapperTypes[typeof(System.Xml.XmlNotation).Name] = typeof(ScriptableNotation); wrapperTypes[typeof(System.Xml.XmlEntity).Name] = typeof(ScriptableEntity); wrapperTypes[typeof(SharpVectors.Dom.EntityReference).Name] = typeof(ScriptableEntityReference); wrapperTypes[typeof(SharpVectors.Dom.ProcessingInstruction).Name] = typeof(ScriptableProcessingInstruction); wrapperTypes[typeof(SharpVectors.Dom.DocumentFragment).Name] = typeof(ScriptableDocumentFragment); wrapperTypes[typeof(SharpVectors.Dom.Document).Name] = typeof(ScriptableDocument); // Events Types wrapperTypes[typeof(EventTarget).Name] = typeof(ScriptableEventTarget); //TODO wrapperTypes[typeof(EventListener).Name] = typeof(ScriptableEventListener); wrapperTypes[typeof(Event).Name] = typeof(ScriptableEvent); //TODO, I think this is handled under Document: wrapperTypes[typeof(DocumentEvent).Name] = typeof(ScriptableDocumentEvent); wrapperTypes[typeof(UiEvent).Name] = typeof(ScriptableUiEvent); wrapperTypes[typeof(MouseEvent).Name] = typeof(ScriptableMouseEvent); wrapperTypes[typeof(MutationEvent).Name] = typeof(ScriptableMutationEvent); wrapperTypes[typeof(IUiEvent).Name] = typeof(ScriptableUiEvent); wrapperTypes[typeof(IMouseEvent).Name] = typeof(ScriptableMouseEvent); wrapperTypes[typeof(IMutationEvent).Name] = typeof(ScriptableMutationEvent); // SMIL Types //TODO wrapperTypes[typeof(ElementTimeControl).Name] = typeof(ScriptableElementTimeControl); //TODO wrapperTypes[typeof(TimeEvent).Name] = typeof(ScriptableTimeEvent); // StyleSheets Types wrapperTypes[typeof(StyleSheet).Name] = typeof(ScriptableStyleSheet); wrapperTypes[typeof(StyleSheetList).Name] = typeof(ScriptableStyleSheetList); wrapperTypes[typeof(MediaList).Name] = typeof(ScriptableMediaList); //TODO wrapperTypes[typeof(LinkStyle).Name] = typeof(ScriptableLinkStyle); //TODO wrapperTypes[typeof(DocumentStyle).Name] = typeof(ScriptableDocumentStyle); // SVG Types wrapperTypes[typeof(SvgElement).Name] = typeof(ScriptableSvgElement); wrapperTypes[typeof(SvgAnimatedBoolean).Name] = typeof(ScriptableSvgAnimatedBoolean); wrapperTypes[typeof(SvgAnimatedString).Name] = typeof(ScriptableSvgAnimatedString); wrapperTypes[typeof(SvgStringList).Name] = typeof(ScriptableSvgStringList); wrapperTypes[typeof(SvgAnimatedEnumeration).Name] = typeof(ScriptableSvgAnimatedEnumeration); //TODO wrapperTypes[typeof(SvgAnimatedInteger).Name] = typeof(ScriptableSvgAnimatedInteger); wrapperTypes[typeof(SvgNumber).Name] = typeof(ScriptableSvgNumber); wrapperTypes[typeof(SvgAnimatedNumber).Name] = typeof(ScriptableSvgAnimatedNumber); wrapperTypes[typeof(SvgNumberList).Name] = typeof(ScriptableSvgNumberList); wrapperTypes[typeof(SvgAnimatedNumberList).Name] = typeof(ScriptableSvgAnimatedNumberList); wrapperTypes[typeof(SvgLength).Name] = typeof(ScriptableSvgLength); wrapperTypes[typeof(SvgAnimatedLength).Name] = typeof(ScriptableSvgAnimatedLength); wrapperTypes[typeof(SvgLengthList).Name] = typeof(ScriptableSvgLengthList); wrapperTypes[typeof(SvgAnimatedLengthList).Name] = typeof(ScriptableSvgAnimatedLengthList); wrapperTypes[typeof(SvgAngle).Name] = typeof(ScriptableSvgAngle); wrapperTypes[typeof(SvgAnimatedAngle).Name] = typeof(ScriptableSvgAnimatedAngle); wrapperTypes[typeof(SvgColor).Name] = typeof(ScriptableSvgColor); //TODO wrapperTypes[typeof(SvgIccColor).Name] = typeof(ScriptableSvgIccColor); wrapperTypes[typeof(SvgRect).Name] = typeof(ScriptableSvgRect); wrapperTypes[typeof(SvgAnimatedRect).Name] = typeof(ScriptableSvgAnimatedRect); //No Type information wrapperTypes[typeof(SvgUnitTypes).Name] = typeof(ScriptableSvgUnitTypes); wrapperTypes[typeof(SvgStyleableElement).Name] = typeof(ScriptableSvgStylable); //TODO wrapperTypes[typeof(SvgLocatable).Name] = typeof(ScriptableSvgLocatable); wrapperTypes[typeof(SvgTransformableElement).Name] = typeof(ScriptableSvgTransformable); wrapperTypes[typeof(SvgTests).Name] = typeof(ScriptableSvgTests); //TODO wrapperTypes[typeof(SvgLangSpace).Name] = typeof(ScriptableSvgLangSpace); wrapperTypes[typeof(SvgExternalResourcesRequired).Name] = typeof(ScriptableSvgExternalResourcesRequired); wrapperTypes[typeof(SvgFitToViewBox).Name] = typeof(ScriptableSvgFitToViewBox); wrapperTypes[typeof(SvgZoomAndPan).Name] = typeof(ScriptableSvgZoomAndPan); wrapperTypes[typeof(SvgViewSpec).Name] = typeof(ScriptableSvgViewSpec); wrapperTypes[typeof(SvgURIReference).Name] = typeof(ScriptableSvgUriReference); //No Type information wrapperTypes[typeof(SvgCssRule).Name] = typeof(ScriptableSvgCssRule); //No Type information wrapperTypes[typeof(SvgRenderingIntent).Name] = typeof(ScriptableSvgRenderingIntent); wrapperTypes[typeof(SvgDocument).Name] = typeof(ScriptableSvgDocument); wrapperTypes[typeof(SvgSvgElement).Name] = typeof(ScriptableSvgSvgElement); wrapperTypes[typeof(SvgGElement).Name] = typeof(ScriptableSvgGElement); wrapperTypes[typeof(SvgDefsElement).Name] = typeof(ScriptableSvgDefsElement); wrapperTypes[typeof(SvgDescElement).Name] = typeof(ScriptableSvgDescElement); wrapperTypes[typeof(SvgTitleElement).Name] = typeof(ScriptableSvgTitleElement); wrapperTypes[typeof(SvgSymbolElement).Name] = typeof(ScriptableSvgSymbolElement); wrapperTypes[typeof(SvgUseElement).Name] = typeof(ScriptableSvgUseElement); wrapperTypes[typeof(SvgElementInstance).Name] = typeof(ScriptableSvgElementInstance); wrapperTypes[typeof(SvgElementInstanceList).Name] = typeof(ScriptableSvgElementInstanceList); wrapperTypes[typeof(SvgImageElement).Name] = typeof(ScriptableSvgImageElement); wrapperTypes[typeof(SvgSwitchElement).Name] = typeof(ScriptableSvgSwitchElement); //TODO wrapperTypes[typeof(GetSvgDocument).Name] = typeof(ScriptableGetSvgDocument); //TODO wrapperTypes[typeof(SvgStyleElement).Name] = typeof(ScriptableSvgStyleElement); wrapperTypes[typeof(SvgPoint).Name] = typeof(ScriptableSvgPoint); wrapperTypes[typeof(SvgPointList).Name] = typeof(ScriptableSvgPointList); wrapperTypes[typeof(SvgMatrix).Name] = typeof(ScriptableSvgMatrix); wrapperTypes[typeof(SvgTransform).Name] = typeof(ScriptableSvgTransform); wrapperTypes[typeof(SvgTransformList).Name] = typeof(ScriptableSvgTransformList); wrapperTypes[typeof(SvgAnimatedTransformList).Name] = typeof(ScriptableSvgAnimatedTransformList); wrapperTypes[typeof(SvgPreserveAspectRatio).Name] = typeof(ScriptableSvgPreserveAspectRatio); wrapperTypes[typeof(SvgAnimatedPreserveAspectRatio).Name] = typeof(ScriptableSvgAnimatedPreserveAspectRatio); wrapperTypes[typeof(SvgPathSeg).Name] = typeof(ScriptableSvgPathSeg); wrapperTypes[typeof(SvgPathSegClosePath).Name] = typeof(ScriptableSvgPathSegClosePath); wrapperTypes[typeof(SvgPathSegMovetoAbs).Name] = typeof(ScriptableSvgPathSegMovetoAbs); wrapperTypes[typeof(SvgPathSegMovetoRel).Name] = typeof(ScriptableSvgPathSegMovetoRel); wrapperTypes[typeof(SvgPathSegLinetoAbs).Name] = typeof(ScriptableSvgPathSegLinetoAbs); wrapperTypes[typeof(SvgPathSegLinetoRel).Name] = typeof(ScriptableSvgPathSegLinetoRel); wrapperTypes[typeof(SvgPathSegCurvetoCubicAbs).Name] = typeof(ScriptableSvgPathSegCurvetoCubicAbs); wrapperTypes[typeof(SvgPathSegCurvetoCubicRel).Name] = typeof(ScriptableSvgPathSegCurvetoCubicRel); wrapperTypes[typeof(SvgPathSegCurvetoQuadraticAbs).Name] = typeof(ScriptableSvgPathSegCurvetoQuadraticAbs); wrapperTypes[typeof(SvgPathSegCurvetoQuadraticRel).Name] = typeof(ScriptableSvgPathSegCurvetoQuadraticRel); wrapperTypes[typeof(SvgPathSegArcAbs).Name] = typeof(ScriptableSvgPathSegArcAbs); wrapperTypes[typeof(SvgPathSegArcRel).Name] = typeof(ScriptableSvgPathSegArcRel); wrapperTypes[typeof(SvgPathSegLinetoHorizontalAbs).Name] = typeof(ScriptableSvgPathSegLinetoHorizontalAbs); wrapperTypes[typeof(SvgPathSegLinetoHorizontalRel).Name] = typeof(ScriptableSvgPathSegLinetoHorizontalRel); wrapperTypes[typeof(SvgPathSegLinetoVerticalAbs).Name] = typeof(ScriptableSvgPathSegLinetoVerticalAbs); wrapperTypes[typeof(SvgPathSegLinetoVerticalRel).Name] = typeof(ScriptableSvgPathSegLinetoVerticalRel); wrapperTypes[typeof(SvgPathSegCurvetoCubicSmoothAbs).Name] = typeof(ScriptableSvgPathSegCurvetoCubicSmoothAbs); wrapperTypes[typeof(SvgPathSegCurvetoCubicSmoothRel).Name] = typeof(ScriptableSvgPathSegCurvetoCubicSmoothRel); wrapperTypes[typeof(SvgPathSegCurvetoQuadraticSmoothAbs).Name] = typeof(ScriptableSvgPathSegCurvetoQuadraticSmoothAbs); wrapperTypes[typeof(SvgPathSegCurvetoQuadraticSmoothRel).Name] = typeof(ScriptableSvgPathSegCurvetoQuadraticSmoothRel); wrapperTypes[typeof(SvgPathSegList).Name] = typeof(ScriptableSvgPathSegList); //TODO wrapperTypes[typeof(SvgAnimatedPathData).Name] = typeof(ScriptableSvgAnimatedPathData); wrapperTypes[typeof(SvgPathElement).Name] = typeof(ScriptableSvgPathElement); wrapperTypes[typeof(SvgRectElement).Name] = typeof(ScriptableSvgRectElement); wrapperTypes[typeof(SvgCircleElement).Name] = typeof(ScriptableSvgCircleElement); wrapperTypes[typeof(SvgEllipseElement).Name] = typeof(ScriptableSvgEllipseElement); wrapperTypes[typeof(SvgLineElement).Name] = typeof(ScriptableSvgLineElement); //TODO wrapperTypes[typeof(SvgAnimatedPoints).Name] = typeof(ScriptableSvgAnimatedPoints); wrapperTypes[typeof(SvgPolylineElement).Name] = typeof(ScriptableSvgPolylineElement); wrapperTypes[typeof(SvgPolygonElement).Name] = typeof(ScriptableSvgPolygonElement); wrapperTypes[typeof(SvgTextContentElement).Name] = typeof(ScriptableSvgTextContentElement); wrapperTypes[typeof(SvgTextPositioningElement).Name] = typeof(ScriptableSvgTextPositioningElement); wrapperTypes[typeof(SvgTextElement).Name] = typeof(ScriptableSvgTextElement); wrapperTypes[typeof(SvgTSpanElement).Name] = typeof(ScriptableSvgTSpanElement); wrapperTypes[typeof(SvgTRefElement).Name] = typeof(ScriptableSvgTRefElement); //TODO wrapperTypes[typeof(SvgTextPathElement).Name] = typeof(ScriptableSvgTextPathElement); //TODO wrapperTypes[typeof(SvgAltGlyphElement).Name] = typeof(ScriptableSvgAltGlyphElement); //TODO wrapperTypes[typeof(SvgAltGlyphDefElement).Name] = typeof(ScriptableSvgAltGlyphDefElement); //TODO wrapperTypes[typeof(SvgAltGlyphItemElement).Name] = typeof(ScriptableSvgAltGlyphItemElement); //TODO wrapperTypes[typeof(SvgGlyphRefElement).Name] = typeof(ScriptableSvgGlyphRefElement); wrapperTypes[typeof(SvgPaint).Name] = typeof(ScriptableSvgPaint); wrapperTypes[typeof(SvgMarkerElement).Name] = typeof(ScriptableSvgMarkerElement); //TODO wrapperTypes[typeof(SvgColorProfileElement).Name] = typeof(ScriptableSvgColorProfileElement); //TODO wrapperTypes[typeof(SvgColorProfileRule).Name] = typeof(ScriptableSvgColorProfileRule); wrapperTypes[typeof(SvgGradientElement).Name] = typeof(ScriptableSvgGradientElement); wrapperTypes[typeof(SvgLinearGradientElement).Name] = typeof(ScriptableSvgLinearGradientElement); wrapperTypes[typeof(SvgRadialGradientElement).Name] = typeof(ScriptableSvgRadialGradientElement); wrapperTypes[typeof(SvgStopElement).Name] = typeof(ScriptableSvgStopElement); wrapperTypes[typeof(SvgPatternElement).Name] = typeof(ScriptableSvgPatternElement); wrapperTypes[typeof(SvgClipPathElement).Name] = typeof(ScriptableSvgClipPathElement); wrapperTypes[typeof(SvgMaskElement).Name] = typeof(ScriptableSvgMaskElement); wrapperTypes[typeof(SvgFilterElement).Name] = typeof(ScriptableSvgFilterElement); //TODO wrapperTypes[typeof(SvgFilterPrimitiveStandardAttributes).Name] = typeof(ScriptableSvgFilterPrimitiveStandardAttributes); //TODO wrapperTypes[typeof(SvgFEBlendElement).Name] = typeof(ScriptableSvgFEBlendElement); //TODO wrapperTypes[typeof(SvgFEColorMatrixElement).Name] = typeof(ScriptableSvgFEColorMatrixElement); //TODO wrapperTypes[typeof(SvgFEComponentTransferElement).Name] = typeof(ScriptableSvgFEComponentTransferElement); //TODO wrapperTypes[typeof(SvgComponentTransferFunctionElement).Name] = typeof(ScriptableSvgComponentTransferFunctionElement); //TODO wrapperTypes[typeof(SvgFEFuncRElement).Name] = typeof(ScriptableSvgFEFuncRElement); //TODO wrapperTypes[typeof(SvgFEFuncGElement).Name] = typeof(ScriptableSvgFEFuncGElement); //TODO wrapperTypes[typeof(SvgFEFuncBElement).Name] = typeof(ScriptableSvgFEFuncBElement); //TODO wrapperTypes[typeof(SvgFEFuncAElement).Name] = typeof(ScriptableSvgFEFuncAElement); //TODO wrapperTypes[typeof(SvgFECompositeElement).Name] = typeof(ScriptableSvgFECompositeElement); //TODO wrapperTypes[typeof(SvgFEConvolveMatrixElement).Name] = typeof(ScriptableSvgFEConvolveMatrixElement); //TODO wrapperTypes[typeof(SvgFEDiffuseLightingElement).Name] = typeof(ScriptableSvgFEDiffuseLightingElement); //TODO wrapperTypes[typeof(SvgFEDistantLightElement).Name] = typeof(ScriptableSvgFEDistantLightElement); //TODO wrapperTypes[typeof(SvgFEPointLightElement).Name] = typeof(ScriptableSvgFEPointLightElement); //TODO wrapperTypes[typeof(SvgFESpotLightElement).Name] = typeof(ScriptableSvgFESpotLightElement); //TODO wrapperTypes[typeof(SvgFEDisplacementMapElement).Name] = typeof(ScriptableSvgFEDisplacementMapElement); //TODO wrapperTypes[typeof(SvgFEFloodElement).Name] = typeof(ScriptableSvgFEFloodElement); //TODO wrapperTypes[typeof(SvgFEGaussianBlurElement).Name] = typeof(ScriptableSvgFEGaussianBlurElement); //TODO wrapperTypes[typeof(SvgFEImageElement).Name] = typeof(ScriptableSvgFEImageElement); //TODO wrapperTypes[typeof(SvgFEMergeElement).Name] = typeof(ScriptableSvgFEMergeElement); //TODO wrapperTypes[typeof(SvgFEMergeNodeElement).Name] = typeof(ScriptableSvgFEMergeNodeElement); //TODO wrapperTypes[typeof(SvgFEMorphologyElement).Name] = typeof(ScriptableSvgFEMorphologyElement); //TODO wrapperTypes[typeof(SvgFEOffsetElement).Name] = typeof(ScriptableSvgFEOffsetElement); //TODO wrapperTypes[typeof(SvgFESpecularLightingElement).Name] = typeof(ScriptableSvgFESpecularLightingElement); //TODO wrapperTypes[typeof(SvgFETileElement).Name] = typeof(ScriptableSvgFETileElement); //TODO wrapperTypes[typeof(SvgFETurbulenceElement).Name] = typeof(ScriptableSvgFETurbulenceElement); //TODO wrapperTypes[typeof(SvgCursorElement).Name] = typeof(ScriptableSvgCursorElement); //TODO wrapperTypes[typeof(SvgAElement).Name] = typeof(ScriptableSvgAElement); //TODO wrapperTypes[typeof(SvgViewElement).Name] = typeof(ScriptableSvgViewElement); wrapperTypes[typeof(SvgScriptElement).Name] = typeof(ScriptableSvgScriptElement); //TODO wrapperTypes[typeof(SvgEvent).Name] = typeof(ScriptableSvgEvent); //TODO wrapperTypes[typeof(SvgZoomEvent).Name] = typeof(ScriptableSvgZoomEvent); //TODO wrapperTypes[typeof(SvgAnimationElement).Name] = typeof(ScriptableSvgAnimationElement); //TODO wrapperTypes[typeof(SvgAnimateElement).Name] = typeof(ScriptableSvgAnimateElement); //TODO wrapperTypes[typeof(SvgSetElement).Name] = typeof(ScriptableSvgSetElement); //TODO wrapperTypes[typeof(SvgAnimateMotionElement).Name] = typeof(ScriptableSvgAnimateMotionElement); //TODO wrapperTypes[typeof(SvgMPathElement).Name] = typeof(ScriptableSvgMPathElement); //TODO wrapperTypes[typeof(SvgAnimateColorElement).Name] = typeof(ScriptableSvgAnimateColorElement); //TODO wrapperTypes[typeof(SvgAnimateTransformElement).Name] = typeof(ScriptableSvgAnimateTransformElement); //TODO wrapperTypes[typeof(SvgFontElement).Name] = typeof(ScriptableSvgFontElement); //TODO wrapperTypes[typeof(SvgGlyphElement).Name] = typeof(ScriptableSvgGlyphElement); //TODO wrapperTypes[typeof(SvgMissingGlyphElement).Name] = typeof(ScriptableSvgMissingGlyphElement); //TODO wrapperTypes[typeof(SvgHKernElement).Name] = typeof(ScriptableSvgHKernElement); //TODO wrapperTypes[typeof(SvgVKernElement).Name] = typeof(ScriptableSvgVKernElement); //TODO wrapperTypes[typeof(SvgFontFaceElement).Name] = typeof(ScriptableSvgFontFaceElement); //TODO wrapperTypes[typeof(SvgFontFaceSrcElement).Name] = typeof(ScriptableSvgFontFaceSrcElement); //TODO wrapperTypes[typeof(SvgFontFaceUriElement).Name] = typeof(ScriptableSvgFontFaceUriElement); //TODO wrapperTypes[typeof(SvgFontFaceFormatElement).Name] = typeof(ScriptableSvgFontFaceFormatElement); //TODO wrapperTypes[typeof(SvgFontFaceNameElement).Name] = typeof(ScriptableSvgFontFaceNameElement); //TODO wrapperTypes[typeof(SvgDefinitionSrcElement).Name] = typeof(ScriptableSvgDefinitionSrcElement); wrapperTypes[typeof(SvgMetadataElement).Name] = typeof(ScriptableSvgMetadataElement); //TODO wrapperTypes[typeof(SvgForeignObjectElement).Name] = typeof(ScriptableSvgForeignObjectElement); // Views Types //TODO wrapperTypes[typeof(AbstractView).Name] = typeof(ScriptableAbstractView); //TODO wrapperTypes[typeof(DocumentView).Name] = typeof(ScriptableDocumentView); // Window Types wrapperTypes[typeof(SvgWindow).Name] = typeof(ScriptableSvgWindow); } public override bool Equals(Object obj) { if (obj == null) return false; return obj is ScriptableObject && this.baseObject == ((ScriptableObject)obj).baseObject; } public override int GetHashCode() { if (baseObject == null) return 0; return baseObject.GetHashCode(); } public static bool operator ==(ScriptableObject x, ScriptableObject y) { if ((object)x == null || (object)y == null) return false; return x.baseObject == y.baseObject; } public static bool operator !=(ScriptableObject x, ScriptableObject y) { return !(x == y); } } } --- NEW FILE: Dom.cs --- using System; namespace SharpVectors.Scripting { /// /// IScriptableDomTimeStamp /// public interface IScriptableDomTimeStamp { } /// <summary> /// IScriptableDomImplementation /// </summary> public interface IScriptableDomImplementation { bool hasFeature(string feature, string version); IScriptableDocumentType createDocumentType(string qualifiedName, string publicId, string systemId); IScriptableDocument createDocument(string namespaceURI, string qualifiedName, IScriptableDocumentType doctype); } /// <summary> /// IScriptableNode /// </summary> public interface IScriptableNode { IScriptableNode insertBefore(IScriptableNode newChild, IScriptableNode refChild); IScriptableNode replaceChild(IScriptableNode newChild, IScriptableNode oldChild); IScriptableNode removeChild(IScriptableNode oldChild); IScriptableNode appendChild(IScriptableNode newChild); bool hasChildNodes(); IScriptableNode cloneNode(bool deep); void normalize(); bool isSupported(string feature, string version); bool hasAttributes(); string nodeName { get; } string nodeValue { get; set; } ushort nodeType { get; } IScriptableNode parentNode { get; } IScriptableNodeList childNodes { get; } IScriptableNode firstChild { get; } IScriptableNode lastChild { get; } IScriptableNode previousSibling { get; } IScriptableNode nextSibling { get; } IScriptableNamedNodeMap attributes { get; } IScriptableDocument ownerDocument { get; } string namespaceURI { get; } string prefix { get; set; } string localName { get; } } /// <summary> /// IScriptableNode... [truncated message content] |