diff --git a/.prettierignore b/.prettierignore index 23739656..56d06499 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,5 +2,5 @@ packages/webamp/demo/built/ packages/webamp/built/ -packages/webamp-modern-2/src/build/ -packages/webamp-modern-2/tools/eslint-rules/dist/ \ No newline at end of file +packages/webamp-modern/src/build/ +packages/webamp-modern/tools/eslint-rules/dist/ \ No newline at end of file diff --git a/deploy.sh b/deploy.sh index 905e9197..02e0737d 100755 --- a/deploy.sh +++ b/deploy.sh @@ -2,5 +2,5 @@ yarn workspace ani-cursor build yarn workspace webamp build yarn workspace webamp build-library -yarn workspace webamp-modern-2 build -mv packages/webamp-modern-2/src/build packages/webamp/demo/built/modern \ No newline at end of file +yarn workspace webamp-modern build +mv packages/webamp-modern/src/build packages/webamp/demo/built/modern \ No newline at end of file diff --git a/package.json b/package.json index f290ff15..0ec3bff3 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ ], "scripts": { "test": "jest", - "lint": "eslint . --ext ts,tsx,js,jsx --rulesdir=packages/webamp-modern-2/tools/eslint-rules", + "lint": "eslint . --ext ts,tsx,js,jsx --rulesdir=packages/webamp-modern/tools/eslint-rules", "deploy": "sh deploy.sh", "format": "prettier --write '**/*.{js,ts,tsx}'" }, diff --git a/packages/webamp-modern-2/.eslintignore b/packages/webamp-modern-2/.eslintignore deleted file mode 100644 index d1638636..00000000 --- a/packages/webamp-modern-2/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -build/ \ No newline at end of file diff --git a/packages/webamp-modern-2/.gitignore b/packages/webamp-modern-2/.gitignore deleted file mode 100644 index d1638636..00000000 --- a/packages/webamp-modern-2/.gitignore +++ /dev/null @@ -1 +0,0 @@ -build/ \ No newline at end of file diff --git a/packages/webamp-modern-2/README.md b/packages/webamp-modern-2/README.md deleted file mode 100644 index 8272b7f0..00000000 --- a/packages/webamp-modern-2/README.md +++ /dev/null @@ -1,67 +0,0 @@ -## Running locally - -Assuming you have [Yarn](https://yarnpkg.com/) installed: - -```bash -cd packages/webamp-modern-2 -yarn -yarn start -``` - -## Performance Improvements - -- [ ] We could use WebGL to try to improve the speed of switching gamma colors -- [ ] We could use some CSS techniques to avoid having to appply inline style to each BitmapFont character's DOM node. -- [ ] We should profile the parse phase to see what's taking time. Perhaps there's some sync image work that could be done lazily. -- [ ] Remove some paranoid validation in the VM. -- [ ] Consider throttling time updates coming from audio - -# TODO Next - -- [ ] Why doesn't scrolling work property in MMD3? -- [ ] Implement proper color - - [ ] Move gammacolor to GPU -- [ ] Requires VM - - [ ] Look at componentbucket (Where can I find the images) - - [ ] How is the scroll window for colors supposed to work? - - [ ] How is the position slider supposed to work? -- [ ] Standardize handling of different type condition permutations in interpreter -- [ ] Implement EQ -- [ ] Implament global actions - - [ ] TOGGLE - - [ ] MINIMIZE -- [ ] Allow for skins which don't have gamma sets -- [ ] Figure out if global NULL is actually typed as INT in Maki. I suspect there is no NULL type, but only an INT who happens to be zero. -- [ ] Fix all `// FIXME` -- [ ] SystemObject.getruntimeversion -- [ ] SystemObject.getskinname -- [ ] Handle clicking through transparent: https://stackoverflow.com/questions/38487569/click-through-png-image-only-if-clicked-coordinate-is-transparent - -# TODO Some day - -- [ ] Handle case (in)sensitivity of includes. -- [ ] Handle forward/backward slashes issues (if they exist) - -## Known Bugs - -- [ ] In GuiObj's handling of left click, it's possible for the y/x of the click event to fall outside of the element being clicked. To repro click just above the volume2 of MMD3. Y can be one pixel above the clientBoundingRect of the element. Why? - -# Phases of Initialization - -## Asset Parse - -Starting with `skin.xml`, and inlining each `` we parse XML. As we go, we initialize GUI objects and attach them to their parent. During this phase we also encounter other asset files like Maki script, images, and fonts. These are parsed as they are encountered and setaside into a look-aside table (Maki scripts might live in the tree...). - -This phase is `async` since it may require reading files from zip or doing image/font manipulation which is inherently `async`. - -## Object Initialization - -Once all look-aside tables are populated, we notify all GUI objects to initialize themselves by propogating from the root of the tree to the leaves. Each node is reponsible for notifying its children. In this phase components pull images/scripts/fonts out of their look-aside tables. [Question: Could these just be lazy?]. At this point we also hook up any event bindings/hooks that exist in Maki. - -## Maki Initialization - -Once all nodes have been initialized, we trigger/dispatch `System.onScriptLoaded` for each Maki script. - -## First paint - -Now we can begin panting diff --git a/packages/webamp-modern-2/objectData/stdPatched.js b/packages/webamp-modern-2/objectData/stdPatched.js deleted file mode 100644 index f5239c49..00000000 --- a/packages/webamp-modern-2/objectData/stdPatched.js +++ /dev/null @@ -1,63 +0,0 @@ -const std = require("./std.json"); - -const NAME_TO_DEF = {}; - -Object.values(std).forEach((value) => { - NAME_TO_DEF[value.name] = value; -}); - -function getMethod(className, methodName) { - return NAME_TO_DEF[className].functions.find(({ name }) => { - return name === methodName; - }); -} - -// Between myself and the author of the decompiler, a number of manual tweaks -// have been made to our current object definitions. This function recreates -// those tweaks so we can have an apples to apples comparison. - -/* - * From object.js - * - * > The std.mi has this set as void, but we checked in Winamp and confirmed it - * > returns 0/1 - */ -getMethod("Timer", "isRunning").result = "boolean"; - -/* - * From Object.pm - * - * > note, std.mi does not have this parameter! - */ -getMethod("ToggleButton", "onToggle").parameters[0][1] = "onoff"; - -// Some methods are not compatible with the type signature of their parent class -getMethod("GuiTree", "onChar").parameters[0][0] = "string"; -getMethod("GuiList", "onSetVisible").parameters[0][0] = "boolean"; - -// I'm not sure how to get these to match -getMethod("Wac", "onNotify").parameters = getMethod( - "Object", - "onNotify" -).parameters; -getMethod("Wac", "onNotify").result = "int"; - -/* - -Here's the error we get without that patch: - -__generated__/makiInterfaces.ts:254:18 - error TS2430: Interface 'Wac' incorrectly extends interface 'MakiObject'. - Types of property 'onnotify' are incompatible. - Type '(notifstr: string, a: number, b: number) => void' is not assignable to type '(command: string, param: string, a: number, b: number) => number'. - Types of parameters 'a' and 'param' are incompatible. - Type 'string' is not assignable to type 'number'. - -254 export interface Wac extends MakiObject { - ~~~ - - -Found 1 error. - - */ - -module.exports = std; diff --git a/packages/webamp-modern-2/package.json b/packages/webamp-modern-2/package.json deleted file mode 100644 index fd4bedb0..00000000 --- a/packages/webamp-modern-2/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "webamp-modern-2", - "version": "1.0.0", - "main": "index.js", - "license": "MIT", - "scripts": { - "start": "snowpack dev", - "build": "snowpack build", - "lint": "yarn build-lint && eslint . --ext .js,.jsx,.ts,.tsx", - "test": "yarn jest", - "build-lint": "tsup tools/eslint-rules/proper-maki-types.ts -d tools/eslint-rules/dist --no-splitting --minify" - }, - "devDependencies": { - "@types/eslint": "^7.2.14", - "@types/estree": "^0.0.50", - "@typescript-eslint/eslint-plugin": "^4.28.2", - "@typescript-eslint/parser": "^4.28.2", - "eslint": "^7.30.0", - "eslint-plugin-rulesdir": "^0.2.0", - "snowpack": "^3.5.5", - "tsup": "^4.12.5", - "typescript": "^4.3.5" - }, - "prettier": {}, - "dependencies": { - "@rgrove/parse-xml": "^3.0.0", - "jszip": "^3.6.0" - } -} diff --git a/packages/webamp-modern-2/src/maki/objectData/config.json b/packages/webamp-modern-2/src/maki/objectData/config.json deleted file mode 100644 index 9c70d82b..00000000 --- a/packages/webamp-modern-2/src/maki/objectData/config.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "593DBA22D0774976B952F4713655400B": { - "parent": "Object", - "functions": [ - { - "result": "ConfigItem", - "name": "getItem", - "parameters": [ - [ - "String", - "item_name" - ] - ] - }, - { - "result": "ConfigItem", - "name": "getItemByGuid", - "parameters": [ - [ - "String", - "item_guid" - ] - ] - }, - { - "result": "ConfigItem", - "name": "newItem", - "parameters": [ - [ - "String", - "item_name" - ], - [ - "String", - "item_guid" - ] - ] - } - ], - "name": "Config" - }, - "D40302823AAB4d87878D12326FADFCD5": { - "parent": "Object", - "functions": [ - { - "result": "ConfigAttribute", - "name": "getAttribute", - "parameters": [ - [ - "String", - "attr_name" - ] - ] - }, - { - "result": "ConfigAttribute", - "name": "newAttribute", - "parameters": [ - [ - "String", - "attr_name" - ], - [ - "String", - "default_value" - ] - ] - }, - { - "result": "String", - "name": "getGuid", - "parameters": [ - [ - "String", - "attr_name" - ] - ] - }, - { - "result": "String", - "name": "getName", - "parameters": [] - } - ], - "name": "ConfigItem" - }, - "24DEC283B76E4a368CCC9E24C46B6C73": { - "parent": "Object", - "functions": [ - { - "result": "", - "name": "setData", - "parameters": [ - [ - "String", - "value" - ] - ] - }, - { - "result": "String", - "name": "getData", - "parameters": [] - }, - { - "result": "", - "name": "onDataChanged", - "parameters": [] - }, - { - "result": "ConfigItem", - "name": "getParentItem", - "parameters": [] - }, - { - "result": "String", - "name": "getAttributeName", - "parameters": [] - } - ], - "name": "ConfigAttribute" - } -} \ No newline at end of file diff --git a/packages/webamp-modern-2/src/maki/objectData/pldir.json b/packages/webamp-modern-2/src/maki/objectData/pldir.json deleted file mode 100644 index d96969fa..00000000 --- a/packages/webamp-modern-2/src/maki/objectData/pldir.json +++ /dev/null @@ -1,269 +0,0 @@ -{ - "345BEEBC0229492190BE6CB6A49A79D9": { - "parent": "Object", - "functions": [ - { - "result": "int", - "name": "getNumTracks", - "parameters": [] - }, - { - "result": "int", - "name": "getCurrentIndex", - "parameters": [] - }, - { - "result": "int", - "name": "getNumSelectedTracks", - "parameters": [] - }, - { - "result": "int", - "name": "getNextSelectedTrack", - "parameters": [ - [ - "int", - "i" - ] - ] - }, - { - "result": "", - "name": "showCurrentlyPlayingTrack", - "parameters": [] - }, - { - "result": "", - "name": "showTrack", - "parameters": [ - [ - "int", - "item" - ] - ] - }, - { - "result": "", - "name": "enqueueFile", - "parameters": [ - [ - "string", - "file" - ] - ] - }, - { - "result": "", - "name": "clear", - "parameters": [] - }, - { - "result": "", - "name": "removeTrack", - "parameters": [ - [ - "int", - "item" - ] - ] - }, - { - "result": "", - "name": "swapTracks", - "parameters": [ - [ - "int", - "item1" - ], - [ - "int", - "item2" - ] - ] - }, - { - "result": "", - "name": "moveUp", - "parameters": [ - [ - "int", - "item" - ] - ] - }, - { - "result": "", - "name": "moveDown", - "parameters": [ - [ - "int", - "item" - ] - ] - }, - { - "result": "", - "name": "moveTo", - "parameters": [ - [ - "int", - "item" - ], - [ - "int", - "pos" - ] - ] - }, - { - "result": "", - "name": "playTrack", - "parameters": [ - [ - "int", - "item" - ] - ] - }, - { - "result": "int", - "name": "getRating", - "parameters": [ - [ - "int", - "item" - ] - ] - }, - { - "result": "", - "name": "setRating", - "parameters": [ - [ - "int", - "item" - ], - [ - "int", - "rating" - ] - ] - }, - { - "result": "String", - "name": "getTitle", - "parameters": [ - [ - "int", - "item" - ] - ] - }, - { - "result": "String", - "name": "getLength", - "parameters": [ - [ - "int", - "item" - ] - ] - }, - { - "result": "String", - "name": "getMetaData", - "parameters": [ - [ - "int", - "item" - ], - [ - "String", - "metadatastring" - ] - ] - }, - { - "result": "String", - "name": "getFileName", - "parameters": [ - [ - "int", - "item" - ] - ] - }, - { - "result": "", - "name": "onPleditModified", - "parameters": [] - } - ], - "name": "PlEdit" - }, - "61A7ABAD7D7941f6B1D0E1808603A4F4": { - "parent": "Object", - "functions": [ - { - "result": "int", - "name": "getNumItems", - "parameters": [] - }, - { - "result": "String", - "name": "getItemName", - "parameters": [ - [ - "int", - "item" - ] - ] - }, - { - "result": "", - "name": "showCurrentlyPlayingEntry", - "parameters": [] - }, - { - "result": "", - "name": "refresh", - "parameters": [] - }, - { - "result": "", - "name": "renameItem", - "parameters": [ - [ - "int", - "item" - ], - [ - "String", - "name" - ] - ] - }, - { - "result": "", - "name": "enqueueItem", - "parameters": [ - [ - "int", - "item" - ] - ] - }, - { - "result": "", - "name": "playItem", - "parameters": [ - [ - "int", - "item" - ] - ] - } - ], - "name": "PlDir" - } -} \ No newline at end of file diff --git a/packages/webamp-modern-2/src/maki/objectData/std.json b/packages/webamp-modern-2/src/maki/objectData/std.json deleted file mode 100644 index 3b71bd72..00000000 --- a/packages/webamp-modern-2/src/maki/objectData/std.json +++ /dev/null @@ -1,7243 +0,0 @@ -{ - "516549710D874a5191E3A6B53235F3E7": { - "parent": "@{00000000-0000-0000-0000-000000000000}@", - "functions": [ - { - "result": "String", - "name": "getClassName", - "parameters": [] - }, - { - "result": "String", - "name": "getId", - "parameters": [] - }, - { - "result": "Int", - "name": "onNotify", - "parameters": [ - [ - "String", - "command" - ], - [ - "String", - "param" - ], - [ - "int", - "a" - ], - [ - "int", - "b" - ] - ] - } - ], - "name": "Object" - }, - "D6F50F6493FA49b793F1BA66EFAE3E98": { - "parent": "Object", - "functions": [ - { - "result": "", - "name": "onScriptLoaded", - "parameters": [] - }, - { - "result": "", - "name": "onScriptUnloading", - "parameters": [] - }, - { - "result": "", - "name": "onQuit", - "parameters": [] - }, - { - "result": "", - "name": "onSetXuiParam", - "parameters": [ - [ - "String", - "param" - ], - [ - "String", - "value" - ] - ] - }, - { - "result": "", - "name": "onKeyDown", - "parameters": [ - [ - "String", - "key" - ] - ] - }, - { - "result": "", - "name": "onAccelerator", - "parameters": [ - [ - "String", - "action" - ], - [ - "String", - "section" - ], - [ - "String", - "key" - ] - ] - }, - { - "result": "", - "name": "onCreateLayout", - "parameters": [ - [ - "Layout", - "_layout" - ] - ] - }, - { - "result": "", - "name": "onShowLayout", - "parameters": [ - [ - "Layout", - "_layout" - ] - ] - }, - { - "result": "", - "name": "onHideLayout", - "parameters": [ - [ - "Layout", - "_layout" - ] - ] - }, - { - "result": "", - "name": "onViewPortChanged", - "parameters": [ - [ - "int", - "width" - ], - [ - "int", - "height" - ] - ] - }, - { - "result": "", - "name": "onStop", - "parameters": [] - }, - { - "result": "", - "name": "onPlay", - "parameters": [] - }, - { - "result": "", - "name": "onPause", - "parameters": [] - }, - { - "result": "", - "name": "onResume", - "parameters": [] - }, - { - "result": "", - "name": "onTitleChange", - "parameters": [ - [ - "String", - "newtitle" - ] - ] - }, - { - "result": "", - "name": "onTitle2Change", - "parameters": [ - [ - "String", - "newtitle2" - ] - ] - }, - { - "result": "", - "name": "onUrlChange", - "parameters": [ - [ - "String", - "url" - ] - ] - }, - { - "result": "", - "name": "onInfoChange", - "parameters": [ - [ - "String", - "info" - ] - ] - }, - { - "result": "", - "name": "onStatusMsg", - "parameters": [ - [ - "String", - "msg" - ] - ] - }, - { - "result": "", - "name": "onEqBandChanged", - "parameters": [ - [ - "int", - "band" - ], - [ - "int", - "newvalue" - ] - ] - }, - { - "result": "", - "name": "onEqPreampChanged", - "parameters": [ - [ - "int", - "newvalue" - ] - ] - }, - { - "result": "", - "name": "onEqChanged", - "parameters": [ - [ - "int", - "newstatus" - ] - ] - }, - { - "result": "", - "name": "onEqFreqChanged", - "parameters": [ - [ - "int", - "isiso" - ] - ] - }, - { - "result": "", - "name": "onVolumeChanged", - "parameters": [ - [ - "int", - "newvol" - ] - ] - }, - { - "result": "", - "name": "onSeek", - "parameters": [ - [ - "int", - "newpos" - ] - ] - }, - { - "result": "Container", - "name": "getContainer", - "parameters": [ - [ - "String", - "container_id" - ] - ] - }, - { - "result": "Container", - "name": "newDynamicContainer", - "parameters": [ - [ - "String", - "container_id" - ] - ] - }, - { - "result": "Group", - "name": "newGroup", - "parameters": [ - [ - "String", - "group_id" - ] - ] - }, - { - "result": "Layout", - "name": "newGroupAsLayout", - "parameters": [ - [ - "String", - "group_id" - ] - ] - }, - { - "result": "Int", - "name": "getNumContainers", - "parameters": [] - }, - { - "result": "Container", - "name": "enumContainer", - "parameters": [ - [ - "Int", - "num" - ] - ] - }, - { - "result": "String", - "name": "enumEmbedGUID", - "parameters": [ - [ - "int", - "num" - ] - ] - }, - { - "result": "Wac", - "name": "getWac", - "parameters": [ - [ - "String", - "wac_guid" - ] - ] - }, - { - "result": "Int", - "name": "messageBox", - "parameters": [ - [ - "String", - "message" - ], - [ - "String", - "msgtitle" - ], - [ - "Int", - "flag" - ], - [ - "String", - "notanymore_id" - ] - ] - }, - { - "result": "String", - "name": "getPlayItemString", - "parameters": [] - }, - { - "result": "Int", - "name": "getPlayItemLength", - "parameters": [] - }, - { - "result": "String", - "name": "getPlayItemMetaDataString", - "parameters": [ - [ - "String", - "metadataname" - ] - ] - }, - { - "result": "String", - "name": "getMetaDataString", - "parameters": [ - [ - "String", - "filename" - ], - [ - "String", - "metadataname" - ] - ] - }, - { - "result": "String", - "name": "getPlayItemDisplayTitle", - "parameters": [] - }, - { - "result": "Int", - "name": "getCurrentTrackRating", - "parameters": [] - }, - { - "result": "", - "name": "onCurrentTrackRated", - "parameters": [ - [ - "int", - "rating" - ] - ] - }, - { - "result": "", - "name": "setCurrentTrackRating", - "parameters": [ - [ - "int", - "rating" - ] - ] - }, - { - "result": "String", - "name": "getExtFamily", - "parameters": [ - [ - "String", - "ext" - ] - ] - }, - { - "result": "String", - "name": "getDecoderName", - "parameters": [ - [ - "string", - "playitem" - ] - ] - }, - { - "result": "", - "name": "playFile", - "parameters": [ - [ - "String", - "playitem" - ] - ] - }, - { - "result": "Int", - "name": "getAlbumArt", - "parameters": [ - [ - "String", - "playitem" - ] - ] - }, - { - "result": "", - "name": "downloadMedia", - "parameters": [ - [ - "String", - "url" - ], - [ - "String", - "destinationPath" - ], - [ - "boolean", - "wantAddToML" - ], - [ - "boolean", - "notifyDownloadsList" - ] - ] - }, - { - "result": "", - "name": "downloadURL", - "parameters": [ - [ - "String", - "url" - ], - [ - "String", - "destination_filename" - ], - [ - "String", - "progress_dialog_title" - ] - ] - }, - { - "result": "", - "name": "onDownloadFinished", - "parameters": [ - [ - "String", - "url" - ], - [ - "boolean", - "success" - ], - [ - "String", - "filename" - ] - ] - }, - { - "result": "String", - "name": "getDownloadPath", - "parameters": [] - }, - { - "result": "", - "name": "setDownloadPath", - "parameters": [ - [ - "String", - "new_path" - ] - ] - }, - { - "result": "", - "name": "enqueueFile", - "parameters": [ - [ - "String", - "playitem" - ] - ] - }, - { - "result": "Int", - "name": "getLeftVuMeter", - "parameters": [] - }, - { - "result": "Int", - "name": "getRightVuMeter", - "parameters": [] - }, - { - "result": "Int", - "name": "getVolume", - "parameters": [] - }, - { - "result": "", - "name": "setVolume", - "parameters": [ - [ - "Int", - "vol" - ] - ] - }, - { - "result": "", - "name": "play", - "parameters": [] - }, - { - "result": "", - "name": "stop", - "parameters": [] - }, - { - "result": "", - "name": "pause", - "parameters": [] - }, - { - "result": "", - "name": "next", - "parameters": [] - }, - { - "result": "", - "name": "previous", - "parameters": [] - }, - { - "result": "", - "name": "eject", - "parameters": [] - }, - { - "result": "", - "name": "seekTo", - "parameters": [ - [ - "Int", - "pos" - ] - ] - }, - { - "result": "Int", - "name": "getPosition", - "parameters": [] - }, - { - "result": "", - "name": "setEqBand", - "parameters": [ - [ - "int", - "band" - ], - [ - "Int", - "value" - ] - ] - }, - { - "result": "", - "name": "setEqPreamp", - "parameters": [ - [ - "Int", - "value" - ] - ] - }, - { - "result": "", - "name": "setEq", - "parameters": [ - [ - "Int", - "onoff" - ] - ] - }, - { - "result": "Int", - "name": "getEqBand", - "parameters": [ - [ - "int", - "band" - ] - ] - }, - { - "result": "int", - "name": "getEqPreamp", - "parameters": [] - }, - { - "result": "int", - "name": "getEq", - "parameters": [] - }, - { - "result": "int", - "name": "getMousePosX", - "parameters": [] - }, - { - "result": "int", - "name": "getMousePosY", - "parameters": [] - }, - { - "result": "String", - "name": "integerToString", - "parameters": [ - [ - "Int", - "value" - ] - ] - }, - { - "result": "Int", - "name": "StringToInteger", - "parameters": [ - [ - "String", - "str" - ] - ] - }, - { - "result": "String", - "name": "floatToString", - "parameters": [ - [ - "float", - "value" - ], - [ - "int", - "ndigits" - ] - ] - }, - { - "result": "Float", - "name": "stringToFloat", - "parameters": [ - [ - "String", - "str" - ] - ] - }, - { - "result": "String", - "name": "integerToLongTime", - "parameters": [ - [ - "Int", - "value" - ] - ] - }, - { - "result": "String", - "name": "integerToTime", - "parameters": [ - [ - "Int", - "value" - ] - ] - }, - { - "result": "String", - "name": "dateToTime", - "parameters": [ - [ - "Int", - "datetime" - ] - ] - }, - { - "result": "String", - "name": "dateToLongTime", - "parameters": [ - [ - "Int", - "datetime" - ] - ] - }, - { - "result": "String", - "name": "formatDate", - "parameters": [ - [ - "Int", - "datetime" - ] - ] - }, - { - "result": "String", - "name": "formatLongDate", - "parameters": [ - [ - "Int", - "datetime" - ] - ] - }, - { - "result": "Int", - "name": "getDateYear", - "parameters": [ - [ - "Int", - "datetime" - ] - ] - }, - { - "result": "Int", - "name": "getDateMonth", - "parameters": [ - [ - "Int", - "datetime" - ] - ] - }, - { - "result": "Int", - "name": "getDateDay", - "parameters": [ - [ - "Int", - "datetime" - ] - ] - }, - { - "result": "Int", - "name": "getDateDow", - "parameters": [ - [ - "Int", - "datetime" - ] - ] - }, - { - "result": "Int", - "name": "getDateDoy", - "parameters": [ - [ - "Int", - "datetime" - ] - ] - }, - { - "result": "Int", - "name": "getDateHour", - "parameters": [ - [ - "Int", - "datetime" - ] - ] - }, - { - "result": "Int", - "name": "getDateMin", - "parameters": [ - [ - "Int", - "datetime" - ] - ] - }, - { - "result": "Int", - "name": "getDateSec", - "parameters": [ - [ - "Int", - "datetime" - ] - ] - }, - { - "result": "Int", - "name": "getDateDst", - "parameters": [ - [ - "Int", - "datetime" - ] - ] - }, - { - "result": "Int", - "name": "getDate", - "parameters": [] - }, - { - "result": "String", - "name": "strmid", - "parameters": [ - [ - "String", - "str" - ], - [ - "Int", - "start" - ], - [ - "Int", - "len" - ] - ] - }, - { - "result": "String", - "name": "strleft", - "parameters": [ - [ - "string", - "str" - ], - [ - "int", - "nchars" - ] - ] - }, - { - "result": "string", - "name": "strright", - "parameters": [ - [ - "string", - "str" - ], - [ - "int", - "nchars" - ] - ] - }, - { - "result": "int", - "name": "strsearch", - "parameters": [ - [ - "string", - "str" - ], - [ - "string", - "substr" - ] - ] - }, - { - "result": "int", - "name": "strlen", - "parameters": [ - [ - "string", - "str" - ] - ] - }, - { - "result": "string", - "name": "strupper", - "parameters": [ - [ - "string", - "str" - ] - ] - }, - { - "result": "string", - "name": "strlower", - "parameters": [ - [ - "string", - "str" - ] - ] - }, - { - "result": "string", - "name": "urlEncode", - "parameters": [ - [ - "string", - "url" - ] - ] - }, - { - "result": "string", - "name": "urlDecode", - "parameters": [ - [ - "string", - "url" - ] - ] - }, - { - "result": "string", - "name": "parseATF", - "parameters": [ - [ - "string", - "topass" - ] - ] - }, - { - "result": "string", - "name": "removePath", - "parameters": [ - [ - "string", - "str" - ] - ] - }, - { - "result": "string", - "name": "getPath", - "parameters": [ - [ - "string", - "str" - ] - ] - }, - { - "result": "string", - "name": "getExtension", - "parameters": [ - [ - "string", - "str" - ] - ] - }, - { - "result": "string", - "name": "getToken", - "parameters": [ - [ - "string", - "str" - ], - [ - "string", - "separator" - ], - [ - "int", - "tokennum" - ] - ] - }, - { - "result": "double", - "name": "sin", - "parameters": [ - [ - "double", - "value" - ] - ] - }, - { - "result": "double", - "name": "cos", - "parameters": [ - [ - "double", - "value" - ] - ] - }, - { - "result": "double", - "name": "tan", - "parameters": [ - [ - "double", - "value" - ] - ] - }, - { - "result": "double", - "name": "asin", - "parameters": [ - [ - "double", - "value" - ] - ] - }, - { - "result": "double", - "name": "acos", - "parameters": [ - [ - "double", - "value" - ] - ] - }, - { - "result": "double", - "name": "atan", - "parameters": [ - [ - "double", - "value" - ] - ] - }, - { - "result": "double", - "name": "atan2", - "parameters": [ - [ - "double", - "y" - ], - [ - "double", - "x" - ] - ] - }, - { - "result": "double", - "name": "pow", - "parameters": [ - [ - "double", - "value" - ], - [ - "double", - "pvalue" - ] - ] - }, - { - "result": "double", - "name": "sqr", - "parameters": [ - [ - "double", - "value" - ] - ] - }, - { - "result": "double", - "name": "log10", - "parameters": [ - [ - "double", - "value" - ] - ] - }, - { - "result": "double", - "name": "ln", - "parameters": [ - [ - "double", - "value" - ] - ] - }, - { - "result": "double", - "name": "sqrt", - "parameters": [ - [ - "double", - "value" - ] - ] - }, - { - "result": "int", - "name": "random", - "parameters": [ - [ - "int", - "max" - ] - ] - }, - { - "result": "", - "name": "setPrivateString", - "parameters": [ - [ - "string", - "section" - ], - [ - "string", - "item" - ], - [ - "string", - "value" - ] - ] - }, - { - "result": "", - "name": "setPrivateInt", - "parameters": [ - [ - "string", - "section" - ], - [ - "string", - "item" - ], - [ - "int", - "value" - ] - ] - }, - { - "result": "String", - "name": "getPrivateString", - "parameters": [ - [ - "String", - "section" - ], - [ - "String", - "item" - ], - [ - "String", - "defvalue" - ] - ] - }, - { - "result": "Int", - "name": "getPrivateInt", - "parameters": [ - [ - "String", - "section" - ], - [ - "String", - "item" - ], - [ - "Int", - "defvalue" - ] - ] - }, - { - "result": "", - "name": "setPublicString", - "parameters": [ - [ - "String", - "item" - ], - [ - "String", - "value" - ] - ] - }, - { - "result": "", - "name": "setPublicInt", - "parameters": [ - [ - "String", - "item" - ], - [ - "Int", - "value" - ] - ] - }, - { - "result": "String", - "name": "getPublicString", - "parameters": [ - [ - "String", - "item" - ], - [ - "String", - "defvalue" - ] - ] - }, - { - "result": "Int", - "name": "getPublicInt", - "parameters": [ - [ - "String", - "item" - ], - [ - "Int", - "defvalue" - ] - ] - }, - { - "result": "String", - "name": "getParam", - "parameters": [] - }, - { - "result": "Group", - "name": "getScriptGroup", - "parameters": [] - }, - { - "result": "Int", - "name": "getViewportWidth", - "parameters": [] - }, - { - "result": "Int", - "name": "getViewportWidthFromGuiObject", - "parameters": [ - [ - "GuiObject", - "g" - ] - ] - }, - { - "result": "Int", - "name": "getViewportWidthFromPoint", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - }, - { - "result": "Int", - "name": "getMonitorWidth", - "parameters": [] - }, - { - "result": "Int", - "name": "getMonitorWidthFromPoint", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - }, - { - "result": "Int", - "name": "getMonitorWidthFromGuiObject", - "parameters": [ - [ - "GuiObject", - "g" - ] - ] - }, - { - "result": "", - "name": "onMouseMove", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - }, - { - "result": "Int", - "name": "getViewportHeight", - "parameters": [] - }, - { - "result": "Int", - "name": "getViewportHeightFromGuiObject", - "parameters": [ - [ - "GuiObject", - "g" - ] - ] - }, - { - "result": "Int", - "name": "getViewportHeightFromPoint", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - }, - { - "result": "Int", - "name": "getMonitorHeight", - "parameters": [] - }, - { - "result": "Int", - "name": "getMonitorHeightFromPoint", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - }, - { - "result": "Int", - "name": "getMonitorHeightFromGuiObject", - "parameters": [ - [ - "GuiObject", - "g" - ] - ] - }, - { - "result": "Int", - "name": "getMonitorLeft", - "parameters": [] - }, - { - "result": "Int", - "name": "getMonitorLeftFromGuiObject", - "parameters": [ - [ - "GuiObject", - "g" - ] - ] - }, - { - "result": "Int", - "name": "getMonitorLeftFromPoint", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - }, - { - "result": "Int", - "name": "getMonitorTop", - "parameters": [] - }, - { - "result": "Int", - "name": "getMonitorTopFromGuiObject", - "parameters": [ - [ - "GuiObject", - "g" - ] - ] - }, - { - "result": "Int", - "name": "getMonitorTopFromPoint", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - }, - { - "result": "Int", - "name": "getViewportLeft", - "parameters": [] - }, - { - "result": "Int", - "name": "getViewportLeftFromGuiObject", - "parameters": [ - [ - "GuiObject", - "g" - ] - ] - }, - { - "result": "Int", - "name": "getViewportLeftFromPoint", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - }, - { - "result": "Int", - "name": "getViewportTop", - "parameters": [] - }, - { - "result": "Int", - "name": "getViewportTopFromGuiObject", - "parameters": [ - [ - "GuiObject", - "g" - ] - ] - }, - { - "result": "Int", - "name": "getViewportTopFromPoint", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - }, - { - "result": "", - "name": "debugString", - "parameters": [ - [ - "String", - "str" - ], - [ - "Int", - "severity" - ] - ] - }, - { - "result": "", - "name": "ddeSend", - "parameters": [ - [ - "String", - "application" - ], - [ - "String", - "command" - ], - [ - "Int", - "mininterval" - ] - ] - }, - { - "result": "WindowHolder", - "name": "onLookForComponent", - "parameters": [ - [ - "String", - "guid" - ] - ] - }, - { - "result": "Int", - "name": "getCurAppLeft", - "parameters": [] - }, - { - "result": "Int", - "name": "getCurAppTop", - "parameters": [] - }, - { - "result": "Int", - "name": "getCurAppWidth", - "parameters": [] - }, - { - "result": "Int", - "name": "getCurAppHeight", - "parameters": [] - }, - { - "result": "Boolean", - "name": "isAppActive", - "parameters": [] - }, - { - "result": "String", - "name": "getSkinName", - "parameters": [] - }, - { - "result": "", - "name": "switchSkin", - "parameters": [ - [ - "String", - "skinname" - ] - ] - }, - { - "result": "Int", - "name": "isLoadingSkin", - "parameters": [] - }, - { - "result": "", - "name": "lockUI", - "parameters": [] - }, - { - "result": "", - "name": "unlockUI", - "parameters": [] - }, - { - "result": "Browser", - "name": "getMainBrowser", - "parameters": [] - }, - { - "result": "", - "name": "popMainBrowser", - "parameters": [] - }, - { - "result": "", - "name": "navigateUrl", - "parameters": [ - [ - "String", - "url" - ] - ] - }, - { - "result": "", - "name": "navigateUrlBrowser", - "parameters": [ - [ - "String", - "url" - ] - ] - }, - { - "result": "Boolean", - "name": "onOpenURL", - "parameters": [ - [ - "string", - "url" - ] - ] - }, - { - "result": "Boolean", - "name": "isObjectValid", - "parameters": [ - [ - "Object", - "o" - ] - ] - }, - { - "result": "Int", - "name": "integer", - "parameters": [ - [ - "Double", - "d" - ] - ] - }, - { - "result": "Double", - "name": "frac", - "parameters": [ - [ - "Double", - "d" - ] - ] - }, - { - "result": "Int", - "name": "getTimeOfDay", - "parameters": [] - }, - { - "result": "", - "name": "setMenuTransparency", - "parameters": [ - [ - "int", - "alphavalue" - ] - ] - }, - { - "result": "Boolean", - "name": "onGetCancelComponent", - "parameters": [ - [ - "String", - "guid" - ], - [ - "boolean", - "goingvisible" - ] - ] - }, - { - "result": "Int", - "name": "getStatus", - "parameters": [] - }, - { - "result": "Int", - "name": "isKeyDown", - "parameters": [ - [ - "int", - "vk_code" - ] - ] - }, - { - "result": "", - "name": "setClipboardText", - "parameters": [ - [ - "String", - "_text" - ] - ] - }, - { - "result": "String", - "name": "Chr", - "parameters": [ - [ - "Int", - "charnum" - ] - ] - }, - { - "result": "String", - "name": "translate", - "parameters": [ - [ - "String", - "str" - ] - ] - }, - { - "result": "String", - "name": "getString", - "parameters": [ - [ - "String", - "table" - ], - [ - "int", - "id" - ] - ] - }, - { - "result": "String", - "name": "getLanguageId", - "parameters": [] - }, - { - "result": "String", - "name": "selectFile", - "parameters": [ - [ - "String", - "extlist" - ], - [ - "String", - "id" - ], - [ - "String", - "prev_filename" - ] - ] - }, - { - "result": "String", - "name": "selectFolder", - "parameters": [ - [ - "String", - "wnd_title" - ], - [ - "String", - "wnd_info" - ], - [ - "String", - "default_path" - ] - ] - }, - { - "result": "", - "name": "systemMenu", - "parameters": [] - }, - { - "result": "", - "name": "windowMenu", - "parameters": [] - }, - { - "result": "", - "name": "triggerAction", - "parameters": [ - [ - "GuiObject", - "context" - ], - [ - "String", - "actionname" - ], - [ - "String", - "actionparam" - ] - ] - }, - { - "result": "GuiObject", - "name": "showWindow", - "parameters": [ - [ - "String", - "guidorgroupid" - ], - [ - "String", - "preferedcontainer" - ], - [ - "Boolean", - "transient" - ] - ] - }, - { - "result": "", - "name": "hideWindow", - "parameters": [ - [ - "GuiObject", - "hw" - ] - ] - }, - { - "result": "", - "name": "hideNamedWindow", - "parameters": [ - [ - "String", - "guidorgroup" - ] - ] - }, - { - "result": "Boolean", - "name": "isNamedWindowVisible", - "parameters": [ - [ - "String", - "guidorgroup" - ] - ] - }, - { - "result": "", - "name": "setAtom", - "parameters": [ - [ - "String", - "atomname" - ], - [ - "Object", - "object" - ] - ] - }, - { - "result": "Object", - "name": "getAtom", - "parameters": [ - [ - "String", - "atomname" - ] - ] - }, - { - "result": "", - "name": "invokeDebugger", - "parameters": [] - }, - { - "result": "int", - "name": "hasVideoSupport", - "parameters": [] - }, - { - "result": "Int", - "name": "isVideo", - "parameters": [] - }, - { - "result": "Int", - "name": "isVideoFullscreen", - "parameters": [] - }, - { - "result": "Int", - "name": "getIdealVideoWidth", - "parameters": [] - }, - { - "result": "Int", - "name": "getIdealVideoHeight", - "parameters": [] - }, - { - "result": "Int", - "name": "isMinimized", - "parameters": [] - }, - { - "result": "", - "name": "minimizeApplication", - "parameters": [] - }, - { - "result": "", - "name": "restoreApplication", - "parameters": [] - }, - { - "result": "", - "name": "activateApplication", - "parameters": [] - }, - { - "result": "Int", - "name": "getPlaylistLength", - "parameters": [] - }, - { - "result": "Int", - "name": "getPlaylistIndex", - "parameters": [] - }, - { - "result": "", - "name": "clearPlaylist", - "parameters": [] - }, - { - "result": "Boolean", - "name": "isDesktopAlphaAvailable", - "parameters": [] - }, - { - "result": "Boolean", - "name": "isTransparencyAvailable", - "parameters": [] - }, - { - "result": "Int", - "name": "onShowNotification", - "parameters": [] - }, - { - "result": "String", - "name": "getSongInfoText", - "parameters": [] - }, - { - "result": "String", - "name": "getSongInfoTextTranslated", - "parameters": [] - }, - { - "result": "Int", - "name": "getVisBand", - "parameters": [ - [ - "int", - "channel" - ], - [ - "int", - "band" - ] - ] - }, - { - "result": "Double", - "name": "getRuntimeVersion", - "parameters": [] - }, - { - "result": "Int", - "name": "isWa2ComponentVisible", - "parameters": [ - [ - "String", - "guid" - ] - ] - }, - { - "result": "", - "name": "hideWa2Component", - "parameters": [ - [ - "String", - "guid" - ] - ] - }, - { - "result": "boolean", - "name": "isProVersion", - "parameters": [] - }, - { - "result": "String", - "name": "getWinampVersion", - "parameters": [] - }, - { - "result": "Int", - "name": "getBuildNumber", - "parameters": [] - }, - { - "result": "int", - "name": "getFileSize", - "parameters": [ - [ - "String", - "fullfilename" - ] - ] - } - ], - "name": "System" - }, - "E90DC47B840D4ae7B02C040BD275F7FC": { - "parent": "Object", - "functions": [ - { - "result": "", - "name": "onSwitchToLayout", - "parameters": [ - [ - "Layout", - "newlayout" - ] - ] - }, - { - "result": "", - "name": "onBeforeSwitchToLayout", - "parameters": [ - [ - "Layout", - "oldlayout" - ], - [ - "Layout", - "newlayout" - ] - ] - }, - { - "result": "", - "name": "setXmlParam", - "parameters": [ - [ - "String", - "param" - ], - [ - "String", - "value" - ] - ] - }, - { - "result": "", - "name": "onHideLayout", - "parameters": [ - [ - "Layout", - "_layout" - ] - ] - }, - { - "result": "", - "name": "onShowLayout", - "parameters": [ - [ - "Layout", - "_layout" - ] - ] - }, - { - "result": "Layout", - "name": "getLayout", - "parameters": [ - [ - "String", - "layout_id" - ] - ] - }, - { - "result": "Int", - "name": "getNumLayouts", - "parameters": [] - }, - { - "result": "Layout", - "name": "enumLayout", - "parameters": [ - [ - "Int", - "num" - ] - ] - }, - { - "result": "", - "name": "switchToLayout", - "parameters": [ - [ - "String", - "layout_id" - ] - ] - }, - { - "result": "", - "name": "show", - "parameters": [] - }, - { - "result": "", - "name": "hide", - "parameters": [] - }, - { - "result": "", - "name": "close", - "parameters": [] - }, - { - "result": "", - "name": "toggle", - "parameters": [] - }, - { - "result": "Int", - "name": "isDynamic", - "parameters": [] - }, - { - "result": "", - "name": "setName", - "parameters": [ - [ - "String", - "name" - ] - ] - }, - { - "result": "String", - "name": "getName", - "parameters": [] - }, - { - "result": "String", - "name": "getGuid", - "parameters": [] - }, - { - "result": "Layout", - "name": "getCurLayout", - "parameters": [] - }, - { - "result": "", - "name": "onAddContent", - "parameters": [ - [ - "GuiObject", - "wnd" - ], - [ - "String", - "id" - ], - [ - "String", - "guid" - ] - ] - } - ], - "name": "Container" - }, - "00C074A0FEA249a0BE8DFABBDB161640": { - "parent": "Object", - "functions": [ - { - "result": "String", - "name": "getGuid", - "parameters": [] - }, - { - "result": "String", - "name": "getName", - "parameters": [] - }, - { - "result": "Int", - "name": "sendCommand", - "parameters": [ - [ - "String", - "cmd" - ], - [ - "Int", - "param1" - ], - [ - "Int", - "param2" - ], - [ - "String", - "param3" - ] - ] - }, - { - "result": "", - "name": "show", - "parameters": [] - }, - { - "result": "", - "name": "hide", - "parameters": [] - }, - { - "result": "Boolean", - "name": "isVisible", - "parameters": [] - }, - { - "result": "", - "name": "onNotify", - "parameters": [ - [ - "String", - "notifstr" - ], - [ - "Int", - "a" - ], - [ - "Int", - "b" - ] - ] - }, - { - "result": "", - "name": "onShow", - "parameters": [] - }, - { - "result": "", - "name": "onHide", - "parameters": [] - }, - { - "result": "", - "name": "setStatusBar", - "parameters": [ - [ - "Boolean", - "onoff" - ] - ] - }, - { - "result": "Boolean", - "name": "getStatusBar", - "parameters": [] - } - ], - "name": "Wac" - }, - "B2023AB5434D4ba1BEAE59637503F3C6": { - "parent": "Object", - "functions": [ - { - "result": "", - "name": "addItem", - "parameters": [ - [ - "Any", - "_object" - ] - ] - }, - { - "result": "", - "name": "removeItem", - "parameters": [ - [ - "int", - "pos" - ] - ] - }, - { - "result": "Any", - "name": "enumItem", - "parameters": [ - [ - "int", - "pos" - ] - ] - }, - { - "result": "Int", - "name": "findItem", - "parameters": [ - [ - "Any", - "_object" - ] - ] - }, - { - "result": "Int", - "name": "findItem2", - "parameters": [ - [ - "Any", - "_object" - ], - [ - "int", - "startItem" - ] - ] - }, - { - "result": "int", - "name": "getNumItems", - "parameters": [] - }, - { - "result": "", - "name": "removeAll", - "parameters": [] - } - ], - "name": "List" - }, - "87C65778E74349fe85F909CC532AFD56": { - "parent": "Object", - "functions": [ - { - "result": "boolean", - "name": "getItem", - "parameters": [ - [ - "int", - "n" - ] - ] - }, - { - "result": "", - "name": "setItem", - "parameters": [ - [ - "int", - "n" - ], - [ - "boolean", - "val" - ] - ] - }, - { - "result": "", - "name": "setSize", - "parameters": [ - [ - "int", - "s" - ] - ] - }, - { - "result": "int", - "name": "getSize", - "parameters": [] - } - ], - "name": "BitList" - }, - "38603665461B42a7AA75D83F6667BF73": { - "parent": "Object", - "functions": [ - { - "result": "Int", - "name": "getValue", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - }, - { - "result": "Int", - "name": "getARGBValue", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ], - [ - "int", - "channel" - ] - ] - }, - { - "result": "Boolean", - "name": "inRegion", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - }, - { - "result": "", - "name": "loadMap", - "parameters": [ - [ - "String", - "bitmapid" - ] - ] - }, - { - "result": "Int", - "name": "getWidth", - "parameters": [] - }, - { - "result": "Int", - "name": "getHeight", - "parameters": [] - }, - { - "result": "Region", - "name": "getRegion", - "parameters": [] - } - ], - "name": "Map" - }, - "F4787AF4B2BB4ef79CFBE74BA9BEA88D": { - "parent": "Object", - "functions": [ - { - "result": "", - "name": "addSubMenu", - "parameters": [ - [ - "PopupMenu", - "submenu" - ], - [ - "String", - "submenutext" - ] - ] - }, - { - "result": "", - "name": "addCommand", - "parameters": [ - [ - "String", - "cmdtxt" - ], - [ - "Int", - "cmd_id" - ], - [ - "Boolean", - "checked" - ], - [ - "Boolean", - "disabled" - ] - ] - }, - { - "result": "", - "name": "addSeparator", - "parameters": [] - }, - { - "result": "Int", - "name": "popAtXY", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - }, - { - "result": "Int", - "name": "popAtMouse", - "parameters": [] - }, - { - "result": "Int", - "name": "getNumCommands", - "parameters": [] - }, - { - "result": "", - "name": "checkCommand", - "parameters": [ - [ - "int", - "cmd_id" - ], - [ - "boolean", - "check" - ] - ] - }, - { - "result": "", - "name": "disableCommand", - "parameters": [ - [ - "int", - "cmd_id" - ], - [ - "boolean", - "disable" - ] - ] - } - ], - "name": "PopupMenu" - }, - "3A370C023CBF439f84F186885BCF1E36": { - "parent": "Object", - "functions": [ - { - "result": "", - "name": "add", - "parameters": [ - [ - "Region", - "reg" - ] - ] - }, - { - "result": "", - "name": "sub", - "parameters": [ - [ - "Region", - "reg" - ] - ] - }, - { - "result": "", - "name": "offset", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - }, - { - "result": "", - "name": "stretch", - "parameters": [ - [ - "double", - "r" - ] - ] - }, - { - "result": "", - "name": "copy", - "parameters": [ - [ - "Region", - "reg" - ] - ] - }, - { - "result": "", - "name": "loadFromMap", - "parameters": [ - [ - "Map", - "regionmap" - ], - [ - "Int", - "threshold" - ], - [ - "Boolean", - "reversed" - ] - ] - }, - { - "result": "", - "name": "loadFromBitmap", - "parameters": [ - [ - "String", - "bitmapid" - ] - ] - }, - { - "result": "Int", - "name": "getBoundingBoxX", - "parameters": [] - }, - { - "result": "Int", - "name": "getBoundingBoxY", - "parameters": [] - }, - { - "result": "Int", - "name": "getBoundingBoxW", - "parameters": [] - }, - { - "result": "Int", - "name": "getBoundingBoxH", - "parameters": [] - } - ], - "name": "Region" - }, - "5D0C5BB67DE14b1fA70F8D1659941941": { - "parent": "Object", - "functions": [ - { - "result": "", - "name": "onTimer", - "parameters": [] - }, - { - "result": "", - "name": "setDelay", - "parameters": [ - [ - "int", - "millisec" - ] - ] - }, - { - "result": "Int", - "name": "getDelay", - "parameters": [] - }, - { - "result": "", - "name": "start", - "parameters": [] - }, - { - "result": "", - "name": "stop", - "parameters": [] - }, - { - "result": "", - "name": "isRunning", - "parameters": [] - }, - { - "result": "Int", - "name": "getSkipped", - "parameters": [] - } - ], - "name": "Timer" - }, - "A5376FA14E94411a83F605EC5EEA5F0A": { - "parent": "Object", - "functions": [ - { - "result": "Int", - "name": "setFeed", - "parameters": [ - [ - "String", - "feed_id" - ] - ] - }, - { - "result": "", - "name": "releaseFeed", - "parameters": [] - }, - { - "result": "", - "name": "onFeedChange", - "parameters": [ - [ - "String", - "new_feeddata" - ] - ] - } - ], - "name": "FeedWatcher" - }, - "4EE3E199C6364bec97CD78BC9C8628B0": { - "parent": "Object", - "functions": [ - { - "result": "", - "name": "show", - "parameters": [] - }, - { - "result": "", - "name": "hide", - "parameters": [] - }, - { - "result": "int", - "name": "isVisible", - "parameters": [] - }, - { - "result": "", - "name": "onSetVisible", - "parameters": [ - [ - "Boolean", - "onoff" - ] - ] - }, - { - "result": "", - "name": "setAlpha", - "parameters": [ - [ - "int", - "alpha" - ] - ] - }, - { - "result": "int", - "name": "getAlpha", - "parameters": [] - }, - { - "result": "", - "name": "onLeftButtonUp", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - }, - { - "result": "", - "name": "onLeftButtonDown", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - }, - { - "result": "", - "name": "onRightButtonUp", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - }, - { - "result": "", - "name": "onRightButtonDown", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - }, - { - "result": "", - "name": "onRightButtonDblClk", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - }, - { - "result": "", - "name": "onLeftButtonDblClk", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - }, - { - "result": "int", - "name": "onMouseWheelUp", - "parameters": [ - [ - "int", - "clicked" - ], - [ - "int", - "lines" - ] - ] - }, - { - "result": "int", - "name": "onMouseWheelDown", - "parameters": [ - [ - "int", - "clicked" - ], - [ - "int", - "lines" - ] - ] - }, - { - "result": "", - "name": "onMouseMove", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - }, - { - "result": "", - "name": "onEnterArea", - "parameters": [] - }, - { - "result": "", - "name": "onLeaveArea", - "parameters": [] - }, - { - "result": "", - "name": "setEnabled", - "parameters": [ - [ - "boolean", - "onoff" - ] - ] - }, - { - "result": "boolean", - "name": "getEnabled", - "parameters": [] - }, - { - "result": "", - "name": "onEnable", - "parameters": [ - [ - "boolean", - "onoff" - ] - ] - }, - { - "result": "", - "name": "resize", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ], - [ - "int", - "w" - ], - [ - "int", - "h" - ] - ] - }, - { - "result": "", - "name": "onResize", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ], - [ - "int", - "w" - ], - [ - "int", - "h" - ] - ] - }, - { - "result": "boolean", - "name": "isMouseOver", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - }, - { - "result": "int", - "name": "getLeft", - "parameters": [] - }, - { - "result": "int", - "name": "getTop", - "parameters": [] - }, - { - "result": "int", - "name": "getWidth", - "parameters": [] - }, - { - "result": "int", - "name": "getHeight", - "parameters": [] - }, - { - "result": "", - "name": "setTargetX", - "parameters": [ - [ - "int", - "x" - ] - ] - }, - { - "result": "", - "name": "setTargetY", - "parameters": [ - [ - "int", - "y" - ] - ] - }, - { - "result": "", - "name": "setTargetW", - "parameters": [ - [ - "int", - "w" - ] - ] - }, - { - "result": "", - "name": "setTargetH", - "parameters": [ - [ - "int", - "r" - ] - ] - }, - { - "result": "", - "name": "setTargetA", - "parameters": [ - [ - "int", - "alpha" - ] - ] - }, - { - "result": "", - "name": "setTargetSpeed", - "parameters": [ - [ - "float", - "insecond" - ] - ] - }, - { - "result": "", - "name": "gotoTarget", - "parameters": [] - }, - { - "result": "", - "name": "onTargetReached", - "parameters": [] - }, - { - "result": "", - "name": "cancelTarget", - "parameters": [] - }, - { - "result": "", - "name": "reverseTarget", - "parameters": [ - [ - "int", - "reverse" - ] - ] - }, - { - "result": "", - "name": "onStartup", - "parameters": [] - }, - { - "result": "boolean", - "name": "isGoingToTarget", - "parameters": [] - }, - { - "result": "", - "name": "setXmlParam", - "parameters": [ - [ - "String", - "param" - ], - [ - "String", - "value" - ] - ] - }, - { - "result": "String", - "name": "getXmlParam", - "parameters": [ - [ - "String", - "param" - ] - ] - }, - { - "result": "", - "name": "init", - "parameters": [ - [ - "Group", - "parent" - ] - ] - }, - { - "result": "", - "name": "bringToFront", - "parameters": [] - }, - { - "result": "", - "name": "bringToBack", - "parameters": [] - }, - { - "result": "", - "name": "bringAbove", - "parameters": [ - [ - "GuiObject", - "guiobj" - ] - ] - }, - { - "result": "", - "name": "bringBelow", - "parameters": [ - [ - "GuiObject", - "guiobj" - ] - ] - }, - { - "result": "Int", - "name": "getGuiX", - "parameters": [] - }, - { - "result": "Int", - "name": "getGuiY", - "parameters": [] - }, - { - "result": "Int", - "name": "getGuiW", - "parameters": [] - }, - { - "result": "Int", - "name": "getGuiH", - "parameters": [] - }, - { - "result": "Int", - "name": "getGuiRelatX", - "parameters": [] - }, - { - "result": "Int", - "name": "getGuiRelatY", - "parameters": [] - }, - { - "result": "Int", - "name": "getGuiRelatW", - "parameters": [] - }, - { - "result": "Int", - "name": "getGuiRelatH", - "parameters": [] - }, - { - "result": "Boolean", - "name": "isActive", - "parameters": [] - }, - { - "result": "GuiObject", - "name": "getParent", - "parameters": [] - }, - { - "result": "Layout", - "name": "getParentLayout", - "parameters": [] - }, - { - "result": "GuiObject", - "name": "getTopParent", - "parameters": [] - }, - { - "result": "int", - "name": "runModal", - "parameters": [] - }, - { - "result": "", - "name": "endModal", - "parameters": [ - [ - "int", - "retcode" - ] - ] - }, - { - "result": "GuiObject", - "name": "findObject", - "parameters": [ - [ - "String", - "id" - ] - ] - }, - { - "result": "GuiObject", - "name": "findObjectXY", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - }, - { - "result": "String", - "name": "getName", - "parameters": [] - }, - { - "result": "int", - "name": "clientToScreenX", - "parameters": [ - [ - "int", - "x" - ] - ] - }, - { - "result": "int", - "name": "clientToScreenY", - "parameters": [ - [ - "int", - "y" - ] - ] - }, - { - "result": "int", - "name": "clientToScreenW", - "parameters": [ - [ - "int", - "w" - ] - ] - }, - { - "result": "int", - "name": "clientToScreenH", - "parameters": [ - [ - "int", - "h" - ] - ] - }, - { - "result": "int", - "name": "screenToClientX", - "parameters": [ - [ - "int", - "x" - ] - ] - }, - { - "result": "int", - "name": "screenToClientY", - "parameters": [ - [ - "int", - "y" - ] - ] - }, - { - "result": "int", - "name": "screenToClientW", - "parameters": [ - [ - "int", - "w" - ] - ] - }, - { - "result": "int", - "name": "screenToClientH", - "parameters": [ - [ - "int", - "h" - ] - ] - }, - { - "result": "int", - "name": "getAutoWidth", - "parameters": [] - }, - { - "result": "int", - "name": "getAutoHeight", - "parameters": [] - }, - { - "result": "", - "name": "setFocus", - "parameters": [] - }, - { - "result": "", - "name": "onChar", - "parameters": [ - [ - "String", - "c" - ] - ] - }, - { - "result": "", - "name": "onAccelerator", - "parameters": [ - [ - "String", - "accel" - ] - ] - }, - { - "result": "Boolean", - "name": "isMouseOverRect", - "parameters": [] - }, - { - "result": "Object", - "name": "getInterface", - "parameters": [ - [ - "String", - "interface_guid" - ] - ] - }, - { - "result": "", - "name": "onDragEnter", - "parameters": [] - }, - { - "result": "", - "name": "onDragOver", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - }, - { - "result": "", - "name": "onDragLeave", - "parameters": [] - }, - { - "result": "", - "name": "onKeyDown", - "parameters": [ - [ - "int", - "vk_code" - ] - ] - }, - { - "result": "", - "name": "onKeyUp", - "parameters": [ - [ - "int", - "vk_code" - ] - ] - }, - { - "result": "", - "name": "onGetFocus", - "parameters": [] - }, - { - "result": "", - "name": "onKillFocus", - "parameters": [] - }, - { - "result": "Int", - "name": "sendAction", - "parameters": [ - [ - "String", - "action" - ], - [ - "String", - "param" - ], - [ - "Int", - "x" - ], - [ - "int", - "y" - ], - [ - "int", - "p1" - ], - [ - "int", - "p2" - ] - ] - }, - { - "result": "Int", - "name": "onAction", - "parameters": [ - [ - "String", - "action" - ], - [ - "String", - "param" - ], - [ - "Int", - "x" - ], - [ - "int", - "y" - ], - [ - "int", - "p1" - ], - [ - "int", - "p2" - ], - [ - "GuiObject", - "source" - ] - ] - } - ], - "name": "GuiObject" - }, - "45BE95E520724191935CBB5FF9F117FD": { - "parent": "GuiObject", - "functions": [ - { - "result": "GuiObject", - "name": "getObject", - "parameters": [ - [ - "String", - "object_id" - ] - ] - }, - { - "result": "Int", - "name": "getNumObjects", - "parameters": [] - }, - { - "result": "GuiObject", - "name": "enumObject", - "parameters": [ - [ - "Int", - "num" - ] - ] - }, - { - "result": "", - "name": "onCreateObject", - "parameters": [ - [ - "GuiObject", - "newobj" - ] - ] - }, - { - "result": "Int", - "name": "getMousePosX", - "parameters": [] - }, - { - "result": "Int", - "name": "getMousePosY", - "parameters": [] - }, - { - "result": "Boolean", - "name": "isLayout", - "parameters": [] - } - ], - "name": "Group" - }, - "60906D4E537E482eB004CC9461885672": { - "parent": "Group", - "functions": [ - { - "result": "", - "name": "onDock", - "parameters": [ - [ - "int", - "side" - ] - ] - }, - { - "result": "", - "name": "onUndock", - "parameters": [] - }, - { - "result": "", - "name": "onScale", - "parameters": [ - [ - "Double", - "newscalevalue" - ] - ] - }, - { - "result": "Double", - "name": "getScale", - "parameters": [] - }, - { - "result": "", - "name": "setScale", - "parameters": [ - [ - "Double", - "scalevalue" - ] - ] - }, - { - "result": "", - "name": "setDesktopAlpha", - "parameters": [ - [ - "Boolean", - "onoff" - ] - ] - }, - { - "result": "Boolean", - "name": "getDesktopAlpha", - "parameters": [] - }, - { - "result": "Container", - "name": "getContainer", - "parameters": [] - }, - { - "result": "", - "name": "center", - "parameters": [] - }, - { - "result": "", - "name": "onMove", - "parameters": [] - }, - { - "result": "", - "name": "onEndMove", - "parameters": [] - }, - { - "result": "", - "name": "onUserResize", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ], - [ - "int", - "w" - ], - [ - "int", - "h" - ] - ] - }, - { - "result": "", - "name": "snapAdjust", - "parameters": [ - [ - "int", - "left" - ], - [ - "int", - "top" - ], - [ - "int", - "right" - ], - [ - "int", - "bottom" - ] - ] - }, - { - "result": "Int", - "name": "getSnapAdjustTop", - "parameters": [] - }, - { - "result": "Int", - "name": "getSnapAdjustRight", - "parameters": [] - }, - { - "result": "Int", - "name": "getSnapAdjustLeft", - "parameters": [] - }, - { - "result": "Int", - "name": "getSnapAdjustBottom", - "parameters": [] - }, - { - "result": "", - "name": "setRedrawOnResize", - "parameters": [ - [ - "int", - "wantredrawonresize" - ] - ] - }, - { - "result": "", - "name": "beforeRedock", - "parameters": [] - }, - { - "result": "", - "name": "redock", - "parameters": [] - }, - { - "result": "Boolean", - "name": "isTransparencySafe", - "parameters": [] - }, - { - "result": "Boolean", - "name": "isLayoutAnimationSafe", - "parameters": [] - }, - { - "result": "", - "name": "onMouseEnterLayout", - "parameters": [] - }, - { - "result": "", - "name": "onMouseLeaveLayout", - "parameters": [] - }, - { - "result": "", - "name": "onSnapAdjustChanged", - "parameters": [] - } - ], - "name": "Layout" - }, - "403ABCC06F224bd68BA410C829932547": { - "parent": "GuiObject", - "functions": [ - { - "result": "", - "name": "setRegionFromMap", - "parameters": [ - [ - "Map", - "regionmap" - ], - [ - "Int", - "threshold" - ], - [ - "Boolean", - "reverse" - ] - ] - }, - { - "result": "", - "name": "setRegion", - "parameters": [ - [ - "Region", - "reg" - ] - ] - }, - { - "result": "GuiObject", - "name": "getContent", - "parameters": [] - }, - { - "result": "String", - "name": "getGuid", - "parameters": [] - }, - { - "result": "String", - "name": "getComponentName", - "parameters": [] - }, - { - "result": "", - "name": "onGetWac", - "parameters": [ - [ - "Wac", - "wacobj" - ] - ] - }, - { - "result": "", - "name": "onGiveUpWac", - "parameters": [ - [ - "Wac", - "wacobj" - ] - ] - }, - { - "result": "Wac", - "name": "getWac", - "parameters": [] - }, - { - "result": "", - "name": "setAcceptWac", - "parameters": [ - [ - "Boolean", - "onoff" - ] - ] - } - ], - "name": "WindowHolder" - }, - "97AA3E4DF4D04fa8817B0AF22A454983": { - "parent": "GuiObject", - "functions": [ - { - "result": "Int", - "name": "getMaxHeight", - "parameters": [] - }, - { - "result": "Int", - "name": "getMaxWidth", - "parameters": [] - }, - { - "result": "Int", - "name": "setScroll", - "parameters": [ - [ - "int", - "x" - ] - ] - }, - { - "result": "Int", - "name": "getScroll", - "parameters": [] - }, - { - "result": "Int", - "name": "getNumChildren", - "parameters": [] - }, - { - "result": "GuiObject", - "name": "enumChildren", - "parameters": [ - [ - "int", - "n" - ] - ] - } - ], - "name": "ComponentBucket" - }, - "64E4BBFA81F449d9B0C0A85B2EC3BCFD": { - "parent": "GuiObject", - "functions": [ - { - "result": "", - "name": "onEnter", - "parameters": [] - }, - { - "result": "", - "name": "onAbort", - "parameters": [] - }, - { - "result": "", - "name": "onIdleEditUpdate", - "parameters": [] - }, - { - "result": "", - "name": "onEditUpdate", - "parameters": [] - }, - { - "result": "", - "name": "setText", - "parameters": [ - [ - "String", - "txt" - ] - ] - }, - { - "result": "", - "name": "setAutoEnter", - "parameters": [ - [ - "boolean", - "onoff" - ] - ] - }, - { - "result": "Int", - "name": "getAutoEnter", - "parameters": [] - }, - { - "result": "String", - "name": "getText", - "parameters": [] - }, - { - "result": "", - "name": "selectAll", - "parameters": [] - }, - { - "result": "", - "name": "enter", - "parameters": [] - }, - { - "result": "", - "name": "setIdleEnabled", - "parameters": [ - [ - "boolean", - "onoff" - ] - ] - }, - { - "result": "Int", - "name": "getIdleEnabled", - "parameters": [] - } - ], - "name": "Edit" - }, - "62B65E3F375E408d8DEA76814AB91B77": { - "parent": "GuiObject", - "functions": [ - { - "result": "", - "name": "onSetPosition", - "parameters": [ - [ - "int", - "newpos" - ] - ] - }, - { - "result": "", - "name": "onPostedPosition", - "parameters": [ - [ - "int", - "newpos" - ] - ] - }, - { - "result": "", - "name": "onSetFinalPosition", - "parameters": [ - [ - "int", - "pos" - ] - ] - }, - { - "result": "", - "name": "setPosition", - "parameters": [ - [ - "int", - "pos" - ] - ] - }, - { - "result": "Int", - "name": "getPosition", - "parameters": [] - }, - { - "result": "", - "name": "lock", - "parameters": [] - }, - { - "result": "", - "name": "unlock", - "parameters": [] - } - ], - "name": "Slider" - }, - "CE4F97BE77B04e199956D49833C96C27": { - "parent": "GuiObject", - "functions": [ - { - "result": "", - "name": "onFrame", - "parameters": [] - }, - { - "result": "", - "name": "setRealtime", - "parameters": [ - [ - "Boolean", - "onoff" - ] - ] - }, - { - "result": "Boolean", - "name": "getRealtime", - "parameters": [] - }, - { - "result": "Int", - "name": "getMode", - "parameters": [] - }, - { - "result": "", - "name": "setMode", - "parameters": [ - [ - "Int", - "mode" - ] - ] - }, - { - "result": "", - "name": "nextMode", - "parameters": [] - } - ], - "name": "Vis" - }, - "A8C2200D51EB4b2aBA7F5D4BC65D4C71": { - "parent": "GuiObject", - "functions": [ - { - "result": "", - "name": "navigateUrl", - "parameters": [ - [ - "String", - "url" - ] - ] - }, - { - "result": "", - "name": "back", - "parameters": [] - }, - { - "result": "", - "name": "forward", - "parameters": [] - }, - { - "result": "", - "name": "stop", - "parameters": [] - }, - { - "result": "", - "name": "refresh", - "parameters": [] - }, - { - "result": "", - "name": "home", - "parameters": [] - }, - { - "result": "", - "name": "setTargetName", - "parameters": [ - [ - "String", - "targetname" - ] - ] - }, - { - "result": "Boolean", - "name": "onBeforeNavigate", - "parameters": [ - [ - "String", - "url" - ], - [ - "Int", - "flags" - ], - [ - "String", - "targetframename" - ] - ] - }, - { - "result": "", - "name": "onDocumentComplete", - "parameters": [ - [ - "String", - "url" - ] - ] - }, - { - "result": "", - "name": "onDocumentReady", - "parameters": [ - [ - "String", - "url" - ] - ] - }, - { - "result": "String", - "name": "getDocumentTitle", - "parameters": [] - }, - { - "result": "", - "name": "onNavigateError", - "parameters": [ - [ - "String", - "url" - ], - [ - "int", - "code" - ] - ] - }, - { - "result": "", - "name": "setCancelIEErrorPage", - "parameters": [ - [ - "boolean", - "cancel" - ] - ] - }, - { - "result": "", - "name": "scrape", - "parameters": [] - }, - { - "result": "string", - "name": "onMediaLink", - "parameters": [ - [ - "string", - "url" - ] - ] - } - ], - "name": "Browser" - }, - "8D1EBA38489E483eB9608D1F43C5C405": { - "parent": "GuiObject", - "functions": [], - "name": "EqVis" - }, - "0F08C940AF394b2380F3B8C48F7EBB59": { - "parent": "GuiObject", - "functions": [], - "name": "Status" - }, - "EFAA8672310E41faB7DC85A9525BCB4B": { - "parent": "GuiObject", - "functions": [ - { - "result": "", - "name": "setText", - "parameters": [ - [ - "String", - "txt" - ] - ] - }, - { - "result": "", - "name": "setAlternateText", - "parameters": [ - [ - "String", - "txt" - ] - ] - }, - { - "result": "String", - "name": "getText", - "parameters": [] - }, - { - "result": "int", - "name": "getTextWidth", - "parameters": [] - }, - { - "result": "", - "name": "onTextChanged", - "parameters": [ - [ - "String", - "newtxt" - ] - ] - } - ], - "name": "Text" - }, - "7DFD324437514e7cBF4082AE5F3ADC33": { - "parent": "GuiObject", - "functions": [], - "name": "Title" - }, - "5AB9FA159A7D4557ABC86557A6C67CA9": { - "parent": "GuiObject", - "functions": [ - { - "result": "", - "name": "onBeginResize", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ], - [ - "int", - "w" - ], - [ - "int", - "h" - ] - ] - }, - { - "result": "", - "name": "onEndResize", - "parameters": [ - [ - "int", - "x" - ], - [ - "int", - "y" - ], - [ - "int", - "w" - ], - [ - "int", - "h" - ] - ] - }, - { - "result": "", - "name": "fx_onInit", - "parameters": [] - }, - { - "result": "", - "name": "fx_onFrame", - "parameters": [] - }, - { - "result": "Double", - "name": "fx_onGetPixelR", - "parameters": [ - [ - "double", - "r" - ], - [ - "double", - "d" - ], - [ - "double", - "x" - ], - [ - "double", - "y" - ] - ] - }, - { - "result": "Double", - "name": "fx_onGetPixelD", - "parameters": [ - [ - "double", - "r" - ], - [ - "double", - "d" - ], - [ - "double", - "x" - ], - [ - "double", - "y" - ] - ] - }, - { - "result": "Double", - "name": "fx_onGetPixelX", - "parameters": [ - [ - "double", - "r" - ], - [ - "double", - "d" - ], - [ - "double", - "x" - ], - [ - "double", - "y" - ] - ] - }, - { - "result": "Double", - "name": "fx_onGetPixelY", - "parameters": [ - [ - "double", - "r" - ], - [ - "double", - "d" - ], - [ - "double", - "x" - ], - [ - "double", - "y" - ] - ] - }, - { - "result": "Double", - "name": "fx_onGetPixelA", - "parameters": [ - [ - "double", - "r" - ], - [ - "double", - "d" - ], - [ - "double", - "x" - ], - [ - "double", - "y" - ] - ] - }, - { - "result": "", - "name": "setRegionFromMap", - "parameters": [ - [ - "Map", - "regionmap" - ], - [ - "int", - "threshold" - ], - [ - "boolean", - "reverse" - ] - ] - }, - { - "result": "", - "name": "setRegion", - "parameters": [ - [ - "Region", - "reg" - ] - ] - }, - { - "result": "", - "name": "fx_setEnabled", - "parameters": [ - [ - "boolean", - "onoff" - ] - ] - }, - { - "result": "Boolean", - "name": "fx_getEnabled", - "parameters": [] - }, - { - "result": "", - "name": "fx_setWrap", - "parameters": [ - [ - "Boolean", - "onoff" - ] - ] - }, - { - "result": "Boolean", - "name": "fx_getWrap", - "parameters": [] - }, - { - "result": "", - "name": "fx_setRect", - "parameters": [ - [ - "Boolean", - "onoff" - ] - ] - }, - { - "result": "Boolean", - "name": "fx_getRect", - "parameters": [] - }, - { - "result": "", - "name": "fx_setBgFx", - "parameters": [ - [ - "Boolean", - "onoff" - ] - ] - }, - { - "result": "Boolean", - "name": "fx_getBgFx", - "parameters": [] - }, - { - "result": "", - "name": "fx_setClear", - "parameters": [ - [ - "Boolean", - "onoff" - ] - ] - }, - { - "result": "Boolean", - "name": "fx_getClear", - "parameters": [] - }, - { - "result": "", - "name": "fx_setSpeed", - "parameters": [ - [ - "Int", - "msperframe" - ] - ] - }, - { - "result": "Int", - "name": "fx_getSpeed", - "parameters": [] - }, - { - "result": "", - "name": "fx_setRealtime", - "parameters": [ - [ - "Boolean", - "onoff" - ] - ] - }, - { - "result": "Boolean", - "name": "fx_getRealtime", - "parameters": [] - }, - { - "result": "", - "name": "fx_setLocalized", - "parameters": [ - [ - "Boolean", - "onoff" - ] - ] - }, - { - "result": "Boolean", - "name": "fx_getLocalized", - "parameters": [] - }, - { - "result": "", - "name": "fx_setBilinear", - "parameters": [ - [ - "Boolean", - "onoff" - ] - ] - }, - { - "result": "Boolean", - "name": "fx_getBilinear", - "parameters": [] - }, - { - "result": "", - "name": "fx_setAlphaMode", - "parameters": [ - [ - "Boolean", - "onoff" - ] - ] - }, - { - "result": "Boolean", - "name": "fx_getAlphaMode", - "parameters": [] - }, - { - "result": "", - "name": "fx_setGridSize", - "parameters": [ - [ - "Int", - "x" - ], - [ - "Int", - "y" - ] - ] - }, - { - "result": "", - "name": "fx_update", - "parameters": [] - }, - { - "result": "", - "name": "fx_restart", - "parameters": [] - }, - { - "result": "Boolean", - "name": "isInvalid", - "parameters": [] - } - ], - "name": "Layer" - }, - "698EDDCD8F1E4fec9B12F944F909FF45": { - "parent": "GuiObject", - "functions": [ - { - "result": "", - "name": "onActivate", - "parameters": [ - [ - "int", - "activated" - ] - ] - }, - { - "result": "", - "name": "onLeftClick", - "parameters": [] - }, - { - "result": "", - "name": "onRightClick", - "parameters": [] - }, - { - "result": "", - "name": "setActivated", - "parameters": [ - [ - "Boolean", - "onoff" - ] - ] - }, - { - "result": "", - "name": "setActivatedNoCallback", - "parameters": [ - [ - "Boolean", - "onoff" - ] - ] - }, - { - "result": "Boolean", - "name": "getActivated", - "parameters": [] - }, - { - "result": "", - "name": "leftClick", - "parameters": [] - }, - { - "result": "", - "name": "rightClick", - "parameters": [] - } - ], - "name": "Button" - }, - "6B64CD275A264c4b8C59E6A70CF6493A": { - "parent": "Layer", - "functions": [ - { - "result": "", - "name": "onPlay", - "parameters": [] - }, - { - "result": "", - "name": "onPause", - "parameters": [] - }, - { - "result": "", - "name": "onResume", - "parameters": [] - }, - { - "result": "", - "name": "onStop", - "parameters": [] - }, - { - "result": "", - "name": "onFrame", - "parameters": [ - [ - "Int", - "framenum" - ] - ] - }, - { - "result": "", - "name": "setSpeed", - "parameters": [ - [ - "Int", - "msperframe" - ] - ] - }, - { - "result": "", - "name": "gotoFrame", - "parameters": [ - [ - "int", - "framenum" - ] - ] - }, - { - "result": "", - "name": "setStartFrame", - "parameters": [ - [ - "Int", - "framenum" - ] - ] - }, - { - "result": "", - "name": "setEndFrame", - "parameters": [ - [ - "int", - "framenum" - ] - ] - }, - { - "result": "", - "name": "setAutoReplay", - "parameters": [ - [ - "Boolean", - "onoff" - ] - ] - }, - { - "result": "", - "name": "play", - "parameters": [] - }, - { - "result": "", - "name": "stop", - "parameters": [] - }, - { - "result": "", - "name": "pause", - "parameters": [] - }, - { - "result": "Boolean", - "name": "isPlaying", - "parameters": [] - }, - { - "result": "Boolean", - "name": "isPaused", - "parameters": [] - }, - { - "result": "Boolean", - "name": "isStopped", - "parameters": [] - }, - { - "result": "Int", - "name": "getStartFrame", - "parameters": [] - }, - { - "result": "Int", - "name": "getEndFrame", - "parameters": [] - }, - { - "result": "Int", - "name": "getLength", - "parameters": [] - }, - { - "result": "Int", - "name": "getDirection", - "parameters": [] - }, - { - "result": "Boolean", - "name": "getAutoReplay", - "parameters": [] - }, - { - "result": "Int", - "name": "getCurFrame", - "parameters": [] - }, - { - "result": "", - "name": "setRealtime", - "parameters": [ - [ - "Boolean", - "onoff" - ] - ] - } - ], - "name": "AnimatedLayer" - }, - "6DCB05E48AC448c2B19349F0910EF54A": { - "parent": "Layer", - "functions": [ - { - "result": "", - "name": "refresh", - "parameters": [] - }, - { - "result": "", - "name": "isLoading", - "parameters": [] - }, - { - "result": "", - "name": "onAlbumArtLoaded", - "parameters": [ - [ - "boolean", - "success" - ] - ] - } - ], - "name": "AlbumArtLayer" - }, - "B4DCCFFF81FE4bcc961B720FD5BE0FFF": { - "parent": "Button", - "functions": [ - { - "result": "", - "name": "onToggle", - "parameters": [ - [ - "Boolean", - "onoff" - ] - ] - }, - { - "result": "int", - "name": "getCurCfgVal", - "parameters": [] - } - ], - "name": "ToggleButton" - }, - "01E28CE1B05911d5979FE4DE6F51760A": { - "parent": "GuiObject", - "functions": [ - { - "result": "Group", - "name": "instantiate", - "parameters": [ - [ - "String", - "group_id" - ], - [ - "int", - "num_groups" - ] - ] - }, - { - "result": "Int", - "name": "getNumItems", - "parameters": [] - }, - { - "result": "Group", - "name": "enumItem", - "parameters": [ - [ - "int", - "num" - ] - ] - }, - { - "result": "", - "name": "removeAll", - "parameters": [] - }, - { - "result": "", - "name": "scrollToPercent", - "parameters": [ - [ - "Int", - "percent" - ] - ] - }, - { - "result": "", - "name": "setRedraw", - "parameters": [ - [ - "int", - "redraw" - ] - ] - } - ], - "name": "GroupList" - }, - "80F0F8BD1BA542a6A0933236A00C8D4A": { - "parent": "Group", - "functions": [ - { - "result": "Int", - "name": "cfgGetInt", - "parameters": [] - }, - { - "result": "", - "name": "cfgSetInt", - "parameters": [ - [ - "Int", - "intvalue" - ] - ] - }, - { - "result": "String", - "name": "cfgGetString", - "parameters": [] - }, - { - "result": "Float", - "name": "cfgGetFloat", - "parameters": [] - }, - { - "result": "", - "name": "cfgSetFloat", - "parameters": [ - [ - "Float", - "floatvalue" - ] - ] - }, - { - "result": "", - "name": "cfgSetString", - "parameters": [ - [ - "String", - "strvalue" - ] - ] - }, - { - "result": "", - "name": "onCfgChanged", - "parameters": [] - }, - { - "result": "String", - "name": "cfgGetGuid", - "parameters": [] - }, - { - "result": "String", - "name": "cfgGetName", - "parameters": [] - } - ], - "name": "CfgGroup" - }, - "CDCB785D81F242538F0561B872283CFA": { - "parent": "GuiObject", - "functions": [ - { - "result": "", - "name": "onResetQuery", - "parameters": [] - } - ], - "name": "QueryList" - }, - "9B2E341B6C9840fa8B850C1B6EE89405": { - "parent": "GuiObject", - "functions": [ - { - "result": "", - "name": "setRedirection", - "parameters": [ - [ - "GuiObject", - "o" - ] - ] - }, - { - "result": "GuiObject", - "name": "getRedirection", - "parameters": [] - }, - { - "result": "", - "name": "setRegionFromMap", - "parameters": [ - [ - "Map", - "regionmap" - ], - [ - "Int", - "threshold" - ], - [ - "Boolean", - "reverse" - ] - ] - }, - { - "result": "", - "name": "setRegion", - "parameters": [ - [ - "Region", - "reg" - ] - ] - } - ], - "name": "MouseRedir" - }, - "36D59B7103FD4af897950502B7DB267A": { - "parent": "GuiObject", - "functions": [ - { - "result": "String", - "name": "getItemSelected", - "parameters": [] - }, - { - "result": "", - "name": "onSelect", - "parameters": [ - [ - "Int", - "id" - ], - [ - "Int", - "hover" - ] - ] - }, - { - "result": "", - "name": "setListHeight", - "parameters": [ - [ - "Int", - "h" - ] - ] - }, - { - "result": "", - "name": "openList", - "parameters": [] - }, - { - "result": "", - "name": "closeList", - "parameters": [] - }, - { - "result": "", - "name": "setItems", - "parameters": [ - [ - "String", - "lotsofitems" - ] - ] - }, - { - "result": "Int", - "name": "addItem", - "parameters": [ - [ - "String", - "_text" - ] - ] - }, - { - "result": "", - "name": "delItem", - "parameters": [ - [ - "Int", - "id" - ] - ] - }, - { - "result": "Int", - "name": "findItem", - "parameters": [ - [ - "String", - "_text" - ] - ] - }, - { - "result": "Int", - "name": "getNumItems", - "parameters": [] - }, - { - "result": "", - "name": "selectItem", - "parameters": [ - [ - "Int", - "id" - ], - [ - "Int", - "hover" - ] - ] - }, - { - "result": "String", - "name": "getItemText", - "parameters": [ - [ - "Int", - "id" - ] - ] - }, - { - "result": "Int", - "name": "getSelected", - "parameters": [] - }, - { - "result": "String", - "name": "getSelectedText", - "parameters": [] - }, - { - "result": "String", - "name": "getCustomText", - "parameters": [] - }, - { - "result": "", - "name": "deleteAllItems", - "parameters": [] - }, - { - "result": "", - "name": "setNoItemText", - "parameters": [ - [ - "String", - "txt" - ] - ] - } - ], - "name": "DropDownList" - }, - "7FD5F210ACC448dfA6A05451576CDC76": { - "parent": "GuiObject", - "functions": [ - { - "result": "", - "name": "callme", - "parameters": [ - [ - "String", - "str" - ] - ] - } - ], - "name": "LayoutStatus" - }, - "B5BAA53505B34dcbADC1E618D28F6896": { - "parent": "GuiObject", - "functions": [ - { - "result": "Int", - "name": "getCurPage", - "parameters": [] - }, - { - "result": "", - "name": "setCurPage", - "parameters": [ - [ - "Int", - "a" - ] - ] - } - ], - "name": "TabSheet" - }, - "6129FEC1DAB74d51916501CA0C1B70DB": { - "parent": "GuiObject", - "functions": [ - { - "result": "Int", - "name": "addColumn", - "parameters": [ - [ - "String", - "name" - ], - [ - "Int", - "width" - ], - [ - "Int", - "numeric" - ] - ] - }, - { - "result": "Int", - "name": "getNumColumns", - "parameters": [] - }, - { - "result": "Int", - "name": "getColumnWidth", - "parameters": [ - [ - "Int", - "column" - ] - ] - }, - { - "result": "", - "name": "setColumnWidth", - "parameters": [ - [ - "Int", - "column" - ], - [ - "Int", - "newwidth" - ] - ] - }, - { - "result": "String", - "name": "getColumnLabel", - "parameters": [ - [ - "Int", - "column" - ] - ] - }, - { - "result": "", - "name": "setColumnLabel", - "parameters": [ - [ - "Int", - "column" - ], - [ - "String", - "newlabel" - ] - ] - }, - { - "result": "Int", - "name": "getColumnNumeric", - "parameters": [ - [ - "Int", - "column" - ] - ] - }, - { - "result": "", - "name": "setColumnDynamic", - "parameters": [ - [ - "Int", - "column" - ], - [ - "Int", - "isdynamic" - ] - ] - }, - { - "result": "Int", - "name": "isColumnDynamic", - "parameters": [ - [ - "Int", - "column" - ] - ] - }, - { - "result": "", - "name": "invalidateColumns", - "parameters": [] - }, - { - "result": "Int", - "name": "getNumItems", - "parameters": [] - }, - { - "result": "Int", - "name": "getItemCount", - "parameters": [] - }, - { - "result": "Int", - "name": "addItem", - "parameters": [ - [ - "String", - "label" - ] - ] - }, - { - "result": "Int", - "name": "insertItem", - "parameters": [ - [ - "Int", - "pos" - ], - [ - "String", - "label" - ] - ] - }, - { - "result": "Int", - "name": "getLastAddedItemPos", - "parameters": [] - }, - { - "result": "", - "name": "setSubItem", - "parameters": [ - [ - "Int", - "pos" - ], - [ - "Int", - "subpos" - ], - [ - "String", - "txt" - ] - ] - }, - { - "result": "", - "name": "deleteAllItems", - "parameters": [] - }, - { - "result": "Int", - "name": "deleteByPos", - "parameters": [ - [ - "Int", - "pos" - ] - ] - }, - { - "result": "String", - "name": "getItemLabel", - "parameters": [ - [ - "Int", - "pos" - ], - [ - "Int", - "subpos" - ] - ] - }, - { - "result": "String", - "name": "getSubitemText", - "parameters": [ - [ - "Int", - "pos" - ], - [ - "Int", - "subpos" - ] - ] - }, - { - "result": "", - "name": "setItemLabel", - "parameters": [ - [ - "Int", - "pos" - ], - [ - "String", - "_text" - ] - ] - }, - { - "result": "Int", - "name": "invalidateItem", - "parameters": [ - [ - "Int", - "pos" - ] - ] - }, - { - "result": "Int", - "name": "getFirstItemVisible", - "parameters": [] - }, - { - "result": "Int", - "name": "getLastItemVisible", - "parameters": [] - }, - { - "result": "", - "name": "setItemIcon", - "parameters": [ - [ - "Int", - "pos" - ], - [ - "String", - "bitmapId" - ] - ] - }, - { - "result": "String", - "name": "getItemIcon", - "parameters": [ - [ - "Int", - "pos" - ] - ] - }, - { - "result": "", - "name": "setMinimumSize", - "parameters": [ - [ - "Int", - "size" - ] - ] - }, - { - "result": "Int", - "name": "getWantAutoDeselect", - "parameters": [] - }, - { - "result": "", - "name": "setWantAutoDeselect", - "parameters": [ - [ - "Int", - "want" - ] - ] - }, - { - "result": "", - "name": "onSetVisible", - "parameters": [ - [ - "Int", - "show" - ] - ] - }, - { - "result": "", - "name": "setAutoSort", - "parameters": [ - [ - "Int", - "dosort" - ] - ] - }, - { - "result": "Int", - "name": "setFontSize", - "parameters": [ - [ - "Int", - "size" - ] - ] - }, - { - "result": "Int", - "name": "getFontSize", - "parameters": [] - }, - { - "result": "Int", - "name": "getHeaderHeight", - "parameters": [] - }, - { - "result": "Int", - "name": "getPreventMultipleSelection", - "parameters": [] - }, - { - "result": "Int", - "name": "setPreventMultipleSelection", - "parameters": [ - [ - "Int", - "val" - ] - ] - }, - { - "result": "", - "name": "setShowIcons", - "parameters": [ - [ - "int", - "showThem" - ] - ] - }, - { - "result": "Int", - "name": "getShowIcons", - "parameters": [] - }, - { - "result": "Int", - "name": "setIconWidth", - "parameters": [ - [ - "int", - "width" - ] - ] - }, - { - "result": "Int", - "name": "setIconHeight", - "parameters": [ - [ - "int", - "width" - ] - ] - }, - { - "result": "", - "name": "getIconWidth", - "parameters": [] - }, - { - "result": "", - "name": "getIconHeight", - "parameters": [] - }, - { - "result": "", - "name": "next", - "parameters": [] - }, - { - "result": "", - "name": "previous", - "parameters": [] - }, - { - "result": "", - "name": "pagedown", - "parameters": [] - }, - { - "result": "", - "name": "pageup", - "parameters": [] - }, - { - "result": "", - "name": "home", - "parameters": [] - }, - { - "result": "", - "name": "end", - "parameters": [] - }, - { - "result": "", - "name": "reset", - "parameters": [] - }, - { - "result": "", - "name": "ensureItemVisible", - "parameters": [ - [ - "Int", - "pos" - ] - ] - }, - { - "result": "Int", - "name": "scrollAbsolute", - "parameters": [ - [ - "Int", - "x" - ] - ] - }, - { - "result": "Int", - "name": "scrollRelative", - "parameters": [ - [ - "Int", - "x" - ] - ] - }, - { - "result": "", - "name": "scrollLeft", - "parameters": [ - [ - "Int", - "lines" - ] - ] - }, - { - "result": "", - "name": "scrollRight", - "parameters": [ - [ - "Int", - "lines" - ] - ] - }, - { - "result": "", - "name": "scrollUp", - "parameters": [ - [ - "Int", - "lines" - ] - ] - }, - { - "result": "", - "name": "scrollDown", - "parameters": [ - [ - "Int", - "lines" - ] - ] - }, - { - "result": "", - "name": "jumpToNext", - "parameters": [ - [ - "Int", - "c" - ] - ] - }, - { - "result": "", - "name": "scrollToItem", - "parameters": [ - [ - "Int", - "pos" - ] - ] - }, - { - "result": "", - "name": "selectCurrent", - "parameters": [] - }, - { - "result": "", - "name": "selectFirstEntry", - "parameters": [] - }, - { - "result": "Int", - "name": "getItemSelected", - "parameters": [ - [ - "Int", - "pos" - ] - ] - }, - { - "result": "Int", - "name": "isItemFocused", - "parameters": [ - [ - "Int", - "pos" - ] - ] - }, - { - "result": "Int", - "name": "getItemFocused", - "parameters": [] - }, - { - "result": "", - "name": "setItemFocused", - "parameters": [ - [ - "Int", - "pos" - ] - ] - }, - { - "result": "Int", - "name": "getFirstItemSelected", - "parameters": [] - }, - { - "result": "Int", - "name": "getNextItemSelected", - "parameters": [ - [ - "Int", - "lastpos" - ] - ] - }, - { - "result": "Int", - "name": "selectAll", - "parameters": [] - }, - { - "result": "Int", - "name": "deselectAll", - "parameters": [] - }, - { - "result": "Int", - "name": "invertSelection", - "parameters": [] - }, - { - "result": "", - "name": "setSelectionStart", - "parameters": [ - [ - "Int", - "pos" - ] - ] - }, - { - "result": "", - "name": "setSelectionEnd", - "parameters": [ - [ - "Int", - "pos" - ] - ] - }, - { - "result": "", - "name": "setSelected", - "parameters": [ - [ - "Int", - "pos" - ], - [ - "Int", - "selected" - ] - ] - }, - { - "result": "", - "name": "toggleSelection", - "parameters": [ - [ - "Int", - "pos" - ], - [ - "Int", - "setfocus" - ] - ] - }, - { - "result": "", - "name": "resort", - "parameters": [] - }, - { - "result": "Int", - "name": "getSortDirection", - "parameters": [] - }, - { - "result": "Int", - "name": "getSortColumn", - "parameters": [] - }, - { - "result": "", - "name": "setSortColumn", - "parameters": [ - [ - "Int", - "col" - ] - ] - }, - { - "result": "", - "name": "setSortDirection", - "parameters": [ - [ - "Int", - "dir" - ] - ] - }, - { - "result": "", - "name": "moveItem", - "parameters": [ - [ - "Int", - "from" - ], - [ - "Int", - "to" - ] - ] - }, - { - "result": "", - "name": "onSelectAll", - "parameters": [] - }, - { - "result": "", - "name": "onDelete", - "parameters": [] - }, - { - "result": "", - "name": "onDoubleClick", - "parameters": [ - [ - "Int", - "itemnum" - ] - ] - }, - { - "result": "", - "name": "onLeftClick", - "parameters": [ - [ - "Int", - "itemnum" - ] - ] - }, - { - "result": "", - "name": "onSecondLeftClick", - "parameters": [ - [ - "Int", - "itemnum" - ] - ] - }, - { - "result": "Int", - "name": "onRightClick", - "parameters": [ - [ - "Int", - "itemnum" - ] - ] - }, - { - "result": "Int", - "name": "onColumnDblClick", - "parameters": [ - [ - "Int", - "col" - ], - [ - "Int", - "x" - ], - [ - "Int", - "y" - ] - ] - }, - { - "result": "Int", - "name": "onColumnLabelClick", - "parameters": [ - [ - "Int", - "col" - ], - [ - "Int", - "x" - ], - [ - "Int", - "y" - ] - ] - }, - { - "result": "", - "name": "onItemSelection", - "parameters": [ - [ - "Int", - "itemnum" - ], - [ - "Int", - "selected" - ] - ] - }, - { - "result": "Int", - "name": "onIconLeftClick", - "parameters": [ - [ - "int", - "itemnum" - ], - [ - "int", - "x" - ], - [ - "int", - "y" - ] - ] - } - ], - "name": "GuiList" - }, - "D59514F7ED3645e8980F3F4EA0522CD9": { - "parent": "GuiObject", - "functions": [ - { - "result": "Int", - "name": "onWantAutoContextMenu", - "parameters": [] - }, - { - "result": "Int", - "name": "onMouseWheelUp", - "parameters": [ - [ - "Int", - "clicked" - ], - [ - "Int", - "lines" - ] - ] - }, - { - "result": "Int", - "name": "onMouseWheelDown", - "parameters": [ - [ - "Int", - "clicked" - ], - [ - "Int", - "lines" - ] - ] - }, - { - "result": "Int", - "name": "onContextMenu", - "parameters": [ - [ - "Int", - "x" - ], - [ - "Int", - "y" - ] - ] - }, - { - "result": "Int", - "name": "onChar", - "parameters": [ - [ - "Int", - "c" - ] - ] - }, - { - "result": "", - "name": "onItemRecvDrop", - "parameters": [ - [ - "TreeItem", - "item" - ] - ] - }, - { - "result": "", - "name": "onLabelChange", - "parameters": [ - [ - "TreeItem", - "item" - ] - ] - }, - { - "result": "", - "name": "onItemSelected", - "parameters": [ - [ - "TreeItem", - "item" - ] - ] - }, - { - "result": "", - "name": "onItemDeselected", - "parameters": [ - [ - "TreeItem", - "item" - ] - ] - }, - { - "result": "Int", - "name": "getNumRootItems", - "parameters": [] - }, - { - "result": "TreeItem", - "name": "enumRootItem", - "parameters": [ - [ - "Int", - "which" - ] - ] - }, - { - "result": "", - "name": "jumpToNext", - "parameters": [ - [ - "Int", - "c" - ] - ] - }, - { - "result": "", - "name": "ensureItemVisible", - "parameters": [ - [ - "TreeItem", - "item" - ] - ] - }, - { - "result": "Int", - "name": "getContentsWidth", - "parameters": [] - }, - { - "result": "Int", - "name": "getContentsHeight", - "parameters": [] - }, - { - "result": "TreeItem", - "name": "addTreeItem", - "parameters": [ - [ - "TreeItem", - "item" - ], - [ - "TreeItem", - "par" - ], - [ - "Int", - "sorted" - ], - [ - "Int", - "haschildtab" - ] - ] - }, - { - "result": "Int", - "name": "removeTreeItem", - "parameters": [ - [ - "TreeItem", - "item" - ] - ] - }, - { - "result": "", - "name": "moveTreeItem", - "parameters": [ - [ - "TreeItem", - "item" - ], - [ - "TreeItem", - "newparent" - ] - ] - }, - { - "result": "", - "name": "deleteAllItems", - "parameters": [] - }, - { - "result": "Int", - "name": "expandItem", - "parameters": [ - [ - "TreeItem", - "item" - ] - ] - }, - { - "result": "", - "name": "expandItemDeferred", - "parameters": [ - [ - "TreeItem", - "item" - ] - ] - }, - { - "result": "Int", - "name": "collapseItem", - "parameters": [ - [ - "TreeItem", - "item" - ] - ] - }, - { - "result": "", - "name": "collapseItemDeferred", - "parameters": [ - [ - "TreeItem", - "item" - ] - ] - }, - { - "result": "", - "name": "selectItem", - "parameters": [ - [ - "TreeItem", - "item" - ] - ] - }, - { - "result": "", - "name": "selectItemDeferred", - "parameters": [ - [ - "TreeItem", - "item" - ] - ] - }, - { - "result": "", - "name": "delItemDeferred", - "parameters": [ - [ - "TreeItem", - "item" - ] - ] - }, - { - "result": "", - "name": "hiliteItem", - "parameters": [ - [ - "TreeItem", - "item" - ] - ] - }, - { - "result": "", - "name": "unhiliteItem", - "parameters": [ - [ - "TreeItem", - "item" - ] - ] - }, - { - "result": "TreeItem", - "name": "getCurItem", - "parameters": [] - }, - { - "result": "TreeItem", - "name": "hitTest", - "parameters": [ - [ - "Int", - "x" - ], - [ - "Int", - "y" - ] - ] - }, - { - "result": "", - "name": "editItemLabel", - "parameters": [ - [ - "TreeItem", - "item" - ] - ] - }, - { - "result": "", - "name": "cancelEditLabel", - "parameters": [ - [ - "Int", - "destroyit" - ] - ] - }, - { - "result": "", - "name": "setAutoEdit", - "parameters": [ - [ - "Int", - "ae" - ] - ] - }, - { - "result": "Int", - "name": "getAutoEdit", - "parameters": [] - }, - { - "result": "TreeItem", - "name": "getByLabel", - "parameters": [ - [ - "TreeItem", - "item" - ], - [ - "String", - "name" - ] - ] - }, - { - "result": "", - "name": "setSorted", - "parameters": [ - [ - "Int", - "dosort" - ] - ] - }, - { - "result": "Int", - "name": "getSorted", - "parameters": [] - }, - { - "result": "", - "name": "sortTreeItems", - "parameters": [] - }, - { - "result": "TreeItem", - "name": "getSibling", - "parameters": [ - [ - "TreeItem", - "item" - ] - ] - }, - { - "result": "", - "name": "setAutoCollapse", - "parameters": [ - [ - "Int", - "doautocollapse" - ] - ] - }, - { - "result": "Int", - "name": "setFontSize", - "parameters": [ - [ - "Int", - "newsize" - ] - ] - }, - { - "result": "Int", - "name": "getFontSize", - "parameters": [] - }, - { - "result": "Int", - "name": "getNumVisibleChildItems", - "parameters": [ - [ - "TreeItem", - "c" - ] - ] - }, - { - "result": "Int", - "name": "getNumVisibleItems", - "parameters": [] - }, - { - "result": "TreeItem", - "name": "enumVisibleItems", - "parameters": [ - [ - "Int", - "n" - ] - ] - }, - { - "result": "TreeItem", - "name": "enumVisibleChildItems", - "parameters": [ - [ - "TreeItem", - "c" - ], - [ - "Int", - "n" - ] - ] - }, - { - "result": "TreeItem", - "name": "enumAllItems", - "parameters": [ - [ - "Int", - "n" - ] - ] - }, - { - "result": "Int", - "name": "getItemRectX", - "parameters": [ - [ - "TreeItem", - "item" - ] - ] - }, - { - "result": "Int", - "name": "getItemRectY", - "parameters": [ - [ - "TreeItem", - "item" - ] - ] - }, - { - "result": "Int", - "name": "getItemRectW", - "parameters": [ - [ - "TreeItem", - "item" - ] - ] - }, - { - "result": "Int", - "name": "getItemRectH", - "parameters": [ - [ - "TreeItem", - "item" - ] - ] - }, - { - "result": "TreeItem", - "name": "getItemFromPoint", - "parameters": [ - [ - "Int", - "x" - ], - [ - "Int", - "y" - ] - ] - } - ], - "name": "GuiTree" - }, - "9B3B4B82667A420e8FFC794115809C02": { - "parent": "Object", - "functions": [ - { - "result": "Int", - "name": "getNumChildren", - "parameters": [] - }, - { - "result": "", - "name": "setLabel", - "parameters": [ - [ - "String", - "label" - ] - ] - }, - { - "result": "String", - "name": "getLabel", - "parameters": [] - }, - { - "result": "", - "name": "ensureVisible", - "parameters": [] - }, - { - "result": "TreeItem", - "name": "getNthChild", - "parameters": [ - [ - "Int", - "nth" - ] - ] - }, - { - "result": "TreeItem", - "name": "getChild", - "parameters": [] - }, - { - "result": "TreeItem", - "name": "getChildSibling", - "parameters": [ - [ - "TreeItem", - "_item" - ] - ] - }, - { - "result": "TreeItem", - "name": "getSibling", - "parameters": [] - }, - { - "result": "TreeItem", - "name": "getParent", - "parameters": [] - }, - { - "result": "", - "name": "editLabel", - "parameters": [] - }, - { - "result": "Int", - "name": "hasSubItems", - "parameters": [] - }, - { - "result": "", - "name": "setSorted", - "parameters": [ - [ - "Int", - "issorted" - ] - ] - }, - { - "result": "", - "name": "setChildTab", - "parameters": [ - [ - "Int", - "haschildtab" - ] - ] - }, - { - "result": "Int", - "name": "isSorted", - "parameters": [] - }, - { - "result": "Int", - "name": "isCollapsed", - "parameters": [] - }, - { - "result": "Int", - "name": "isExpanded", - "parameters": [] - }, - { - "result": "", - "name": "invalidate", - "parameters": [] - }, - { - "result": "Int", - "name": "isSelected", - "parameters": [] - }, - { - "result": "Int", - "name": "isHilited", - "parameters": [] - }, - { - "result": "", - "name": "setHilited", - "parameters": [ - [ - "Int", - "ishilited" - ] - ] - }, - { - "result": "Int", - "name": "collapse", - "parameters": [] - }, - { - "result": "Int", - "name": "expand", - "parameters": [] - }, - { - "result": "GuiTree", - "name": "getTree", - "parameters": [] - }, - { - "result": "", - "name": "onTreeAdd", - "parameters": [] - }, - { - "result": "", - "name": "onTreeRemove", - "parameters": [] - }, - { - "result": "", - "name": "onSelect", - "parameters": [] - }, - { - "result": "", - "name": "onDeselect", - "parameters": [] - }, - { - "result": "Int", - "name": "onLeftDoubleClick", - "parameters": [] - }, - { - "result": "Int", - "name": "onRightDoubleClick", - "parameters": [] - }, - { - "result": "Int", - "name": "onChar", - "parameters": [ - [ - "Int", - "key" - ] - ] - }, - { - "result": "", - "name": "onExpand", - "parameters": [] - }, - { - "result": "", - "name": "onCollapse", - "parameters": [] - }, - { - "result": "Int", - "name": "onBeginLabelEdit", - "parameters": [] - }, - { - "result": "Int", - "name": "onEndLabelEdit", - "parameters": [ - [ - "String", - "newlabel" - ] - ] - }, - { - "result": "Int", - "name": "onContextMenu", - "parameters": [ - [ - "Int", - "x" - ], - [ - "Int", - "y" - ] - ] - } - ], - "name": "TreeItem" - }, - "1D8631C880D047929F98BD5D36B49136": { - "parent": "GuiObject", - "functions": [ - { - "result": "", - "name": "onOpenMenu", - "parameters": [] - }, - { - "result": "", - "name": "onCloseMenu", - "parameters": [] - }, - { - "result": "", - "name": "onSelectItem", - "parameters": [ - [ - "String", - "item" - ] - ] - }, - { - "result": "", - "name": "openMenu", - "parameters": [] - }, - { - "result": "", - "name": "closeMenu", - "parameters": [] - } - ], - "name": "MenuButton" - }, - "C7ED319953194798986360B15A298CAA": { - "parent": "GuiObject", - "functions": [ - { - "result": "", - "name": "onToggle", - "parameters": [ - [ - "int", - "newstate" - ] - ] - }, - { - "result": "", - "name": "setChecked", - "parameters": [ - [ - "int", - "checked" - ] - ] - }, - { - "result": "Int", - "name": "isChecked", - "parameters": [] - }, - { - "result": "", - "name": "setText", - "parameters": [ - [ - "String", - "txt" - ] - ] - }, - { - "result": "String", - "name": "getText", - "parameters": [] - } - ], - "name": "CheckBox" - }, - "2D2D1376BE0A4CB9BC0C57E6E4C999F5": { - "parent": "GuiObject", - "functions": [ - { - "result": "Int", - "name": "getContentsHeight", - "parameters": [] - }, - { - "result": "", - "name": "newCell", - "parameters": [ - [ - "String", - "groupname" - ] - ] - }, - { - "result": "", - "name": "nextRow", - "parameters": [] - }, - { - "result": "", - "name": "deleteAll", - "parameters": [] - } - ], - "name": "Form" - }, - "E2BBC14D84F64173BDB3B2EB2F665550": { - "parent": "GuiObject", - "functions": [ - { - "result": "Int", - "name": "getPosition", - "parameters": [] - }, - { - "result": "", - "name": "setPosition", - "parameters": [ - [ - "Int", - "position" - ] - ] - }, - { - "result": "", - "name": "onSetPosition", - "parameters": [ - [ - "Int", - "position" - ] - ] - } - ], - "name": "Frame" - }, - "73C00594961F401B9B1B672427AC4165": { - "parent": "GuiObject", - "functions": [ - { - "result": "", - "name": "setMenuGroup", - "parameters": [ - [ - "String", - "groupId" - ] - ] - }, - { - "result": "String", - "name": "getMenuGroup", - "parameters": [] - }, - { - "result": "", - "name": "setMenu", - "parameters": [ - [ - "String", - "menuId" - ] - ] - }, - { - "result": "String", - "name": "getMenu", - "parameters": [] - }, - { - "result": "", - "name": "spawnMenu", - "parameters": [ - [ - "int", - "monitor" - ] - ] - }, - { - "result": "", - "name": "cancelMenu", - "parameters": [] - }, - { - "result": "", - "name": "setNormalId", - "parameters": [ - [ - "String", - "id" - ] - ] - }, - { - "result": "", - "name": "setDownId", - "parameters": [ - [ - "String", - "id" - ] - ] - }, - { - "result": "", - "name": "setHoverId", - "parameters": [ - [ - "String", - "id" - ] - ] - }, - { - "result": "", - "name": "onOpenMenu", - "parameters": [] - }, - { - "result": "", - "name": "onCloseMenu", - "parameters": [] - }, - { - "result": "", - "name": "nextMenu", - "parameters": [] - }, - { - "result": "", - "name": "previousMenu", - "parameters": [] - } - ], - "name": "Menu" - } -} \ No newline at end of file diff --git a/packages/webamp-modern-2/src/utils.ts b/packages/webamp-modern-2/src/utils.ts deleted file mode 100644 index 86895da0..00000000 --- a/packages/webamp-modern-2/src/utils.ts +++ /dev/null @@ -1,160 +0,0 @@ -import JSZip, { JSZipObject } from "jszip"; - -export function assert(condition: boolean, message: string) { - if (!condition) { - throw new Error(message); - } -} - -// While developing I want to clarify some assumptions. These are things which -// don't need to break the world, but I would like to know if/when my -// assumptions are invalidated. -// In the future these can be turned into warnings. -export function assume(condition: boolean, message: string) { - if (!condition) { - console.warn(message); - } - return condition; -} - -export function getCaseInsensitiveFile( - zip: JSZip, - filePath: string -): JSZipObject | null { - const normalized = filePath.replace(/[\/\\]/g, `[/\\\\]`); - return zip.file(new RegExp(normalized, "i"))[0] ?? null; -} - -export function num(str: string | void): number | null { - return str == null ? null : Number(str); -} - -export function px(size: number): string { - return `${size}px`; -} - -export function relative(size: number): string { - if (size === 0) return "100%"; - return `calc(100% + ${size}px)`; -} - -export function toBool(str: string) { - assert( - str === "0" || str === "1", - `Expected bool value to be "0" or "1", but it was "${str}".` - ); - return str === "1"; -} - -let id = 0; -export function getId(): number { - return id++; -} - -// TODO: Delete this once we have proper type coersion in the VM. -export function ensureVmInt(num: number): number { - return Math.floor(num); -} - -export function clamp(num: number, min: number, max: number): number { - return Math.max(min, Math.min(num, max)); -} - -export function normalizeDomId(id: string) { - return id.replace(/[^a-zA-Z0-9]/g, "-"); -} - -export function removeAllChildNodes(parent: Element) { - while (parent.firstChild) { - parent.removeChild(parent.firstChild); - } -} - -export function integerToTime(seconds: number): string { - const mins = Math.floor(seconds / 60); - const secs = String(Math.round(seconds % 60)).padStart(2, "0"); - return `${mins}:${secs}`; -} - -export function findLast( - arr: T[], - predicate: (value: T) => boolean -): T | undefined { - for (let i = arr.length - 1; i >= 0; i--) { - const value = arr[i]; - if (predicate(value)) { - return value; - } - } -} - -export function getUrlQuery(location: Location, variable: string): string { - return new URL(location.href).searchParams.get(variable); -} - -export const throttle = (fn: Function, wait: number = 300) => { - let inThrottle: boolean, - lastFn: ReturnType, - lastTime: number; - return function (this: any) { - const context = this, - args = arguments; - if (!inThrottle) { - fn.apply(context, args); - lastTime = Date.now(); - inThrottle = true; - } else { - clearTimeout(lastFn); - lastFn = setTimeout(() => { - if (Date.now() - lastTime >= wait) { - fn.apply(context, args); - lastTime = Date.now(); - } - }, Math.max(wait - (Date.now() - lastTime), 0)); - } - }; -}; - -/** - * Purpuse: to hold eventListeners - */ -export class Emitter { - _cbs: { [event: string]: Array } = {}; - - // call this to register a callback to a specific event - on(event: string, cb: Function) { - if (this._cbs[event] == null) { - this._cbs[event] = []; - } - this._cbs[event].push(cb); - - // return a function for later unregistering - return () => { - //TODO: consider using this.off(), or integrate both - this._cbs[event] = this._cbs[event].filter((c) => c !== cb); - }; - } - - // remove an registered callback from a specific event - off(event: string, cb: Function) { - if (this._cbs[event] == null) { - return; - } - const cbs = this._cbs[event]; - const index = cbs.indexOf(cb, 0); - if (index > -1) { - cbs.splice(index, 1); - } - } - - // call this to run registered callbacks of an event - trigger(event: string, ...args: any[]) { - const subscriptions = this._cbs[event]; - if (subscriptions == null) { - return; - } - for (const cb of subscriptions) { - cb(...args); - } - } -} diff --git a/packages/webamp-modern-2/tools/extract-object-types.js b/packages/webamp-modern-2/tools/extract-object-types.js deleted file mode 100644 index ed8faaee..00000000 --- a/packages/webamp-modern-2/tools/extract-object-types.js +++ /dev/null @@ -1,21 +0,0 @@ -import { parseFile } from "./parse-mi"; -import path from "path"; -import fs from "fs"; - -const compilers = path.join(__dirname, "../../../resources/maki_compiler/"); - -const lib566 = path.join(compilers, "v1.2.0 (Winamp 5.66)/lib/"); - -const files = { - pldir: path.join(lib566, "pldir.mi"), - config: path.join(lib566, "config.mi"), - std: path.join(lib566, "std.mi"), -}; - -Object.keys(files).forEach((name) => { - const sourcePath = files[name]; - const types = parseFile(sourcePath); - const destinationPath = path.join(__dirname, `../objectData/${name}.json`); - - fs.writeFileSync(destinationPath, JSON.stringify(types, null, 2)); -}); diff --git a/packages/webamp-modern-2/tsconfig.json b/packages/webamp-modern-2/tsconfig.json deleted file mode 100644 index c06e60a9..00000000 --- a/packages/webamp-modern-2/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "target": "es2015", - "esModuleInterop": true, - "allowJs": true, - "resolveJsonModule": true - } -} diff --git a/packages/webamp-modern/.babelrc b/packages/webamp-modern/.babelrc deleted file mode 100644 index ce4b793b..00000000 --- a/packages/webamp-modern/.babelrc +++ /dev/null @@ -1,44 +0,0 @@ -{ - "presets": [ - [ - "@babel/preset-env", - { - "useBuiltIns": "entry", - "corejs": "2", - "targets": { - "browsers": [ - "last 2 Chrome versions", - "last 2 ChromeAndroid versions", - "last 2 Safari versions", - "last 2 Firefox versions", - "last 2 Edge versions", - "last 2 iOS versions", - "last 2 Opera versions" - ] - } - } - ], - "@babel/preset-react", - "@babel/preset-typescript" - ], - "plugins": [ - "@babel/plugin-proposal-nullish-coalescing-operator", - "@babel/plugin-proposal-optional-chaining", - "@babel/plugin-proposal-object-rest-spread", - "@babel/plugin-proposal-class-properties" - ], - "env": { - "test": { - "plugins": [ - "@babel/plugin-transform-modules-commonjs", - "@babel/plugin-syntax-dynamic-import" - ] - }, - "library": { - "plugins": ["@babel/plugin-transform-runtime"] - }, - "production": { - "plugins": ["@babel/plugin-syntax-dynamic-import"] - } - } -} diff --git a/packages/webamp-modern/.eslintignore b/packages/webamp-modern/.eslintignore index 6a659d86..d1638636 100644 --- a/packages/webamp-modern/.eslintignore +++ b/packages/webamp-modern/.eslintignore @@ -1,6 +1 @@ -*.min.js -built/ -coverage/ -**/node_modules/ -examples/webpack/bundle.js -pacakges/tweetBot/env/ \ No newline at end of file +build/ \ No newline at end of file diff --git a/packages/webamp-modern/.eslintrc b/packages/webamp-modern/.eslintrc deleted file mode 100644 index 34669f84..00000000 --- a/packages/webamp-modern/.eslintrc +++ /dev/null @@ -1,164 +0,0 @@ -{ - "parser": "@typescript-eslint/parser", - "parserOptions": { - "jsx": true, - "sourceType": "module", - "ecmaFeatures": { - "jsx": true, - "experimentalObjectRestSpread": true - } - }, - "plugins": [ - "react", - "prettier", - "import", - "@typescript-eslint", - "react-hooks" - ], - "settings": { - "react": { - "version": "15.2" - }, - "import/resolver": { - "node": { - "extensions": [".js", ".ts", ".tsx"] - } - } - }, - "env": { - "node": true, - "amd": true, - "es6": true, - "jest": true - }, - // TODO: Consider removing some of these. - // https://github.com/facebook/create-react-app/pull/1840 - // Create React App and "Standard" only allow the following: - // * document - // * window - // * console - // * navigator - "globals": { - "window": true, - "document": true, - "console": true, - "navigator": true, - "alert": true, - "Blob": true, - "fetch": true, - "FileReader": true, - "Element": true, - "AudioNode": true, - "MutationObserver": true, - "Image": true, - "location": true - }, - "rules": { - "no-multiple-empty-lines": [ - "error", - { - "max": 2, - "maxEOF": 0, - "maxBOF": 0 - } - ], - "block-scoped-var": "warn", - "constructor-super": "error", - "dot-notation": "error", - "eqeqeq": ["error", "smart"], - "guard-for-in": "error", - "lines-between-class-members": [ - "warn", - "always", - { "exceptAfterSingleLine": true } - ], - "max-depth": ["warn", 4], - "max-params": ["warn", 5], - "new-cap": "error", - "no-caller": "error", - "no-catch-shadow": "error", - "no-const-assign": "error", - "no-debugger": "error", - "no-delete-var": "error", - "no-div-regex": "warn", - "no-dupe-args": "error", - "no-dupe-class-members": "error", - "no-dupe-keys": "error", - "no-duplicate-case": "error", - "no-duplicate-imports": "error", - "no-else-return": "error", - "no-empty-character-class": "error", - "no-eval": "error", - "no-ex-assign": "error", - "no-extend-native": "warn", - "no-extra-boolean-cast": "error", - "no-extra-semi": "error", - "no-fallthrough": "error", - "no-floating-decimal": "error", - "no-func-assign": "error", - "no-implied-eval": "error", - "no-inner-declarations": "error", - "no-irregular-whitespace": "error", - "no-label-var": "error", - "no-labels": "error", - "no-lone-blocks": "error", - "no-lonely-if": "error", - "no-multi-spaces": "warn", - "no-multi-str": "error", - "no-native-reassign": "error", - "no-negated-in-lhs": "warn", - "no-nested-ternary": "warn", - "no-new-object": "error", - "no-new-symbol": "error", - "no-new-wrappers": "error", - "no-obj-calls": "error", - "no-octal": "error", - "no-octal-escape": "error", - "no-proto": "error", - "no-redeclare": "error", - "no-shadow": "warn", - "no-spaced-func": "error", - "no-this-before-super": "error", - "no-throw-literal": "error", - "no-trailing-spaces": "error", - "no-undef": "error", - "no-undef-init": "error", - "no-unneeded-ternary": "error", - "no-unreachable": "error", - "no-unused-expressions": "error", - "@typescript-eslint/no-unused-vars": [ - "error", - { "ignoreRestSiblings": true } - ], - "no-useless-rename": "error", - "no-var": "error", - "no-with": "error", - "prefer-arrow-callback": "warn", - "prefer-const": "error", - "prefer-spread": "error", - "prefer-template": "warn", - "radix": "error", - "no-return-await": "error", - "react/no-string-refs": "error", - "react/jsx-boolean-value": "error", - "react/jsx-uses-react": "error", - "react/jsx-uses-vars": "error", - "react/prefer-es6-class": "error", - "react/jsx-pascal-case": "error", - "react/require-render-return": "error", - "react/self-closing-comp": "error", - "react/no-unescaped-entities": "error", - "use-isnan": "error", - "valid-typeof": "error", - "import/default": "error", - "import/export": "error", - "import/first": "error", - "import/named": "error", - "import/namespace": "error", - "import/no-duplicates": "error", - "import/no-extraneous-dependencies": "error", - "import/no-named-as-default-member": "error", - "react-hooks/rules-of-hooks": "error", - "react-hooks/exhaustive-deps": "error" - } -} diff --git a/packages/webamp-modern-2/.eslintrc.js b/packages/webamp-modern/.eslintrc.js similarity index 77% rename from packages/webamp-modern-2/.eslintrc.js rename to packages/webamp-modern/.eslintrc.js index 42a813f5..92cc655e 100644 --- a/packages/webamp-modern-2/.eslintrc.js +++ b/packages/webamp-modern/.eslintrc.js @@ -1,5 +1,5 @@ const rulesDirPlugin = require("eslint-plugin-rulesdir"); -rulesDirPlugin.RULES_DIR = "packages/webamp-modern-2/tools/eslint-rules/dist"; +rulesDirPlugin.RULES_DIR = "packages/webamp-modern/tools/eslint-rules/dist"; module.exports = { root: true, diff --git a/packages/webamp-modern/.gitignore b/packages/webamp-modern/.gitignore index 293baaae..d1638636 100644 --- a/packages/webamp-modern/.gitignore +++ b/packages/webamp-modern/.gitignore @@ -1,6 +1 @@ -**/node_modules - -/built -/coverage -/examples/webpack/bundle.js -**/__diff_output__/ +build/ \ No newline at end of file diff --git a/packages/webamp-modern/.prettierignore b/packages/webamp-modern/.prettierignore deleted file mode 100644 index a90e9ecf..00000000 --- a/packages/webamp-modern/.prettierignore +++ /dev/null @@ -1,6 +0,0 @@ -package.json -**/*.min.css -**/base-skin.css -built/* -coverage/* -examples/webpack/bundle.js diff --git a/packages/webamp-modern/README.md b/packages/webamp-modern/README.md index 20d6439d..8272b7f0 100644 --- a/packages/webamp-modern/README.md +++ b/packages/webamp-modern/README.md @@ -1,46 +1,67 @@ -# Modern Winamp Skins +## Running locally -This package is an experiment to see if we can bring "modern" Winamp skins to the browser. It's still very early. If you have any qeustions or are interested in getting involved, feel free to check out our [Discord server](https://discord.gg/mEcRbVq). +Assuming you have [Yarn](https://yarnpkg.com/) installed: -- We have a master task here which is sometimes up to date: https://github.com/captbaritone/webamp/issues/796 -- We have a shared Dropbox Paper doc with contains a grab bag of notes, but it will likely be hard to newcomers to read. You can find it [here](https://paper.dropbox.com/doc/Webamp-Modern-Skins-Notes--AgWp4Jwdobq13VLYYOgwJGOCAQ-UpeDNptmJ0t6aN1jlWbfU). -- We have a document with [meeting notes](https://paper.dropbox.com/doc/Meeting-Notes-lPgIliU4ZThefBT3J8g2a) from the few in-person meetings that Jordan Eldredge and Jordan Berg have had to discuss the project. - -## Maki Interpreter - -One of the biggest challenges to this project is that modern skins could define their own behavior by writing scripts in a custom language called Maki (Make a Killer Interface). One of the critical pieces of this project will be to write a working Maki interpreter and runtime in browser-compatible JavaScript. We have made good progress on this front. The work on that project lives in `src/maki-interpreter` and has its own [readme](./src/maki-interpreter/readme.md). - -One goal of this project is to document what we learn about the Maki language so that if others wish to travel down this path they will have an open source reference implementation and also better docs than we had. We've started that effort with out [Maki Language Spec](https://paper.dropbox.com/doc/Maki-Language-Spec--AlIjyyR70bQuNFJD7rIeuFfiAg-csainvAwSr3SBUXO5DWXy) document. Once the document stabalizes, we will likely convert it to Markdown and check it into this repository. - -Another way to document the behavior of Maki is to write automated tests in the form of Maki scripts. We have few of these so far, but intend to be more systematic about writing tests in the future. For now our tests can be found in `resources/maki_compiler/*/*.maki` and `src/maki-interpreter/fixtures/issue_*/*.maki`. - -## Standard Library - -In addition to the Maki interpreter, we also need an implementation of the Maki standard library. We have some portion of that implmented, but it's still very much a work in progress. You can find the code in `src/runtime/`. The definition for how these classes and methods should behave is derived from looking at the types defined in the `std.mi` file distributed with the Maki compiler. We have a file that contains a JSON representation of these types. It can be found in `src/objects.js`. That file is used for a few runtime checks (which I hope we can remove) but also to power some static analysis and tests. - -`src/objects.test.js` does some tests to double check that every method no prefixed with `_` or `js_` is a maki method. It also tracks which methods are still unimplemented in a Jest snapshot file. - -`eslint-local-rules.js` contains a custom [ESLint](https://eslint.org/) rule which uses the type definitions to check many of the same things that the Jest test checks, but also can make assertions about argument names and TypeScript types. This approach also has the advantage that it can automatically correct some errors and generate stubs for missing methods. - -We also have a tool for examining a corpus of modern skins an extracting which methods of the standard libary they use. This lives in `src/maki-interpreter/tools/extract-functions.js` it's not really built for anyone but Jordan to run, so it has a few paths hard coded into it. This could be fixed if somebody else had the interest. By running `yarn analyze-wals` it will look in a specific hard-coded folder for skins and extract method data from them. It will then write that data to `resources/maki-skin-data.json`. This data is invaluable for prioritizing which methods we should implement next. Some methods are only used by a very small number of skins. Others are not used at all. - -The data extracted by the `extract-functions.js` utility and the list of unimplmented methods which is validated by `src/objects.test.js` can be visualized visiting [https://webamp.org/ready/](https://webamp.org/ready/) or `localhost:8080/ready` if developing locally. This dashboard makes it very easy to see current progress and explore the usage of different methods. Keep in mind that as of this writting some ~20% of `.maki` files fail to parse, so the data on this page represents a lower bound of actual usage. - -## Architecture - -How we tie together our standard library implementation, the interpreter and the DOM (React) is still not a solved problem. We have stuff working, but we are not sure it's the right approach. We are currently doing work to move toward what we are calling [Mutable XML Tree](https://paper.dropbox.com/doc/A-Third-Way-Mutable-XML-Tree-vx3iPfGIBmSHEDJSMh0bn) architecture but, to be honest, we are not 100% this will actually work. - -## Running - -This experiment is now built as part of the main Webamp project. To run it locally you just need to do the following from the repositories root directory: - -``` +```bash +cd packages/webamp-modern-2 yarn yarn start ``` -Then open: `http://localhost:8080/`. +## Performance Improvements -## Tests +- [ ] We could use WebGL to try to improve the speed of switching gamma colors +- [ ] We could use some CSS techniques to avoid having to appply inline style to each BitmapFont character's DOM node. +- [ ] We should profile the parse phase to see what's taking time. Perhaps there's some sync image work that could be done lazily. +- [ ] Remove some paranoid validation in the VM. +- [ ] Consider throttling time updates coming from audio -This experiments tests are run as part of the main Webamp test suite. To run all tests just run: `yart test`. +# TODO Next + +- [ ] Why doesn't scrolling work property in MMD3? +- [ ] Implement proper color + - [ ] Move gammacolor to GPU +- [ ] Requires VM + - [ ] Look at componentbucket (Where can I find the images) + - [ ] How is the scroll window for colors supposed to work? + - [ ] How is the position slider supposed to work? +- [ ] Standardize handling of different type condition permutations in interpreter +- [ ] Implement EQ +- [ ] Implament global actions + - [ ] TOGGLE + - [ ] MINIMIZE +- [ ] Allow for skins which don't have gamma sets +- [ ] Figure out if global NULL is actually typed as INT in Maki. I suspect there is no NULL type, but only an INT who happens to be zero. +- [ ] Fix all `// FIXME` +- [ ] SystemObject.getruntimeversion +- [ ] SystemObject.getskinname +- [ ] Handle clicking through transparent: https://stackoverflow.com/questions/38487569/click-through-png-image-only-if-clicked-coordinate-is-transparent + +# TODO Some day + +- [ ] Handle case (in)sensitivity of includes. +- [ ] Handle forward/backward slashes issues (if they exist) + +## Known Bugs + +- [ ] In GuiObj's handling of left click, it's possible for the y/x of the click event to fall outside of the element being clicked. To repro click just above the volume2 of MMD3. Y can be one pixel above the clientBoundingRect of the element. Why? + +# Phases of Initialization + +## Asset Parse + +Starting with `skin.xml`, and inlining each `` we parse XML. As we go, we initialize GUI objects and attach them to their parent. During this phase we also encounter other asset files like Maki script, images, and fonts. These are parsed as they are encountered and setaside into a look-aside table (Maki scripts might live in the tree...). + +This phase is `async` since it may require reading files from zip or doing image/font manipulation which is inherently `async`. + +## Object Initialization + +Once all look-aside tables are populated, we notify all GUI objects to initialize themselves by propogating from the root of the tree to the leaves. Each node is reponsible for notifying its children. In this phase components pull images/scripts/fonts out of their look-aside tables. [Question: Could these just be lazy?]. At this point we also hook up any event bindings/hooks that exist in Maki. + +## Maki Initialization + +Once all nodes have been initialized, we trigger/dispatch `System.onScriptLoaded` for each Maki script. + +## First paint + +Now we can begin panting diff --git a/packages/webamp-modern-2/assets/.gitignore b/packages/webamp-modern/assets/.gitignore similarity index 100% rename from packages/webamp-modern-2/assets/.gitignore rename to packages/webamp-modern/assets/.gitignore diff --git a/packages/webamp-modern-2/assets/CornerAmp_Redux.wal b/packages/webamp-modern/assets/CornerAmp_Redux.wal similarity index 100% rename from packages/webamp-modern-2/assets/CornerAmp_Redux.wal rename to packages/webamp-modern/assets/CornerAmp_Redux.wal diff --git a/packages/webamp-modern-2/assets/Default_winamp3_build499.wal b/packages/webamp-modern/assets/Default_winamp3_build499.wal similarity index 100% rename from packages/webamp-modern-2/assets/Default_winamp3_build499.wal rename to packages/webamp-modern/assets/Default_winamp3_build499.wal diff --git a/packages/webamp-modern-2/assets/MMD3.wal b/packages/webamp-modern/assets/MMD3.wal similarity index 100% rename from packages/webamp-modern-2/assets/MMD3.wal rename to packages/webamp-modern/assets/MMD3.wal diff --git a/packages/webamp-modern-2/assets/WinampModern566.wal b/packages/webamp-modern/assets/WinampModern566.wal similarity index 100% rename from packages/webamp-modern-2/assets/WinampModern566.wal rename to packages/webamp-modern/assets/WinampModern566.wal diff --git a/packages/webamp-modern-2/assets/favicon.ico b/packages/webamp-modern/assets/favicon.ico similarity index 100% rename from packages/webamp-modern-2/assets/favicon.ico rename to packages/webamp-modern/assets/favicon.ico diff --git a/packages/webamp-modern/config/jest.unit.js b/packages/webamp-modern/config/jest.unit.js deleted file mode 100644 index fe358d3b..00000000 --- a/packages/webamp-modern/config/jest.unit.js +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = { - displayName: "test", - rootDir: "../", - testRegex: "\\.test\\.(js|ts|tsx)$", - globals: { - SENTRY_DSN: null, - }, - moduleFileExtensions: ["js", "tsx", "ts"], - moduleNameMapper: { - // "\\.css$": "/js/__mocks__/styleMock.js", - // "\\.wsz$": "/js/__mocks__/fileMock.js", - // "\\.mp3$": "/js/__mocks__/fileMock.js", - }, - transform: { - "^.+\\.(js|ts|tsx)$": "babel-jest", - }, - testPathIgnorePatterns: ["/node_modules/"], -}; diff --git a/packages/webamp-modern/config/webpack.common.js b/packages/webamp-modern/config/webpack.common.js deleted file mode 100644 index 702caaad..00000000 --- a/packages/webamp-modern/config/webpack.common.js +++ /dev/null @@ -1,74 +0,0 @@ -const path = require("path"); -const HtmlWebpackPlugin = require("html-webpack-plugin"); - -module.exports = { - resolve: { - extensions: [".js", ".ts", ".tsx"], - }, - module: { - rules: [ - { - test: /\.css$/, - use: [ - "style-loader", - { loader: "css-loader", options: { importLoaders: 1 } }, - // We really only need this in prod. We could find a way to disable it in dev. - ], - }, - { - test: /\.(js|ts|tsx)?$/, - exclude: /(node_modules)/, - use: { - loader: "babel-loader", - options: { - envName: "production", - }, - }, - }, - { - test: /\.(wsz|wal|mp3|png|ico|jpg|svg)$/, - use: [ - { - loader: "file-loader", - options: { - emitFile: true, - name: "[path][name]-[hash].[ext]", - }, - }, - ], - }, - ], - noParse: [/jszip\.js$/], - }, - plugins: [ - new HtmlWebpackPlugin({ - filename: "index.html", - template: "./index.html", - chunks: ["modern"], - }), - // Ideally we could just do this via client-side routing, but it's tricky - // with both the real app and this sub directory. So we just hack it to - // duplicate the html file in both places and move on with our lives. - new HtmlWebpackPlugin({ - filename: "./ready/index.html", - template: "./index.html", - chunks: ["modern"], - }), - ], - - performance: { - // We do some crazy shit okay! Don't judge! - maxEntrypointSize: 7000000, - maxAssetSize: 7000000, - }, - entry: { - modern: ["./src/index.js"], - }, - context: path.resolve(__dirname, "../"), - output: { - filename: "[name]-[hash].js", - chunkFilename: "[name]-[hash].js", - publicPath: "/", - path: path.resolve(__dirname, "../built"), - }, -}; diff --git a/packages/webamp-modern/config/webpack.dev.js b/packages/webamp-modern/config/webpack.dev.js deleted file mode 100644 index 9bb2b4f6..00000000 --- a/packages/webamp-modern/config/webpack.dev.js +++ /dev/null @@ -1,10 +0,0 @@ -const merge = require("webpack-merge"); -const common = require("./webpack.common.js"); - -module.exports = merge(common, { - devtool: "source-map", - mode: "development", - devServer: { - overlay: true, - }, -}); diff --git a/packages/webamp-modern/config/webpack.prod.js b/packages/webamp-modern/config/webpack.prod.js deleted file mode 100644 index 7cafcfea..00000000 --- a/packages/webamp-modern/config/webpack.prod.js +++ /dev/null @@ -1,10 +0,0 @@ -const merge = require("webpack-merge"); - -const common = require("./webpack.common.js"); - -const config = merge(common, { - devtool: "source-map", - mode: "production", -}); - -module.exports = config; diff --git a/packages/webamp-modern/index.html b/packages/webamp-modern/index.html deleted file mode 100644 index ac3810b3..00000000 --- a/packages/webamp-modern/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - Webamp · Modern Skin Rendering Experiment [PRE-ALPHA] - - - -
- - diff --git a/packages/webamp-modern/maki.md b/packages/webamp-modern/maki.md deleted file mode 100644 index 4d56da5b..00000000 --- a/packages/webamp-modern/maki.md +++ /dev/null @@ -1,259 +0,0 @@ -# MAKI - -In the process of starting to build support for "modern" Winamp skins for Webamp, we built an interpreter for MAKI (Make A Killer Interface) byte code, the scripting language used for adding custom functionality to modern Winamp skins. - -Most of what we learned came from the Ralf Engels' [Maki Decompiler](http://www.rengels.de/maki_decompiler/) (which seems to be offline at the moment) and trial and error testing of what the compiler output. - -My goal here is to document the structure and semantics of the compiled `.maki` file that the MAKI compiler outputs and Winamp interprerates. - -## Notation - -- Terminal symbols are written in **bold** -- Nonterminal symbols are written in _italics_ -- Productions are written _sym_ ::= A B C -- Vectors are written as vec(_A_) where _A_ is the production being enumerated. - -### _u16_ - -TODO: Clarify encoding. - -Encoded as little endien. - -### _u32_ - -TODO: Clarify encoding. - -Encoded as little endien. - -### _Vector_ - -_Vectors_ are encoded with their _u32_ length followed by the encoding of their element sequence. - -### _String_ - -A string is encoded as a _u16_ indicating the length of the string n followed by n bytes of ASCII. - -## Module Sections - -_module_ ::= _header_ _classes_ _methods_ _variables_ _constants_ _bindings_ _codes_ - -A module (file) consists of the above seven consecutive sections. - -## Header - -_header_ ::= _magic_ _moduleVersion_ _extraVersion_ - -_magic_ ::= **`0x46`** **`0x47`** - -_moduleVersion_ ::= _u16_ -_extraVersion_ ::= _u32_ - -The _magic_ that beings the header consists of the binary representation of the ASCII characters "FG". I'm not sure what, if any, significance there is to this choice. These characters are simply here for the parser to validate that it's actually geting a `.maki` file. - -_moduleVersion_ represents the version of the compiler with which this module was compiled. - -_extraVersion_ is unused. I suspect that it may be additional version information, but I don't know for sure. - -## Classes - -_classes_ ::= vec(_identifier_) -_identifier_ ::= _u32_ _u32_ _u32_ _u32_ - -The _identifier_ represents the unique ID found in the `std.mi` against which the module was compiled. The hex string can be computed by interpreting each _u32_ as a hex string (left padded to 8 characters) and then concatenating them. - -Note: The ASCII representation we construct above may not directly match that found in `std.mi` due to the [oddities of UUID encoding](https://en.wikipedia.org/wiki/Universally_unique_identifier#Encoding). We use the following function to map from our representation to the one fond in `std.mi`: - -```JavaScript -function getFormattedId(id) { - // https://en.wikipedia.org/wiki/Universally_unique_identifier#Encoding - const formattedId = id.replace( - /(........)(....)(....)(..)(..)(..)(..)(..)(..)(..)(..)/, - "$1$3$2$7$6$5$4$11$10$9$8" - ); - return formattedId.toLowerCase(); -} -``` - -## Methods - -_methods_ ::= vec(_method_) -_method_ ::= _classCode_ _extraClassCode_ _string_ -_classCode_ ::= _u16_ -_extraClassCode_ ::= _u16_ - -We use `classCode & 0xff` to derive the "class offset" and then discard/ignore `_extraClassCode_. It's possible that this is actually intended to be parsed as a single _u32_ and we just did something wrong. - -The "class offset" is an offset into the _classes_ vector and indicates to which class this method belongs. - -The final _string_ is the name of this method. - -## Variables - -_variables_ ::= vec(_variable_) -_variable_ ::= _typeOffset_ _object_ _subclass_ _uint1_ _uint2_ _uint3_ _uint4_ _global_ _system_ -_typeOffset_ ::= **byte** -_object_ ::= **byte** -_subclass_ ::= _u16_ -_uint1_ ::= _u16_ -_uint2_ ::= _u16_ -_uint3_ ::= _u16_ -_uint4_ ::= _u16_ -_global_ ::= **byte** -_system_ ::= **byte** - -Each variable declared here is an entry in our variables table. There are three different types of variables: subclasses, objects, and primitives. - -Our interpretation of _variables_ is a bit squirrely but does seem to work according to our tests. Our method of determining which type we have seems suspect and there are number of bytes which go completely ignored. - -### Subclass - -If _subclass_ is truthy, this variable is a subclass and _typeOffset_ represents an earlier offset into _variables_ which is this variables superclass. - -_global_ indicates if this variable is global. - -In the subclass case all other values are ignored. - -### Object - -If _object_ is truthy, this variable is an object and _typeOffset_ is an offset into the _classes_ vector which is this variables type. - -_global_ indicates if this variable is global. - -In the object case all other values are ignored. - -### Primitives - -If a variable is neithe a subclass nor an object, it is a primitive. _typeOffset_ determines which type of primitive it is. There are at least five types of primitives: - -- Int (2) -- Float (3) -- Double (4) -- Boolean (5) -- String (6) - -The fact that index 0 and 1 are not used is confusing, but in our testing we did not discover any `.maki` files that referenced them. - -If _typeOffset_ is **2** this variable is an Int and its value can be found in _uint1_. - -If _typeOffset_ is **3** this variable is a Float. We use the following function to derive the floating value from _uint1_ and _uint2_: - -```JavaScript -function decodeFloat(uint1, unint2) { - const exponent = (uint2 & 0xff80) >> 7; - const mantisse = ((0x80 | (uint2 & 0x7f)) << 16) | uint1; - return mantisse * 2.0 ** (exponent - 0x96); -} -``` - -If _typeOffset_ is **4** this variable is a Double. We currently derive the value exactly the same as we do for floats. This is likely wrong. Probably we should also be looking at _uint3_ and _uint4_. - -If _typeOffset_ is **5** this variable is a Boolean and its value can be found in _uint1_. - -If _typeOffset_ is **6** this variable is a String. The actual string will be found in the _constants_ section which will reference this variable via its offset in the _variables_ vector. - -## Constants - -_constants_ ::= vec(_constant_) -_constant_ ::= _variableOffset_ _string_ -_variableOffset_ ::= _u32_ - -String constants are encoded in this section. _variableOffset_ is the offset into the _variables_ vector that is a string and has this string as its initial value. - -_string_ is the actual value. - -## Bindings - -_bindings_ ::= vec(_binding_) -_binding_ ::= _variableOffset_ _methodOffset_ _binaryOffset_ -_methodOffset_ ::= _u32_ -_binaryOffset_ ::= _u32_ - -MAKI allows you to define behavior for events on an instance of an object. These are represented as _bindings_ in the byte code. - -_variableOffset_ is an offset into the _variables_ vector. It indicates the instance to which this binding is attached. - -_methodOffset_ is an offset into the _methods_ vector and indicates the method on object instance that will be called. - -_binaryOffset_ is the byte offset into the _codes_ section where the opcodes for this method begin. - -## Code - -_codes_ ::= _codeLength_ _code_ -_codeLength_ ::= _u32_ - -_codeLength_ indicates the byte size of _code_. - -_code_ is made up of a stream of opcodes, some of which include an "immediate" values. For the opcodes that do include an immediate, the immediate is encoded as a _u32_. See the Opcodes table below for a list of opcodes and their behavior. - -There are a few small quirks to reading _code_ which I _beleive_ have to do with stack protection, but I honestly don't understand them. - -After we parse each opcode, we must peek at the next _u32_. If it's `>= 0xffff0000` and `<= 0xffff000f`, then we must consume that _u32_ and throw it away. - -After parsing opcode `112` we must consume and throw away a single **byte**. I don't know why or what that byte might contain. - -## Opcodes - -Opcodes may or may not have an associated immediate value. If it does, there are a number of different types: - -- var: Offset into the _variables_ vector -- inst: Relative instruction pointer (ip) value -- method: Offset into the _methods_ vector -- class: Offset into the _classes_ vector - -| Opcode | Name | Immediate | Behavior | -| ------ | ----------- | --------- | ------------------------------------------------------------------------------ | -| 1 | push | var | Pushes variable onto the stack | -| 2 | pop | | Pops a variable off the stack and discards it | -| 3 | popTo | var | Pops a variable off the stack stores it into var | -| 8 | eq | | Pops a and b. Leaves a == b on the stack | -| 9 | neq | | Pops a and b. Leaves a != b on the stack | -| 10 | gt | | Pops a and b. Leaves a > b on the stack | -| 11 | gte | | Pops a and b. Leaves a >= b on the stack | -| 12 | lt | | Pops a and b. Leaves a < b on the stack | -| 13 | lte | | Pops a and b. Leaves a <= b on the stack | -| 16 | jumpIf | inst | Pops a value and jumps to inst if it is _false_ | -| 17 | jumpIfNot | inst | Pops a value and jumps to inst if it is _true_ | -| 18 | jump | inst | Jumps to inst | -| 24 | call | method | Pops off a value for each arg and one for the object | -| 112 | strangeCall | method | Same as above? Not sure why this is different. | -| 25 | callGlobal | inst | Jump to inst and execute until return, leaves returned value on the stack | -| 33 | return | | Pops value off stack and returns it to caller | -| 40 | complete | | ? | -| 48 | mov | | Pops a and b, and assigns variable b the value of a. Leaves value on the stack | -| 56 | postinc | | Pops a variable, increments it, and pushes original value back on the stack | -| 57 | postdec | | Pops a variable, decrements it, and pushes original value back on the stack | -| 58 | preinc | | Pops a variable, increments it, and pushes new value back on the stack | -| 59 | postinc | | Pops a variable, decrements it, and pushes new value back on the stack | -| 64 | add | | Pops a and b. Leaves a + b on the stack | -| 65 | sub | | Pops a and b. Leaves a - b on the stack | -| 66 | mul | | Pops a and b. Leaves a \* b on the stack | -| 67 | div | | Pops a and b. Leaves a / b on the stack | -| 68 | mod | | Pops a and b. Leaves a % b on the stack | -| 72 | band | | Pops a and b. Leaves a & b on the stack | -| 73 | bor | | Pops a and b. Leaves a \| b on the stack | -| 74 | not | | Pops a. Leaves !a | -| 76 | neg | | Pops a. Leaves -a | -| 80 | land | | Pops a and b. Leaves a && b | -| 81 | lor | | Pops a and b. Leaves a \|\| b | -| 88 | shiftl | | Pops a and b. Leaves a << b | -| 89 | shiftr | | Pops a and b. Leaves a >> b | -| 96 | new | class | Constructs a new instance of class and leaves it on the stack | -| 97 | delete | | Pops variable off the stack and deletes it | - -## TODO - -- Document int8 production rule -- Document u16 production rule -- Document u32 production rule -- Can we get a sample of what _extraVersion_ contains? -- What are the four 32s of an _identifier_? -- Could _extraClassCode_ actually be the second half of _classCode_? -- What happens if we try to encode an int larger than uint16? Do we spill over into uint2? -- What happens if we try to encode a negative int? -- What happens if we try to encode a high precision float? Does it spill over into uint3 or uint4? -- Are we really limited to 255 classes/superclasses. Can we test these cases? It seems like _typeOffset_ is just a byte so we fail if we had more. -- Do we know what _sytem_ means? -- Can we express variables using explicit productions? -- Does _subclass_ have an interesting value when it's true? -- Does _object_ have an interesting value when it's true? -- What is the byte the follows a strangecall? diff --git a/packages/webamp-modern/package.json b/packages/webamp-modern/package.json index 6d2f7caf..658996ea 100644 --- a/packages/webamp-modern/package.json +++ b/packages/webamp-modern/package.json @@ -1,130 +1,34 @@ { "name": "webamp-modern", - "version": "0.0.0", - "description": "Winamp Modern Skins in the browser", - "scripts": { - "lint-fix": "eslint . --ext ts,tsx,js --fix", - "lint": "eslint . --ext ts,tsx,js --rulesdir=eslint", - "type-check": "tsc", - "serve": "http-server ./built", - "start": "webpack-dev-server --open --config=config/webpack.dev.js", - "format": "prettier --write \"**/*.{js,ts,tsx,d.ts,css}\"", - "analyze-wals": "babel-node --extensions=\".ts,.js,.tsx\" src/maki-interpreter/tools/extract-functions.js > resources/maki-skin-data.json", - "extract-object-types": "babel-node --extensions=\".ts,.js,.tsx\" src/maki-interpreter/tools/extract-object-types.js", - "extract-attributes": "babel-node --extensions=\".ts,.js,.tsx\" src/maki-interpreter/tools/extract-attributes.js > resources/attribute-skin-data.json", - "maki-interfaces": "babel-node --extensions=\".ts,.js,.tsx\" src/maki-interpreter/tools/build-typescript-interfaces.js > __generated__/makiInterfaces.ts" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/captbaritone/webamp.git" - }, - "keywords": [ - "Winamp", - "HTML5", - "audio", - "web-audio-api" - ], - "author": "Jordan Eldredge ", + "version": "1.0.0", + "main": "index.js", "license": "MIT", - "bugs": { - "url": "https://github.com/captbaritone/webamp/issues" + "scripts": { + "start": "snowpack dev", + "build": "snowpack build", + "serve": "http-server ./built", + "lint": "yarn build-lint && eslint . --ext .js,.jsx,.ts,.tsx", + "test": "yarn jest", + "extract-object-types": "node tools/extract-object-types.js", + "extract-attributes": "babel-node --extensions=\".ts,.js,.tsx\" src/maki-interpreter/tools/extract-attributes.js > resources/attribute-skin-data.json", + "maki-interfaces": "babel-node --extensions=\".ts,.js,.tsx\" src/maki-interpreter/tools/build-typescript-interfaces.js > __generated__/makiInterfaces.ts", + "analyze-wals": "babel-node --extensions=\".ts,.js,.tsx\" src/maki-interpreter/tools/extract-functions.js > resources/maki-skin-data.json", + "build-lint": "tsup tools/eslint-rules/proper-maki-types.ts -d tools/eslint-rules/dist --no-splitting --minify" }, - "homepage": "https://github.com/captbaritone/webamp/", "devDependencies": { - "@babel/core": "^7.7.2", - "@babel/node": "^7.0.0", - "@babel/plugin-proposal-class-properties": "^7.0.0", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.4.4", - "@babel/plugin-proposal-object-rest-spread": "^7.0.0", - "@babel/plugin-proposal-optional-chaining": "^7.6.0", - "@babel/plugin-syntax-dynamic-import": "^7.0.0", - "@babel/plugin-transform-modules-commonjs": "^7.0.0", - "@babel/plugin-transform-runtime": "^7.0.0", - "@babel/polyfill": "^7.7.0", - "@babel/preset-env": "^7.7.1", - "@babel/preset-react": "^7.7.0", - "@babel/preset-typescript": "^7.7.2", - "@babel/runtime": "^7.7.2", - "@sentry/browser": "5.9.1", - "@types/classnames": "^2.2.6", - "@types/css-font-loading-module": "^0.0.2", - "@types/fscreen": "^1.0.1", - "@types/invariant": "^2.2.29", - "@types/jszip": "^3.1.5", - "@types/lodash": "^4.14.116", - "@types/lodash-es": "^4.17.1", - "@types/rc-slider": "^8.6.3", - "@types/react": "^16.8.13", - "@types/react-dom": "^16.8.4", - "@types/react-redux": "^7.1.1", - "@types/webaudioapi": "^0.0.27", - "@typescript-eslint/eslint-plugin": "^2.6.1", - "@typescript-eslint/parser": "^2.7.0", - "babel-core": "7.0.0-bridge.0", - "babel-eslint": "^9.0.0-beta.3", - "babel-loader": "^8.0.4", - "butterchurn": "^2.6.7", - "canvas-mock": "0.0.0", - "classnames": "^2.2.5", - "copy-webpack-plugin": "^4.6.0", - "css-loader": "^1.0.1", - "cssnano": "^4.1.10", - "data-uri-to-buffer": "^2.0.0", - "eslint": "^6.5.1", - "eslint-plugin-import": "^2.18.2", - "eslint-plugin-react": "^7.16.0", - "file-loader": "^2.0.0", - "git-revision-webpack-plugin": "^3.0.3", - "glob": "^7.1.4", - "html-webpack-inline-svg-plugin": "^1.2.4", - "html-webpack-plugin": "^3.2.0", - "http-server": "^0.11.1", - "imagemin": "^6.1.0", - "imagemin-optipng": "^6.0.0", - "invariant": "^2.2.3", - "jszip": "^3.1.3", - "lodash": "^4.17.21", - "milkdrop-preset-converter-aws": "^0.1.6", - "music-metadata-browser": "^0.6.1", - "postcss": "^8.2.10", - "postcss-loader": "^3.0.0", - "puppeteer": "^1.15.0", - "rc-slider": "^8.7.1", - "react-redux": "^7.1.0", - "react-test-renderer": "^16.8.1", - "redux": "^4.0.1", - "redux-devtools-extension": "^2.13.2", - "redux-thunk": "^2.3.0", - "reselect": "^3.0.1", - "screenfull": "^4.0.0", - "style-loader": "^0.23.1", - "tinyqueue": "^1.2.3", - "typescript": "^3.7.2", - "url-loader": "^1.1.2", - "webpack": "^4.41.2", - "webpack-bundle-analyzer": "^3.3.2", - "webpack-cli": "^3.1.2", - "webpack-dev-server": "^3.8.2", - "webpack-merge": "^4.1.2", - "winamp-eqf": "^1.0.0" - }, - "jest": { - "globalSetup": "jest-environment-puppeteer/setup", - "globalTeardown": "jest-environment-puppeteer/teardown", - "projects": [ - "config/jest.*.js" - ] - }, - "prettier": { - "trailingComma": "es5" + "@types/eslint": "^7.2.14", + "@types/estree": "^0.0.50", + "@typescript-eslint/eslint-plugin": "^4.28.2", + "@typescript-eslint/parser": "^4.28.2", + "eslint": "^7.30.0", + "eslint-plugin-rulesdir": "^0.2.0", + "snowpack": "^3.5.5", + "tsup": "^4.12.5", + "typescript": "^4.3.5" }, + "prettier": {}, "dependencies": { - "eslint-plugin-react-hooks": "^2.1.2", - "fscreen": "^1.0.2", - "react": "^17.0.1", - "react-dom": "^17.0.1", - "react-dropzone": "^10.1.7", - "redux-sentry-middleware": "^0.1.3", - "xml-js": "^1.6.11" + "@rgrove/parse-xml": "^3.0.0", + "jszip": "^3.6.0" } } diff --git a/packages/webamp-modern/skins/CornerAmp_Redux.wal b/packages/webamp-modern/skins/CornerAmp_Redux.wal deleted file mode 100644 index 7b7f2166..00000000 Binary files a/packages/webamp-modern/skins/CornerAmp_Redux.wal and /dev/null differ diff --git a/packages/webamp-modern/skins/simple.wal b/packages/webamp-modern/skins/simple.wal deleted file mode 100644 index bf85b87b..00000000 Binary files a/packages/webamp-modern/skins/simple.wal and /dev/null differ diff --git a/packages/webamp-modern-2/snowpack.config.js b/packages/webamp-modern/snowpack.config.js similarity index 100% rename from packages/webamp-modern-2/snowpack.config.js rename to packages/webamp-modern/snowpack.config.js diff --git a/packages/webamp-modern/src/Actions.ts b/packages/webamp-modern/src/Actions.ts deleted file mode 100644 index d26b4e4e..00000000 --- a/packages/webamp-modern/src/Actions.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { - MakiTree, - ModernAction, - ModernStore, - XmlTree, - XmlNode, - Thunk, -} from "./types"; -import JSZip from "jszip"; -import * as Utils from "./utils"; -import initialize from "./initialize"; -import initializeStateTree from "./initializeStateTree"; -import { run } from "./maki-interpreter/virtualMachine"; -import System from "./runtime/System"; -import runtime from "./runtime"; -import MakiObject from "./runtime/MakiObject"; -import JsScript from "./runtime/JsScript"; - -export function setMakiTree(makiTree: MakiTree): ModernAction { - return { type: "SET_MAKI_TREE", makiTree }; -} - -export function setXmlTree(xmlTree: XmlTree): Thunk { - return async (dispatch) => { - dispatch({ - type: "SET_XML_TREE", - xmlTree: await initializeStateTree(xmlTree), - }); - }; -} - -export function gotSkinUrl(skinUrl: string, store: ModernStore): Thunk { - return async (dispatch) => { - const resp = await fetch(skinUrl); - dispatch(gotSkinBlob(await resp.blob(), store)); - }; -} - -export function gotSkinBlob(blob: Blob, store: ModernStore): Thunk { - return async (dispatch) => { - dispatch(gotSkinZip(await JSZip.loadAsync(blob), store)); - }; -} - -async function unloadSkin(makiTree: MakiTree): Promise { - await Utils.asyncTreeFlatMap(makiTree, async (node: MakiObject) => { - if (node instanceof JsScript && node.system) { - node.system.onscriptunloading(); - } - - return node; - }); -} - -export function gotSkinZip(zip: JSZip, store: ModernStore): Thunk { - return async (dispatch) => { - // unload current skin if one has been loaded - if (store.getState().modernSkin.skinLoaded) { - await unloadSkin(store.getState().modernSkin.makiTree); - dispatch({ type: "SKIN_UNLOADED" }); - } - - const skinXml = await Utils.readXml(zip, "skin.xml"); - if (skinXml == null) { - throw new Error("Could not find skin.xml in skin"); - } - const rawXmlTree = await Utils.inlineIncludes(skinXml, zip); - const xmlTree = Utils.mapTreeBreadth( - rawXmlTree, - (node: XmlNode, parent: XmlNode) => { - return { ...node, uid: Utils.getId(), parent }; - } - ); - - dispatch(setXmlTree(xmlTree)); - - const makiTree: MakiObject = await initialize(zip, xmlTree); - // Execute scripts - await Utils.asyncTreeFlatMap(makiTree, async (node: MakiObject) => { - if (!(node instanceof JsScript)) { - return node; - } - const scriptPath = node.getScriptPath(); - if (scriptPath == null) { - return node; - } - if (scriptPath.endsWith("standardframe.maki")) { - // TODO: stop ignoring standardframe - return node; - } - - // removes groupdefs from consideration (only run scripts when actually referenced by group) - if (Utils.findParentNodeOfType(node, new Set(["groupdef"]))) { - return node; - } - const scriptGroup = Utils.findParentNodeOfType( - node, - new Set(["group", "winampabstractionlayer", "wasabixml"]) - ); - node.system = new System(scriptGroup, store); - const script = await Utils.readUint8array(zip, scriptPath); - if (script == null) { - console.warn(`Unable to find script at ${scriptPath}`); - return node; - } - run({ - runtime, - data: script, - system: node.system, - log: false, - }); - return node; - }); - - dispatch(setMakiTree(makiTree)); - }; -} - -export function setVolume(volume: number): ModernAction { - return { type: "SET_VOLUME", volume }; -} diff --git a/packages/webamp-modern/src/App.css b/packages/webamp-modern/src/App.css deleted file mode 100644 index 827b8978..00000000 --- a/packages/webamp-modern/src/App.css +++ /dev/null @@ -1,3 +0,0 @@ -#root { - image-rendering: pixelated; -} diff --git a/packages/webamp-modern/src/App.js b/packages/webamp-modern/src/App.js deleted file mode 100644 index 84cf8307..00000000 --- a/packages/webamp-modern/src/App.js +++ /dev/null @@ -1,128 +0,0 @@ -import React, { Suspense } from "react"; -import "./App.css"; -import * as Actions from "./Actions"; -import * as Selectors from "./Selectors"; -// import simpleSkin from "../skins/simple.wal"; -import cornerSkin from "../skins/CornerAmp_Redux.wal"; -import { useDispatch, useSelector, useStore } from "react-redux"; -import DropTarget from "./components/DropTarget"; -import { Maki } from "./MakiRenderer"; -const Dashboard = React.lazy(() => import("./Dashboard")); - -const skinUrls = [ - cornerSkin, - "https://archive.org/cors/winampskin_MMD3/MMD3.wal", - "https://archive.org/cors/winampskin_The_Official_Ford_Sync_Winamp5_Skin/The_Official_Ford_Sync_Winamp5_Skin.wal", - "https://archive.org/cors/winampskin_Godsmack_Faceless/Godsmack_-_Faceless.wal", - "https://archive.org/cors/winampskin_Tokyo_Drift/Tokyo_Drift.wal", - "https://archive.org/cors/winampskin_Nebular/Nebular.wal", - "https://archive.org/cors/winampskin_Official_Enter_the_Matrix_Skin/Enter_the_Matrix.wal", - "https://archive.org/cors/winampskin_Reel-To-Reel_Machine_Sony_Edition/ReelToReel_Machine__Sony_Edition.wal", - "https://archive.org/cors/winampskin_Casio-G-Shocked-V5/Casio-G-Shocked-V2.wal", - "https://archive.org/cors/winampskin_ZDL_GOLD_STACK/ZDL_GOLD_STACK.wal", - "https://archive.org/cors/winampskin_BLAKK/BLAKK.wal", - "https://archive.org/cors/winampskin_Braun_CC_50/Braun_CC_50.wal", - "https://archive.org/cors/winampskin_Walk_Hard_Winamp5_Skin/Walk_Hard_Winamp5_Skin.wal", - "https://archive.org/cors/winampskin_Freddy_vs_Jason/Freddy_vs_Jason.wal", - "https://archive.org/cors/winampskin_The_Official_Grind_Winamp_3_Skin/The_Official_Grind_Winamp_3_Skin.wal", - "https://archive.org/cors/winampskin_The_KidsWB_Winamp_3_Skin/The_KidsWB_Winamp_3_Skin.wal", - "https://archive.org/cors/winampskin_Sailor_Moon_Modern_version_1/Sailor_Moon_Modern_version_1.wal", - "https://archive.org/cors/winampskin_Dr_Who_--_Monsters_and_Villains/Dr_Who_--_Monsters_and_Villains.wal", - "https://archive.org/cors/winampskin_Official_Linkin_Park_Skin/Official_Linkin_Park_Skin.wal", - "https://archive.org/cors/winampskin_Resin/Resin.wal", - "https://archive.org/cors/winampskin_PAD/PAD.wal", - "https://archive.org/cors/winampskin_MIPOD/MIPOD.wal", - "https://archive.org/cors/winampskin_Ebonite_2.0/Ebonite_2_1.wal", - "https://archive.org/cors/winampskin_Drone_v1dot1/Drone_v1.wal", - "https://archive.org/cors/winampskin_Hoop_Life_Modern/Hoop_Life_WA3_version.wal", - "https://archive.org/cors/winampskin_Austin_Powers_Goldmember_Skin/Official_Austin_Powers_3_Skin.wal", - "https://archive.org/cors/winampskin_Coca_Cola_My_Coke_Music/Coca_Cola__My_Coke_Music.wal", - "https://archive.org/cors/winampskin_Barracuda_Winamp/Barracuda_Winamp.wal", - "https://archive.org/cors/winampskin_Nike_total_90_aerow/Nike_total_90_aerow.wal", - "https://archive.org/cors/winampskin_Metallica_Metallica/Metallica_Metallica.wal", - "https://archive.org/cors/winampskin_Epsilux/Epsilux.wal", - "https://archive.org/cors/winampskin_Official_Witchblade_TV_Series_Skin/Official_Witchblade_TV_Series_Skin.wal", - "https://archive.org/cors/winampskin_ocrana/ocrana.wal", - "https://archive.org/cors/winampskin_Clean_AMP/Clean_AMP.wal", - "https://archive.org/cors/winampskin_Xbox_Amp/Xbox_Amp.wal", - "https://archive.org/cors/winampskin_Lapis_Lazuli/Lapis_Lazuli.wal", - "https://archive.org/cors/winampskin_The_Punisher_Winamp_5_Skin/The_Punisher_Winamp_5_Skin.wal", - "https://archive.org/cors/winampskin_The_Chronicles_of_Riddick/The_Chronicles_of_Riddick.wal", - "https://archive.org/cors/winampskin_Official_Midnight_Club_2_skin/Official_Midnight_Club_2_skin.wal", - "https://archive.org/cors/winampskin_Official_Torque_Winamp5_Skin/Official_Torque_Winamp5_Skin.wal", - "https://archive.org/cors/winampskin_Official_Mad_Magazine_Skin/Official_Mad_Magazine_Skin.wal", - "https://archive.org/cors/winampskin_PUMA_v1.08_Speed_Boot_Winamp5_Skin/PUMA_v1.08_Speed_Boot_Winamp5_Skin.wal", - "https://archive.org/cors/winampskin_EMP/EMP.wal", - "https://archive.org/cors/winampskin_Devay/Devay.wal", -]; - -function getSkinUrlFromQueryParams() { - const searchParams = new URLSearchParams(window.location.search); - return searchParams.get("skinUrl"); -} - -function setSkinUrlToQueryParams(skinUrl) { - const searchParams = new URLSearchParams(window.location.search); - searchParams.set("skinUrl", skinUrl); - const newRelativePathQuery = `${ - window.location.pathname - }?${searchParams.toString()}`; - window.history.pushState(null, "", newRelativePathQuery); -} - -function Loading() { - return

