r20514: implement idl for DsGetNT4ChangeLog() which transferres the meta data
[ira/wip.git] / webapps / qooxdoo-0.6.3-sdk / frontend / framework / tool / modules / obfuscator.py
1 #!/usr/bin/env python
2
3 import tree, mapper
4
5 qooxdooStart = [
6   # Properties
7   "_modify", "_check", "_unitDetection",
8
9   # Layout
10   "_applyRuntime",
11
12   # Cache Properties
13   "_resetRuntime", "_compute", "_change", "_invalidate", "_recompute",
14
15   # Property Methods
16   "set", "get", "force", "reset"
17 ]
18
19 qooxdooNames = [
20   # Demos
21   "ROOT_LOGGER", "removeAllAppenders", "addAppender", "DivAppender",
22
23   # qx.ui.core.Widget.initApplyMethods
24   "_style",
25   "setStyleProperty", "removeStyleProperty",
26   "constant", "Core",
27
28   # Inheritance
29   "qx", "Proto", "Class"
30 ]
31
32 systemNames = [
33   # Statement
34   "break","catch","continue","do","for","in","finally","function","if","else","return","switch","case","default",
35   "this","throw","try","var","while","with",
36
37   # Operator
38   "delete","false","instanceof","new","null","true","typeof","void",
39
40   # Function
41   "GetObject","ScriptEngine","ScriptEngineBuildVersion","ScriptEngineMajorVersion","ScriptEngineMinorVersion",
42
43   # Objects
44   "ActiveXObject","Arguments","Array","Boolean","Date","Dictionary","Enumerator","Error","FileSystemObject",
45   "Function","Global","Image","Math","Number","Object","RegExp","String","VBArray",
46
47   # Property
48   "$1","$2","$3","$4","$5",
49   "$6","$7","$8","$9","arguments","arity","callee","caller","constructor","description","E","global","ignoreCase",
50   "index","Infinity","input","lastIndex","leftContext","length","LN2","LN10","LOG2E","LOG10E","MAX_VALUE",
51   "MIN_VALUE","message","multiline","name","NaN","NEGATIVE_INFINITY","number","PI","POSITIVE_INFINITY",
52   "prototype","rightContext","source","SQRT1_2","SQRT2","undefined",
53
54   # Methods
55   "abs","acos","anchor","apply","asin",
56   "atan","atan2","atEnd","big","blink","bold","call","ceil","charAt","charCodeAt","compile","concat","cos",
57   "decodeURI","decodeURIComponent","dimensions","encodeURI","encodeURIComponent","escape","eval","exec",
58   "exp","fixed","floor","fontcolor","fontsize","fromCharCode","getDate","getDay","getFullYear","getHours",
59   "getItem","getMilliseconds","getMinutes","getMonth","getSeconds","getTime","getTimezoneOffset","getUTCDate",
60   "getUTCDay","getUTCFullYear","getUTCHours","getUTCMilliseconds","getUTCMinutes","getUTCMonth","getUTCSeconds",
61   "getVarDate","getYear","hasOwnProperty","indexOf","isFinite","isNaN","isPrototypeOf","italics","item","join",
62   "lastIndexOf","lastMatch","lastParen","lbound","link","localeCompare","log","match","max","min","moveFirst",
63   "moveNext","parse","parseFloat","parseInt","pop","pow","propertyIsEnumerable","push","random","replace",
64   "reverse","round","search","setDate","setFullYear","setHours","setMilliseconds","setMinutes","setMonth",
65   "setSeconds","setTime","setUTCDate","setUTCFullYear","setUTCHours","setUTCMilliseconds","setUTCMinutes",
66   "setUTCMonth","setUTCSeconds","setYear","shift","sin","slice","small","sort","splice","split","sqrt","strike",
67   "sub","substr","substring","sup","tan","test","toArray","toDateString","toExponential","toFixed","toGMTString",
68   "toLocaleDateString","toLocaleLowerCase","toLocaleString","toLocaleTimeString","toLocaleUpperCase","toLowerCase",
69   "toPrecision","toString","toTimeString","toUpperCase","toUTCString","ubound","unescape","unshift","unwatch","UTC",
70   "valueOf","watch",
71
72   # HTML Entity
73   "nbsp","lt","gt","amp","apos","quot","cent","pound","yen","sect","copy","reg","times","divide",
74
75   # DHTML Constant
76   "ATTRIBUTE_NODE","CDATA_SECTION_NODE","COMMENT_NODE","DOCUMENT_FRAGMENT_NODE","DOCUMENT_NODE","DOCUMENT_TYPE_NODE",
77   "ELEMENT_NODE","ENTITY_NODE","ENTITY_REFERENCE_NODE","NOTATION_NODE","PROCESSING_INSTRUCTION_NODE","TEXT_NODE",
78   "NOTATION_FRAGMENT_NODE","DOMSTRING_SIZE_ERR","HIERARCHY_REQUEST_ERR","INDEX_SIZE_ERR","INUSE_ATTRIBUTE_ERR",
79   "INVALID_ACCESS_ERR","INVALID_CHARACTER_ERR","INVALID_MODIFICATION_ERR","INVALID_STATE_ERR","NAMESPACE_ERR",
80   "NOT_FOUND_ERR","NOT_SUPPORTED_ERR","NO_DATA_ALLOWED_ERR","NO_MODIFICATION_ALLOWED_ERR","SYNTAX_ERR",
81   "WRONG_DOCUMENT_ERR","ABORT","BLUR","CLICK","CHANGE","DBLCLICK","DRAGDROP","ERROR","FOCUS","KEYDOWN","KEYPRESS",
82   "KEYUP","LOAD","MOUSEDOWN","MOUSEMOVE","MOUSEOUT","MOUSEOVER","MOUSEUP","MOVE","RESET","RESIZE","SELECT","SUBMIT",
83   "UNLOAD","NODE_BEFORE","NODE_AFTER","NODE_BEFORE_AND_AFTER","NODE_INSIDE","START_TO_START","START_TO_END",
84   "END_TO_END","END_TO_START","BAD_BOUNDARYPOINTS_ERR","INVALID_NODE_TYPE_ERR","UNKNOWN_RULE","STYLE_RULE",
85   "CHARSET_RULE","IMPORT_RULE","MEDIA_RULE","FONT_FACE_RULE","PAGE_RULE","CSS_UNKNOWN","CSS_NUMBER","CSS_PERCENTAGE",
86   "CSS_EMS","CSS_EXS","CSS_PX","CSS_CM","CSS_MM","CSS_IN","CSS_PT","CSS_PC","CSS_DEG","CSS_RAD","CSS_GRAD","CSS_MS",
87   "CSS_S","CSS_HZ","CSS_KHZ","CSS_DIMENSION","CSS_STRING","CSS_URI","CSS_IDENT","CSS_ATTR","CSS_COUNTER","CSS_RECT",
88   "CSS_RGBCOLOR","CSS_INHERIT","CSS_PRIMITIVE_VALUE","CSS_VALUE_LIST","CSS_CUSTOM","STATE_MAXIMIZED","STATE_MINIMIZED",
89   "STATE_NORMAL","DOCUMENT_POSITION_DISCONNECTED","DOCUMENT_POSITION_PRECEDING","DOCUMENT_POSITION_FOLLOWING",
90   "DOCUMENT_POSITION_CONTAINS","DOCUMENT_POSITION_CONTAINED_BY","DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC",
91   "CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","MOUSEDOWN","MOUSEUP","MOUSEOVER","MOUSEOUT","MOUSEMOVE",
92   "MOUSEDRAG","CLICK","DBLCLICK","KEYDOWN","KEYUP","KEYPRESS","DRAGDROP","FOCUS","BLUR","SELECT","CHANGE",
93   "RESET","SUBMIT","SCROLL","LOAD","UNLOAD","XFER_DONE","ABORT","ERROR","LOCATE","MOVE","RESIZE","FORWARD",
94   "HELP","BACK","TEXT","ALT_MASK","CONTROL_MASK","SHIFT_MASK","META_MASK","SCROLL_PAGE_UP","SCROLL_PAGE_DOWN",
95   "DOM_VK_CANCEL","DOM_VK_HELP","DOM_VK_BACK_SPACE","DOM_VK_TAB","DOM_VK_CLEAR","DOM_VK_RETURN","DOM_VK_ENTER",
96   "DOM_VK_SHIFT","DOM_VK_CONTROL","DOM_VK_ALT","DOM_VK_PAUSE","DOM_VK_CAPS_LOCK","DOM_VK_ESCAPE","DOM_VK_SPACE",
97   "DOM_VK_PAGE_UP","DOM_VK_PAGE_DOWN","DOM_VK_END","DOM_VK_HOME","DOM_VK_LEFT","DOM_VK_UP","DOM_VK_RIGHT","DOM_VK_DOWN",
98   "DOM_VK_PRINTSCREEN","DOM_VK_INSERT","DOM_VK_DELETE","DOM_VK_0","DOM_VK_1","DOM_VK_2","DOM_VK_3","DOM_VK_4","DOM_VK_5",
99   "DOM_VK_6","DOM_VK_7","DOM_VK_8","DOM_VK_9","DOM_VK_SEMICOLON","DOM_VK_EQUALS","DOM_VK_A","DOM_VK_B","DOM_VK_C",
100   "DOM_VK_D","DOM_VK_E","DOM_VK_F","DOM_VK_G","DOM_VK_H","DOM_VK_I","DOM_VK_J","DOM_VK_K","DOM_VK_L","DOM_VK_M",
101   "DOM_VK_N","DOM_VK_O","DOM_VK_P","DOM_VK_Q","DOM_VK_R","DOM_VK_S","DOM_VK_T","DOM_VK_U","DOM_VK_V","DOM_VK_W",
102   "DOM_VK_X","DOM_VK_Y","DOM_VK_Z","DOM_VK_CONTEXT_MENU","DOM_VK_NUMPAD0","DOM_VK_NUMPAD1","DOM_VK_NUMPAD2",
103   "DOM_VK_NUMPAD3","DOM_VK_NUMPAD4","DOM_VK_NUMPAD5","DOM_VK_NUMPAD6","DOM_VK_NUMPAD7","DOM_VK_NUMPAD8","DOM_VK_NUMPAD9",
104   "DOM_VK_MULTIPLY","DOM_VK_ADD","DOM_VK_SEPARATOR","DOM_VK_SUBTRACT","DOM_VK_DECIMAL","DOM_VK_DIVIDE","DOM_VK_F1",
105   "DOM_VK_F2","DOM_VK_F3","DOM_VK_F4","DOM_VK_F5","DOM_VK_F6","DOM_VK_F7","DOM_VK_F8","DOM_VK_F9","DOM_VK_F10",
106   "DOM_VK_F11","DOM_VK_F12","DOM_VK_F13","DOM_VK_F14","DOM_VK_F15","DOM_VK_F16","DOM_VK_F17","DOM_VK_F18","DOM_VK_F19",
107   "DOM_VK_F20","DOM_VK_F21","DOM_VK_F22","DOM_VK_F23","DOM_VK_F24","DOM_VK_NUM_LOCK","DOM_VK_SCROLL_LOCK","DOM_VK_COMMA",
108   "DOM_VK_PERIOD","DOM_VK_SLASH","DOM_VK_BACK_QUOTE","DOM_VK_OPEN_BRACKET","DOM_VK_BACK_SLASH","DOM_VK_CLOSE_BRACKET",
109   "DOM_VK_QUOTE","DOM_VK_META","MODIFICATION","ADDITION","REMOVAL","INVALID_EXPRESSION_ERR","TYPE_ERR","ANY_TYPE",
110   "NUMBER_TYPE","STRING_TYPE","BOOLEAN_TYPE","UNORDERED_NODE_ITERATOR_TYPE","ORDERED_NODE_ITERATOR_TYPE",
111   "UNORDERED_NODE_SNAPSHOT_TYPE","ORDERED_NODE_SNAPSHOT_TYPE","ANY_UNORDERED_NODE_TYPE","FIRST_ORDERED_NODE_TYPE",
112   "UNSPECIFIED_EVENT_TYPE_ERR",
113
114   # DHTML Object
115   "a","AbstractView","acronym","address","applet","area","Attr","attribute","b",
116   "BarProp","base","baseFont","bdo","BeforeUnloadEvent","bgSound","big","blockQuote","body","br","button",
117   "CanvasGradient","CanvasPattern","CanvasRenderingContext2D","caption","CDATASection","center","CharacterData",
118   "ChromeWindow","cite","clientInformation","clipboardData","code","col","colGroup","comment","Comment","Counter",
119   "CSS2Properties","CSSCharsetRule","CSSFontFaceRule","CSSImportRule","CSSMediaRule","CSSPageRule","CSSPrimitiveValue",
120   "CSSRGBColor","CSSRule","CSSRuleList","CSSStyleDeclaration","CSSStyleRule","CSSStyleSheet","CSSUnknownRule",
121   "CSSValue","CSSValueList","currentStyle","custom","dataTransfer","dd","defaults","del","dfn","dir","div","dl",
122   "document","Document","DocumentCSS","DocumentEvent","DocumentFragment","DocumentRange","DocumentStyle",
123   "DocumentType","DocumentView","DOMException","DOMImplementation","DOMImplementationCSS","DOMParser",
124   "DOMStringList","dt","Element","ElementCSSInlineStyle","em","embed","Entity","EntityReference","event",
125   "Event","EventException","EventListener","EventTarget","external","fieldSet","font","form","frame","frameSet",
126   "h","head","history","History","hr","html","HTMLAnchorElement","HTMLAppletElement","HTMLAreaElement",
127   "HTMLBRElement","HTMLBaseElement","HTMLBaseFontElement","HTMLBodyElement","HTMLButtonElement","HTMLCanvasElement",
128   "HTMLCollection","HTMLDListElement","HTMLDirectoryElement","HTMLDivElement","HTMLDocument","HTMLDOMImplementation",
129   "HTMLElement","HTMLEmbedElement","HTMLFieldSetElement","HTMLFontElement","HTMLFormElement","HTMLFrameElement",
130   "HTMLFrameSetElement","HTMLHRElement","HTMLHeadElement","HTMLHeadingElement","HTMLHtmlElement","HTMLIFrameElement",
131   "HTMLImageElement","HTMLInputElement","HTMLIsIndexElement","HTMLLIElement","HTMLLabelElement","HTMLLegendElement",
132   "HTMLLinkElement","HTMLMapElement","HTMLMenuElement","HTMLMetaElement","HTMLModElement","HTMLOListElement",
133   "HTMLObjectElement","HTMLOptGroupElement","HTMLOptionElement","HTMLOptionsCollection","HTMLParagraphElement",
134   "HTMLParamElement","HTMLPreElement","HTMLQuoteElement","HTMLScriptElement","HTMLSelectElement","HTMLStyleElement",
135   "HTMLTableCaptionElement","HTMLTableCellElement","HTMLTableColElement","HTMLTableElement","HTMLTableRowElement",
136   "HTMLTableSectionElement","HTMLTextAreaElement","HTMLTitleElement","HTMLUListElement","i","iframe","ImageDocument",
137   "img","implementation","IMPORT","input","ins","isIndex","kbd","KeyboardEvent","KeyEvent","label","legend","li",
138   "link","LinkStyle","listing","location","Location","map","marquee","MediaList","menu","meta","MimeType",
139   "MimeTypeArray","MouseEvent","MutationEvent","NamedNodeMap","NameList","namespace","navigator","Navigator",
140   "nextID","noBR","Node","NodeList","noFrames","noScript","Notation","NSDocument","NSEvent","NSHTMLAnchorElement",
141   "NSHTMLAreaElement","NSHTMLButtonElement","NSHTMLDocument","NSHTMLElement","NSHTMLFormElement","NSHTMLFrameElement",
142   "NSHTMLHRElement","NSHTMLImageElement","NSHTMLInputElement","NSHTMLOptionElement","NSHTMLSelectElement",
143   "NSHTMLTextAreaElement","NSRange","NSUIEvent","object","ol","optGroup","option","p","page","PageTransitionEvent",
144   "param","plainText","Plugin","PluginArray","popup","PopupBlockedEvent","pre","ProcessingInstruction","q","Range",
145   "RangeException","Rect","RGBColor","rt","ruby","rule","runtimeStyle","s","samp","SchemaLoader","screen","Screen",
146   "script","select","selection","Selection","small","SmartCardEvent","span","strike","strong","style","styleSheet",
147   "StyleSheet","StyleSheetList","sub","sup","Supports","table","TableSectionElement","tBody","td","Text","textArea",
148   "TextNode","TextRange","TextRectangle","tFoot","th","tHead","title","tr","TreeWalker","tt","u","UIEvent","ul",
149   "userProfile","URI","var","ViewCSS","wbr","WebBrowser","WebNavigation","window","Window","Window2","WindowCollection",
150   "WindowInternal","xml","XMLDocument","XMLHttpRequest","XMLSerializer","xmp","XPathEvaluator","XPathException",
151   "XPathExpression","XPathNSResolver","XPathResult","XPointerResult","XSLTProcessor",
152
153   # DHTML Property
154   "_content","abbr","accelerator",
155   "accept","acceptCharset","accessKey","action","activeElement","additive","align","aLink","alinkColor","allowTransparency",
156   "alt","altHTML","altKey","altLeft","anchorNode","anchorOffset","appCodeName","APPLICATION","appMinorVersion","appName",
157   "appVersion","archive","async","ATOMICSELECTION","attrChange","attrName","autocomplete","availHeight","availLeft",
158   "availTop","availWidth","azimuth","axis","background","backgroundAttachment","backgroundColor","backgroundImage",
159   "backgroundPosition","backgroundPositionX","backgroundPositionY","backgroundRepeat","balance","Banner",
160   "BannerAbstract","BaseHref","baseURI","behavior","bgColor","BGCOLOR","bgProperties","blockDirection","blue",
161   "booleanValue","border","borderBottom","borderBottomColor","borderBottomStyle","borderBottomWidth","borderCollapse",
162   "borderColor","borderColorDark","borderColorLight","borderLeft","borderLeftColor","borderLeftStyle","borderLeftWidth",
163   "borderRight","borderRightColor","borderRightStyle","borderRightWidth","borderSpacing","borderStyle","borderTop",
164   "borderTopColor","borderTopStyle","borderTopWidth","borderWidth","borderWidths","bottom","bottomMargin","boundingHeight",
165   "boundingLeft","boundingTop","boundingWidth","browserDOMWindow","browserLanguage","bubbles","bufferDepth","button",
166   "cancelable","cancelBubble","canHaveChildren","canHaveHTML","canvas","caption","captionSide","cellIndex","cellPadding",
167   "cellSpacing","ch","channel","charCode","charset","checked","characterSet","chOff","cite","classid","className",
168   "clear","clientHeight","clientLeft","clientTop","clientWidth","clientX","clientY","clip","clipBottom","clipLeft",
169   "clipRight","clipTop","cloneContents","closed","code","codeBase","codeType","collapsed","color","colorDepth","cols",
170   "colSpan","columnNumber","commonAncestorContainer","compact","compatMode","complete","content","contentDocument",
171   "contentEditable","contentOverflow","contentType","contentWindow","cookie","cookieEnabled","coords","Count",
172   "counterIncrement","counterReset","cpuClass","crypto","cssFloat","cssRules","cssText","cssValueType","ctrlKey",
173   "ctrlLeft","cue","cueAfter","cueBefore","current","currentNode","currentTarget","cursor","data","dataFld","DATAFLD",
174   "dataFormatAs","DATAFORMATAS","dataPageSize","dataSrc","DATASRC","dateTime","declare","defaultCharset",
175   "defaultChecked","defaultSelected","defaultStatus","defaultValue","defaultView","defer","description","designMode",
176   "detail","deviceXDPI","deviceYDPI","dialogArguments","dialogHeight","dialogLeft","dialogTop","dialogWidth","dir",
177   "direction","directories","disabled","display","displays","doctype","document","documentElement","documentURI",
178   "domain","domConfig","dropEffect","dynsrc","effectAllowed","elevation","emptyCells","enabledPlugin","encoding",
179   "enctype","endContainer","endOffset","entities","event","eventPhase","expandEntityReferences","expando",
180   "explicitOriginalTarget","face","fgColor","FieldDelim","fileCreatedDate","fileModifiedDate","filename","fileSize",
181   "fileUpdatedDate","fillStyle","filter","firstChild","focusNode","focusOffset","font","fontFamily","fontSize",
182   "fontSizeAdjust","fontSmoothingEnabled","fontStretch","fontStyle","fontVariant","fontWeight","form","formName",
183   "frame","frameBorder","frameElement","frameSpacing","fromElement","fullScreen","galleryImg","globalAlpha",
184   "globalCompositeOperation","green","hash","hasLayout","headers","height","hidden","hideFocus","history","host",
185   "hostname","href","hreflang","hspace","htmlFor","htmlText","httpEquiv","id","identifier","imageIsOverflowing",
186   "imageIsResized","imageRequest","imageResizingEnabled","imeMode","implementation","indeterminate","index","inner",
187   "innerHeight","innerHTML","innerText","innerWidth","inputEncoding","internalSubset","invalidIteratorState","isChar",
188   "isCollapsed","isContentEditable","isDisabled","isMap","isMultiLine","isOpen","isTextEdit","isTrusted","keyCode",
189   "label","lang","language","lastChild","lastModified","layerX","layerY","layoutFlow","layoutGrid","layoutGridChar",
190   "layoutGridLine","layoutGridMode","layoutGridType","left","leftMargin","length","letterSpacing","lineBreak","lineCap",
191   "lineHeight","lineJoin","lineNumber","lineWidth","link","linkColor","listStyle","listStyleImage","listStylePosition",
192   "listStyleType","localName","location","locationbar","logicalXDPI","logicalYDPI","longDesc","loop","loop","lowsrc",
193   "lowSrc","margin","marginBottom","marginHeight","marginLeft","marginRight","margins","marginTop","marginWidth",
194   "markerOffset","marks","maxHeight","maxLength","maxWidth","media","mediaText","menuArguments","menubar","message",
195   "metaKey","method","Methods","minHeight","minWidth","miterLimit","MozAppearance","MozBackgroundClip",
196   "MozBackgroundInlinePolicy","MozBackgroundOrigin","MozBinding","MozBorderBottomColors","MozBorderLeftColors",
197   "MozBorderRadius","MozBorderRadiusBottomleft","MozBorderRadiusBottomright","MozBorderRadiusTopleft",
198   "MozBorderRadiusTopright","MozBorderRightColors","MozBorderTopColors","MozBoxAlign","MozBoxDirection","MozBoxFlex",
199   "MozBoxOrdinalGroup","MozBoxOrient","MozBoxPack","MozBoxSizing","MozColumnCount","MozColumnGap","MozColumnWidth",
200   "MozFloatEdge","MozForceBrokenImageIcon","MozImageRegion","MozMarginEnd","MozMarginStart","MozOpacity","MozOutline",
201   "MozOutlineColor","MozOutlineOffset","MozOutlineRadius","MozOutlineRadiusBottomleft","MozOutlineRadiusBottomright",
202   "MozOutlineRadiusTopleft","MozOutlineRadiusTopright","MozOutlineStyle","MozOutlineWidth","MozPaddingEnd",
203   "MozPaddingStart","MozUserFocus","MozUserInput","MozUserModify","MozUserSelect","multipart","multiple","name",
204   "nameProp","namespaceURI","naturalHeight","naturalWidth","navigator","newValue","next","nextPage","nextSibling",
205   "nodeName","nodeType","nodeValue","noHref","noResize","noShade","notationName","notations","noWrap","numberValue",
206   "object","offscreenBuffering","offsetHeight","offsetLeft","offsetParent","offsetTop","offsetWidth","offsetX",
207   "offsetY","onBefore","onLine","opacity","opener","originalTarget","orphans","oscpu","outerHeight","outerHTML",
208   "outerText","outerWidth","outline","outlineColor","outlineOffset","outlineStyle","outlineWidth","overflow","overflowX",
209   "overflowY","ownerDocument","ownerElement","ownerNode","ownerRule","owningElement","padding","paddingBottom",
210   "paddingLeft","paddingRight","paddings","paddingTop","page","pageBreakAfter","pageBreakBefore","pageBreakInside",
211   "pageX","pageXOffset","pageY","pageYOffset","palette","parent","parentElement","parentNode","parentRule",
212   "parentStyleSheet","parentTextEdit","parentWindow","pathname","pause","pauseAfter","pauseBefore","persisted",
213   "personalbar","pitch","pitchRange","pixelBottom","pixelDepth","pixelHeight","pixelLeft","pixelRight","pixelTop",
214   "pixelWidth","pkcs11","platform","playDuring","pluginspage","popupWindowFeatures","popupWindowURI","port","posBottom",
215   "posHeight","position","posLeft","posRight","posTop","posWidth","preferredStylesheetSet","prefix","previous",
216   "previousSibling","prevValue","primitiveType","product","productSub","profile","prompt","prompter","propertyName",
217   "protocol","pseudoClass","publicId","qualifier","quotes","rangeCount","rangeOffset","rangeParent","readOnly",
218   "readyState","reason","recordNumber","recordset","red","referrer","rel","relatedNode","relatedTarget","repeat",
219   "requestingWindowURI","responseText","responseXML","result","resultType","returnValue","rev","richness","right",
220   "rightMargin","root","rowIndex","rows","rowSpan","rubyAlign","rubyOverhang","rubyPosition","rules","saveType",
221   "scheme","scope","scopeName","screen","screenLeft","screenTop","screenX","screenY","scroll","scrollAmount",
222   "scrollbar3dLightColor","scrollbarArrowColor","scrollbarBaseColor","scrollbarDarkShadowColor","scrollbarFaceColor",
223   "scrollbarHighlightColor","scrollbars","scrollbarShadowColor","scrollbarTrackColor","scrollDelay","scrollHeight",
224   "scrolling","scrollLeft","scrollMaxX","scrollMaxY","scrollTop","scrollX","scrollY","scrollWidth","search",
225   "sectionRowIndex","SECURITY","securityPolicy","selected","selectedIndex","selectionEnd","selectionStart","selector",
226   "selectorText","self","separator","shape","sheet","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY",
227   "shiftKey","shiftLeft","sidebar","singleNodeValue","size","snapshotLength","sourceIndex","span","speak","speakHeader",
228   "speakNumeral","speakPunctuation","specified","speechRate","src","srcElement","srcFilter","srcUrn","standby","start",
229   "startContainer","startOffset","status","statusbar","statusText","stress","strictErrorChecking","stringValue",
230   "strokeStyle","style","STYLE","styleFloat","styleSheet","suffixes","summary","systemId","systemLanguage","tabIndex",
231   "tableLayout","tabStop","tagName","tagUrn","target","text","textAlign","textAlignLast","textAutospace","textContent",
232   "textDecoration","textDecorationBlink","textDecorationLineThrough","textDecorationNone","textDecorationOverline",
233   "textDecorationUnderline","textIndent","textJustify","textKashidaSpace","textLength","textOverflow","textShadow",
234   "textTransform","textUnderlinePosition","textZoom","tFoot","tHead","timeStamp","title","tmpRealOriginalTarget",
235   "toElement","tokenName","toolbar","top","topMargin","trueSpeed","type","typeDetail","unicodeBidi","uniqueID","units",
236   "unselectable","UNSELECTABLE","updateInterval","URL","URLUnencoded","urn","useMap","userAgent","userLanguage","vAlign",
237   "value","valueType","vcard_name","vendor","vendorSub","version","verticalAlign","view","viewInheritStyle","viewLink",
238   "viewMasterTab","visibility","visible","vLink","vlinkColor","voiceFamily","volume","vspace","whatToShow","wheelDelta",
239   "which","whiteSpace","widows","width","window","windowRoot","windowState","wordBreak","wordSpacing","wordWrap","wrap",
240   "writingMode","x","XMLDocument","xmlEncoding","XMLNS","xmlStandalone","xmlVersion","XSLDocument","y","zIndex","zoom",
241
242   # DHTML Method
243   "abort","add","addBehavior","addBinding","addColorStop","addEventListener","AddChannel","AddDesktopComponent",
244   "addElement","AddFavorite","addImport","addPageRule","addRange","addReadRequest","addRule","adoptNode","alert",
245   "appendChild","appendData","appendMedium","applyElement","arc","arcTo","assign","atob","attachEvent",
246   "AutoCompleteSaveForm","AutoScan","back","beginPath","bezierCurveTo","blur","btoa","captureEvents","ChooseColorDlg",
247   "clear","clearAttributes","clearData","clearInterval","clearParameters","clearRect","clearRequest","clearTimeout",
248   "click","clip","cloneNode","cloneRange","close","closePath","collapse","collapseToEnd","collapseToStart",
249   "compareBoundaryPoints","compareDocumentPosition","compareEndPoints","compareNode","comparePoint","componentFromPoint",
250   "confirm","contains","containsNode","containsNS","createAttribute","createAttributeNS","createCaption",
251   "createCDATASection","createComment","createContextualFragment","createControlRange","createCSSStyleSheet",
252   "createDocument","createDocumentFragment","createDocumentType","createElement","createElementNS",
253   "createEntityReference","createEvent","createEventObject","createExpression","createLinearGradient",
254   "createHTMLDocument","createNodeIterator","createNSResolver","createPattern","createPopup",
255   "createProcessingInstruction","createRadialGradient","createRange","createRangeCollection","createStyleSheet",
256   "createTextNode","createTextRange","createTFoot","createTHead","createTreeWalker","deleteCaption","deleteCell",
257   "deleteContents","deleteData","deleteFromDocument","deleteMedium","deleteRow","deleteRule","deleteTFoot",
258   "deleteTHead","detach","detachEvent","disableExternalCapture","dispatchEvent","doImport","doReadRequest",
259   "doScroll","dragDrop","drawImage","dump","duplicate","elementFromPoint","enableExternalCapture","empty",
260   "escape","evaluate","evaluateFIXptr","evaluateWithContext","evaluateXPointer","execCommand","execCommandShowHelp",
261   "execScript","expand","extend","extractContents","fill","fillRect","find","findText","fireEvent","firstPage",
262   "focus","forward","getAdjacentText","getAllResponseHeaders","getAnonymousElementByAttribute","getAnonymousNodes",
263   "getAttention","getAttentionWithCycleCount","getAttribute","getAttributeNode","getAttributeNodeNS","getAttributeNS",
264   "getBindingParent","getBookmark","getBoundingClientRect","getBoxObjectFor","getCharset","getClientRects",
265   "getComputedStyle","getContext","getCounterValue","getData","getElementById","getElementsByName","getElementsByTagName",
266   "getElementsByTagNameNS","getExpression","getFeature","getFloatValue","getName","getNamedItem","getNamedItemNS",
267   "getNamespaceURI","getOverrideStyle","getParameter","getPreventDefault","getPropertyCSSValue","getPropertyPriority",
268   "getPropertyValue","getRangeAt","getRectValue","getResponseHeader","getRGBColorValue","getSelection","getStringValue",
269   "getSVGDocument","getUserData","go","hasAttribute","hasAttributeNS","hasAttributes","hasChildNodes","hasFeature",
270   "hasFocus","hide","home","ImportExportFavorites","importNode","importStylesheet","Init","initEvent","initKeyEvent",
271   "initMouseEvent","initMutationEvent","initPageTransitionEvent","initPopupBlockedEvent","initUIEvent","inRange",
272   "insertNode","insertAdjacentElement","insertAdjacentHTML","insertAdjacentText","insertBefore","insertCell","insertData",
273   "insertRow","insertRule","intersectsNode","isDefaultNamespace","isEqual","isEqualNode","isPointInRange","isSameNode",
274   "IsSubscribed","isSupported","item","Item","iterateNext","javaEnabled","lastPage","lineTo","load","loadAsync",
275   "loadBindingDocument","loadOverlay","lookupNamespaceURI","lookupPrefix","maximize","mergeAttributes","minimize",
276   "move","moveBy","moveEnd","moveRow","moveStart","moveTo","moveToBookmark","moveToElementText","moveToPoint",
277   "namedItem","namedRecordset","navigate","NavigateAndFind","nextNode","nextPage","normalize","normalizeDocument",
278   "nSDetach","open","openDialog","openRequest","overrideMimeType","parentElement","parseFromBuffer","parseFromStream",
279   "parseFromString","pasteHTML","preference","preventBubble","preventCapture","preventDefault","previousNode",
280   "previousPage","print","processSchemaElement","prompt","quadraticCurveTo","queryCommandEnabled","queryCommandIndeterm",
281   "queryCommandState","queryCommandSupported","queryCommandText","queryCommandValue","recalc","rect","refresh",
282   "releaseCapture","releaseEvents","reload","remove","removeAllRanges","removeAttribute","removeAttributeNode",
283   "removeAttributeNS","removeBehavior","removeBinding","removeChild","removeEventListener","removeExpression",
284   "removeNamedItem","removeNamedItemNS","removeNode","removeParameter","removeProperty","removeRange","removeRule",
285   "renameNode","replace","replaceAdjacentText","replaceChild","replaceData","replaceNode","reset","resizeBy",
286   "resizeTo","restore","restoreImage","restoreImageTo","rotate","routeEvent","save","scale","scroll","scrollBy",
287   "scrollByLines","scrollByPages","scrollIntoView","scrollTo","select","selectAllChildren","selectionLanguageChange",
288   "selectNode","selectNodeContents","send","serializeToStream","serializeToString","setActive","setAttribute",
289   "setAttributeNode","setAttributeNodeNS","setAttributeNS","setBoxObjectFor","setCapture","setCursor","setData",
290   "setEnd","setEndAfter","setEndBefore","setEndPoint","setExpression","setFloatValue","setInterval","setNamedItem",
291   "setNamedItemNS","setParameter","setProperty","setPropertyPriority","setRequestHeader","setResizable",
292   "setSelectionRange","setStart","setStartAfter","setStartBefore","setStringValue","setTimeout","setUserData",
293   "show","ShowBrowserUI","showHelp","showModalDialog","showModelessDialog","shrinkToFit","sizeToContent",
294   "snapshotItem","splitText","start","stop","stopPropagation","stroke","strokeRect","submit","substringData",
295   "supports","surroundContents","swapNode","tags","taintEnabled","toggleImageSize","transformToDocument",
296   "transformToFragment","translate","unescape","updateCommands","urns","write","writeln",
297
298   # DHTML Event
299   "onabort","onactivate",
300   "onafterprint","onafterupdate","onbeforeactivate","onbeforecopy","onbeforecut","onbeforedeactivate","onbeforeeditfocus",
301   "onbeforepaste","onbeforeprint","onbeforeunload","onbeforeupdate","onblur","onbounce","oncellchange","onchange",
302   "onclick","onclose","oncontextmenu","oncontrolselect","oncopy","oncut","ondataavailable","ondatasetchanged",
303   "ondatasetcomplete","ondblclick","ondeactivate","ondrag","ondragdrop","ondragend","ondragenter","ondragleave",
304   "ondragover","ondragstart","ondrop","onerror","onerrorupdate","onfilterchange","onfinish","onfocus","onfocusin",
305   "onfocusout","onhelp","onkeydown","onkeypress","onkeyup","onlayoutcomplete","onload","onlosecapture","onmousedown",
306   "onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onmove","onmoveend",
307   "onmovestart","onpaint","onpaste","onprogress","onpropertychange","onreadystatechange","onreset","onresize",
308   "onresizeend","onresizestart","onrowenter","onrowexit","onrowsdelete","onrowsinserted","onscroll","onselect",
309   "onselectionchange","onselectstart","onstart","onstop","onsubmit","onunload",
310
311   # DHTML Collection
312   "all","anchors","applets","areas",
313   "attributes","behaviorUrns","blockFormats","bookmarks","boundElements","cells","childNodes","children","classes",
314   "Components","controllers","controlRange","elements","embeds","filters","fonts","forms","frames","ids","images",
315   "imports","interfaces","layers","links","mimeTypes","namespaces","options","pages","plugins","rows","rules","scripts",
316   "styleSheets","tBodies","TextRange","TextRectangle",
317
318   # IE Default Behavior
319   "anchorClick","anim","clientCaps","download","homePage","httpFolder",
320   "mediaBar","saveFavorite","saveHistory","saveSnapshot","userData",
321
322   # IE Default Behavior Object
323   "MediaItem","PlaylistInfo",
324
325   # IE Default Behavior Property
326   "attributeCount",
327   "availHeight","availWidth","bufferDepth","colorDepth","connectionType","cookieEnabled","cpuClass","currentItem",
328   "disabledUI","duration","enabled","expires","folder","hasNextItem","height","image","javaEnabled","name","nextItem",
329   "openState","platform","playlistInfo","playState","sound","sourceURL","statics","systemLanguage","target",
330   "userLanguage","width","XMLDocument",
331
332   # IE Default Behavior Method
333   "addComponentRequest","addDABehavior","clearComponentRequest","compareVersions",
334   "doComponentRequest","getAttribute","getAttributeName","getComponentVersion","getItemInfo","isComponentInstalled",
335   "isHomePage","load","navigate","navigateFrame","navigateHomePage","playNext","playURL","removeAttribute",
336   "removeDABehavior","save","setAttribute","setHomePage","startDownload","stop",
337
338   # IE Default Behavior Event
339   "onhide","onload","onopenstatechange",
340   "onplaystatechange","onsave","onshow",
341
342   # XMLHTTP Object Property
343   "onreadystatechange","readyState","responseBody","responseStream","responseText",
344   "responseXML","status","statusText",
345
346   # XMLHTTP Object Method
347   "abort","getAllResponseHeaders","getResponseHeader","open","send",
348   "setRequestHeader"
349 ]
350
351
352 def search(node, names):
353
354   if node.type == "assignment":
355     left = node.getChild("left", False)
356
357     if left:
358       variable = left.getChild("variable", False)
359
360       if variable:
361         last = variable.getLastChild()
362         first = variable.getFirstChild()
363
364         if last == first:
365           if last.type == "identifier":
366             pass
367
368         elif last.type == "identifier":
369           name = last.get("name")
370
371           ignore = False
372
373           if name in systemNames or name in qooxdooNames:
374             ignore = True
375
376           if not ignore:
377             for item in qooxdooStart:
378               if name.startswith(item):
379                 ignore = True
380
381           # only apply to names which starts with an underscore
382           if not name.startswith("_"):
383             ignore = True
384
385           if not ignore:
386             if not names.has_key(name):
387               # print "Add %s" % name
388
389               names[name] = 1
390             else:
391               names[name] += 1
392
393   if node.hasChildren():
394     for child in node.children:
395       search(child, names)
396
397   return names
398
399
400
401
402 def update(node, list, prefix):
403   counter = 0
404
405   if node.type == "identifier":
406     idenName = node.get("name", False)
407
408     if idenName != None and idenName in list:
409       replName = "%s%s" % (prefix, mapper.convert(list.index(idenName)))
410       node.set("name", replName)
411       counter += 1
412
413       # print "  - Replaced '%s' with '%s'" % (idenName, replName)
414
415   if node.hasChildren():
416     for child in node.children:
417       counter += update(child, list, prefix)
418
419   return counter
420
421
422
423 def sort(names):
424   temp = []
425
426   for name in names:
427     temp.append({ "name" : name, "number" : names[name] })
428
429   temp.sort(lambda x, y: y["number"]-x["number"])
430
431   list = []
432
433   for item in temp:
434     list.append(item["name"])
435
436   print "  * Found %s names" % len(list)
437
438   return list