[Got legacy domconv to compile. golubovsky@gmail.com**20090321032925 Ignore-this: bd7f93d3d801b2a2fc5f069b355d113e ] { addfile ./README hunk ./README 1 +This repo houses various projects aimed at utilization of +Haskell as a language in Web programming. + addfile ./domconv/Setup.hs hunk ./domconv/Setup.hs 1 - +import Distribution.Simple +main = defaultMain adddir ./domconv/W3C adddir ./domconv/W3C/DOM2 addfile ./domconv/W3C/DOM2/COPYRIGHT.html hunk ./domconv/W3C/DOM2/COPYRIGHT.html 1 + + + + + W3C IPR SOFTWARE NOTICE + + +

+ W3C IPR SOFTWARE NOTICE +

+

+ Copyright © 2000 World Wide Web + Consortium, (Massachusetts + Institute of Technology, Institut + National de Recherche en Informatique et en Automatique, Keio University). All Rights + Reserved. +

+

+ The DOM bindings are published under the W3C Software Copyright Notice + and License. The software license requires "Notice of any changes or + modifications to the W3C files, including the date changes were made." + Consequently, modified versions of the DOM bindings must document that + they do not conform to the W3C standard; in the case of the IDL binding, + the pragma prefix can no longer be 'w3c.org'; in the case of the Java + binding, the package names can no longer be in the 'org.w3c' package. +

+

+ Note: The original version of the W3C Software Copyright Notice + and License could be found at http://www.w3.org/Consortium/Legal/copyright-software-19980720 +

+

+ Copyright © 1994-2000 World Wide Web + Consortium, (Massachusetts + Institute of Technology, Institut + National de Recherche en Informatique et en Automatique, Keio University). All Rights + Reserved. http://www.w3.org/Consortium/Legal/ +

+

+ This W3C work (including software, documents, or other related items) is + being provided by the copyright holders under the following license. By + obtaining, using and/or copying this work, you (the licensee) agree that + you have read, understood, and will comply with the following terms and + conditions: +

+

+ Permission to use, copy, and modify this software and its documentation, + with or without modification,  for any purpose and without fee or + royalty is hereby granted, provided that you include the following on ALL + copies of the software and documentation or portions thereof, including + modifications, that you make: +

+
    +
  1. + The full text of this NOTICE in a location viewable to users of the + redistributed or derivative work. +
  2. +
  3. + Any pre-existing intellectual property disclaimers, notices, or terms + and conditions. If none exist, a short notice of the following form + (hypertext is preferred, text is permitted) should be used within the + body of any redistributed or derivative code: "Copyright © + [$date-of-software] World Wide Web + Consortium, (Massachusetts + Institute of Technology, Institut + National de Recherche en Informatique et en Automatique, Keio University). All Rights + Reserved. http://www.w3.org/Consortium/Legal/" +
  4. +
  5. + Notice of any changes or modifications to the W3C files, including the + date changes were made. (We recommend you provide URIs to the location + from which the code is derived.) +
  6. +
+

+ THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT + HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, + INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS + FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR + DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, + TRADEMARKS OR OTHER RIGHTS. +

+

+ COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR + CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR + DOCUMENTATION. +

+

+ The name and trademarks of copyright holders may NOT be used in + advertising or publicity pertaining to the software without specific, + written prior permission. Title to copyright in this software and any + associated documentation will at all times remain with copyright + holders. +

+ + adddir ./domconv/W3C/DOM2/idl addfile ./domconv/W3C/DOM2/idl/css.idl hunk ./domconv/W3C/DOM2/idl/css.idl 1 +/* + * Copyright (c) 2000 World Wide Web Consortium, + * (Massachusetts Institute of Technology, Institut National de + * Recherche en Informatique et en Automatique, Keio University). All + * Rights Reserved. This program is distributed under the W3C's Software + * Intellectual Property License. This program is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. + * See W3C License http://www.w3.org/Consortium/Legal/ for more details. + */ + +// File: http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/css.idl + +#ifndef _CSS_IDL_ +#define _CSS_IDL_ + +#include "dom.idl" +#include "stylesheets.idl" +#include "views.idl" + +#pragma prefix "dom.w3c.org" +module css +{ + +// typedef dom::DOMString DOMString; +// typedef dom::Element Element; +// typedef dom::DOMImplementation DOMImplementation; + + interface CSSRule; + interface CSSStyleSheet; + interface CSSStyleDeclaration; + interface CSSValue; + interface Counter; + interface Rect; + interface RGBColor; + + // Introduced in DOM Level 2: + interface CSSRuleList { + readonly attribute unsigned long length; + CSSRule item(in unsigned long index); + }; + + // Introduced in DOM Level 2: + interface CSSRule { + + // RuleType + const unsigned short UNKNOWN_RULE = 0; + const unsigned short STYLE_RULE = 1; + const unsigned short CHARSET_RULE = 2; + const unsigned short IMPORT_RULE = 3; + const unsigned short MEDIA_RULE = 4; + const unsigned short FONT_FACE_RULE = 5; + const unsigned short PAGE_RULE = 6; + + readonly attribute unsigned short type; + attribute DOMString cssText; + // raises(dom::DOMException) on setting + + readonly attribute CSSStyleSheet parentStyleSheet; + readonly attribute CSSRule parentRule; + }; + + // Introduced in DOM Level 2: + interface CSSStyleRule : CSSRule { + attribute DOMString selectorText; + // raises(dom::DOMException) on setting + + readonly attribute CSSStyleDeclaration style; + }; + + // Introduced in DOM Level 2: + interface CSSMediaRule : CSSRule { + readonly attribute MediaList media; + readonly attribute CSSRuleList cssRules; + unsigned long insertRule(in DOMString rule, + in unsigned long index) + raises(dom::DOMException); + void deleteRule(in unsigned long index) + raises(dom::DOMException); + }; + + // Introduced in DOM Level 2: + interface CSSFontFaceRule : CSSRule { + readonly attribute CSSStyleDeclaration style; + }; + + // Introduced in DOM Level 2: + interface CSSPageRule : CSSRule { + attribute DOMString selectorText; + // raises(dom::DOMException) on setting + + readonly attribute CSSStyleDeclaration style; + }; + + // Introduced in DOM Level 2: + interface CSSImportRule : CSSRule { + readonly attribute DOMString href; + readonly attribute MediaList media; + readonly attribute CSSStyleSheet styleSheet; + }; + + // Introduced in DOM Level 2: + interface CSSCharsetRule : CSSRule { + attribute DOMString encoding; + // raises(dom::DOMException) on setting + + }; + + // Introduced in DOM Level 2: + interface CSSUnknownRule : CSSRule { + }; + + // Introduced in DOM Level 2: + interface CSSStyleDeclaration { + attribute DOMString cssText; + // raises(dom::DOMException) on setting + + DOMString getPropertyValue(in DOMString propertyName); + CSSValue getPropertyCSSValue(in DOMString propertyName); + DOMString removeProperty(in DOMString propertyName) + raises(dom::DOMException); + DOMString getPropertyPriority(in DOMString propertyName); + void setProperty(in DOMString propertyName, + in DOMString value, + in DOMString priority) + raises(dom::DOMException); + readonly attribute unsigned long length; + DOMString item(in unsigned long index); + readonly attribute CSSRule parentRule; + }; + + // Introduced in DOM Level 2: + interface CSSValue { + + // UnitTypes + const unsigned short CSS_INHERIT = 0; + const unsigned short CSS_PRIMITIVE_VALUE = 1; + const unsigned short CSS_VALUE_LIST = 2; + const unsigned short CSS_CUSTOM = 3; + + attribute DOMString cssText; + // raises(dom::DOMException) on setting + + readonly attribute unsigned short cssValueType; + }; + + // Introduced in DOM Level 2: + interface CSSPrimitiveValue : CSSValue { + + // UnitTypes + const unsigned short CSS_UNKNOWN = 0; + const unsigned short CSS_NUMBER = 1; + const unsigned short CSS_PERCENTAGE = 2; + const unsigned short CSS_EMS = 3; + const unsigned short CSS_EXS = 4; + const unsigned short CSS_PX = 5; + const unsigned short CSS_CM = 6; + const unsigned short CSS_MM = 7; + const unsigned short CSS_IN = 8; + const unsigned short CSS_PT = 9; + const unsigned short CSS_PC = 10; + const unsigned short CSS_DEG = 11; + const unsigned short CSS_RAD = 12; + const unsigned short CSS_GRAD = 13; + const unsigned short CSS_MS = 14; + const unsigned short CSS_S = 15; + const unsigned short CSS_HZ = 16; + const unsigned short CSS_KHZ = 17; + const unsigned short CSS_DIMENSION = 18; + const unsigned short CSS_STRING = 19; + const unsigned short CSS_URI = 20; + const unsigned short CSS_IDENT = 21; + const unsigned short CSS_ATTR = 22; + const unsigned short CSS_COUNTER = 23; + const unsigned short CSS_RECT = 24; + const unsigned short CSS_RGBCOLOR = 25; + + readonly attribute unsigned short primitiveType; + + void setFloatValue(in unsigned short unitType, + in float floatValue) + raises(dom::DOMException); + float getFloatValue(in unsigned short unitType) + raises(dom::DOMException); + + void setStringValue(in unsigned short stringType, + in DOMString stringValue) + raises(dom::DOMException); + DOMString getStringValue() + raises(dom::DOMException); + Counter getCounterValue() + raises(dom::DOMException); + Rect getRectValue() + raises(dom::DOMException); + RGBColor getRGBColorValue() + raises(dom::DOMException); + }; + + // Introduced in DOM Level 2: + interface CSSValueList : CSSValue { + readonly attribute unsigned long length; + CSSValue item(in unsigned long index); + }; + + // Introduced in DOM Level 2: + interface RGBColor { + readonly attribute CSSPrimitiveValue red; + readonly attribute CSSPrimitiveValue green; + readonly attribute CSSPrimitiveValue blue; + }; + + // Introduced in DOM Level 2: + interface Rect { + readonly attribute CSSPrimitiveValue top; + readonly attribute CSSPrimitiveValue right; + readonly attribute CSSPrimitiveValue bottom; + readonly attribute CSSPrimitiveValue left; + }; + + // Introduced in DOM Level 2: + interface Counter { + readonly attribute DOMString identifier; + readonly attribute DOMString listStyle; + readonly attribute DOMString separator; + }; + + // Introduced in DOM Level 2: + interface ElementCSSInlineStyle { + readonly attribute CSSStyleDeclaration style; + }; + + // Introduced in DOM Level 2: + interface CSS2Properties { + attribute DOMString azimuth; + // raises(dom::DOMException) on setting + + attribute DOMString background; + // raises(dom::DOMException) on setting + + attribute DOMString backgroundAttachment; + // raises(dom::DOMException) on setting + + attribute DOMString backgroundColor; + // raises(dom::DOMException) on setting + + attribute DOMString backgroundImage; + // raises(dom::DOMException) on setting + + attribute DOMString backgroundPosition; + // raises(dom::DOMException) on setting + + attribute DOMString backgroundRepeat; + // raises(dom::DOMException) on setting + + attribute DOMString border; + // raises(dom::DOMException) on setting + + attribute DOMString borderCollapse; + // raises(dom::DOMException) on setting + + attribute DOMString borderColor; + // raises(dom::DOMException) on setting + + attribute DOMString borderSpacing; + // raises(dom::DOMException) on setting + + attribute DOMString borderStyle; + // raises(dom::DOMException) on setting + + attribute DOMString borderTop; + // raises(dom::DOMException) on setting + + attribute DOMString borderRight; + // raises(dom::DOMException) on setting + + attribute DOMString borderBottom; + // raises(dom::DOMException) on setting + + attribute DOMString borderLeft; + // raises(dom::DOMException) on setting + + attribute DOMString borderTopColor; + // raises(dom::DOMException) on setting + + attribute DOMString borderRightColor; + // raises(dom::DOMException) on setting + + attribute DOMString borderBottomColor; + // raises(dom::DOMException) on setting + + attribute DOMString borderLeftColor; + // raises(dom::DOMException) on setting + + attribute DOMString borderTopStyle; + // raises(dom::DOMException) on setting + + attribute DOMString borderRightStyle; + // raises(dom::DOMException) on setting + + attribute DOMString borderBottomStyle; + // raises(dom::DOMException) on setting + + attribute DOMString borderLeftStyle; + // raises(dom::DOMException) on setting + + attribute DOMString borderTopWidth; + // raises(dom::DOMException) on setting + + attribute DOMString borderRightWidth; + // raises(dom::DOMException) on setting + + attribute DOMString borderBottomWidth; + // raises(dom::DOMException) on setting + + attribute DOMString borderLeftWidth; + // raises(dom::DOMException) on setting + + attribute DOMString borderWidth; + // raises(dom::DOMException) on setting + + attribute DOMString bottom; + // raises(dom::DOMException) on setting + + attribute DOMString captionSide; + // raises(dom::DOMException) on setting + + attribute DOMString clear; + // raises(dom::DOMException) on setting + + attribute DOMString clip; + // raises(dom::DOMException) on setting + + attribute DOMString color; + // raises(dom::DOMException) on setting + + attribute DOMString content; + // raises(dom::DOMException) on setting + + attribute DOMString counterIncrement; + // raises(dom::DOMException) on setting + + attribute DOMString counterReset; + // raises(dom::DOMException) on setting + + attribute DOMString cue; + // raises(dom::DOMException) on setting + + attribute DOMString cueAfter; + // raises(dom::DOMException) on setting + + attribute DOMString cueBefore; + // raises(dom::DOMException) on setting + + attribute DOMString cursor; + // raises(dom::DOMException) on setting + + attribute DOMString direction; + // raises(dom::DOMException) on setting + + attribute DOMString display; + // raises(dom::DOMException) on setting + + attribute DOMString elevation; + // raises(dom::DOMException) on setting + + attribute DOMString emptyCells; + // raises(dom::DOMException) on setting + + attribute DOMString cssFloat; + // raises(dom::DOMException) on setting + + attribute DOMString font; + // raises(dom::DOMException) on setting + + attribute DOMString fontFamily; + // raises(dom::DOMException) on setting + + attribute DOMString fontSize; + // raises(dom::DOMException) on setting + + attribute DOMString fontSizeAdjust; + // raises(dom::DOMException) on setting + + attribute DOMString fontStretch; + // raises(dom::DOMException) on setting + + attribute DOMString fontStyle; + // raises(dom::DOMException) on setting + + attribute DOMString fontVariant; + // raises(dom::DOMException) on setting + + attribute DOMString fontWeight; + // raises(dom::DOMException) on setting + + attribute DOMString height; + // raises(dom::DOMException) on setting + + attribute DOMString left; + // raises(dom::DOMException) on setting + + attribute DOMString letterSpacing; + // raises(dom::DOMException) on setting + + attribute DOMString lineHeight; + // raises(dom::DOMException) on setting + + attribute DOMString listStyle; + // raises(dom::DOMException) on setting + + attribute DOMString listStyleImage; + // raises(dom::DOMException) on setting + + attribute DOMString listStylePosition; + // raises(dom::DOMException) on setting + + attribute DOMString listStyleType; + // raises(dom::DOMException) on setting + + attribute DOMString margin; + // raises(dom::DOMException) on setting + + attribute DOMString marginTop; + // raises(dom::DOMException) on setting + + attribute DOMString marginRight; + // raises(dom::DOMException) on setting + + attribute DOMString marginBottom; + // raises(dom::DOMException) on setting + + attribute DOMString marginLeft; + // raises(dom::DOMException) on setting + + attribute DOMString markerOffset; + // raises(dom::DOMException) on setting + + attribute DOMString marks; + // raises(dom::DOMException) on setting + + attribute DOMString maxHeight; + // raises(dom::DOMException) on setting + + attribute DOMString maxWidth; + // raises(dom::DOMException) on setting + + attribute DOMString minHeight; + // raises(dom::DOMException) on setting + + attribute DOMString minWidth; + // raises(dom::DOMException) on setting + + attribute DOMString orphans; + // raises(dom::DOMException) on setting + + attribute DOMString outline; + // raises(dom::DOMException) on setting + + attribute DOMString outlineColor; + // raises(dom::DOMException) on setting + + attribute DOMString outlineStyle; + // raises(dom::DOMException) on setting + + attribute DOMString outlineWidth; + // raises(dom::DOMException) on setting + + attribute DOMString overflow; + // raises(dom::DOMException) on setting + + attribute DOMString padding; + // raises(dom::DOMException) on setting + + attribute DOMString paddingTop; + // raises(dom::DOMException) on setting + + attribute DOMString paddingRight; + // raises(dom::DOMException) on setting + + attribute DOMString paddingBottom; + // raises(dom::DOMException) on setting + + attribute DOMString paddingLeft; + // raises(dom::DOMException) on setting + + attribute DOMString page; + // raises(dom::DOMException) on setting + + attribute DOMString pageBreakAfter; + // raises(dom::DOMException) on setting + + attribute DOMString pageBreakBefore; + // raises(dom::DOMException) on setting + + attribute DOMString pageBreakInside; + // raises(dom::DOMException) on setting + + attribute DOMString pause; + // raises(dom::DOMException) on setting + + attribute DOMString pauseAfter; + // raises(dom::DOMException) on setting + + attribute DOMString pauseBefore; + // raises(dom::DOMException) on setting + + attribute DOMString pitch; + // raises(dom::DOMException) on setting + + attribute DOMString pitchRange; + // raises(dom::DOMException) on setting + + attribute DOMString playDuring; + // raises(dom::DOMException) on setting + + attribute DOMString position; + // raises(dom::DOMException) on setting + + attribute DOMString quotes; + // raises(dom::DOMException) on setting + + attribute DOMString richness; + // raises(dom::DOMException) on setting + + attribute DOMString right; + // raises(dom::DOMException) on setting + + attribute DOMString size; + // raises(dom::DOMException) on setting + + attribute DOMString speak; + // raises(dom::DOMException) on setting + + attribute DOMString speakHeader; + // raises(dom::DOMException) on setting + + attribute DOMString speakNumeral; + // raises(dom::DOMException) on setting + + attribute DOMString speakPunctuation; + // raises(dom::DOMException) on setting + + attribute DOMString speechRate; + // raises(dom::DOMException) on setting + + attribute DOMString stress; + // raises(dom::DOMException) on setting + + attribute DOMString tableLayout; + // raises(dom::DOMException) on setting + + attribute DOMString textAlign; + // raises(dom::DOMException) on setting + + attribute DOMString textDecoration; + // raises(dom::DOMException) on setting + + attribute DOMString textIndent; + // raises(dom::DOMException) on setting + + attribute DOMString textShadow; + // raises(dom::DOMException) on setting + + attribute DOMString textTransform; + // raises(dom::DOMException) on setting + + attribute DOMString top; + // raises(dom::DOMException) on setting + + attribute DOMString unicodeBidi; + // raises(dom::DOMException) on setting + + attribute DOMString verticalAlign; + // raises(dom::DOMException) on setting + + attribute DOMString visibility; + // raises(dom::DOMException) on setting + + attribute DOMString voiceFamily; + // raises(dom::DOMException) on setting + + attribute DOMString volume; + // raises(dom::DOMException) on setting + + attribute DOMString whiteSpace; + // raises(dom::DOMException) on setting + + attribute DOMString widows; + // raises(dom::DOMException) on setting + + attribute DOMString width; + // raises(dom::DOMException) on setting + + attribute DOMString wordSpacing; + // raises(dom::DOMException) on setting + + attribute DOMString zIndex; + // raises(dom::DOMException) on setting + + }; + + // Introduced in DOM Level 2: + interface CSSStyleSheet : StyleSheet { + readonly attribute CSSRule ownerRule; + readonly attribute CSSRuleList cssRules; + unsigned long insertRule(in DOMString rule, + in unsigned long index) + raises(dom::DOMException); + void deleteRule(in unsigned long index) + raises(dom::DOMException); + }; + + // Introduced in DOM Level 2: + interface ViewCSS : AbstractView { + CSSStyleDeclaration getComputedStyle(in Element elt, + in DOMString pseudoElt); + }; + + // Introduced in DOM Level 2: + interface DocumentCSS : DocumentStyle { + CSSStyleDeclaration getOverrideStyle(in Element elt, + in DOMString pseudoElt); + }; + + // Introduced in DOM Level 2: + interface DOMImplementationCSS : DOMImplementation { + CSSStyleSheet createCSSStyleSheet(in DOMString title, + in DOMString media) + raises(dom::DOMException); + }; +}; + +#endif // _CSS_IDL_ + addfile ./domconv/W3C/DOM2/idl/dom.idl hunk ./domconv/W3C/DOM2/idl/dom.idl 1 +/* + * Copyright (c) 2000 World Wide Web Consortium, + * (Massachusetts Institute of Technology, Institut National de + * Recherche en Informatique et en Automatique, Keio University). All + * Rights Reserved. This program is distributed under the W3C's Software + * Intellectual Property License. This program is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. + * See W3C License http://www.w3.org/Consortium/Legal/ for more details. + */ + +// File: http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/dom.idl + +#ifndef _DOM_IDL_ +#define _DOM_IDL_ + +#pragma prefix "w3c.org" +module dom +{ + + // valuetype DOMString sequence; + typedef sequence DOMString; + + typedef unsigned long DOMTimeStamp; + + interface DocumentType; + interface Document; + interface NodeList; + interface NamedNodeMap; + interface Element; + + exception DOMException { + unsigned short code; + }; + // ExceptionCode + const unsigned short INDEX_SIZE_ERR = 1; + const unsigned short DOMSTRING_SIZE_ERR = 2; + const unsigned short HIERARCHY_REQUEST_ERR = 3; + const unsigned short WRONG_DOCUMENT_ERR = 4; + const unsigned short INVALID_CHARACTER_ERR = 5; + const unsigned short NO_DATA_ALLOWED_ERR = 6; + const unsigned short NO_MODIFICATION_ALLOWED_ERR = 7; + const unsigned short NOT_FOUND_ERR = 8; + const unsigned short NOT_SUPPORTED_ERR = 9; + const unsigned short INUSE_ATTRIBUTE_ERR = 10; + // Introduced in DOM Level 2: + const unsigned short INVALID_STATE_ERR = 11; + // Introduced in DOM Level 2: + const unsigned short SYNTAX_ERR = 12; + // Introduced in DOM Level 2: + const unsigned short INVALID_MODIFICATION_ERR = 13; + // Introduced in DOM Level 2: + const unsigned short NAMESPACE_ERR = 14; + // Introduced in DOM Level 2: + const unsigned short INVALID_ACCESS_ERR = 15; + + + interface DOMImplementation { + boolean hasFeature(in DOMString feature, + in DOMString version); + // Introduced in DOM Level 2: + DocumentType createDocumentType(in DOMString qualifiedName, + in DOMString publicId, + in DOMString systemId) + raises(DOMException); + // Introduced in DOM Level 2: + Document createDocument(in DOMString namespaceURI, + in DOMString qualifiedName, + in DocumentType doctype) + raises(DOMException); + }; + + interface Node { + + // NodeType + const unsigned short ELEMENT_NODE = 1; + const unsigned short ATTRIBUTE_NODE = 2; + const unsigned short TEXT_NODE = 3; + const unsigned short CDATA_SECTION_NODE = 4; + const unsigned short ENTITY_REFERENCE_NODE = 5; + const unsigned short ENTITY_NODE = 6; + const unsigned short PROCESSING_INSTRUCTION_NODE = 7; + const unsigned short COMMENT_NODE = 8; + const unsigned short DOCUMENT_NODE = 9; + const unsigned short DOCUMENT_TYPE_NODE = 10; + const unsigned short DOCUMENT_FRAGMENT_NODE = 11; + const unsigned short NOTATION_NODE = 12; + + readonly attribute DOMString nodeName; + attribute DOMString nodeValue; + // raises(DOMException) on setting + // raises(DOMException) on retrieval + + readonly attribute unsigned short nodeType; + readonly attribute Node parentNode; + readonly attribute NodeList childNodes; + readonly attribute Node firstChild; + readonly attribute Node lastChild; + readonly attribute Node previousSibling; + readonly attribute Node nextSibling; + readonly attribute NamedNodeMap attributes; + // Modified in DOM Level 2: + readonly attribute Document ownerDocument; + Node insertBefore(in Node newChild, + in Node refChild) + raises(DOMException); + Node replaceChild(in Node newChild, + in Node oldChild) + raises(DOMException); + Node removeChild(in Node oldChild) + raises(DOMException); + Node appendChild(in Node newChild) + raises(DOMException); + boolean hasChildNodes(); + Node cloneNode(in boolean deep); + // Modified in DOM Level 2: + void normalize(); + // Introduced in DOM Level 2: + boolean isSupported(in DOMString feature, + in DOMString version); + // Introduced in DOM Level 2: + readonly attribute DOMString namespaceURI; + // Introduced in DOM Level 2: + attribute DOMString prefix; + // raises(DOMException) on setting + + // Introduced in DOM Level 2: + readonly attribute DOMString localName; + // Introduced in DOM Level 2: + boolean hasAttributes(); + }; + + interface NodeList { + Node item(in unsigned long index); + readonly attribute unsigned long length; + }; + + interface NamedNodeMap { + Node getNamedItem(in DOMString name); + Node setNamedItem(in Node arg) + raises(DOMException); + Node removeNamedItem(in DOMString name) + raises(DOMException); + Node item(in unsigned long index); + readonly attribute unsigned long length; + // Introduced in DOM Level 2: + Node getNamedItemNS(in DOMString namespaceURI, + in DOMString localName); + // Introduced in DOM Level 2: + Node setNamedItemNS(in Node arg) + raises(DOMException); + // Introduced in DOM Level 2: + Node removeNamedItemNS(in DOMString namespaceURI, + in DOMString localName) + raises(DOMException); + }; + + interface CharacterData : Node { + attribute DOMString data; + // raises(DOMException) on setting + // raises(DOMException) on retrieval + + readonly attribute unsigned long length; + DOMString substringData(in unsigned long offset, + in unsigned long count) + raises(DOMException); + void appendData(in DOMString arg) + raises(DOMException); + void insertData(in unsigned long offset, + in DOMString arg) + raises(DOMException); + void deleteData(in unsigned long offset, + in unsigned long count) + raises(DOMException); + void replaceData(in unsigned long offset, + in unsigned long count, + in DOMString arg) + raises(DOMException); + }; + + interface Attr : Node { + readonly attribute DOMString name; + readonly attribute boolean specified; + attribute DOMString value; + // raises(DOMException) on setting + + // Introduced in DOM Level 2: + readonly attribute Element ownerElement; + }; + + interface Element : Node { + readonly attribute DOMString tagName; + DOMString getAttribute(in DOMString name); + void setAttribute(in DOMString name, + in DOMString value) + raises(DOMException); + void removeAttribute(in DOMString name) + raises(DOMException); + Attr getAttributeNode(in DOMString name); + Attr setAttributeNode(in Attr newAttr) + raises(DOMException); + Attr removeAttributeNode(in Attr oldAttr) + raises(DOMException); + NodeList getElementsByTagName(in DOMString name); + // Introduced in DOM Level 2: + DOMString getAttributeNS(in DOMString namespaceURI, + in DOMString localName); + // Introduced in DOM Level 2: + void setAttributeNS(in DOMString namespaceURI, + in DOMString qualifiedName, + in DOMString value) + raises(DOMException); + // Introduced in DOM Level 2: + void removeAttributeNS(in DOMString namespaceURI, + in DOMString localName) + raises(DOMException); + // Introduced in DOM Level 2: + Attr getAttributeNodeNS(in DOMString namespaceURI, + in DOMString localName); + // Introduced in DOM Level 2: + Attr setAttributeNodeNS(in Attr newAttr) + raises(DOMException); + // Introduced in DOM Level 2: + NodeList getElementsByTagNameNS(in DOMString namespaceURI, + in DOMString localName); + // Introduced in DOM Level 2: + boolean hasAttribute(in DOMString name); + // Introduced in DOM Level 2: + boolean hasAttributeNS(in DOMString namespaceURI, + in DOMString localName); + }; + + interface Text : CharacterData { + Text splitText(in unsigned long offset) + raises(DOMException); + }; + + interface Comment : CharacterData { + }; + + interface CDATASection : Text { + }; + + interface DocumentType : Node { + readonly attribute DOMString name; + readonly attribute NamedNodeMap entities; + readonly attribute NamedNodeMap notations; + // Introduced in DOM Level 2: + readonly attribute DOMString publicId; + // Introduced in DOM Level 2: + readonly attribute DOMString systemId; + // Introduced in DOM Level 2: + readonly attribute DOMString internalSubset; + }; + + interface Notation : Node { + readonly attribute DOMString publicId; + readonly attribute DOMString systemId; + }; + + interface Entity : Node { + readonly attribute DOMString publicId; + readonly attribute DOMString systemId; + readonly attribute DOMString notationName; + }; + + interface EntityReference : Node { + }; + + interface ProcessingInstruction : Node { + readonly attribute DOMString target; + attribute DOMString data; + // raises(DOMException) on setting + + }; + + interface DocumentFragment : Node { + }; + + interface Document : Node { + readonly attribute DocumentType doctype; + readonly attribute DOMImplementation implementation; + readonly attribute Element documentElement; + Element createElement(in DOMString tagName) + raises(DOMException); + DocumentFragment createDocumentFragment(); + Text createTextNode(in DOMString data); + Comment createComment(in DOMString data); + CDATASection createCDATASection(in DOMString data) + raises(DOMException); + ProcessingInstruction createProcessingInstruction(in DOMString target, + in DOMString data) + raises(DOMException); + Attr createAttribute(in DOMString name) + raises(DOMException); + EntityReference createEntityReference(in DOMString name) + raises(DOMException); + NodeList getElementsByTagName(in DOMString tagname); + // Introduced in DOM Level 2: + Node importNode(in Node importedNode, + in boolean deep) + raises(DOMException); + // Introduced in DOM Level 2: + Element createElementNS(in DOMString namespaceURI, + in DOMString qualifiedName) + raises(DOMException); + // Introduced in DOM Level 2: + Attr createAttributeNS(in DOMString namespaceURI, + in DOMString qualifiedName) + raises(DOMException); + // Introduced in DOM Level 2: + NodeList getElementsByTagNameNS(in DOMString namespaceURI, + in DOMString localName); + // Introduced in DOM Level 2: + Element getElementById(in DOMString elementId); + }; +}; + +#endif // _DOM_IDL_ + addfile ./domconv/W3C/DOM2/idl/events.idl hunk ./domconv/W3C/DOM2/idl/events.idl 1 +/* + * Copyright (c) 2000 World Wide Web Consortium, + * (Massachusetts Institute of Technology, Institut National de + * Recherche en Informatique et en Automatique, Keio University). All + * Rights Reserved. This program is distributed under the W3C's Software + * Intellectual Property License. This program is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. + * See W3C License http://www.w3.org/Consortium/Legal/ for more details. + */ + +// File: http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.idl + +#ifndef _EVENTS_IDL_ +#define _EVENTS_IDL_ + +#include "dom.idl" +#include "views.idl" + +#pragma prefix "dom.w3c.org" +module events +{ + +// typedef dom::DOMString DOMString; +// typedef dom::DOMTimeStamp DOMTimeStamp; +// typedef sequence DOMString; +// typedef dom::Node Node; + + interface EventListener; + interface Event; + + // Introduced in DOM Level 2: + exception EventException { + unsigned short code; + }; + // EventExceptionCode + const unsigned short UNSPECIFIED_EVENT_TYPE_ERR = 0; + + + // Introduced in DOM Level 2: + interface EventTarget { + void addEventListener(in DOMString type, + in EventListener listener, + in boolean useCapture); + void removeEventListener(in DOMString type, + in EventListener listener, + in boolean useCapture); + boolean dispatchEvent(in Event evt) + raises(EventException); + }; + + // Introduced in DOM Level 2: + interface EventListener { + void handleEvent(in Event evt); + }; + + // Introduced in DOM Level 2: + interface Event { + + // PhaseType + const unsigned short CAPTURING_PHASE = 1; + const unsigned short AT_TARGET = 2; + const unsigned short BUBBLING_PHASE = 3; + + readonly attribute DOMString type; + readonly attribute EventTarget target; + readonly attribute EventTarget currentTarget; + readonly attribute unsigned short eventPhase; + readonly attribute boolean bubbles; + readonly attribute boolean cancelable; + readonly attribute unsigned long timeStamp; + void stopPropagation(); + void preventDefault(); + void initEvent(in DOMString eventTypeArg, + in boolean canBubbleArg, + in boolean cancelableArg); + }; + + // Introduced in DOM Level 2: + interface DocumentEvent { + Event createEvent(in DOMString eventType) + raises(dom::DOMException); + }; + + // Introduced in DOM Level 2: + interface UIEvent : Event { + readonly attribute AbstractView view; + readonly attribute long detail; + void initUIEvent(in DOMString typeArg, + in boolean canBubbleArg, + in boolean cancelableArg, + in AbstractView viewArg, + in long detailArg); + }; + + // Introduced in DOM Level 2: + interface MouseEvent : UIEvent { + readonly attribute long screenX; + readonly attribute long screenY; + readonly attribute long clientX; + readonly attribute long clientY; + readonly attribute boolean ctrlKey; + readonly attribute boolean shiftKey; + readonly attribute boolean altKey; + readonly attribute boolean metaKey; + readonly attribute unsigned short button; + readonly attribute EventTarget relatedTarget; + void initMouseEvent(in DOMString typeArg, + in boolean canBubbleArg, + in boolean cancelableArg, + in AbstractView viewArg, + in long detailArg, + in long screenXArg, + in long screenYArg, + in long clientXArg, + in long clientYArg, + in boolean ctrlKeyArg, + in boolean altKeyArg, + in boolean shiftKeyArg, + in boolean metaKeyArg, + in unsigned short buttonArg, + in EventTarget relatedTargetArg); + }; + + // Introduced in DOM Level 2: + interface MutationEvent : Event { + + // attrChangeType + const unsigned short MODIFICATION = 1; + const unsigned short ADDITION = 2; + const unsigned short REMOVAL = 3; + + readonly attribute Node relatedNode; + readonly attribute DOMString prevValue; + readonly attribute DOMString newValue; + readonly attribute DOMString attrName; + readonly attribute unsigned short attrChange; + void initMutationEvent(in DOMString typeArg, + in boolean canBubbleArg, + in boolean cancelableArg, + in Node relatedNodeArg, + in DOMString prevValueArg, + in DOMString newValueArg, + in DOMString attrNameArg, + in unsigned short attrChangeArg); + }; + + // Introduced in DOM Level 3 and manually moved here (ex. NS version): + interface KeyboardEvent : UIEvent { + + // KeyLocationCode + const unsigned long DOM_KEY_LOCATION_STANDARD = 0x00; + const unsigned long DOM_KEY_LOCATION_LEFT = 0x01; + const unsigned long DOM_KEY_LOCATION_RIGHT = 0x02; + const unsigned long DOM_KEY_LOCATION_NUMPAD = 0x03; + + readonly attribute DOMString keyIdentifier; + readonly attribute unsigned long keyLocation; + readonly attribute boolean ctrlKey; + readonly attribute boolean shiftKey; + readonly attribute boolean altKey; + readonly attribute boolean metaKey; + boolean getModifierState(in DOMString keyIdentifierArg); + void initKeyboardEvent(in DOMString typeArg, + in boolean canBubbleArg, + in boolean cancelableArg, + in AbstractView viewArg, + in DOMString keyIdentifierArg, + in unsigned long keyLocationArg, + in DOMString modifiersList); + }; + + // Borrowed from the 19990923 version of DOM2 Event Specifications + +// Introduced in DOM Level 2: + +interface KeyEvent : UIEvent { + // VirtualKeyCode + const unsigned long CHAR_UNDEFINED = 0x0FFFF; + const unsigned long DOM_VK_0 = 0x30; + const unsigned long DOM_VK_1 = 0x31; + const unsigned long DOM_VK_2 = 0x32; + const unsigned long DOM_VK_3 = 0x33; + const unsigned long DOM_VK_4 = 0x34; + const unsigned long DOM_VK_5 = 0x35; + const unsigned long DOM_VK_6 = 0x36; + const unsigned long DOM_VK_7 = 0x37; + const unsigned long DOM_VK_8 = 0x38; + const unsigned long DOM_VK_9 = 0x39; + const unsigned long DOM_VK_A = 0x41; + const unsigned long DOM_VK_ACCEPT = 0x1E; + const unsigned long DOM_VK_ADD = 0x6B; + const unsigned long DOM_VK_AGAIN = 0xFFC9; + const unsigned long DOM_VK_ALL_CANDIDATES = 0x0100; + const unsigned long DOM_VK_ALPHANUMERIC = 0x00F0; + const unsigned long DOM_VK_ALT = 0x12; + const unsigned long DOM_VK_ALT_GRAPH = 0xFF7E; + const unsigned long DOM_VK_AMPERSAND = 0x96; + const unsigned long DOM_VK_ASTERISK = 0x97; + const unsigned long DOM_VK_AT = 0x0200; + const unsigned long DOM_VK_B = 0x42; + const unsigned long DOM_VK_BACK_QUOTE = 0xC0; + const unsigned long DOM_VK_BACK_SLASH = 0x5C; + const unsigned long DOM_VK_BACK_SPACE = 0x08; + const unsigned long DOM_VK_BRACELEFT = 0xA1; + const unsigned long DOM_VK_BRACERIGHT = 0xA2; + const unsigned long DOM_VK_C = 0x43; + const unsigned long DOM_VK_CANCEL = 0x03; + const unsigned long DOM_VK_CAPS_LOCK = 0x14; + const unsigned long DOM_VK_CIRCUMFLEX = 0x0202; + const unsigned long DOM_VK_CLEAR = 0x0C; + const unsigned long DOM_VK_CLOSE_BRACKET = 0x5D; + const unsigned long DOM_VK_CODE_INPUT = 0x0102; + const unsigned long DOM_VK_COLON = 0x0201; + const unsigned long DOM_VK_COMMA = 0x2C; + const unsigned long DOM_VK_COMPOSE = 0xFF20; + const unsigned long DOM_VK_CONTROL = 0x11; + const unsigned long DOM_VK_CONVERT = 0x1C; + const unsigned long DOM_VK_COPY = 0xFFCD; + const unsigned long DOM_VK_CUT = 0xFFD1; + const unsigned long DOM_VK_D = 0x44; + const unsigned long DOM_VK_DEAD_ABOVEDOT = 0x86; + const unsigned long DOM_VK_DEAD_ABOVERING = 0x88; + const unsigned long DOM_VK_DEAD_ACUTE = 0x81; + const unsigned long DOM_VK_DEAD_BREVE = 0x85; + const unsigned long DOM_VK_DEAD_CARON = 0x8A; + const unsigned long DOM_VK_DEAD_CEDILLA = 0x8B; + const unsigned long DOM_VK_DEAD_CIRCUMFLEX = 0x82; + const unsigned long DOM_VK_DEAD_DIAERESIS = 0x87; + const unsigned long DOM_VK_DEAD_DOUBLEACUTE = 0x89; + const unsigned long DOM_VK_DEAD_GRAVE = 0x80; + const unsigned long DOM_VK_DEAD_IOTA = 0x8D; + const unsigned long DOM_VK_DEAD_MACRON = 0x84; + const unsigned long DOM_VK_DEAD_OGONEK = 0x8C; + const unsigned long DOM_VK_DEAD_SEMIVOICED_SOUND = 0x8F; + const unsigned long DOM_VK_DEAD_TILDE = 0x83; + const unsigned long DOM_VK_DEAD_VOICED_SOUND = 0x8E; + const unsigned long DOM_VK_DECIMAL = 0x6E; + const unsigned long DOM_VK_DELETE = 0x7F; + const unsigned long DOM_VK_DIVIDE = 0x6F; + const unsigned long DOM_VK_DOLLAR = 0x0203; + const unsigned long DOM_VK_DOWN = 0x28; + const unsigned long DOM_VK_E = 0x45; + const unsigned long DOM_VK_END = 0x23; + const unsigned long DOM_VK_ENTER = 0x0D; + const unsigned long DOM_VK_EQUALS = 0x3D; + const unsigned long DOM_VK_ESCAPE = 0x1B; + const unsigned long DOM_VK_EURO_SIGN = 0x0204; + const unsigned long DOM_VK_EXCLAMATION_MARK = 0x0205; + const unsigned long DOM_VK_F = 0x46; + const unsigned long DOM_VK_F1 = 0x70; + const unsigned long DOM_VK_F10 = 0x79; + const unsigned long DOM_VK_F11 = 0x7A; + const unsigned long DOM_VK_F12 = 0x7B; + const unsigned long DOM_VK_F13 = 0xF000; + const unsigned long DOM_VK_F14 = 0xF001; + const unsigned long DOM_VK_F15 = 0xF002; + const unsigned long DOM_VK_F16 = 0xF003; + const unsigned long DOM_VK_F17 = 0xF004; + const unsigned long DOM_VK_F18 = 0xF005; + const unsigned long DOM_VK_F19 = 0xF006; + const unsigned long DOM_VK_F2 = 0x71; + const unsigned long DOM_VK_F20 = 0xF007; + const unsigned long DOM_VK_F21 = 0xF008; + const unsigned long DOM_VK_F22 = 0xF009; + const unsigned long DOM_VK_F23 = 0xF00A; + const unsigned long DOM_VK_F24 = 0xF00B; + const unsigned long DOM_VK_F3 = 0x72; + const unsigned long DOM_VK_F4 = 0x73; + const unsigned long DOM_VK_F5 = 0x74; + const unsigned long DOM_VK_F6 = 0x75; + const unsigned long DOM_VK_F7 = 0x76; + const unsigned long DOM_VK_F8 = 0x77; + const unsigned long DOM_VK_F9 = 0x78; + const unsigned long DOM_VK_FINAL = 0x18; + const unsigned long DOM_VK_FIND = 0xFFD0; + const unsigned long DOM_VK_FULL_WIDTH = 0x00F3; + const unsigned long DOM_VK_G = 0x47; + const unsigned long DOM_VK_GREATER = 0xA0; + const unsigned long DOM_VK_H = 0x48; + const unsigned long DOM_VK_HALF_WIDTH = 0x00F4; + const unsigned long DOM_VK_HELP = 0x9C; + const unsigned long DOM_VK_HIRAGANA = 0x00F2; + const unsigned long DOM_VK_HOME = 0x24; + const unsigned long DOM_VK_I = 0x49; + const unsigned long DOM_VK_INSERT = 0x9B; + const unsigned long DOM_VK_INVERTED_EXCLAMATION_MARK = 0x0206; + const unsigned long DOM_VK_J = 0x4A; + const unsigned long DOM_VK_JAPANESE_HIRAGANA = 0x0104; + const unsigned long DOM_VK_JAPANESE_KATAKANA = 0x0103; + const unsigned long DOM_VK_JAPANESE_ROMAN = 0x0105; + const unsigned long DOM_VK_K = 0x4B; + const unsigned long DOM_VK_KANA = 0x15; + const unsigned long DOM_VK_KANJI = 0x19; + const unsigned long DOM_VK_KATAKANA = 0x00F1; + const unsigned long DOM_VK_KP_DOWN = 0xE1; + const unsigned long DOM_VK_KP_LEFT = 0xE2; + const unsigned long DOM_VK_KP_RIGHT = 0xE3; + const unsigned long DOM_VK_KP_UP = 0xE0; + const unsigned long DOM_VK_L = 0x4C; + const unsigned long DOM_VK_LEFT = 0x25; + const unsigned long DOM_VK_LEFT_PARENTHESIS = 0x0207; + const unsigned long DOM_VK_LESS = 0x99; + const unsigned long DOM_VK_M = 0x4D; + const unsigned long DOM_VK_META = 0x9D; + const unsigned long DOM_VK_MINUS = 0x2D; + const unsigned long DOM_VK_MODECHANGE = 0x1F; + const unsigned long DOM_VK_MULTIPLY = 0x6A; + const unsigned long DOM_VK_N = 0x4E; + const unsigned long DOM_VK_NONCONVERT = 0x1D; + const unsigned long DOM_VK_NUM_LOCK = 0x90; + const unsigned long DOM_VK_NUMBER_SIGN = 0x0208; + const unsigned long DOM_VK_NUMPAD0 = 0x60; + const unsigned long DOM_VK_NUMPAD1 = 0x61; + const unsigned long DOM_VK_NUMPAD2 = 0x62; + const unsigned long DOM_VK_NUMPAD3 = 0x63; + const unsigned long DOM_VK_NUMPAD4 = 0x64; + const unsigned long DOM_VK_NUMPAD5 = 0x65; + const unsigned long DOM_VK_NUMPAD6 = 0x66; + const unsigned long DOM_VK_NUMPAD7 = 0x67; + const unsigned long DOM_VK_NUMPAD8 = 0x68; + const unsigned long DOM_VK_NUMPAD9 = 0x69; + const unsigned long DOM_VK_O = 0x4F; + const unsigned long DOM_VK_OPEN_BRACKET = 0x5B; + const unsigned long DOM_VK_P = 0x50; + const unsigned long DOM_VK_PAGE_DOWN = 0x22; + const unsigned long DOM_VK_PAGE_UP = 0x21; + const unsigned long DOM_VK_PASTE = 0xFFCF; + const unsigned long DOM_VK_PAUSE = 0x13; + const unsigned long DOM_VK_PERIOD = 0x2E; + const unsigned long DOM_VK_PLUS = 0x0209; + const unsigned long DOM_VK_PREVIOUS_CANDIDATE = 0x0101; + const unsigned long DOM_VK_PRINTSCREEN = 0x9A; + const unsigned long DOM_VK_PROPS = 0xFFCA; + const unsigned long DOM_VK_Q = 0x51; + const unsigned long DOM_VK_QUOTE = 0xDE; + const unsigned long DOM_VK_QUOTEDBL = 0x98; + const unsigned long DOM_VK_R = 0x52; + const unsigned long DOM_VK_RIGHT = 0x27; + const unsigned long DOM_VK_RIGHT_PARENTHESIS = 0x020A; + const unsigned long DOM_VK_ROMAN_CHARACTERS = 0x00F5; + const unsigned long DOM_VK_S = 0x53; + const unsigned long DOM_VK_SCROLL_LOCK = 0x91; + const unsigned long DOM_VK_SEMICOLON = 0x3B; + const unsigned long DOM_VK_SEPARATER = 0x6C; + const unsigned long DOM_VK_SHIFT = 0x10; + const unsigned long DOM_VK_SLASH = 0x2F; + const unsigned long DOM_VK_SPACE = 0x20; + const unsigned long DOM_VK_STOP = 0xFFC8; + const unsigned long DOM_VK_SUBTRACT = 0x6D; + const unsigned long DOM_VK_T = 0x54; + const unsigned long DOM_VK_TAB = 0x09; + const unsigned long DOM_VK_U = 0x55; + const unsigned long DOM_VK_UNDEFINED = 0x0; + const unsigned long DOM_VK_UNDERSCORE = 0x020B; + const unsigned long DOM_VK_UNDO = 0xFFCB; + const unsigned long DOM_VK_UP = 0x26; + const unsigned long DOM_VK_V = 0x56; + const unsigned long DOM_VK_W = 0x57; + const unsigned long DOM_VK_X = 0x58; + const unsigned long DOM_VK_Y = 0x59; + const unsigned long DOM_VK_Z = 0x5A; + + readonly attribute boolean ctrlKey; + readonly attribute boolean shiftKey; + readonly attribute boolean altKey; + readonly attribute boolean metaKey; + readonly attribute unsigned long keyCode; + readonly attribute unsigned long charCode; + void initKeyEvent(in DOMString typeArg, + in boolean canBubbleArg, + in boolean cancelableArg, + in boolean ctrlKeyArg, + in boolean altKeyArg, + in boolean shiftKeyArg, + in boolean metaKeyArg, + in unsigned long keyCodeArg, + in unsigned long charCodeArg, + in AbstractView viewArg); +}; + + +}; + +#endif // _EVENTS_IDL_ + addfile ./domconv/W3C/DOM2/idl/html2.idl hunk ./domconv/W3C/DOM2/idl/html2.idl 1 +/* + * Copyright (c) 2003 World Wide Web Consortium, + * (Massachusetts Institute of Technology, Institut National de + * Recherche en Informatique et en Automatique, Keio University). All + * Rights Reserved. This program is distributed under the W3C's Software + * Intellectual Property License. This program is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. + * See W3C License http://www.w3.org/Consortium/Legal/ for more details. + */ + +// File: http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html2.idl + +#ifndef _HTML2_IDL_ +#define _HTML2_IDL_ + +#include "dom.idl" + +#pragma prefix "dom.w3c.org" +module html2 +{ + + typedef dom::DOMString DOMString; + typedef dom::Node Node; + typedef dom::Document Document; + typedef dom::NodeList NodeList; + typedef dom::Element Element; + + interface HTMLElement; + interface HTMLFormElement; + interface HTMLTableCaptionElement; + interface HTMLTableSectionElement; + + interface HTMLCollection { + readonly attribute unsigned long length; + Node item(in unsigned long index); + Node namedItem(in DOMString name); + }; + + // Introduced in DOM Level 2: + interface HTMLOptionsCollection { + attribute unsigned long length; + // raises(dom::DOMException) on setting + + Node item(in unsigned long index); + Node namedItem(in DOMString name); + }; + + interface HTMLDocument : Document { + attribute DOMString title; + readonly attribute DOMString referrer; + readonly attribute DOMString domain; + readonly attribute DOMString URL; + attribute HTMLElement body; + readonly attribute HTMLCollection images; + readonly attribute HTMLCollection applets; + readonly attribute HTMLCollection links; + readonly attribute HTMLCollection forms; + readonly attribute HTMLCollection anchors; + attribute DOMString cookie; + // raises(dom::DOMException) on setting + + void open(); + void close(); + void write(in DOMString text); + void writeln(in DOMString text); + NodeList getElementsByName(in DOMString elementName); + }; + + interface HTMLElement : Element { + attribute DOMString id; + attribute DOMString title; + attribute DOMString lang; + attribute DOMString dir; + attribute DOMString className; + }; + + interface HTMLHtmlElement : HTMLElement { + attribute DOMString version; + }; + + interface HTMLHeadElement : HTMLElement { + attribute DOMString profile; + }; + + interface HTMLLinkElement : HTMLElement { + attribute boolean disabled; + attribute DOMString charset; + attribute DOMString href; + attribute DOMString hreflang; + attribute DOMString media; + attribute DOMString rel; + attribute DOMString rev; + attribute DOMString target; + attribute DOMString type; + }; + + interface HTMLTitleElement : HTMLElement { + attribute DOMString text; + }; + + interface HTMLMetaElement : HTMLElement { + attribute DOMString content; + attribute DOMString httpEquiv; + attribute DOMString name; + attribute DOMString scheme; + }; + + interface HTMLBaseElement : HTMLElement { + attribute DOMString href; + attribute DOMString target; + }; + + interface HTMLIsIndexElement : HTMLElement { + readonly attribute HTMLFormElement form; + attribute DOMString prompt; + }; + + interface HTMLStyleElement : HTMLElement { + attribute boolean disabled; + attribute DOMString media; + attribute DOMString type; + }; + + interface HTMLBodyElement : HTMLElement { + attribute DOMString aLink; + attribute DOMString background; + attribute DOMString bgColor; + attribute DOMString link; + attribute DOMString text; + attribute DOMString vLink; + }; + + interface HTMLFormElement : HTMLElement { + readonly attribute HTMLCollection elements; + readonly attribute long length; + attribute DOMString name; + attribute DOMString acceptCharset; + attribute DOMString action; + attribute DOMString enctype; + attribute DOMString method; + attribute DOMString target; + void submit(); + void reset(); + }; + + interface HTMLSelectElement : HTMLElement { + readonly attribute DOMString type; + attribute long selectedIndex; + attribute DOMString value; + // Modified in DOM Level 2: + attribute unsigned long length; + // raises(dom::DOMException) on setting + + readonly attribute HTMLFormElement form; + // Modified in DOM Level 2: + readonly attribute HTMLOptionsCollection options; + attribute boolean disabled; + attribute boolean multiple; + attribute DOMString name; + attribute long size; + attribute long tabIndex; + void add(in HTMLElement element, + in HTMLElement before) + raises(dom::DOMException); + void remove(in long index); + void blur(); + void focus(); + }; + + interface HTMLOptGroupElement : HTMLElement { + attribute boolean disabled; + attribute DOMString label; + }; + + interface HTMLOptionElement : HTMLElement { + readonly attribute HTMLFormElement form; + // Modified in DOM Level 2: + attribute boolean defaultSelected; + readonly attribute DOMString text; + // Modified in DOM Level 2: + readonly attribute long index; + attribute boolean disabled; + attribute DOMString label; + attribute boolean selected; + attribute DOMString value; + }; + + interface HTMLInputElement : HTMLElement { + attribute DOMString defaultValue; + attribute boolean defaultChecked; + readonly attribute HTMLFormElement form; + attribute DOMString accept; + attribute DOMString accessKey; + attribute DOMString align; + attribute DOMString alt; + attribute boolean checked; + attribute boolean disabled; + attribute long maxLength; + attribute DOMString name; + attribute boolean readOnly; + // Modified in DOM Level 2: + attribute unsigned long size; + attribute DOMString src; + attribute long tabIndex; + // Modified in DOM Level 2: + attribute DOMString type; + attribute DOMString useMap; + attribute DOMString value; + void blur(); + void focus(); + void select(); + void click(); + }; + + interface HTMLTextAreaElement : HTMLElement { + // Modified in DOM Level 2: + attribute DOMString defaultValue; + readonly attribute HTMLFormElement form; + attribute DOMString accessKey; + attribute long cols; + attribute boolean disabled; + attribute DOMString name; + attribute boolean readOnly; + attribute long rows; + attribute long tabIndex; + readonly attribute DOMString type; + attribute DOMString value; + void blur(); + void focus(); + void select(); + }; + + interface HTMLButtonElement : HTMLElement { + readonly attribute HTMLFormElement form; + attribute DOMString accessKey; + attribute boolean disabled; + attribute DOMString name; + attribute long tabIndex; + readonly attribute DOMString type; + attribute DOMString value; + }; + + interface HTMLLabelElement : HTMLElement { + readonly attribute HTMLFormElement form; + attribute DOMString accessKey; + attribute DOMString htmlFor; + }; + + interface HTMLFieldSetElement : HTMLElement { + readonly attribute HTMLFormElement form; + }; + + interface HTMLLegendElement : HTMLElement { + readonly attribute HTMLFormElement form; + attribute DOMString accessKey; + attribute DOMString align; + }; + + interface HTMLUListElement : HTMLElement { + attribute boolean compact; + attribute DOMString type; + }; + + interface HTMLOListElement : HTMLElement { + attribute boolean compact; + attribute long start; + attribute DOMString type; + }; + + interface HTMLDListElement : HTMLElement { + attribute boolean compact; + }; + + interface HTMLDirectoryElement : HTMLElement { + attribute boolean compact; + }; + + interface HTMLMenuElement : HTMLElement { + attribute boolean compact; + }; + + interface HTMLLIElement : HTMLElement { + attribute DOMString type; + attribute long value; + }; + + interface HTMLDivElement : HTMLElement { + attribute DOMString align; + }; + + interface HTMLParagraphElement : HTMLElement { + attribute DOMString align; + }; + + interface HTMLHeadingElement : HTMLElement { + attribute DOMString align; + }; + + interface HTMLQuoteElement : HTMLElement { + attribute DOMString cite; + }; + + interface HTMLPreElement : HTMLElement { + attribute long width; + }; + + interface HTMLBRElement : HTMLElement { + attribute DOMString clear; + }; + + interface HTMLBaseFontElement : HTMLElement { + attribute DOMString color; + attribute DOMString face; + // Modified in DOM Level 2: + attribute long size; + }; + + interface HTMLFontElement : HTMLElement { + attribute DOMString color; + attribute DOMString face; + attribute DOMString size; + }; + + interface HTMLHRElement : HTMLElement { + attribute DOMString align; + attribute boolean noShade; + attribute DOMString size; + attribute DOMString width; + }; + + interface HTMLModElement : HTMLElement { + attribute DOMString cite; + attribute DOMString dateTime; + }; + + interface HTMLAnchorElement : HTMLElement { + attribute DOMString accessKey; + attribute DOMString charset; + attribute DOMString coords; + attribute DOMString href; + attribute DOMString hreflang; + attribute DOMString name; + attribute DOMString rel; + attribute DOMString rev; + attribute DOMString shape; + attribute long tabIndex; + attribute DOMString target; + attribute DOMString type; + void blur(); + void focus(); + }; + + interface HTMLImageElement : HTMLElement { + attribute DOMString name; + attribute DOMString align; + attribute DOMString alt; + attribute DOMString border; + // Modified in DOM Level 2: + attribute long height; + // Modified in DOM Level 2: + attribute long hspace; + attribute boolean isMap; + attribute DOMString longDesc; + attribute DOMString src; + attribute DOMString useMap; + // Modified in DOM Level 2: + attribute long vspace; + // Modified in DOM Level 2: + attribute long width; + }; + + interface HTMLObjectElement : HTMLElement { + readonly attribute HTMLFormElement form; + attribute DOMString code; + attribute DOMString align; + attribute DOMString archive; + attribute DOMString border; + attribute DOMString codeBase; + attribute DOMString codeType; + attribute DOMString data; + attribute boolean declare; + attribute DOMString height; + attribute long hspace; + attribute DOMString name; + attribute DOMString standby; + attribute long tabIndex; + attribute DOMString type; + attribute DOMString useMap; + attribute long vspace; + attribute DOMString width; + // Introduced in DOM Level 2: + readonly attribute Document contentDocument; + }; + + interface HTMLParamElement : HTMLElement { + attribute DOMString name; + attribute DOMString type; + attribute DOMString value; + attribute DOMString valueType; + }; + + interface HTMLAppletElement : HTMLElement { + attribute DOMString align; + attribute DOMString alt; + attribute DOMString archive; + attribute DOMString code; + attribute DOMString codeBase; + attribute DOMString height; + // Modified in DOM Level 2: + attribute long hspace; + attribute DOMString name; + // Modified in DOM Level 2: + attribute DOMString object; + // Modified in DOM Level 2: + attribute long vspace; + attribute DOMString width; + }; + + interface HTMLMapElement : HTMLElement { + readonly attribute HTMLCollection areas; + attribute DOMString name; + }; + + interface HTMLAreaElement : HTMLElement { + attribute DOMString accessKey; + attribute DOMString alt; + attribute DOMString coords; + attribute DOMString href; + attribute boolean noHref; + attribute DOMString shape; + attribute long tabIndex; + attribute DOMString target; + }; + + interface HTMLScriptElement : HTMLElement { + attribute DOMString text; + attribute DOMString htmlFor; + attribute DOMString event; + attribute DOMString charset; + attribute boolean defer; + attribute DOMString src; + attribute DOMString type; + }; + + interface HTMLTableElement : HTMLElement { + // Modified in DOM Level 2: + attribute HTMLTableCaptionElement caption; + // raises(dom::DOMException) on setting + + // Modified in DOM Level 2: + attribute HTMLTableSectionElement tHead; + // raises(dom::DOMException) on setting + + // Modified in DOM Level 2: + attribute HTMLTableSectionElement tFoot; + // raises(dom::DOMException) on setting + + readonly attribute HTMLCollection rows; + readonly attribute HTMLCollection tBodies; + attribute DOMString align; + attribute DOMString bgColor; + attribute DOMString border; + attribute DOMString cellPadding; + attribute DOMString cellSpacing; + attribute DOMString frame; + attribute DOMString rules; + attribute DOMString summary; + attribute DOMString width; + HTMLElement createTHead(); + void deleteTHead(); + HTMLElement createTFoot(); + void deleteTFoot(); + HTMLElement createCaption(); + void deleteCaption(); + // Modified in DOM Level 2: + HTMLElement insertRow(in long index) + raises(dom::DOMException); + // Modified in DOM Level 2: + void deleteRow(in long index) + raises(dom::DOMException); + }; + + interface HTMLTableCaptionElement : HTMLElement { + attribute DOMString align; + }; + + interface HTMLTableColElement : HTMLElement { + attribute DOMString align; + attribute DOMString ch; + attribute DOMString chOff; + attribute long span; + attribute DOMString vAlign; + attribute DOMString width; + }; + + interface HTMLTableSectionElement : HTMLElement { + attribute DOMString align; + attribute DOMString ch; + attribute DOMString chOff; + attribute DOMString vAlign; + readonly attribute HTMLCollection rows; + // Modified in DOM Level 2: + HTMLElement insertRow(in long index) + raises(dom::DOMException); + // Modified in DOM Level 2: + void deleteRow(in long index) + raises(dom::DOMException); + }; + + interface HTMLTableRowElement : HTMLElement { + // Modified in DOM Level 2: + readonly attribute long rowIndex; + // Modified in DOM Level 2: + readonly attribute long sectionRowIndex; + // Modified in DOM Level 2: + readonly attribute HTMLCollection cells; + attribute DOMString align; + attribute DOMString bgColor; + attribute DOMString ch; + attribute DOMString chOff; + attribute DOMString vAlign; + // Modified in DOM Level 2: + HTMLElement insertCell(in long index) + raises(dom::DOMException); + // Modified in DOM Level 2: + void deleteCell(in long index) + raises(dom::DOMException); + }; + + interface HTMLTableCellElement : HTMLElement { + readonly attribute long cellIndex; + attribute DOMString abbr; + attribute DOMString align; + attribute DOMString axis; + attribute DOMString bgColor; + attribute DOMString ch; + attribute DOMString chOff; + attribute long colSpan; + attribute DOMString headers; + attribute DOMString height; + attribute boolean noWrap; + attribute long rowSpan; + attribute DOMString scope; + attribute DOMString vAlign; + attribute DOMString width; + }; + + interface HTMLFrameSetElement : HTMLElement { + attribute DOMString cols; + attribute DOMString rows; + }; + + interface HTMLFrameElement : HTMLElement { + attribute DOMString frameBorder; + attribute DOMString longDesc; + attribute DOMString marginHeight; + attribute DOMString marginWidth; + attribute DOMString name; + attribute boolean noResize; + attribute DOMString scrolling; + attribute DOMString src; + // Introduced in DOM Level 2: + readonly attribute Document contentDocument; + }; + + interface HTMLIFrameElement : HTMLElement { + attribute DOMString align; + attribute DOMString frameBorder; + attribute DOMString height; + attribute DOMString longDesc; + attribute DOMString marginHeight; + attribute DOMString marginWidth; + attribute DOMString name; + attribute DOMString scrolling; + attribute DOMString src; + attribute DOMString width; + // Introduced in DOM Level 2: + readonly attribute Document contentDocument; + }; + +#include "../../addtags.idl" + +}; + +#endif // _HTML2_IDL_ + addfile ./domconv/W3C/DOM2/idl/ranges.idl hunk ./domconv/W3C/DOM2/idl/ranges.idl 1 +/* + * Copyright (c) 2000 World Wide Web Consortium, + * (Massachusetts Institute of Technology, Institut National de + * Recherche en Informatique et en Automatique, Keio University). All + * Rights Reserved. This program is distributed under the W3C's Software + * Intellectual Property License. This program is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. + * See W3C License http://www.w3.org/Consortium/Legal/ for more details. + */ + +// File: http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113/ranges.idl + +#ifndef _RANGES_IDL_ +#define _RANGES_IDL_ + +#include "dom.idl" + +#pragma prefix "dom.w3c.org" +module ranges +{ + + typedef dom::Node Node; + typedef dom::DocumentFragment DocumentFragment; + typedef dom::DOMString DOMString; + + // Introduced in DOM Level 2: + exception RangeException { + unsigned short code; + }; + // RangeExceptionCode + const unsigned short BAD_BOUNDARYPOINTS_ERR = 1; + const unsigned short INVALID_NODE_TYPE_ERR = 2; + + + // Introduced in DOM Level 2: + interface Range { + readonly attribute Node startContainer; + // raises(dom::DOMException) on retrieval + + readonly attribute long startOffset; + // raises(dom::DOMException) on retrieval + + readonly attribute Node endContainer; + // raises(dom::DOMException) on retrieval + + readonly attribute long endOffset; + // raises(dom::DOMException) on retrieval + + readonly attribute boolean collapsed; + // raises(dom::DOMException) on retrieval + + readonly attribute Node commonAncestorContainer; + // raises(dom::DOMException) on retrieval + + void setStart(in Node refNode, + in long offset) + raises(RangeException, + dom::DOMException); + void setEnd(in Node refNode, + in long offset) + raises(RangeException, + dom::DOMException); + void setStartBefore(in Node refNode) + raises(RangeException, + dom::DOMException); + void setStartAfter(in Node refNode) + raises(RangeException, + dom::DOMException); + void setEndBefore(in Node refNode) + raises(RangeException, + dom::DOMException); + void setEndAfter(in Node refNode) + raises(RangeException, + dom::DOMException); + void collapse(in boolean toStart) + raises(dom::DOMException); + void selectNode(in Node refNode) + raises(RangeException, + dom::DOMException); + void selectNodeContents(in Node refNode) + raises(RangeException, + dom::DOMException); + + // CompareHow + const unsigned short START_TO_START = 0; + const unsigned short START_TO_END = 1; + const unsigned short END_TO_END = 2; + const unsigned short END_TO_START = 3; + + short compareBoundaryPoints(in unsigned short how, + in Range sourceRange) + raises(dom::DOMException); + void deleteContents() + raises(dom::DOMException); + DocumentFragment extractContents() + raises(dom::DOMException); + DocumentFragment cloneContents() + raises(dom::DOMException); + void insertNode(in Node newNode) + raises(dom::DOMException, + RangeException); + void surroundContents(in Node newParent) + raises(dom::DOMException, + RangeException); + Range cloneRange() + raises(dom::DOMException); + DOMString toString() + raises(dom::DOMException); + void detach() + raises(dom::DOMException); + }; + + // Introduced in DOM Level 2: + interface DocumentRange { + Range createRange(); + }; +}; + +#endif // _RANGES_IDL_ + addfile ./domconv/W3C/DOM2/idl/stylesheets.idl hunk ./domconv/W3C/DOM2/idl/stylesheets.idl 1 +/* + * Copyright (c) 2000 World Wide Web Consortium, + * (Massachusetts Institute of Technology, Institut National de + * Recherche en Informatique et en Automatique, Keio University). All + * Rights Reserved. This program is distributed under the W3C's Software + * Intellectual Property License. This program is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. + * See W3C License http://www.w3.org/Consortium/Legal/ for more details. + */ + +// File: http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/stylesheets.idl + +#ifndef _STYLESHEETS_IDL_ +#define _STYLESHEETS_IDL_ + +#include "dom.idl" + +#pragma prefix "dom.w3c.org" +module stylesheets +{ + +// typedef dom::DOMString DOMString; +// typedef dom::Node Node; + + interface MediaList; + + // Introduced in DOM Level 2: + interface StyleSheet { + readonly attribute DOMString type; + attribute boolean disabled; + readonly attribute Node ownerNode; + readonly attribute StyleSheet parentStyleSheet; + readonly attribute DOMString href; + readonly attribute DOMString title; + readonly attribute MediaList media; + }; + + // Introduced in DOM Level 2: + interface StyleSheetList { + readonly attribute unsigned long length; + StyleSheet item(in unsigned long index); + }; + + // Introduced in DOM Level 2: + interface MediaList { + attribute DOMString mediaText; + // raises(dom::DOMException) on setting + + readonly attribute unsigned long length; + DOMString item(in unsigned long index); + void deleteMedium(in DOMString oldMedium) + raises(dom::DOMException); + void appendMedium(in DOMString newMedium) + raises(dom::DOMException); + }; + + // Introduced in DOM Level 2: + interface LinkStyle { + readonly attribute StyleSheet sheet; + }; + + // Introduced in DOM Level 2: + interface DocumentStyle { + readonly attribute StyleSheetList styleSheets; + }; +}; + +#endif // _STYLESHEETS_IDL_ + addfile ./domconv/W3C/DOM2/idl/traversal.idl hunk ./domconv/W3C/DOM2/idl/traversal.idl 1 +/* + * Copyright (c) 2000 World Wide Web Consortium, + * (Massachusetts Institute of Technology, Institut National de + * Recherche en Informatique et en Automatique, Keio University). All + * Rights Reserved. This program is distributed under the W3C's Software + * Intellectual Property License. This program is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. + * See W3C License http://www.w3.org/Consortium/Legal/ for more details. + */ + +// File: http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113/traversal.idl + +#ifndef _TRAVERSAL_IDL_ +#define _TRAVERSAL_IDL_ + +#include "dom.idl" + +#pragma prefix "dom.w3c.org" +module traversal +{ + + typedef dom::Node Node; + + interface NodeFilter; + + // Introduced in DOM Level 2: + interface NodeIterator { + readonly attribute Node root; + readonly attribute unsigned long whatToShow; + readonly attribute NodeFilter filter; + readonly attribute boolean expandEntityReferences; + Node nextNode() + raises(dom::DOMException); + Node previousNode() + raises(dom::DOMException); + void detach(); + }; + + // Introduced in DOM Level 2: + interface NodeFilter { + + // Constants returned by acceptNode + const short FILTER_ACCEPT = 1; + const short FILTER_REJECT = 2; + const short FILTER_SKIP = 3; + + + // Constants for whatToShow + const unsigned long SHOW_ALL = 0xFFFFFFFF; + const unsigned long SHOW_ELEMENT = 0x00000001; + const unsigned long SHOW_ATTRIBUTE = 0x00000002; + const unsigned long SHOW_TEXT = 0x00000004; + const unsigned long SHOW_CDATA_SECTION = 0x00000008; + const unsigned long SHOW_ENTITY_REFERENCE = 0x00000010; + const unsigned long SHOW_ENTITY = 0x00000020; + const unsigned long SHOW_PROCESSING_INSTRUCTION = 0x00000040; + const unsigned long SHOW_COMMENT = 0x00000080; + const unsigned long SHOW_DOCUMENT = 0x00000100; + const unsigned long SHOW_DOCUMENT_TYPE = 0x00000200; + const unsigned long SHOW_DOCUMENT_FRAGMENT = 0x00000400; + const unsigned long SHOW_NOTATION = 0x00000800; + + short acceptNode(in Node n); + }; + + // Introduced in DOM Level 2: + interface TreeWalker { + readonly attribute Node root; + readonly attribute unsigned long whatToShow; + readonly attribute NodeFilter filter; + readonly attribute boolean expandEntityReferences; + attribute Node currentNode; + // raises(dom::DOMException) on setting + + Node parentNode(); + Node firstChild(); + Node lastChild(); + Node previousSibling(); + Node nextSibling(); + Node previousNode(); + Node nextNode(); + }; + + // Introduced in DOM Level 2: + interface DocumentTraversal { + NodeIterator createNodeIterator(in Node root, + in unsigned long whatToShow, + in NodeFilter filter, + in boolean entityReferenceExpansion) + raises(dom::DOMException); + TreeWalker createTreeWalker(in Node root, + in unsigned long whatToShow, + in NodeFilter filter, + in boolean entityReferenceExpansion) + raises(dom::DOMException); + }; +}; + +#endif // _TRAVERSAL_IDL_ + addfile ./domconv/W3C/DOM2/idl/views.idl hunk ./domconv/W3C/DOM2/idl/views.idl 1 +/* + * Copyright (c) 2000 World Wide Web Consortium, + * (Massachusetts Institute of Technology, Institut National de + * Recherche en Informatique et en Automatique, Keio University). All + * Rights Reserved. This program is distributed under the W3C's Software + * Intellectual Property License. This program is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. + * See W3C License http://www.w3.org/Consortium/Legal/ for more details. + */ + +// File: http://www.w3.org/TR/2000/REC-DOM-Level-2-Views-20001113/views.idl + +#ifndef _VIEWS_IDL_ +#define _VIEWS_IDL_ + +#include "dom.idl" + +#pragma prefix "dom.w3c.org" +module views +{ + + interface DocumentView; + + // Introduced in DOM Level 2: + interface AbstractView { + readonly attribute DocumentView document; + }; + + // Introduced in DOM Level 2: + interface DocumentView { + readonly attribute AbstractView defaultView; + }; +}; + +#endif // _VIEWS_IDL_ + addfile ./domconv/W3C/DOM2/idl/xmlhttp.idl hunk ./domconv/W3C/DOM2/idl/xmlhttp.idl 1 +// This file has its source at: http://www.w3.org/TR/XMLHttpRequest/ +// It has been modified to be used with DOM Level 2 definitions +// adopted for ycr2js + +// Changes made: +// * XMLHttpRequest is a subclass of Element to work with Event interface +// * `open' and `send' methods are renamed to remove method name multiplicity +// * added #pragma namespace ("proprietary" to ycr2js) for correct Haskell module naming +// * renamed formal arguments (data) which conflict with Haskell reserved words + +#include "dom.idl" + +#pragma prefix "dom.w3c.org" + +module XMLHTTP { + +interface XMLHttpRequest : Element { + readonly attribute unsigned short readyState; + void openSync(in DOMString method, in DOMString url) context("open"); + void openAsync(in DOMString method, in DOMString url, in boolean async) context("open"); + void openUser(in DOMString method, in DOMString url, in boolean async, in DOMString user) context("open"); + void openAuth(in DOMString method, in DOMString url, in boolean async, in DOMString user, in DOMString password) context("open"); + void setRequestHeader(in DOMString header, in DOMString value); + void sendString(in DOMString str) context("send"); + void sendDocument(in Document doc) context("send"); + void abort(); + DOMString getAllResponseHeaders(); + DOMString getResponseHeader(in DOMString header); + readonly attribute DOMString responseText; + readonly attribute Document responseXML; + readonly attribute unsigned short status; + readonly attribute DOMString statusText; +}; +}; + hunk ./domconv/domconv-cps.hs 7 -import System.Environment +import Prelude hiding (putStrLn) +import System.Environment.UTF8 hunk ./domconv/domconv-cps.hs 10 -import System.FilePath.Version_0_09 +import System.FilePath hunk ./domconv/domconv-cps.hs 12 -import System.IO +import System.IO (stderr, stdin, openFile, IOMode (..)) +import System.IO.UTF8 hunk ./domconv/domconv-cps.hs 30 ---import JS.Jcode ---import JS.Show +import JS.Jcode +import JS.Show hunk ./domconv/domconv.cabal 26 +Data-Dir: W3C/DOM2 +Data-Files: COPYRIGHT.html, idl/*.idl + hunk ./domconv/domconv.cabal 33 -Hs-source-dirs: ., hdirect-0.21 +Hs-source-dirs: ., hdirect-0.21, legacy-js hunk ./domconv/domconv.cabal 36 +Extensions: ScopedTypeVariables hunk ./domconv/hdirect-0.21/Lex.lhs 328 - [((_::Int),cs1)] -> + [((z::Int),cs1)] -> adddir ./domconv/legacy-js adddir ./domconv/legacy-js/JS addfile ./domconv/legacy-js/JS/Jcode.hs hunk ./domconv/legacy-js/JS/Jcode.hs 1 +-- Jcode datatype: to represent Javascript on per-statement basis. + +module JS.Jcode where + +data Jcode + = JComment String -- renders as '// anycomment' + | JMlcomm [String] -- renders as multiline comment within /* */ + | JStat Jexp -- renders as a non-assignment statement + | JRaw String -- renders as raw Javascript + | JAssign Jexp Jexp -- renders as assignment (LHS = RHS;) + | JAssignV Jexp Jexp -- renders as variable declaration with assignment + | JSwitch Jexp [(Maybe Jexp,[Jcode],Bool)] -- renders as a switch statements + | JTry [Jcode] String [Jcode] [Jcode] -- try ... catch ... finally + | JFunction String [String] [Jcode] -- toplevel-declared multistatement funciton + | JReturn Jexp -- renders as a return statement + deriving (Show) + +data Jexp + = JEmpty -- empty expression + | JStr String -- variable/function identifier/immediate value + | JNum String -- specifically for numeric values + | JObject [(String, Jexp)] -- object initializer + | JPrim String [Jexp] -- primitive call on arguments + | JCall Jexp [Jexp] -- function call on arguments + | JFunc [String] Jexp -- nested function declaration + | JProc [String] [Jcode] -- procedure + | JMethod String Jexp [Jexp] -- method invocation + | JMember String Jexp -- member access + | JArray [Jexp] -- array + | JIndex Jexp Jexp -- array indexed access + | JCond Jexp Jexp Jexp -- conditional exp1 ? exp2 : exp3 + | JInfix String Jexp Jexp -- infix operator + | JComma Jexp Jexp -- comma operator + deriving (Show) + addfile ./domconv/legacy-js/JS/Show.hs hunk ./domconv/legacy-js/JS/Show.hs 1 +-- Functions to render encoded Javascript statements and expressions +-- into a interpretable Javascript + +module JS.Show where + +import JS.Jcode +import Data.List +import Data.Char +import Numeric +import Prim + +-- A rendering function for Jcode (not pretty, w/o indents) + +strJcode (JComment s) = "// " ++ s ++ "\n" +strJcode (JMlcomm []) = "" +strJcode (JMlcomm ss) = "/*\n" ++ concat (intersperse "\n" ss) ++ "\n*/\n" +strJcode (JStat e) = strJexp e ++ ";\n" +strJcode (JRaw s) = s +strJcode (JAssign lhs rhs) = strJexp lhs ++ "=" ++ strJexp rhs ++ ";\n" +strJcode (JAssignV lhs rhs) = "var " ++ strJexp lhs ++ "=" ++ strJexp rhs ++ ";\n" +strJcode (JTry jtry cv jcatch jfin) = + "try {\n" ++ concat (map strJcode jtry) ++ "}\n" ++ + "catch (" ++ cv ++ ") {\n" ++ concat (map strJcode jcatch) ++ "}\n" ++ + "finally {\n" ++ concat (map strJcode jfin) ++ "}\n" +strJcode (JReturn (JCall (JFunc [] exp) [])) = strJcode (JReturn exp) +strJcode (JReturn (JCall (JProc [] jss) [])) = concat (map strJcode jss) +strJcode (JReturn ret) = "return " ++ strJexp ret ++ ";\n" +strJcode (JSwitch exp cases) = "switch(" ++ strJexp exp ++ ") {\n" ++ + concat (map onecase cases) ++ "}\n" + where onecase (Just cexp, ccode, brk) = "case " ++ strJexp cexp ++ " : " ++ + concat (map strJcode ccode) ++ + if brk then "break;\n" else "" + onecase (Nothing, ccode, _) = "default : " ++ concat (map strJcode ccode) +strJcode (JFunction name args body) = "function " ++ name ++ "(" ++ + concat (intersperse ", " args) ++ ")" ++ + "{\n" ++ concat (map strJcode body) ++ "}\n" + + +-- A function to render Javascript expressions + +strJexp JEmpty = "undefined" +strJexp (JStr s) = s +strJexp (JNum s) = s +strJexp (JObject flds) = "{" ++ + concat (intersperse ",\n" (map strfield flds)) ++ "}" + where strfield (f, e) = f ++ ":" ++ strJexp e + +strJexp (JCall (JStr "new HSData") ((JStr con):_)) | con == "true" || con == "false" = con + +strJexp (JCall (JFunc fargs (JStr fret)) _) | not (fret `elem` fargs) = fret + +strJexp (JCall fun args) = (strJexp fun) ++ "(" ++ concat (intersperse ", " (map strJexp args)) ++ ")" + +strJexp (JFunc args (JCall (JFunc [] exp) [])) = strJexp (JFunc args exp) + +strJexp (JFunc args (JCall (JProc [] jcs) [])) = strJexp (JProc args jcs) + +strJexp (JFunc args exp) = "function(" ++ concat (intersperse ", " args) ++ + "){return " ++ strJexp exp ++ ";}" + +strJexp (JProc args jcs) = "function(" ++ concat (intersperse ", " args) ++ + "){\n" ++ concat (map strJcode jcs) ++ "}" + + +strJexp (JComma l r) = "(" ++ strJexp l ++ "," ++ strJexp r ++ ")" + +strJexp (JPrim (pn) args@(l:r:_)) = + let pref o = "(" ++ o ++ "(" ++ strJexp l ++ "))" + jxpn (JNum n) = n + jxpn e = strJexp (JCall (JStr "Number") [e]) + inf1 o = "(" ++ strJexp l ++ ")" ++ o ++ "(" ++ strJexp r ++ ")" + inf2 o = "(" ++ jxpn l ++ ")" ++ o ++ "(" ++ jxpn r ++ ")" in + case pn of + "SEQ" -> "(exprEval(" ++ strJexp l ++ ")," ++ strJexp r ++ ")" + "QUOT" -> "function(x,y){return (x - (x % y))/y;}(" ++ jxpn l ++ "," ++ jxpn r ++ ")" + "ADD_W" -> inf1 "+" + "ADD_F" -> inf1 "+" + "ADD_D" -> inf1 "+" + "SUB_W" -> inf1 "-" + "SUB_F" -> inf1 "-" + "SUB_D" -> inf1 "-" + "MUL_W" -> inf1 "*" + "MUL_F" -> inf1 "*" + "MUL_D" -> inf1 "*" + "NEG_W" -> pref "-" + "NEG_F" -> pref "-" + "NEG_D" -> pref "-" + "EQ_W" -> inf2 "===" + "EQ_F" -> inf2 "===" + "EQ_D" -> inf2 "===" + "NE_W" -> inf2 "!==" + "NE_F" -> inf2 "!==" + "NE_D" -> inf2 "!==" + "GT_W" -> inf2 ">" + "GT_F" -> inf2 ">" + "GT_D" -> inf2 ">" + "LT_W" -> inf2 "<" + "LT_F" -> inf2 "<" + "LT_D" -> inf2 "<" + "GE_W" -> inf2 ">=" + "GE_F" -> inf2 ">=" + "GE_D" -> inf2 ">=" + "LE_W" -> inf2 "<=" + "LE_F" -> inf2 "<=" + "LE_D" -> inf2 "<=" + "SLASH_D" -> inf2 "/" + "SLASH_F" -> inf2 "/" + "REM" -> inf1 "%" +-- "SEQ" -> strJexp (JCall (JStr "exprEval") [l] + other -> strJexp (JCall (JStr (" /*???*/ " ++ pn)) args) + +strJexp (JPrim prim args) = prim ++ "(" ++ + concat (intersperse "," (map strJexp args)) ++ ")" + +strJexp (JMethod meth obj args) = "(" ++ strJexp obj ++ ")." ++ meth ++ "(" ++ + concat (intersperse ", " (map strJexp args)) ++ ")" + +strJexp (JMember memb obj) = "(" ++ strJexp obj ++ ")." ++ memb + +strJexp (JArray es) = "[" ++ concat (intersperse ", " (map strJexp es)) ++ "]" + +strJexp (JCond e1 e2 e3) = "(" ++ strJexp e1 ++ ")?(" ++ + strJexp e2 ++ "):(" ++ strJexp e3 ++ ")" + +strJexp (JInfix oper e1 e2) = "(" ++ strJexp e1 ++ ") " ++ oper ++ " (" ++ strJexp e2 ++ ")" + +strJexp (JIndex arr idx) = strJexp arr ++ "[" ++ strJexp idx ++ "]" + +instance Show Prim where + show = strPrim + +-- A function to render Javascript string literals. + +showJstr "" = "" +showJstr (c:cs) = (showjsc c) ++ (showJstr cs) where + showjsc c | isAlphaNum c || c `elem` "{}[]() <=>_.,/;:!|+-@#$%^&*()~`" = [c] + showjsc c | c `elem` "\'\"\\" = '\\':[c] + showjsc c | (ord c) > 127 && (ord c) < 256 = "\\x" ++ lpad '0' 2 (showHex (ord c) "") + showjsc c = "\\u" ++ lpad '0' 4 (showHex (ord c) "") + lpad p n s = let npad = n - length s in + case npad > 0 of + True -> (replicate npad p) ++ s + False -> s + addfile ./domconv/legacy-js/Prim.hs hunk ./domconv/legacy-js/Prim.hs 1 +module Prim where + +data PrimOp = OpWord | OpFloat | OpDouble deriving (Eq,Show,Ord) + +data Prim = + ADD PrimOp + | SUB PrimOp + | MUL PrimOp + | ABS PrimOp + | SIGNUM PrimOp + | EXP PrimOp + | POW PrimOp + | LOG PrimOp + | SQRT PrimOp + | SIN PrimOp + | COS PrimOp + | TAN PrimOp + | ASIN PrimOp + | ACOS PrimOp + | ATAN PrimOp + | SLASH PrimOp + | CMP_EQ PrimOp -- EQ is used by 1.3 in in Ordering + | CMP_NE PrimOp + | CMP_LT PrimOp -- LT is used by 1.3 in in Ordering + | CMP_LE PrimOp + | CMP_GT PrimOp -- GT is used by 1.3 in in Ordering + | CMP_GE PrimOp + | NEG PrimOp + | QUOT + | REM + | AND + | OR + | NOT + | ORD + | CHR + | SEQ + | STRING -- NR + | CATCH + | HGETS -- MW + | HGETC -- NR + | HPUTC -- NR + -- -- | QUOTREM -- WITHDRAWN + -- -- | DIVMOD -- WITHDRAWN + -- -- | DIV -- WITHDRAWN + -- -- | MOD -- WITHDRAWN + deriving (Eq) + +strPrim :: Prim -> String +strPrim (ADD op) = strPrimOp "ADD" op +strPrim (SUB op) = strPrimOp "SUB" op +strPrim (MUL op) = strPrimOp "MUL" op +strPrim (ABS op) = strPrimOp "ABS" op +strPrim (SIGNUM op) = strPrimOp "SIGNUM" op +strPrim (EXP op) = strPrimOp "EXP" op +strPrim (POW op) = strPrimOp "POW" op +strPrim (LOG op) = strPrimOp "LOG" op +strPrim (SQRT op) = strPrimOp "SQRT" op +strPrim (SIN op) = strPrimOp "SIN" op +strPrim (COS op) = strPrimOp "COS" op +strPrim (TAN op) = strPrimOp "TAN" op +strPrim (ASIN op) = strPrimOp "ASIN" op +strPrim (ACOS op) = strPrimOp "ACOS" op +strPrim (ATAN op) = strPrimOp "ATAN" op +strPrim (SLASH op) = strPrimOp "SLASH" op +strPrim (CMP_EQ op) = strPrimOp "EQ" op +strPrim (CMP_NE op) = strPrimOp "NE" op +strPrim (CMP_LT op) = strPrimOp "LT" op +strPrim (CMP_LE op) = strPrimOp "LE" op +strPrim (CMP_GT op) = strPrimOp "GT" op +strPrim (CMP_GE op) = strPrimOp "GE" op +strPrim (NEG op) = strPrimOp "NEG" op +strPrim QUOT = "QUOT" +strPrim REM = "REM" +strPrim AND = "AND" +strPrim OR = "OR" +strPrim NOT = "NOT" +strPrim ORD = "ORD" +strPrim CHR = "CHR" +strPrim SEQ = "SEQ" +strPrim STRING = "STRING" +strPrim CATCH = "CATCH" +strPrim HGETS = "HGETS" +strPrim HGETC = "HGETC" +strPrim HPUTC = "HPUTC" + +strPrimOp :: String -> PrimOp -> String +strPrimOp mnem OpWord = mnem ++ "_W" +strPrimOp mnem OpFloat = mnem ++ "_F" +strPrimOp mnem OpDouble = mnem ++ "_D" }