Loading...

; -} - -function Modern() { - const dispatch = useDispatch(); - const store = useStore(); - const root = useSelector(Selectors.getMakiTree); - const [skinUrl, setSkinUrl] = React.useState(null); - React.useEffect(() => { - const defaultSkinUrl = getSkinUrlFromQueryParams() || skinUrls[0]; - setSkinUrl(defaultSkinUrl); - dispatch(Actions.gotSkinUrl(defaultSkinUrl, store)); - }, [store, dispatch]); - if (root == null) { - return ; - } - return ( -
- { - dispatch(Actions.gotSkinBlob(e.dataTransfer.files[0], store)); - }} - > - - - -
- ); -} -function App() { - return ( - }> - {window.location.pathname.includes("ready") ? : } - - ); -} - -export default App; diff --git a/packages/webamp-modern/src/Dashboard.js b/packages/webamp-modern/src/Dashboard.js deleted file mode 100644 index 255cd9de..00000000 --- a/packages/webamp-modern/src/Dashboard.js +++ /dev/null @@ -1,178 +0,0 @@ -import React from "react"; -import { objects } from "./maki-interpreter/objects"; -import snapshotString from "./__tests__/__snapshots__/objects.test.js.snap"; -import methodData from "../resources/maki-skin-data.json"; - -const methodsSting = - snapshotString["Maki classes Track unimplemented methods 1"]; - -const unimplemented = new Set( - methodsSting.substring(1, methodsSting.length - 2).split("\n") -); - -const GREEN = "rgba(0, 255, 0, 0.2)"; -const RED = "rgba(255, 0, 0, 0.2)"; - -let METHOD_COUNT = 0; -let IMPLEMENTED_METHOD_COUNT = 0; - -const normalizedMethods = []; -Object.keys(objects).forEach((key) => { - const makiObject = objects[key]; - makiObject.functions.forEach((method) => { - METHOD_COUNT++; - const normalizedName = `${makiObject.name}.${method.name.toLowerCase()}`; - const implemented = !unimplemented.has(normalizedName); - if (implemented) { - IMPLEMENTED_METHOD_COUNT++; - } - const foundInSkins = methodData.foundInSkins[normalizedName] || 0; - const totalCalls = methodData.totalCalls[normalizedName] || 0; - normalizedMethods.push({ - className: makiObject.name, - totalCalls, - foundInSkins, - methodName: method.name, - normalizedName, - implemented, - }); - }); -}); - -const foundMethods = normalizedMethods.filter( - (method) => method.foundInSkins > 0 -); - -function PercentBox({ number, total, label }) { - const percent = total === 0 ? 1 : number / total; - - return ( -
-
- {Math.round(percent * 100)}% -
-
-
- - {label} - {" "} - - ({number}/{total}) - -
-
- ); -} - -export default function () { - const [searchQuery, setSearchQuery] = React.useState(""); - const [sortKey, setSortKey] = React.useState("totalCalls"); - const [sortDirection, setSortDirection] = React.useState("ASC"); - function setOrToggleSort(key) { - if (sortKey === key) { - setSortDirection((dir) => (dir === "ASC" ? "DESC" : "ASC")); - } else { - setSortKey(key); - } - } - - const sortAscending = (a, b) => (b[sortKey] > a[sortKey] ? 1 : -1); - const sortDecending = (a, b) => (b[sortKey] < a[sortKey] ? 1 : -1); - const sortFunction = sortDirection === "ASC" ? sortAscending : sortDecending; - - let filterFunction = () => true; - if (searchQuery) { - const normalizedQuery = searchQuery.toLowerCase(); - - filterFunction = (method) => { - return method.normalizedName.toLowerCase().includes(normalizedQuery); - }; - } - return ( -
-

Are Modern Skins Ready Yet?

- - method.implemented).length} - total={foundMethods.length} - label="Used Methods" - /> - setSearchQuery(e.target.value)} - /> - - - - - - - - - - - - {normalizedMethods - .sort(sortFunction) - .filter(filterFunction) - .map( - ({ - className, - methodName, - foundInSkins, - totalCalls, - implemented, - }) => { - return ( - - - - - - - - ); - } - )} - -
setOrToggleSort("implemented")}>Status setOrToggleSort("className")}>Class setOrToggleSort("methodName")}>Method Name setOrToggleSort("foundInSkins")}> - Found In Skins - setOrToggleSort("totalCalls")}>Total Calls
- - {className}{methodName}{foundInSkins}{totalCalls}
-
- ); -} diff --git a/packages/webamp-modern/src/Emitter.ts b/packages/webamp-modern/src/Emitter.ts deleted file mode 100644 index 49f29431..00000000 --- a/packages/webamp-modern/src/Emitter.ts +++ /dev/null @@ -1,43 +0,0 @@ -// TODO: Merge with the Webamp emitter -export default class Emitter { - _hooks: { [eventName: string]: Array<(...args: any[]) => void> }; - _globalHooks: Array<(eventName: string, ...args: any[]) => void>; - constructor() { - this._hooks = {}; - // TODO: Rename this property - this._globalHooks = []; - } - - listen(eventName: string, cb: (...args: any[]) => void) { - if (this._hooks[eventName] == null) { - this._hooks[eventName] = []; - } - this._hooks[eventName].push(cb); - return () => { - this._hooks[eventName] = this._hooks[eventName].filter( - (hookCb) => hookCb !== cb - ); - }; - } - - trigger(eventName: string, ...args: any[]) { - this._globalHooks.map((cb) => cb(eventName, ...args)); - if (this._hooks[eventName] == null) { - return; - } - this._hooks[eventName].map((cb) => cb(...args)); - } - - listenToAll(cb: (eventName: string, ...args: any[]) => void) { - this._globalHooks.push(cb); - return () => { - this._globalHooks = this._globalHooks.filter((hookCb) => hookCb !== cb); - }; - } - - dispose() { - // Note: This will cause any future trigger or hook to cause a runtime error. - this._hooks = {}; - this._globalHooks = []; - } -} diff --git a/packages/webamp-modern/src/MakiRenderer.js b/packages/webamp-modern/src/MakiRenderer.js deleted file mode 100644 index 22f531e2..00000000 --- a/packages/webamp-modern/src/MakiRenderer.js +++ /dev/null @@ -1,585 +0,0 @@ -import React, { useEffect, useReducer } from "react"; -import "./App.css"; -import * as Utils from "./utils"; - -function useJsUpdates(makiObject) { - const [, forceUpdate] = useReducer((x) => x + 1, 0); - useEffect(() => makiObject.js_listen("js_update", forceUpdate)); -} - -function handleMouseEventDispatch(makiObject, event, eventName) { - event.stopPropagation(); - - // In order to properly calculate the x/y coordinates like MAKI does we need - // to find the container element and calculate based off of that - const container = Utils.findParentOrCurrentNodeOfType( - makiObject, - new Set(["container"]) - ); - const clientX = event.clientX; - const clientY = event.clientY; - const x = clientX - (Number(container.attributes.x) || 0); - const y = clientY - (Number(container.attributes.y) || 0); - makiObject.js_trigger(eventName, x, y); - - if (event.nativeEvent.type === "mousedown") { - // We need to persist the react event so we can access the target - event.persist(); - document.addEventListener("mouseup", function globalMouseUp(ev) { - document.removeEventListener("mouseup", globalMouseUp); - // Create an object that looks and acts like an event, but has mixed - // properties from original mousedown event and new mouseup event - const fakeEvent = { - target: event.target, - clientX: ev.clientX, - clientY: ev.clientY, - nativeEvent: { - type: "mouseup", - }, - stopPropagation: ev.stopPropagation.bind(ev), - }; - handleMouseEventDispatch( - makiObject, - fakeEvent, - eventName === "onLeftButtonDown" ? "onLeftButtonUp" : "onRightButtonUp" - ); - }); - } -} - -function handleMouseButtonEventDispatch( - makiObject, - event, - leftEventName, - rightEventName -) { - handleMouseEventDispatch( - makiObject, - event, - event.button === 2 ? rightEventName : leftEventName - ); -} - -function GuiObjectEvents({ makiObject, children }) { - const { alpha, ghost } = makiObject.attributes; - if (!makiObject.isvisible()) { - return null; - } - - return ( -
- handleMouseButtonEventDispatch( - makiObject, - e, - "onLeftButtonDown", - "onRightButtonDown" - ) - } - onDoubleClick={(e) => - handleMouseButtonEventDispatch( - makiObject, - e, - "onLeftButtonDblClk", - "onRightButtonDblClk" - ) - } - onMouseMove={(e) => - handleMouseEventDispatch(makiObject, e, "onMouseMove") - } - onMouseEnter={(e) => - handleMouseEventDispatch(makiObject, e, "onEnterArea") - } - onMouseLeave={(e) => - handleMouseEventDispatch(makiObject, e, "onLeaveArea") - } - onDragEnter={() => makiObject.js_trigger("onDragEnter")} - onDragLeave={() => makiObject.js_trigger("onDragLeave")} - onDragOver={(e) => handleMouseEventDispatch(makiObject, e, "onDragOver")} - onKeyUp={(e) => makiObject.js_trigger("onKeyUp", e.keyCode)} - onKeyDown={(e) => makiObject.js_trigger("onKeyDown", e.keyCode)} - onContextMenu={(e) => { - e.preventDefault(); - return false; - }} - style={{ - opacity: alpha == null ? 1 : alpha / 255, - pointerEvents: ghost ? "none" : null, - }} - > - {children} -
- ); -} - -function Container({ makiObject }) { - const { id, default_x, default_y, default_visible } = makiObject.attributes; - - const style = { - position: "absolute", - }; - if (default_x !== undefined) { - style.left = Number(default_x); - } - if (default_y !== undefined) { - style.top = Number(default_y); - } - if (default_visible !== undefined) { - style.display = default_visible ? "block" : "none"; - } - - const layout = makiObject.getcurlayout(); - if (layout == null) { - return null; - } - - return ( -
- -
- ); -} - -function Layout({ makiObject }) { - const { - id, - js_assets, - background, - // desktopalpha, - drawBackground, - x, - y, - w, - h, - minimum_h, - maximum_h, - minimum_w, - maximum_w, - // droptarget, - } = makiObject.attributes; - if (drawBackground && background == null) { - console.warn("Got a Layout without a background. Rendering null", id); - return null; - } - - if (drawBackground) { - const image = js_assets.background; - if (image == null) { - console.warn( - "Unable to find image to render. Rendering null", - background - ); - return null; - } - - return ( - -
- -
-
- ); - } - - const params = {}; - if (x !== undefined) { - params.left = Number(x); - } - if (y !== undefined) { - params.top = Number(y); - } - if (w !== undefined) { - params.width = Number(w); - params.overflow = "hidden"; - } - if (h !== undefined) { - params.height = Number(h); - params.overflow = "hidden"; - } - - return ( - -
- -
-
- ); -} - -function Layer({ makiObject }) { - const { id, js_assets, image, x, y, w, h } = makiObject.attributes; - if (image == null) { - console.warn("Got an Layer without an image. Rendering null", id); - return null; - } - const img = js_assets.image; - if (img == null) { - console.warn("Unable to find image to render. Rendering null", image); - return null; - } - const params = {}; - if (x !== undefined) { - params.left = Number(x); - } - if (y !== undefined) { - params.top = Number(y); - } - if (img.x !== undefined) { - params.backgroundPositionX = -Number(img.x); - } - if (img.y !== undefined) { - params.backgroundPositionY = -Number(img.y); - } - if (w !== undefined) { - params.width = Number(w); - } else if (img.w !== undefined) { - params.width = Number(img.w); - } - if (h !== undefined) { - params.height = Number(h); - } else if (img.h !== undefined) { - params.height = Number(img.h); - } - if (img.imgUrl !== undefined) { - params.backgroundImage = `url(${img.imgUrl}`; - } - return ( - -
- -
-
- ); -} - -function animatedLayerOffsetAndSize( - frameNum, - frameSize, - layerSize, - imgSize, - imgOffset -) { - let size, offset; - if (frameSize !== undefined) { - size = Number(frameSize); - offset = -Number(frameSize) * frameNum; - } else if (layerSize !== undefined) { - size = Number(layerSize); - offset = -Number(layerSize) * frameNum; - } else { - if (imgSize !== undefined) { - size = Number(imgSize); - } - if (imgOffset !== undefined) { - offset = -Number(imgOffset); - } - } - return { offset, size }; -} - -function AnimatedLayer({ makiObject }) { - const { id, js_assets, x, y, w, h, framewidth, frameheight } = - makiObject.attributes; - const img = js_assets.image; - if (img == null) { - console.warn("Got an AnimatedLayer without an image. Rendering null", id); - return null; - } - - const frameNum = makiObject.getcurframe(); - - let style = {}; - if (x !== undefined) { - style.left = Number(x); - } - if (y !== undefined) { - style.top = Number(y); - } - - const { offset: backgroundPositionX, size: width } = - animatedLayerOffsetAndSize(frameNum, framewidth, w, img.w, img.x); - const { offset: backgroundPositionY, size: height } = - animatedLayerOffsetAndSize(frameNum, frameheight, h, img.h, img.y); - style = { ...style, width, height, backgroundPositionX, backgroundPositionY }; - - if (img.imgUrl !== undefined) { - style.backgroundImage = `url(${img.imgUrl}`; - } - - return ( - -
- -
-
- ); -} - -function Button({ makiObject }) { - const { - id, - js_assets, - // image, - // action, - x, - y, - downImage, - tooltip, - ghost, - } = makiObject.attributes; - const [down, setDown] = React.useState(false); - // TODO: These seem to be switching too fast - const img = down && downImage ? js_assets.downimage : js_assets.image; - if (img == null) { - console.warn("Got a Button without a img. Rendering null", id); - return null; - } - - return ( - -
{ - setDown(true); - document.addEventListener("mouseup", () => { - // TODO: This could be unmounted - setDown(false); - }); - }} - onClick={(e) => { - if (e.button === 2) { - makiObject.js_trigger("onRightClick"); - } else { - makiObject.js_trigger("onLeftClick"); - } - }} - title={tooltip} - style={{ - position: "absolute", - top: Number(y), - left: Number(x), - backgroundPositionX: -Number(img.x), - backgroundPositionY: -Number(img.y), - width: Number(img.w), - height: Number(img.h), - backgroundImage: `url(${img.imgUrl})`, - pointerEvents: ghost ? "none" : null, - }} - > - -
-
- ); -} - -function Popupmenu({ makiObject }) { - const { id, x, y } = makiObject.attributes; - - const children = makiObject.js_getCommands().map((item) => { - if (item.id === "seperator") { - return
  • ; - } - return ( -
  • { - makiObject.js_selectCommand(item.id); - }} - > - {item.name} -
  • - ); - }); - // TODO: Actually properly style element - return ( -
    -
      {children}
    -
    - ); -} - -function ToggleButton({ makiObject }) { - return