diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 86a4dd9..196b7a8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,7 @@ name: CI on: push jobs: - build: + test-unix: strategy: fail-fast: false matrix: @@ -11,35 +11,132 @@ jobs: - ubuntu-latest runs-on: ${{ matrix.os }} env: - HAXE_STD_PATH: "${{ github.workspace }}/std" + HAXE_STD_PATH: "${{ github.workspace }}/current/std" steps: - uses: actions/checkout@main - - name: Install haxe-manager - run: | - sh ./install.sh - - name: Add to PATH run: | echo "${GITHUB_WORKSPACE}/bin" >> $GITHUB_PATH + - name: Install haxe-manager + run: | + ./install.sh + haxe --version + - name: Check env run: | - echo $PATH - echo $GITHUB_PATH - echo $HAXE_STD_PATH + echo "PATH=${PATH}" + echo "GITHUB_PATH=${GITHUB_PATH}" + echo "HAXE_STD_PATH=${HAXE_STD_PATH}" + + - name: Help messages + run: | + echo "hx --help" + hx --help + echo "" + echo "hx --help download" + hx --help download + echo "" + echo "hx --help select" + hx --help select - name: Check base usage run: | + echo "Download latest nightly" + hx download latest + echo "Download release" + hx download 4.3.4 + echo "Download short hash nightly" + hx download nightly 569e52e + echo "Download short hash nightly (already downloaded)" + hx download nightly 569e52e alias + echo "Check Haxe version" + haxe --version + echo "Switch to dev" + hx select dev + echo "Check Haxe version" haxe --version - hx 4.2.5 - hx-download latest - hx dev + echo "Switch to 4.3.4" + hx 4.3.4 + echo "Check Haxe version" + haxe --version + echo "Switch to dev" + hx select dev + echo "Check Haxe version" + haxe --version + echo "Check hx current (normal, --name, --full)" + hx current + hx current --name + hx current --full - name: Install extra tools run: | sh ./extra/install-all.sh ls -Al bin/ - - name: Check list-haxe-versions - run: list-haxe-versions + test-windows: + strategy: + fail-fast: false + matrix: + os: + - windows-latest + runs-on: ${{ matrix.os }} + env: + HAXE_STD_PATH: "${{ github.workspace }}/current/std" + steps: + - uses: actions/checkout@main + + - name: Add to PATH + run: | + echo "${env:GITHUB_WORKSPACE}/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + + - name: Install haxe-manager + run: | + ./install.bat + haxe --version + + - name: Check env + run: | + echo "PATH=${env:PATH}" + echo "GITHUB_PATH=${env:GITHUB_PATH}" + echo "HAXE_STD_PATH=${env:HAXE_STD_PATH}" + + - name: Help messages + run: | + echo "hx --help" + hx --help + echo "" + echo "hx --help download" + hx --help download + echo "" + echo "hx --help select" + hx --help select + + - name: Check base usage + run: | + echo "Download latest nightly" + hx download latest + echo "Download release" + hx download 4.3.4 + echo "Download short hash nightly" + hx download nightly 569e52e + echo "Download short hash nightly (already downloaded)" + hx download nightly 569e52e alias + echo "Check Haxe version" + haxe --version + echo "Switch to dev" + hx select dev + echo "Check Haxe version" + haxe --version + echo "Switch to 4.3.4" + hx 4.3.4 + echo "Check Haxe version" + haxe --version + echo "Switch to dev" + hx select dev + echo "Check Haxe version" + haxe --version + echo "Check hx current" + hx current + diff --git a/.gitignore b/.gitignore index cb9fcac..c89cefc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,7 @@ -**/node_modules/* -**/package-lock.json releases/ versions/ builds/ -std -bin/* -!bin/hx -!bin/hx-download -!bin/hx-select +current +data/ +bin/ +build/*.hxb diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fd0d6d2 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +.SILENT: + +build-tools: + extra/build-tools.sh diff --git a/README.md b/README.md index 8447a6f..0524ea3 100644 --- a/README.md +++ b/README.md @@ -1,46 +1,75 @@ # Haxe Manager -Easily download and switch haxe versions on UNIX (currently tested on -`ubuntu-latest` and `macos-latest` via github actions). +Easily download and switch haxe versions (currently tested on +`ubuntu-latest`, `macos-latest` and `windows-latest` via github actions). -Run `install.sh` and update `PATH` / `HAXE_STD_PATH` as requested. +Run `install.sh` (`install.bat` on Windows) and update `PATH` / `HAXE_STD_PATH` as +requested. ## Select a version -Run `hx` to display the haxe version switch (using [`fzf`](https://github.com/junegunn/fzf)). +Run `hx` to display the haxe version switch (using a Haxe port of [`fzf`](https://github.com/junegunn/fzf) +picker). -You can also skip the version picker by using directly `hx 4.3.0` (or any other -version/alias you have installed). +You can also skip the version picker by using directly `hx 4.3.0` or `hx select +4.3.0` (or any other version/alias you have installed). ## Installing / updating versions -Use `hx-download` tool to download haxe versions: +Use `hx download` tool to download haxe versions: ``` -Usage: hx-download [AS_NAME] +Usage: hx download [AS_NAME] Download official release VERSION (e.g., 4.3.0) Save as AS_NAME if provided or use version number - or: hx-download latest [AS_NAME] + or: hx download latest [AS_NAME] Download latest nightly Save as AS_NAME if provided or use version number (with revision) - or: hx-download nightly [AS_NAME] + or: hx download nightly [AS_NAME] + or: hx download aws [AS_NAME] Download specific nightly VERSION (e.g., 2023-01-22_development_dd5e467) Save as AS_NAME if provided or use version number (with revision) + Note: short hash VERSION is also supported for development nightlies (e.g. dd5e467) ``` -## Included tools +### Installing archive -`extra/` folder contains optional tools you can install individually with their -`install.sh` script or all at once with `install-all.sh`. +If you already have an archive available (a nightly from a branch other than +`development`, for example), you can install it with: + +`hx install my_haxe_release.tar.gz [AS_NAME]` + +## List available versions + +Use `hx list` to get a list of all haxe versions available throught your (local) +haxe-manager. + +## Display currently selected version + +Use `hx current` to display currently selected Haxe version string (equivalent +to running `haxe --version`). + +On Unix, you can also run: +- `hx current --name` to get the name under which that version is installed +- `hx current --full` to get both name and version string (`[NAME] ([VERSION])`) -### `hxfzf` +## List all Haxe modules for current hxml Prints a list of all `.hx` files in all your classpath, to be passed to `fzf` or other tools. -Usage: `hxfzf [compile.hxml]` (will default to `build.hxml`) +Usage: `hx list-modules [compile.hxml]` (will default to `build.hxml`) + + +## Included tools + +`extra/` folder contains optional tools you can install individually with their +`install.sh` script or all at once with `install-all.sh`. + +Note that those have been written when Haxe Manager was unix only and probably +can't work at all on Windows. ### `++haxe` @@ -73,10 +102,6 @@ the path to your repository if you're executing from somewhere else) Update your local (git) copy of haxe-manager. -### `list-haxe-versions` - -Get a list of all haxe versions available throught your (local) haxe-manager. - ### `rofi-haxe` [rofi](https://github.com/davatorium/rofi) wrapper to `hx` command, to graphically select a Haxe version. diff --git a/bin/hx b/bin/hx deleted file mode 100755 index 0f4e3d8..0000000 --- a/bin/hx +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -ROOT=$(dirname $(readlink -f $0)) - -if [ "$1" = "download" ]; then - shift - hx-download "$@" -elif [ ! -z "$1" ]; then - if [ -e "$ROOT/../versions/$1" ]; then - hx-select "$1" - else - echo "Haxe version not found: $1" - fi -else - current=$(haxe -version 2>&1) - v=$(find "$ROOT/../versions/" -type l -exec basename {} \; | sort -r | fzf --prompt="Current: $current > ") - - if [ ! -z "$v" ]; then - hx-select "$v" - fi -fi diff --git a/bin/hx-download b/bin/hx-download deleted file mode 100755 index 4f889ea..0000000 --- a/bin/hx-download +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh - -ROOT=$(dirname $(readlink -f $0)) - -BUILD_OS="linux64" -BUILD_OS2="linux64" - -if [[ "$OSTYPE" == "darwin"* ]]; then - BUILD_OS="osx" - BUILD_OS2="mac" -fi - -get_haxe_version () { - local OUTDIR="$1" - local VERSION=$("$ROOT/../releases/$OUTDIR/haxe" --version) - - # Append revision for 4.3.0-rc.1 nightlies that were missing it - if [ "$VERSION" = "4.3.0-rc.1" ]; then - REV=$(echo "$OUTDIR" | sed -E 's/^haxe_20[0-9]+_([a-f0-9]{5,})\/$/\1/') - if [ ! -z "$REV" ] && [ ! "$REV" = "$OUTDIR" ]; then - VERSION="$VERSION+$REV" - fi - fi - - echo "$VERSION" -} - -if [ -z "$1" ]; then - echo "hx-download: missing argument(s)" - echo "" - echo "Usage: hx-download [AS_NAME]" - echo " Download official release VERSION (e.g., 4.3.0)" - echo " Save as AS_NAME if provided or use version number" - echo "" - echo " or: hx-download latest [AS_NAME]" - echo " Download latest nightly" - echo " Save as AS_NAME if provided or use version number (with revision)" - echo "" - echo " or: hx-download nightly [AS_NAME]" - echo " or: hx-download aws [AS_NAME]" - echo " Download specific nightly VERSION (e.g., 2023-01-22_development_dd5e467)" - echo " Save as AS_NAME if provided or use version number (with revision)" - exit 1 - -# Download latest nightly -elif [ "$1" = "latest" ]; then - TARGET=$2 - - if [ -z "$TARGET" ]; then - TARGET="dev" - fi - - URL="https://build.haxe.org/builds/haxe/$BUILD_OS2/haxe_latest.tar.gz" - FILENAME="haxe_latest" - -# Download a specific nightly -elif [ "$1" = "nightly" ] || [ "$1" = "aws" ]; then - TARGET=$3 - - if [ -z "$TARGET" ]; then - TARGET=$2 - fi - - URL="https://build.haxe.org/builds/haxe/$BUILD_OS2/haxe_$2.tar.gz" - FILENAME="haxe_$2" - -# Install a local release file -# Technically not a download, and potentially unsafe, but can be of use -# Not documented on purpose -elif [ -f "$1" ]; then - FILE=$(realpath "$1") - - # TODO make sure this looks good - OUTDIR=$(tar -tf "$FILE" | head -n 1) - - cd "$ROOT/../releases" - tar -xf $FILE - cd - > /dev/null - - TARGET=$2 - if [ -z "$TARGET" ]; then - TARGET="$(get_haxe_version "$OUTDIR")" - fi - - unlink "$ROOT/../versions/$TARGET" 2> /dev/null - ln -s "$ROOT/../releases/$OUTDIR" "$ROOT/../versions/$TARGET" - - echo "Installed version $TARGET" - exit 0; - -# Install an official release -else - TARGET=$2 - - if [ -z "$TARGET" ]; then - TARGET=$1 - fi - - URL="https://github.com/HaxeFoundation/haxe/releases/download/$1/haxe-$1-$BUILD_OS.tar.gz" - FILENAME="haxe-$1-$BUILD_OS" -fi - -cd "$ROOT/../releases" -rm -f "$FILENAME.tar.gz" -wget "$URL" - -if [ "$?" -eq "0" ]; then - OUTDIR=$(tar -tf "$FILENAME.tar.gz" | head -n 1) - tar -xf "$FILENAME.tar.gz" - rm "$FILENAME.tar.gz" - cd - > /dev/null - - VERSION="$TARGET" - if [ "$FILENAME" = "haxe_latest" ] || [ -z "$TARGET" ]; then - VERSION="$(get_haxe_version "$OUTDIR")" - fi - unlink "$ROOT/../versions/$VERSION" 2> /dev/null - ln -s "$ROOT/../releases/$OUTDIR" "$ROOT/../versions/$VERSION" - - if [ "$FILENAME" = "haxe_latest" ]; then - unlink "$ROOT/../versions/$TARGET" 2> /dev/null - ln -s "$ROOT/../releases/$OUTDIR" "$ROOT/../versions/$TARGET" - fi - - echo "Downloaded version $VERSION" -else - echo "Failed to download $FILENAME" -fi diff --git a/bin/hx-select b/bin/hx-select deleted file mode 100755 index 150de66..0000000 --- a/bin/hx-select +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -ROOT=$(dirname $(readlink -f $0)) - -if [ ! -z "$1" ]; then - if [ -e "$ROOT/../versions/$1" ]; then - rm -f "$ROOT/haxe" - rm -f "$ROOT/haxelib" - rm -f "$ROOT/../std" - - ln -s "$ROOT/../versions/$1/haxe" "$ROOT/haxe" - ln -s "$ROOT/../versions/$1/haxelib" "$ROOT/haxelib" - ln -s "$ROOT/../versions/$1/std" "$ROOT/../std" - - echo "Switched to $1" - haxe -version - else - if [ -e "$ROOT/../releases/$1" ]; then - rm -f "$ROOT/haxe" - rm -f "$ROOT/haxelib" - rm -f "$ROOT/../std" - - ln -s "$ROOT/../releases/$1/haxe" "$ROOT/haxe" - ln -s "$ROOT/../releases/$1/haxelib" "$ROOT/haxelib" - ln -s "$ROOT/../releases/$1/std" "$ROOT/../std" - - echo "Switched to $1" - haxe -version - else - echo "Cannot find haxe version $1" - fi - fi -else - echo "Please specify a haxe version" -fi - diff --git a/build.hxml b/build.hxml new file mode 100644 index 0000000..9faa7f0 --- /dev/null +++ b/build.hxml @@ -0,0 +1,5 @@ +common.hxml +-cp src +--hxb build/hx.hxb +HaxeManager +--interp diff --git a/build/linux64_569e52e/CHANGES.txt b/build/linux64_569e52e/CHANGES.txt new file mode 100644 index 0000000..42bd5b6 --- /dev/null +++ b/build/linux64_569e52e/CHANGES.txt @@ -0,0 +1,3010 @@ +2024-03-04 4.3.4 + + General improvements: + + all : allow @:using with Class and Enum (#11553) + display : expose list of metadata/defines (#11399) + + Bugfixes: + + all : typedef vs. GADT (#11446) + all : don't double-throw exceptions (#11175) + all : fix some abstract inlining failures (#11526) + all : fix JsonPrinter empty parent class (#11560) + all : dce: clean up operator handling (#11427) + all : analyzer: deal with unreachable block in binops (#11402) + all : analyzer: don't recursively check enum values when const propagating (#11429) + all : analyzer: fix check for inlined purity meta + display : fix errors from parser missing in diagnostics (#8687) + display : fix display services with static extension (#11285) + display : fix display services with safe navigation (#11205) + hl : hlopt rework try-catch control flow (#11581) + hl/c : fix reserved keywords (#11408) + + Deprecation / future version handling: + + all : don't infer string on concat, when using -D haxe-next (#11318) + all : handle optional arguments with bind, when using -D haxe-next (#11533) + macro : build order vs inheritance, when using -D haxe-next (#11582) + macro : deprecate some API from haxe.macro.Compiler (see #11540) + java/jvm : warn about --java ... -D jvm vs --jvm ... + +2023-09-17 4.3.3 + + General improvements: + + all : improve extra field error range (#11335) + all : better error messages for --connect + hl : improve error message when hl_version is missing (#11086) + hl/c : compiler now adds hlc define when targeting hl/c (#11382) + macro : update macro API restriction warnings when using -D haxe-next (#11377) + + Bugfixes: + + all : handle non existing files for positions in pretty errors (#11364) + all : metadata support for local static vars + all : catch trailing invalid syntax in string interpolation (#10287) + eval : fix Array.resize retaining values (#11317) + eval/hl : fix catching haxe.ValueException (#11321) + hl : make genhl respect Meta.NoExpr (#11257) + hl : don't add bindings for non existing methods + hl/c : add missing I64 mod support + hl/c : rework reserved keywords (#11293, #11378) + hl/c : fix Int64 unsigned right shift overflow (#11382) + java/cs: fix stack overflow from closures constraints (#11350) + js : DOMElement insertAdjacentElement should not be pure (#11333) + macro : catch trailing invalid syntax in Context.parseInlineString (#11368) + macro : fix TDAbstract without flags in haxe.macro.Printer + +2023-09-01 4.3.2 + + General improvements: + + all : do not raise error on no-op reification outside macro + + Bugfixes: + + all : don't infer Null if it already is Null (#11286) + all : fix ?? inference and precedence (#11252) + all : bring back forced inline (#11217) + all : allow non constant "inline" var init with -D no-inline (#11192) + all : improve @:enum abstract deprecation warning handling (#11302) + all : fix some stack overflow with pretty errors + display : fix go to definition with final (#11173) + display : fix completion requests with @:forwardStatics (#11294) + eval : fix MainLoop.add not repeating (#11202) + hl/eval/neko : fix exception stack when wrapping native exceptions (#11249) + macro : map `this` when restoring typed expressions (#11212) + macro : safe navigation fix for ExprTools.map (#11204) + macro : safe navigation fix for haxe.macro.Printer (#11206) + macro : macro generated EVars position fixes (#11163) + macro : fix abstract casts for local statics (#11301) + macro : add flags to TDAbstract to be able to construct enum abstracts (#11230) + nullsafety : make break/continue expressions not-nullable (#11269) + nullsafety : handle return in assignment (#11114) + +2023-04-28 4.3.1 + + Breaking changes: + + all : namespace message reporting defines (#11142) + + General improvements: + + all : support deprecation for defines + + Bugfixes: + + all : fix --times with compilation server (#11091) + all : fix default type parameters not respecting imports (#11161) + all : fix bytecode bindings issues (#11098) + macro : allow local statics in macro functions (#11096) + cpp : fix AtomicInt warnings on cppia (#11105) + cpp : fix deprecated implicit casts of cpp.Int64 (#10998) + cpp : add white space around template type syntax (#11107) + java : don't check native signatures on extern functions (#11131) + lua : remove non existent luautf8 charCodeAt extern (#11097) + +2023-04-06 4.3.0 + + New features: + + all : support defaults for type parameters (#10518) + all : support @:op(a()) on abstracts (#10119) + all : support abstract keyword to reference the abstract (#10513) + all : support static var at expression-level (#10555) + all : support ?. safe navigation operator (#10561) + all : added ?? null coalescing operator (#10428) + all : add -w compiler option to configure warnings (#10612) + all : added new error reporting modes (#10863) + all : support custom metadata and defines (#10858) + + General improvements: + + all : made various optimizations in the analyzer + all : made various improvements to diagnostics + all : made various improvements to null-safety + all : optimize `.bind` for instance methods (#10737) + all : improved various parser error messages + all : improved compilation server performance + all : improved code generation for try/catch (#10519) + all : infer property accessor type from the property (#10569) + all : improved inference of local functions typed against abstracts (#10336) + all : improved completion on module-level fields + all : improved handling of native libraries on the compilation server + all : improved performance when generating locals (#10648) + all : made Std.parseInt more consistent across targets (#10664) + all : infer null literals as Null (#7736) + all : made field access errors more consistent (#10896) + all : consistently allow trailing commas (#11009) + all : migrated all relevant targets to PCRE2 (#10491) + all : made analyzer reconstruct do-while loops (#7979) + all : improved restrictions on init macros (#11043) + all : improved positions of @:structInit fields (#9318) + macro : support map literals in Context.makeExpr (#10259) + macro : added haxe.macro.Compiler.getConfiguration() (#10871) + macro : added withImports and withOption to haxe.macro.Context + macro : added getMacroStack and onAfterInitMacros to haxe.macro.Context (#11043) + macro : added haxe.macro.Context.makeMonomorph (#10728) + eval : added dictionary mode to objects, increasing performance in some cases (#10284) + eval : fixed Sys.exit handling messing up the compilation server (#10642) + eval : added -D eval-print-depth and -D eval-pretty-print (#10952, #10963) + cpp : supported type parameters on extern classes (#10415) + cpp : haxe.Int64 improvements (#9935) + cpp : non-blocking process exit code reading (#10321) + js : improved type names for debugger (#10894) + lua : added SSL implementation (#10593) + lua : fixed String API when -D no-inline was in place (#11057) + lua : non-zero exit code in case of uncaught exception (#11082) + java : deal with default implementations when loading extern libraries (#10466) + jvm : improved closure naming (#10571) + jvm : supported --jvm dir (#10614) + jvm : added some missing TShort and TFloat handling (#10722) + jvm : added experimental support for functional interfaces (#11019) + php : added and fixed several extern functions + + Standard Library: + + all : added atomic operations to several targets (#10610) + all : added Vector.fill (#10687) + sys : added sys.thread.Condition and Semaphore (#10503) + sys : added Http.getResponseHeaderValues to deal with multiple values of same key (#10812) + sys : make Sys.environment consistent between targets (#10460) + sys : consistent way to unset environment variables with Sys.putEnv (#10402) + + Bugfixes: + + all : properly disallowed macro reification in invalid places (#10883) + all : fixed behavior when extending abstract classes with final fields (#10139) + all : addressed some issues with constructor inlining (#10304) + all : fixed pattern matcher bug related to null-guards (#10291) + all : fixed weird parser behavior on first offset in files (#10322) + all : fixed various issues related to the final modifier + all : fixed various issues related to overload handling + all : fixed precedence of => vs. ?: (#10455) + all : made error positions in structure declarations more accurate (#9584) + all : brought back proper check when accessing super fields (#10521) + all : fixed @:publicFields on abstracts (#10541) + all : inherited some metadata to @:generic implementation classes (#10557) + all : fixed various problems in EventLoop and MainLoop + all : fixed infinite recursion from invalid inheritance (#10245) + all : fixed strange interaction between static extensions and macro functions (#10587) + all : fixed problems with @:generic on the compilation server (#10635) + all : fixed Context.onTypeNotFound being called multiple times for the same thing (#10678) + all : fixed type parameter problem involving abstract classes and interfaces (#10748) + all : fixed #if (a != b) yielding true for nonexistent values (#10868) + all : fixed interaction between @:generic and abstract class (#10735) + all : fixed @:using loading types too eagerly (#10107) + all : fixed parser ignoring subsequent documentation comments (#10171) + all : fixed parser function messing up unrelated file state in some cases (#10763) + all : unified Map printing to always use [] (#9260) + cpp : fixed problem with cpp.Pointer being used in enum arguments (#10831) + macro : improved handling of macro this expressions (#10793) + eval : fixed bit shift operations > 31 (#10752) + eval : fixed Bytes.toString causing an internal exception (#10623) + jvm : fixed @:native processing (#10280) + jvm : fixed Type.getEnumConstructs on native enums (#10508) + jvm : fixed @:volatile being ignored (#10594) + jvm : fixed some hashing issue when pattern matching on emojis (#10720) + jvm : fixed stack handling on return return (#10743) + hl : fixed various code generation problems + python : fixed SslSocket for newer python versions (#8401) + python : fixed syntax issue related to Vector (#11060) + +2021-03-06 4.2.5: + + New features: + + php : support PHP attributes generation (#9964) + + Bugfixes: + + all : fixed compiler crash in complex constraints chains (#10445) + all : fixed timers execution order for timers with small time delta (#10567) + js : fixed constructors with rest arguments when compiling for ES3, ES5 (#10490) + php : excluded E_DEPRECATED notices from error reporting (#10502) + php : fixed safe casts to native arrays (#10576) + nullsafety : fixed false error on extern var fields without initialization (#10448) + +2021-10-22 4.2.4: + + New features: + + hl : add clipboard support in hl 1.12 (#10320) + + General improvements: + + all : improved error messages upon directory creation failures (#10361) + eval : added `%` operator to `eval.numbers.Int64` and `eval.numbers.UInt64` (#10411) + + Bugfixes: + + all : fixed errors on final vars modification with `+=`, `*=` etc operations (#10325) + all : fixed hanging of MainLoop.add on threaded targets (#10308, #10329) + all : fixed compiler crash when resolving overloads with not enough arguments (#10434) + all : fixed non-static `@:to` methods on `@:multiType` abstracts (#10145) + analyzer : fixed analyzer on overloads (#10405) + analyzer : fixed issues with fields initialization expressions (#10405) + display : improved code completion in anonymous objects declarations (#10414) + js : fixed IntMap for keys greater than 2^31 (#10316) + js : workaround to fix sourcemaps on Firefox in Windows (#10217) + js : delayed truncation of the output file on `Compiler.setCustomJSGenerator` (#10387) + cs/java : fixed rest arguments for cases when only one argument is provided (#10315) + php : fixed type of `php.db.PDO.ATTR_DRIVER_NAME` (#10319) + eval : fixed signature of `eval.luv.Tcp.noDelay` method + lua : fixed `string.length` when `string` has type of a type parameter constrained to `String` (#10343) + jvm : fixed `Reflect.compare()` for different number types (#10350) + python : fixed exceptions on tracing some native values (#10440) + +2021-07-01 4.2.3: + + General improvements: + + all : analyzer optimizations + macro : support maps in `haxe.macro.Context.makeExpr` (#10259) + js : added `-D js-global=globalThis` to customize global object name (#10282) + php : added externs for `quoted_printable_decode`, `quoted_printable_encode`, `Attribute`, `NumberFormat`, `IntlCalendar` and other `Intl*` classes + + Bugfixes: + + all : fixed compiler crash on some unreachable code blocks (#10261) + jvm : fixed `@:native` (#10280) + jvm : fixed `--xml` generation (#10279) + +2021-05-14 4.2.2: + + Bugfixes: + + all : fixed piping stdin/stdout in `--cmd` (#4669, #6726) + all : fixed rest args typing for overloaded functions (#10143) + all : fixed using `var` fields as static extensions (#10144) + all : fixed completion for a type in `expr is Type` (#10167) + all : fixed subtypes in `expr is Module.SubType` expressions (#10174) + all : fixed typing chains of calls with constrained type params (#10198) + all : fixed mixed constraints of anonymous structures and other types (#10162) + all : fixed operator overloading for enum abstracts (#10173) + hl : fixed debugging of `catch` blocks (#10109) + jvm : fixed manifest generation for cases with a lot of jar libraries (#10157) + js : fixed extending extern classes for es5 (#10192) + js : fixed checking `this` before `super` for es6 (#10193) + eval : fixed null pointer exception in `eval.NativeString.fromString(null)` + eval : fixed multiple locks of `sys.thread.Mutex` from the same thread (#10249) + +2021-02-26 4.2.1: + + General improvements: + + threads : changed main thread initialization to make main event loop available during static initialization (#10114) + php : added extern for `number_format` function (#10115) + python : rewrote `sys.thread.Thread`, `Mutex` and `Lock` as classes instead of abstracts. + + Bugfixes: + + all : fixed compiler compatibility with OS X 10.13 (#10110) + all : fixed compiler hanging on `switch` for abstracts with implicit casts involving type parameters and constraints (#10082) + all : fixed inlining of `haxe.DynamicAccess.keyValueIterator` (#10118) + all : fixed rest arguments typing against type parameters (#10124) + analyzer : fixed side effect handling for enums (#10032) + cpp : fixed handling of `cpp.ConstCharStar` with analyzer enabled (#9733) + php : fixed failure with trailing slash in output dir (#6212) + hl : fixed call stack of rethrown exceptions (#10109) + +2021-02-09 4.2.0: + + New features: + + all : implemented "classic" abstract classes and functions (see [haxe-evolution#69](https://github.com/HaxeFoundation/haxe-evolution/pull/69)) (#9716) + all : module-level static declarations (#8460) + all : implemented rest arguments (variadic functions) for all targets with `haxe.Rest` type (#9961) + all : per-thread event loops `sys.thread.Thread.events` (#9868) + all : added `@:inheritDoc` meta to inherit documentation for a type or field from another type or field (#9817) + all : support method overloading for extern methods on all targets (#9793) + all : constructors forwarding for abstracts with `@:forward.new` (#9735) + all : added `EIs` constructor to `haxe.macro.Expr` (#9689) + all : added variance forwarding with `@:forward.variance` (#9741) + all : treat `Any` as `Dynamic` in variance unification (#6649) + all : added some common exception types to `haxe.exceptions` package + all : support metadata in var declaration syntax (#9618) + all : added `StringTools.unsafeCharAt` (#9467) + eval : added libuv bindings under `eval.luv` package (#9903) + eval : added bindings to native `Int64` and `UInt64` implementations under `eval.integers` package (#9903) + cs : UDP socket implementation (#8498) + cs : added `cs.Syntax` module (#10051) + jvm : added `-D jvm.dynamic-level` to control the amount of dynamic support code being generated. 0 = none, 1 = field read/write optimization (default), 2 = compile-time method closures + java,jvm : support `--java-lib ` (#9551) + python : threading API implementation (#9754) + + General improvements: + + all : `expr is SomeType` doesn't require parentheses anymore (#9672) + all : increased priority of @:using extensions (#9681) + all : allowed usage of static extensions with super (#10062) + all : allow @:noDoc on fields too (#9893) + all : made `Map` abstract transitive (#9877) + all : support `@:native` on enum constructors (#9806) + all : support `@:using` on typedefs (#9749) + all : changed multiline errors format to use "..." as a prefix for subsequent lines (#9651) + all : improved type inference with constrained monomorphs (#9549) + all : print no-argument function types as `()->...` instead of `Void->...` (#8148) + all : allow `function` as package name + all : improved object inlining (#9599) + display : narrow range for hover on parametrized types (#8073) + cs : added .NET 5.0 support (#10043) + cpp : support native constructors on extern classes (#9516) + php: `php.Syntax.customArrayDecl` (#9113) + php : added externs for various php functions and classes + php : optimized anonymous objects instantiation (#7916) + hl : skip compilation if no module has been changed (#9922) + lua : use hx-lua-simdjson for Lua json parsing (#9885) + jvm : less CPU consuming `sys.thread.Lock` implementation + + Bugfixes: + + all : fixed Template.resolve when current context is not an object (#9372) + all : `get` and `set` functions of `haxe.io.Float64Array` actually use 64-bit floats now (#9972) + all : treat empty blocks `{}` as object declarations in array comprehension (fixes #9971) + all : `haxe.format.JsonParser`: preserve Float-typed values when they are written as such in JSON (ie. "5.0" or "0.0") (#9844) + all : fixed priority of forwarded static extensions (#9680) + all : fixed some inconsistency in variance unification for abstracts (#9743) + display : fixed completion with platform-specific files (#9423) + cpp : fixed conversion of `cpp.Int64` to/from `haxe.Int64` (#10101) + cpp : fixed extending extern classes with `@:nativeGen` classes (#9431) + php : fixed generation with subdirectories in `-D php-front=subdir/index.php` (#10037) + php : fixed local vars with the same names as super global vars (#9924) + eval : allow full range of 32bit integers in `Std.random` (#9974) + js : fixed `haxe.CallStack.exceptionStack` (#9968) + js : fixed compatibility issue with closure compiler upon unused `catch` vars (#9617) + lua : fixed anonymous object printing issue with null fields on tables + hl : drop data of terminated threads (#9875) + macro : fixed `haxe.macro.Context.storeTypedExpr` for enum constructs (#9828) + macro : emit a deprecation warning upon a macro call instead of upon a macro function declaration (#9425) + macro : fixed uncatchable error from `haxe.macro.Context.getType` (#9449) + jvm : fixed `Type.resolveEnum` for enums in the root package (#9809) + jvm : fixed `Type.resolveEnumName` for enums in the root package (#9759) + cs : fixed cs.Lib.rethrow (#9738) + nullsafety : respect `@:nullSafety(Off)` on var declarations: `var @:nullSafety(Off) v` + nullsafety : respect `@:nullSafety(Off)` in closures in constructors (#9643) + nullsafety : fixed error "Type not found : haxe.macro._Compiler.NullSafetyMode_Impl_" (#9483) + +2020-12-31 4.1.5: + + General improvements: + + all : added an argument to `haxe.CallStack.exceptionStack` to return full stack up to the topmost call (#9947) + php : compatibility with PHP 8 + + Bugfixes: + + all : fixed empty object declarations in array comprehension (#9971) + jvm : fixed equality checks for `Null` and `Null` (#9897) + hl : fixed crash if a thread finishes without invoking `sendMessage`/`readMessage` (#9920) + php : fixed local vars with certain names (_SERVER, _GET etc) overriding super global values (#9924) + php : fixed generation with directories in `-D php-front`. For example `-D php-front=sub/index.php` (#10037) + macro : added return type hint to haxe.macro.MacroStringTools.formatString (#9928) + cs : fixed catching exceptions from static closures (#9957) + eval : fixed `Std.random(arg)` for `arg` values of more than 30 bits (#9974) + js : fixed `haxe.CallStack.exceptionStack` (#9968) + +2020-09-11 4.1.4: + + General improvements: + + all : allowed `Any` as type parameter in `catch(e:SomeType)` (#9641) + all : improved compilation speed for `try..catch` expressions (#9848) + + Bugfixes: + + all : fixed `switch` typing error for arrow functions with `Void` return type (#9813) + all : fixed typing of arrow functions with empty blocks as bodies (closes #9843) + macro : fixed `haxe.macro.Context.getResources()` (#9838) + php : fixed false detection of `catch` vars in anonymous functions as captured from outer scope + php : fixed return type of extern definition for `fseek` function + cs,java : fixed generation of `@:generic` classes with anonymous functions (#9799) + jvm : fixed sending/reading messages with `sys.thread.Threads` for threads created outside of Haxe (#9863) + jvm : fixed multiplication of `Null` and `Int` (#9870) + flash : fixed loading swc libraries containing `Vector` without a type parameter (#9805) + hl : fixed messages being send to wrong threads with `sendMessage`/`readMessage` in `sys.thread.Thread` (#9875) + cpp : fixed `cpp.Lib.stringReference()` (#8457) + +2020-07-22 4.1.3 + + General improvements: + + all : added an error on `return` outside of a function (#9659) + php : support @:native("") for extern classes (#6448) + python : support @:native("") for extern classes (#6448) + + Bugfixes: + + all : fixed compilation server bug caused by removing `inline` from a method (#9690) + macro : fixed compiler crash if `@:genericBuild` meta is removed by a macro during building (#9391) + jvm : fixed "--java-lib-extern" (#9515) + flash : fixed var shadowing issue for variables captured in a closure inside of a loop (#9624) + flash : fixed `VerifyError` exception when `Void` end up as an argument type after inlining (#9678) + php : fixed runtime error "cannot use temporary expression in write context" for call arguments passed by reference + cs : fixed `cs.Lib.rethrow` (#9738) + nullsafety: fixed `@:nullSafety(Off)` in closures inside of constructors (#9643) + nullsafety: fixed "Type not found NullSafetyMode_Impl_" (#9483) + +2020-06-19 4.1.2 + + Bugfixes: + + all : added `contains` and `keyValueIterator` methods to haxe.ds.ReadOnlyArray + all : fixed super constructor call when extending externs (#7837, #9501) + all : fixed compiler crash for "--run" argument without a value (#9513) + all : fixed local variable name collision in `try..catch` (#9533) + all : fixed memory leak in completion server related to haxe.Exception (#9537) + display : fixed completion for out-of-bounds argument in a call (#9435) + display : fixed "find references" through interfaces (#9470) + display : optimized "find references" (#9504) + display : optimized "server/invalidate" requests (#9509) + analyzer : fixed compiler crash upon handling code branches with enums with optional arguments (#9591) + jvm : added "--java-lib-extern" to use jar files as externs without adding them to the compiled project (#9515) + macro : fixed type intersection syntax in macro reification (#9404) + eval : fixed exception message when catching compiler-generated `haxe.macro.Error` as `Dynamic` (#9600) + lua : fixed lua code generation without `--main` compilation argument (#9489) + php : added an overload signature for `session_set_cookie_params` function (#9507) + js : fixed name collisions for catch variables to avoid closure compiler errors (#9617) + nullsafety : fixed various scenarios of `if..else` branching (#9474) + +2020-05-22 4.1.1 + + New features: + + jvm : added `--jvm path/to.jar` CLI argument + + Bugfixes: + + all : fixed arguments ordering for @:structInit constructors (#9418) + all : fixed display/references completion server request for static fields (#9440) + all : fixed "Module not found" error reporting during macro execution in display requests (#9449) + all : fixed module name completion for target-specific modules like `Mod.js.hx` (#9423) + all : fixed completion for packages named "function" (#7697) + all : fixed recursive typedefs with optional arguments in `@:overload` functions (#9455) + cpp : fixed StringTools.endsWith() for unicode characters (#8980) + cpp : fixed broken externs in `cpp` package (#9452) + js/cpp : fixed catch var naming collision (#9413) + interp : fixed throwing `haxe.macro.Error` outside of a macro context (#9390) + lua : fixed lua.PairTools.ipairsMap method + php : fixed an edge case in String methods generation (#9464) + +2020-05-13: 4.1.0 + + New features: + + all : added tail recursion elimination (#8908) + all : added unified exception handling (#9124) + all : allow `try {} catch(e) {}` as a shortcut for `try {} catch(e:haxe.Exception) {}` (#9269) + eval : added SSL support (#9009) + jvm : the JVM target is no longer considered experimental + + General improvements: + + all : implemented different display support approach (#8962) + all : improved display services related to reference finding + all : added go-to-implementation support (#9043) + all : made various improvements to diagnostics + all : support completion for map keys (#9133) + all : improved parser robustness for incomplete syntax (#9148) + all : disallowed the combination of `@:overload` and inline (#3846) + all : improved renaming of local variables (#9304) + all : better inlining of for-loops with anonymous iterators (#8848) + all : remove redundant final `return` in `Void` functions (#6420) + all : remove redundant `continue` in loops (#8952) + all : improved various compilation errors reporting + all : allowed `(get,default)` property access combination (#6195, #8825) + all : allowed ++ and -- on member properties of abstracts (#8930) + js : use abstract type name for generating its implementation class (#9006) + js : improve haxe.ds.StringMap implementation (#8909) + js : improve interface checking and make it more minifier-friendly (#9178) + js : generate `let` instead of `var` when compiler with `-D js-es=6` (#9280) + js : optimize `.bind` on constructors (#9227) + jvm : rewrote function handling to me much faster and more portable (#9208) + jvm : generate interfaces for typedefs for improved performance (#9195) + jvm : added support for haxe.MainLoop + jvm : support `@:jvm.synthetic` and use it to hide some generated fields (#9213) + jvm : respect `@:private` and `@:protected` + lua : improve error handling behavior when throwing objects/instances + lua : optimize `haxe.iterators.StringIterator` + php : optimize `Std.isOfType` for String, Bool and Float + php : make Haxe Array implement native interfaces Iterator, IteratorAggregate, Countable (#8821, 9377) + cs : support `@:assemblyMeta` and `@:assemblyStrict` (#8347) + python : added `__contains__` and `__getitem__` implementations to generated python code for `_hx_AnonObject`, so it is subscribable and behaves like a python dict (#9109) + + Standard Library: + + all : negative `startIndex` argument of `String.indexOf` and `String.lastIndexOf` is unspecified (#8365) + all : changed Array.iterator() to return instances of haxe.iterators.ArrayIterator (#8987) + all : added Array.contains (#9179) + all : added Array.keyValueIterator (#7422) + all : added haxe.Constraints.NotVoid (#8357) + all : added Lambda.findIndex() (#9071) + all : added Lambda.foldi() (#9054) + all : added array access and key-value iteration support to haxe.ds.HashMap (#9056) + jvm : added JVM-specific versions of sys.thread.Lock and sys.thread.Thread + jvm : added JVM-specific version of haxe.ds.StringMap + java/jvm : use native versions of MD-5, SHA-1 and SHA-256 for `haxe.crypto` modules (#9298) + macro : added haxe.macro.Context.containsDisplayPosition(pos) (#9077) + nullsafety : treat Strict as a single-threaded mode; added StrictThreaded (#8895) + + Deprecations: + + all : deprecated `Std.is`; use `Std.isOfType` instead (#2976) + all : added a warning for an uninitialized variable usage captured in a closure (#7447) + js : deprecated `untyped __js__(code, args)`; use `js.Syntax.code(code, args)` instead + php/neko : deprecated neko.Web and php.Web; will be moved to hx4compat library later (#9153) + + Bugfixes: + + all : fixed display support for static imports (#9012) + all : fixed completion in macro mode picking up the wrong type (#7703) + all : fixed wonky analyzer transformation related to locals captured in closures (#9305) + all : allow `return;` in abstract constructors (#7809) + all : fixed static @:op([]) functions (#9347) + all : fixed `@:optional` handling in the inheritance of `@:structInit` classes (#7559) + all : support negative numbers as constant type parameters for `@:generic` types (#9149) + all : fixed false positive compilation server error with empty methods in inheritance (#9029) + all : fixed default values for manually defined @:structInit constructors (#9177, #9258) + all : fixed inference of `Void` return type for arrow functions (#9181) + all : fixed inconsistencies in wildcard imports resolution (#9189, #9190) + all : fix array comprehension for a chain of `if..else if` without final `else` (#9040) + all : prohibit @:structInit on interfaces (#9017) + macro : fixed handling `TAnonymous` in `haxe.macro.TypeTools.map` (#9147) + eval : fixed EReg.matchSub handling with negative length (#9333) + eval : fixed extern classes being generated and causing errors in some cases (#9366) + eval : fixed StringBuf.addSub unicode handling (#9382) + jvm : fixed Void being generated with the wrong casing (#8717) + jvm : fixed debugging-related data being generated in the wrong place + jvm : fixed switches on string values being too optimistic + jvm : fixed problems with Std.parseInt and Std.parseFloat + jvm : made sure type parameter types are boxed + jvm : fixed dynamic access on `null` yielding `null` (#8452) + cpp : fixed native compilation if there is a `hx` package in a project (#8543) + cs : fixed `null` to `0` conversion in parametrized functions for `Null` params (#7428) + cs : fixed integer division handling (#9232) + php : fixed closure creation out of fields with `null` value (#9316) + js : fixed interface generation for minification with Google Closure Compiler in advanced mode (#9172) + js : fixed a crash at startup in IE8 (#9062) + hl : fixed BLOB handling in SQLite (#9048) + +2019-12-17: 4.0.5 + + Bugfixes: + + java : fix boolean arguments for `Type.createInstance(cls, args)` (#9025) + jvm : fix static overloads (#9034) + java/cs : fixed `Reflect.makeVarArgs(fn)` for calls of `fn` without arguments (#9037) + js : fix multiple appearances of the first object added to `ObjectMap` is passed to `ObjectMap.set(obj, v)` multiple times (#9026) + js : automatically wrap compound expressions with parentheses when passed to `js.Syntax.code()` (#9024) + windows : fix adding neko to PATH env var running windows installer (#9021) + +2019-11-29: 4.0.3 + + General improvements: + + hl : profiler API + + Bugfixes: + + all : fixed EnumValue handling in constant propagation with analyzer enabled (#8959) + all : fixed compiler crash upon Void items in array declarations (#8972) + hl : fixed `sys.thread.Lock` implementation for Hashlink 1.11+ (#8699) + js/eval/java/jvm/cs/python/lua : fixed `Std.parseInt()` for hexadecimals with leading whitespaces (#8978) + java/cs : fixed `Reflect.callMethod(o, method, args)` for `args` not containing optional arguments (#8975) + cs : fixed Json.stringify for @:struct-annotated classes (#8979) + cs : fixed bitwise shifts for `cs.types.Int64` (#8978) + python : fixed invalid generation of some inlined code blocks (#8971) + std : fixed an exception from `haxe.zip.Huffman` on reading a zip (#8875) + windows : workaround windows installer being detected as a malware by some anti-virus software (#8951) + windows : fix PATH env var modification when running windows installer without admin privileges (#8870) + all : fixed null-safety checker for field access on a call to inlined function + +2019-11-11: 4.0.2 + + General improvements and optimizations: + + php : improved performance of `haxe.io.Bytes.get()` (#8938) + php : improved performance of serialization/unserialization of `haxe.io.Bytes` (#8943) + php : improved performance of enum-related methods in `Type` class of standard library + + Bugfixes: + + haxelib : Fixed too strict requirements to haxelib.json data for private libs + all : fixed `@:using` static extensions on `Null` (#8928) + php : fixed static methods with the same name in parent and child classes (#8944) + +2019-11-04: 4.0.1 + + Bugfixes: + + haxelib : fixed git dependencies in haxelib.json + neko : updated windows & osx installer to install Neko 2.3.0 (#8906) + jvm : fixed compilation failure caused by a specific usage of `Array` (#8872) + all : fixed compiler crash on loops with `continue` in all branches of the body (#8912) + all : fixed erasing typedef in AST on field access to forwarded abstract fields (#8919) + + +2019-10-26: 4.0.0 + + General improvements: + + js : updated externs for `Float32Array` and `Float64Array` (#8864) + php : added array access to `php.NativeStructArray` (#8893) + + Bugfixes: + + cs : fixed "This expression may be invalid" false warning (#8589) + php : fixed iterator fields on maps being removed (#8851) + php : fixed `-2147483648` as init value for static vars (#5289) + python : fixed modulo by a negative number (#8845) + java : fixed backslash escaping on `EReg.replace` (#3430) + lua : fixed `EReg.map` for unicode (#8861) + hl : fixed sqlite connection on OSX/Linux (#8878) + +2019-09-12: 4.0.0-rc.5 + + General improvements and optimizations: + + eval: improved performance of regular expressions (#8693) + + Bugfixes: + + all: fixed regression, which caused compiler to crash on enum abstracts with explicit casting (#8765) + all: fixed regression of macro `@:from` methods on abstracts (#8779) + all: fixed switching on `this` (#8781) + +2019-09-04: 4.0.0-rc.4 + + Standard Library: + + all : added Map.clear (#8681) + all : improved Date API (#8508) + all : added JSON-RPC protocol types to haxe.display package (#8610) + all : added default timeout to HTTP sockets (#8646) + macro : added Context.info (#8478) + macro : added Context.getMessages and Context.filterMessages (#8471) + macro : added function kind to EFunction (#8653) + macro : added string literal kind to CString (#8668) + flash : added flash.AnyType (#8549) + + General improvements and optimizations: + + all : allowed enum constructors without arguments as static inline var (#8187) + all : improved handling of default values when inlining (#8397) + all : made various improvements to the display API as usual + all : detect invalid #tokens in inactive code (#7108) + all : allowed function types in @:generic (#3697) + all : improved --help-defines and --help-metas + all : improved overall file finding (#8202) + all : improved server reaction to added and removed files (#8451) + all : improved memory handling of the compilation server (8727) + all : improved handling of native libraries on the compilation server (#8629) + all : support partial completion results (#8642) + all : improved support of hovering over inactive conditional compilation blocks + all : improved completion support in .platform.hx files + all : support hovering conditional compilation identifiers + all : improved and unified identifier checks for names, fields and types (#8708) + all : improved --times performance (#8733) + all : remove some redundant cast expressions (#8725) + all : added --server-connect (#8730) + lua : improved -D lua-vanilla + js : improved HTML externs + + Bugfixes : + + all : fixed various position and replace ranges in the display API + all : fixed compiler hang related to @:arrayAccess (#5525) + all : fixed bug regarding abstract `this` modification in inline methods (#8454) + all : fixed `from Dynamic` on abstracts (#8425) + all : fixed overeager recursive inline check (#8489) + all : fixed the pattern matcher allowing inexhaustive switches in value-places (#8277) + all : fixed pattern matcher allowing invalid abstract unification (#8579) + all : fixed local variable type information being lost on the compilation server (#8511) + all : don't generate return expressions in Void lambda functions (#6503) + all : fixed unification of recursive typedefs again (#8523) + all : fixed various hangs related to abstracts (#8588) + all : fixed various GADT-related problems (#7672) + all : fixed macro `@:from` methods allowing any return type (#8463) + macro : fixed Sys.programPath assertion failure (#8466) + js : fixed typed array APIs (#8422) + java : fixed Std.is on non-reference and unrelated types (#5168) + java/macro : fixed null-pointer exception in Reflect.getProperty (#4934) + java/jvm : fix switch on null string (#4481) + jvm : fixed boxed vs. unboxed comparison (#8577) + jvm : generate toplevel types to haxe.root like genjava does (#8590) + jvm : improved 32bit support (#8601) + cs/python : fixed various issues with code generation + cs : fixed NativeArray casting (#3949) + +2019-06-13: 4.0.0-rc.3 + + New features: + + all : added JVM target + + General improvements and optimizations: + + all : create temp vars in pattern matcher to avoid duplicate access (#8064) + all : support parsing dots in conditional compilation, e.g. `#if target.sys` + all : added `@:bypassAccessor` + all : improved various aspects of the display API + all : properly error on `@:op(a = b)` (#6903) + all : made `@:using` actually work + all : properly disallowed some modifier combinations related to `final` (#8335) + all : support `@:pure(false)` on variable fields (#8338) + flash : updated Flash externs to version 32.0 (now using `final`, `enum abstract` and `haxe.extern.Rest`) + flash : rework support for native Flash properties (#8241) + php : improved performance of various parser implementations (#8083) + cs : support .NET core target (#8391) + cs : generate native type parameter constraints (#8311, #7863) + + Standard Library: + + all : added StringTools.contains (#7608) + all : turned sys.thread.Thread into abstracts (#8130) + all : introduced `Std.downcast` as replacement for `Std.instance` (#8301) + all : introduced `UnicodeString`, deprecated `haxe.Utf8` (#8298) + java : added java.NativeString (#8163) + cs : added sys.thread implementations (#8166) + js : moved various classes to js.lib (#7390) + + Bugfixes + + all : fixed issue with `@:generic` type parameters not being bound to Dynamic (#8102) + all : fixed various issues related to `@:structInit` + all : fixed top-down inference on abstract setters (#7674) + all : fixed DCE issue related to closures (#8200) + all : fixed and restricted various Unicode-related issues in String literals + all : fixed various priority issues regarding loops and iterators + all : fixed cast handling in try-catch expressions (#8257) + all : fixed `inline new` handling (#8240) + all : fixed pattern matcher issue with wildcards in or-patterns (#8296) + all : fixed `@:allow(package)` allowing too much (#8306) + all : fixed various issues with startIndex handling on String.indexOf and String.lastIndexOf + all : fixed infinite recursion related to printing of objects with circular references (#8113) + sys : fixed various Unicode issues (#8135) + macro : fixed Array.pop handling (#8075) + macro : fixed assertion failure when throwing exception (#8039) + macro : fixed various uncatchable exceptions being thrown + php : error on case-insensitive name clashes (#8219) + lua : fixed issue where Process output occasionally is missing some data + hl : fixed various String Unicode issues + java : fixed null exception in CallStack.exceptionStack (#8322) + js : fixed code generation issue related to negative abstract values (#8318) + flash : fix various issues, including native `protected` handling and method overloading + + Removals: + + all : remove support for `@:fakeEnum` enums + all : disallowed `\x` with values > 0x7F (#8141) + all : consistently disallowed metadata in lambda function arguments (#7800) + all : removed `--gen-hx-classes` (#8237) + +2019-03-22: 4.0.0-rc.2 + + New features: + + all : added strictness settings for the null-safety checker, using loose checking by default (#7811) + js : added ES6 class generation with `-D js-es=6` (#7806) + + General improvements and optimizations: + + all : inherit `@:native` for overriden methods (#7844) + all : standardized identifiers allowed in markup literals (#7558) + all : show typo suggestions when declaring `override` field (#7847) + all : improved parser error messages (#7912) + all : improved diagnostics of syntax errors (#7940) + all : improved positions of `switch` and `case` expressions (#7947) + all : allow parsing `#if (a.b)` (#8005) + eval : improved performance of various string operations (#7982) + eval : fixed many error positions + eval : greatly improved debugger interaction (#7839) + eval : properly support threads when debugging (#7991) + eval : improved handling of capture variables (#8017) + js : generate dot-access for "keyword" field names (#7645) + js : optimized run-time type checking against interfaces (#7834) + js : skip generation of interfaces when no run-time type checking needed (#7843) + + Standard Library: + + all : unified various Thread APIs in sys.thread (#7999) + all : moved typed arrays from `js.html` to `js.lib` (#7894) + all : added `iterator()` to `haxe.DynamicAccess` (#7892) + all : added `keyValueIterator()` to `haxe.DynamicAccess` (#7769) + eval : completed Thread API + + Bugfixes: + + all : fixed argument default value checking for externs (#7752) + all : fixed optional status of overloaded arguments with default values (#7794) + all : fixed DCE compilation server state issue (#7805) + all : fixed compilation server module dependency issue related to macros (#7448) + all : fixed call-site inlining on abstracts (#7886) + all : fixed Constructible not checking constraints properly (#6714) + all : fixed @:structInit not being compatible with `final` fields (#7182) + all : fixed capture variables being allowed in `.match` (#7921) + all : fixed infinite recursion on `@:generic` field access (#6430) + all : fixed `-D no-deprecation-warnings` for typedefs and enums + js : fixed bad stack handling on `Map` constraint checks (#7781) + js : fixed DCE issues related to haxe.CallStack (#7908) + cpp : fixed Socket flags not being preserved (#7989) + lua : fixed broken output when compiling through the compilation server (#7851) + lua : fixed `StringTools.fastCodeAt` with `-D lua-vanilla` (#7589) + lua : fixed `@:expose` for classes inside packages (#7849) + +2019-02-01: 4.0.0-rc.1 + + New features: + + all : added experimental null-safety feature through `--macro nullSafety("package")` (#7717) + + General improvements and optimizations: + + all : improved unification error messages (#7547) + all : added `haxe4` define + all : do not require semicolon for markup literals (#7438) + all : made `@:expose` imply `@:keep` (#7695) + all : unified cast, catch and Std.is behavior of null-values (#7532) + macro : static variables are now always re-initialized when using the compilation server (#5746) + macro : support `@:persistent` to keep macro static values across compilations + js : improve js.Promise extern: now `then` callback argument types can be properly inferred (#7644) + + Bugfixes: + + all : fixed various pattern matching problems + all : fixed various wrong positions when encoding data to macros + all : specified String.indexOf with out-of-bounds indices (#7601) + all : fixed various problems related to DCE and feature-handling (#7694) + all : fixed bad unary operator optimization (#7704) + js : fixed syntax problem related to `instanceof` (#7653) + flash : fixed var field access on interfaces being uncast (#7727) + cpp : fixed various issues related to casts + cpp : fixed some leftover unicode issues + php : fixed class naming conflicts (#7716) + eval : fixed Socket.setTimeout (#7682) + eval : fixed int switch bug related to overflows + + Removals: + + macro : deprecated Context.registerModuleReuseCall and onMacroContextReused (#5746) + +2018-10-13: 4.0.0-preview.5 + New features: + + all : support Unicode strings properly on all targets + all : support `for (key => value in e)` syntax for key-value iterators + all : added keyValueIterator to Map and its implementations + all : support loop-unrolling on `for (i in 0...5)` (#7365) + all : added support for write-mode `@:op(a.b)` + all : support `inline call()` and `inline new` expressions (#7425) + all : support `@:using` on type declarations (#7462) + all : support markup literal strings but require them to be macro-processed (#7438) + all : allow enum values without arguments as default function argument values (#7439) + lua : add -D lua-vanilla, which emits code with reduced functionality but no additional lib dependencies + + General improvements and optimizations: + + all : [breaking] reserved `operator` and `overload` as keywords (#7413) + all : made `final` on structure fields invariant (#7039) + all : [breaking] disallowed static variables that have no type-hint and expression (#6440) + all : added display/typeDefinition to display protocol (#7266) + all : fixed various display-related problems + all : made parser in display mode much more tolerant + all : allowed assigning `[]` where `Map` is expected (#7426) + all : unified various parts of the String API across all targets + php : Optimized haxe.ds.Vector (VectorData is not Array anymore) + php : Optimized `Map.copy()` and `Array.copy()` + php : Optimized iterators of `Map` and native arrays. + php : Support native PHP generators. See `php.Syntax.yield()` and `php.Generator` + js : updated HTML externs + eval : improved object prototype field handling (#7393) + eval : optimized int switches (#7481) + eval : improved IntMap and StringMap performance + eval : improved performance of instance calls + + Removals : + + all : disallowed get_x/set_x property syntax, use get/set instead (#4699) + all : disallowed default values on interface variables (#4087) + all : disallowed `implements Dynamic` on non-extern classes (#6191) + all : warn about expressions in extern non-inline fields (#5898) + all : removed `-D use-rtti-doc`, always store documentation instead (#7493) + all : disallowed macro-in-macro calls (#7496) + js : removed jQuery and swfobject externs (#7494) + + Bugfixes: + + all : fix GC compacting too often in server mode + all : [breaking] `function () { }(e)` is no longer parsed as a call (#5854) + all : fixed various minor inlining issues + all : disallowed `return null` from Void-functions (#7198) + all : fixed various pattern matching problems + all : fixed compiler hang in display mode (#7236) + all : fixed the XML printer trimming CDATA content (#7454) + all : fixed invalid visibility unification with statics (#7527) + php : Escape `$` in field names of anonymous objects (#7230) + php : Generate `switch` as `if...else if...else...` to avoid loose comparison (#7257) + cs : fixed bad evaluation order in structures (#7531) + eval : fixed various problems with the debugger + eval : fixed Vector.fromArrayCopy (#7492) + eval : fixed bad string conversions on invalid + operations + + Standard Library: + + all : [breaking] made Lambda functions return Array instead of List (#7097) + all : added haxe.iterators package + all : improved StringTools.lpad/rpad/htmlEscape implementation + +2018-06-12: 4.0.0-preview.4 + + New features: + + all : added JSON-RPC-based display protocol + all : allow `enum abstract` syntax instead of `@:enum abstract` (#4282) + all : allow `extern` on fields instead of `@:extern` + all : support signature completion on incomplete structures (#5767) + all : support auto-numbering and auto-stringification in enum abstracts (#7139) + all : support `Type1 & Type2` intersection syntax for type parameter constraints and structures (#7127) + + General improvements and optimizations: + + all : reworked CLI usage/help output (#6862) + all : implemented `for` loop unrolling (#3784) + all : metadata can now use `.`, e.g. `@:a.b`. This is represented as a string (#3959) + all : [breaking] disallow static extensions through abstract field casts (#5924) + all : [breaking] disallow static extensions on implicit `this` (#6036) + all : allow true and false expressions as type parameters (#6958) + all : improved display support in many areas + all : support `override |` completion + all : make display/references and display/toplevel actually work sometimes + all : allow `var ?x` and `final ?x` parsing in structures (#6947) + all : improved overall robustness of the parser in display mode + all : allow `@:commutative` on non-static abstract functions (#5599) + js : added externs for js.Date (#6855) + js : respect `-D source-map` flag to generate source maps in release builds + js : enums are now generated as objects instead of arrays (#6350) + eval : improved debugger, support conditional breakpoints + + Removals: + + all : moved haxe.remoting to hx3compat + js : moved js.XMLSocket to hx3compat + neko : moved neko.net to hx3compat + all : removed support for `T:(A, B)` constraint syntax + + Bugfixes: + + all : fixed various issues with diagnostics + all : fixed fields with default values for `@:structInit` classes (#5449) + all : fixed `Null` inconsistency in if/ternary expressions (#6955) + all : fixed visibility check related to private constructors of sibling classes (#6957) + all : fixed @:generic naming (#6968) + all : fixed handling of type parameters in local functions (#6560) + all : fixed resolution order between `untyped` and type parameters (#7113) + all : fixed unification behavior in try/catch expressions (#7120) + all : fixed field type being lost for Int expressions on Float fields (#7132) + all : cleaned up `inline` handling (#7155) + display : fixed completion in packages starting with underscore (#5417) + php : fixed Reflect.callMethod with classes as first argument (#7106) + eval : fixed internal exception surfacing in some context calls (#7007) + eval : fixed Type.enumEq (#6710) + flash : fixed silently swallowing exceptions in getters/setters when invoked with Reflect methods (#5460, #6871) + + Standard Library: + + all : added `resize` to Array (#6869) + all : [breaking] removed `return this` from some haxe.Http methods (#6980) + +2018-02-23: 4.0.0-preview.3 + + See full commit history at https://github.com/HaxeFoundation/haxe/compare/4.0.0-preview.2...4.0.0-preview.3, notable changes below: + + New features: + + all : added new function type syntax (`(a:Int, b:String)->Void`) (#6645) + all : added column to StackItem.FilePos (#6665) + all : added `-D warn-var-shadowing` + all : added haxe.Log.formatOutput (#6738) + js : added js.Syntax class for generating unsupported JavaScript syntax in a type-safe analyzer-friendly way + js : added js.Map and js.Set and js.JsIterator extern definitions (ES6) + hl : added hl.Format.digest, use it for native Sha1/Md5 + + General improvements and optimizations: + + all : made all non-warning/non-error compiler messages output to stdout (#4480) + all : make DCE keep constructor if any instance field is kept (#6690) + all : make `final` in structures use class notation + display : added `this` and `super` to toplevel completion (#6051) + php : implemented direct method comparison. No need to use `Reflect.compareMethods()` + php : added `php.Syntax.code()` instead of deprecated `untyped __php__()` (#6708) + php : added methods to `php.Syntax` for each php operator: `??`, `?:`, `**` etc. (#6708) + python : add ssl support for http requests + python : improve Sys.print(ln) code generation (#6184) + js : generate faster code for `x.iterator()` calls (#6669) + js : rework exception handling, added js.Lib.getOriginalException (#6713) + js : generate `value instanceof MyClass` instead of `Std.is(value, MyClass)` (#6687) + js : use lazy getter for HaxeError.message instead of calling String(val) in the ctor (#6754) + + Removals: + + php : removed `php.Syntax.binop()` (#6708) + + Deprecations: + + php : deprecated support for `untyped __php__`, `untyped __call__` etc. Use `php.Syntax` instead. + + Bugfixes: + + all : delay interface accessor generation properly (#6225, #6672) + all : fixed unbound variable error in anonymous functions (#6674) + all : fixed abstract `@:to` used when `from` is available in a specific case (#6751) + all : sys.Http: fix chunked encoding handling (#6763) + all : fix some invalid Json being accepted by haxe.format.JsonParser (#6734) + all : fixed haxe.format.JsonPrinter for instances of classes to make it produce consistent result across targets (#6801) + all : fixed autogenerated constructor for extending @:structInit classes (#6822, #6078) + js : fixed saving setter to `tmp` var before invocation (#6672) + lua : fix toString behavior in the case of -0 (#6652) + lua : properly bind field functions when passed as arguments (#6722) + php : don't fail on generating import aliases for classes with the similar names (#6680) + php : fixed `Sys.environment()` to also return variables set by `Sys.putEnv()` + php : fixed `sys.net.Socket.bind()` (#6693) + php : fixed appending "sqlite:" prefix to the names of files created by `sys.db.Sqlite.open()` (#6692) + php : made php.Lib.objectOfAssociativeArray() recursive (#6698) + php : fixed php error on parsing expressions like `a == b == c` (#6720) + php : fixed multiple file uploads in php.Web.parseMultiPart() (#4173) + php : fixed an issue with "Object" used as a class name for PHP 7.2 (it's a new keyword in php) (#6838) + eval : don't lose dynamic function inits from parent classes (#6660) + cs : fix order-dependent enum type parameter issue (#6016) + +2017-10-08: 4.0.0-preview.2 + + New features: + + all : added final keyword (#6596) + + General improvements and optimizations: + + all : replaced some occurrences of List with Array + all : changed haxe.xml.Fast to an abstract + all : improved optimization when comparing against `null` + all : added support for `case var x` syntax and detect possible typos (#6608) + php : changed `--php-prefix`, `--php-front` and `--php-lib` to `-D php-prefix=`, `-D php-front=` and `-D php-lib=` respectively + + Removals: + + all : moved haxe.unit to hx3compat + all : moved haxe.web.Request to hx3compat + php : dropped php5 support; minimum supported php version is 7.0 now + + Bugfixes: + + all : fixed issue with various functions not being displayed in macro context (#6000) + all : fixed invalid static extension lookup on `super` (#3607) + all : fixed typing error when constructing enums with abstracts over functions (#6609) + all : fixed bug that skipped checking @:from typing in some cases (#6564) + all : fixed Int64 parsing of negative numbers that end in a zero (#5493) + all : fixed top-down inference when constructing enums (#6606) + eval : fixed bug with equality handling + eval : fixed issue with file creation not defaulting to binary + eval : fixed invalid override detection (#6583) + eval : fixed infinite recursion when printing arrays/vectors + cs/java : fixed DCE bug that would lose toString method of thrown objects + php/python : fixed some bit operators for Int32 (#5938) + php : fixed accessing `static inline var` via reflection (#6630) + php : fixed Math.min() and Math.max() for NAN on PHP 7.1.9 and 7.1.10 + js : fixed js syntax error for `value.iterator--` (#6637) + + Standard Library: + + macro : added have.display.Position and PositionTools.toRange (#6599) + all : moved List to haxe.ds (#6610) + +2017-09-12: 4.0.0-preview.1 + + New features: + + all : reworked macro interpreter + all : added support for arrow functions + + General improvements and optimizations: + + js : improved generation of `break` inside `switch` inside loops (#4964) + cs : improved generation of enum classes (#6119) + sys : the `database` parameter of `Mysql.connect` is now optional + js : updated jQuery extern (js.jquery.*) for jQuery 1.12.4 / 3.2.1 support. + Makefile : default Unix installation location $(INSTALL_DIR) changed from /usr to /usr/local. + Makefile : default Unix std location $(INSTALL_STD_DIR) changed from $(INSTALL_LIB_DIR)/std to $(INSTALL_DIR)/share/haxe/std. + + Removals: + + all : removed --eval command line argument + sys : SPOD (sys.db.Object, sys.db.Manager and friends) was moved into a separate library `record-macros` (https://github.com/HaxeFoundation/record-macros) + js : js.JQuery and js.SWFObject were moved into hx3compat library (https://github.com/HaxeFoundation/hx3compat), + it's recommended to use more modern js.jquery.JQuery and js.swfobject.SWFObject classes. + all : moved haxe.web.Dispatch into hx3compat library (https://github.com/HaxeFoundation/hx3compat). + + Bugfixes: + + php7: fix Reflect.field() for strings (#6276) + php7: fix `@:enum abstract` generation without `-dce full` (#6175) + php7: fix using enum constructor with arguments as a call argument (#6177) + php7: fix `null` property access (#6281) + php7: fix setting values in a map stored in another map (#6257) + php7: fix haxe.io.Input.readAll() with disabled analyzer optimizations (#6387) + php/php7: fixed accessing enum constructors on enum type stored to a variable (#6159) + php/php7: fix "cannot implement previously implemented interface" (#6208) + php: fix invoking functions stored in dynamic static vars (#6158) + php: fix field access on `new MyClass()` expressions wrapped in a `cast` (#6294) + + Standard Library: + + all : added `EReg.escape` (#5098) + all : `BalancedTree implements `haxe.Constraints.IMap` (#6231) + +2018-01-31: 3.4.5 + + General improvements and optimizations: + + dce : optimized DCE performance (#6181) + + Bugfixes: + + dce : don't remove constructor if any instance field is kept (#6062) + js : fixed saving setter to `tmp` var before invocation (#6672) + php7 : don't fail on generating import aliases for classes with the similar names (#6680) + php7 : fixed appending "sqlite:" prefix to the names of files created by `sys.db.Sqlite.open()` (#6692) + php7 : made php.Lib.objectOfAssociativeArray() recursive (#6698) + php7 : fixed php error on parsing expressions like `a == b == c` (#6720) + php/php7 : fixed `sys.net.Socket.bind()` (#6693) + +2017-10-08: 3.4.4 + + Bugfixes: + + flash : fixed flash target broken when compiled with OCaml 4.05 (#6589) + php7 : fixed accessing `static inline var` via reflection (#6630) + js : fixed js syntax error for `value.iterator--` (#6637) + cpp : fixed evaluation order problem when constructing enums (#6643) + +2017-09-10: 3.4.3 + + Bugfixes: + + all : fixed DCE issue with interface fields (#6502) + cpp : fixed return typing for embedded closures (#6121) + php7: fixed `@:enum abstract` generation without `-dce full` (#6175) + php7: fixed using enum constructor with arguments as a call argument (#6177) + php7: fixed accessing methods on dynamic values (#6211) + php7: fixed `null` property access (#6281) + php7: fixed setting values in a map stored in another map (#6257) + php7: implemented `php.Lib.mail()` + php7: implemented `php.Lib.loadLib()` + php7: implemented `php.Lib.getClasses()` (#6384) + php7: fixed exception on `Reflect.getProperty(o, field)` if requested field does not exist (#6559) + php/php7: fixed accessing enum constructors on enum type stored to a variable (#6159) + php/php7: fixed "cannot implement previously implemented interface" (#6208) + php: fixed invoking functions stored in dynamic static vars (#6158) + php: fixed field access on `new MyClass()` expressions wrapped in a `cast` (#6294) + macro : fixed bug in addClassPath that overwrites macro class paths with context class paths + +2017-03-20: 3.4.2 + + Bugfixes: + + cpp : fixed issue with @:native names being prefixed with :: (#6086) + cpp : fixed issue with return type handling (#6103) + cpp : fixed inaccurate line numbers that threw off debugging + php7 : fixed generation of `[][0]` constructs (#6090) + +2017-03-17: 3.4.1 + + New features: + + php7 : added source maps generation with `-D source_map` flag. + + General improvements and optimizations: + + cpp : added cpp.Star and cpp.Struct to help with extern typing + lua : cleaned up various parts of the standard library + + Bugfixes: + + all : fixed compilation server issue with two identical @:native paths on extern abstracts (#5993) + all : fixed invalid inling in a specific case (#6067) + all : fixed various display related issues + all : fixed inline super() calls missing field initializations (#6097) + all : consider UNC paths to be absolute in haxe.io.Path.isAbsolute (#6061) + cpp : improved typing of some Function/Callable-related types + cpp : fixed problem with line numbers when debugging + hl : various fixes and improvements + php : fixed FileSystem.stat() for directories on Windows (#6057) + php/php7 : fixed invalid result of Web.getPostData() (#6033) + php7 : fixed invalid access to length of string in some cases (#6055) + php7 : fixed infinite recursion on MysqlConnection.close() (#6056) + +2017-01-31: 3.4.0 + + General improvements and optimizations: + + all : support completion for static extensions (#5766) + all : removed neko dependency for macros, use PCRE instead + all : disabled analyzer optimizations by default, re-enable with -D analyzer-optimize + php7 : generate native `$v instanceof MyType` instead of `Std.is(v, MyType)` where possible for better performance + php7 : added @:phpNoConstructor meta for externs which do not have native php constructors and yet can be constructed + php7 : greatly reduced amount of generated tmp vars + php7 : `Array` performance improvements + hl : made various improvements + + Bugfixes: + + all : fixed `using` picking up non-static abstract functions (#5888) + all : fixed issue with side-effect detection when optimizing (#5911) + all : fixed issue with zlib bindings causing zlib_deflate errors (#5941) + php7 : Allow user-defined modules in `php` package (#5921) + php7 : Dereference some of `php.Syntax` methods if required (#5923) + php : fixed assigning a method of dynamic value to a variable (#5469) + php : fixed missing initialization of dynamic methods in classes with empty constructors (#4723) + +2016-12-24: 3.4.0-RC2 + + New features: + + js : added API documentation to HTML externs (#5868) + php : added php7 target, enabled with -D php7 + + Bugfixes: + + all : fixed top-down inference infinite recursion issue (#5848) + all : fixed regression in Compiler.include (#5847) + all : fixed Not_found exception related to try/catch (#5851) + all : fixed metadata completion showing up in trace arguments (#5775) + all : fixed problem with useless pattern detection (#5873) + all : fixed issue with toString handling in trace arguments (#5858) + all : fixed inline constructor scoping (#5855) + cpp : fixed issue with cpp.Pointer variables being eliminated (#5850) + js : added Notification API to HTML externs (#5852) + js : fixed several options structures in HTML externs (#5849) + php/cs : FileSystem.deleteFile() and FileSystem.deleteDirectory() now throw on non-existent path (#5742) + php/lua : fixed field access on `null` (#4988) + php : fixed static field access on a `Class` stored to a field (#5383) + php : fixed invalid detection of `NativeArray` by `Std.is()` (#5565) + php : fixed `stdin()`, `stdout()`, `stderr()` of `Sys` to use predefined constants for corresponding channels (#5733) + php : fixed Std.parseInt() on hexstrings for PHP7+ (#5521) + php : fixed typed cast in assign operations (#5135) + php : fixed exception thrown by `Reflect.fields(o)` when `o` is `Class` (#5608) + php : fixed json encoding of empty objects (#5015) + php : fixed checking floats for equality (#4260) + php : throw if invalid json string supplied to Json.parse() (#4592) + php : fixed ssl connections (#4581) + php : fixed writing bytes containing zero byte to MySQL & SQLite (#4489) + php : fixed call()() cases for PHP5 (#5569) + +2016-11-29: 3.4.0-RC1 + + New features: + + all : support metadata completion + all : support type-hint completion + all : added @signature display mode (#4758) + all : finalized HashLink (HL) target + + General improvements and optimizations: + + all : greatly improved support for display mode in general + all : made --times output look much nicer + all : remove calls to functions that have no side-effect + all : hid private property accessors from completion (#5678) + js : updated jQuery extern (js.jquery.*) for jQuery 1.12.4 / 3.1.0 support. + js : jQuery extern (js.jquery.*) now includes deprecated fields marked with @:deprecated. + js : no longer rewrite `o["s"]` to `o.s` (#5724) + cpp : greatly improved ObjC output and integration options + lua : greatly improved code output quality + + Bugfixes: + + all : fixed various optimization issues + all : fixed various issues with side-effect detection + all : fixed performance drain in the DCE implementation (#5716) + all : fixed issue with assignments when inlining constructors (#5340) + all : fixed major inlining issue when using compilation server (#5320) + all : fixed pattern matching evaluation order issue (#5274) + cpp : fixed various minor code generation issues + js : fixed issue regarding iterating over abstracts (#5385) + python : fixed evaluation order issue for array writing (#5366) + + Standard Library: + + all : added Any type (#5500) + all : added haxe.extern.AsVar + all : added haxe.macro.CompilationServer (experimental) + all : fixed haxe.Template.resolve (#5301) + +2016-05-27: 3.3.0-RC1 + + New features: + + all : support @:resolve on abstracts (#3753) + all : support extern abstracts and extern @:enum abstracts (#4862) + all : support completion on { if the expected type is a structure (#3907) + all : support (expr is Type) with mandatory parentheses (#2976) + all : allowed passing package dot-paths on command line (#4227) + all : support import.hx modules that define per-directory import/using directives (#1138) + all : support parsing of postfix ! operator (can be used by abstract operator overloading and macros) (#4284) + all : support parsing of ||= and &&= operators (can be used by abstract operator overloading and macros) (#4427) + all : support @:structInit classes (#4526) + all : reworked static analyzer and enabled it by default + flash : update flash externs to version 21 + hl : added HL target (interpreter and C output) + lua: added lua target + js : introduced new jQuery extern (js.jquery.*) for jQuery 1.12.4 / 2.2.4 support. (#4377) + js : introduced new SWFObject extern (js.swfobject.SWFObject) for SWFObject 2.3.20130521 (#4451) + js : added js.Lib.rethrow (#4551) + cs/java : added -D fast_cast as an experimental feature to cleanup casts + + Bugfixes: + + all : properly disallowed assigning methods to structures with read-accessors (#3975) + all : fixed a bug related to abstract + Int/Float and implicit casts (#4122) + all : disallowed duplicate type parameter names (#4293) + all : made UInt's >>> behave like >> (#2736) + all : fixed various type loading issues + all : fixed code generation problems with `inline` (#1827) + php/as3 : support run-time metadata on interfaces (#2042) + php : fixed argument passing to closures (#2587) + neko/cpp : fixed various sys.Filesystem issues with Windows drive paths (#3266) + as3 : fixed problem with covariant return types (#4222) + as3 : fixed rare problem with static initialization order (#3563) + python : fixed various reflection problems + + General improvements and optimizations: + + all : added support for determining minimal types in Map literals (#4196) + all : allowed @:native on abstracts to set the name of the implementation class (#4158) + all : allowed creating closures on abstract inline methods (#4165) + all : type parameter declarations can now have metadata (#3836) + all : optimize Math.ceil/floor on constant arguments (#4223) + all : allowed extern classes to have field names being used for both static and instance (#4376) + all : added haxe.Constraints.Constructible (#4761) + all : rewrote pattern matcher to improve output in many cases (#4940) + python : use spaces instead of tabs to indent the output (#4299) + cpp : reworked backend to improve overall code output quality and fix various issues + swf : added scene-tag to allow creating accessible SWF files + + Standard Library: + + all : added Lambda.flatten and Lambda.flatMap (#3553) + all : added haxe.Constraints.Constructible (#4761) + sys : proper quoting/escaping (can be opt-out) for Sys.command and sys.io.Process (#3603) + js : added position parameter to haxe.macro.Compiler.includeFile + js : removed -D embed-js (#4074) + js : updated HTML externs + + Macro features and changes: + + macro : added overloads field to ClassField (#3460) + macro : added Context.getLocalImports (#3560) + macro : added Context.onAfterTyping (#4714) + macro : added Context.resolveType + +2015-10-11: 3.2.1 + + Bugfixes: + + cs/java : fixed `-dce no` issues + cs/java : fixed how KExpr type parameters are generated + cs : fixed enum creation by reflection problem + cpp : do not rely in reflection to make interfaces work for non-first interface parents + cpp : fixed setting of static variables via reflection when class has no member variables + cpp : make sure StringMap's h field is kept if we use StringMap + js : Avoid the use of `eval`/`Function` to get the top-level defined type/var to not break ContentSecurityPolicy + +2015-05-12: 3.2.0 + + New features: + + all : added @:noPrivateAccess to re-enable access restrictions within @:privateAccess + cpp : some support for @:nativeGen metadata + + Bugfixes: + + all : fixed detection of @:generic classes with constructor constraints + all : fixed variable initialization check issue in loop condition + all : fixed pattern matching on @:enum abstracts via field access (#4084) + all : fixed missing implicit casts in Map literals (#4100) + all : fixed various minor issues in haxe.xml.Parser + all : fixed class path issue when HAXE_STD_PATH is set (#4163) + js : fixed DCE issue related to printing enums (#4197) + js : fixed various issues with the new Bytes implementation + php : fixed EOF handling in FileInput.readByte (#4082) + cs/java : fixed Math.fround implementation (#4177) + cs/java : fixed some cases of Std.parseInt failing (#4132) + cpp : fixed compilation without -main (#4199) + + General improvements and optimizations: + + all : --macro keep no longer causes types to be included for compilation + php : support interpolation in __php__ code + js : added variable number of arguments support in js.html.* classes + js : refined new HTML externs + + Macro features and changes: + + macro : [breaking] synced FClosure and FInstance with the compiler updates + +2015-03-15: 3.2.0-RC1 + + This release removes support for Flash 8 target + + New features: + + all : added --display mode for toplevel completion + all : added --display mode for position and usage information + all : allowed @:callable on abstracts to forward calls to their underlying type + all : allowed pattern matching on getters + all : allowed @:native on class fields + all : added static analyzer with constant propagation + all : added Haxe-based XML implementation + python : added python target + flash : flash player 12-14 support + js : added @:jsRequire and js.Lib.require + js : support haxe.CallStack.exceptionStack + cs : added @:bridgeProperties + cs : added -D erase_generics + cs : added -D dll_import to import haxe-generated dlls + java/cs : added `sys.db` package + java/cs : clean unused files in output folder, unless `-D keep_old_output` is defined + java/cs : added `-c-arg` to add C#/Java compiler arguments + cpp : inititial implementation of cppia scripting + + Bugfixes: + + all : fixed nullability of abstracts over functions + all : fixed some equality checks between UInt and Int + all : fixed rare issue with abstract casts + all : fixed some internal code which relied on unspecified evaluation order + all : fixed exhaustiveness checks involving guards + all : fixed issue involving recursively constrained type parameters and @:generic + all : fixed type inference issue in map literals + all : fixed type inference issue when calling abstract method from within the abstract + all : fixed several abstract variance issues + all : fixed DCE issues with interface properties + all : fixed variance issue with function variables and dynamic methods on interfaces + all : fixed pattern matching on empty arrays that are typed as Dynamic + all : fixed various @:generic issues + all : fixed default cases on @:enum abstract being omitted + all : fixed various expression positions + all : disallowed break/continue in closures in loops + all : disallowed inline functions in value places + all : fixed parsing of cast followed by parentheses + all : fixed resource naming in case of invalid file system characters + all : fixed issue with inlined array declarations with field access + cpp : fixed issue with the side-effect handler + cpp : fixed issue with NativeArray in --no-inline mode + php : fixed issue with invalid references for closures in for-loops + php : fixed Reflect.compare and string comparison for numeric strings + cs/java : fixed various issues with -java-lib and -net-lib. + cs/java : added @:libType to skip checking on -java-lib / -net-lib types + cs/java : compilation server now works with C#/Java [experimental support] + cs : fixed Type.enumIndex / switch on C# native enums + cs : fixed reflection on COM types + java : fixed sys.net.Socket server implementation + spod : various fixes - working now on cpp, java, neko, php and c# + cpp : improved boot order, with enums constants first + + General improvements and optimizations: + + all : disallowed using `super` in value positions + all : check exhaustiveness of explicit Null types + all : resolve unqualified identifiers to @:enum abstract constructors + all : determine @:generic type parameters from constructor call if possible + all : properly disallowed field redefinition in extending interface + all : properly disallowed leading zeroes for Int and Float literals + all : allowed variance on interface variables + all : allowed pattern matching on arrays if they are typed as Dynamic + all : allowed pattern matching on fields of parent classes + all : -D doc-gen no longer implies -dce no + all : allowed matching against null on any enum instance + flash/js: optimized haxe.ds.StringMap + neko : create output directory if it does not exist + js : inline Math methods and fields + cs/java : optimized Reflect.fields on dynamic structures + cs/java : haxe will now clear output directory of old files (use -D keep-old-output to keep them) + cs : optimized field lookup structure + cs : optimized casting of parametrized types + cs : beautify c# code output + cs : added `cs.Flags` to manipulate C# enums that can be also flags + xml : improved documentation generation and fixed missing entity escaping + cpp : property access via Dynamic variables now requires property to be declared with @:nativeProperty + cpp : allow injection of code from relative paths using @:sourceFile and @:cppInclude + cpp : stronger typing of native functions via cpp.Function + cpp.Callable + cpp : moved 'Class' implementation to hx namespace to improve objective C interaction + cpp : added file_extension define to change the output filename extension (eg, ".mm") + cpp : added pre-calculated hashes to string constants to allow faster lookups + cpp : map implementation allows strongly typed interactions in some cases (avoids boxing) + cpp : added native WeakMap implementation + cpp : put each resource into own cpp file to allow more data/smaller files + + Standard Library: + + all : added typed arrays to haxe.io package + all : added haxe.ds.Either + all : added haxe.extern.Rest type for representing "rest" arguments in extern method signatures + all : added haxe.extern.EitherType abstract type for dealing with externs for dynamic targets + all : added haxe.DynamicAccess type for working with dynamic anonymous structures using a Map-like interface + all : [breaking] changed haxe.ds.Vector.get to return T instead of Null + all : added haxe.macro.Compiler.addGlobalMetadata + all : changed haxe.Int64 to be an abstract type instead of a class + js : updated HTML externs + + Macro features and changes: + + macro : added Context.getLocalTVars + macro : added TypedExprTools.iter + macro : added Context.getCallArguments + macro : changed @:genericBuild macros to prefer ComplexType returns + macro : [breaking] extended TAnonymous structures now have AExtend status instead of AClosed + macro : added Context.getDefines + macro : fixed file_seek from end (position was inversed) + macro : added Context.storeTypedExpr + macro : allowed type name reification + + Deprecations: + + all : deprecated structurally extending classes and interfaces + sys : Sys.command shell special chars (&|<>#;*?(){}$) are now properly escaped + java/cs : Lib.nativeType is now renamed to Lib.getNativeType + +2014-04-13: 3.1.3 + + Bugfixes: + + all : fixed handling of abstract variance + flash : ensure correct endianess in haxe.io.BytesBuffer + cpp : fixed issue involving class paths with spaces + php : fixed >>> + macro : fixed haxe.macro.Compiler.keep + + General improvements and optimizations: + + all : give @:deprecated warnings by default, allow -D no-deprecation-warnings + cpp : optimized Vector implementation + + Standard Library: + + all : renamed Bytes.readDouble/Float to getDouble/Float to avoid inheritance issues + all : deprecated Bytes.readString in favor of getString + all : added pretty-printing to haxe.format.JsonPrinter (and haxe.Json) + +2014-03-29: 3.1.2 + + Bugfixes: + + all : disallowed spaces between >>, >>>, >>= and >>>= + all : fix branching issue when switching on Dynamic values with only one case + all : added missing abstract cast call when checking for equality + all : fixed member fields initializations on parent classes that have no constructor + all : fixed toString usage of abstracts which are argument to Std.string + flash : avoid rare FP 12 PPAPI JIT crash + cpp : fixed bug in side-effect handler which caused incorrect behavior of while loops + js : fixed missing print function for enum values with DCE + macro : make sure member field initializations are respected + + General improvements and optimizations: + + all : cached file exist checks to speed up compilations with a lot of class paths + all : improved completion related to super class fields + all : allowed iterating on abstract which have get_length and @:arrayAccess fields + js : improved Type.allEnums implementation to avoid issues with obfuscation + + Standard Library: + + all : added haxe.io.Bytes.readDouble/Float + all : added haxe.io.BytesBuffer.addString/Float/Double + +2014-03-15: 3.1.1 + + New features: + + all : added -D deprecation-warnings + all : allowed \u escape sequences in strings + cs : implemented haxe.CallStack + + Bugfixes: + + all : fixed wrong handling of "" and null in haxe.io.Path.join + all : fixed invalid cast-to-self generation on some abstracts + all : removed @:to Dynamic from UInt to avoid issues in the Map selection algorithm + all : fixed various issues with UInt + all : fixed position setter in haxe.io.BytesInput + all : fixed various issues with member/static extension macros + flash : fixed invalid override involving single-constraint type parameters + flash8 : fixed various bugs + js : fixed a problem with Std.string(null) being optimized incorrectly + js : fixed custom generators + cpp : dealt with string literals that are too long for MSVC + cs : fixed various issues with -net-lib + +2014-03-04: 3.1.0 + + New features: + + all : allowed null-patterns in pattern matching + all : allowed extractors in pattern matching using => syntax + all : allowed extending generic type parameters + all : allowed (expr : type) syntax (ECheckType) + all : allowed @:enum and @:forward on abstracts + all : allowed using abstracts as static extension + all : allowed Class.new + all : added EnumValue.match + all : allow multiple structural extension using { > T1, > T2, fields } + all : inline array and structure declarations if possible + cs : added -net-lib + cs : support for native delegates + cs : support for attributes + cs : support for events + + Standard Library: + + all : support abstract types in haxe.rtti.XmlParser + all : added Std.instance + all : added length field to BytesBuffer, BytesOutput, BytesInput and StringBuf + all : added UInt for all targets + all : added Array.indexOf and Array.lastIndexOf + all : added haxe.xml.Printer + all : added haxe.Int32 as abstract type + all : added haxe.format.JsonParser/Printer + + General improvements and optimizations: + + all : optimized pattern matching output + all : allowed recursive type parameter constraints + all : improved support of custom @:coreType abstracts + all : evaluate conditional expressions in @:require + all : improved inline constructors by detecting more cases where it can be applied + js : improved inlining + js : always use JSON extern (compile with -D old-browser to disable) + js : added -D js-flatten + js : added -D js-es5 + cpp : improved side-effect detection + + Bugfixes: + + all : inlining a parameter which has side effects will not remove it even if not used + all : implemented constraints check on enum and enum field type parameters + all : fixed memory leak in compilation server and optimized caching in general + all : fixed issue with invalid lowercase class name in Windows completion + flash : fixed font embedding with UTF8 chars + flash : give error if non-nullable basic types are skipped in a call + flash : give error if assigned parent class field values would be overwritten by super() + + Macro features and changes: + + macro : add Context.onAfterGenerate + macro : add Context.typeExpr + macro : add Context.getExpectedType + macro : add ExprTools.getValue + macro : allowed $v{(c:Float|Int|String)} + macro : resolve error line number in external files + macro : rewrote macros used as static extension + macro : exposed typed AST + macro : added @:genericBuild + macro : [breaking] first argument of ComplexType.TExtend is now Array instead of TypePath + macro : improved expression printing + +2013-09-25: 3.0.1 + all : minor DCE bug fix + +2013-05-25: 3.0.0 + all : added haxe.ds.BalancedTree + all : added haxe.ds.EnumValueMap + all : allow enum constructors as keys to Map + all : haxe.ds.ObjectMap is now correctly constrained on all targets + all : preliminary support of -D display-mode=usage|position|metadata + all : improved pattern matcher error messages + all : allow inline constructors + all : allow abstract member macros (not for @:op, @:arrayAccess, @:from, @:to) + all : allow abstract type parameter variance + all : do not generate hidden null on if without else + macro : made abstract structure available + +2013-05-08: 3.0.0-RC2 + all : improved abstract support + all : renamed HAXE_LIBRARY_PATH to HAXE_STD_PATH + all : added inlinable constructors + all : renamed haxe.ds.FastCell to GenericCell + all : fixed >= operator in #if conditionals + all : improved completion support for Unknown results + all : allowed [] access for Map + all : added haxe.ds.WeakMap (not yet supported on all platforms) + all : all trace parameters are now printed by default + all : added --help-metas + all : improved completion + all : improved pattern matching variable capture and GADT support + js : cached $bind results (unique closure creation per instance) + js : removed --js-modern (now as default) + cpp : added socket.setFastSend + flash : update player 11.7 api + flash : improved @:font, @:sound and @:bitmap support + neko/java/cs : improved Array performances when growing with [] + java : added -java-lib support + java : added sys.net package implementation (alpha) + java : complete java std library through hxjava haxelib + java/cs : added support for overloaded function declarations + java/cs : overload selection algorithm + cs : operator overloading is now accessible through Haxe + cs : source mapping; can be disabled with -D real_position + as3 : fixed rare syntax ambiguity + php : removed initialization of some inline fields + macro : fixed several issues with 'using' a macro function + macro : improved expression printing + +2013-02-24: 3.0.0-RC + flash : updated player 11.4 api + all : allowed named functions as r-value + all : fixed using + overload usage + all : allow any type constraint for type parameters + all : make property type optional (when a initial value is set) + all : Std.random(x) when x <= 0 is now always 0 + spod : added serialized data with SData + all : Dispatcher will now throw DETooManyValues + all : speed up neko compilation by using native compiler + all : allow @:generic on functions + all : allow constructing generic type parameters + swf : added support for SWC files in -swf-lib + macro : added Context.onTypeNotFound callback for unresolved types + js : no JS embed as default (use -D embed-js instead) + all : added abstract types (Int/Float/Bool/Void/Class/Enum/EnumValue) + all : added --help-defines + all : changed DCE with three modes : std(default), no and full + all : Haxe3 packages changes (see http://haxe.org/manual/haxe3) + all : Removed haxe.Int32, haxe.Firebug, haxe.TimerQueue + all : added -D key=value and #if (key >= value) operations + all : StringTools.htmlEscape/unescape nows handle "/" and '/' + all : using and import must now appear before any type declaration in a file + all : no longer create variable fields for pure getter/setter properties (unless @:isVar is used) + all : use default get_prop/set_prop instead of custom getter/setter names for properties + js : added JQuery.delegateTarget + macro : removed EType and CType, added EMeta, modified ESwitch + all : allow @metadata expr + all : replaced haxe.rtti.Generic interface with @:generic metadata + all : no longer infer arrays of mixed types as Array + all : all type/import/enum constructor resolution now follows the shadowing principle (latest has priority) + all : added EReg.matchSub, renamed EReg.customReplace to map + all : no longer allow initialization of extern non-inline variables + swf : fixed out of memory errors on very large swf-lib files + swf : added -D swf_preloader_frame, swf_gpu, swf_direct_blit + swf : added -D swf_script_timeout=seconds, swf_debug_password=password, swf_metadata=file + swf : added -swf-lib-extern + swf : added @:font support (beta) + all : added GADT support in enums + all : added pattern matching (beta) + all : changed callback(func, args) to func.bind(args) + macro : added haxe.macro.ExprTools/ComplexTypeTools/TypeTools + macro : changed reification syntax to ${expr}, $a{array}, $p{path}, $v{value} + macro : allow macro @:pos(pos-expr) to inject positions for reification + all : added array comprehension + flash : Vector.length is now Int instead of UInt + all : moved haxe.BaseCode, haxe.Md5 and haxe.SHA1 to haxe.crypto package + all : disallow Void variables and arguments (still allow S -> T to S -> Void) + all : added Array.map/filter + all : added spell check suggestions for enum constructors and fields + all : added opaque abstract(T) types + all : allow operator overloading on opaque abstract types + all : renamed IntIter to IntIterator + all : added Map + all : added haxe.ds with StringMap, IntMap, HashMap, ObjectMap, Vector, GenericStack + all : removed Hash, IntHash and haxe.FastList in favor of the types in haxe.ds + all : haxe.xml.Parser now handles entities consistently across platforms + all : renamed HAXE_LIBRARY_PATH environment variable to HAXE_STD_PATH + +2012-07-16: 2.10 + java/cs : added two new targets (beta) + all : fixed List and Null for first, last, pop + js : added js.Lib.debug() + flash : fixed Xml.parent() when no parent + flash : fixed haxe.io.Bytes.blit when len=0 + js/php/flash8 : fixed haxe.Int32.mul overflow on 52 bits + js : fixed haxe.Utf8 usage (static 'length' issue) + all : does not allow overriding var/prop + flash : removed wrapping for Xml nodes, use instead specific compare when comparing two typed nodes + js : use new haxe.xml.Parser (faster, not based on Regexp) + flash : fixed completion issue with for( x in Vector ) + all : optimized Std.int(123) and Std.int(123.45) + flash : bugfix for @:bitmap with 24-bits PNG (flash decode wrong colors) + as3 : fixed EnumValue becomes Object + js : removed js.Lib.isIE/isOpera (not complete, use js.JQuery.browser instead) + all : function parameters are nullable if they are declared with '?' + all : added support for finding common base types of multiple types (unify_min) for array, switch, if + php : do not implement duplicate interfaces + haxelib : added git support through haxelib git + all : allow derived classes to widen method visibility + macro : added haxe.macro.Context.getLocalMethod + macro : improved support of "using" macro functions + php : optimized Xml implementation + php : fixed Reflect.get/setProperty not working on PHP < 5.3 + all : support for callback(f, _, x) + all : allow private access between classes that have a common base class + all : added Output.writeFloat/Double and Input.readFloat/Double + all : support for var:{x:Float} = { x = 1 } constant structure subtyping + all : allow contravariant function arguments and covariant function returns in overrides + macro : support for final Array argument as rest argument + macro : use top-down inference on macro calls + all : made "using" imply "import" + all : made String concat more consistent across platforms (add Std.string wrappers) + all : allow direct member variable/property and static property initialization + js : greatly reduced amount of generated code by using smarter DCE + php : made modulo operations more consistent + all : allow local functions to have both type parameters and be inlined + all : functions type parameters can be constraint (will be checked at end of compilation) + macro : use NekoVM runtime for regexps, process and xml parsing + flash : allow @:getter/@:setter in interfaces + flash : added support for "arguments" in methods + all : not used enums and inline var/methods are now removed by DCE + all : allow @:overload to use type parameters and not-absolute type paths + all : ensure that Std.string of arrays and enums are now consistent across platforms + all : allow to inline functions containing other functions + xml : added metadata output to xml generator + macro : added macro and macro : reification + all : renamed type(e) to $type(e) + as3 : support for metadata and resources, and other fixes + +2012-04-14: 2.09 + all : optimized const == const and const != const (with different const types) + all : add Type.allEnums(e) + all : big improvements with completion speed and fixed many issues + flash9 : fixed -D swfprotected with swc output + neko : added ~ implementation + js : upgraded jquery version, more api overloads + sys : added "in" operator for spod macros, added relation access in expressions + macro : added ECheckType + macro : added TLazy for not-yet-typed class fields + js/php/neko : added haxe.web.Request + all : added Std.format + js : trace() output fallback on console.log if no id="haxe:trace" + all : ensure that Std.is(2.0,Int) returns true on all platforms + js : replaced $closure by function.$bind + changes in output format + all : allowed @:extern on static methods (no generate + no closure + force inlining) + all : added documentation in --display infos + display overloads in completion + js : removed --js-namespace, added $hxClasses + flash : output traces to native trace() when using -D fdb or -D nativeTrace + all : allowed abitrary string fields in anonymous objects + all : allowed optional structure fields (for constant structs) + all : allowed optional args in functions types (?Int -> Void) + all : added Reflect.getProperty/setProperty (except flash8) + all : added --wait and --cwd and --connect (parsed files and module caching) + all : fixed completion in macros calls arguments + all : fixed DCE removing empty but still used interfaces/superclasses + all : added haxe.Utf8 (crossplatform) + neko : Reflect now uses $fasthash (require neko 1.8.2) + all : allow \uXXXX in regexp (although not supported everywhere) + js : make difference between values and statements expressions in JSGenApi + js : added source mapping with -debug (replace previous stack emulation) + flash : added @:file("a.dat") class File extends flash.utils.ByteArray + flash : added @:sound("file.wav|mp3") class S extends flash.media.Sound + js : added --js-modern for wrapping output in a closure and ES5 strict mode + all : null, true and false are now keywords + all : neko.io.Path, cpp.io.Path and php.io.Path are now haxe.io.Path + neko, cpp, php : added Sys class, sys.io and sys.net packages and "sys" define + all : allow to access root package with std prefix (std.Type for example) + all : added haxe.EnumFlags + sys : io.File.getChar/stdin/stdout/stderr are now in Sys class + cpp : Reflect.getField and Reflect.setField no longer call property functions. Use Reflect.getProperty and Refelect.setProperty instead. + cpp : Default arguments now use Null for performance increase and interface compatibility + cpp : Added metadata options for injecting native cpp code into headers, classes and functions + php : added php.Lib.mail + (hotfix) fixed bug in completion and disabled profiling on Linux + (hotfix) fixed $ssize when doing new String(v) in neko + (hotfix) fixed bug with properties in interfaces for Flash & PHP + +2011-09-25: 2.08 + js : added js.JQuery + all : added @:overload + js : upgraded js.SWFObject from 1.4.4 inlined to 1.5 embedded + js : code generator beautify + all : ensure that modifying returned Type.getEnumConstructs array does not affect enum + all : allow macro typed parameters (other than Expr) + flash : added flash11 apis + neko : added support for https to haxe.Http (using hxssl library) + all : added haxe.Int64 + all : added haxe.Int32 isNeg,isZero,ucompare, fixed overflows for js/flash8/php + all : bugfix when optimizing inlined immediate function call + all : fixed "using" on macro function + all : allowed member macros functions (called as static) + neko : allowed serialization of haxe.Int32 (as Int) + all : fixed invalid optimization of two constant numbers comparison + flash8 : bugfix Std.parseInt with some hex values + flash9 : added flash.utils.RegExp + all : changed @:build behavior, now takes/returns a var with anonymous fields + all : added @:native support for enums + neko : changed the result of array-assign expression (was null) + flash9 : no longer auto create enums from SWF classes + (need explicit "enum" type patch) + all : optimized variable tracking/renaming + all : optimized macro engine (speed x2) + all : added -D macrotimes support + flash9 : store resources in bytes tag instead of bytecode + all : allow $ prefixed identifiers (for macros usage only) + all : allow to access modules subtype statics with pack.Mod.Type.value + and fixed identifier resolution order + flash9 : added @:bitmap("file") for simple embedding + all : added haxe.web.Dispatch + js : added js.Storage + all : allow this + member variables access in local functions + added untyped __this__ support and transition error + all : added haxe.macro.MacroType + neko : neko.Lib.serialize/unserialize now returns bytes + neko : added sys.db package (crossplatform with -D spod_macro support) + spod_macro now uses wrappers for Bytes (require neko 1.8.2) + php : added --php-prefix for prefixing generated files and class names + all : added type_expr_with_type enum support + php/js : fixed adding 'null' to StringBuf + all : added haxe.macro.Context.defineType + +2011-01-30: 2.07 + all : fixed completion support with --remap + all : added macros, added --interp + all : removed 'here' special identifier + neko : fixed neko.Web.getParamsString() returning "null" instead of "" + flash9 : fixed issue with @:bind + flash9 : added some missing errors + flash9 : fixed TypedDictionary.exists + all : added @:build and @:autoBuild for enums and classes + neko : Std.parseFloat now returns NaN with invalid string + php: fixed Array.push must return the current length (issue 219) + php: fixed EReg.replace (issue 194) + php: FileSystem.readDirectory now skips '.' and '..' to be consistent with neko (issue 226) + flash9 : add trace text on stage (always over current and subclips) + flash9 : delay SWF initialization until it's added on stage and stageWidth > 0 + (this can be disabled with -D dontWaitStage) + all : added haxe.Timer.measure + all : added Lambda.indexOf and Lambda.concat + all : no longer allow inline vars as metadata values + neko : added getFieldsNames to neko.db.ResultSet (supported in Neko 1.8.2 mysql driver) + all : added --macro and haxe.macro.Compiler + all : allow macro type patches + flash9 : changed --gen-hx-classes implementation + now use 'haxe -swf-lib lib.swf --gen-hx-classes' instead + flash9 : added @:getter and @:setter + all : added @:require + flash9 : moved vector utils functions from flash.Lib to flash.Vector + flash9 : added support for FP 10.1 and 10.2 + flash9 : added @:meta(Meta(k="v")) support + all : improved #if support (fixed ! precedence) + all : lookup unqualified types in all package hierarchy and not only in current package + flash : set default flash version to 10 (-swf9 deprecated, use -swf-version 8 for avm1) + php : added --php-lib to allow to rename the destination path of the generated lib + all : added --dead-code-elimination, removes unused functions from the output + (beta feature could not make in the final release) + all : added @:keep to prevent --dead-code-elimination of class/method + flash9 : fixed issues with loading a Haxe SWF (boot_XXXX class extends flash.Boot) + all : allow to inline override methods (if the superclass method is not inlined already) + all : fixed escape sequences in literal regular expressions + flash9 : fixed Xml.setNodeValue + all : removed -excluded, replaced by --macro excludeFile('filename') + all : added --macro exclude('package') and --macro include('package') + all : importing a typedef of an enum allow to access its constructors + all : removed String.cca (replaced by StringTools.fastCodeAt + StringTools.isEOF) + flash9 : fixed use of default values when null is passed for nullable basic types + all : fixed issues with inlining and class/function type parameters + all : big speedup for compiler internal completion + all : added --macro keepClass('classname') + flash9 : fixed Xml.nodeValue for comments (does not include ) + all : added named local functions (allow self-recursion) + all : use left-assoc for (==,!=,>,>=,<,<=)(==,!=,>,>=,<,<=) (&&)(&&) and (||)(||) + all : give prefix unary operators higher priority than ?: + php : fixed XML parsing + cpp : many fixes + +2010-08-14: 2.06 + neko : change serializer to be able to handle instances of basic classes from other modules + js : add Document.createTextNode + all : bugfix with inline when modifying var with same name as one of current local + flash9 : classes implementing ArrayAccess are now dynamic (including TypedDictionary) + all : allow "using" on typedefs + as3 : minor fixes in genas3 and --gen-hx-classes + as3 : fix with readonly/writeonly properties accesses + flash9 : list native getter/setters in Type API class/instance fields + all : make haxe.rtti.Generic typing lazy (fix for self-recursion) + all : allow haxe.rtti.Generic + inheritance + all : added resource size limit to 12MB (ocaml max_string_size is 16MB + b64) + flash : changes in swf handling to work with >16MB swfs + flash9 : only init dynamic methods if not already defined (in subclass) + std : added haxe.SHA1 + compiler : added TCast, allow cast optimization on flash9/cpp + as3 : fixed Std.__init__ generating 'null' + compiler : fixed -no-opt + flash : allow several -swf-lib + no longer support automatic creation of classes for f8 swfs in f9 mode + classes defined in f9 swf are not redefinable in Haxe code (use extern) + flash9 : allow direct access and completion with classes defined in -swf-lib's + flash9 : remove imported libraries debug infos when not compiled with -debug + all : only display errors with --display if no completion matched + all : some completion related errors fixed + flash9 : added @:bind support + all : fixed StringTools.hex with negative numbers + flash9 : fixed Type.typeof(1<<28) was TFloat + flash9 : use flash.XML parser for Xml class implementation + neko : fixed Array.splice (was not setting null at end of array) + neko : rewrote Array class using neko.NativeArray + all : core classes implementation are now in std/(platform)/_std + all : added @:final support + all : added haxe.rtti.Meta + flash9 : added flash.desktop.Clipboard* classes (added in flash10) + as3 : fixed Date.toString issue in flash.Boot (now use .toStringHX instead) + this will only work if .toString called explicitely on Date class + all : only allow "using" on Dynamic if first parameter is Dynamic + php : haxe.Http now supports Https connections when OpenSSL extension is enabled (issue 143) + php : fixed enum constructors sequence (issue 142) + php : added error message when using 2 fields with different cases in the same class/enum + php : fixed field declaration for properties with getter and setter (issue 124) + php : fixed comparison issues between strings (issue 132) + php : enhanced FileInput.readLine using native fgets function (issue 103) + flash9 : renamed flash.Error to flash.errors.Error + php : removed eval() everywhere and simplified _hx_lambda + php : fixed return type for Std.string() with integers and floats + php : fixed php.Lib.rethrow + all : added custom Haxe serialization + php : aligned php.Web.parseMultipart signature with neko implementation + cpp : Added source location and stack dump for errors in debug mode + cpp : Remapped more keywords + cpp : Added templated fast iterator code for arrays and FastLists + cpp : Added option for tracing GC references in debug mode + cpp : Switch the native string implementation from wchar_t to utf8 - for regex speed + cpp : Added extra "()" to ensure correct order of operations + cpp : Fixed various bugs for unusual (and not so unusual) language constructs + cpp : Fixed order of enum generation from index + cpp : Added __unsafe_get and __unsafe_set to Array as possible optimizations + cpp : Default to mult-thread compiling on windows for cl version >= 14 + cpp : Seed Math.random + cpp : Use strftime for Dates + cpp : Fix socket sellect passing _s + cpp : Throw error when match count does not match regex + cpp : Improve register capture in GC + cpp : Fix Dynamic integer compare + cpp : Implement makeVarArgs + cpp : Fix toString for nulls in Enums and Arrays + cpp : Added initial Android support + cpp : Move initializers to entry functions in standard ndlls. + cpp : Changes some CFFI register funtions to char*, from wchar_t* + cpp : Added some initial support for v8 script target + cpp : Use non-recursive GC marking to avoid overflow in big lists + cpp : Added __hxcpp_obj_id + +2010-01-09: 2.05 + js : added js.Scroll + js : package names are now checked at runtime to avoid clashes with existing libs + js : added --js-namespace to create a namespace for types that are defined in the root + all : updated xml output and html doc - add inline, override, dynamic functions support + all : added error when comparing enum with arguments + all : optimize constant equality for enums + flash9 : fixed verify error with inline + null type + flash9 : bugfix when overriding/implementing an method with an applied type parameter + php : fixed issues with classes that implement Dynamic + all : ignore #! line at beginning of the hx file + haxelib : added tags, added documentation + flash8 : don't use b64 encoding for text ressources + php : fixed bug in Hash.exists for null values and Reflect.callMethod + js/flash9 : throw exception in Xml.parse when unclosed node + all : improve return type progagation in inlined expression (fix some VerifyErrors) + all : optimize {const} into const + all : added structure / Dynamic subtyping + all : fixed List.map2 error when inline + optional args + flash9 : encode all ISO constant strings into UTF8 at compilation time + all : allow hxml with only -cmd statements + spod : moved Manager.addQuote to Connection.addValue + flash9 : removed .iterator() from Vector (not implementable) + all : fixed haxe.rtti.Generic on interfaces + php : fixed issue with Reflect.callMethod + php : fixed issue with PHP reserved word used in callbacks + all : bugfix with non-constant enums in switches + flash9 : fix for interfaces (use namespace) + all : "using" now works for identifiers in member methods + flash9 : bugfix with switch on some big integers + all : bugfix when optimizing (function(x) return x)(x) + neko : improved speed of Xml.toString() + all : added -D dump (for debugging purposes) + neko : added neko.Web.isTora + php : added php.db.PDO (php.db.Sqlite is now deprecated) + php : fixed bug in Type.getClassFields() that reported duplicated entries + php : fixed errror in XML error reporting + all : allow sub-types declarations everywhere (pack.Type.Sub) + all : added completion for sub-types declarations + all : improved completion with lambda function + as3 : several generation fixes + all : bugfix haxe.rtti.Generic on private class + php/js/cpp : sanitize binary expressions to prevent inlining errors + spod : remove object from cache when deleted + +2009-07-26: 2.04 + flash9 : fixed get_full_path error with -D fdb + js : fixed Array.remove on IE + flash8 : removed extra empty AS3 tag (causing some issue with F8 loadMovie) + improved speed of Bytes unserializing (no need for BytesBuffer) + flash9 : bugfix, Null was generating dynamic code + flash9 : added error message in flash.Vector if used without flash 10 + flash9 : fixed some "never" property access issues + all : added "never" property access support for all platforms + js : small syntax fix with value-blocks + js : fixed Type.enumEq with null values + js/flash8 : use &0xFF in haxe.io.Bytes.set + flash9 : fixed switch on Null verify error + flash9 : fixes related to UInt type + error when using Int/UInt comparison + as3 : improved Vector support, inline flash.Lib.as + as3 : bugfix with skip_constructor + as3 : added Enum.__constructs__ (allow Type.getEnumConstructs) + as3 : make all constructor parameters optional (allow Type.createEmptyInstance) + as3 : bugfix with property access inside setter (stack overflow) + all : Enum is now Enum + all : added Type.createEnumIndex + all : forbid same name for static+instance field (not supported on several platforms) + all : renamed haxe.Http.request to "requestUrl" + all : renamed neko.zip.Compress/Uncompress.run to "execute" + spod : fix very rare issue with relations and transactions + compiler : added TClosure - optimize closure creation and ease code generation + cpp : added CPP platform + all : added 'using' syntax + neko : added 'domains' optional param to ThreadRemotingServer to answer policy-file-request + php : fixed php.db.Mysql so that getResult is consistent with Neko behavior + php : fixed __toString for anonymouse objects + php : fixed bug in overridden dynamic functions + php : fixed round to be consistent with other platforms + php : fixed bug concatenating two dynamic variables + php : php.Lib.rethrow now works as expected + flash9 : fixed bug with SWC output and recursive types + flash8 : fixed inversed arguments in __new__ + neko : added neko.net.Socket.setFastSend + php: fixed String.charCodeAt + php: minor optimization (removed foreach from std code) + php: implemented haxe.Stack + php: changed exception handler to use Haxe call stack + php: changed special vars to use the '\xBB' prefix instead of __ + php: fixed use of reserved keywords for var names + php: List iterator is now class based (faster) + php: fixed behavior of class variables having assigned functions + php: fixed php.db.Manager (was uncorrectly removing superclass fields) + php: added support for native Iterator and IteratorAggregate interfaces + all : added --display classes and --display keywords + all : fixed issue with optional parameters in inline functions + all : allow implementing interfaces with inline methods + all : enable inlining for getter/setter/iterator/resolve/using + +2009-03-22: 2.03 + optimized Type.enumEq : use index instead of tag comparison for neko/flash9/php + bugfix for flash.display.BitmapDataChannel and GraphicsPathCommand (allow inline static) + resolve environment variable in -cmd commands + added flash.Vector.indexOf and lastIndexOf + fixed bug in interfaces that define the method toString (Haxe/PHP) + fixed bug in haxe.io.BytesInput.readBytes in Flash9 (was throwing Eof if full buffer can't be read) + fixed implements/extends special classes when they are imported + StringBuf now uses an array for JS implementation (around same on FF, faster on IE) + fixed assignment of field length in anonym objects (Haxe/PHP) + fixed addEventListener typing for flash9 + fixed __vector__ generation for AS3 target + fix with inline functions : position is now the inserted position and not the original one (better error reporting) + added SWC output support + fixed issues with unset of values in for loops and executing blocks that return functions (Haxe/PHP) + "throw" type is now Unknown instead of Dynamic (prevent type-hole in "if A else if B else throw") + added __foreach__ for flash9/as3 + fixed f9 verify error with different kind of functions + moved eof() from neko.io.FileOutput to FileInput + added haxe.rtti.HtmlEditor + added neko.db.Manager.setLockMode + genAS3 : fixed Error classes issues + genAS3 : fixed default basic type value in interfaces + flash9 : fixed UInt default parameter verify error + flash9 : fixed issue with flash.* string enums verify error + compiler : allowed \r line separators for HXML files + flash9 : fixed verify error with loop variable beeing a specific class + compiler : prevent truncating float dynamic values to int when using numerical operations + neko.db.Manager fix : synchronize fields after locking an unlocked cached object + compiler : fixed issue with cascading inline+haxe.rtti.Generic + optimizer : reduce constant int/float/bool expressions and immediate function calls + flash9/as3/php : don't add Boot.skip_constructor test if no side effects in constructor + compiler : added --no-opt to disable expr reduction + compiler : separated basic and advanced commandline options + compiler : fixed printing of sub-function types + genHX : fixed generation of classes that extends another class (shouldn't be turned into enums) + speedup Array.remove on flash9/js + +2008-11-23: 2.02 + Std.is(MyInterface, Class) now returns true (Haxe/PHP) + php arrays are wrapped into _hx_array instances, fixes issues with references (array cast, access out of bounds ...) + removed untested php classes (php.DBase, php.IniHash) + added -D use_rtti_doc + flash.Lib.getTimer() now returns Int and is inlined + fixed php.FileSystem.stat + added memory related functions to php.Sys + added error when trying to extend Array, String, Date and Xml + fixed handling of implements ArrayAccess + fixed some minor things in flash10 api + switch/for/while/do/try/if are no longer using parse_next (parenthesises requ. instead) + fixed Type.typeof and Std.is in case of too much large integers for Flash6-8/JS + haxe.xml.Check : treat comments the same as PCDATA spaces + haxe.io.BytesData now uses strings instead of arrays for PHP + compiler : optimized line calculus from ast position + lexer : allow identifiers starting with _[0-9] + fixed access to flash.Vector methods : use AS3 namespace (faster) + bugfix in inline functions : modifying a parameter can't modify a real local var anymore + bugfix in inline functions : handle class type parameters and method type parameters + fixed issue with Int default value for Float parameter + flash9 : bugfix when using the retval after setting a closure variable + added flash.Memory API for flash10 alchemy opcodes access + changed #if as3gen to #if as3 when generating as3 code + fixed as3 flash.Vector generation + fixed haxe.io.BytesOutput for flash9 : set default to little-endian + some flash9 fixes related to extern enums + updated flash.text.engine package with haxe enums + flash9 : use target file path for Boot unique ID instead of random number + as3 : fixed bug when anonymous field was a reserved identifier + flash9 : added flash.Lib.vectorOfArray and vectorConvert for flash10 + added -D check-js-packages to allow several haxe-generated js files in same page + +2008-10-04: 2.01 + fixed php.Sys + added neko.NativeString and neko.NativeArray + fixed php.Boot.__string_rec() when invoked from toString + fixed null references in class constructors for array arguments + fixed Type.enumParameters() and Type.typeOf() for PHP + fixed SPOD/MySql for PHP + fixed php.net.Socket.setTimeout(), php.io.Process + fixed php.Web.setCookie() for expire time + fixed php rethrow in catches and added the possibility to catch native exceptions + added runttime check for php.io.Socket.shutdown (uses fclose in php 5.1.x) + allowed optional Context in remoting connections + fixed extern classes for flash < 8 + fixed inherited protected/private properties in as3 SWF library + fixed haxe.io float/double in Neko (when bigEndian was null) + added __FSCommand2__ support + optimized haxe.Unserializer (use faster buffer access) + use "Dynamic" instead of Dynamic->Void for flash9 IEventDispatcher + always use full classes paths for genAS3 + prevent different get/set property accesses when implementing an interface + fixed assign of dynamicfunction references in PHP + Haxe/PHP now generates code for extern classes __init__ + added strings literal support in haxe.Template + fixed Process arguments and exitCode() in Haxe/PHP + fixed hierarchy problem for classes with the name from different packages Haxe/PHP + php.db.Mysql now throws an exception when tries to connect to an unexistant DB + fixed blocks in if statements for Haxe/PHP + added php check on the full hierarchy for colliding names + added support for "g" modifier in EReg for PHP + PHP now generates __toString for classes that have toString defined + implemented php.Lib.getClasses() + fixed duplicate fields in Type.getInstanceFields on subclass + Enum is no longer defined inside Type but is standalone class + fixed Date.getDay on Neko/Windows (use %w instead of %u) + fixed memory leak with PHP closures + fixed wrong scope in PHP closures + fixed Array.reverse() in PHP + fixed Reflect.compareMethods in Neko (require Neko 1.8.0) + fixed flash7-8 register usage for __init__ and static variables initialization + moved StringTools.baseEncode/Decode to haxe.BaseCode + fixed binary resources for Flash, JS and PHP outputs + fixed compiler bug with inline + optional arguments + fixed Type.createInstance and createEmptyInstance with Array for flash6-8 + +2008-07-28: 2.0 + fixed current package bug in inherited constructor type + delayed type-parameter constraints check (allow mutual rec extends for SPOD) + improved unclosed macro error reporting + Haxe/PHP integration + renamed NekoSocketConnection to SyncSocketConnection (php support) + fixes in genAs3 + fix for flash9 : always coerce call return type + set all private+protected names from SWF lib to public (allow override+reflect) + flash9 : use findprop instead of findpropstrict for 'this' access (allow dynamic) + don't allow nullness changes in overrided/implemented + prevent typing hole with overridden polymorphic methods + added neko.vm.Mutex and neko.vm.Deque (included in neko 1.7.1) + added package remapping using --remap + +2008-07-17: 2.0-RC1 + genneko : remove big array error (fixed in neko 1.7.1) + fixed neko.net.ThreadRemotingServer.onXML + genswf9 : fixed verify error with Null (was using dynamic access) + small patch for jsfl support + added .cca for faster string operations on Flash9/Flash/JS + bugfix with inlined local variables + upgraded flash9 api to flex3/player 9.0.115 + override is now mandatory, no more --override + dynamic is now a keyword + f9dynamic is now dynamic and is mandatory on all platforms + public/private/dynamic are inherited by default when overriding a method + removed Reflect.empty() : use {} instead + changed #else by #elseif, added #else + flash9 : optimized Hash,IntHash,StringBuf (use typed value) + Reflect.field/setField/callMethod , Type.enumIndex and StringBuf methods are now inlined + optimized haxe.Md5 : don't use statics + allow up to 8 parameters in Reflect.createInstance + flash9 : some minor optimizations in haxe.Serializer + added haxe.io package (removed things from neko.io) + __resolve becomes resolve (and should be documented) + added haxe.Int32 + removed neko.Int32 + removed neko.io.Input/Output/Eof/Error/Logger/Multiple/StringInput/StringOutput + removed neko.net.RemotingServer + changed neko apis to use haxe.io and Bytes instead of String buffers + fixed big bug in js/flash8 debug stack handling + complete rewrite of haxe.remoting package + haxe.io.Bytes serialization support (replace deprecated string support) + removed === and !== + removed Std.bool + fixed : Reflect.field(null) in flash9 doesn't throw an error anymore + removed Type.toClass and Type.toEnum + Dynamic type is now a class and not an enum + moved reflection support for core types from Boot to Std + fixed Type.getClassName/getEnumName/resolve for core flash9 types + renamed haxe.rtti.Type to haxe.rtti.CType (with changes in prefix) + added haxe.TimerQueue, added haxe.Timer.delay, remove haxe.Timer.delayed + flash9 : bugfix, generated interfaces were empty + fixed bug while writing block-vars in flash/js + added parameters default value (constants) + removed Std.resource, Std.ord, Std.chr + added haxe.Resource, allow binary data in resources + added Type.createEnum + check that local variables get correctly initialized before usage + haxe.Stack support for flash9 + +2008-04-05: 1.19 + fixed flash9 Array.toString + fixed inline return bug + added haxe.rtti.Generic behavior + added haxe.FastList + bugfix to prevent recursive anonymous + fixed some incorrectly reported "recursive inline" errors + fixes in genas3 + genswf9 for Dynamic/* in methods + {} is now an empty object and not an empty block + fixed some verify errors left in flash9 + fixed private/protected differences in gen-hx-classes + genswf9 : allowed to store a Class in a typed register + fixed switch-on-bool (don't use matching) + genswf9 : optimized switch on ints + some renames in haxe.rtti.Type + added flash.utils.TypedDictionary for F9 + genswf9 : fixe debug filename with inline code + fixed completion for packages starting with 'a' or 'z' + added flash9.Lib.as + prevent double Movieclip class declaration when linking flash9 lib + allow numerical operations on type parameters constraint by Float + genswf9 : fixed dynamic inheritance + +2008-02-23: 1.18 + some optimization and bugfix for as3 codegen + bugfix : allow bitmaps and fonts classes for F9 library + bugfix : neko.Web.setCookie + bugfix : as3 switches in -swf-lib, and enable to "repair" corrupted as3 bytecode + fixed --i return value in flash9 + fixed some transforms in flash9 + added js.Selection + simplified js.Dom (more events) + added haxe.xml.Fast.innerHTML + added Reflect.compare + fixed "".split() in Neko (now returns [""] instead of []) + bugfix for swf-lib f9 classes ordering + added EReg.customReplace + added neko.Lib.lazyLoad and improved neko.net.Poll for Neko 1.6.1 + prevented static fields in interfaces + added neko.Sys.cpuTime() + fix for protected as3 classes + added support for flash9 XML (in flash.xml package) + added neko.vm.Tls for Neko 1.6.1 + added --no-inline + renamed neko.zip.File to neko.zip.Reader + added neko.zip.Writer and neko.zip.CRC32 + fixed multilevel Transform.block_vars + added js.SWFObject + fixes for if/switch with null or Null on Flash9 + +2008-01-13: 1.17 + fixed Int32.compare, added Int32.read and Int32.write + fixed type of unitialized registers in flash9 + fixed Sqlite transactions (commit and rollback now restart a transaction) + several flash9 optimizations + flash9 debug support (with -D fdb) + set align to TopLeft if not defined for flash9 + added neko.vm.Gc + fixed Null should not be a value + bugfix in serialization format with USE_ENUM_INDEXES + added apis in DateTools for time manipulation + bugfix in flash9 : strictly typed local vars used in local functions + always force swf version and sandbox redefinition + added as3hl layer + merge as3 classes + use flash9 fast switch for enums + always use match for enums (no switch even if constant) + fixed DateTools.format %I and %l in Flash/JS + securized Hash for JS and Flash + compiletime F9 class generation for F8 swflib + optimized for loops (Array and IntIter) + added #line support + more f9 Null support for "if" and array declarations + more neko.Web.setCookie parameters + added "inline" for methods and static vars + fixed % type in flash9 + +2007-10-31: 1.16 + use _sans font for default flash traces (better Linux support) + fixed haxe.remoting.Connection compilation for Flash<8 + added fix to prevent 64K identifiers limit on Flash<9 + ensure order of anonymous fields initialization + fixed haxe.remoting.Connection.urlConnect in JS + use amortized O(1) for Neko Array implementation + ndlls libraries should now use .neko() instead of __a + allowed 'u' utf8 for regexp (needs Neko 1.6.1 regexp.ndll on windows) + onclick and onsubmit JS events returns Bool + fixed inherited constructor of extern class was always private + fixed Ereg.split without 'g' flag on JS/Flash9 + fixed haxe.Stack in JS without -debug + added support for -D no-swf-compress + fixed ByteArray.readObject + fixed implements Dynamic in Flash9 + removed neko.io.FileInput.eof, fixed neko.io.Input.readLine + fixed haxe.Template for Flash9 + added neko.Sys.command optional array of arguments + removed haxe.Proxy + added flash.XMLRequest + fixed Type.enumParameters for Neko + guaranteed order of Type.getEnumConstructs same as code + used index-based dispatch for enums + added Type.enumIndex + fixed enum.toString for Flash and JS + support for -Dnetwork-sandbox + trim -cp and -resource + various genas3 fixes + +2007-08-29: 1.15 + fixed bug with Enum.construct when Enum have type parameters + change with "untyped" : arguments types are checked (because of opt select) + haxedoc : fixed type parameters display + fix for JS and Flash9 XML parser : allow newlines in attributes + disable Flash9 resources with AS3Gen + error on extra anonymous fields + error on too much big neko array declaration (neko 1.6 max_stack limit) + fixed Flash9 statics slots (FP 9,0,60 compatibility) + fixed Flash9 Type.getClassName + optional enums arguments on Flash9 are now automatically Null + forbid usage of type parameters in static functions + fixed Std.int with negative numbers + fixed some F9 issues with Haxe-specific Array, Date and Math methods + used AS3 namespace for F9 Array and String instance methods + fixed F9 with uninitialized integer registers + fixed F9 + operator with Dynamic/Null operands + added Enum subtyping + fix with remoting threadserver and exceptions + fixed Flash9 dynamic runtime type field access + fixed very tricky typing bug with constructors inheritance + fixed some documentation related parser bug + fixed stack overflow with static setter + fixed package completion bug when -cp points to an not existing dir + fix duplicate sandboxes tags with -swf + __resolve in Haxe Remoting is now public + +2007-07-25: 1.14 + fixed no error when invalid "catch" expression + remove variance + fixed prototype bug in neko when "Main" class is defined + fixed flash9 xml iterator methods + bugfix in flash9 ByteArray serialization + fixed genAS3 conflicting classes and interfaces + preserve neko output file extension + added flash.Event for Flash9 + added --no-output + fixed neko.net.Socket peer and host methods + added neko.io.Process and neko.vm.Ui + added haxe.xml.Proxy + some flash6 fixes + allowed simplequotes for xml attributes in Flash9 and JS + flash9 optimizing compiler + new faster neko binary AST + added haxe.remoting.NekoSocketConnection and SocketProtocol + don't allow for...in iteration with Dynamic or Unknown + added flash9 resources + fixed precedence of ternary operator ?: + +2007-05-18: 1.13 + fixed bug with local variable masking package in catch type + fixed "Not_found" when enum params differs + added "override" for AS3 generator + fixed stack overflow in typedefs + added haxe.Timer.queue, removed delayedArg (use callback instead) + fixed haxe.remoting.SocketConnection (msg invertions might occur) + add uniqueness check for switch constants + js : HtmlCollection and MetaDom.childNodes are not true Arrays + allowed semicolon after typedef declaration + fixed in-loop closure usage of "for" variable for Flash and JS + added neko.net.ThreadRemotingServer.onXml (to handle crossdomain xml) + more accurate stack trace for socket remoting + prevent some memory leak in haxe.Timer / JS + added flash fullscreen support + added cond?a:b syntax support + added utf8 buffer api + added haxelib "dev" mode + renamed Http.asyncRequest to customRequest + add classes to Neko module export table + fixed parametrized enums for Flash6 + fixed bug with completion and interfaces + fixed --flash-use-stage in Flash9 + +2007-03-06: 1.12 + added flash lite support with -D flash_lite + bugfix for Unknown should Unknown + prevent some exceptions in neko.net.ProxyDetect + fixed ByteArray serialization + added neko.Int32 + added -x for fast neko scripting + prevent locals from breaking class access (works with imports) + fix in function overriding subtyping + added haxe.remoting.FlashJsConnection + fixed tar support in neko.zip.File + ide completion support using --display + give access to neko.net.Host ip (as Int32) + fixed bug when calling super.UpperCaseMethod() + hide additional flash Array methods + allow leading comma in anonymous types + added haxe.Public interface + added AS3 code generator + field lookup gives priority to superclass over interfaces + improved haxedoc output + fixed bug in neko regexp split/replace when empty match at eol + fixed bug in flash 6-7-8 resources generation + +2007-01-28: 1.11 + changed StringBuf.add implementation + added haxe.Firebug + allowed variable return type for overridden/implemented methods + display error position in front of each error line + improved error messages when optional arguments not matched + added neko.io.Path + added neko.net.ProxyDetect + bugfix in unify : prevent recursive anonymous objects + haxe.Http call "prepare" only if size is known + added multiple expressions in "case" + serialization : deprecated old string format, use urlEncode/Decode + added flash9 bytearray serialization (to binary string, for neko com) + fixed Type.typeof on some flash9 instances + no more dontUseCache (haxe.Serializer.USE_CACHE, default to false) + small genxml/haxedoc improvements + added Type.enumEq + local function parameters are now inferred in several cases + optional RTTI for Spod Object + bugfix related to callback in neko code generator + more type error stack (now includes type parameters) + type system fixes in anonymous subtyping + added Iterable, changed Lambda + added TAR and GZIP support to neko.io.Zip + compute minimal array content type + fixes in enum switchs + +2007-01-01: 1.10 + fix in haxe.remoting.SocketConnection.readAnswer + fix in postfix incr/decr and getter/setter + added haxe.Http.fileTransfert for Neko + fixed haxelib to 1.02 (use multipart file transfert) + fixed Array.reverse + added flash.Lib.getURL and fscommand for Flash9 + fixed some ignored parse errors + fixed minor syntax : immediate object access + allow extend/implements a typedef + fixed Flash9 AMF remoting + fixed Flash9 bugs in Date object + fixed dynamic Array typing bug + allowed typedef private field access + added Class base class type + AsyncConnection.call callback is now optional + fixed if/switch with no else/default compilation + moved Reflect.createInstance to Type + added Reflect.makeVarArgs + haXelib 1.03 : several developers per project + web interface + +2006-11-22: 1.09 + added neko.vm.Module and neko.vm.Loader + haxelib : allowed spaces in "run" arguments + allowed Thread comparison + fixed bug in SWF6 compilation + allowed either Mysql or Mysql5 usage + replaced db.Connection.hasFeature by db.Connection.dbName + added Socket.custom field + moved neko.Thread to neko.vm.Thread + define haxe_109 (for api changes) + fixes in haxe.remoting.Connection and haxe.Unserializer for F9 + added haxe.remoting.Connection.urlConnect for JS + allowed private typedef fields + added neko.net.ThreadServer, ThreadRemotingServer and Poll + removed neko.net.RemotingBuffer + relaxed enums switchs (allow value in first case) + changed "cast" codegeneration (fix some F9 usages) + change in POST data handling in mod_neko (max 256K, except multipart) + added neko.Web.getClientHeaders and neko.Web.flush + "callback" is now a keyword + fixed stack overflow when typedef = Dynamic + fixed Reflect.createInstance on F9 + Array : slice optional length, fixed neko slice & splice + + fixed cast return type + +2006-10-29: 1.08 + fixed bug in flash -debug + fixed Sqlite result .length + fixed missing "." in OSX/Linux default classpath + fixed haxelib NDLL autoloading on OSX + fixed bug in deserialization of "\\\r" sequence + added inheritance and fields getter/setter to xml output + haxedoc 2.0 + fixed neko native enum serialization + fixed "all constructors matched" for enums without params + fixed returned value semantics in neko (prevent remoting leak) + more documentation + added haxe.rtti package (classes can implement haxe.rtti.Infos) + fixed windows line endings in exclude files under linux/osx + fixed small bug in "cast" syntax + added "callback" for partial function application + added --auto-xml for future haxeFD usage + fixed Reflect.isFunction + minor bugfix in JS code generator + new neko.net package + allow recursive remoting proxys (skip instead of error) + added neko.Thread and neko.Lock MultiThread classes + added neko.net.ServerLoop for multiple clients handling + +2006-09-11: 1.07 + fixed resources in Neko + typedef, override, package and f9dynamic are now keywords + slighly changed error format output + fixed "undefined" serialization and Type.typeof + some fixes in haxelib + set default classpath for non windows systems + added variance + fixed bug in bounded type parameters + fixed scope bug in try/catch with Flash9 + added remoting over XMLSocket and LocalConnection for Flash9 + fixed Std.is(*,null) = false + allowed >64K Haxe/neko strings + -debug and stack traces support for Flash and JS + minor changes in xml output + +2006-08-28: 1.06 + allowed extern enums + use only matching construct when parameters are matched + fixed bug preventing & char to be sent between JS and Flash remoting + improved flash9 api (more strict) + flash9 xml : use JS ReXml parser + added neko.io package (Input/Output) + moved neko.File and neko.Socket to neko.io package + fixed flash optional arguments (when extending flash.MC) + fixed neko native serialization problems + variable modification does not have side effects in 'for x in a...b' + jit disabled by default for neko web server + enable flash7-8 libraries usage from flash9 + unknown identifier become "class not found" when representing a classpath + changed haxe.PosInfos handling + added -debug (removed --flash-debug) effective on flash9 and neko only now + added Type.typeof + improved Serializer speed + added Serialization support for Date, Hash, IntHash, List + added flash9 and JS IE/Opera class reflection + added haxe.xml.Check and haxe.xml.Fast + added Xml.parent + added haxelib + added ArrayAccess interface + +2006-08-16: 1.05 + moved Md5 to haxe package. + some method renamed in neko.FileSystem. + added neko.remoting.Server.setLogger + fixed bug in haxe.Serializer on neko (was preventing List serialization) + fixed bugs in Haxe.Unserializer on neko (invalid enum tag & pbs with UTF8 strings) + fixed sqlite escape & quote , added BOOL support + allowed direct property access in getter/setter (prevent rec loop) + allowed event-driven neko http requests + forbidden "name" static in js + don't allow variable redeclaration in subclasses + added && || and ! in conditional compilation rules + metas : removed __construct__ and class.toString. + metas : __super__ and __interfaces__ now optional + added Type api (seperated from Reflect) + flash 9 support + +2006-07-25: 1.04 + added macros in haxe.Template + allowed static variables access from a signature shortcut + allowed new Signature when signature is a class + fixed : modulo priority is now higher than mult and div + fixed bug in haxe.Proxy generation + fixed more stack overflows with recursive signatures + fixed bug in class <: anonymous subtyping (inherited fields) + override is not mandatory by default (need --override) + added neko just-in-time + fixed bugs in haxe.Serializer and haxe.Unserializer (enum format change) + changed "signature" by "typedef" (more comprehensible) + restricted objects comparisons + fixed bug with js operator priority + improved performances for haxe.Serializer and haxe.Unserializer + fixed bug in static variable lookup (should look class in the last case) + prevented several prints of "not enough arguments". + +2006-06-23: 1.03 + haxedoc executable now part of the distribution + removed selectDB from the neko.db.Connection API + added optional parameters with selection + removed --no-flash-opt-args + changes in SWF packages handling + fixed optional leading comma in anonymous object and array values + fixed bug in inheritend constructor type parameters + fixed bug in type_field with inherited type parameters + added haxe.Proxy + added code transformations for swf/js block variables + fixed very tricky bug with constraint parameters used together with polymorphic methods + added selective import (import x.y.Class.InnerType) + added optional enum constructor parameters + added opened anonymous types (no more Unknown has no field...) + fixed "MovieClip extends flash.MovieClip". + added Reflect.copy + added neko.Random + added Date.fromString + fixed bug in haxe.Unserializer, slighlty optimized haxe.Serializer + added __setfield magic (complete __resolve) + added explicit override when overriding methods + +2006-06-08: 1.02 + fixed stack overflow when recursive class <: recursive signature + improved a bit commandline : allow several hxml arguments + added {> Class, fields... } types declarations + added cast without type (less dangerous than untyped) + no stage objects by default, added --flash-use-stage + added haxe.remoting.DelayedConnection + added -exclude + removed classpath from neko debug infos filenames + fixed bug in Neko empty Array.pop and Neko EReg.replace "" + fixed nodeValue for Neko XML comments, doctype, prolog + improved DocView : formating, signatures, files generation + added neko.zip package + fixed bug in neko.File binary flags + fixed problems when downloading large files using haxe.Http under Neko + neko.db.Connection and neko.db.ResultSet are now interfaces + added neko.db.Sqlite and neko sqlite ndll + mod_neko2.ndll for Apache2 in Windows distribution + fixed bug in static properties method resolution + change js.Dom : use cascading signatures and improved api + added haxe.unit Unit test framework + +2006-05-25: 1.01 + added neko.Utf8 + Serializer/Unserializer now support utf8 strings + allowed subtyping of prop accesses public/private when implementing an interface + removed "eval" from Remoting APIs (only calls - more easy to handle). + added flash6 support + fixed Std.is on different platforms (interfaces implements interface) + added AsyncConnection.amfConnect for flash + added SWF overflow checks + changed "property" to "var" + don't allow monorph unification with Dynamic (more safe) + allowed multiple parsing and typing errors + review and completed commandline options + error on backwards constant integer iterators + remoting proxy constructor is now public + fixed -swf-header override the swflib background color + moved all remoting classes into the haxe.remoting package + added haxe.remoting.LocalConnection + +2006-05-17: 1.0 + fixed small bugs in JS Xml Parser (empty attribute, newlines in attributes) + added default Content-Type for haxe.Http in JS + haxe.AsyncConnection : onError should not be call if error occur in onData + fixed infinite loop if haxe.Unserializer.readDigits reach eof on JS/Flash + fixed bugs in neko.Web and neko.Sys (some methods returning "null" instead of null) + added neko.Socket.setBlocking for nonblocking sockets + fixed bug in js generator when using cascading iterators + fixed typing bug when overloading parametrized method + fixed bug in js generator when "try" without curly braces. + allowed enum catching + added remoting proxys + allowed neko.Web API commandline emulation outside mod_neko + removed subtyping Anon :> Instance + added signatures, Iterator is now a signature + getter/setter and public/private unification + allowed anonymous declaration with interface-style syntax (for signatures) + optimized code generated for underscore in enum matches parameters + fixed flash/js String.charCodeAt(outside) => null + fixed neko charAt(outside) => "" + added errors for strings containing \0 in JS and Flash + added HAXE_LIBRARY_PATH environment variable support + fixed interfaces inheritance : can't extend, can implement (type-sums) + fixed fixed >64K resource bug in SWF + fixed newline problems with Flash/JS Connection + +2006-05-02: RC1 + added the Socket class + fixed a bug of returned value in neko with 6 or more parameters + added "Missing type" error for catchs. + added regular expressions (still missing Flash implementation) + fixed type printing and parenthesis in type declarations + different behavior when elements removed during Array.iteration + fixed genswf : local variables used in for...function + improved type parameters structure coherency + enable usage of Spod without Transaction + implemented neko.db.Transaction.isDeadlock + slighly relaxed one of the javascript generator constraint + added haxe.Template + moved Log , PosInfos and ImportAll to haxe package + completed private class/interface/enum support + removed Array.indexes + added __resolve compile-time support when class implement Dynamic + added haxe Remoting + added "module with different case" error (for windows) + added Reflect.resolveClass, Reflect.resolveEnum, Reflect.setPrototype + added access to classes by name in genneko + added enum.__ename__ + fixed Std.is(e,enum) + fixed infinite loop in neko EReg split/replace and epsilon matching + added neko native serialization support + fixed syntax for multiple constraints in type parameter + added recursive type parameters constraints (T : C constraints) + updated Xml handling + +2006-04-17: beta 5 + fixed bug : continue in do...while + changed typing order for do...while (infer condition after block) + fixed JS "catch" generation + fixed extending flash.* extern class + fixed bug in neko generator w/ closures + fixed bug in js generator (return switch need correct "this" context) + fixed bug in for x in a...b : invalid local variables overridding + added properties + fixed bug in js generator : while...switch...break + new List implementation + can use static function __init__ on every platform + bug fixes in Reflect.fields + added Hash.remove, changed Hash/JS implementation + added flash __delete__ support + added neko.db.Object, Manager, Transaction + fixed neko class.__interfaces__ + added "assigning a value to itself" error + added automatic PosInfos when is last parameter + added polymorphic methods + added check_flash_args support + +2006-04-02: beta 4 + fixed javascript events case + fixed invalid use of physeq + fixed + type inference + added -altfmt + allowed anonymous <: class subtyping + relaxed unifications of expressions in "for" and "while" + more methods in List + syntax changes : mandatory parenthesis for "for" and "while" + allowed any kind of identifier almost everywhere + moved tools, flash, js and neko inside "std" + no need for 0x in flash header bgcolor + added -res + fixed type parameter contraint holes + Std.is Dynamic always returns true + added Enum.toString + neko : env locals can be modified in inner functions + completed js keywords list in generator + added Reflect.typeof + prioritize neko.Lib.load static calls + fixed bugs in for...in optimization with continue + fixed Reflect fields, added documentation, added Class + added javascript closures, fixed null closures on flash and Neko + added javascript __init__ statics and js.XMLHttpRequest + added neko.Stack + fixed bug in Std.ord + convert neko string to haxe string on catch + automaticaly creates empty clips for classes extending flash.MovieClip + unify stack : several meaningful unification errors + added cast operation and keyword + +2006-03-11: beta 3 + javascript generator + optimized for in interval + renaming of locals (name must be unique) + added uncaught exceptions handling in Flash + fixed Bool.true == true and Bool.false == false on all platforms + fixed matching on Bool different from enums + removed -fplayer (use -D instead) and added -fheader + fixed infinity is Int + added "here" special identifier + neko Apis : File, FileSystem, Sys + added base JS API + +2006-02-19: beta 2 + renamed neko.db.Result to neko.db.ResultSet + added Date support for Mysql results + added private fields for static class anonymous types + disambigous >=, >>= and >>>= + fixed inheritance bug in swf and neko generators + improved function parameters type error reporting. + allowed variable number of args for flash.* constructors. + added Math.random(), Reflect.empty() + added flash.XMLSocket and flash.Timer classes + completed Std class with conversion functions and others. + completed flash.Lib class with flash toplevel functions. + fixed bugs in neko webserver + +2006-02-04: beta 1 + allowed array literals to be dynamic + use neko 1.2 commandline and prototypes + changed #cond to #if cond for conditional compilation + all fields are defined to null by default + defined __class__ and other meta accesses for Flash and Neko + fixed type hole for compiler-know types (should not resolve using imports) + changed packages : neko.* and flash.* (with protection) + added Lazy types : type the fields when they are needed with recursion + untyped accesses are monomorphs, not dynamics + generated __string check that toString() return an object + XmlParser and other APIs for Neko + fixed escaped chars in Neko generation + conservative static initialization order + allowed no type parameters for new Class + function types carry parameter names + anonymous types contain private variables (for private static accesses) + added optional name for anonymous types in typer (for static accesses) + private classes and enums (partial support) + improved error message for invalid number of arguments + flash extern classes can take variable number of args. + added -swf-lib for importing SWF library + added neko.db package + +2005-12-23: alpha 5 + added -main commandline parameter + catches are now working with Neko + restricted catch types for type-safety + added constructor inheritance + check if superconstructor is called + allowed Dynamic-only subtyping on type parameters + added method closures to Neko generation + added class Reflect + added License : libraries are BSD + added -xml documentation output + allowed class instance :> anonymous subtyping + +2005-12-10: alpha 4 + forbid break and continue outside loops + fixed SWF generation bugs + added SWF "extends" support + added method closures + added some flash lowlevel operations (__xxx__) + added Log, LogInfos and trace + added Neko generation + fixed problems with conditional compilation macros + +2005-11-30: alpha 3 + added Flash extern classes + Boot initialization + added "untyped" + added conditional compilation + added interfaces + changed iterators from closures to objects + added (XML)Node and XmlParser for Flash + +2005-11-25: alpha 2 + swf generation (missing iterators) + some typing fixes + +2005-11-17: alpha 1b + fix some bugs + changed package tests.lang + +2005-11-14: alpha 1 + lexer + parser + typer diff --git a/build/linux64_569e52e/CONTRIB.txt b/build/linux64_569e52e/CONTRIB.txt new file mode 100644 index 0000000..7c594ad --- /dev/null +++ b/build/linux64_569e52e/CONTRIB.txt @@ -0,0 +1,25 @@ +Contributor License Agreement : + +You accept and agree to the following terms and conditions for Your present and future Contributions submitted to the project Haxe : + +1) Definitions + + "Contribution" : any source code, documentation, including any modifications or additions to an existing work that is intentionally submitted by You to the Haxe Foundation for inclusion in, or documentation of, any of the products managed and maintained by the Haxe Foundation. + + "Submitted" means any form or electronic, verbal or written communication, including but not limited to communication on electronic mailing lists, source code control systems and issue tracking system that are managed by, or on behalf of, the Haxe Foundation for the purpose of improving Haxe. + +2) Grant of Copyright License. Subject to the terms and conditions of this Grant, You hereby grant to the Haxe Foundation and to recipients of software distributed by the Haxe Foundation a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works. + +3) You represent that you are legally entitled to grant the above license. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that you have received permission to make Contributions on behalf of that employer, that your employer has waived such rights for your Contributions to the Haxe Foundation, or that your employer has executed a separate Corporate Contributor License Grant with the Haxe Foundation. + +4) You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which you are personally aware and which are associated with any part of Your Contributions. + +5) You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON- INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. + +Full Name : +Email : +Mailing Address : +Country : + + +Signature: \ No newline at end of file diff --git a/build/linux64_569e52e/LICENSE.txt b/build/linux64_569e52e/LICENSE.txt new file mode 100644 index 0000000..b4142af --- /dev/null +++ b/build/linux64_569e52e/LICENSE.txt @@ -0,0 +1,311 @@ +Haxe Licenses +------------- + +For details about Haxe Licenses, please read http://haxe.org/foundation/open-source.html + +The Haxe Standard Library MIT License : +-------------------------- + +Copyright (C)2005-2016 Haxe Foundation + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +The Haxe compiler GPL License : +------------------------------- + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/build/linux64_569e52e/haxe b/build/linux64_569e52e/haxe new file mode 100755 index 0000000..bf92429 Binary files /dev/null and b/build/linux64_569e52e/haxe differ diff --git a/build/linux64_569e52e/haxelib b/build/linux64_569e52e/haxelib new file mode 100755 index 0000000..50034e6 Binary files /dev/null and b/build/linux64_569e52e/haxelib differ diff --git a/build/linux64_569e52e/std/Any.hx b/build/linux64_569e52e/std/Any.hx new file mode 100644 index 0000000..171cbb3 --- /dev/null +++ b/build/linux64_569e52e/std/Any.hx @@ -0,0 +1,41 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + `Any` is a type that is compatible with any other in both ways. + + This means that a value of any type can be assigned to `Any`, and + vice-versa, a value of `Any` type can be assigned to any other type. + + It's a more type-safe alternative to `Dynamic`, because it doesn't + support field access or operators and it's bound to monomorphs. So, + to work with the actual value, it needs to be explicitly promoted + to another type. +**/ +@:forward.variance +abstract Any(Dynamic) from Dynamic { + @:noCompletion @:to extern inline function __promote():T + return this; + + @:noCompletion extern inline function toString():String + return Std.string(this); +} diff --git a/build/linux64_569e52e/std/Array.hx b/build/linux64_569e52e/std/Array.hx new file mode 100644 index 0000000..722c2a1 --- /dev/null +++ b/build/linux64_569e52e/std/Array.hx @@ -0,0 +1,333 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + An Array is a storage for values. You can access it using indexes or + with its API. + + @see https://haxe.org/manual/std-Array.html + @see https://haxe.org/manual/lf-array-comprehension.html +**/ + +import haxe.iterators.ArrayKeyValueIterator; + +extern class Array { + /** + The length of `this` Array. + **/ + var length(default, null):Int; + + /** + Creates a new Array. + **/ + function new():Void; + + /** + Returns a new Array by appending the elements of `a` to the elements of + `this` Array. + + This operation does not modify `this` Array. + + If `a` is the empty Array `[]`, a copy of `this` Array is returned. + + The length of the returned Array is equal to the sum of `this.length` + and `a.length`. + + If `a` is `null`, the result is unspecified. + **/ + function concat(a:Array):Array; + + /** + Returns a string representation of `this` Array, with `sep` separating + each element. + + The result of this operation is equal to `Std.string(this[0]) + sep + + Std.string(this[1]) + sep + ... + sep + Std.string(this[this.length-1])` + + If `this` is the empty Array `[]`, the result is the empty String `""`. + If `this` has exactly one element, the result is equal to a call to + `Std.string(this[0])`. + + If `sep` is null, the result is unspecified. + **/ + function join(sep:String):String; + + /** + Removes the last element of `this` Array and returns it. + + This operation modifies `this` Array in place. + + If `this` has at least one element, `this.length` will decrease by 1. + + If `this` is the empty Array `[]`, null is returned and the length + remains 0. + **/ + function pop():Null; + + /** + Adds the element `x` at the end of `this` Array and returns the new + length of `this` Array. + + This operation modifies `this` Array in place. + + `this.length` increases by 1. + **/ + function push(x:T):Int; + + /** + Reverse the order of elements of `this` Array. + + This operation modifies `this` Array in place. + + If `this.length < 2`, `this` remains unchanged. + **/ + function reverse():Void; + + /** + Removes the first element of `this` Array and returns it. + + This operation modifies `this` Array in place. + + If `this` has at least one element, `this`.length and the index of each + remaining element is decreased by 1. + + If `this` is the empty Array `[]`, `null` is returned and the length + remains 0. + **/ + function shift():Null; + + /** + Creates a shallow copy of the range of `this` Array, starting at and + including `pos`, up to but not including `end`. + + This operation does not modify `this` Array. + + The elements are not copied and retain their identity. + + If `end` is omitted or exceeds `this.length`, it defaults to the end of + `this` Array. + + If `pos` or `end` are negative, their offsets are calculated from the + end of `this` Array by `this.length + pos` and `this.length + end` + respectively. If this yields a negative value, 0 is used instead. + + If `pos` exceeds `this.length` or if `end` is less than or equals + `pos`, the result is `[]`. + **/ + function slice(pos:Int, ?end:Int):Array; + + /** + Sorts `this` Array according to the comparison function `f`, where + `f(x,y)` returns 0 if x == y, a positive Int if x > y and a + negative Int if x < y. + + This operation modifies `this` Array in place. + + The sort operation is not guaranteed to be stable, which means that the + order of equal elements may not be retained. For a stable Array sorting + algorithm, `haxe.ds.ArraySort.sort()` can be used instead. + + If `f` is null, the result is unspecified. + **/ + function sort(f:T->T->Int):Void; + + /** + Removes `len` elements from `this` Array, starting at and including + `pos`, an returns them. + + This operation modifies `this` Array in place. + + If `len` is < 0 or `pos` exceeds `this`.length, an empty Array [] is + returned and `this` Array is unchanged. + + If `pos` is negative, its value is calculated from the end of `this` + Array by `this.length + pos`. If this yields a negative value, 0 is + used instead. + + If the sum of the resulting values for `len` and `pos` exceed + `this.length`, this operation will affect the elements from `pos` to the + end of `this` Array. + + The length of the returned Array is equal to the new length of `this` + Array subtracted from the original length of `this` Array. In other + words, each element of the original `this` Array either remains in + `this` Array or becomes an element of the returned Array. + **/ + function splice(pos:Int, len:Int):Array; + + /** + Returns a string representation of `this` Array. + + The result will include the individual elements' String representations + separated by comma. The enclosing [ ] may be missing on some platforms, + use `Std.string()` to get a String representation that is consistent + across platforms. + **/ + function toString():String; + + /** + Adds the element `x` at the start of `this` Array. + + This operation modifies `this` Array in place. + + `this.length` and the index of each Array element increases by 1. + **/ + function unshift(x:T):Void; + + /** + Inserts the element `x` at the position `pos`. + + This operation modifies `this` Array in place. + + The offset is calculated like so: + + - If `pos` exceeds `this.length`, the offset is `this.length`. + - If `pos` is negative, the offset is calculated from the end of `this` + Array, i.e. `this.length + pos`. If this yields a negative value, the + offset is 0. + - Otherwise, the offset is `pos`. + + If the resulting offset does not exceed `this.length`, all elements from + and including that offset to the end of `this` Array are moved one index + ahead. + **/ + function insert(pos:Int, x:T):Void; + + /** + Removes the first occurrence of `x` in `this` Array. + + This operation modifies `this` Array in place. + + If `x` is found by checking standard equality, it is removed from `this` + Array and all following elements are reindexed accordingly. The function + then returns true. + + If `x` is not found, `this` Array is not changed and the function + returns false. + **/ + function remove(x:T):Bool; + + + /** + Returns whether `this` Array contains `x`. + + If `x` is found by checking standard equality, the function returns `true`, otherwise + the function returns `false`. + **/ + @:pure function contains( x : T ) : Bool; + + /** + Returns position of the first occurrence of `x` in `this` Array, searching front to back. + + If `x` is found by checking standard equality, the function returns its index. + + If `x` is not found, the function returns -1. + + If `fromIndex` is specified, it will be used as the starting index to search from, + otherwise search starts with zero index. If it is negative, it will be taken as the + offset from the end of `this` Array to compute the starting index. If given or computed + starting index is less than 0, the whole array will be searched, if it is greater than + or equal to the length of `this` Array, the function returns -1. + **/ + function indexOf(x:T, ?fromIndex:Int):Int; + + /** + Returns position of the last occurrence of `x` in `this` Array, searching back to front. + + If `x` is found by checking standard equality, the function returns its index. + + If `x` is not found, the function returns -1. + + If `fromIndex` is specified, it will be used as the starting index to search from, + otherwise search starts with the last element index. If it is negative, it will be + taken as the offset from the end of `this` Array to compute the starting index. If + given or computed starting index is greater than or equal to the length of `this` Array, + the whole array will be searched, if it is less than 0, the function returns -1. + **/ + function lastIndexOf(x:T, ?fromIndex:Int):Int; + + /** + Returns a shallow copy of `this` Array. + + The elements are not copied and retain their identity, so + `a[i] == a.copy()[i]` is true for any valid `i`. However, + `a == a.copy()` is always false. + **/ + function copy():Array; + + /** + Returns an iterator of the Array values. + **/ + @:runtime inline function iterator():haxe.iterators.ArrayIterator { + return new haxe.iterators.ArrayIterator(this); + } + + /** + Returns an iterator of the Array indices and values. + **/ + @:pure @:runtime public inline function keyValueIterator() : ArrayKeyValueIterator { + return new ArrayKeyValueIterator(this); + } + + /** + Creates a new Array by applying function `f` to all elements of `this`. + + The order of elements is preserved. + + If `f` is null, the result is unspecified. + **/ + @:runtime inline function map(f:T->S):Array { + #if (cpp && !cppia) + var result = cpp.NativeArray.create(length); + for (i in 0...length) cpp.NativeArray.unsafeSet(result, i, f(cpp.NativeArray.unsafeGet(this, i))); + return result; + #else + return [for (v in this) f(v)]; + #end + } + + /** + Returns an Array containing those elements of `this` for which `f` + returned true. + + The individual elements are not duplicated and retain their identity. + + If `f` is null, the result is unspecified. + **/ + @:runtime inline function filter(f:T->Bool):Array { + return [for (v in this) if (f(v)) v]; + } + + /** + Set the length of the Array. + + If `len` is shorter than the array's current size, the last + `length - len` elements will be removed. If `len` is longer, the Array + will be extended, with new elements set to a target-specific default + value: + + - always null on dynamic targets + - 0, 0.0 or false for Int, Float and Bool respectively on static targets + - null for other types on static targets + **/ + function resize(len:Int):Void; +} diff --git a/build/linux64_569e52e/std/Class.hx b/build/linux64_569e52e/std/Class.hx new file mode 100644 index 0000000..73d91c3 --- /dev/null +++ b/build/linux64_569e52e/std/Class.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + An abstract type that represents a Class. + + See `Type` for the Haxe Reflection API. + + @see https://haxe.org/manual/types-class-instance.html +**/ +@:coreType @:runtimeValue abstract Class {} diff --git a/build/linux64_569e52e/std/Date.hx b/build/linux64_569e52e/std/Date.hx new file mode 100644 index 0000000..7f05cc1 --- /dev/null +++ b/build/linux64_569e52e/std/Date.hx @@ -0,0 +1,185 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + The Date class provides a basic structure for date and time related + information. Date instances can be created by + + - `new Date()` for a specific date, + - `Date.now()` to obtain information about the current time, + - `Date.fromTime()` with a given timestamp or + - `Date.fromString()` by parsing from a String. + + There are some extra functions available in the `DateTools` class. + + In the context of Haxe dates, a timestamp is defined as the number of + milliseconds elapsed since 1st January 1970 UTC. + + ## Supported range + + Due to platform limitations, only dates in the range 1970 through 2038 are + supported consistently. Some targets may support dates outside this range, + depending on the OS at runtime. The `Date.fromTime` method will not work with + timestamps outside the range on any target. +**/ +extern class Date { + /** + Creates a new date object from the given arguments. + + The behaviour of a Date instance is only consistent across platforms if + the the arguments describe a valid date. + + - month: 0 to 11 (note that this is zero-based) + - day: 1 to 31 + - hour: 0 to 23 + - min: 0 to 59 + - sec: 0 to 59 + **/ + function new(year:Int, month:Int, day:Int, hour:Int, min:Int, sec:Int):Void; + + /** + Returns the timestamp (in milliseconds) of `this` date. + On cpp and neko, this function only has a second resolution, so the + result will always be a multiple of `1000.0`, e.g. `1454698271000.0`. + To obtain the current timestamp with better precision on cpp and neko, + see the `Sys.time` API. + + For measuring time differences with millisecond accuracy on + all platforms, see `haxe.Timer.stamp`. + **/ + function getTime():Float; + + /** + Returns the hours of `this` Date (0-23 range) in the local timezone. + **/ + function getHours():Int; + + /** + Returns the minutes of `this` Date (0-59 range) in the local timezone. + **/ + function getMinutes():Int; + + /** + Returns the seconds of `this` Date (0-59 range) in the local timezone. + **/ + function getSeconds():Int; + + /** + Returns the full year of `this` Date (4 digits) in the local timezone. + **/ + function getFullYear():Int; + + /** + Returns the month of `this` Date (0-11 range) in the local timezone. + Note that the month number is zero-based. + **/ + function getMonth():Int; + + /** + Returns the day of `this` Date (1-31 range) in the local timezone. + **/ + function getDate():Int; + + /** + Returns the day of the week of `this` Date (0-6 range, where `0` is Sunday) + in the local timezone. + **/ + function getDay():Int; + + /** + Returns the hours of `this` Date (0-23 range) in UTC. + **/ + function getUTCHours():Int; + + /** + Returns the minutes of `this` Date (0-59 range) in UTC. + **/ + function getUTCMinutes():Int; + + /** + Returns the seconds of `this` Date (0-59 range) in UTC. + **/ + function getUTCSeconds():Int; + + /** + Returns the full year of `this` Date (4 digits) in UTC. + **/ + function getUTCFullYear():Int; + + /** + Returns the month of `this` Date (0-11 range) in UTC. + Note that the month number is zero-based. + **/ + function getUTCMonth():Int; + + /** + Returns the day of `this` Date (1-31 range) in UTC. + **/ + function getUTCDate():Int; + + /** + Returns the day of the week of `this` Date (0-6 range, where `0` is Sunday) + in UTC. + **/ + function getUTCDay():Int; + + /** + Returns the time zone difference of `this` Date in the current locale + to UTC, in minutes. + + Assuming the function is executed on a machine in a UTC+2 timezone, + `Date.now().getTimezoneOffset()` will return `-120`. + **/ + function getTimezoneOffset():Int; + + /** + Returns a string representation of `this` Date in the local timezone + using the standard format `YYYY-MM-DD HH:MM:SS`. See `DateTools.format` for + other formatting rules. + **/ + function toString():String; + + /** + Returns a Date representing the current local time. + **/ + static function now():Date; + + /** + Creates a Date from the timestamp (in milliseconds) `t`. + **/ + static function fromTime(t:Float):Date; + + /** + Creates a Date from the formatted string `s`. The following formats are + accepted by the function: + + - `"YYYY-MM-DD hh:mm:ss"` + - `"YYYY-MM-DD"` + - `"hh:mm:ss"` + + The first two formats expressed a date in local time. The third is a time + relative to the UTC epoch. + + If `s` does not match these formats, the result is unspecified. + **/ + static function fromString(s:String):Date; +} diff --git a/build/linux64_569e52e/std/DateTools.hx b/build/linux64_569e52e/std/DateTools.hx new file mode 100644 index 0000000..32d5a63 --- /dev/null +++ b/build/linux64_569e52e/std/DateTools.hx @@ -0,0 +1,256 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + The DateTools class contains some extra functionalities for handling `Date` + instances and timestamps. + + In the context of Haxe dates, a timestamp is defined as the number of + milliseconds elapsed since 1st January 1970. +**/ +class DateTools { + #if php + #elseif (neko && !(macro || interp)) + static var date_format = neko.Lib.load("std", "date_format", 2); + #else + static var DAY_SHORT_NAMES = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; + static var DAY_NAMES = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; + static var MONTH_SHORT_NAMES = [ + "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" + ]; + static var MONTH_NAMES = [ + "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" + ]; + + private static function __format_get(d:Date, e:String):String { + return switch (e) { + case "%": + "%"; + case "a": + DAY_SHORT_NAMES[d.getDay()]; + case "A": + DAY_NAMES[d.getDay()]; + case "b", "h": + MONTH_SHORT_NAMES[d.getMonth()]; + case "B": + MONTH_NAMES[d.getMonth()]; + case "C": + StringTools.lpad(Std.string(Std.int(d.getFullYear() / 100)), "0", 2); + case "d": + StringTools.lpad(Std.string(d.getDate()), "0", 2); + case "D": + __format(d, "%m/%d/%y"); + case "e": + Std.string(d.getDate()); + case "F": + __format(d, "%Y-%m-%d"); + case "H", "k": + StringTools.lpad(Std.string(d.getHours()), if (e == "H") "0" else " ", 2); + case "I", "l": + var hour = d.getHours() % 12; + StringTools.lpad(Std.string(hour == 0 ? 12 : hour), if (e == "I") "0" else " ", 2); + case "m": + StringTools.lpad(Std.string(d.getMonth() + 1), "0", 2); + case "M": + StringTools.lpad(Std.string(d.getMinutes()), "0", 2); + case "n": + "\n"; + case "p": + if (d.getHours() > 11) "PM"; else "AM"; + case "r": + __format(d, "%I:%M:%S %p"); + case "R": + __format(d, "%H:%M"); + case "s": + Std.string(Std.int(d.getTime() / 1000)); + case "S": + StringTools.lpad(Std.string(d.getSeconds()), "0", 2); + case "t": + "\t"; + case "T": + __format(d, "%H:%M:%S"); + case "u": + var t = d.getDay(); + if (t == 0) "7" else Std.string(t); + case "w": + Std.string(d.getDay()); + case "y": + StringTools.lpad(Std.string(d.getFullYear() % 100), "0", 2); + case "Y": + Std.string(d.getFullYear()); + default: + throw new haxe.exceptions.NotImplementedException("Date.format %" + e + "- not implemented yet."); + } + } + + private static function __format(d:Date, f:String):String { + var r = new StringBuf(); + var p = 0; + while (true) { + var np = f.indexOf("%", p); + if (np < 0) + break; + + r.addSub(f, p, np - p); + r.add(__format_get(d, f.substr(np + 1, 1))); + + p = np + 2; + } + r.addSub(f, p, f.length - p); + return r.toString(); + } + #end + + /** + Format the date `d` according to the format `f`. The format is + compatible with the `strftime` standard format, except that there is no + support in Flash and JS for day and months names (due to lack of proper + internationalization API). On Haxe/Neko/Windows, some formats are not + supported. + + ```haxe + var t = DateTools.format(Date.now(), "%Y-%m-%d_%H:%M:%S"); + // 2016-07-08_14:44:05 + + var t = DateTools.format(Date.now(), "%r"); + // 02:44:05 PM + + var t = DateTools.format(Date.now(), "%T"); + // 14:44:05 + + var t = DateTools.format(Date.now(), "%F"); + // 2016-07-08 + ``` + **/ + public static function format(d:Date, f:String):String { + #if (neko && !(macro || interp)) + return new String(untyped date_format(d.__t, f.__s)); + #elseif php + return php.Global.strftime(f, php.Syntax.int(@:privateAccess d.__t)); + #else + return __format(d, f); + #end + } + + /** + Returns the result of adding timestamp `t` to Date `d`. + + This is a convenience function for calling + `Date.fromTime(d.getTime() + t)`. + **/ + public static inline function delta(d:Date, t:Float):Date { + return Date.fromTime(d.getTime() + t); + } + + static var DAYS_OF_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + + /** + Returns the number of days in the month of Date `d`. + + This method handles leap years. + **/ + public static function getMonthDays(d:Date):Int { + var month = d.getMonth(); + var year = d.getFullYear(); + + if (month != 1) + return DAYS_OF_MONTH[month]; + + var isB = ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0); + return if (isB) 29 else 28; + } + + /** + Converts a number of seconds to a timestamp. + **/ + public static inline function seconds(n:Float):Float { + return n * 1000.0; + } + + /** + Converts a number of minutes to a timestamp. + **/ + public static inline function minutes(n:Float):Float { + return n * 60.0 * 1000.0; + } + + /** + Converts a number of hours to a timestamp. + **/ + public static inline function hours(n:Float):Float { + return n * 60.0 * 60.0 * 1000.0; + } + + /** + Converts a number of days to a timestamp. + **/ + public static inline function days(n:Float):Float { + return n * 24.0 * 60.0 * 60.0 * 1000.0; + } + + /** + Separate a date-time into several components + **/ + public static function parse(t:Float) { + var s = t / 1000; + var m = s / 60; + var h = m / 60; + return { + ms: t % 1000, + seconds: Std.int(s % 60), + minutes: Std.int(m % 60), + hours: Std.int(h % 24), + days: Std.int(h / 24), + }; + } + + /** + Build a date-time from several components + **/ + public static function make(o:{ + ms:Float, + seconds:Int, + minutes:Int, + hours:Int, + days:Int + }) { + return o.ms + 1000.0 * (o.seconds + 60.0 * (o.minutes + 60.0 * (o.hours + 24.0 * o.days))); + } + + #if (js || flash || php || cpp || python) + /** + Retrieve Unix timestamp value from Date components. Takes same argument sequence as the Date constructor. + **/ + public static #if (js || flash || php) inline #end function makeUtc(year:Int, month:Int, day:Int, hour:Int, min:Int, sec:Int):Float { + #if (js || flash || python) + return untyped Date.UTC(year, month, day, hour, min, sec); + #elseif php + return php.Global.gmmktime(hour, min, sec, month + 1, day, year) * 1000; + #elseif cpp + return untyped __global__.__hxcpp_utc_date(year, month, day, hour, min, sec) * 1000.0; + #else + // TODO + return 0.; + #end + } + #end +} diff --git a/build/linux64_569e52e/std/EReg.hx b/build/linux64_569e52e/std/EReg.hx new file mode 100644 index 0000000..c2d1ec4 --- /dev/null +++ b/build/linux64_569e52e/std/EReg.hx @@ -0,0 +1,203 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + The EReg class represents regular expressions. + + While basic usage and patterns consistently work across platforms, some more + complex operations may yield different results. This is a necessary trade- + off to retain a certain level of performance. + + EReg instances can be created by calling the constructor, or with the + special syntax `~/pattern/modifier` + + EReg instances maintain an internal state, which is affected by several of + its methods. + + A detailed explanation of the supported operations is available at + +**/ +class EReg { + /** + Creates a new regular expression with pattern `r` and modifiers `opt`. + + This is equivalent to the shorthand syntax `~/r/opt` + + If `r` or `opt` are null, the result is unspecified. + **/ + public function new(r:String, opt:String) { + throw new haxe.exceptions.NotImplementedException("Regular expressions are not implemented for this platform"); + } + + /** + Tells if `this` regular expression matches String `s`. + + This method modifies the internal state. + + If `s` is `null`, the result is unspecified. + **/ + public function match(s:String):Bool { + return false; + } + + /** + Returns the matched sub-group `n` of `this` EReg. + + This method should only be called after `this.match` or + `this.matchSub`, and then operates on the String of that operation. + + The index `n` corresponds to the n-th set of parentheses in the pattern + of `this` EReg. If no such sub-group exists, the result is unspecified. + + If `n` equals 0, the whole matched substring is returned. + **/ + public function matched(n:Int):String { + return null; + } + + /** + Returns the part to the left of the last matched substring. + + If the most recent call to `this.match` or `this.matchSub` did not + match anything, the result is unspecified. + + If the global g modifier was in place for the matching, only the + substring to the left of the leftmost match is returned. + + The result does not include the matched part. + **/ + public function matchedLeft():String { + return null; + } + + /** + Returns the part to the right of the last matched substring. + + If the most recent call to `this.match` or `this.matchSub` did not + match anything, the result is unspecified. + + If the global g modifier was in place for the matching, only the + substring to the right of the leftmost match is returned. + + The result does not include the matched part. + **/ + public function matchedRight():String { + return null; + } + + /** + Returns the position and length of the last matched substring, within + the String which was last used as argument to `this.match` or + `this.matchSub`. + + If the most recent call to `this.match` or `this.matchSub` did not + match anything, the result is unspecified. + + If the global g modifier was in place for the matching, the position and + length of the leftmost substring is returned. + **/ + public function matchedPos():{pos:Int, len:Int} { + return null; + } + + /** + Tells if `this` regular expression matches a substring of String `s`. + + This function expects `pos` and `len` to describe a valid substring of + `s`, or else the result is unspecified. To get more robust behavior, + `this.match(s.substr(pos,len))` can be used instead. + + This method modifies the internal state. + + If `s` is null, the result is unspecified. + **/ + public function matchSub(s:String, pos:Int, len:Int = -1):Bool { + return false; + } + + /** + Splits String `s` at all substrings `this` EReg matches. + + If a match is found at the start of `s`, the result contains a leading + empty String "" entry. + + If a match is found at the end of `s`, the result contains a trailing + empty String "" entry. + + If two matching substrings appear next to each other, the result + contains the empty String `""` between them. + + By default, this method splits `s` into two parts at the first matched + substring. If the global g modifier is in place, `s` is split at each + matched substring. + + If `s` is null, the result is unspecified. + **/ + public function split(s:String):Array { + return null; + } + + /** + Replaces the first substring of `s` which `this` EReg matches with `by`. + + If `this` EReg does not match any substring, the result is `s`. + + By default, this method replaces only the first matched substring. If + the global g modifier is in place, all matched substrings are replaced. + + If `by` contains `$1` to `$9`, the digit corresponds to number of a + matched sub-group and its value is used instead. If no such sub-group + exists, the replacement is unspecified. The string `$$` becomes `$`. + + If `s` or `by` are null, the result is unspecified. + **/ + public function replace(s:String, by:String):String { + return null; + } + + /** + Calls the function `f` for the substring of `s` which `this` EReg matches + and replaces that substring with the result of `f` call. + + The `f` function takes `this` EReg object as its first argument and should + return a replacement string for the substring matched. + + If `this` EReg does not match any substring, the result is `s`. + + By default, this method replaces only the first matched substring. If + the global g modifier is in place, all matched substrings are replaced. + + If `s` or `f` are null, the result is unspecified. + **/ + public function map(s:String, f:EReg->String):String { + return null; + } + + /** + Escape the string `s` for use as a part of regular expression. + + If `s` is null, the result is unspecified. + **/ + public static function escape(s:String):String { + return null; + } +} diff --git a/build/linux64_569e52e/std/Enum.hx b/build/linux64_569e52e/std/Enum.hx new file mode 100644 index 0000000..12f9a1f --- /dev/null +++ b/build/linux64_569e52e/std/Enum.hx @@ -0,0 +1,32 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + An abstract type that represents an Enum type. + + The corresponding enum instance type is `EnumValue`. + + See `Type` for the Haxe Reflection API. + + @see https://haxe.org/manual/types-enum-instance.html +**/ +@:coreType @:runtimeValue abstract Enum {} diff --git a/build/linux64_569e52e/std/EnumValue.hx b/build/linux64_569e52e/std/EnumValue.hx new file mode 100644 index 0000000..7297d0b --- /dev/null +++ b/build/linux64_569e52e/std/EnumValue.hx @@ -0,0 +1,61 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + An abstract type that represents any enum value. + See `Type` for the Haxe Reflection API. + + @see https://haxe.org/manual/types-enum-instance.html +**/ +@:coreType abstract EnumValue { + /** + Matches enum instance `e` against pattern `pattern`, returning `true` if + matching succeeded and `false` otherwise. + + Example usage: + + ```haxe + if (e.match(pattern)) { + // codeIfTrue + } else { + // codeIfFalse + } + ``` + + This is equivalent to the following code: + + ```haxe + switch (e) { + case pattern: + // codeIfTrue + case _: + // codeIfFalse + } + ``` + + This method is implemented in the compiler. This definition exists only + for documentation. + **/ + public function match(pattern:Dynamic):Bool { + return false; + } +} diff --git a/build/linux64_569e52e/std/IntIterator.hx b/build/linux64_569e52e/std/IntIterator.hx new file mode 100644 index 0000000..f87bc09 --- /dev/null +++ b/build/linux64_569e52e/std/IntIterator.hx @@ -0,0 +1,65 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + IntIterator is used for implementing interval iterations. + + It is usually not used explicitly, but through its special syntax: + `min...max` + + While it is possible to assign an instance of IntIterator to a variable or + field, it is worth noting that IntIterator does not reset after being used + in a for-loop. Subsequent uses of the same instance will then have no + effect. + + @see https://haxe.org/manual/lf-iterators.html +**/ +class IntIterator { + var min:Int; + var max:Int; + + /** + Iterates from `min` (inclusive) to `max` (exclusive). + + If `max <= min`, the iterator will not act as a countdown. + **/ + public inline function new(min:Int, max:Int) { + this.min = min; + this.max = max; + } + + /** + Returns true if the iterator has other items, false otherwise. + **/ + public inline function hasNext() { + return min < max; + } + + /** + Moves to the next item of the iterator. + + If this is called while hasNext() is false, the result is unspecified. + **/ + public inline function next() { + return min++; + } +} diff --git a/build/linux64_569e52e/std/Lambda.hx b/build/linux64_569e52e/std/Lambda.hx new file mode 100644 index 0000000..8b9f16f --- /dev/null +++ b/build/linux64_569e52e/std/Lambda.hx @@ -0,0 +1,297 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +import haxe.ds.List; + +/** + The `Lambda` class is a collection of methods to support functional + programming. It is ideally used with `using Lambda` and then acts as an + extension to Iterable types. + + On static platforms, working with the Iterable structure might be slower + than performing the operations directly on known types, such as Array and + List. + + If the first argument to any of the methods is null, the result is + unspecified. + + @see https://haxe.org/manual/std-Lambda.html +**/ +class Lambda { + /** + Creates an Array from Iterable `it`. + + If `it` is an Array, this function returns a copy of it. + **/ + public static function array(it:Iterable):Array { + var a = new Array(); + for (i in it) + a.push(i); + return a; + } + + /** + Creates a List form Iterable `it`. + + If `it` is a List, this function returns a copy of it. + **/ + public static function list(it:Iterable):List { + var l = new List(); + for (i in it) + l.add(i); + return l; + } + + /** + Creates a new Array by applying function `f` to all elements of `it`. + The order of elements is preserved. + If `f` is null, the result is unspecified. + **/ + public static inline function map(it:Iterable, f:(item:A) -> B):Array { + return [for (x in it) f(x)]; + } + + /** + Similar to map, but also passes the index of each element to `f`. + The order of elements is preserved. + If `f` is null, the result is unspecified. + **/ + public static inline function mapi(it:Iterable, f:(index:Int, item:A) -> B):Array { + var i = 0; + return [for (x in it) f(i++, x)]; + } + + /** + Concatenate a list of iterables. + The order of elements is preserved. + **/ + public static inline function flatten(it:Iterable>):Array { + return [for (e in it) for (x in e) x]; + } + + /** + A composition of map and flatten. + The order of elements is preserved. + If `f` is null, the result is unspecified. + **/ + public static inline function flatMap(it:Iterable, f:(item:A) -> Iterable):Array { + return Lambda.flatten(Lambda.map(it, f)); + } + + /** + Tells if `it` contains `elt`. + + This function returns true as soon as an element is found which is equal + to `elt` according to the `==` operator. + + If no such element is found, the result is false. + **/ + public static function has(it:Iterable, elt:A):Bool { + for (x in it) + if (x == elt) + return true; + return false; + } + + /** + Tells if `it` contains an element for which `f` is true. + + This function returns true as soon as an element is found for which a + call to `f` returns true. + + If no such element is found, the result is false. + + If `f` is null, the result is unspecified. + **/ + public static function exists(it:Iterable, f:(item:A) -> Bool) { + for (x in it) + if (f(x)) + return true; + return false; + } + + /** + Tells if `f` is true for all elements of `it`. + + This function returns false as soon as an element is found for which a + call to `f` returns false. + + If no such element is found, the result is true. + + In particular, this function always returns true if `it` is empty. + + If `f` is null, the result is unspecified. + **/ + public static function foreach(it:Iterable, f:(item:A) -> Bool) { + for (x in it) + if (!f(x)) + return false; + return true; + } + + /** + Calls `f` on all elements of `it`, in order. + + If `f` is null, the result is unspecified. + **/ + public static function iter(it:Iterable, f:(item:A) -> Void) { + for (x in it) + f(x); + } + + /** + Returns a Array containing those elements of `it` for which `f` returned + true. + If `it` is empty, the result is the empty Array even if `f` is null. + Otherwise if `f` is null, the result is unspecified. + **/ + public static function filter(it:Iterable, f:(item:A) -> Bool) { + return [for (x in it) if (f(x)) x]; + } + + /** + Functional fold on Iterable `it`, using function `f` with start argument + `first`. + + If `it` has no elements, the result is `first`. + + Otherwise the first element of `it` is passed to `f` alongside `first`. + The result of that call is then passed to `f` with the next element of + `it`, and so on until `it` has no more elements. + + If `it` or `f` are null, the result is unspecified. + **/ + public static function fold(it:Iterable, f:(item:A, result:B) -> B, first:B):B { + for (x in it) + first = f(x, first); + return first; + } + + /** + Similar to fold, but also passes the index of each element to `f`. + + If `it` or `f` are null, the result is unspecified. + **/ + public static function foldi(it:Iterable, f:(item:A, result:B, index:Int) -> B, first:B):B { + var i = 0; + for (x in it) { + first = f(x, first, i); + ++i; + } + return first; + } + + /** + Returns the number of elements in `it` for which `pred` is true, or the + total number of elements in `it` if `pred` is null. + + This function traverses all elements. + **/ + public static function count(it:Iterable, ?pred:(item:A) -> Bool) { + var n = 0; + if (pred == null) + for (_ in it) + n++; + else + for (x in it) + if (pred(x)) + n++; + return n; + } + + /** + Tells if Iterable `it` does not contain any element. + **/ + public static function empty(it:Iterable):Bool { + return !it.iterator().hasNext(); + } + + /** + Returns the index of the first element `v` within Iterable `it`. + + This function uses operator `==` to check for equality. + + If `v` does not exist in `it`, the result is -1. + **/ + public static function indexOf(it:Iterable, v:T):Int { + var i = 0; + for (v2 in it) { + if (v == v2) + return i; + i++; + } + return -1; + } + + /** + Returns the first element of `it` for which `f` is true. + + This function returns as soon as an element is found for which a call to + `f` returns true. + + If no such element is found, the result is null. + + If `f` is null, the result is unspecified. + **/ + public static function find(it:Iterable, f:(item:T) -> Bool):Null { + for (v in it) { + if (f(v)) + return v; + } + return null; + } + + /** + Returns the index of the first element of `it` for which `f` is true. + + This function returns as soon as an element is found for which a call to + `f` returns true. + + If no such element is found, the result is -1. + + If `f` is null, the result is unspecified. + **/ + public static function findIndex(it:Iterable, f:(item:T) -> Bool):Int { + var i = 0; + for (v in it) { + if (f(v)) + return i; + i++; + } + return -1; + } + + /** + Returns a new Array containing all elements of Iterable `a` followed by + all elements of Iterable `b`. + + If `a` or `b` are null, the result is unspecified. + **/ + public static function concat(a:Iterable, b:Iterable):Array { + var l = new Array(); + for (x in a) + l.push(x); + for (x in b) + l.push(x); + return l; + } +} diff --git a/build/linux64_569e52e/std/List.hx b/build/linux64_569e52e/std/List.hx new file mode 100644 index 0000000..ee5b506 --- /dev/null +++ b/build/linux64_569e52e/std/List.hx @@ -0,0 +1,22 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +typedef List = haxe.ds.List; diff --git a/build/linux64_569e52e/std/Map.hx b/build/linux64_569e52e/std/Map.hx new file mode 100644 index 0000000..4f38a91 --- /dev/null +++ b/build/linux64_569e52e/std/Map.hx @@ -0,0 +1,26 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +typedef Map = haxe.ds.Map; + +@:dox(hide) +@:deprecated +typedef IMap = haxe.Constraints.IMap; diff --git a/build/linux64_569e52e/std/Math.hx b/build/linux64_569e52e/std/Math.hx new file mode 100644 index 0000000..3872167 --- /dev/null +++ b/build/linux64_569e52e/std/Math.hx @@ -0,0 +1,309 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + This class defines mathematical functions and constants. + + @see https://haxe.org/manual/std-math.html +**/ +#if cpp +@:include("hxMath.h") +#end +@:pure +extern class Math { + /** + Represents the ratio of the circumference of a circle to its diameter, + specified by the constant, π. `PI` is approximately `3.141592653589793`. + **/ + static var PI(default, null):Float; + + /** + A special `Float` constant which denotes negative infinity. + + For example, this is the result of `-1.0 / 0.0`. + + Operations with `NEGATIVE_INFINITY` as an operand may result in + `NEGATIVE_INFINITY`, `POSITIVE_INFINITY` or `NaN`. + + If this constant is converted to an `Int`, e.g. through `Std.int()`, the + result is unspecified. + **/ + static var NEGATIVE_INFINITY(default, null):Float; + + /** + A special `Float` constant which denotes positive infinity. + + For example, this is the result of `1.0 / 0.0`. + + Operations with `POSITIVE_INFINITY` as an operand may result in + `NEGATIVE_INFINITY`, `POSITIVE_INFINITY` or `NaN`. + + If this constant is converted to an `Int`, e.g. through `Std.int()`, the + result is unspecified. + **/ + static var POSITIVE_INFINITY(default, null):Float; + + /** + A special `Float` constant which denotes an invalid number. + + `NaN` stands for "Not a Number". It occurs when a mathematically incorrect + operation is executed, such as taking the square root of a negative + number: `Math.sqrt(-1)`. + + All further operations with `NaN` as an operand will result in `NaN`. + + If this constant is converted to an `Int`, e.g. through `Std.int()`, the + result is unspecified. + + In order to test if a value is `NaN`, you should use `Math.isNaN()` function. + **/ + static var NaN(default, null):Float; + + /** + Returns the absolute value of `v`. + + - If `v` is positive or `0`, the result is unchanged. Otherwise the result is `-v`. + - If `v` is `NEGATIVE_INFINITY` or `POSITIVE_INFINITY`, the result is `POSITIVE_INFINITY`. + - If `v` is `NaN`, the result is `NaN`. + **/ + static function abs(v:Float):Float; + + /** + Returns the smaller of values `a` and `b`. + + - If `a` or `b` are `NaN`, the result is `NaN`. + - If `a` or `b` are `NEGATIVE_INFINITY`, the result is `NEGATIVE_INFINITY`. + - If `a` and `b` are `POSITIVE_INFINITY`, the result is `POSITIVE_INFINITY`. + **/ + static function min(a:Float, b:Float):Float; + + /** + Returns the greater of values `a` and `b`. + + - If `a` or `b` are `NaN`, the result is `NaN`. + - If `a` or `b` are `POSITIVE_INFINITY`, the result is `POSITIVE_INFINITY`. + - If `a` and `b` are `NEGATIVE_INFINITY`, the result is `NEGATIVE_INFINITY`. + **/ + static function max(a:Float, b:Float):Float; + + /** + Returns the trigonometric sine of the specified angle `v`, in radians. + + If `v` is `NaN` or infinite, the result is `NaN`. + **/ + static function sin(v:Float):Float; + + /** + Returns the trigonometric cosine of the specified angle `v`, in radians. + + If `v` is `NaN` or infinite, the result is `NaN`. + **/ + static function cos(v:Float):Float; + + /** + Returns the trigonometric tangent of the specified angle `v`, in radians. + + If `v` is `NaN` or infinite, the result is `NaN`. + **/ + static function tan(v:Float):Float; + + /** + Returns the trigonometric arc of the specified angle `v`, in radians. + + If `v` is `NaN` or infinite, the result is `NaN`. + **/ + static function asin(v:Float):Float; + + /** + Returns the trigonometric arc cosine of the specified angle `v`, + in radians. + + If `v` is `NaN` or infinite, the result is `NaN`. + **/ + static function acos(v:Float):Float; + + /** + Returns the trigonometric arc tangent of the specified angle `v`, + in radians. + + If `v` is `NaN` or infinite, the result is `NaN`. + **/ + static function atan(v:Float):Float; + + /** + Returns the trigonometric arc tangent whose tangent is the quotient of + two specified numbers, in radians. + + If parameter `x` or `y` is `NaN`, `NEGATIVE_INFINITY` or `POSITIVE_INFINITY`, + the result is `NaN`. + **/ + static function atan2(y:Float, x:Float):Float; + + /** + Returns Euler's number, raised to the power of `v`. + + `exp(1.0)` is approximately `2.718281828459`. + + - If `v` is `POSITIVE_INFINITY`, the result is `POSITIVE_INFINITY`. + - If `v` is `NEGATIVE_INFINITY`, the result is `0.0`. + - If `v` is `NaN`, the result is `NaN`. + **/ + static function exp(v:Float):Float; + + /** + Returns the natural logarithm of `v`. + + This is the mathematical inverse operation of exp, + i.e. `log(exp(v)) == v` always holds. + + - If `v` is negative (including `NEGATIVE_INFINITY`) or `NaN`, the result is `NaN`. + - If `v` is `POSITIVE_INFINITY`, the result is `POSITIVE_INFINITY`. + - If `v` is `0.0`, the result is `NEGATIVE_INFINITY`. + **/ + static function log(v:Float):Float; + + /** + Returns a specified base `v` raised to the specified power `exp`. + **/ + static function pow(v:Float, exp:Float):Float; + + /** + Returns the square root of `v`. + + - If `v` is negative (including `NEGATIVE_INFINITY`) or `NaN`, the result is `NaN`. + - If `v` is `POSITIVE_INFINITY`, the result is `POSITIVE_INFINITY`. + - If `v` is `0.0`, the result is `0.0`. + **/ + static function sqrt(v:Float):Float; + + /** + Rounds `v` to the nearest integer value. + + Ties are rounded up, so that `0.5` becomes `1` and `-0.5` becomes `0`. + + If `v` is outside of the signed `Int32` range, or is `NaN`, `NEGATIVE_INFINITY` + or `POSITIVE_INFINITY`, the result is unspecified. + **/ + static function round(v:Float):Int; + + /** + Returns the largest integer value that is not greater than `v`. + + If `v` is outside of the signed `Int32` range, or is `NaN`, `NEGATIVE_INFINITY` + or `POSITIVE_INFINITY`, the result is unspecified. + **/ + static function floor(v:Float):Int; + + /** + Returns the smallest integer value that is not less than `v`. + + If `v` is outside of the signed `Int32` range, or is `NaN`, `NEGATIVE_INFINITY` + or `POSITIVE_INFINITY`, the result is unspecified. + **/ + static function ceil(v:Float):Int; + + /** + Returns a pseudo-random number which is greater than or equal to `0.0`, + and less than `1.0`. + **/ + static function random():Float; + + #if (flash || cpp || eval) + /** + Returns the largest integer value that is not greater than `v`, as a `Float`. + + If `v` is is `NaN`, `NEGATIVE_INFINITY` or `POSITIVE_INFINITY`, + the result is unspecified. + **/ + static function ffloor(v:Float):Float; + + /** + Returns the smallest integer value that is not less than `v`, as a `Float`. + + If `v` is is `NaN`, `NEGATIVE_INFINITY` or `POSITIVE_INFINITY`, + the result is unspecified. + **/ + static function fceil(v:Float):Float; + + /** + Rounds `v` to the nearest integer value, as a Float. + + Ties are rounded up, so that `0.5` becomes `1` and `-0.5` becomes `0`. + + If `v` is is `NaN`, `NEGATIVE_INFINITY` or `POSITIVE_INFINITY`, + the result is unspecified. + **/ + static function fround(v:Float):Float; + #else + static inline function ffloor(v:Float):Float { + return floor(v); + } + + static inline function fceil(v:Float):Float { + return ceil(v); + } + + static inline function fround(v:Float):Float { + return round(v); + } + #end + + /** + Tells if `f` is a finite number. + + If `f` is `POSITIVE_INFINITY`, `NEGATIVE_INFINITY` or `NaN`, the result + is `false`, otherwise the result is `true`. + **/ + static function isFinite(f:Float):Bool; + + /** + Tells if `f` is `Math.NaN`. + + If `f` is `NaN`, the result is `true`, otherwise the result is `false`. + In particular, `null`, `POSITIVE_INFINITY` and `NEGATIVE_INFINITY` are + not considered `NaN`. + **/ + static function isNaN(f:Float):Bool; + + #if !eval + private static function __init__():Void + untyped { + #if flash + NaN = __global__["Number"].NaN; + NEGATIVE_INFINITY = __global__["Number"].NEGATIVE_INFINITY; + POSITIVE_INFINITY = __global__["Number"].POSITIVE_INFINITY; + #else + // TODO: Abandoned code block? Js has its own _std/Math.hx + Math.__name__ = ["Math"]; + Math.NaN = Number["NaN"]; + Math.NEGATIVE_INFINITY = Number["NEGATIVE_INFINITY"]; + Math.POSITIVE_INFINITY = Number["POSITIVE_INFINITY"]; + #end + Math.isFinite = function(i) { + return #if flash __global__["isFinite"](i); #else false; #end + }; + Math.isNaN = function(i) { + return #if flash __global__["isNaN"](i); #else false; #end + }; + } + #end +} diff --git a/build/linux64_569e52e/std/Reflect.hx b/build/linux64_569e52e/std/Reflect.hx new file mode 100644 index 0000000..009e223 --- /dev/null +++ b/build/linux64_569e52e/std/Reflect.hx @@ -0,0 +1,202 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + The Reflect API is a way to manipulate values dynamically through an + abstract interface in an untyped manner. Use with care. + + @see https://haxe.org/manual/std-reflection.html +**/ +extern class Reflect { + /** + Tells if structure `o` has a field named `field`. + + This is only guaranteed to work for anonymous structures. Refer to + `Type.getInstanceFields` for a function supporting class instances. + + If `o` or `field` are null, the result is unspecified. + **/ + static function hasField(o:Dynamic, field:String):Bool; + + /** + Returns the value of the field named `field` on object `o`. + + If `o` is not an object or has no field named `field`, the result is + null. + + If the field is defined as a property, its accessors are ignored. Refer + to `Reflect.getProperty` for a function supporting property accessors. + + If `field` is null, the result is unspecified. + **/ + static function field(o:Dynamic, field:String):Dynamic; + + /** + Sets the field named `field` of object `o` to value `value`. + + If `o` has no field named `field`, this function is only guaranteed to + work for anonymous structures. + + If `o` or `field` are null, the result is unspecified. + **/ + static function setField(o:Dynamic, field:String, value:Dynamic):Void; + + /** + Returns the value of the field named `field` on object `o`, taking + property getter functions into account. + + If the field is not a property, this function behaves like + `Reflect.field`, but might be slower. + + If `o` or `field` are null, the result is unspecified. + **/ + static function getProperty(o:Dynamic, field:String):Dynamic; + + /** + Sets the field named `field` of object `o` to value `value`, taking + property setter functions into account. + + If the field is not a property, this function behaves like + `Reflect.setField`, but might be slower. + + If `field` is null, the result is unspecified. + **/ + static function setProperty(o:Dynamic, field:String, value:Dynamic):Void; + + /** + Call a method `func` with the given arguments `args`. + + The object `o` is ignored in most cases. It serves as the `this`-context in the following + situations: + + * (neko) Allows switching the context to `o` in all cases. + * (macro) Same as neko for Haxe 3. No context switching in Haxe 4. + * (js, lua) Require the `o` argument if `func` does not, but should have a context. + This can occur by accessing a function field natively, e.g. through `Reflect.field` + or by using `(object : Dynamic).field`. However, if `func` has a context, `o` is + ignored like on other targets. + **/ + static function callMethod(o:Dynamic, func:haxe.Constraints.Function, args:Array):Dynamic; + + /** + Returns the fields of structure `o`. + + This method is only guaranteed to work on anonymous structures. Refer to + `Type.getInstanceFields` for a function supporting class instances. + + If `o` is null, the result is unspecified. + **/ + static function fields(o:Dynamic):Array; + + /** + Returns true if `f` is a function, false otherwise. + + If `f` is null, the result is false. + **/ + static function isFunction(f:Dynamic):Bool; + + /** + Compares `a` and `b`. + + If `a` is less than `b`, the result is negative. If `b` is less than + `a`, the result is positive. If `a` and `b` are equal, the result is 0. + + This function is only defined if `a` and `b` are of the same type. + + If that type is a function, the result is unspecified and + `Reflect.compareMethods` should be used instead. + + For all other types, the result is 0 if `a` and `b` are equal. If they + are not equal, the result depends on the type and is negative if: + + - Numeric types: a is less than b + - String: a is lexicographically less than b + - Other: unspecified + + If `a` and `b` are null, the result is 0. If only one of them is null, + the result is unspecified. + **/ + static function compare(a:T, b:T):Int; + + /** + Compares the functions `f1` and `f2`. + + If `f1` or `f2` are null, the result is false. + If `f1` or `f2` are not functions, the result is unspecified. + + Otherwise the result is true if `f1` and the `f2` are physically equal, + false otherwise. + + If `f1` or `f2` are member method closures, the result is true if they + are closures of the same method on the same object value, false otherwise. + **/ + static function compareMethods(f1:Dynamic, f2:Dynamic):Bool; + + /** + Tells if `v` is an object. + + The result is true if `v` is one of the following: + + - class instance + - structure + - `Class` + - `Enum` + + Otherwise, including if `v` is null, the result is false. + **/ + static function isObject(v:Dynamic):Bool; + + /** + Tells if `v` is an enum value. + + The result is true if `v` is of type EnumValue, i.e. an enum + constructor. + + Otherwise, including if `v` is null, the result is false. + **/ + static function isEnumValue(v:Dynamic):Bool; + + /** + Removes the field named `field` from structure `o`. + + This method is only guaranteed to work on anonymous structures. + + If `o` or `field` are null, the result is unspecified. + **/ + static function deleteField(o:Dynamic, field:String):Bool; + + /** + Copies the fields of structure `o`. + + This is only guaranteed to work on anonymous structures. + + If `o` is null, the result is `null`. + **/ + static function copy(o:Null):Null; + + /** + Transform a function taking an array of arguments into a function that can + be called with any number of arguments. + **/ + @:overload(function(f:Array->Void):Dynamic {}) + static function makeVarArgs(f:Array->Dynamic):Dynamic; +} diff --git a/build/linux64_569e52e/std/Std.hx b/build/linux64_569e52e/std/Std.hx new file mode 100644 index 0000000..dd826e6 --- /dev/null +++ b/build/linux64_569e52e/std/Std.hx @@ -0,0 +1,138 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +#if !(core_api || cross || custom_target || eval) +#error "Please don't add haxe/std to your classpath, instead set HAXE_STD_PATH env var" +#end + +/** + The Std class provides standard methods for manipulating basic types. +**/ +extern class Std { + /** + DEPRECATED. Use `Std.isOfType(v, t)` instead. + + Tells if a value `v` is of the type `t`. Returns `false` if `v` or `t` are null. + + If `t` is a class or interface with `@:generic` meta, the result is `false`. + **/ + @:deprecated('Std.is is deprecated. Use Std.isOfType instead.') + static function is(v:Dynamic, t:Dynamic):Bool; + + /** + Tells if a value `v` is of the type `t`. Returns `false` if `v` or `t` are null. + + If `t` is a class or interface with `@:generic` meta, the result is `false`. + **/ + static function isOfType(v:Dynamic, t:Dynamic):Bool; + + /** + Checks if object `value` is an instance of class or interface `c`. + + Compiles only if the type specified by `c` can be assigned to the type + of `value`. + + This method checks if a downcast is possible. That is, if the runtime + type of `value` is assignable to the type specified by `c`, `value` is + returned. Otherwise null is returned. + + This method is not guaranteed to work with core types such as `String`, + `Array` and `Date`. + + If `value` is null, the result is null. If `c` is null, the result is + unspecified. + **/ + static function downcast(value:T, c:Class):S; + + @:deprecated('Std.instance() is deprecated. Use Std.downcast() instead.') + static function instance(value:T, c:Class):S; + + /** + Converts any value to a String. + + If `s` is of `String`, `Int`, `Float` or `Bool`, its value is returned. + + If `s` is an instance of a class and that class or one of its parent classes has + a `toString` method, that method is called. If no such method is present, the result + is unspecified. + + If `s` is an enum constructor without argument, the constructor's name is returned. If + arguments exists, the constructor's name followed by the String representations of + the arguments is returned. + + If `s` is a structure, the field names along with their values are returned. The field order + and the operator separating field names and values are unspecified. + + If s is null, "null" is returned. + **/ + static function string(s:Dynamic):String; + + /** + Converts a `Float` to an `Int`, rounded towards 0. + + If `x` is outside of the signed Int32 range, or is `NaN`, `NEGATIVE_INFINITY` or `POSITIVE_INFINITY`, the result is unspecified. + **/ + static function int(x:Float):Int; + + /** + Converts a `String` to an `Int`. + + Leading whitespaces are ignored. + + `x` may optionally start with a + or - to denote a postive or negative value respectively. + + If the optional sign is followed 0x or 0X, hexadecimal notation is recognized where the following + digits may contain 0-9 and A-F. Both the prefix and digits are case insensitive. + + Otherwise `x` is read as decimal number with 0-9 being allowed characters. Octal and binary + notations are not supported. + + Parsing continues until an invalid character is detected, in which case the result up to + that point is returned. Scientific notation is not supported. That is `Std.parseInt('10e2')` produces `10`. + + If `x` is `null`, the result is `null`. + If `x` cannot be parsed as integer or is empty, the result is `null`. + + If `x` starts with a hexadecimal prefix which is not followed by at least one valid hexadecimal + digit, the result is unspecified. + **/ + static function parseInt(x:String):Null; + + /** + Converts a `String` to a `Float`. + + The parsing rules for `parseInt` apply here as well, with the exception of invalid input + resulting in a `NaN` value instead of `null`. Also, hexadecimal support is **not** specified. + + Additionally, decimal notation may contain a single `.` to denote the start of the fractions. + + It may also end with `e` or `E` followed by optional minus or plus sign and a sequence of + digits (defines exponent to base 10). + **/ + static function parseFloat(x:String):Float; + + /** + Return a random integer between 0 included and `x` excluded. + + If `x <= 1`, the result is always 0. + **/ + static function random(x:Int):Int; +} diff --git a/build/linux64_569e52e/std/StdTypes.hx b/build/linux64_569e52e/std/StdTypes.hx new file mode 100644 index 0000000..b67e3c4 --- /dev/null +++ b/build/linux64_569e52e/std/StdTypes.hx @@ -0,0 +1,172 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +// standard Haxe types + +/** + The standard `Void` type. Only `null` values can be of the type `Void`. + + @see https://haxe.org/manual/types-void.html +**/ +#if jvm +@:runtimeValue +#end +@:coreType abstract Void {} + +/** + The standard `Float` type, this is a double-precision IEEE 64bit float. + + On static targets, `null` cannot be assigned to Float. If this is necessary, + `Null` can be used instead. + + `Std.int` converts a `Float` to an `Int`, rounded towards 0. + `Std.parseFloat` converts a `String` to a `Float`. + + @see https://haxe.org/manual/types-basic-types.html + @see https://haxe.org/manual/types-nullability.html +**/ +@:coreType @:notNull @:runtimeValue abstract Float {} + +/** + The standard `Int` type. Its precision depends on the platform. + + On static targets, `null` cannot be assigned to `Int`. If this is necessary, + `Null` can be used instead. + + `Std.int` converts a `Float` to an `Int`, rounded towards 0. + `Std.parseInt` converts a `String` to an `Int`. + + @see https://haxe.org/manual/types-basic-types.html + @see https://haxe.org/manual/std-math-integer-math.html + @see https://haxe.org/manual/types-nullability.html +**/ +@:coreType @:notNull @:runtimeValue abstract Int to Float {} + +#if (java || hl || cpp) +/** + Single-precision IEEE 32bit float (4-byte). +**/ +@:coreType @:notNull @:runtimeValue abstract Single to Float from Float {} +#end + +/** + `Null` is a wrapper that can be used to make the basic types `Int`, + `Float` and `Bool` nullable on static targets. + + If null safety is enabled, only types wrapped in `Null` are nullable. + + Otherwise, it has no effect on non-basic-types, but it can be useful as a way to document + that `null` is an acceptable value for a method argument, return value or variable. + + @see https://haxe.org/manual/types-nullability.html +**/ +@:forward +@:coreType +abstract Null from T to T {} + +/** + The standard Boolean type, which can either be `true` or `false`. + + On static targets, `null` cannot be assigned to `Bool`. If this is necessary, + `Null` can be used instead. + + @see https://haxe.org/manual/types-bool.html + @see https://haxe.org/manual/types-nullability.html +**/ +@:coreType @:notNull @:runtimeValue abstract Bool {} + +/** + `Dynamic` is a special type which is compatible with all other types. + + Use of `Dynamic` should be minimized as it prevents several compiler + checks and optimizations. See `Any` type for a safer alternative for + representing values of any type. + + @see https://haxe.org/manual/types-dynamic.html +**/ +@:coreType @:runtimeValue abstract Dynamic {} + +/** + An `Iterator` is a structure that permits iteration over elements of type `T`. + + Any class with matching `hasNext()` and `next()` fields is considered an `Iterator` + and can then be used e.g. in `for`-loops. This makes it easy to implement + custom iterators. + + @see https://haxe.org/manual/lf-iterators.html +**/ +typedef Iterator = { + /** + Returns `false` if the iteration is complete, `true` otherwise. + + Usually iteration is considered to be complete if all elements of the + underlying data structure were handled through calls to `next()`. However, + in custom iterators any logic may be used to determine the completion + state. + **/ + function hasNext():Bool; + + /** + Returns the current item of the `Iterator` and advances to the next one. + + This method is not required to check `hasNext()` first. A call to this + method while `hasNext()` is `false` yields unspecified behavior. + + On the other hand, iterators should not require a call to `hasNext()` + before the first call to `next()` if an element is available. + **/ + function next():T; +} + +/** + An `Iterable` is a data structure which has an `iterator()` method. + See `Lambda` for generic functions on iterable structures. + + @see https://haxe.org/manual/lf-iterators.html +**/ +typedef Iterable = { + function iterator():Iterator; +} + +/** + A `KeyValueIterator` is an `Iterator` that has a key and a value. +**/ +typedef KeyValueIterator = Iterator<{key:K, value:V}>; + +/** + A `KeyValueIterable` is a data structure which has a `keyValueIterator()` + method to iterate over key-value-pairs. +**/ +typedef KeyValueIterable = { + function keyValueIterator():KeyValueIterator; +} + +/** + `ArrayAccess` is used to indicate a class that can be accessed using brackets. + The type parameter represents the type of the elements stored. + + This interface should be used for externs only. Haxe does not support custom + array access on classes. However, array access can be implemented for + abstract types. + + @see https://haxe.org/manual/types-abstract-array-access.html +**/ +extern interface ArrayAccess {} diff --git a/build/linux64_569e52e/std/String.hx b/build/linux64_569e52e/std/String.hx new file mode 100644 index 0000000..b4a2899 --- /dev/null +++ b/build/linux64_569e52e/std/String.hx @@ -0,0 +1,177 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + The basic String class. + + A Haxe String is immutable, it is not possible to modify individual + characters. No method of this class changes the state of `this` String. + + Strings can be constructed using the String literal syntax `"string value"`. + + String can be concatenated by using the `+` operator. If an operand is not a + String, it is passed through `Std.string()` first. + + @see https://haxe.org/manual/std-String.html +**/ +extern class String { + /** + The number of characters in `this` String. + **/ + var length(default, null):Int; + + /** + Creates a copy from a given String. + **/ + function new(string:String):Void; + + /** + Returns a String where all characters of `this` String are upper case. + **/ + function toUpperCase():String; + + /** + Returns a String where all characters of `this` String are lower case. + **/ + function toLowerCase():String; + + /** + Returns the character at position `index` of `this` String. + + If `index` is negative or exceeds `this.length`, the empty String `""` + is returned. + **/ + function charAt(index:Int):String; + + /** + Returns the character code at position `index` of `this` String. + + If `index` is negative or exceeds `this.length`, `null` is returned. + + To obtain the character code of a single character, `"x".code` can be + used instead to inline the character code at compile time. Note that + this only works on String literals of length 1. + **/ + function charCodeAt(index:Int):Null; + + /** + Returns the position of the leftmost occurrence of `str` within `this` String. + + If `str` is the empty String `""`, then: + * If `startIndex` is not specified or < 0, 0 is returned. + * If `startIndex >= this.length`, `this.length` is returned. + * Otherwise, `startIndex` is returned, + + Otherwise, if `startIndex` is not specified or < 0, it is treated as 0. + + If `startIndex >= this.length`, -1 is returned. + + Otherwise the search is performed within the substring of `this` String starting + at `startIndex`. If `str` is found, the position of its first character in `this` + String relative to position 0 is returned. + + If `str` cannot be found, -1 is returned. + **/ + function indexOf(str:String, ?startIndex:Int):Int; + + /** + Returns the position of the rightmost occurrence of `str` within `this` + String. + + If `startIndex` is given, the search is performed within the substring + of `this` String from 0 to `startIndex + str.length`. Otherwise the search + is performed within `this` String. In either case, the returned position + is relative to the beginning of `this` String. + + If `startIndex` is negative, the result is unspecifed. + + If `str` cannot be found, -1 is returned. + **/ + function lastIndexOf(str:String, ?startIndex:Int):Int; + + /** + Splits `this` String at each occurrence of `delimiter`. + + If `this` String is the empty String `""`, the result is not consistent + across targets and may either be `[]` (on Js, Cpp) or `[""]`. + + If `delimiter` is the empty String `""`, `this` String is split into an + Array of `this.length` elements, where the elements correspond to the + characters of `this` String. + + If `delimiter` is not found within `this` String, the result is an Array + with one element, which equals `this` String. + + If `delimiter` is null, the result is unspecified. + + Otherwise, `this` String is split into parts at each occurrence of + `delimiter`. If `this` String starts (or ends) with `delimiter`, the + result `Array` contains a leading (or trailing) empty String `""` element. + Two subsequent delimiters also result in an empty String `""` element. + **/ + function split(delimiter:String):Array; + + /** + Returns `len` characters of `this` String, starting at position `pos`. + + If `len` is omitted, all characters from position `pos` to the end of + `this` String are included. + + If `pos` is negative, its value is calculated from the end of `this` + String by `this.length + pos`. If this yields a negative value, 0 is + used instead. + + If the calculated position + `len` exceeds `this.length`, the characters + from that position to the end of `this` String are returned. + + If `len` is negative, the result is unspecified. + **/ + function substr(pos:Int, ?len:Int):String; + + /** + Returns the part of `this` String from `startIndex` to but not including `endIndex`. + + If `startIndex` or `endIndex` are negative, 0 is used instead. + + If `startIndex` exceeds `endIndex`, they are swapped. + + If the (possibly swapped) `endIndex` is omitted or exceeds + `this.length`, `this.length` is used instead. + + If the (possibly swapped) `startIndex` exceeds `this.length`, the empty + String `""` is returned. + **/ + function substring(startIndex:Int, ?endIndex:Int):String; + + /** + Returns the String itself. + **/ + function toString():String; + + /** + Returns the String corresponding to the character code `code`. + + If `code` is negative or has another invalid value, the result is + unspecified. + **/ + @:pure static function fromCharCode(code:Int):String; +} diff --git a/build/linux64_569e52e/std/StringBuf.hx b/build/linux64_569e52e/std/StringBuf.hx new file mode 100644 index 0000000..72a9aef --- /dev/null +++ b/build/linux64_569e52e/std/StringBuf.hx @@ -0,0 +1,99 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + A String buffer is an efficient way to build a big string by appending small + elements together. + + Unlike String, an instance of StringBuf is not immutable in the sense that + it can be passed as argument to functions which modify it by appending more + values. +**/ +class StringBuf { + var b:String; + + /** + The length of `this` StringBuf in characters. + **/ + public var length(get, never):Int; + + /** + Creates a new StringBuf instance. + + This may involve initialization of the internal buffer. + **/ + public inline function new() { + b = ""; + } + + inline function get_length():Int { + return b.length; + } + + /** + Appends the representation of `x` to `this` StringBuf. + + The exact representation of `x` may vary per platform. To get more + consistent behavior, this function should be called with + Std.string(x). + + If `x` is null, the String "null" is appended. + **/ + public inline function add(x:T):Void { + b += x; + } + + /** + Appends the character identified by `c` to `this` StringBuf. + + If `c` is negative or has another invalid value, the result is + unspecified. + **/ + public inline function addChar(c:Int):Void { + b += String.fromCharCode(c); + } + + /** + Appends a substring of `s` to `this` StringBuf. + + This function expects `pos` and `len` to describe a valid substring of + `s`, or else the result is unspecified. To get more robust behavior, + `this.add(s.substr(pos,len))` can be used instead. + + If `s` or `pos` are null, the result is unspecified. + + If `len` is omitted or null, the substring ranges from `pos` to the end + of `s`. + **/ + public inline function addSub(s:String, pos:Int, ?len:Int):Void { + b += (len == null ? s.substr(pos) : s.substr(pos, len)); + } + + /** + Returns the content of `this` StringBuf as String. + + The buffer is not emptied by this operation. + **/ + public inline function toString():String { + return b; + } +} diff --git a/build/linux64_569e52e/std/StringTools.hx b/build/linux64_569e52e/std/StringTools.hx new file mode 100644 index 0000000..208b280 --- /dev/null +++ b/build/linux64_569e52e/std/StringTools.hx @@ -0,0 +1,617 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +import haxe.iterators.StringIterator; +import haxe.iterators.StringKeyValueIterator; + +#if cpp +using cpp.NativeString; +#end + +/** + This class provides advanced methods on Strings. It is ideally used with + `using StringTools` and then acts as an [extension](https://haxe.org/manual/lf-static-extension.html) + to the `String` class. + + If the first argument to any of the methods is null, the result is + unspecified. +**/ +class StringTools { + /** + Encode an URL by using the standard format. + **/ + #if (!java && !cpp && !lua && !eval) inline #end public static function urlEncode(s:String):String { + #if flash + return untyped __global__["encodeURIComponent"](s); + #elseif neko + return untyped new String(_urlEncode(s.__s)); + #elseif js + return untyped encodeURIComponent(s); + #elseif cpp + return untyped s.__URLEncode(); + #elseif java + return postProcessUrlEncode(java.net.URLEncoder.encode(s, "UTF-8")); + #elseif python + return python.lib.urllib.Parse.quote(s, ""); + #elseif hl + var len = 0; + var b = @:privateAccess s.bytes.urlEncode(len); + return @:privateAccess String.__alloc__(b, len); + #elseif lua + s = lua.NativeStringTools.gsub(s, "\n", "\r\n"); + s = lua.NativeStringTools.gsub(s, "([^%w %-%_%.%~])", function(c) { + return lua.NativeStringTools.format("%%%02X", lua.NativeStringTools.byte(c) + ''); + }); + s = lua.NativeStringTools.gsub(s, " ", "+"); + return s; + #else + return null; + #end + } + + #if java + private static function postProcessUrlEncode(s:String):String { + var ret = new StringBuf(); + var i = 0, len = s.length; + while (i < len) { + switch (_charAt(s, i++)) { + case '+'.code: + ret.add('%20'); + case '%'.code if (i <= len - 2): + var c1 = _charAt(s, i++), c2 = _charAt(s, i++); + switch [c1, c2] { + case ['2'.code, '1'.code]: + ret.addChar('!'.code); + case ['2'.code, '7'.code]: + ret.addChar('\''.code); + case ['2'.code, '8'.code]: + ret.addChar('('.code); + case ['2'.code, '9'.code]: + ret.addChar(')'.code); + case ['7'.code, 'E'.code] | ['7'.code, 'e'.code]: + ret.addChar('~'.code); + case _: + ret.addChar('%'.code); + ret.addChar(cast c1); + ret.addChar(cast c2); + } + case var chr: + ret.addChar(cast chr); + } + } + return ret.toString(); + } + #end + + /** + Decode an URL using the standard format. + **/ + #if (!java && !cpp && !lua && !eval) inline #end public static function urlDecode(s:String):String { + #if flash + return untyped __global__["decodeURIComponent"](s.split("+").join(" ")); + #elseif neko + return untyped new String(_urlDecode(s.__s)); + #elseif js + return untyped decodeURIComponent(s.split("+").join(" ")); + #elseif cpp + return untyped s.__URLDecode(); + #elseif java + try + return java.net.URLDecoder.decode(s, "UTF-8") + catch (e:Dynamic) + throw e; + #elseif python + return python.lib.urllib.Parse.unquote(s); + #elseif hl + var len = 0; + var b = @:privateAccess s.bytes.urlDecode(len); + return @:privateAccess String.__alloc__(b, len); + #elseif lua + s = lua.NativeStringTools.gsub(s, "+", " "); + s = lua.NativeStringTools.gsub(s, "%%(%x%x)", function(h) { + return lua.NativeStringTools.char(lua.Lua.tonumber(h, 16)); + }); + s = lua.NativeStringTools.gsub(s, "\r\n", "\n"); + return s; + #else + return null; + #end + } + + /** + Escapes HTML special characters of the string `s`. + + The following replacements are made: + + - `&` becomes `&`; + - `<` becomes `<`; + - `>` becomes `>`; + + If `quotes` is true, the following characters are also replaced: + + - `"` becomes `"`; + - `'` becomes `'`; + **/ + public static function htmlEscape(s:String, ?quotes:Bool):String { + var buf = new StringBuf(); + for (code in #if neko iterator(s) #else new haxe.iterators.StringIteratorUnicode(s) #end) { + switch (code) { + case '&'.code: + buf.add("&"); + case '<'.code: + buf.add("<"); + case '>'.code: + buf.add(">"); + case '"'.code if (quotes): + buf.add("""); + case '\''.code if (quotes): + buf.add("'"); + case _: + buf.addChar(code); + } + } + return buf.toString(); + } + + /** + Unescapes HTML special characters of the string `s`. + + This is the inverse operation to htmlEscape, i.e. the following always + holds: `htmlUnescape(htmlEscape(s)) == s` + + The replacements follow: + + - `&` becomes `&` + - `<` becomes `<` + - `>` becomes `>` + - `"` becomes `"` + - `'` becomes `'` + **/ + public static function htmlUnescape(s:String):String { + return s.split(">") + .join(">") + .split("<") + .join("<") + .split(""") + .join('"') + .split("'") + .join("'") + .split("&") + .join("&"); + } + + /** + Returns `true` if `s` contains `value` and `false` otherwise. + + When `value` is `null`, the result is unspecified. + **/ + public static inline function contains(s:String, value:String):Bool { + #if (js && js_es >= 6) + return (cast s).includes(value); + #else + return s.indexOf(value) != -1; + #end + } + + /** + Tells if the string `s` starts with the string `start`. + + If `start` is `null`, the result is unspecified. + + If `start` is the empty String `""`, the result is true. + **/ + public static #if (java || python || (js && js_es >= 6)) inline #end function startsWith(s:String, start:String):Bool { + #if java + return (cast s : java.NativeString).startsWith(start); + #elseif hl + return @:privateAccess (s.length >= start.length && s.bytes.compare(0, start.bytes, 0, start.length << 1) == 0); + #elseif python + return python.NativeStringTools.startswith(s, start); + #elseif (js && js_es >= 6) + return (cast s).startsWith(start); + #elseif lua + return untyped __lua__("{0}:sub(1, #{1}) == {1}", s, start); + #else + return (s.length >= start.length && s.lastIndexOf(start, 0) == 0); + #end + } + + /** + Tells if the string `s` ends with the string `end`. + + If `end` is `null`, the result is unspecified. + + If `end` is the empty String `""`, the result is true. + **/ + public static #if (java || python || (js && js_es >= 6)) inline #end function endsWith(s:String, end:String):Bool { + #if java + return (cast s : java.NativeString).endsWith(end); + #elseif hl + var elen = end.length; + var slen = s.length; + return @:privateAccess (slen >= elen && s.bytes.compare((slen - elen) << 1, end.bytes, 0, elen << 1) == 0); + #elseif python + return python.NativeStringTools.endswith(s, end); + #elseif (js && js_es >= 6) + return (cast s).endsWith(end); + #elseif lua + return end == "" || untyped __lua__("{0}:sub(-#{1}) == {1}", s, end); + #else + var elen = end.length; + var slen = s.length; + return (slen >= elen && s.indexOf(end, (slen - elen)) == (slen - elen)); + #end + } + + /** + Tells if the character in the string `s` at position `pos` is a space. + + A character is considered to be a space character if its character code + is 9,10,11,12,13 or 32. + + If `s` is the empty String `""`, or if pos is not a valid position within + `s`, the result is false. + **/ + public static function isSpace(s:String, pos:Int):Bool { + #if (python || lua) + if (s.length == 0 || pos < 0 || pos >= s.length) + return false; + #end + var c = s.charCodeAt(pos); + return (c > 8 && c < 14) || c == 32; + } + + /** + Removes leading space characters of `s`. + + This function internally calls `isSpace()` to decide which characters to + remove. + + If `s` is the empty String `""` or consists only of space characters, the + result is the empty String `""`. + **/ + public inline static function ltrim(s:String):String { + var l = s.length; + var r = 0; + while (r < l && isSpace(s, r)) { + r++; + } + if (r > 0) + return s.substr(r, l - r); + else + return s; + } + + /** + Removes trailing space characters of `s`. + + This function internally calls `isSpace()` to decide which characters to + remove. + + If `s` is the empty String `""` or consists only of space characters, the + result is the empty String `""`. + **/ + public inline static function rtrim(s:String):String { + var l = s.length; + var r = 0; + while (r < l && isSpace(s, l - r - 1)) { + r++; + } + if (r > 0) { + return s.substr(0, l - r); + } else { + return s; + } + } + + /** + Removes leading and trailing space characters of `s`. + + This is a convenience function for `ltrim(rtrim(s))`. + **/ + public #if java inline #end static function trim(s:String):String { + #if java + return (cast s : java.NativeString).trim(); + #else + return ltrim(rtrim(s)); + #end + } + + /** + Concatenates `c` to `s` until `s.length` is at least `l`. + + If `c` is the empty String `""` or if `l` does not exceed `s.length`, + `s` is returned unchanged. + + If `c.length` is 1, the resulting String length is exactly `l`. + + Otherwise the length may exceed `l`. + + If `c` is null, the result is unspecified. + **/ + public static function lpad(s:String, c:String, l:Int):String { + if (c.length <= 0) + return s; + + var buf = new StringBuf(); + l -= s.length; + while (buf.length < l) { + buf.add(c); + } + buf.add(s); + return buf.toString(); + } + + /** + Appends `c` to `s` until `s.length` is at least `l`. + + If `c` is the empty String `""` or if `l` does not exceed `s.length`, + `s` is returned unchanged. + + If `c.length` is 1, the resulting String length is exactly `l`. + + Otherwise the length may exceed `l`. + + If `c` is null, the result is unspecified. + **/ + public static function rpad(s:String, c:String, l:Int):String { + if (c.length <= 0) + return s; + + var buf = new StringBuf(); + buf.add(s); + while (buf.length < l) { + buf.add(c); + } + return buf.toString(); + } + + /** + Replace all occurrences of the String `sub` in the String `s` by the + String `by`. + + If `sub` is the empty String `""`, `by` is inserted after each character + of `s` except the last one. If `by` is also the empty String `""`, `s` + remains unchanged. + + If `sub` or `by` are null, the result is unspecified. + **/ + public static function replace(s:String, sub:String, by:String):String { + #if java + if (sub.length == 0) + return s.split(sub).join(by); + else + return (cast s : java.NativeString).replace(sub, by); + #else + return s.split(sub).join(by); + #end + } + + /** + Encodes `n` into a hexadecimal representation. + + If `digits` is specified, the resulting String is padded with "0" until + its `length` equals `digits`. + **/ + public static function hex(n:Int, ?digits:Int) { + #if flash + var n:UInt = n; + var s:String = untyped n.toString(16); + s = s.toUpperCase(); + #else + var s = ""; + var hexChars = "0123456789ABCDEF"; + do { + s = hexChars.charAt(n & 15) + s; + n >>>= 4; + } while (n > 0); + #end + #if python + if (digits != null && s.length < digits) { + var diff = digits - s.length; + for (_ in 0...diff) { + s = "0" + s; + } + } + #else + if (digits != null) + while (s.length < digits) + s = "0" + s; + #end + return s; + } + + /** + Returns the character code at position `index` of String `s`, or an + end-of-file indicator at if `position` equals `s.length`. + + This method is faster than `String.charCodeAt()` on some platforms, but + the result is unspecified if `index` is negative or greater than + `s.length`. + + End of file status can be checked by calling `StringTools.isEof()` with + the returned value as argument. + + This operation is not guaranteed to work if `s` contains the `\0` + character. + **/ + public static #if !eval inline #end function fastCodeAt(s:String, index:Int):Int { + #if neko + return untyped __dollar__sget(s.__s, index); + #elseif cpp + return untyped s.cca(index); + #elseif flash + return untyped s.cca(index); + #elseif java + return (index < s.length) ? cast(_charAt(s, index), Int) : -1; + #elseif js + return (cast s).charCodeAt(index); + #elseif python + return if (index >= s.length) -1 else python.internal.UBuiltins.ord(python.Syntax.arrayAccess(s, index)); + #elseif hl + return @:privateAccess s.bytes.getUI16(index << 1); + #elseif lua + #if lua_vanilla + return lua.NativeStringTools.byte(s, index + 1); + #else + return lua.lib.luautf8.Utf8.byte(s, index + 1); + #end + #else + return untyped s.cca(index); + #end + } + + /** + Returns the character code at position `index` of String `s`, or an + end-of-file indicator at if `position` equals `s.length`. + + This method is faster than `String.charCodeAt()` on some platforms, but + the result is unspecified if `index` is negative or greater than + `s.length`. + + This operation is not guaranteed to work if `s` contains the `\0` + character. + **/ + public static #if !eval inline #end function unsafeCodeAt(s:String, index:Int):Int { + #if neko + return untyped __dollar__sget(s.__s, index); + #elseif cpp + return untyped s.cca(index); + #elseif flash + return untyped s.cca(index); + #elseif java + return cast(_charAt(s, index), Int); + #elseif js + return (cast s).charCodeAt(index); + #elseif python + return python.internal.UBuiltins.ord(python.Syntax.arrayAccess(s, index)); + #elseif hl + return @:privateAccess s.bytes.getUI16(index << 1); + #elseif lua + #if lua_vanilla + return lua.NativeStringTools.byte(s, index + 1); + #else + return lua.lib.luautf8.Utf8.byte(s, index + 1); + #end + #else + return untyped s.cca(index); + #end + } + + /** + Returns an iterator of the char codes. + + Note that char codes may differ across platforms because of different + internal encoding of strings in different runtimes. + For the consistent cross-platform UTF8 char codes see `haxe.iterators.StringIteratorUnicode`. + **/ + public static inline function iterator(s:String):StringIterator { + return new StringIterator(s); + } + + /** + Returns an iterator of the char indexes and codes. + + Note that char codes may differ across platforms because of different + internal encoding of strings in different of runtimes. + For the consistent cross-platform UTF8 char codes see `haxe.iterators.StringKeyValueIteratorUnicode`. + **/ + public static inline function keyValueIterator(s:String):StringKeyValueIterator { + return new StringKeyValueIterator(s); + } + + /** + Tells if `c` represents the end-of-file (EOF) character. + **/ + @:noUsing public static inline function isEof(c:Int):Bool { + #if (flash || cpp || hl) + return c == 0; + #elseif js + return c != c; // fast NaN + #elseif (neko || lua || eval) + return c == null; + #elseif (java || python) + return c == -1; + #else + return false; + #end + } + + /** + Returns a String that can be used as a single command line argument + on Unix. + The input will be quoted, or escaped if necessary. + **/ + @:noCompletion + @:deprecated('StringTools.quoteUnixArg() is deprecated. Use haxe.SysTools.quoteUnixArg() instead.') + public static function quoteUnixArg(argument:String):String { + return inline haxe.SysTools.quoteUnixArg(argument); + } + + /** + Character codes of the characters that will be escaped by `quoteWinArg(_, true)`. + **/ + @:noCompletion + @:deprecated('StringTools.winMetaCharacters is deprecated. Use haxe.SysTools.winMetaCharacters instead.') + public static var winMetaCharacters:Array = cast haxe.SysTools.winMetaCharacters; + + /** + Returns a String that can be used as a single command line argument + on Windows. + The input will be quoted, or escaped if necessary, such that the output + will be parsed as a single argument using the rule specified in + http://msdn.microsoft.com/en-us/library/ms880421 + + Examples: + ```haxe + quoteWinArg("abc") == "abc"; + quoteWinArg("ab c") == '"ab c"'; + ``` + **/ + @:noCompletion + @:deprecated('StringTools.quoteWinArg() is deprecated. Use haxe.SysTools.quoteWinArg() instead.') + public static function quoteWinArg(argument:String, escapeMetaCharacters:Bool):String { + return inline haxe.SysTools.quoteWinArg(argument, escapeMetaCharacters); + } + + #if java + private static inline function _charAt(str:String, idx:Int):java.StdTypes.Char16 + return (cast str : java.NativeString).charAt(idx); + #end + + #if neko + private static var _urlEncode = neko.Lib.load("std", "url_encode", 1); + private static var _urlDecode = neko.Lib.load("std", "url_decode", 1); + #end + + #if utf16 + static inline var MIN_SURROGATE_CODE_POINT = 65536; + + static inline function utf16CodePointAt(s:String, index:Int):Int { + var c = StringTools.fastCodeAt(s, index); + if (c >= 0xD800 && c <= 0xDBFF) { + c = ((c - 0xD7C0) << 10) | (StringTools.fastCodeAt(s, index + 1) & 0x3FF); + } + return c; + } + #end +} diff --git a/build/linux64_569e52e/std/Sys.hx b/build/linux64_569e52e/std/Sys.hx new file mode 100644 index 0000000..def62d6 --- /dev/null +++ b/build/linux64_569e52e/std/Sys.hx @@ -0,0 +1,181 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + This class provides access to various base functions of system platforms. + Look in the `sys` package for more system APIs. +**/ +@:require(sys) +extern class Sys { + /** + Prints any value to the standard output. + **/ + static function print(v:Dynamic):Void; + + /** + Prints any value to the standard output, followed by a newline. + On Windows, this function outputs a CRLF newline. + LF newlines are printed on all other platforms. + **/ + static function println(v:Dynamic):Void; + + /** + Returns all the arguments that were passed in the command line. + This does not include the interpreter or the name of the program file. + + (java)(eval) On Windows, non-ASCII Unicode arguments will not work correctly. + **/ + static function args():Array; + + /** + Returns the value of the given environment variable, or `null` if it + doesn't exist. + **/ + static function getEnv(s:String):String; + + /** + Sets the value of the given environment variable. + + If `v` is `null`, the environment variable is removed. + + (java) This functionality is not available on Java; calling this function will throw. + **/ + static function putEnv(s:String, v:Null):Void; + + /** + Returns a map of the current environment variables and their values + as of the invocation of the function. + + (python) On Windows, the variable names are always in upper case. + + (cpp)(hl)(neko) On Windows, the variable names match the last capitalization used when modifying + the variable if the variable has been modified, otherwise they match their capitalization at + the start of the process. + + On Windows on remaining targets, variable name capitalization matches however they were capitalized + at the start of the process or at the moment of their creation. + **/ + static function environment():Map; + + /** + Suspends execution for the given length of time (in seconds). + **/ + static function sleep(seconds:Float):Void; + + /** + Changes the current time locale, which will affect `DateTools.format` date formating. + Returns `true` if the locale was successfully changed. + **/ + static function setTimeLocale(loc:String):Bool; + + /** + Gets the current working directory (usually the one in which the program was started). + **/ + static function getCwd():String; + + /** + Changes the current working directory. + + (java) This functionality is not available on Java; calling this function will throw. + **/ + static function setCwd(s:String):Void; + + /** + Returns the type of the current system. Possible values are: + - `"Windows"` + - `"Linux"` + - `"BSD"` + - `"Mac"` + **/ + static function systemName():String; + + /** + Runs the given command. The command output will be printed to the same output as the current process. + The current process will block until the command terminates. + The return value is the exit code of the command (usually `0` indicates no error). + + Command arguments can be passed in two ways: + + 1. Using `args` to pass command arguments. Each argument will be automatically quoted and shell meta-characters will be escaped if needed. + `cmd` should be an executable name that can be located in the `PATH` environment variable, or a full path to an executable. + + 2. When `args` is not given or is `null`, command arguments can be appended to `cmd`. No automatic quoting/escaping will be performed. `cmd` should be formatted exactly as it would be when typed at the command line. + It can run executables, as well as shell commands that are not executables (e.g. on Windows: `dir`, `cd`, `echo` etc). + + Use the `sys.io.Process` API for more complex tasks, such as background processes, or providing input to the command. + **/ + static function command(cmd:String, ?args:Array):Int; + + /** + Exits the current process with the given exit code. + + (macro)(eval) Being invoked in a macro or eval context (e.g. with `-x` or `--run`) immediately terminates + the compilation process, which also prevents the execution of any `--next` sections of compilation arguments. + **/ + static function exit(code:Int):Void; + + /** + Gives the most precise timestamp value available (in seconds). + **/ + static function time():Float; + + /** + Gives the most precise timestamp value available (in seconds), + but only accounts for the actual time spent running on the CPU for the current thread/process. + **/ + static function cpuTime():Float; + + /** + Returns the path to the current executable that we are running. + **/ + @:deprecated("Use programPath instead") static function executablePath():String; + + /** + Returns the absolute path to the current program file that we are running. + Concretely, for an executable binary, it returns the path to the binary. + For a script (e.g. a PHP file), it returns the path to the script. + **/ + static function programPath():String; + + /** + Reads a single input character from the standard input and returns it. + Setting `echo` to `true` will also display the character on the output. + **/ + static function getChar(echo:Bool):Int; + + /** + Returns the standard input of the process, from which user input can be read. + Usually it will block until the user sends a full input line. + See `getChar` for an alternative. + **/ + static function stdin():haxe.io.Input; + + /** + Returns the standard output of the process, to which program output can be written. + **/ + static function stdout():haxe.io.Output; + + /** + Returns the standard error of the process, to which program errors can be written. + **/ + static function stderr():haxe.io.Output; +} diff --git a/build/linux64_569e52e/std/Type.hx b/build/linux64_569e52e/std/Type.hx new file mode 100644 index 0000000..5d28f5c --- /dev/null +++ b/build/linux64_569e52e/std/Type.hx @@ -0,0 +1,295 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + The Haxe Reflection API allows retrieval of type information at runtime. + + This class complements the more lightweight Reflect class, with a focus on + class and enum instances. + + @see https://haxe.org/manual/types.html + @see https://haxe.org/manual/std-reflection.html +**/ +extern class Type { + /** + Returns the class of `o`, if `o` is a class instance. + + If `o` is null or of a different type, null is returned. + + In general, type parameter information cannot be obtained at runtime. + **/ + static function getClass(o:T):Null>; + + /** + Returns the enum of enum instance `o`. + + An enum instance is the result of using an enum constructor. Given an + `enum Color { Red; }`, `getEnum(Red)` returns `Enum`. + + If `o` is null, null is returned. + + In general, type parameter information cannot be obtained at runtime. + **/ + static function getEnum(o:EnumValue):Enum; + + /** + Returns the super-class of class `c`. + + If `c` has no super class, null is returned. + + If `c` is null, the result is unspecified. + + In general, type parameter information cannot be obtained at runtime. + **/ + static function getSuperClass(c:Class):Class; + + /** + Returns the name of class `c`, including its path. + + If `c` is inside a package, the package structure is returned dot- + separated, with another dot separating the class name: + `pack1.pack2.(...).packN.ClassName` + If `c` is a sub-type of a Haxe module, that module is not part of the + package structure. + + If `c` has no package, the class name is returned. + + If `c` is null, the result is unspecified. + + The class name does not include any type parameters. + **/ + static function getClassName(c:Class):String; + + /** + Returns the name of enum `e`, including its path. + + If `e` is inside a package, the package structure is returned dot- + separated, with another dot separating the enum name: + `pack1.pack2.(...).packN.EnumName` + If `e` is a sub-type of a Haxe module, that module is not part of the + package structure. + + If `e` has no package, the enum name is returned. + + If `e` is null, the result is unspecified. + + The enum name does not include any type parameters. + **/ + static function getEnumName(e:Enum):String; + + /** + Resolves a class by name. + + If `name` is the path of an existing class, that class is returned. + + Otherwise null is returned. + + If `name` is null or the path to a different type, the result is + unspecified. + + The class name must not include any type parameters. + **/ + static function resolveClass(name:String):Class; + + /** + Resolves an enum by name. + + If `name` is the path of an existing enum, that enum is returned. + + Otherwise null is returned. + + If `name` is null the result is unspecified. + + If `name` is the path to a different type, null is returned. + + The enum name must not include any type parameters. + **/ + static function resolveEnum(name:String):Enum; + + /** + Creates an instance of class `cl`, using `args` as arguments to the + class constructor. + + This function guarantees that the class constructor is called. + + Default values of constructors arguments are not guaranteed to be + taken into account. + + If `cl` or `args` are null, or if the number of elements in `args` does + not match the expected number of constructor arguments, or if any + argument has an invalid type, or if `cl` has no own constructor, the + result is unspecified. + + In particular, default values of constructor arguments are not + guaranteed to be taken into account. + **/ + static function createInstance(cl:Class, args:Array):T; + + /** + Creates an instance of class `cl`. + + This function guarantees that the class constructor is not called. + + If `cl` is null, the result is unspecified. + **/ + static function createEmptyInstance(cl:Class):T; + + /** + Creates an instance of enum `e` by calling its constructor `constr` with + arguments `params`. + + If `e` or `constr` is null, or if enum `e` has no constructor named + `constr`, or if the number of elements in `params` does not match the + expected number of constructor arguments, or if any argument has an + invalid type, the result is unspecified. + **/ + static function createEnum(e:Enum, constr:String, ?params:Array):T; + + /** + Creates an instance of enum `e` by calling its constructor number + `index` with arguments `params`. + + The constructor indices are preserved from Haxe syntax, so the first + declared is index 0, the next index 1 etc. + + If `e` or `constr` is null, or if enum `e` has no constructor named + `constr`, or if the number of elements in `params` does not match the + expected number of constructor arguments, or if any argument has an + invalid type, the result is unspecified. + **/ + static function createEnumIndex(e:Enum, index:Int, ?params:Array):T; + + /** + Returns a list of the instance fields of class `c`, including + inherited fields. + + This only includes fields which are known at compile-time. In + particular, using `getInstanceFields(getClass(obj))` will not include + any fields which were added to `obj` at runtime. + + The order of the fields in the returned Array is unspecified. + + If `c` is null, the result is unspecified. + **/ + static function getInstanceFields(c:Class):Array; + + /** + Returns a list of static fields of class `c`. + + This does not include static fields of parent classes. + + The order of the fields in the returned Array is unspecified. + + If `c` is null, the result is unspecified. + **/ + static function getClassFields(c:Class):Array; + + /** + Returns a list of the names of all constructors of enum `e`. + + The order of the constructor names in the returned Array is preserved + from the original syntax. + + If `e` is null, the result is unspecified. + **/ + static function getEnumConstructs(e:Enum):Array; + + /** + Returns the runtime type of value `v`. + + The result corresponds to the type `v` has at runtime, which may vary + per platform. Assumptions regarding this should be minimized to avoid + surprises. + **/ + static function typeof(v:Dynamic):ValueType; + + /** + Recursively compares two enum instances `a` and `b` by value. + + Unlike `a == b`, this function performs a deep equality check on the + arguments of the constructors, if exists. + + If `a` or `b` are null, the result is unspecified. + **/ + static function enumEq(a:T, b:T):Bool; + + /** + Returns the constructor name of enum instance `e`. + + The result String does not contain any constructor arguments. + + If `e` is null, the result is unspecified. + **/ + static function enumConstructor(e:EnumValue):String; + + /** + Returns a list of the constructor arguments of enum instance `e`. + + If `e` has no arguments, the result is []. + + Otherwise the result are the values that were used as arguments to `e`, + in the order of their declaration. + + If `e` is null, the result is unspecified. + **/ + static function enumParameters(e:EnumValue):Array; + + /** + Returns the index of enum instance `e`. + + This corresponds to the original syntactic position of `e`. The index of + the first declared constructor is 0, the next one is 1 etc. + + If `e` is null, the result is unspecified. + **/ + static function enumIndex(e:EnumValue):Int; + + /** + Returns a list of all constructors of enum `e` that require no + arguments. + + This may return the empty Array `[]` if all constructors of `e` require + arguments. + + Otherwise an instance of `e` constructed through each of its non- + argument constructors is returned, in the order of the constructor + declaration. + + If `e` is null, the result is unspecified. + **/ + static function allEnums(e:Enum):Array; +} + +/** + The different possible runtime types of a value. +**/ +enum ValueType { + TNull; + TInt; + TFloat; + TBool; + TObject; + TFunction; + TClass(c:Class); + TEnum(e:Enum); + TUnknown; +} diff --git a/build/linux64_569e52e/std/UInt.hx b/build/linux64_569e52e/std/UInt.hx new file mode 100644 index 0000000..862fd74 --- /dev/null +++ b/build/linux64_569e52e/std/UInt.hx @@ -0,0 +1,321 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +#if ((flash || flash9doc || hl) && !doc_gen) +/** + The unsigned `Int` type is only defined for Flash. It's currently + handled the same as a normal Int. + + @see https://haxe.org/manual/types-basic-types.html +**/ +@:coreType +@:notNull +@:runtimeValue +@:analyzer(no_const_propagation) +abstract UInt to Int from Int { + @:commutative @:op(A + B) private static function addI(lhs:UInt, rhs:Int):UInt; + + @:commutative @:op(A + B) private static function addF(lhs:UInt, rhs:Float):Float; + + @:op(A + B) private static function add(lhs:UInt, rhs:UInt):UInt; + + @:commutative @:op(A * B) private static function mulI(lhs:UInt, rhs:Int):UInt; + + @:commutative @:op(A * B) private static function mulF(lhs:UInt, rhs:Float):Float; + + @:op(A * B) private static function mul(lhs:UInt, rhs:UInt):UInt; + + @:op(A % B) private static function modI(lhs:UInt, rhs:Int):UInt; + + @:op(A % B) private static function modF(lhs:UInt, rhs:Float):Float; + + @:op(A % B) private static function mod(lhs:UInt, rhs:UInt):UInt; + + @:op(A - B) private static function subI(lhs:UInt, rhs:Int):UInt; + + @:op(A - B) private static function subF(lhs:UInt, rhs:Float):Float; + + @:op(A - B) private static function sub(lhs:UInt, rhs:UInt):UInt; + + @:op(A / B) private static function divI(lhs:UInt, rhs:Int):Float; + + @:op(A / B) private static function divF(lhs:UInt, rhs:Float):Float; + + @:op(A / B) private static function div(lhs:UInt, rhs:UInt):Float; + + @:commutative @:op(A | B) private static function orI(lhs:UInt, rhs:Int):UInt; + + @:op(A | B) private static function or(lhs:UInt, rhs:UInt):UInt; + + @:commutative @:op(A ^ B) private static function xorI(lhs:UInt, rhs:Int):UInt; + + @:op(A ^ B) private static function xor(lhs:UInt, rhs:UInt):UInt; + + @:commutative @:op(A & B) private static function andI(lhs:UInt, rhs:Int):UInt; + + @:op(A & B) private static function and(lhs:UInt, rhs:UInt):UInt; + + @:op(A << B) private static function shl(lhs:UInt, rhs:Int):UInt; + + @:op(A >> B) private static inline function shr(lhs:UInt, rhs:Int):UInt + return lhs >>> rhs; + + @:op(A >>> B) private static function ushr(lhs:UInt, rhs:Int):UInt; + + @:op(A > B) private static function gt(lhs:UInt, rhs:UInt):Bool; + + @:op(A >= B) private static function gte(lhs:UInt, rhs:UInt):Bool; + + @:op(A < B) private static function lt(lhs:UInt, rhs:UInt):Bool; + + @:op(A <= B) private static function lte(lhs:UInt, rhs:UInt):Bool; + + @:op(A > B) private static function gtf(lhs:UInt, rhs:Float):Bool; + + @:op(A > B) private static function gtf2(lhs:Float, rhs:UInt):Bool; + + @:op(A >= B) private static function gtef(lhs:UInt, rhs:Float):Bool; + + @:op(A >= B) private static function gtef2(lhs:Float, rhs:UInt):Bool; + + @:op(A < B) private static function ltf(lhs:UInt, rhs:Float):Bool; + + @:op(A < B) private static function ltf2(lhs:Float, rhs:UInt):Bool; + + @:op(A <= B) private static function ltef(lhs:UInt, rhs:Float):Bool; + + @:op(A <= B) private static function ltef2(lhs:Float, rhs:UInt):Bool; + + @:op(~A) private static function bneg(t:UInt):UInt; + + @:commutative @:op(A == B) private static function equalsInt(a:UInt, b:T):Bool; + + @:commutative @:op(A != B) private static function notEqualsInt(a:UInt, b:T):Bool; + + @:commutative @:op(A == B) private static function equalsFloat(a:UInt, b:T):Bool; + + @:commutative @:op(A != B) private static function notEqualsFloat(a:UInt, b:T):Bool; + + @:op(++A) private function prefixIncrement():UInt; + + @:op(A++) private function postfixIncrement():UInt; + + @:op(--A) private function prefixDecrement():UInt; + + @:op(A--) private function postfixDecrement():UInt; +} +#else + +/** + The unsigned `Int` type is only defined for Flash. + Simulate it for other platforms. + + @see https://haxe.org/manual/types-basic-types.html +**/ +@:transitive +abstract UInt(Int) from Int to Int { + @:op(A + B) private static inline function add(a:UInt, b:UInt):UInt { + return a.toInt() + b.toInt(); + } + + @:op(A / B) private static inline function div(a:UInt, b:UInt):Float { + return a.toFloat() / b.toFloat(); + } + + @:op(A * B) private static inline function mul(a:UInt, b:UInt):UInt { + return a.toInt() * b.toInt(); + } + + @:op(A - B) private static inline function sub(a:UInt, b:UInt):UInt { + return a.toInt() - b.toInt(); + } + + @:op(A > B) + private static #if !js inline #end function gt(a:UInt, b:UInt):Bool { + var aNeg = a.toInt() < 0; + var bNeg = b.toInt() < 0; + return if (aNeg != bNeg) aNeg; else a.toInt() > b.toInt(); + } + + @:op(A >= B) + private static #if !js inline #end function gte(a:UInt, b:UInt):Bool { + var aNeg = a.toInt() < 0; + var bNeg = b.toInt() < 0; + return if (aNeg != bNeg) aNeg; else a.toInt() >= b.toInt(); + } + + @:op(A < B) private static inline function lt(a:UInt, b:UInt):Bool { + return gt(b, a); + } + + @:op(A <= B) private static inline function lte(a:UInt, b:UInt):Bool { + return gte(b, a); + } + + @:op(A & B) private static inline function and(a:UInt, b:UInt):UInt { + return a.toInt() & b.toInt(); + } + + @:op(A | B) private static inline function or(a:UInt, b:UInt):UInt { + return a.toInt() | b.toInt(); + } + + @:op(A ^ B) private static inline function xor(a:UInt, b:UInt):UInt { + return a.toInt() ^ b.toInt(); + } + + @:op(A << B) private static inline function shl(a:UInt, b:Int):UInt { + return a.toInt() << b; + } + + @:op(A >> B) private static inline function shr(a:UInt, b:Int):UInt { + return a.toInt() >>> b; + } + + @:op(A >>> B) private static inline function ushr(a:UInt, b:Int):UInt { + return a.toInt() >>> b; + } + + @:op(A % B) private static inline function mod(a:UInt, b:UInt):UInt { + return Std.int(a.toFloat() % b.toFloat()); + } + + @:commutative @:op(A + B) private static inline function addWithFloat(a:UInt, b:Float):Float { + return a.toFloat() + b; + } + + @:commutative @:op(A * B) private static inline function mulWithFloat(a:UInt, b:Float):Float { + return a.toFloat() * b; + } + + @:op(A / B) private static inline function divFloat(a:UInt, b:Float):Float { + return a.toFloat() / b; + } + + @:op(A / B) private static inline function floatDiv(a:Float, b:UInt):Float { + return a / b.toFloat(); + } + + @:op(A - B) private static inline function subFloat(a:UInt, b:Float):Float { + return a.toFloat() - b; + } + + @:op(A - B) private static inline function floatSub(a:Float, b:UInt):Float { + return a - b.toFloat(); + } + + @:op(A > B) private static inline function gtFloat(a:UInt, b:Float):Bool { + return a.toFloat() > b; + } + + @:commutative @:op(A == B) private static inline function equalsInt(a:UInt, b:T):Bool { + return a.toInt() == b; + } + + @:commutative @:op(A != B) private static inline function notEqualsInt(a:UInt, b:T):Bool { + return a.toInt() != b; + } + + @:commutative @:op(A == B) private static inline function equalsFloat(a:UInt, b:T):Bool { + return a.toFloat() == b; + } + + @:commutative @:op(A != B) private static inline function notEqualsFloat(a:UInt, b:T):Bool { + return a.toFloat() != b; + } + + @:op(A >= B) private static inline function gteFloat(a:UInt, b:Float):Bool { + return a.toFloat() >= b; + } + + @:op(A > B) private static inline function floatGt(a:Float, b:UInt):Bool { + return a > b.toFloat(); + } + + @:op(A >= B) private static inline function floatGte(a:Float, b:UInt):Bool { + return a >= b.toFloat(); + } + + @:op(A < B) private static inline function ltFloat(a:UInt, b:Float):Bool { + return a.toFloat() < b; + } + + @:op(A <= B) private static inline function lteFloat(a:UInt, b:Float):Bool { + return a.toFloat() <= b; + } + + @:op(A < B) private static inline function floatLt(a:Float, b:UInt):Bool { + return a < b.toFloat(); + } + + @:op(A <= B) private static inline function floatLte(a:Float, b:UInt):Bool { + return a <= b.toFloat(); + } + + @:op(A % B) private static inline function modFloat(a:UInt, b:Float):Float { + return a.toFloat() % b; + } + + @:op(A % B) private static inline function floatMod(a:Float, b:UInt):Float { + return a % b.toFloat(); + } + + @:op(~A) private inline function negBits():UInt { + return ~this; + } + + @:op(++A) private inline function prefixIncrement():UInt { + return ++this; + } + + @:op(A++) private inline function postfixIncrement():UInt { + return this++; + } + + @:op(--A) private inline function prefixDecrement():UInt { + return --this; + } + + @:op(A--) private inline function postfixDecrement():UInt { + return this--; + } + + // TODO: radix is just defined to deal with doc_gen issues + private inline function toString(?radix:Int):String { + return Std.string(toFloat()); + } + + private inline function toInt():Int { + return this; + } + + @:to private #if (!js || analyzer) inline #end function toFloat():Float { + var int = toInt(); + if (int < 0) { + return 4294967296.0 + int; + } else { + // + 0.0 here to make sure we promote to Float on some platforms + // In particular, PHP was having issues when comparing to Int in the == op. + return int + 0.0; + } + } +} +#end diff --git a/build/linux64_569e52e/std/UnicodeString.hx b/build/linux64_569e52e/std/UnicodeString.hx new file mode 100644 index 0000000..7024684 --- /dev/null +++ b/build/linux64_569e52e/std/UnicodeString.hx @@ -0,0 +1,440 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +import haxe.io.Bytes; +import haxe.io.Encoding; +import haxe.iterators.StringIteratorUnicode; +import haxe.iterators.StringKeyValueIteratorUnicode; + +/** + This abstract provides consistent cross-target unicode support for characters of any width. + + Due to differing internal representations of strings across targets, only the basic + multilingual plane (BMP) is supported consistently by `String` class. + + This abstract provides API to consistently handle all characters even beyond BMP. + + @see https://haxe.org/manual/std-String-unicode.html +**/ +@:forward +@:access(StringTools) +abstract UnicodeString(String) from String to String { + /** + Tells if `b` is a correctly encoded UTF8 byte sequence. + **/ + static public function validate(b:Bytes, encoding:Encoding):Bool { + switch (encoding) { + case RawNative: + throw "UnicodeString.validate: RawNative encoding is not supported"; + case UTF8: + var data = b.getData(); + var pos = 0; + var max = b.length; + while (pos < max) { + var c:Int = Bytes.fastGet(data, pos++); + if (c < 0x80) {} else if (c < 0xC2) { + return false; + } else if (c < 0xE0) { + if (pos + 1 > max) { + return false; + } + var c2:Int = Bytes.fastGet(data, pos++); + if (c2 < 0x80 || c2 > 0xBF) { + return false; + } + } else if (c < 0xF0) { + if (pos + 2 > max) { + return false; + } + var c2:Int = Bytes.fastGet(data, pos++); + if (c == 0xE0) { + if (c2 < 0xA0 || c2 > 0xBF) + return false; + } else { + if (c2 < 0x80 || c2 > 0xBF) + return false; + } + var c3:Int = Bytes.fastGet(data, pos++); + if (c3 < 0x80 || c3 > 0xBF) { + return false; + } + c = (c << 16) | (c2 << 8) | c3; + if (0xEDA080 <= c && c <= 0xEDBFBF) { // surrogate pairs + return false; + } + } else if (c > 0xF4) { + return false; + } else { + if (pos + 3 > max) { + return false; + } + var c2:Int = Bytes.fastGet(data, pos++); + if (c == 0xF0) { + if (c2 < 0x90 || c2 > 0xBF) + return false; + } else if (c == 0xF4) { + if (c2 < 0x80 || c2 > 0x8F) + return false; + } else { + if (c2 < 0x80 || c2 > 0xBF) + return false; + } + var c3:Int = Bytes.fastGet(data, pos++); + if (c3 < 0x80 || c3 > 0xBF) { + return false; + } + var c4:Int = Bytes.fastGet(data, pos++); + if (c4 < 0x80 || c4 > 0xBF) { + return false; + } + } + } + return true; + } + } + + #if target.unicode + /** + Creates an instance of UnicodeString. + **/ + public inline function new(string:String):Void { + this = string; + } + + /** + Returns an iterator of the unicode code points. + **/ + public inline function iterator():StringIteratorUnicode { + return new StringIteratorUnicode(this); + } + + /** + Returns an iterator of the code point indices and unicode code points. + **/ + public inline function keyValueIterator():StringKeyValueIteratorUnicode { + return new StringKeyValueIteratorUnicode(this); + } + + #if target.utf16 + /** + The number of characters in `this` String. + **/ + public var length(get, never):Int; + + /** + Returns the character at position `index` of `this` String. + + If `index` is negative or exceeds `this.length`, the empty String `""` + is returned. + **/ + public function charAt(index:Int):String { + if (index < 0) + return ''; + var unicodeOffset = 0; + var nativeOffset = 0; + while (nativeOffset < this.length) { + var c = StringTools.utf16CodePointAt(this, nativeOffset++); + if (unicodeOffset == index) { + return String.fromCharCode(c); + } + if (c >= StringTools.MIN_SURROGATE_CODE_POINT) { + nativeOffset++; + } + unicodeOffset++; + } + return ''; + } + + /** + Returns the character code at position `index` of `this` String. + + If `index` is negative or exceeds `this.length`, `null` is returned. + **/ + public function charCodeAt(index:Int):Null { + if (index < 0) + return null; + var unicodeOffset = 0; + var nativeOffset = 0; + while (nativeOffset < this.length) { + var c = StringTools.utf16CodePointAt(this, nativeOffset++); + if (unicodeOffset == index) { + return c; + } + if (c >= StringTools.MIN_SURROGATE_CODE_POINT) { + nativeOffset++; + } + unicodeOffset++; + } + return null; + } + + /** + @see String.indexOf + **/ + public function indexOf(str:String, ?startIndex:Int):Int { + var startIndex:Int = if (startIndex == null || startIndex < 0) { + 0; + } else { + startIndex; + } + if (str.length == 0) { + if (startIndex > length) { + return length; + } + return startIndex; + } + + var unicodeOffset = 0; + var nativeOffset = 0; + var matchingOffset = 0; + var result = -1; + while (nativeOffset <= this.length) { + var c = StringTools.utf16CodePointAt(this, nativeOffset); + + if (unicodeOffset >= startIndex) { + var c2 = StringTools.utf16CodePointAt(str, matchingOffset); + if (c == c2) { + if (matchingOffset == 0) { + result = unicodeOffset; + } + matchingOffset++; + if (c2 >= StringTools.MIN_SURROGATE_CODE_POINT) { + matchingOffset++; + } + if (matchingOffset == str.length) { + return result; + } + } else if (matchingOffset != 0) { + result = -1; + matchingOffset = 0; + continue; + } + } + + nativeOffset++; + if (c >= StringTools.MIN_SURROGATE_CODE_POINT) { + nativeOffset++; + } + unicodeOffset++; + } + return -1; + } + + /** + Returns the position of the rightmost occurrence of `str` within `this` + String. + + If `startIndex` is given, the search is performed within the substring + of `this` String from 0 to `startIndex + str.length`. Otherwise the search + is performed within `this` String. In either case, the returned position + is relative to the beginning of `this` String. + + If `str` cannot be found, -1 is returned. + **/ + public function lastIndexOf(str:String, ?startIndex:Int):Int { + if (startIndex == null) { + startIndex = this.length; + } else if (startIndex < 0) { + startIndex = 0; + } + + var unicodeOffset = 0; + var nativeOffset = 0; + var result = -1; + var lastIndex = -1; + var matchingOffset = 0; + var strUnicodeLength = (str : UnicodeString).length; + while (nativeOffset < this.length && unicodeOffset < startIndex + strUnicodeLength) { + var c = StringTools.utf16CodePointAt(this, nativeOffset); + + var c2 = StringTools.utf16CodePointAt(str, matchingOffset); + if (c == c2) { + if (matchingOffset == 0) { + lastIndex = unicodeOffset; + } + matchingOffset++; + if (c2 >= StringTools.MIN_SURROGATE_CODE_POINT) { + matchingOffset++; + } + if (matchingOffset == str.length) { + result = lastIndex; + lastIndex = -1; + } + } else if (matchingOffset != 0) { + lastIndex = -1; + matchingOffset = 0; + continue; + } + + nativeOffset++; + if (c >= StringTools.MIN_SURROGATE_CODE_POINT) { + nativeOffset++; + } + unicodeOffset++; + } + return result; + } + + /** + Returns `len` characters of `this` String, starting at position `pos`. + + If `len` is omitted, all characters from position `pos` to the end of + `this` String are included. + + If `pos` is negative, its value is calculated from the end of `this` + String by `this.length + pos`. If this yields a negative value, 0 is + used instead. + + If the calculated position + `len` exceeds `this.length`, the characters + from that position to the end of `this` String are returned. + + If `len` is negative, the result is unspecified. + **/ + public function substr(pos:Int, ?len:Int):String { + if (pos < 0) { + pos = (this : UnicodeString).length + pos; + if (pos < 0) { + pos = 0; + } + } + if (len != null) { + if (len < 0) { + len = (this : UnicodeString).length + len; + } + if (len <= 0) { + return ""; + } + } + var unicodeOffset = 0; + var nativeOffset = 0; + var fromOffset = -1; + var subLength = 0; + while (nativeOffset < this.length) { + var c = StringTools.utf16CodePointAt(this, nativeOffset); + + if (unicodeOffset >= pos) { + if (fromOffset < 0) { + if (len == null) { + return this.substr(nativeOffset); + } + fromOffset = nativeOffset; + } + subLength++; + if (subLength >= len) { + var lastOffset = (c < StringTools.MIN_SURROGATE_CODE_POINT ? nativeOffset : nativeOffset + 1); + return this.substr(fromOffset, lastOffset - fromOffset + 1); + } + } + + nativeOffset += (c >= StringTools.MIN_SURROGATE_CODE_POINT ? 2 : 1); + unicodeOffset++; + } + return (fromOffset < 0 ? "" : this.substr(fromOffset)); + } + + /** + Returns the part of `this` String from `startIndex` to but not including `endIndex`. + + If `startIndex` or `endIndex` are negative, 0 is used instead. + + If `startIndex` exceeds `endIndex`, they are swapped. + + If the (possibly swapped) `endIndex` is omitted or exceeds + `this.length`, `this.length` is used instead. + + If the (possibly swapped) `startIndex` exceeds `this.length`, the empty + String `""` is returned. + **/ + public function substring(startIndex:Int, ?endIndex:Int):String { + if (startIndex < 0) { + startIndex = 0; + } + if (endIndex != null) { + if (endIndex < 0) { + endIndex = 0; + } + if (startIndex == endIndex) { + return ""; + } + if (startIndex > endIndex) { + var tmp = startIndex; + startIndex = endIndex; + endIndex = tmp; + } + } + + var unicodeOffset = 0; + var nativeOffset = 0; + var fromOffset = -1; + var subLength = 0; + while (nativeOffset < this.length) { + var c = StringTools.utf16CodePointAt(this, nativeOffset); + + if (startIndex <= unicodeOffset) { + if (fromOffset < 0) { + if (endIndex == null) { + return this.substr(nativeOffset); + } + fromOffset = nativeOffset; + } + subLength++; + if (subLength >= endIndex - startIndex) { + var lastOffset = (c < StringTools.MIN_SURROGATE_CODE_POINT ? nativeOffset : nativeOffset + 1); + return this.substr(fromOffset, lastOffset - fromOffset + 1); + } + } + + nativeOffset += (c >= StringTools.MIN_SURROGATE_CODE_POINT ? 2 : 1); + unicodeOffset++; + } + return (fromOffset < 0 ? "" : this.substr(fromOffset)); + } + + function get_length():Int { + var l = 0; + for (c in new StringIteratorUnicode(this)) { + l++; + } + return l; + } + #end + #end + @:op(A < B) static function lt(a:UnicodeString, b:UnicodeString):Bool; + + @:op(A <= B) static function lte(a:UnicodeString, b:UnicodeString):Bool; + + @:op(A > B) static function gt(a:UnicodeString, b:UnicodeString):Bool; + + @:op(A >= B) static function gte(a:UnicodeString, b:UnicodeString):Bool; + + @:op(A == B) static function eq(a:UnicodeString, b:UnicodeString):Bool; + + @:op(A != B) static function neq(a:UnicodeString, b:UnicodeString):Bool; + + @:op(A + B) static function add(a:UnicodeString, b:UnicodeString):UnicodeString; + + @:op(A += B) static function assignAdd(a:UnicodeString, b:UnicodeString):UnicodeString; + + @:op(A + B) @:commutative static function addString(a:UnicodeString, b:String):UnicodeString; + + @:op(A += B) @:commutative static function assignAddString(a:UnicodeString, b:String):UnicodeString; +} diff --git a/build/linux64_569e52e/std/Xml.hx b/build/linux64_569e52e/std/Xml.hx new file mode 100644 index 0000000..e9ac618 --- /dev/null +++ b/build/linux64_569e52e/std/Xml.hx @@ -0,0 +1,408 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + Xml node types. + + @see https://haxe.org/manual/std-Xml.html +**/ +enum abstract XmlType(Int) { + /** + Represents an XML element type. + **/ + var Element = 0; + + /** + Represents XML parsed character data type. + **/ + var PCData = 1; + + /** + Represents XML character data type. + **/ + var CData = 2; + + /** + Represents an XML comment type. + **/ + var Comment = 3; + + /** + Represents an XML doctype element type. + **/ + var DocType = 4; + + /** + Represents an XML processing instruction type. + **/ + var ProcessingInstruction = 5; + + /** + Represents an XML document type. + **/ + var Document = 6; + + public function toString():String { + return switch (cast this : XmlType) { + case Element: "Element"; + case PCData: "PCData"; + case CData: "CData"; + case Comment: "Comment"; + case DocType: "DocType"; + case ProcessingInstruction: "ProcessingInstruction"; + case Document: "Document"; + }; + } +} + +/** + Cross-platform Xml API. + + @see https://haxe.org/manual/std-Xml.html +**/ +class Xml { + /** + XML element type. + **/ + static public var Element(default, never) = XmlType.Element; + + /** + XML parsed character data type. + **/ + static public var PCData(default, never) = XmlType.PCData; + + /** + XML character data type. + **/ + static public var CData(default, never) = XmlType.CData; + + /** + XML comment type. + **/ + static public var Comment(default, never) = XmlType.Comment; + + /** + XML doctype element type. + **/ + static public var DocType(default, never) = XmlType.DocType; + + /** + XML processing instruction type. + **/ + static public var ProcessingInstruction(default, never) = XmlType.ProcessingInstruction; + + /** + XML document type. + **/ + static public var Document(default, never) = XmlType.Document; + + /** + Parses the String into an Xml document. + **/ + static public function parse(str:String):Xml { + return haxe.xml.Parser.parse(str); + } + + /** + Returns the type of the Xml Node. This should be used before + accessing other functions since some might raise an exception + if the node type is not correct. + **/ + public var nodeType(default, null):XmlType; + + /** + Returns the node name of an Element. + **/ + @:isVar public var nodeName(get, set):String; + + /** + Returns the node value. Only works if the Xml node is not an Element or a Document. + **/ + @:isVar public var nodeValue(get, set):String; + + /** + Returns the parent object in the Xml hierarchy. + The parent can be `null`, an Element or a Document. + **/ + public var parent(default, null):Xml; + + var children:Array; + var attributeMap:Map; + + #if !cppia inline #end function get_nodeName() { + if (nodeType != Element) { + throw 'Bad node type, expected Element but found $nodeType'; + } + return nodeName; + } + + #if !cppia inline #end function set_nodeName(v) { + if (nodeType != Element) { + throw 'Bad node type, expected Element but found $nodeType'; + } + return this.nodeName = v; + } + + #if !cppia inline #end function get_nodeValue() { + if (nodeType == Document || nodeType == Element) { + throw 'Bad node type, unexpected $nodeType'; + } + return nodeValue; + } + + #if !cppia inline #end function set_nodeValue(v) { + if (nodeType == Document || nodeType == Element) { + throw 'Bad node type, unexpected $nodeType'; + } + return this.nodeValue = v; + } + + /** + Creates a node of the given type. + **/ + static public function createElement(name:String):Xml { + var xml = new Xml(Element); + xml.nodeName = name; + return xml; + } + + /** + Creates a node of the given type. + **/ + static public function createPCData(data:String):Xml { + var xml = new Xml(PCData); + xml.nodeValue = data; + return xml; + } + + /** + Creates a node of the given type. + **/ + static public function createCData(data:String):Xml { + var xml = new Xml(CData); + xml.nodeValue = data; + return xml; + } + + /** + Creates a node of the given type. + **/ + static public function createComment(data:String):Xml { + var xml = new Xml(Comment); + xml.nodeValue = data; + return xml; + } + + /** + Creates a node of the given type. + **/ + static public function createDocType(data:String):Xml { + var xml = new Xml(DocType); + xml.nodeValue = data; + return xml; + } + + /** + Creates a node of the given type. + **/ + static public function createProcessingInstruction(data:String):Xml { + var xml = new Xml(ProcessingInstruction); + xml.nodeValue = data; + return xml; + } + + /** + Creates a node of the given type. + **/ + static public function createDocument():Xml { + return new Xml(Document); + } + + /** + Get the given attribute of an Element node. Returns `null` if not found. + Attributes are case-sensitive. + **/ + public function get(att:String):String { + if (nodeType != Element) { + throw 'Bad node type, expected Element but found $nodeType'; + } + return attributeMap[att]; + } + + /** + Set the given attribute value for an Element node. + Attributes are case-sensitive. + **/ + public function set(att:String, value:String):Void { + if (nodeType != Element) { + throw 'Bad node type, expected Element but found $nodeType'; + } + attributeMap.set(att, value); + } + + /** + Removes an attribute for an Element node. + Attributes are case-sensitive. + **/ + public function remove(att:String):Void { + if (nodeType != Element) { + throw 'Bad node type, expected Element but found $nodeType'; + } + attributeMap.remove(att); + } + + /** + Tells if the Element node has a given attribute. + Attributes are case-sensitive. + **/ + public function exists(att:String):Bool { + if (nodeType != Element) { + throw 'Bad node type, expected Element but found $nodeType'; + } + return attributeMap.exists(att); + } + + /** + Returns an `Iterator` on all the attribute names. + **/ + public function attributes():Iterator { + if (nodeType != Element) { + throw 'Bad node type, expected Element but found $nodeType'; + } + return attributeMap.keys(); + } + + /** + Returns an iterator of all child nodes. + Only works if the current node is an Element or a Document. + **/ + public #if !cppia inline #end function iterator():Iterator { + ensureElementType(); + return children.iterator(); + } + + /** + Returns an iterator of all child nodes which are Elements. + Only works if the current node is an Element or a Document. + **/ + public function elements():Iterator { + ensureElementType(); + var ret = [for (child in children) if (child.nodeType == Element) child]; + return ret.iterator(); + } + + /** + Returns an iterator of all child nodes which are Elements with the given nodeName. + Only works if the current node is an Element or a Document. + **/ + public function elementsNamed(name:String):Iterator { + ensureElementType(); + var ret = [ + for (child in children) + if (child.nodeType == Element && child.nodeName == name) child + ]; + return ret.iterator(); + } + + /** + Returns the first child node. + **/ + public #if !cppia inline #end function firstChild():Xml { + ensureElementType(); + return children[0]; + } + + /** + Returns the first child node which is an Element. + **/ + public function firstElement():Xml { + ensureElementType(); + for (child in children) { + if (child.nodeType == Element) { + return child; + } + } + return null; + } + + /** + Adds a child node to the Document or Element. + A child node can only be inside one given parent node, which is indicated by the `parent` property. + If the child is already inside this Document or Element, it will be moved to the last position among the Document or Element's children. + If the child node was previously inside a different node, it will be moved to this Document or Element. + **/ + public function addChild(x:Xml):Void { + ensureElementType(); + if (x.parent != null) { + x.parent.removeChild(x); + } + children.push(x); + x.parent = this; + } + + /** + Removes a child from the Document or Element. + Returns true if the child was successfuly removed. + **/ + public function removeChild(x:Xml):Bool { + ensureElementType(); + if (children.remove(x)) { + x.parent = null; + return true; + } + return false; + } + + /** + Inserts a child at the given position among the other childs. + A child node can only be inside one given parent node, which is indicated by the [parent] property. + If the child is already inside this Document or Element, it will be moved to the new position among the Document or Element's children. + If the child node was previously inside a different node, it will be moved to this Document or Element. + **/ + public function insertChild(x:Xml, pos:Int):Void { + ensureElementType(); + if (x.parent != null) { + x.parent.children.remove(x); + } + children.insert(pos, x); + x.parent = this; + } + + /** + Returns a String representation of the Xml node. + **/ + public #if !cppia inline #end function toString():String { + return haxe.xml.Printer.print(this); + } + + function new(nodeType:XmlType) { + this.nodeType = nodeType; + children = []; + attributeMap = new Map(); + } + + inline function ensureElementType() { + if (nodeType != Document && nodeType != Element) { + throw 'Bad node type, expected Element or Document but found $nodeType'; + } + } +} diff --git a/build/linux64_569e52e/std/cpp/ArrayBase.hx b/build/linux64_569e52e/std/cpp/ArrayBase.hx new file mode 100644 index 0000000..8f6e69c --- /dev/null +++ b/build/linux64_569e52e/std/cpp/ArrayBase.hx @@ -0,0 +1,31 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +extern class ArrayBase { + // Length is number of elements + var length(default, null):Int; + function getElementSize():Int; + function getByteCount():Int; + function getBase():RawPointer; +} diff --git a/build/linux64_569e52e/std/cpp/AtomicInt.hx b/build/linux64_569e52e/std/cpp/AtomicInt.hx new file mode 100644 index 0000000..f84e866 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/AtomicInt.hx @@ -0,0 +1,44 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:scalar @:coreType +extern abstract AtomicInt from(Int) to(Int) { + /** + Returns true if exchange took place. + **/ + @:native("_hx_atomic_exchange_if") + public static function exchangeIf(ioValue:Pointer, test:Int, newVal:Int):Bool; + + /** + Returns value before increment. + **/ + @:native("_hx_atomic_inc") + public static function atomicInc(ioValue:Pointer):Int; + + /** + Returns value before decrement. + **/ + @:native("_hx_atomic_dec") + public static function atomicDec(ioValue:Pointer):Int; +} diff --git a/build/linux64_569e52e/std/cpp/AutoCast.hx b/build/linux64_569e52e/std/cpp/AutoCast.hx new file mode 100644 index 0000000..2a0900c --- /dev/null +++ b/build/linux64_569e52e/std/cpp/AutoCast.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +extern class AutoCast {} diff --git a/build/linux64_569e52e/std/cpp/Callable.hx b/build/linux64_569e52e/std/cpp/Callable.hx new file mode 100644 index 0000000..85fd050 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Callable.hx @@ -0,0 +1,72 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:noPackageRestrict @:callable +typedef CallableData = T; + +/** + The generator intercepts this type and converts it to a cpp.Function on cpp. +**/ +@:noPackageRestrict +@:callable +#if cpp +extern +#end +abstract Callable(CallableData) { + inline public function new(inValue:T) + this = inValue; + + public var call(get, never):CallableData; + + inline function get_call():CallableData + return this; + + #if cpp + @:from + inline static public function fromFunction(func:Function):Callable + return new Callable(cast func); + + @:to + inline public function toFunction():Function + return cast this; + + inline public static function getProcAddress(inModule:String, inFunction:String):Function + return Function.getProcAddress(inModule, inFunction); + + inline public static function fromStaticFunction(inStaticFunction:T):Callable + return Function.fromStaticFunction(inStaticFunction); + + inline public function lt(inOther:Callable):Bool + return toFunction().lt(inOther.toFunction()); + + inline public function leq(inOther:Callable):Bool + return toFunction().leq(inOther.toFunction()); + + inline public function gt(inOther:Callable):Bool + return toFunction().gt(inOther.toFunction()); + + inline public function geq(inOther:Callable):Bool + return toFunction().geq(inOther.toFunction()); + #end +} diff --git a/build/linux64_569e52e/std/cpp/CastCharStar.hx b/build/linux64_569e52e/std/cpp/CastCharStar.hx new file mode 100644 index 0000000..dc78863 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/CastCharStar.hx @@ -0,0 +1,36 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +abstract CastCharStar(RawPointer) to(RawPointer) { + inline function new(s:String) + this = cast untyped s.__s; + + @:from + static public inline function fromString(s:String) + return new CastCharStar(s); + + @:to + public inline function toPointer() + return this; +} diff --git a/build/linux64_569e52e/std/cpp/Char.hx b/build/linux64_569e52e/std/cpp/Char.hx new file mode 100644 index 0000000..dec9d88 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Char.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:coreType @:notNull @:runtimeValue abstract Char from Int to Int {} diff --git a/build/linux64_569e52e/std/cpp/ConstCharStar.hx b/build/linux64_569e52e/std/cpp/ConstCharStar.hx new file mode 100644 index 0000000..04d3268 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/ConstCharStar.hx @@ -0,0 +1,38 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +extern abstract ConstCharStar(RawConstPointer) to(RawConstPointer) { + inline function new(s:String) + this = untyped s.__s; + + @:from + static public inline function fromString(s:String):ConstCharStar + return new ConstCharStar(s); + + @:to extern public inline function toString():String + return new String(untyped this); + + @:to extern public inline function toPointer():RawConstPointer + return this; +} diff --git a/build/linux64_569e52e/std/cpp/ConstPointer.hx b/build/linux64_569e52e/std/cpp/ConstPointer.hx new file mode 100644 index 0000000..9342f30 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/ConstPointer.hx @@ -0,0 +1,71 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:coreType @:include("cpp/Pointer.h") @:native("cpp.Pointer") @:semantics(variable) +extern class ConstPointer { + // ptr actually returns the pointer - not strictly a 'T' - for pointers to smart pointers + // Use value or ref to get dereferenced value + var ptr:Star; + + var value(get, never):T; + + // Typecast to non-const + var raw(get, never):RawPointer; + + // const version + var constRaw(get, never):RawConstPointer; + + function get_value():Reference; + + function get_constRaw():RawConstPointer; + function get_raw():RawPointer; + + function lt(inOther:ConstPointer):Bool; + function leq(inOther:ConstPointer):Bool; + function gt(inOther:ConstPointer):Bool; + function geq(inOther:ConstPointer):Bool; + + function setRaw(ptr:RawPointer):Void; + + static function fromRaw(ptr:RawConstPointer):ConstPointer; + + @:native("::cpp::Pointer_obj::fromRaw") + static function fromStar(star:Star):ConstPointer; + + static function fromPointer(inNativePointer:Dynamic):ConstPointer; + + function reinterpret():Pointer; + + function rawCast():RawPointer; + + function at(inIndex:Int):Reference; + + function inc():ConstPointer; + function dec():ConstPointer; + function incBy(inT:Int):ConstPointer; + function decBy(inT:Int):ConstPointer; + function add(inT:Int):ConstPointer; + function sub(inT:Int):ConstPointer; + function postIncVal():Reference; +} diff --git a/build/linux64_569e52e/std/cpp/ConstStar.hx b/build/linux64_569e52e/std/cpp/ConstStar.hx new file mode 100644 index 0000000..b99fe00 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/ConstStar.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +/** + Allows haxe to type the result correctly, and hxcpp can recognise this uses + the correct type. +**/ +typedef ConstStar = Null; diff --git a/build/linux64_569e52e/std/cpp/EnumBase.hx b/build/linux64_569e52e/std/cpp/EnumBase.hx new file mode 100644 index 0000000..dfd977a --- /dev/null +++ b/build/linux64_569e52e/std/cpp/EnumBase.hx @@ -0,0 +1,60 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:native("hx.EnumBase") +extern class EnumBase { + #if (hxcpp_api_level >= 330) + function _hx_getIndex():Int; + function _hx_getTag():String; + function _hx_getParamCount():Int; + function _hx_getParamI(inIndex:Int):Dynamic; + function _hx_getParameters():Array; + + inline function getIndex():Int + return _hx_getIndex(); + inline function getTag():String + return _hx_getTag(); + inline function getParamCount():Int + return _hx_getParamCount(); + inline function getParamI(inIndex:Int):Dynamic + return _hx_getParamI(inIndex); + inline function getParameters():Array + return _hx_getParameters(); + #else + function __EnumParams():Array; + function __Tag():String; + function __Index():Int; + + inline function _hx_getIndex():Int + return untyped __Index(); + inline function _hx_getTag():String + return untyped __Tag(); + inline function _hx_getParamCount():Int + return untyped __EnumParams() == null ? 0 : __EnumParams().length; + inline function _hx_getParamI(inIndex:Int):Dynamic + return untyped __EnumParams()[inIndex]; + inline function _hx_getParameters():Array + return __EnumParams() == null ? [] : __EnumParams(); + #end +} diff --git a/build/linux64_569e52e/std/cpp/ErrorConstants.hx b/build/linux64_569e52e/std/cpp/ErrorConstants.hx new file mode 100644 index 0000000..0ea1fba --- /dev/null +++ b/build/linux64_569e52e/std/cpp/ErrorConstants.hx @@ -0,0 +1,40 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +extern class ErrorConstants { + @:native("HX_INVALID_CAST") + static var invalidCast:Dynamic; + + @:native("HX_INDEX_OUT_OF_BOUNDS") + static var indexOutOfBounds:Dynamic; + + @:native("HX_INVALID_OBJECT") + static var invalidObject:Dynamic; + + @:native("HX_INVALID_ARG_COUNT") + static var invalidArgCount:Dynamic; + + @:native("HX_NULL_FUNCTION_POINTER") + static var nullFunctionPointer:Dynamic; +} diff --git a/build/linux64_569e52e/std/cpp/FILE.hx b/build/linux64_569e52e/std/cpp/FILE.hx new file mode 100644 index 0000000..c22f240 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/FILE.hx @@ -0,0 +1,27 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:include("stdio.h") +@:native(" ::cpp::Pointer") +extern class FILE {} diff --git a/build/linux64_569e52e/std/cpp/FastIterator.hx b/build/linux64_569e52e/std/cpp/FastIterator.hx new file mode 100644 index 0000000..1a6b5dd --- /dev/null +++ b/build/linux64_569e52e/std/cpp/FastIterator.hx @@ -0,0 +1,28 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +extern class FastIterator { + function hasNext():Bool; + function next():T; +} diff --git a/build/linux64_569e52e/std/cpp/Finalizable.hx b/build/linux64_569e52e/std/cpp/Finalizable.hx new file mode 100644 index 0000000..0228727 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Finalizable.hx @@ -0,0 +1,36 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +/** + This is just a helper class. It is not actually required to inherit from this + to use `NativeGc.addFinalizable(this,inPin)`, only a function called + `finalize` is needed. +**/ +class Finalizable { + public function new(inPin = false) { + NativeGc.addFinalizable(this, inPin); + } + + public function finalize():Void {} +} diff --git a/build/linux64_569e52e/std/cpp/Float32.hx b/build/linux64_569e52e/std/cpp/Float32.hx new file mode 100644 index 0000000..c00c145 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Float32.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:coreType @:notNull @:runtimeValue abstract Float32 from Float to Float {} diff --git a/build/linux64_569e52e/std/cpp/Float64.hx b/build/linux64_569e52e/std/cpp/Float64.hx new file mode 100644 index 0000000..bd4b376 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Float64.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:coreType @:notNull @:runtimeValue abstract Float64 from Float to Float {} diff --git a/build/linux64_569e52e/std/cpp/Function.hx b/build/linux64_569e52e/std/cpp/Function.hx new file mode 100644 index 0000000..22d0b4a --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Function.hx @@ -0,0 +1,60 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:callable +typedef FunctionData = T; + +@:include("cpp/Pointer.h") @:callable +extern abstract Function(FunctionData) { + inline public function new(inValue:T) + this = inValue; + + // Legacy Api + public var call(get, never):FunctionData; + + inline function get_call():FunctionData + return this; + + @:native("::cpp::Function_obj::getProcAddress") + extern static function nativeGetProcAddress(inModule:String, inFunction:String):AutoCast; + + inline public static function getProcAddress(inModule:String, inFunction:String):Function { + return cast nativeGetProcAddress(inModule, inFunction); + } + + @:native("::cpp::Function_obj::fromStaticFunction") + extern static function nativeFromStaticFunction(inStaticFunction:T):AutoCast; + + inline public static function fromStaticFunction(inStaticFunction:T):Callable { + return cast nativeFromStaticFunction(inStaticFunction); + } + + extern public function lt(inOther:Function):Bool; + + extern public function leq(inOther:Function):Bool; + + extern public function gt(inOther:Function):Bool; + + extern public function geq(inOther:Function):Bool; +} diff --git a/build/linux64_569e52e/std/cpp/Int16.hx b/build/linux64_569e52e/std/cpp/Int16.hx new file mode 100644 index 0000000..713e166 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Int16.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:coreType @:notNull @:runtimeValue abstract Int16 from Int to Int {} diff --git a/build/linux64_569e52e/std/cpp/Int32.hx b/build/linux64_569e52e/std/cpp/Int32.hx new file mode 100644 index 0000000..d60bd64 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Int32.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:coreType @:notNull @:runtimeValue abstract Int32 from Int to Int {} diff --git a/build/linux64_569e52e/std/cpp/Int64.hx b/build/linux64_569e52e/std/cpp/Int64.hx new file mode 100644 index 0000000..0b76d3c --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Int64.hx @@ -0,0 +1,49 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:coreType @:notNull @:runtimeValue abstract Int64 from Int { + + /** + Destructively cast to Int + **/ + public inline function toInt():Int { + return cast this; + } + + @:to + @:deprecated("Implicit cast from Int64 to Int (32 bits) is deprecated. Use .toInt() or explicitly cast instead.") + inline function implicitToInt(): Int { + return toInt(); + } + + @:to + #if !cppia inline #end function toInt64():haxe.Int64 { + return cast this; + } + + @:from + static #if !cppia inline #end function ofInt64(x:haxe.Int64):Int64 { + return cast x; + } +} diff --git a/build/linux64_569e52e/std/cpp/Int64Map.hx b/build/linux64_569e52e/std/cpp/Int64Map.hx new file mode 100644 index 0000000..62e4b64 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Int64Map.hx @@ -0,0 +1,154 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +import haxe.Int64; + +@:headerClassCode(" + inline void set(cpp::Int64 key, ::null value) { __int64_hash_set(HX_MAP_THIS,key,value); } + inline void set(cpp::Int64 key, bool value) { __int64_hash_set(HX_MAP_THIS,key,value); } + inline void set(cpp::Int64 key, char value) { __int64_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(cpp::Int64 key, unsigned char value) { __int64_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(cpp::Int64 key, signed char value) { __int64_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(cpp::Int64 key, short value) { __int64_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(cpp::Int64 key, unsigned short value) { __int64_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(cpp::Int64 key, int value) { __int64_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(cpp::Int64 key, unsigned int value) { __int64_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(cpp::Int64 key, float value) { __int64_hash_set_float(HX_MAP_THIS,key,value); } + inline void set(cpp::Int64 key, double value) { __int64_hash_set_float(HX_MAP_THIS,key,value); } + inline void set(cpp::Int64 key, ::String value) { __int64_hash_set_string(HX_MAP_THIS,key,value); } + inline void set(cpp::Int64 key, cpp::Int64 value) { __int64_hash_set_int64(HX_MAP_THIS,key,value); } + + template + inline void set(cpp::Int64 key, const ::cpp::Struct &value) {__int64_hash_set(HX_MAP_THIS,key,value); } + template + inline void set(cpp::Int64 key, const ::cpp::Function &value) {__int64_hash_set(HX_MAP_THIS,key,value); } + template + inline void set(cpp::Int64 key, const ::cpp::Pointer &value) {__int64_hash_set(HX_MAP_THIS,key,(Dynamic)value ); } + + template + inline void set(Dynamic &key, const VALUE &value) { set( (cpp::Int64)key, value ); } + + inline bool get_bool(cpp::Int64 key) { return __int64_hash_get_bool(h,key); } + inline int get_int(cpp::Int64 key) { return __int64_hash_get_int(h,key); } + inline Float get_float(cpp::Int64 key) { return __int64_hash_get_float(h,key); } + inline String get_string(cpp::Int64 key) { return __int64_hash_get_string(h,key); } + inline cpp::Int64 get_int64(cpp::Int64 key) { return __int64_hash_get_int64(h,key); } +") +@:coreApi class Int64Map implements haxe.Constraints.IMap { + @:ifFeature("cpp.Int64Map.*") + private var h:Dynamic; + + public function new():Void {} + + public function set(key:Int64, value:T):Void { + untyped __global__.__int64_hash_set(__cpp__("HX_MAP_THIS"), key, value); + } + + public function get(key:Int64):Null { + return untyped __global__.__int64_hash_get(h, key); + } + + public function exists(key:Int64):Bool { + return untyped __global__.__int64_hash_exists(h, key); + } + + public function remove(key:Int64):Bool { + return untyped __global__.__int64_hash_remove(h, key); + } + + public function keys():Iterator { + var a:Array = untyped __global__.__int64_hash_keys(h); + return a.iterator(); + } + + public function iterator():Iterator { + var a:Array = untyped __global__.__int64_hash_values(h); + return a.iterator(); + } + + @:runtime public inline function keyValueIterator():KeyValueIterator { + return new haxe.iterators.MapKeyValueIterator(this); + } + + public function copy():Int64Map { + var copied = new Int64Map(); + for (key in keys()) + copied.set(key, get(key)); + return copied; + } + + public function toString():String { + return untyped __global__.__int64_hash_to_string(h); + } + + public function clear():Void { + #if (hxcpp_api_level >= 400) + return untyped __global__.__int64_hash_clear(h); + #else + h = null; + #end + } + + #if (scriptable) + private function setString(key:Int64, val:String):Void { + untyped __int64_hash_set_string(__cpp__("HX_MAP_THIS"), key, val); + } + + private function setInt(key:Int64, val:Int):Void { + untyped __int64_hash_set_int(__cpp__("HX_MAP_THIS"), key, val); + } + + private function setBool(key:Int64, val:Bool):Void { + untyped __int64_hash_set_int(__cpp__("HX_MAP_THIS"), key, val); + } + + private function setFloat(key:Int64, val:Float):Void { + untyped __int64_hash_set_float(__cpp__("HX_MAP_THIS"), key, val); + } + + private function setInt64(key:Int64, val:Int64):Void { + untyped __int64_hash_set_int64(__cpp__("HX_MAP_THIS"), key, val); + } + + private function getString(key:Int64):String { + return untyped __int64_hash_get_string(h, key); + } + + private function getInt(key:Int64):Int { + return untyped __int64_hash_get_int(h, key); + } + + private function getBool(key:Int64):Bool { + return untyped __int64_hash_get_bool(h, key); + } + + private function getFloat(key:Int64):Float { + return untyped __int64_hash_get_float(h, key); + } + + private function getInt64(key:Int64):Int64 { + return untyped __int64_hash_get_int64(h, key); + } + #end +} diff --git a/build/linux64_569e52e/std/cpp/Int8.hx b/build/linux64_569e52e/std/cpp/Int8.hx new file mode 100644 index 0000000..faae9d7 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Int8.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:coreType @:notNull @:runtimeValue abstract Int8 from Int to Int {} diff --git a/build/linux64_569e52e/std/cpp/Lib.hx b/build/linux64_569e52e/std/cpp/Lib.hx new file mode 100644 index 0000000..a81d402 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Lib.hx @@ -0,0 +1,149 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +/** + Platform-specific Cpp Library. Provides some platform-specific functions + for the C++ target, such as conversion from Haxe types to native types + and vice-versa. +**/ +class Lib { + /** + Load and return a Cpp primitive from a DLL library. + **/ + public static function load(lib:String, prim:String, nargs:Int):Dynamic { + #if (iphone || emscripten) + return loadLazy(lib, prim, nargs); + #else + return untyped __global__.__loadprim(lib, prim, nargs); + #end + } + + /** + Unloaded all dynamic libraries in reverse order of loading. + Returns the number of libraries unloaded. + **/ + public static function unloadAllLibraries():Int { + return untyped __global__.__hxcpp_unload_all_libraries(); + } + + public static function _loadPrime(lib:String, prim:String, signature:String, quietFail = false):Dynamic { + var factory:CallableObject> = untyped __global__.__hxcpp_cast_get_proc_address(lib, prim + "__prime", quietFail); + if (factory != null) { + var func:Dynamic = factory.call(signature); + if (func == null && !quietFail) + throw '$prim does not have signature $signature'; + return func; + } + return null; + } + + /** + Tries to load, and always returns a valid function, but the function may throw + if called. + **/ + public static function loadLazy(lib:String, prim:String, nargs:Int):Dynamic { + try { + return untyped __global__.__loadprim(lib, prim, nargs); + } catch (e:Dynamic) { + return switch (nargs) { + case 0: () -> throw e; + case 2: (_, _) -> throw e; + case 3: (_, _, _) -> throw e; + case 4: (_, _, _, _) -> throw e; + case 5: (_, _, _, _, _) -> throw e; + default: _ -> throw e; + }; + } + return null; + } + + @:noDebug @:native("HX_STACK_DO_RETHROW") + extern static function do_rethrow(inExp:Dynamic):Void; + + @:noDebug #if (!cppia) inline #end + public static function rethrow(inExp:Dynamic) { + do_rethrow(inExp); + } + + public static function stringReference(inBytes:haxe.io.Bytes):String { + var result:String = ""; + untyped __global__.__hxcpp_string_of_bytes(inBytes.b, result, 0, inBytes.length, true); + return result; + } + + public static function pushDllSearchPath(inPath:String):Void + untyped __global__.__hxcpp_push_dll_path(inPath); + + public static function getDllExtension():String + return untyped __global__.__hxcpp_get_dll_extension(); + + public static function getBinDirectory():String + return untyped __global__.__hxcpp_get_bin_dir(); + + /** + Returns bytes referencing the content of a string. + Use with extreme caution - changing constant strings will crash. + Changing one string can cause others to change unexpectedly. + Only really safe if you are using it read-only or if it comes from stringReference above + **/ + public inline static function bytesReference(s:String):haxe.io.Bytes { + var bytes = new haxe.io.BytesData(); + untyped bytes.__unsafeStringReference(s); + return haxe.io.Bytes.ofData(bytes); + } + + /** + Print the specified value on the default output. + **/ + public static function print(v:Dynamic):Void { + untyped __global__.__hxcpp_print(v); + } + + /** + This function is used to make porting from neko to cpp easy. + It does not need to do anything because the c-code can work with any Dynamic + **/ + public static function haxeToNeko(v:Dynamic):Dynamic { + return v; + } + + /** + This function is used to make porting from neko to cpp easy. + It does not need to do anything because the c-code can work with any Dynamic + **/ + public static function nekoToHaxe(v:Dynamic):Dynamic { + return v; + } + + /** + Print the specified value on the default output followed by a newline character. + **/ + public static function println(v:Dynamic):Void { + untyped __global__.__hxcpp_println(v); + } + + public static function setFloatFormat(inFormat:String):Void { + untyped __global__.__hxcpp_set_float_format(inFormat); + } +} diff --git a/build/linux64_569e52e/std/cpp/Native.hx b/build/linux64_569e52e/std/cpp/Native.hx new file mode 100644 index 0000000..c97f061 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Native.hx @@ -0,0 +1,103 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:include("stdlib.h") +extern class Native { + @:native("malloc") + static function nativeMalloc(bytes:Int):cpp.Star; + @:native("calloc") + static function nativeCalloc(bytes:Int):cpp.Star; + @:native("realloc") + static function nativeRealloc(inPtr:cpp.Star, bytes:Int):cpp.RawPointer; + @:native("free") + static function nativeFree(ptr:cpp.Star):Void; + @:native("memcpy") + static function nativeMemcpy(dest:cpp.Star, src:cpp.Star, bytes:Int):Void; + + @:native("::hx::ClassSizeOf") @:templatedCall + static function sizeof(t:T):Int; + + #if !cppia + @:native("::hx::Dereference") + static function star(ptr:cpp.Star):cpp.Reference; + + @:generic + static inline function set(ptr:cpp.Star, value:T):Void { + var ref:cpp.Reference = star(ptr); + ref = value; + } + @:generic + static inline function get(ptr:cpp.Star):T { + var ref:cpp.Reference = star(ptr); + return ref; + } + + @:generic + static inline function memcpy(dest:cpp.Star, src:cpp.Star, bytes:Int):Void + nativeMemcpy(cast dest, cast src, bytes); + + @:generic + static inline function malloc(bytes:Int):cpp.Star + return cast nativeMalloc(bytes); + + @:generic + static inline function calloc(bytes:Int):cpp.Star + return cast nativeCalloc(bytes); + + @:generic + static inline function realloc(ioPtr:cpp.Star, bytes:Int):cpp.Star + return cast nativeRealloc(cast ioPtr, bytes); + + @:generic + static inline function free(ptr:cpp.Star):Void { + if (ptr != null) + nativeFree(cast ptr); + } + + @:native("::hx::StarOf") + static function addressOf(inVariable:Reference):Star; + #else + static inline function addressOf(inVariable:Reference):Star { + throw "Native.addressOf not available in cppia"; + } + static inline function star(ptr:cpp.Star):cpp.Reference { + throw "Native.star not available in cppia"; + } + + static inline function set(ptr:cpp.Star, value:T):Void { + throw "Native.set not available in cppia"; + } + static inline function get(ptr:cpp.Star):T { + throw "Native.get not available in cppia"; + var d:Dynamic = null; + return d; + } + + static function memcpy(dest:cpp.Star, src:cpp.Star, bytes:Int):Void; + static function malloc(bytes:Int):cpp.Star; + static function calloc(bytes:Int):cpp.Star; + static function realloc(ioPtr:cpp.Star, bytes:Int):cpp.Star; + static function free(ptr:cpp.Star):Void; + #end +} diff --git a/build/linux64_569e52e/std/cpp/NativeArc.hx b/build/linux64_569e52e/std/cpp/NativeArc.hx new file mode 100644 index 0000000..d0f98b6 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/NativeArc.hx @@ -0,0 +1,31 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +extern class NativeArc { + @:native("(__bridge_transfer id)") + static function _bridgeTransfer(ptr:cpp.RawPointer):cpp.RawPointer; + + static inline function bridgeTransfer(ptr:cpp.RawPointer):T + return cast _bridgeTransfer(ptr); +} diff --git a/build/linux64_569e52e/std/cpp/NativeArray.hx b/build/linux64_569e52e/std/cpp/NativeArray.hx new file mode 100644 index 0000000..6810d9f --- /dev/null +++ b/build/linux64_569e52e/std/cpp/NativeArray.hx @@ -0,0 +1,100 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +extern class NativeArray { + #if cppia + static inline function create(length:Int):Array { + var result = new Array(); + NativeArray.setSize(result, length); + return result; + } + #else + @:native("_hx_create_array_length") + static function create(length:Int):Array; + #end + + static inline function blit(ioDestArray:Array, inDestElement:Int, inSourceArray:Array, inSourceElement:Int, inElementCount:Int):Void { + untyped ioDestArray.blit(inDestElement, inSourceArray, inSourceElement, inElementCount); + }; + + static inline function getBase(inArray:Array):ArrayBase { + return untyped inArray; + } + + @:nativeStaticExtension + static function reserve(inArray:Array, inElements:Int):Void; + + @:nativeStaticExtension + static function capacity(inArray:Array):Int; + + @:nativeStaticExtension + static function getElementSize(inArray:Array):Int; + + static inline function address(inArray:Array, inIndex:Int):Pointer { + return Pointer.arrayElem(inArray, inIndex); + } + + @:nativeStaticExtension + static function setData(inArray:Array, inData:Pointer, inElementCount:Int):Void; + + @:nativeStaticExtension + static function setUnmanagedData(inArray:Array, inData:ConstPointer, inElementCount:Int):Void; + + @:nativeStaticExtension + static function zero(ioDestArray:Array, ?inFirst:Int, ?inElements:Int):Void; + + @:nativeStaticExtension + static function removeAt(ioDestArray:Array, inIndex:Int):Void; + + @:nativeStaticExtension + static function memcmp(inArrayA:Array, inArrayB:Array):Int; + + @:native("_hx_reslove_virtual_array") + static function resolveVirtualArray(inArray:Array):Dynamic; + + #if cppia + static inline function unsafeGet(inDestArray:Array, inIndex:Int):T { + return untyped inDestArray.__unsafe_get(inIndex); + } + + static inline function unsafeSet(ioDestArray:Array, inIndex:Int, inValue:T):T { + return untyped ioDestArray.__unsafe_set(inIndex, inValue); + } + + static inline function setSize(ioArray:Array, inSize:Int):Array { + return untyped ioArray.__SetSizeExact(inSize); + } + #else + @:native("_hx_array_unsafe_get") + static function unsafeGet(inDestArray:Array, inIndex:Int):T; + + @:native("_hx_array_unsafe_set") + static inline function unsafeSet(ioDestArray:Array, inIndex:Int, inValue:T):T { + return untyped ioDestArray.__unsafe_set(inIndex, inValue); + } + + @:native("_hx_array_set_size_exact") + static function setSize(ioArray:Array, inSize:Int):Array; + #end +} diff --git a/build/linux64_569e52e/std/cpp/NativeFile.hx b/build/linux64_569e52e/std/cpp/NativeFile.hx new file mode 100644 index 0000000..19b8078 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/NativeFile.hx @@ -0,0 +1,71 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:buildXml('') +extern class NativeFile { + @:native("_hx_std_file_open") + extern static function file_open(fname:String, r:String):Dynamic; + + @:native("_hx_std_file_close") + extern static function file_close(handle:Dynamic):Void; + + @:native("_hx_std_file_write") + extern static function file_write(handle:Dynamic, s:haxe.io.BytesData, p:Int, n:Int):Int; + + @:native("_hx_std_file_write_char") + extern static function file_write_char(handle:Dynamic, c:Int):Void; + + @:native("_hx_std_file_read") + extern static function file_read(handle:Dynamic, s:haxe.io.BytesData, p:Int, n:Int):Int; + + @:native("_hx_std_file_read_char") + extern static function file_read_char(handle:Dynamic):Int; + + @:native("_hx_std_file_seek") + extern static function file_seek(handle:Dynamic, pos:Int, kind:Int):Void; + + @:native("_hx_std_file_tell") + extern static function file_tell(handle:Dynamic):Int; + + @:native("_hx_std_file_eof") + extern static function file_eof(handle:Dynamic):Bool; + + @:native("_hx_std_file_flush") + extern static function file_flush(handle:Dynamic):Void; + + @:native("_hx_std_file_contents_string") + extern static function file_contents_string(name:String):String; + + @:native("_hx_std_file_contents_bytes") + extern static function file_contents_bytes(name:String):haxe.io.BytesData; + + @:native("_hx_std_file_stdin") + extern static function file_stdin():Dynamic; + + @:native("_hx_std_file_stdout") + extern static function file_stdout():Dynamic; + + @:native("_hx_std_file_stderr") + extern static function file_stderr():Dynamic; +} diff --git a/build/linux64_569e52e/std/cpp/NativeGc.hx b/build/linux64_569e52e/std/cpp/NativeGc.hx new file mode 100644 index 0000000..4a0733b --- /dev/null +++ b/build/linux64_569e52e/std/cpp/NativeGc.hx @@ -0,0 +1,65 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +extern class NativeGc { + @:native("__hxcpp_gc_mem_info") + static function memInfo(inWhatInfo:Int):Float; + + @:native("_hx_allocate_extended") @:templatedCall + static function allocateExtended(cls:Class, size:Int):T; + + @:native("_hx_add_finalizable") + static function addFinalizable(instance:{function finalize():Void;}, inPin:Bool):Void; + + @:native("::hx::InternalNew") + static function allocGcBytesRaw(inBytes:Int, isContainer:Bool):RawPointer; + + inline static function allocGcBytes(inBytes:Int):Pointer { + return Pointer.fromRaw(allocGcBytesRaw(inBytes, false)); + } + + @:native("__hxcpp_enable") extern static function enable(inEnable:Bool):Void; + + @:native("__hxcpp_collect") extern static function run(major:Bool):Void; + + @:native("__hxcpp_gc_compact") extern static function compact():Void; + + @:native("__hxcpp_gc_trace") extern static function nativeTrace(sought:Class, printInstances:Bool):Int; + + @:native("__hxcpp_gc_do_not_kill") extern static function doNotKill(inObject:Dynamic):Void; + + @:native("__hxcpp_get_next_zombie") extern static function getNextZombie():Dynamic; + + @:native("__hxcpp_gc_safe_point") extern static function safePoint():Void; + + @:native("__hxcpp_enter_gc_free_zone") extern static function enterGCFreeZone():Void; + + @:native("__hxcpp_exit_gc_free_zone") extern static function exitGCFreeZone():Void; + + @:native("__hxcpp_set_minimum_free_space") extern static function setMinimumFreeSpace(inBytes:Int):Void; + + @:native("__hxcpp_set_target_free_space_percentage") extern static function setTargetFreeSpacePercentage(inPercentage:Int):Void; + + @:native("__hxcpp_set_minimum_working_memory") extern static function setMinimumWorkingMemory(inBytes:Int):Void; +} diff --git a/build/linux64_569e52e/std/cpp/NativeMath.hx b/build/linux64_569e52e/std/cpp/NativeMath.hx new file mode 100644 index 0000000..83dce90 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/NativeMath.hx @@ -0,0 +1,49 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:noPackageRestrict +extern class NativeMath { + #if (cpp && !cppia) + @:native("_hx_idiv") + static function idiv(num:Int, denom:Int):Int; + @:native("_hx_imod") + static function imod(num:Int, denom:Int):Int; + @:native("_hx_cast_int") + static function castInt(f:Float):Int; + @:native("_hx_fast_floor") + static function fastInt(f:Float):Int; + #else + static inline function imod(num:Int, denom:Int):Int + return num % denom; + + static inline function idiv(num:Int, denom:Int):Int + return Std.int(num / denom); + + static inline function castInt(f:Float):Int + return Std.int(f); + + static inline function fastInt(f:Float):Int + return Std.int(f); + #end +} diff --git a/build/linux64_569e52e/std/cpp/NativeProcess.hx b/build/linux64_569e52e/std/cpp/NativeProcess.hx new file mode 100644 index 0000000..3add92c --- /dev/null +++ b/build/linux64_569e52e/std/cpp/NativeProcess.hx @@ -0,0 +1,56 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:buildXml('') +extern class NativeProcess { + @:native("_hx_std_process_run") + static function process_run(cmd:String, vargs:Array):Dynamic; + + @:native("_hx_std_process_run") + static function process_run_with_show(cmd:String, vargs:Array, inShow:Int):Dynamic; + + @:native("_hx_std_process_stdout_read") + static function process_stdout_read(handle:Dynamic, buf:haxe.io.BytesData, pos:Int, len:Int):Int; + + @:native("_hx_std_process_stderr_read") + static function process_stderr_read(handle:Dynamic, buf:haxe.io.BytesData, pos:Int, len:Int):Int; + + @:native("_hx_std_process_stdin_write") + static function process_stdin_write(handle:Dynamic, buf:haxe.io.BytesData, pos:Int, len:Int):Int; + + @:native("_hx_std_process_stdin_close") + static function process_stdin_close(handle:Dynamic):Void; + + @:native("_hx_std_process_exit") + static function process_exit(handle:Dynamic, block:Bool):Dynamic; + + @:native("_hx_std_process_pid") + static function process_pid(handle:Dynamic):Int; + + @:native("_hx_std_process_kill") + static function process_kill(handle:Dynamic):Void; + + @:native("_hx_std_process_close") + static function process_close(handle:Dynamic):Void; +} diff --git a/build/linux64_569e52e/std/cpp/NativeRandom.hx b/build/linux64_569e52e/std/cpp/NativeRandom.hx new file mode 100644 index 0000000..f653624 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/NativeRandom.hx @@ -0,0 +1,38 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:buildXml('') +extern class NativeRandom { + @:native("_hx_std_random_new") + static function random_new():Dynamic; + + @:native("_hx_std_random_set_seed") + static function random_set_seed(handle:Dynamic, v:Int):Void; + + @:native("_hx_std_random_int") + static function random_int(handle:Dynamic, max:Int):Int; + + @:native("_hx_std_random_float") + static function random_float(handle:Dynamic):Float; +} diff --git a/build/linux64_569e52e/std/cpp/NativeSocket.hx b/build/linux64_569e52e/std/cpp/NativeSocket.hx new file mode 100644 index 0000000..1475b16 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/NativeSocket.hx @@ -0,0 +1,145 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +import sys.net.Socket; + +@:buildXml('') +extern class NativeSocket { + @:native("_hx_std_socket_init") + static function socket_init():Void; + + @:native("_hx_std_socket_new") + static function socket_new(udp:Bool):Dynamic; + + @:native("_hx_std_socket_new") + static function socket_new_ip(udp:Bool, ipv6:Bool):Dynamic; + + @:native("_hx_std_socket_close") + static function socket_close(handle:Dynamic):Void; + + @:native("_hx_std_socket_bind") + static function socket_bind(o:Dynamic, host:Int, port:Int):Void; + + @:native("_hx_std_socket_bind_ipv6") + static function socket_bind_ipv6(o:Dynamic, host:haxe.io.BytesData, port:Int):Void; + + @:native("_hx_std_socket_send_char") + static function socket_send_char(o:Dynamic, c:Int):Void; + + @:native("_hx_std_socket_send") + static function socket_send(o:Dynamic, buf:haxe.io.BytesData, p:Int, l:Int):Int; + + @:native("_hx_std_socket_recv") + static function socket_recv(o:Dynamic, buf:haxe.io.BytesData, p:Int, l:Int):Int; + + @:native("_hx_std_socket_recv_char") + static function socket_recv_char(o:Dynamic):Int; + + @:native("_hx_std_socket_write") + static function socket_write(o:Dynamic, buf:haxe.io.BytesData):Void; + + @:native("_hx_std_socket_read") + static function socket_read(o:Dynamic):haxe.io.BytesData; + + @:native("_hx_std_host_resolve_ipv6") + static function host_resolve_ipv6(host:String):haxe.io.BytesData; + + @:native("_hx_std_host_resolve") + static function host_resolve(host:String):Int; + + @:native("_hx_std_host_to_string") + static function host_to_string(ip:Int):String; + + @:native("_hx_std_host_to_string_ipv6") + static function host_to_string_ipv6(ipv6:haxe.io.BytesData):String; + + @:native("_hx_std_host_reverse") + static function host_reverse(host:Int):String; + + @:native("_hx_std_host_reverse_ipv6") + static function host_reverse_ipv6(ipv6:haxe.io.BytesData):String; + + @:native("_hx_std_host_local") + static function host_local():String; + + inline static function host_local_ipv6():String + return "::1"; + + @:native("_hx_std_socket_connect") + static function socket_connect(o:Dynamic, host:Int, port:Int):Void; + + @:native("_hx_std_socket_connect_ipv6") + static function socket_connect_ipv6(o:Dynamic, host:haxe.io.BytesData, port:Int):Void; + + @:native("_hx_std_socket_listen") + static function socket_listen(o:Dynamic, n:Int):Void; + + @:native("_hx_std_socket_select") + static function socket_select(rs:Array, ws:Array, es:Array, timeout:Dynamic):Array; + + @:native("_hx_std_socket_fast_select") + static function socket_fast_select(rs:Array, ws:Array, es:Array, timeout:Dynamic):Void; + + @:native("_hx_std_socket_accept") + static function socket_accept(o:Dynamic):Dynamic; + + @:native("_hx_std_socket_peer") + static function socket_peer(o:Dynamic):Array; + + @:native("_hx_std_socket_host") + static function socket_host(o:Dynamic):Array; + + @:native("_hx_std_socket_set_timeout") + static function socket_set_timeout(o:Dynamic, t:Dynamic):Void; + + @:native("_hx_std_socket_shutdown") + static function socket_shutdown(o:Dynamic, r:Bool, w:Bool):Void; + + @:native("_hx_std_socket_set_blocking") + static function socket_set_blocking(o:Dynamic, b:Bool):Void; + + @:native("_hx_std_socket_set_fast_send") + static function socket_set_fast_send(o:Dynamic, b:Bool):Void; + + @:native("_hx_std_socket_set_broadcast") + static function socket_set_broadcast(o:Dynamic, b:Bool):Void; + + @:native("_hx_std_socket_poll_alloc") + static function socket_poll_alloc(nsocks:Int):Dynamic; + + @:native("_hx_std_socket_poll_prepare") + static function socket_poll_prepare(pdata:Dynamic, rsocks:Array, wsocks:Array):Array>; + + @:native("_hx_std_socket_poll_events") + static function socket_poll_events(pdata:Dynamic, timeout:Float):Void; + + @:native("_hx_std_socket_poll") + static function socket_poll(socks:Array, pdata:Dynamic, timeout:Float):Array; + + @:native("_hx_std_socket_send_to") + static function socket_send_to(o:Dynamic, buf:haxe.io.BytesData, p:Int, l:Int, inAddr:Dynamic):Int; + + @:native("_hx_std_socket_recv_from") + static function socket_recv_from(o:Dynamic, buf:haxe.io.BytesData, p:Int, l:Int, outAddr:Dynamic):Int; +} diff --git a/build/linux64_569e52e/std/cpp/NativeSsl.hx b/build/linux64_569e52e/std/cpp/NativeSsl.hx new file mode 100644 index 0000000..587345e --- /dev/null +++ b/build/linux64_569e52e/std/cpp/NativeSsl.hx @@ -0,0 +1,137 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:buildXml('') +extern class NativeSsl { + @:native("_hx_ssl_debug_set") + static function ssl_debug_set(int:Int):Void; + + @:native("_hx_ssl_new") + static function ssl_new(conf:Dynamic):Dynamic; + + @:native("_hx_ssl_close") + static function ssl_close(ctx:Dynamic):Void; + + @:native("_hx_ssl_handshake") + static function ssl_handshake(ctx:Dynamic):Void; + + @:native("_hx_ssl_set_socket") + static function ssl_set_socket(ctx:Dynamic, socket:Dynamic):Void; + + @:native("_hx_ssl_set_hostname") + static function ssl_set_hostname(ctx:Dynamic, hostname:String):Void; + + @:native("_hx_ssl_get_peer_certificate") + static function ssl_get_peer_certificate(ctx:Dynamic):Dynamic; + + @:native("_hx_ssl_get_verify_result") + static function ssl_get_verify_result(ctx:Dynamic):Bool; + + @:native("_hx_ssl_send_char") + static function ssl_send_char(ctx:Dynamic, char:Int):Void; + + @:native("_hx_ssl_send") + static function ssl_send(ctx:Dynamic, buf:haxe.io.BytesData, p:Int, l:Int):Int; + + @:native("_hx_ssl_write") + static function ssl_write(ctx:Dynamic, data:haxe.io.BytesData):Void; + + @:native("_hx_ssl_recv_char") + static function ssl_recv_char(ctx:Dynamic):Int; + + @:native("_hx_ssl_recv") + static function ssl_recv(ctx:Dynamic, buf:haxe.io.BytesData, p:Int, l:Int):Int; + + @:native("_hx_ssl_read") + static function ssl_read(ctx:Dynamic):haxe.io.BytesData; + + @:native("_hx_ssl_conf_new") + static function conf_new(server:Bool):Dynamic; + + @:native("_hx_ssl_conf_close") + static function conf_close(conf:Dynamic):Void; + + @:native("_hx_ssl_conf_set_ca") + static function conf_set_ca(conf:Dynamic, cert:Dynamic):Void; + + @:native("_hx_ssl_conf_set_verify") + static function conf_set_verify(conf:Dynamic, mode:Int):Void; + + @:native("_hx_ssl_conf_set_cert") + static function conf_set_cert(conf:Dynamic, cert:Dynamic, pkey:Dynamic):Void; + + @:native("_hx_ssl_conf_set_servername_callback") + static function conf_set_servername_callback(conf:Dynamic, cb:Dynamic):Void; + + @:native("_hx_ssl_cert_load_defaults") + static function cert_load_defaults():Dynamic; + + @:native("_hx_ssl_cert_load_file") + static function cert_load_file(file:String):Dynamic; + + @:native("_hx_ssl_cert_load_path") + static function cert_load_path(path:String):Dynamic; + + @:native("_hx_ssl_cert_get_subject") + static function cert_get_subject(cert:Dynamic, field:String):String; + + @:native("_hx_ssl_cert_get_issuer") + static function cert_get_issuer(cert:Dynamic, field:String):String; + + @:native("_hx_ssl_cert_get_altnames") + static function cert_get_altnames(cert:Dynamic):Array; + + @:native("_hx_ssl_cert_get_notbefore") + static function cert_get_notbefore(cert:Dynamic):Array; + + @:native("_hx_ssl_cert_get_notafter") + static function cert_get_notafter(cert:Dynamic):Array; + + @:native("_hx_ssl_cert_get_next") + static function cert_get_next(cert:Dynamic):Dynamic; + + @:native("_hx_ssl_cert_add_pem") + static function cert_add_pem(cert:Dynamic, data:String):Dynamic; + + @:native("_hx_ssl_cert_add_der") + static function cert_add_der(cert:Dynamic, data:haxe.io.BytesData):Dynamic; + + @:native("_hx_ssl_key_from_der") + static function key_from_der(data:haxe.io.BytesData, pub:Bool):Dynamic; + + @:native("_hx_ssl_key_from_pem") + static function key_from_pem(data:String, pub:Bool, pass:String):Dynamic; + + @:native("_hx_ssl_dgst_make") + static function dgst_make(data:haxe.io.BytesData, alg:String):haxe.io.BytesData; + + @:native("_hx_ssl_dgst_sign") + static function dgst_sign(data:haxe.io.BytesData, key:Dynamic, alg:String):haxe.io.BytesData; + + @:native("_hx_ssl_dgst_verify") + static function dgst_verify(data:haxe.io.BytesData, sign:haxe.io.BytesData, key:Dynamic, alg:String):Bool; + + @:native("_hx_ssl_init") + static function init():Void; +} diff --git a/build/linux64_569e52e/std/cpp/NativeString.hx b/build/linux64_569e52e/std/cpp/NativeString.hx new file mode 100644 index 0000000..52868fd --- /dev/null +++ b/build/linux64_569e52e/std/cpp/NativeString.hx @@ -0,0 +1,73 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +extern class NativeString { + static inline function raw(inString:String):RawConstPointer { + return untyped inString.raw_ptr(); + } + static inline function c_str(inString:String):ConstPointer { + return cpp.ConstPointer.fromPointer(untyped inString.c_str()); + } + static inline function fromPointer(inPtr:ConstPointer):String { + return untyped __global__.String(inPtr.ptr); + } + static inline function fromGcPointer(inPtr:ConstPointer, inLen:Int):String { + return untyped __global__.String(inPtr.ptr, inLen); + } + + @:native("__hxcpp_parse_float") + public static function parseFloat(inString:String):Float; + + @:native("__hxcpp_parse_substr_float") + public static function parseSubstrFloat(inString:String,start:Int, length:Int):Float; + + // Will return 0 for invalid string + @:native("__hxcpp_parse_substr_int") + public static function parseInt(inString:String):Int; + + // Will return 0 for invalid string + @:native("__hxcpp_parse_substr_int") + public static function parseSubstrInt(inString:String,start:Int, length:Int):Int; + + @:native("_hx_string_compare") + static function compare(inString0:String, inString1:String):Int; + + @:native("_hx_utf8_char_code_at") + static function utf8CharCodeAt(inString:String, inIndex:Int):Int; + + @:native("_hx_utf8_length") + static function utf8Length(inString:String):Int; + + @:native("_hx_utf8_is_valid") + static function utf8IsValid(inString:String):Bool; + + @:native("_hx_utf8_sub") + static function utf8Sub(inString:String, charStart:Int, inLen:Int):String; + + @:native("_hx_string_create") + static function fromPointerLen(inPtr:ConstPointer, len:Int):String; + + @:native("_hx_utf8_decode_advance") + static function utf8DecodeAdvance(reference:Char):Int; +} diff --git a/build/linux64_569e52e/std/cpp/NativeSys.hx b/build/linux64_569e52e/std/cpp/NativeSys.hx new file mode 100644 index 0000000..5390568 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/NativeSys.hx @@ -0,0 +1,107 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:buildXml('') +extern class NativeSys { + @:native("__hxcpp_print") + static function print(v:Dynamic):Void; + + @:native("__hxcpp_println") + static function println(v:Dynamic):Void; + + @:native("_hx_std_get_env") + extern static function get_env(v:String):String; + + @:native("_hx_std_put_env") + extern static function put_env(e:String, v:Null):Void; + + @:native("_hx_std_sys_sleep") + extern static function sys_sleep(f:Float):Void; + + @:native("_hx_std_set_time_locale") + extern static function set_time_locale(l:String):Bool; + + @:native("_hx_std_get_cwd") + extern static function get_cwd():String; + + @:native("_hx_std_set_cwd") + extern static function set_cwd(d:String):Void; + + @:native("_hx_std_sys_string") + extern static function sys_string():String; + + @:native("_hx_std_sys_is64") + extern static function sys_is64():Bool; + + @:native("_hx_std_sys_command") + extern static function sys_command(cmd:String):Int; + + @:native("_hx_std_sys_exit") + extern static function sys_exit(code:Int):Void; + + @:native("_hx_std_sys_exists") + extern static function sys_exists(path:String):Bool; + + @:native("_hx_std_file_delete") + extern static function file_delete(path:String):Void; + + @:native("_hx_std_sys_rename") + extern static function sys_rename(path:String, newname:String):Bool; + + @:native("_hx_std_sys_stat") + extern static function sys_stat(path:String):Dynamic; + + @:native("_hx_std_sys_file_type") + extern static function sys_file_type(path:String):String; + + @:native("_hx_std_sys_create_dir") + extern static function sys_create_dir(path:String, mode:Int):Bool; + + @:native("_hx_std_sys_remove_dir") + extern static function sys_remove_dir(path:String):Void; + + @:native("_hx_std_sys_time") + extern static function sys_time():Float; + + @:native("_hx_std_sys_cpu_time") + extern static function sys_cpu_time():Float; + + @:native("_hx_std_sys_read_dir") + extern static function sys_read_dir(p:String):Array; + + @:native("_hx_std_file_full_path") + extern static function file_full_path(path:String):String; + + @:native("_hx_std_sys_exe_path") + extern static function sys_exe_path():String; + + @:native("_hx_std_sys_env") + extern static function sys_env():Array; + + @:native("_hx_std_sys_getch") + extern static function sys_getch(b:Bool):Int; + + @:native("_hx_std_sys_get_pid") + extern static function sys_get_pid():Int; +} diff --git a/build/linux64_569e52e/std/cpp/NativeXml.hx b/build/linux64_569e52e/std/cpp/NativeXml.hx new file mode 100644 index 0000000..ee3ddc2 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/NativeXml.hx @@ -0,0 +1,473 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +enum abstract XmlType(Int) { + /** + Represents an XML element type. + **/ + var Element = 0; + + /** + Represents XML parsed character data type. + **/ + var PCData = 1; + + /** + Represents XML character data type. + **/ + var CData = 2; + + /** + Represents an XML comment type. + **/ + var Comment = 3; + + /** + Represents an XML doctype element type. + **/ + var DocType = 4; + + /** + Represents an XML processing instruction type. + **/ + var ProcessingInstruction = 5; + + /** + Represents an XML document type. + **/ + var Document = 6; +} + +class NativeXmlState { + var cur:Xml; + + public function new(x:Xml) { + x._children = new Array(); + cur = x; + } + + @:keep + public function xml(name:String, att:Dynamic) { + var x = new Xml(); + x._parent = cur; + x.nodeType = Xml.Element; + x._nodeName = name; + x._attributes = att; + x._children = new Array(); + cur.addChild(x); + cur = x; + } + + @:keep + public function cdata(text:String) { + var x = new Xml(); + x._parent = cur; + x.nodeType = Xml.CData; + x._nodeValue = text; + cur.addChild(x); + } + + @:keep + public function pcdata(text:String) { + var x = new Xml(); + x._parent = cur; + x.nodeType = Xml.PCData; + x._nodeValue = text; + cur.addChild(x); + } + + @:keep + public function comment(text:String) { + var x = new Xml(); + x._parent = cur; + if (text.length > 1 && StringTools.fastCodeAt(text, 0) == 63) { + x.nodeType = Xml.ProcessingInstruction; + text = text.substr(1, text.length - 2); + } else { + x.nodeType = Xml.Comment; + } + x._nodeValue = text; + cur.addChild(x); + } + + @:keep + public function doctype(text:String) { + var x = new Xml(); + x._parent = cur; + x.nodeType = Xml.DocType; + x._nodeValue = text.substr(1); + cur.addChild(x); + } + + @:keep + public function done() { + cur = cur._parent; + } +} + +private class NativeXmlIterator { + var cur = 0; + var children:Array; + + public function new(inChildren:Array) { + children = inChildren; + cur = 0; + } + + public function hasNext():Bool { + var k = cur; + var l = children.length; + while (k < l) { + if (children[k].nodeType == Xml.Element) + break; + k += 1; + } + cur = k; + return k < l; + } + + public function next():Xml { + var k = cur; + var l = children.length; + while (k < l) { + var n = children[k]; + k += 1; + if (n.nodeType == Xml.Element) { + cur = k; + return n; + } + } + return null; + } +} + +private class NativeXmlNamedIterator { + var cur = 0; + var children:Array; + var name:String; + + public function new(inChildren:Array, inName:String) { + children = inChildren; + name = inName; + cur = 0; + } + + public function hasNext():Bool { + var k = cur; + var l = children.length; + while (k < l) { + var n = children[k]; + if (n.nodeType == Xml.Element && n._nodeName == name) + break; + k++; + } + cur = k; + return k < l; + } + + public function next():Xml { + var k = cur; + var l = children.length; + while (k < l) { + var n = children[k]; + k++; + if (n.nodeType == Xml.Element && n._nodeName == name) { + cur = k; + return n; + } + } + return null; + } +} + +@:cppInclude("./NativeXmlImport.cpp") +@:allow(cpp.NativeXmlState) @:allow(cpp.NativeXmlIterator) @:allow(cpp.NativeXmlNamedIterator) +class Xml { + static inline var Element = XmlType.Element; + static inline var PCData = XmlType.PCData; + static inline var CData = XmlType.CData; + static inline var Comment = XmlType.Comment; + static inline var DocType = XmlType.DocType; + static inline var ProcessingInstruction = XmlType.ProcessingInstruction; + static inline var Document = XmlType.Document; + + private var _nodeName:String; + private var _nodeValue:String; + private var _attributes:Dynamic; + private var _children:Array; + private var _parent:Xml; + + function new():Void {} + + @:native("parse_xml") + extern static function parse_xml(str:String, state:NativeXmlState):String; + + public static function parse(str:String):Xml { + var x = new Xml(); + var state = new NativeXmlState(x); + parse_xml(str, state); + x.nodeType = Xml.Document; + return x; + } + + public static function createElement(name:String):Xml { + var r = new Xml(); + r.nodeType = Xml.Element; + r._nodeName = name; + r._attributes = null; + r._children = new Array(); + return r; + } + + public static function createPCData(data:String):Xml { + var r = new Xml(); + r.nodeType = Xml.PCData; + r._nodeValue = data; + return r; + } + + public static function createCData(data:String):Xml { + var r = new Xml(); + r.nodeType = Xml.CData; + r._nodeValue = data; + return r; + } + + public static function createComment(data:String):Xml { + var r = new Xml(); + r.nodeType = Xml.Comment; + r._nodeValue = data; + return r; + } + + public static function createDocType(data:String):Xml { + var r = new Xml(); + r.nodeType = Xml.DocType; + r._nodeValue = data; + return r; + } + + public static function createProcessingInstruction(data:String):Xml { + var r = new Xml(); + r.nodeType = Xml.ProcessingInstruction; + r._nodeValue = data; + return r; + } + + public static function createDocument():Xml { + var r = new Xml(); + r.nodeType = Xml.Document; + r._children = new Array(); + return r; + } + + public var nodeType(default, null):XmlType; + + public var nodeName(get, set):String; + + public var nodeValue(get, set):String; + + private function get_nodeName():String { + if (nodeType != Xml.Element) + throw "bad nodeType"; + return _nodeName; + } + + private function set_nodeName(n:String):String { + if (nodeType != Xml.Element) + throw "bad nodeType"; + return _nodeName = n; + } + + private function get_nodeValue():String { + if (nodeType == Xml.Element || nodeType == Xml.Document) + throw "bad nodeType"; + return _nodeValue; + } + + private function set_nodeValue(v:String):String { + if (nodeType == Xml.Element || nodeType == Xml.Document) + throw "bad nodeType"; + return _nodeValue = v; + } + + public var parent(get, null):Xml; + + private function get_parent():Xml { + return _parent; + } + + public function get(att:String):String { + if (nodeType != Xml.Element) + throw "bad nodeType"; + return Reflect.field(_attributes, att); + } + + public function set(att:String, value:String):Void { + if (nodeType != Xml.Element) + throw "bad nodeType"; + if (_attributes == null) + _attributes = {}; + Reflect.setField(_attributes, att, value); + return; + } + + public function remove(att:String):Void { + if (nodeType != Xml.Element) + throw "bad nodeType"; + Reflect.deleteField(_attributes, att); + return; + } + + public function exists(att:String):Bool { + if (nodeType != Xml.Element) + throw "bad nodeType"; + return Reflect.hasField(_attributes, att); + } + + public function attributes():Iterator { + if (nodeType != Xml.Element) + throw "bad nodeType"; + return Reflect.fields(_attributes).iterator(); + } + + public function iterator():Iterator { + if (_children == null) + throw "bad nodetype"; + return untyped _children.iterator(); + } + + public function elements():Iterator { + if (_children == null) + throw "bad nodetype"; + return new NativeXmlIterator(_children); + } + + public function elementsNamed(name:String):Iterator { + if (_children == null) + throw "bad nodetype"; + return new NativeXmlNamedIterator(_children, name); + } + + public function firstChild():Xml { + if (_children == null) + throw "bad nodetype"; + return _children[0]; + } + + public function firstElement():Xml { + if (_children == null) + throw "bad nodetype"; + for (cur in 0..._children.length) { + var n:Xml = _children[cur]; + if (n.nodeType == Xml.Element) + return n; + } + return null; + } + + public function addChild(x:Xml):Void { + if (_children == null) + throw "bad nodetype"; + if (x._parent != null) + x._parent._children.remove(x); + x._parent = this; + _children.push(x); + return; + } + + public function removeChild(x:Xml):Bool { + if (_children == null) + throw "bad nodetype"; + var b = _children.remove(x); + if (b) + x._parent = null; + return b; + } + + public function insertChild(x:Xml, pos:Int):Void { + if (_children == null) + throw "bad nodetype"; + if (x._parent != null) + x._parent._children.remove(x); + x._parent = this; + _children.insert(pos, x); + return; + } + + public function toString():String { + var s = new StringBuf(); + toStringRec(s); + return s.toString(); + } + + private function toStringRec(s:StringBuf):Void { + switch (nodeType) { + case Xml.Document: + for (x in _children) + x.toStringRec(s); + case Xml.Element: + s.addChar("<".code); + s.add(_nodeName); + for (k in Reflect.fields(_attributes)) { + s.addChar(" ".code); + s.add(k); + s.addChar("=".code); + s.addChar("\"".code); + s.add(Reflect.field(_attributes, k)); + s.addChar("\"".code); + } + if (_children.length == 0) { + s.addChar("/".code); + s.addChar(">".code); + return; + } + s.addChar(">".code); + for (x in _children) + x.toStringRec(s); + s.addChar("<".code); + s.addChar("/".code); + s.add(_nodeName); + s.addChar(">".code); + case Xml.PCData: + s.add(StringTools.htmlEscape(_nodeValue)); + case Xml.CData: + s.add(""); + case Xml.Comment: + s.add(""); + case Xml.DocType: + s.add(""); + case Xml.ProcessingInstruction: + s.add(""); + } + } +} diff --git a/build/linux64_569e52e/std/cpp/NativeXmlImport.cpp b/build/linux64_569e52e/std/cpp/NativeXmlImport.cpp new file mode 100644 index 0000000..a98b748 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/NativeXmlImport.cpp @@ -0,0 +1,386 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifdef EPPC +#include +#else +#include +#endif + + +#ifndef HX_WINDOWS +# include +# undef strcmpi +# define strcmpi(a,b) strcasecmp(a,b) +#else +# include +#endif + + +// -------------- parsing -------------------------- + + +enum STATE { + IGNORE_SPACES, + BEGIN, + BEGIN_NODE, + TAG_NAME, + BODY, + ATTRIB_NAME, + EQUALS, + ATTVAL_BEGIN, + ATTRIB_VAL, + CHILDS, + CLOSE, + WAIT_END, + WAIT_END_RET, + PCDATA, + HEADER, + COMMENT, + DOCTYPE, + CDATA, +}; + +static void xml_error( const char *xml, const char *inWhere, int *line, String msg ) { + String b = HX_CSTRING("Xml parse error : ") + msg + HX_CSTRING(" at line ") + String(*line) + HX_CSTRING(" : "); + String where(inWhere); + + int l = where.length; + int nchars = 30; + if( inWhere != xml ) + b += HX_CSTRING("..."); + + if (where.length==0) + b+= HX_CSTRING(""); + else if (where.length= 'a' && c <= 'z' ) || ( c >= 'A' && c <= 'Z' ) || ( c >= '0' && c <= '9' ) || c == ':' || c == '.' || c == '_' || c == '-'; +} + +static void do_parse_xml( const char *xml, const char **lp, int *line, cpp::NativeXmlState callb, String parentname ) +{ + STATE state = BEGIN; + STATE next = BEGIN; + String aname; + hx::Anon attribs; + String nodename; + + const char *start = NULL; + const char *p = *lp; + char c = *p; + int nsubs = 0, nbrackets = 0; + while( c ) { + switch( state ) { + case IGNORE_SPACES: + switch( c ) { + case '\n': + case '\r': + case '\t': + case ' ': + break; + default: + state = next; + continue; + } + break; + case BEGIN: + switch( c ) { + case '<': + state = IGNORE_SPACES; + next = BEGIN_NODE; + break; + default: + start = p; + state = PCDATA; + continue; + } + break; + case PCDATA: + if( c == '<' ) { + callb->pcdata(String(start,p-start).dup()); + nsubs++; + state = IGNORE_SPACES; + next = BEGIN_NODE; + } + break; + case CDATA: + if( c == ']' && p[1] == ']' && p[2] == '>' ) { + callb->cdata(String(start,p-start).dup()); + nsubs++; + p += 2; + state = BEGIN; + } + break; + case BEGIN_NODE: + switch( c ) { + case '!': + if( p[1] == '[' ) { + p += 2; + if( (p[0] != 'C' && p[0] != 'c') || + (p[1] != 'D' && p[1] != 'd') || + (p[2] != 'A' && p[2] != 'a') || + (p[3] != 'T' && p[3] != 't') || + (p[4] != 'A' && p[4] != 'a') || + (p[5] != '[') ) + ERROR("Expected xml(nodename,attribs); + break; + case '>': + state = CHILDS; + nsubs++; + callb->xml(nodename,attribs); + break; + default: + state = ATTRIB_NAME; + start = p; + continue; + } + break; + case ATTRIB_NAME: + if( !is_valid_char(c) ) { + if( start == p ) + ERROR("Expected attribute name"); + aname = String(start,p-start).dup(); + if( attribs->__Field(aname,hx::paccDynamic) != null() ) + ERROR("Duplicate attribute"); + state = IGNORE_SPACES; + next = EQUALS; + continue; + } + break; + case EQUALS: + switch( c ) { + case '=': + state = IGNORE_SPACES; + next = ATTVAL_BEGIN; + break; + default: + ERROR("Expected ="); + } + break; + case ATTVAL_BEGIN: + switch( c ) { + case '"': + case '\'': + state = ATTRIB_VAL; + start = p; + break; + default: + ERROR("Expected \""); + } + break; + case ATTRIB_VAL: + if( c == *start ) { + attribs->Add( aname, String(start+1,p-start-1).dup() ); + state = IGNORE_SPACES; + next = BODY; + } + break; + case CHILDS: + *lp = p; + do_parse_xml(xml,lp,line,callb,nodename); + p = *lp; + start = p; + state = BEGIN; + break; + case WAIT_END: + switch( c ) { + case '>': + callb->done(); + state = BEGIN; + break; + default : + ERROR("Expected >"); + } + break; + case WAIT_END_RET: + switch( c ) { + case '>': + if( nsubs == 0 ) + callb->pcdata(HX_CSTRING("")); + *lp = p; + return; + default : + ERROR("Expected >"); + } + break; + case CLOSE: + if( !is_valid_char(c) ) { + if( start == p ) + ERROR("Expected node name"); + { + String v = String(start,p - start).dup(); + if( strcmpi(parentname.__s,v.__s) != 0 ) { + ERRORSTR(HX_CSTRING("Expected ")); + } + } + state = IGNORE_SPACES; + next = WAIT_END_RET; + continue; + } + break; + case COMMENT: + if( c == '-' && p[1] == '-' && p[2] == '>' ) { + callb->comment(String(start,p-start).dup()); + p += 2; + state = BEGIN; + } + break; + case DOCTYPE: + if( c == '[' ) + nbrackets++; + else if( c == ']' ) + nbrackets--; + else if( c == '>' && nbrackets == 0 ) { + callb->doctype(String(start,p-start).dup()); + state = BEGIN; + } + break; + case HEADER: + if( c == '?' && p[1] == '>' ) { + p++; + callb->comment(String(start,p-start).dup()); + state = BEGIN; + } + break; + } + c = *++p; + if( c == '\n' ) + (*line)++; + } + if( state == BEGIN ) { + start = p; + state = PCDATA; + } + if( parentname.__s == 0 && state == PCDATA ) { + if( p != start || nsubs == 0 ) + callb->pcdata(String(start,p-start).dup()); + return; + } + ERROR("Unexpected end"); +} + +// ---------------------------------------------- + +/** + +

Xml

+

+ The standard event-driven XML parser. +

+
+**/ + +/** + parse_xml : xml:string -> events:object -> void + + The [parse_xml] parse a string and for each parsed element call the + corresponding object method in [events] : +
    +
  • [void xml( name : string, attribs : object)] when an XML node is found
  • +
  • [void done()] when an XML node is closed
  • +
  • [void pcdata(string)] when PCData chars found
  • +
  • [void cdata(string)] when a CData session is found
  • +
  • [void comment(string)] when some comment or special header is found
  • +
+ You can then implement the events so they build the appropriate XML data + structure needed by your language. +
+**/ +static void parse_xml( String str, cpp::NativeXmlState state ) +{ + int line = 0; + const char *p = str.__s; + // skip BOM + if( p[0] == (char)0xEF && p[1] == (char)0xBB && p[2] == (char)0xBF ) + p += 3; + do_parse_xml(p,&p,&line,state,String()); +} + + diff --git a/build/linux64_569e52e/std/cpp/Object.hx b/build/linux64_569e52e/std/cpp/Object.hx new file mode 100644 index 0000000..e1adaf9 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Object.hx @@ -0,0 +1,26 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:noPackageRestrict +typedef Object = Dynamic; diff --git a/build/linux64_569e52e/std/cpp/ObjectType.hx b/build/linux64_569e52e/std/cpp/ObjectType.hx new file mode 100644 index 0000000..a403984 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/ObjectType.hx @@ -0,0 +1,39 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +extern class ObjectType { + inline static var vtUnknown = -1; + inline static var vtInt = 0xff; + inline static var vtNull = 0; + inline static var vtFloat = 1; + inline static var vtBool = 2; + inline static var vtString = 3; + inline static var vtObject = 4; + inline static var vtArray = 5; + inline static var vtFunction = 6; + inline static var vtEnum = 7; + inline static var vtClass = 8; + inline static var vtInt64 = 9; + inline static var vtAbstractBase = 0x100; +} diff --git a/build/linux64_569e52e/std/cpp/Pointer.hx b/build/linux64_569e52e/std/cpp/Pointer.hx new file mode 100644 index 0000000..5b6e370 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Pointer.hx @@ -0,0 +1,86 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +import haxe.extern.AsVar; + +@:coreType +@:semantics(variable) +extern class Pointer extends ConstPointer implements ArrayAccess { + var ref(get, set):Reference; + + function get_ref():Reference; + function set_ref(t:T):Reference; + + function setAt(inIndex:Int, value:T):Void; + + static function fromRaw(ptr:RawPointer):Pointer; + + @:native("::cpp::Pointer_obj::fromRaw") + static function fromStar(star:Star):Pointer; + + @:native("::cpp::Pointer_obj::fromHandle") + static function nativeFromHandle(inHandle:Dynamic, ?inKind:String):AutoCast; + inline static function fromHandle(inHandle:Dynamic, ?inKind:String):Pointer { + return cast nativeFromHandle(inHandle, inKind); + } + + static function fromPointer(inNativePointer:Dynamic):Pointer; + + static function addressOf(inVariable:cpp.Reference):Pointer; + + static function endOf(inVariable:T):Pointer; + + @:native("::cpp::Pointer_obj::arrayElem") + static function nativeArrayElem(array:Array, inElem:Int):AutoCast; + inline static function arrayElem(array:Array, inElem:Int):Pointer { + return cast nativeArrayElem(array, inElem); + } + + @:native("::cpp::Pointer_obj::ofArray") + static function nativeOfArray(array:Array):AutoCast; + inline static function ofArray(array:Array):Pointer { + return cast nativeOfArray(array); + } + + inline function toUnmanagedArray(elementCount:Int):Array { + var result = new Array(); + NativeArray.setUnmanagedData(result, this, elementCount); + return result; + } + + inline function toUnmanagedVector(elementCount:Int):haxe.ds.Vector + return cast toUnmanagedArray(elementCount); + + override function inc():Pointer; + override function dec():Pointer; + override function incBy(inT:Int):Pointer; + override function decBy(inT:Int):Pointer; + override function add(inT:Int):Pointer; + override function sub(inT:Int):Pointer; + + function postIncRef():Reference; + + function destroy():Void; + function destroyArray():Void; +} diff --git a/build/linux64_569e52e/std/cpp/Prime.hx b/build/linux64_569e52e/std/cpp/Prime.hx new file mode 100644 index 0000000..ecc2bac --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Prime.hx @@ -0,0 +1,117 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +#if macro +import haxe.macro.Context; +import haxe.macro.Type; +import haxe.macro.Expr; +#end + +@:noPackageRestrict +class Prime { + #if (!macro && cpp) + public static function _loadPrime(lib:String, prim:String, signature:String, quietFail = false):Dynamic { + var factory:CallableObject> = untyped __global__.__hxcpp_cast_get_proc_address(lib, prim + "__prime", quietFail); + if (factory != null) { + var func:Dynamic = factory.call(signature); + if (func == null && !quietFail) + throw '$prim does not have signature $signature'; + return func; + } + return null; + } + #end + + #if (macro) + static function codeToType(code:String, forCpp:Bool):String { + if (code == "c" && !forCpp) + throw "const char * type only supported in cpp mode"; + + switch (code) { + case "b": + return "Bool"; + case "i": + return "Int"; + case "d": + return "Float"; + case "s": + return "String"; + case "f": + return forCpp ? "cpp.Float32" : "Float"; + case "o": + return forCpp ? "cpp.Object" : "Dynamic"; + case "v": + return forCpp ? "cpp.Void" : "Dynamic"; + case "c": + return "cpp.ConstCharStar"; + default: + throw "Unknown signature type :" + code; + } + } + #end + + public static function nekoInit(inModuleName:String):Bool { + #if neko + var init = neko.Lib.load(inModuleName, "neko_init", 5); + + if (init != null) { + init(function(s) return new String(s), function(len:Int) { + var r = []; + if (len > 0) + r[len - 1] = null; + return r; + }, null, true, false); + return true; + } + #end + return false; + } + + public static macro function load(inModule:String, inName:String, inSig:String, inAllowFail:Bool = false) { + var parts = inSig.split(""); + if (parts.length < 1) + throw "Invalid function signature " + inSig; + var argCount = parts.length - 1; + + var cppiaMode = Context.defined("cppia"); + var cppMode = Context.defined("cpp") && !cppiaMode; + + var typeString = parts.length == 1 ? "Void" : codeToType(parts.shift(), cppMode); + for (p in parts) + typeString += "->" + codeToType(p, cppMode); + + if (cppMode) { + typeString = "cpp.Callable<" + typeString + ">"; + var expr = 'new $typeString(cpp.Prime._loadPrime("$inModule","$inName","$inSig",$inAllowFail))'; + return Context.parse(expr, Context.currentPos()); + } else { + if (argCount > 5) + argCount = -1; + var lazy = inAllowFail ? "loadLazy" : "load"; + var lib = cppiaMode ? "cpp" : "neko"; + var expr = 'new cpp.Callable<$typeString>($lib.Lib.$lazy("$inModule","$inName",$argCount))'; + return Context.parse(expr, Context.currentPos()); + } + } +} diff --git a/build/linux64_569e52e/std/cpp/Random.hx b/build/linux64_569e52e/std/cpp/Random.hx new file mode 100644 index 0000000..5ecbdfc --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Random.hx @@ -0,0 +1,43 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +class Random { + var r:Dynamic; + + public function new() { + r = cpp.NativeRandom.random_new(); + } + + public function setSeed(s:Int) { + cpp.NativeRandom.random_set_seed(r, s); + } + + public function int(max:Int):Int { + return cpp.NativeRandom.random_int(r, max); + } + + public function float():Float { + return cpp.NativeRandom.random_float(r); + } +} diff --git a/build/linux64_569e52e/std/cpp/RawConstPointer.hx b/build/linux64_569e52e/std/cpp/RawConstPointer.hx new file mode 100644 index 0000000..5e6a007 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/RawConstPointer.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:unreflective +extern class RawConstPointer implements ArrayAccess { + @:native("::hx::AddressOf") + static function addressOf(t:T):RawConstPointer; +} diff --git a/build/linux64_569e52e/std/cpp/RawPointer.hx b/build/linux64_569e52e/std/cpp/RawPointer.hx new file mode 100644 index 0000000..a75e80f --- /dev/null +++ b/build/linux64_569e52e/std/cpp/RawPointer.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:unreflective +extern class RawPointer extends RawConstPointer { + @:native("::hx::AddressOf") + static function addressOf(t:T):RawPointer; +} diff --git a/build/linux64_569e52e/std/cpp/Reference.hx b/build/linux64_569e52e/std/cpp/Reference.hx new file mode 100644 index 0000000..c1ad6d0 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Reference.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +/** + Allows haxe to type result correctly, and hxcpp can recognise this and + prevent unwanted casting. +**/ +@:semantics(reference) +typedef Reference = T; diff --git a/build/linux64_569e52e/std/cpp/Rest.hx b/build/linux64_569e52e/std/cpp/Rest.hx new file mode 100644 index 0000000..f111b35 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Rest.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +abstract Rest(Array) {} \ No newline at end of file diff --git a/build/linux64_569e52e/std/cpp/SizeT.hx b/build/linux64_569e52e/std/cpp/SizeT.hx new file mode 100644 index 0000000..3892c6a --- /dev/null +++ b/build/linux64_569e52e/std/cpp/SizeT.hx @@ -0,0 +1,27 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:native("size_t") +@:scalar @:coreType @:notNull +extern abstract SizeT from(Int) to(Int) {} diff --git a/build/linux64_569e52e/std/cpp/Star.hx b/build/linux64_569e52e/std/cpp/Star.hx new file mode 100644 index 0000000..2e60be2 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Star.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +/** + Allows haxe to type result correctly, and hxcpp can recognise this use the + correct type. +**/ +typedef Star = Null; diff --git a/build/linux64_569e52e/std/cpp/StdString.hx b/build/linux64_569e52e/std/cpp/StdString.hx new file mode 100644 index 0000000..4bfe9b7 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/StdString.hx @@ -0,0 +1,49 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +using cpp.NativeString; + +@:native("::hx::StdString") +@:include("hx/StdString.h") +@:stackOnly +@:structAccess +@:unreflective +extern class StdString { + @:native("std::string::npos") + static var npos(default, null):Int; + + // function new(inData:StdStringData); + @:native("::hx::StdString") + static function ofString(s:String):StdString; + + // function toString():String; + // function find(s:String):Int; + // function substr(pos:Int, len:Int):StdString; + function c_str():ConstPointer; + function size():Int; + function find(s:String):Int; + function substr(pos:Int, len:Int):StdString; + function toString():String; + function toStdString():StdString; +} diff --git a/build/linux64_569e52e/std/cpp/StdStringRef.hx b/build/linux64_569e52e/std/cpp/StdStringRef.hx new file mode 100644 index 0000000..c003253 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/StdStringRef.hx @@ -0,0 +1,37 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +using cpp.NativeString; + +@:native("::hx::StdString const &") +@:include("hx/StdString.h") +@:structAccess +extern class StdStringRef { + function c_str():ConstPointer; + function size():Int; + function find(s:String):Int; + function substr(pos:Int, len:Int):StdString; + function toString():String; + function toStdString():StdString; +} diff --git a/build/linux64_569e52e/std/cpp/Stdio.hx b/build/linux64_569e52e/std/cpp/Stdio.hx new file mode 100644 index 0000000..453edae --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Stdio.hx @@ -0,0 +1,41 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:include("stdio.h") +extern class Stdio { + @:native("printf") + static function printf(format:ConstCharStar, rest:Rest):Void; + + @:native("fopen") + static function fopen(filename:ConstCharStar, mode:ConstCharStar):FILE; + + @:native("fwrite") + static function fwrite(data:RawPointer, elemSize:SizeT, elemCount:SizeT, file:FILE):SizeT; + + @:native("fclose") + static function fclose(file:FILE):Int; + + @:native("fprintf") + static function fprintf(file:FILE, format:ConstCharStar, rest:Rest):Void; +} diff --git a/build/linux64_569e52e/std/cpp/Stdlib.hx b/build/linux64_569e52e/std/cpp/Stdlib.hx new file mode 100644 index 0000000..c59f655 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Stdlib.hx @@ -0,0 +1,59 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:include("stdlib.h") +extern class Stdlib { + @:native("malloc") + static function nativeMalloc(bytes:Int):cpp.RawPointer; + @:native("calloc") + static function nativeCalloc(bytes:Int):cpp.RawPointer; + @:native("realloc") + static function nativeRealloc(inPtr:cpp.RawPointer, bytes:Int):cpp.RawPointer; + @:native("free") + static function nativeFree(ptr:cpp.RawPointer):Void; + @:native("memcpy") + static function nativeMemcpy(dest:cpp.RawPointer, src:cpp.RawConstPointer, bytes:Int):Void; + + @:native("::hx::ClassSizeOf") @:templatedCall + static function sizeof(t:T):Int; + + inline static function memcpy(dest:cpp.Pointer, src:cpp.ConstPointer, bytes:Int):Void + nativeMemcpy(cast dest.ptr, cast src.ptr, bytes); + + inline static function malloc(bytes:Int):cpp.Pointer + return cast nativeMalloc(bytes); + + inline static function calloc(bytes:Int):cpp.Pointer + return cast nativeCalloc(bytes); + + inline static function realloc(ioPtr:cpp.Pointer, bytes:Int):Void + ioPtr.setRaw(nativeRealloc(cast ioPtr.ptr, bytes)); + + inline static function free(ptr:cpp.Pointer):Void { + if (ptr != null) { + nativeFree(cast ptr.ptr); + ptr.ptr = null; + } + } +} diff --git a/build/linux64_569e52e/std/cpp/Struct.hx b/build/linux64_569e52e/std/cpp/Struct.hx new file mode 100644 index 0000000..957857a --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Struct.hx @@ -0,0 +1,28 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +/** + Wraps external types with a class that integrates with Dynamic. +**/ +typedef Struct = T; diff --git a/build/linux64_569e52e/std/cpp/UInt16.hx b/build/linux64_569e52e/std/cpp/UInt16.hx new file mode 100644 index 0000000..b155b9b --- /dev/null +++ b/build/linux64_569e52e/std/cpp/UInt16.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:coreType @:notNull @:runtimeValue abstract UInt16 from Int to Int {} diff --git a/build/linux64_569e52e/std/cpp/UInt32.hx b/build/linux64_569e52e/std/cpp/UInt32.hx new file mode 100644 index 0000000..e5dd135 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/UInt32.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:coreType @:notNull @:runtimeValue abstract UInt32 from Int to Int {} diff --git a/build/linux64_569e52e/std/cpp/UInt64.hx b/build/linux64_569e52e/std/cpp/UInt64.hx new file mode 100644 index 0000000..8392a94 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/UInt64.hx @@ -0,0 +1,40 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:coreType @:notNull @:runtimeValue abstract UInt64 from Int { + + /** + Destructively cast to Int + **/ + public inline function toInt():Int { + return cast this; + } + + @:to + @:deprecated("Implicit cast from UInt64 to Int (32 bits) is deprecated. Use .toInt() or explicitly cast instead.") + inline function implicitToInt(): Int { + return toInt(); + } + +} diff --git a/build/linux64_569e52e/std/cpp/UInt8.hx b/build/linux64_569e52e/std/cpp/UInt8.hx new file mode 100644 index 0000000..d19bed9 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/UInt8.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:coreType @:notNull @:runtimeValue abstract UInt8 from Int to Int {} diff --git a/build/linux64_569e52e/std/cpp/VarArg.hx b/build/linux64_569e52e/std/cpp/VarArg.hx new file mode 100644 index 0000000..41af99d --- /dev/null +++ b/build/linux64_569e52e/std/cpp/VarArg.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +/** + Allows haxe to type params correctly, and hxcpp can recognise this use the + correct type. +**/ +typedef VarArg = Dynamic; diff --git a/build/linux64_569e52e/std/cpp/VirtualArray.hx b/build/linux64_569e52e/std/cpp/VirtualArray.hx new file mode 100644 index 0000000..3f66162 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/VirtualArray.hx @@ -0,0 +1,136 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:native("cpp::VirtualArray") +@:coreType extern class NativeVirtualArray implements ArrayAccess { + function new():Void; + var length(get, null):Int; + // concat( a:Array ) : Array ? + function concat(a:VirtualArray):VirtualArray; + function join(sep:String):String; + function pop():Dynamic; + function push(x:Dynamic):Int; + function reverse():Void; + function shift():Dynamic; + function slice(pos:Int, ?end:Int):VirtualArray; + function sort(f:Dynamic->Dynamic->Int):Void; + function splice(pos:Int, len:Int):VirtualArray; + function toString():String; + function unshift(x:Dynamic):Void; + function insert(pos:Int, x:Dynamic):Void; + function remove(x:Dynamic):Bool; + function indexOf(x:Dynamic, ?fromIndex:Int):Int; + function lastIndexOf(x:Dynamic, ?fromIndex:Int):Int; + function copy():VirtualArray; + function iterator():Iterator; + function keyValueIterator():KeyValueIterator; + function map(f:Dynamic->S):VirtualArray; + function filter(f:Dynamic->Bool):VirtualArray; + function resize(len:Int):Void; +} + +abstract VirtualArray(NativeVirtualArray) { + // Add these two functions... + @:from extern inline static public function fromArray(a:Array):VirtualArray + return untyped a; + + @:to extern inline public function toArray():Array + return untyped this; + + // The rest is just boiler-plate + inline public function new() + this = new NativeVirtualArray(); + + @:arrayAccess extern inline function get(idx:Int):Dynamic + return untyped this[idx]; + + @:arrayAccess extern inline function set(pos:Int, value:T):T + return untyped this[idx] = value; + + public var length(get, never):Int; + + extern inline public function get_length():Int + return this.length; + + // concat( a:Array ) : Array ? + extern inline public function concat(a:VirtualArray):VirtualArray + return this.concat(a); + + extern inline public function join(sep:String):String + return this.join(sep); + + extern inline public function pop():Dynamic + return this.pop(); + + extern inline public function push(x:Dynamic):Int + return this.push(x); + + extern inline public function reverse():Void + this.reverse(); + + extern inline public function shift():Dynamic + return this.shift(); + + extern inline public function slice(pos:Int, ?end:Int):VirtualArray + return this.slice(pos, end); + + extern inline public function sort(f:Dynamic->Dynamic->Int):Void + this.sort(f); + + extern inline public function splice(pos:Int, len:Int):VirtualArray + return this.slice(pos, len); + + extern inline public function unshift(x:Dynamic):Void + this.unshift(x); + + extern inline public function insert(pos:Int, x:Dynamic):Void + this.insert(pos, x); + + extern inline public function remove(x:Dynamic):Bool + return this.remove(x); + + extern inline public function indexOf(x:Dynamic, ?fromIndex:Int):Int + return this.indexOf(x, fromIndex); + + extern inline public function lastIndexOf(x:Dynamic, ?fromIndex:Int):Int + return this.lastIndexOf(x, fromIndex); + + extern inline public function copy():VirtualArray + return this.copy(); + + extern inline public function iterator():Iterator + return this.iterator(); + + extern inline public function keyValueIterator():KeyValueIterator + return this.keyValueIterator(); + + extern inline public function map(f:Dynamic->S):VirtualArray + return this.map(f); + + extern inline public function filter(f:Dynamic->Bool):VirtualArray + return this.filter(f); + + extern inline public function resize(len:Int):Void + return this.resize(len); +} diff --git a/build/linux64_569e52e/std/cpp/Void.hx b/build/linux64_569e52e/std/cpp/Void.hx new file mode 100644 index 0000000..d002c53 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/Void.hx @@ -0,0 +1,26 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp; + +@:native("void") +extern class Void {} diff --git a/build/linux64_569e52e/std/cpp/_std/Date.hx b/build/linux64_569e52e/std/cpp/_std/Date.hx new file mode 100644 index 0000000..3556b10 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/Date.hx @@ -0,0 +1,128 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +@:coreApi class Date { + private var mSeconds:Float; + + public function new(year:Int, month:Int, day:Int, hour:Int, min:Int, sec:Int):Void { + mSeconds = untyped __global__.__hxcpp_new_date(year, month, day, hour, min, sec); + } + + public function getTime():Float { + return mSeconds * 1000.0; + } + + public function getHours():Int { + return untyped __global__.__hxcpp_get_hours(mSeconds); + } + + public function getMinutes():Int { + return untyped __global__.__hxcpp_get_minutes(mSeconds); + } + + public function getSeconds():Int { + return untyped __global__.__hxcpp_get_seconds(mSeconds); + } + + public function getFullYear():Int { + return untyped __global__.__hxcpp_get_year(mSeconds); + } + + public function getMonth():Int { + return untyped __global__.__hxcpp_get_month(mSeconds); + } + + public function getDate():Int { + return untyped __global__.__hxcpp_get_date(mSeconds); + } + + public function getDay():Int { + return untyped __global__.__hxcpp_get_day(mSeconds); + } + + public function getUTCHours():Int { + return untyped __global__.__hxcpp_get_utc_hours(mSeconds); + } + + public function getUTCMinutes():Int { + return untyped __global__.__hxcpp_get_utc_minutes(mSeconds); + } + + public function getUTCSeconds():Int { + return untyped __global__.__hxcpp_get_utc_seconds(mSeconds); + } + + public function getUTCFullYear():Int { + return untyped __global__.__hxcpp_get_utc_year(mSeconds); + } + + public function getUTCMonth():Int { + return untyped __global__.__hxcpp_get_utc_month(mSeconds); + } + + public function getUTCDate():Int { + return untyped __global__.__hxcpp_get_utc_date(mSeconds); + } + + public function getUTCDay():Int { + return untyped __global__.__hxcpp_get_utc_day(mSeconds); + } + + public function getTimezoneOffset():Int { + return -Std.int((untyped __global__.__hxcpp_timezone_offset(mSeconds)) / 60); + } + + public function toString():String { + return untyped __global__.__hxcpp_to_string(mSeconds); + } + + public static function now():Date { + return fromTime(untyped __global__.__hxcpp_date_now() * 1000.0); + } + + private static function new1(t:Dynamic):Date { + return new Date(2005, 1, 1, 0, 0, 0); + } + + public static function fromTime(t:Float):Date { + var result = new Date(0, 0, 0, 0, 0, 0); + result.mSeconds = t * 0.001; + return result; + } + + public static function fromString(s:String):Date { + switch (s.length) { + case 8: // hh:mm:ss + var k = s.split(":"); + return Date.fromTime(Std.parseInt(k[0]) * 3600000. + Std.parseInt(k[1]) * 60000. + Std.parseInt(k[2]) * 1000.); + case 10: // YYYY-MM-DD + var k = s.split("-"); + return new Date(Std.parseInt(k[0]), Std.parseInt(k[1]) - 1, Std.parseInt(k[2]), 0, 0, 0); + case 19: // YYYY-MM-DD hh:mm:ss + var k = s.split(" "); + var y = k[0].split("-"); + var t = k[1].split(":"); + return new Date(Std.parseInt(y[0]), Std.parseInt(y[1]) - 1, Std.parseInt(y[2]), Std.parseInt(t[0]), Std.parseInt(t[1]), Std.parseInt(t[2])); + default: + throw "Invalid date format : " + s; + } + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/EReg.hx b/build/linux64_569e52e/std/cpp/_std/EReg.hx new file mode 100644 index 0000000..b671550 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/EReg.hx @@ -0,0 +1,193 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +@:buildXml('') +@:coreApi class EReg { + var r:Dynamic; + var last:String; + var global:Bool; + + public function new(r:String, opt:String):Void { + var a = opt.split("g"); + global = a.length > 1; + if (global) + opt = a.join(""); + this.r = _hx_regexp_new_options(r, opt); + } + + public function match(s:String):Bool { + var p = _hx_regexp_match(r, s, 0, s.length); + if (p) + last = s; + else + last = null; + return p; + } + + public function matched(n:Int):String { + var m = _hx_regexp_matched(r, n); + return m; + } + + public function matchedLeft():String { + var p = _hx_regexp_matched_pos(r, 0); + return last.substr(0, p.pos); + } + + public function matchedRight():String { + var p = _hx_regexp_matched_pos(r, 0); + var sz = p.pos + p.len; + return last.substr(sz, last.length - sz); + } + + public function matchedPos():{pos:Int, len:Int} { + return _hx_regexp_matched_pos(r, 0); + } + + public function matchSub(s:String, pos:Int, len:Int = -1):Bool { + var p = _hx_regexp_match(r, s, pos, len < 0 ? s.length - pos : len); + if (p) + last = s; + else + last = null; + return p; + } + + public function split(s:String):Array { + var pos = 0; + var len = s.length; + var a = new Array(); + var first = true; + do { + if (!_hx_regexp_match(r, s, pos, len)) + break; + var p = _hx_regexp_matched_pos(r, 0); + if (p.len == 0 && !first) { + if (p.pos == s.length) + break; + p.pos += 1; + } + a.push(s.substr(pos, p.pos - pos)); + var tot = p.pos + p.len - pos; + pos += tot; + len -= tot; + first = false; + } while (global); + a.push(s.substr(pos, len)); + return a; + } + + public function replace(s:String, by:String):String { + var b = new StringBuf(); + var pos = 0; + var len = s.length; + var a = by.split("$"); + var first = true; + do { + if (!_hx_regexp_match(r, s, pos, len)) + break; + var p = _hx_regexp_matched_pos(r, 0); + if (p.len == 0 && !first) { + if (p.pos == s.length) + break; + p.pos += 1; + } + b.addSub(s, pos, p.pos - pos); + if (a.length > 0) + b.add(a[0]); + var i = 1; + while (i < a.length) { + var k = a[i]; + var c = k.charCodeAt(0); + // 1...9 + if (c >= 49 && c <= 57) { + var p = try _hx_regexp_matched_pos(r, Std.int(c) - 48) catch (e:String) null; + if (p == null) { + b.add("$"); + b.add(k); + } else { + b.addSub(s, p.pos, p.len); + b.addSub(k, 1, k.length - 1); + } + } else if (c == null) { + b.add("$"); + i++; + var k2 = a[i]; + if (k2 != null && k2.length > 0) + b.add(k2); + } else + b.add("$" + k); + i++; + } + var tot = p.pos + p.len - pos; + pos += tot; + len -= tot; + first = false; + } while (global); + b.addSub(s, pos, len); + return b.toString(); + } + + public function map(s:String, f:EReg->String):String { + var offset = 0; + var buf = new StringBuf(); + do { + if (offset >= s.length) + break; + else if (!matchSub(s, offset)) { + buf.add(s.substr(offset)); + break; + } + var p = _hx_regexp_matched_pos(r, 0); + buf.add(s.substr(offset, p.pos - offset)); + buf.add(f(this)); + if (p.len == 0) { + buf.add(s.substr(p.pos, 1)); + offset = p.pos + 1; + } else + offset = p.pos + p.len; + } while (global); + if (!global && offset > 0 && offset < s.length) + buf.add(s.substr(offset)); + return buf.toString(); + } + + public static function escape(s:String):String { + return escapeRegExpRe.map(s, function(r) return "\\" + r.matched(0)); + } + + static var escapeRegExpRe = ~/[\[\]{}()*+?.\\\^$|]/g; + + function toString():String + return 'EReg($r)'; + + @:native("_hx_regexp_new_options") + extern static function _hx_regexp_new_options(s:String, options:String):Dynamic; + + @:native("_hx_regexp_match") + extern static function _hx_regexp_match(handler:Dynamic, string:String, pos:Int, len:Int):Bool; + + @:native("_hx_regexp_matched") + extern static function _hx_regexp_matched(handle:Dynamic, pos:Int):String; + + @:native("_hx_regexp_matched_pos") + extern static function _hx_regexp_matched_pos(handle:Dynamic, match:Int):{pos:Int, len:Int}; +} diff --git a/build/linux64_569e52e/std/cpp/_std/Reflect.hx b/build/linux64_569e52e/std/cpp/_std/Reflect.hx new file mode 100644 index 0000000..8f0c775 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/Reflect.hx @@ -0,0 +1,129 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +import cpp.ObjectType; + +@:coreApi +@:analyzer(ignore) +class Reflect { + public static function hasField(o:Dynamic, field:String):Bool + untyped { + return o != null && o.__HasField(field); + } + + public static function field(o:Dynamic, field:String):Dynamic + untyped { + return (o == null) ? null : o.__Field(field, untyped __cpp__("::hx::paccNever")); + } + + public static function setField(o:Dynamic, field:String, value:Dynamic):Void + untyped { + if (o != null) + o.__SetField(field, value, untyped __cpp__("::hx::paccNever")); + } + + public static function getProperty(o:Dynamic, field:String):Dynamic { + return (o == null) ? null : o.__Field(field, untyped __cpp__("::hx::paccAlways")); + } + + public static function setProperty(o:Dynamic, field:String, value:Dynamic):Void { + if (o != null) + o.__SetField(field, value, untyped __cpp__("::hx::paccAlways")); + } + + public static function callMethod(o:Dynamic, func:haxe.Constraints.Function, args:Array):Dynamic + untyped { + if (func != null && func.__GetType() == ObjectType.vtString) { + if (o == null) + throw cpp.ErrorConstants.invalidObject; + func = o.__Field(func, untyped __cpp__("::hx::paccDynamic")); + } + if (func == null) + throw cpp.ErrorConstants.nullFunctionPointer; + untyped func.__SetThis(o); + return untyped func.__Run(args); + } + + public static function fields(o:Dynamic):Array + untyped { + if (o == null) + return new Array(); + var a:Array = []; + o.__GetFields(a); + return a; + } + + public static function isFunction(f:Dynamic):Bool + untyped { + return f != null && f.__GetType() == ObjectType.vtFunction; + } + + public static function compare(a:T, b:T):Int { + return (a == b) ? 0 : (((a : Dynamic) > (b : Dynamic)) ? 1 : -1); + } + + public static function compareMethods(f1:Dynamic, f2:Dynamic):Bool { + if (f1 == f2) + return true; + if (!isFunction(f1) || !isFunction(f2)) + return false; + return untyped __global__.__hxcpp_same_closure(f1, f2); + } + + public static function isObject(v:Dynamic):Bool + untyped { + if (v == null) + return false; + var t:Int = v.__GetType(); + return t == ObjectType.vtObject || t == ObjectType.vtClass || t == ObjectType.vtString || t == ObjectType.vtArray; + } + + public static function isEnumValue(v:Dynamic):Bool + untyped { + return v != null && v.__GetType() == ObjectType.vtEnum; + } + + public static function deleteField(o:Dynamic, field:String):Bool + untyped { + if (o == null) + return false; + return untyped __global__.__hxcpp_anon_remove(o, field); + } + + public static function copy(o:Null):Null { + if (o == null) + return null; + if (untyped o.__GetType() == ObjectType.vtString) + return o; + if (untyped o.__GetType() == ObjectType.vtArray) + return untyped o.__Field("copy", untyped __cpp__("::hx::paccDynamic"))(); + var o2:Dynamic = {}; + for (f in Reflect.fields(o)) + Reflect.setField(o2, f, Reflect.field(o, f)); + return o2; + } + + @:overload(function(f:Array->Void):Dynamic {}) + public static function makeVarArgs(f:Array->Dynamic):Dynamic { + return untyped __global__.__hxcpp_create_var_args(f); + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/Std.hx b/build/linux64_569e52e/std/cpp/_std/Std.hx new file mode 100644 index 0000000..9545855 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/Std.hx @@ -0,0 +1,63 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +@:headerClassCode("\t\tstatic inline String string(String &s) { return s; }") +@:coreApi class Std { + @:deprecated('Std.is is deprecated. Use Std.isOfType instead.') + @:keep public static inline function is(v:Dynamic, t:Dynamic):Bool { + return isOfType(v, t); + } + + public static function isOfType(v:Dynamic, t:Dynamic):Bool { + return untyped __global__.__instanceof(v, t); + } + + @:keep public static function downcast(value:T, c:Class):S { + return Std.isOfType(value, c) ? cast value : null; + } + + @:deprecated('Std.instance() is deprecated. Use Std.downcast() instead.') + @:keep public static function instance(value:T, c:Class):S { + return inline downcast(value, c); + } + + @:keep public static function string(s:Dynamic):String { + return untyped s == null ? "null" : s.toString(); + } + + @:keep public static function int(x:Float):Int { + return untyped __global__.__int__(x); + } + + @:keep public static function parseInt(x:String):Null { + return untyped __global__.__hxcpp_parse_int(x); + } + + @:keep public static function parseFloat(x:String):Float { + return untyped __global__.__hxcpp_parse_float(x); + } + + @:keep public static function random(x:Int):Int { + if (x <= 0) + return 0; + return untyped __global__.__hxcpp_irand(x); + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/StringBuf.hx b/build/linux64_569e52e/std/cpp/_std/StringBuf.hx new file mode 100644 index 0000000..aca39e2 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/StringBuf.hx @@ -0,0 +1,101 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +import cpp.NativeString; + +using cpp.NativeArray; + +@:coreApi +class StringBuf { + private var b:Array; + + public var length(get, never):Int; + + var charBuf:Array; + + public function new():Void {} + + private function charBufAsString():String { + var len = charBuf.length; + charBuf.push(0); + return NativeString.fromGcPointer(charBuf.address(0), len); + } + + private function flush():Void { + if (b == null) + b = [charBufAsString()]; + else + b.push(charBufAsString()); + charBuf = null; + } + + function get_length():Int { + var len = 0; + if (charBuf != null) + len = charBuf.length; + if (b != null) + for (s in b) + len += s == null ? 4 : s.length; + return len; + } + + public inline function add(x:T):Void { + if (charBuf != null) + flush(); + if (b == null) + b = [Std.string(x)]; + else + b.push(Std.string(x)); + } + + public #if !cppia inline #end function addSub(s:String, pos:Int, ?len:Int):Void { + if (charBuf != null) + flush(); + if (b == null) + b = [s.substr(pos, len)]; + else + b.push(s.substr(pos, len)); + } + + public #if !cppia inline #end function addChar(c:Int):Void { + #if hxcpp_smart_strings + if (c >= 127) + add(String.fromCharCode(c)); + else + #end + { + if (charBuf == null) + charBuf = new Array(); + charBuf.push(c); + } + } + + public function toString():String { + if (charBuf != null) + flush(); + if (b == null || b.length == 0) + return ""; + if (b.length == 1) + return b[0]; + return b.join(""); + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/Sys.hx b/build/linux64_569e52e/std/cpp/_std/Sys.hx new file mode 100644 index 0000000..3ee99b5 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/Sys.hx @@ -0,0 +1,138 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +import cpp.NativeSys; +import haxe.SysTools; + +@:coreApi class Sys { + public static function print(v:Dynamic):Void { + untyped __global__.__hxcpp_print(v); + } + + public static function println(v:Dynamic):Void { + untyped __global__.__hxcpp_println(v); + } + + @:access(sys.io.FileInput) + public static function stdin():haxe.io.Input { + return new sys.io.FileInput(cpp.NativeFile.file_stdin()); + } + + @:access(sys.io.FileOutput) + public static function stdout():haxe.io.Output { + return new sys.io.FileOutput(cpp.NativeFile.file_stdout()); + } + + @:access(sys.io.FileOutput) + public static function stderr():haxe.io.Output { + return new sys.io.FileOutput(cpp.NativeFile.file_stderr()); + } + + public static function getChar(echo:Bool):Int { + return NativeSys.sys_getch(echo); + } + + public static function args():Array + untyped { + return __global__.__get_args(); + } + + public static function getEnv(s:String):String { + var v = NativeSys.get_env(s); + if (v == null) + return null; + return v; + } + + public static function putEnv(s:String, v:Null):Void { + NativeSys.put_env(s, v); + } + + public static function sleep(seconds:Float):Void { + NativeSys.sys_sleep(seconds); + } + + public static function setTimeLocale(loc:String):Bool { + return NativeSys.set_time_locale(loc); + } + + public static function getCwd():String { + return NativeSys.get_cwd(); + } + + public static function setCwd(s:String):Void { + NativeSys.set_cwd(s); + } + + public static function systemName():String { + return NativeSys.sys_string(); + } + + public static function command(cmd:String, ?args:Array):Int { + if (args == null) { + return NativeSys.sys_command(cmd); + } else { + switch (systemName()) { + case "Windows": + cmd = [ + for (a in [StringTools.replace(cmd, "/", "\\")].concat(args)) + SysTools.quoteWinArg(a, true) + ].join(" "); + return NativeSys.sys_command(cmd); + case _: + cmd = [cmd].concat(args).map(SysTools.quoteUnixArg).join(" "); + return NativeSys.sys_command(cmd); + } + } + } + + public static function exit(code:Int):Void { + untyped __global__.__hxcpp_exit(code); + } + + public static function time():Float { + return NativeSys.sys_time(); + } + + public static function cpuTime():Float { + return NativeSys.sys_cpu_time(); + } + + @:deprecated("Use programPath instead") public static function executablePath():String { + return NativeSys.sys_exe_path(); + } + + public static function programPath():String { + return NativeSys.sys_exe_path(); + } + + public static function environment():Map { + var vars:Array = NativeSys.sys_env(); + var result = new haxe.ds.StringMap(); + var i = 0; + while (i < vars.length) { + result.set(vars[i], vars[i + 1]); + i += 2; + } + return result; + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/Type.hx b/build/linux64_569e52e/std/cpp/_std/Type.hx new file mode 100644 index 0000000..d0af410 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/Type.hx @@ -0,0 +1,182 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +enum ValueType { + TNull; + TInt; + TFloat; + TBool; + TObject; + TFunction; + TClass(c:Class); + TEnum(e:Enum); + TUnknown; +} + +@:coreApi class Type { + public static function getClass(o:T):Null> + untyped { + if (o == null || !Reflect.isObject(o)) + return null; + var c = o.__GetClass(); + switch (c.toString()) { + case "__Anon": + return null; + case "Class": + return null; + } + return c; + } + + public static function getEnum(o:EnumValue):Enum + untyped { + if (o == null) + return null; + return untyped o.__GetClass(); + } + + public static function getSuperClass(c:Class):Class + untyped { + return c.GetSuper(); + } + + public static function getClassName(c:Class):String { + if (c == null) + return null; + return untyped c.mName; + } + + public static function getEnumName(e:Enum):String { + return untyped e.__ToString(); + } + + public static function resolveClass(name:String):Class + untyped { + var result:Class = Class.Resolve(name); + if (result != null && result.__IsEnum()) + return null; + return result; + } + + public static function resolveEnum(name:String):Enum + untyped { + var result:Class = Class.Resolve(name); + if (result != null && !result.__IsEnum()) + return null; + return result; + } + + public static function createInstance(cl:Class, args:Array):T + untyped { + if (cl != null) + return cl.ConstructArgs(args); + return null; + } + + public static function createEmptyInstance(cl:Class):T + untyped { + return cl.ConstructEmpty(); + } + + public static function createEnum(e:Enum, constr:String, ?params:Array):T { + return untyped e.ConstructEnum(constr, params); + } + + public static function createEnumIndex(e:Enum, index:Int, ?params:Array):T { + var c = Type.getEnumConstructs(e)[index]; + if (c == null) + throw index + " is not a valid enum constructor index"; + return createEnum(e, c, params); + } + + public static function getInstanceFields(c:Class):Array { + return untyped c.GetInstanceFields(); + } + + public static function getClassFields(c:Class):Array { + return untyped c.GetClassFields(); + } + + public static function getEnumConstructs(e:Enum):Array + untyped { + return untyped e.GetClassFields(); + } + + public static function typeof(v:Dynamic):ValueType + untyped { + if (v == null) + return TNull; + var t:Int = untyped v.__GetType(); + switch (t) { + case 2: + return TBool; + case 0xFF: + return TInt; + case 1: + return TFloat; + case 6: + return TFunction; + case 4: + return TObject; + case 7: + return TEnum(v.__GetClass()); + default: + return untyped TClass(v.__GetClass()); + } + } + + @:native("__hxcpp_enum_eq") + extern private static function nativeEnumEq(a:Dynamic, b:Dynamic):Bool; + + #if !cppia inline #end + public static function enumEq(a:T, b:T):Bool + return nativeEnumEq(a,b); + + public static function enumConstructor(e:EnumValue):String { + var value:cpp.EnumBase = cast e; + return value._hx_getTag(); + } + + public static function enumParameters(e:EnumValue):Array { + var value:cpp.EnumBase = cast e; + return value._hx_getParameters(); + } + + @:native("_hx_getEnumValueIndex") + extern private static function getEnumValueIndex(e:EnumValue):Int; + + #if !cppia inline #end public static function enumIndex(e:EnumValue):Int { + return getEnumValueIndex(e); + } + + public static function allEnums(e:Enum):Array { + var names:Array = untyped e.GetClassFields(); + var enums = new Array(); + for (name in names) { + try { + var result:T = untyped e.ConstructEnum(name, null); + if (result != null) + enums.push(result); + } catch (invalidArgCount:String) {} + } + return enums; + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/haxe/Exception.hx b/build/linux64_569e52e/std/cpp/_std/haxe/Exception.hx new file mode 100644 index 0000000..92fbaf5 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/haxe/Exception.hx @@ -0,0 +1,94 @@ +package haxe; + +//TODO: extend ::std::exception +@:coreApi +class Exception { + public var message(get,never):String; + public var stack(get,never):CallStack; + public var previous(get,never):Null; + public var native(get,never):Any; + + @:noCompletion var __exceptionMessage:String; + @:noCompletion var __exceptionStack:Null; + @:noCompletion var __nativeStack:Array; + @:noCompletion @:ifFeature("haxe.Exception.get_stack") var __skipStack:Int = 0; + @:noCompletion var __nativeException:Any; + @:noCompletion var __previousException:Null; + + static function caught(value:Any):Exception { + if(Std.isOfType(value, Exception)) { + return value; + } else { + var e = new ValueException(value, null, value); + // Undo automatic __shiftStack() + e.__unshiftStack(); + return e; + } + } + + static function thrown(value:Any):Any { + if(Std.isOfType(value, Exception)) { + return (value:Exception).native; + } else { + var e = new ValueException(value); + e.__shiftStack(); + return e; + } + } + + public function new(message:String, ?previous:Exception, ?native:Any) { + __exceptionMessage = message; + __previousException = previous; + if(native != null) { + __nativeStack = NativeStackTrace.exceptionStack(); + __nativeException = native; + } else { + __nativeStack = NativeStackTrace.callStack(); + __nativeException = this; + } + } + + function unwrap():Any { + return __nativeException; + } + + public function toString():String { + return message; + } + + public function details():String { + return inline CallStack.exceptionToString(this); + } + + @:noCompletion + @:ifFeature("haxe.Exception.get_stack") + inline function __shiftStack():Void { + __skipStack++; + } + + @:noCompletion + @:ifFeature("haxe.Exception.get_stack") + inline function __unshiftStack():Void { + __skipStack--; + } + + function get_message():String { + return __exceptionMessage; + } + + function get_previous():Null { + return __previousException; + } + + final function get_native():Any { + return __nativeException; + } + + function get_stack():CallStack { + return switch __exceptionStack { + case null: __exceptionStack = NativeStackTrace.toHaxe(__nativeStack, __skipStack); + case s: s; + } + } +} + diff --git a/build/linux64_569e52e/std/cpp/_std/haxe/Int64.hx b/build/linux64_569e52e/std/cpp/_std/haxe/Int64.hx new file mode 100644 index 0000000..fe9f1c9 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/haxe/Int64.hx @@ -0,0 +1,418 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +@:include("cpp/Int64.h") +private extern class NativeInt64Helper { + @:native("_hx_int64_make") + static function make(high:Int32, low:Int32):__Int64; + + @:native(" ::cpp::Int64Struct") + static function ofInt(value:Int):__Int64; + + @:native(" ::cpp::Int64Struct::is") + static function isInt64(d:Dynamic):Bool; + + @:native("_hx_int64_is_neg") + static function isNeg(a:__Int64):Bool; + + @:native("_hx_int64_is_zero") + static function isZero(a:__Int64):Bool; + + @:native("_hx_int64_compare") + static function compare(a:__Int64, b:__Int64):Int; + + @:native("_hx_int64_ucompare") + static function ucompare(a:__Int64, b:__Int64):Int; + + @:native("_hx_int64_to_string") + static function toString(a:__Int64):String; + + @:native("_hx_int64_neg") + static function neg(a:__Int64):__Int64; + + @:native("_hx_int64_pre_increment") + static function preIncrement(a:__Int64):__Int64; + + @:native("_hx_int64_post_increment") + static function postIncrement(a:__Int64):__Int64; + + @:native("_hx_int64_pre_decrement") + static function preDecrement(a:__Int64):__Int64; + + @:native("_hx_int64_post_decrement") + static function postDecrement(a:__Int64):__Int64; + + @:native("_hx_int64_add") + static function add(a:__Int64, b:__Int64):__Int64; + + @:native("_hx_int64_add") + static function addInt(a:__Int64, b:Int):__Int64; + + @:native("_hx_int64_sub") + static function sub(a:__Int64, b:__Int64):__Int64; + + @:native("_hx_int64_sub") + static function subInt(a:__Int64, b:Int):__Int64; + + @:native("_hx_int64_sub") + static function intSub(a:Int, b:__Int64):__Int64; + + @:native("_hx_int64_mul") + static function mul(a:__Int64, b:__Int64):__Int64; + + @:native("_hx_int64_div") + static function div(a:__Int64, b:__Int64):__Int64; + + @:native("_hx_int64_mod") + static function mod(a:__Int64, b:__Int64):__Int64; + + @:native("_hx_int64_eq") + static function eq(a:__Int64, b:__Int64):Bool; + + @:native("_hx_int64_eq") + static function eqInt(a:__Int64, b:Int):Bool; + + @:native("_hx_int64_neq") + static function neq(a:__Int64, b:__Int64):Bool; + + @:native("_hx_int64_neq") + static function neqInt(a:__Int64, b:Int):Bool; + + @:native("_hx_int64_complement") + static function complement(a:__Int64):__Int64; + + @:native("_hx_int64_and") + static function bitAnd(a:__Int64, b:__Int64):__Int64; + + @:native("_hx_int64_or") + static function bitOr(a:__Int64, b:__Int64):__Int64; + + @:native("_hx_int64_xor") + static function bitXor(a:__Int64, b:__Int64):__Int64; + + @:native("_hx_int64_shl") + static function shl(a:__Int64, b:Int):__Int64; + + @:native("_hx_int64_shr") + static function shr(a:__Int64, b:Int):__Int64; + + @:native("_hx_int64_ushr") + static function ushr(a:__Int64, b:Int):__Int64; + + @:native("_hx_int64_high") + static function high(a:__Int64):Int32; + + @:native("_hx_int64_low") + static function low(a:__Int64):Int32; +} + +private typedef __Int64 = cpp.Int64; + +@:coreApi +@:transitive +@:notNull +abstract Int64(__Int64) from __Int64 from Int to __Int64 { + public #if !cppia inline #end function copy():Int64 + return this; + + public static #if !cppia inline #end function make(high:Int32, low:Int32):Int64 { + return NativeInt64Helper.make(high, low); + } + + public static #if !cppia inline #end function ofInt(x:Int):Int64 { + return x; + } + + public static #if !cppia inline #end function toInt(x:Int64):Int { + if (x.high != x.low >> 31) + throw "Overflow"; + + return x.low; + } + + @:deprecated('haxe.Int64.is() is deprecated. Use haxe.Int64.isInt64() instead') + inline public static function is(val:Dynamic):Bool { + return val is cpp.Int64; + } + + public static #if !cppia inline #end function isInt64(val:Dynamic):Bool + return val is cpp.Int64; + + @:deprecated("Use high instead") + public static #if !cppia inline #end function getHigh(x:Int64):Int32 + return x.high; + + @:deprecated("Use low instead") + public static #if !cppia inline #end function getLow(x:Int64):Int32 + return x.low; + + public static #if !cppia inline #end function isNeg(x:Int64):Bool + return NativeInt64Helper.isNeg(x); + + public static #if !cppia inline #end function isZero(x:Int64):Bool + return NativeInt64Helper.isZero(x); + + public static #if !cppia inline #end function compare(a:Int64, b:Int64):Int + return NativeInt64Helper.compare(a, b); + + public static #if !cppia inline #end function ucompare(a:Int64, b:Int64):Int + return NativeInt64Helper.ucompare(a, b); + + public static #if !cppia inline #end function toStr(x:Int64):String + return cast x.val; + + private #if !cppia inline #end function toString():String + return cast this; + + public static function parseString(sParam:String):Int64 { + return Int64Helper.parseString(sParam); + } + + public static function fromFloat(f:Float):Int64 { + return Int64Helper.fromFloat(f); + } + + public static function divMod(dividend:Int64, divisor:Int64):{quotient:Int64, modulus:Int64} { + var q = dividend / divisor; + + if (divisor == 0) + throw "divide by zero"; + + var m = dividend - q * divisor; + + return {quotient: q, modulus: m}; + } + +@:op(-A) + public static #if !cppia inline #end function neg(x:Int64):Int64 + return NativeInt64Helper.neg(x); + + @:op(++A) private inline function preIncrement():Int64 { + #if cppia + this = this + make(0, 1); + return this; + #else + return NativeInt64Helper.preIncrement(this); + #end + } + + @:op(A++) private inline function postIncrement():Int64 { + #if cppia + var result = this; + this = this + make(0, 1); + return result; + #else + return NativeInt64Helper.postIncrement(this); + #end + } + + @:op(--A) private inline function preDecrement():Int64 { + #if cppia + untyped this = this - make(0, 1); + return this; + #else + return NativeInt64Helper.preDecrement(this); + #end + } + + @:op(A--) private inline function postDecrement():Int64 { + #if cppia + var result = this; + this = this - make(0, 1); + return result; + #else + return NativeInt64Helper.postDecrement(this); + #end + } + + @:op(A + B) + public static #if !cppia inline #end function add(a:Int64, b:Int64):Int64 + return NativeInt64Helper.add(a, b); + + @:op(A + B) + @:commutative + private static #if !cppia inline #end function addInt(a:Int64, b:Int):Int64 + return NativeInt64Helper.addInt(a, b); + + @:op(A - B) + public static #if !cppia inline #end function sub(a:Int64, b:Int64):Int64 { + return NativeInt64Helper.sub(a, b); + } + + @:op(A - B) + private static #if !cppia inline #end function subInt(a:Int64, b:Int):Int64 + return NativeInt64Helper.subInt(a, b); + + @:op(A - B) + private static #if !cppia inline #end function intSub(a:Int, b:Int64):Int64 + return NativeInt64Helper.intSub(a, b); + + @:op(A * B) + public static #if !cppia inline #end function mul(a:Int64, b:Int64):Int64 + return NativeInt64Helper.mul(a, b); + + @:op(A * B) + @:commutative + private static #if !cppia inline #end function mulInt(a:Int64, b:Int):Int64 + return mul(a, b); + + @:op(A / B) + public static #if !cppia inline #end function div(a:Int64, b:Int64):Int64 { + if (NativeInt64Helper.isZero(b)) + throw "divide by zero"; + return NativeInt64Helper.div(a, b); + } + + @:op(A / B) + private static #if !cppia inline #end function divInt(a:Int64, b:Int):Int64 + return div(a, b); + + @:op(A / B) + private static #if !cppia inline #end function intDiv(a:Int, b:Int64):Int64 + return toInt(div(a, b)); + + @:op(A % B) + public static #if !cppia inline #end function mod(a:Int64, b:Int64):Int64 { + if (NativeInt64Helper.isZero(b)) + throw "divide by zero"; + return NativeInt64Helper.mod(a, b); + } + + @:op(A % B) + private static #if !cppia inline #end function modInt(a:Int64, b:Int):Int64 + return toInt(mod(a, b)); + + @:op(A % B) + private static #if !cppia inline #end function intMod(a:Int, b:Int64):Int64 + return toInt(mod(a, b)); + + @:op(A == B) + public static #if !cppia inline #end function eq(a:Int64, b:Int64):Bool + return NativeInt64Helper.eq(a, b); + + @:op(A == B) + @:commutative + private static #if !cppia inline #end function eqInt(a:Int64, b:Int):Bool + return NativeInt64Helper.eqInt(a, b); + + @:op(A != B) + public static #if !cppia inline #end function neq(a:Int64, b:Int64):Bool + return NativeInt64Helper.neq(a, b); + + @:op(A != B) + @:commutative + private static #if !cppia inline #end function neqInt(a:Int64, b:Int):Bool + return neq(a, b); + + @:op(A < B) + private static #if !cppia inline #end function lt(a:Int64, b:Int64):Bool + return compare(a, b) < 0; + + @:op(A < B) + private static #if !cppia inline #end function ltInt(a:Int64, b:Int):Bool + return lt(a, b); + + @:op(A < B) + private static #if !cppia inline #end function intLt(a:Int, b:Int64):Bool + return lt(a, b); + + @:op(A <= B) + private static #if !cppia inline #end function lte(a:Int64, b:Int64):Bool + return compare(a, b) <= 0; + + @:op(A <= B) + private static #if !cppia inline #end function lteInt(a:Int64, b:Int):Bool + return lte(a, b); + + @:op(A <= B) + private static #if !cppia inline #end function intLte(a:Int, b:Int64):Bool + return lte(a, b); + + @:op(A > B) + private static #if !cppia inline #end function gt(a:Int64, b:Int64):Bool + return compare(a, b) > 0; + + @:op(A > B) + private static #if !cppia inline #end function gtInt(a:Int64, b:Int):Bool + return gt(a, b); + + @:op(A > B) + private static #if !cppia inline #end function intGt(a:Int, b:Int64):Bool + return gt(a, b); + + @:op(A >= B) + private static #if !cppia inline #end function gte(a:Int64, b:Int64):Bool + return compare(a, b) >= 0; + + @:op(A >= B) + private static #if !cppia inline #end function gteInt(a:Int64, b:Int):Bool + return gte(a, b); + + @:op(A >= B) + private static #if !cppia inline #end function intGte(a:Int, b:Int64):Bool + return gte(a, b); + + @:op(~A) + private static #if !cppia inline #end function complement(a:Int64):Int64 + return NativeInt64Helper.complement(a); + + @:op(A & B) + public static #if !cppia inline #end function and(a:Int64, b:Int64):Int64 + return NativeInt64Helper.bitAnd(a, b); + + @:op(A | B) + public static #if !cppia inline #end function or(a:Int64, b:Int64):Int64 + return NativeInt64Helper.bitOr(a, b); + + @:op(A ^ B) + public static #if !cppia inline #end function xor(a:Int64, b:Int64):Int64 + return NativeInt64Helper.bitXor(a, b); + + @:op(A << B) + public static #if !cppia inline #end function shl(a:Int64, b:Int):Int64 + return NativeInt64Helper.shl(a, b); + + @:op(A >> B) + public static #if !cppia inline #end function shr(a:Int64, b:Int):Int64 + return NativeInt64Helper.shr(a, b); + + @:op(A >>> B) + public static #if !cppia inline #end function ushr(a:Int64, b:Int):Int64 + return NativeInt64Helper.ushr(a, b); + + public var high(get, never):Int32; + + private #if !cppia inline #end function get_high():Int32 + return NativeInt64Helper.high(this); + + public var low(get, never):Int32; + + private #if !cppia inline #end function get_low():Int32 + return NativeInt64Helper.low(this); + + private var val(get, never):__Int64; + + private #if !cppia inline #end function get_val():__Int64 + return this; +} diff --git a/build/linux64_569e52e/std/cpp/_std/haxe/Log.hx b/build/linux64_569e52e/std/cpp/_std/haxe/Log.hx new file mode 100644 index 0000000..c02376e --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/haxe/Log.hx @@ -0,0 +1,49 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +@:coreApi class Log { + @:native("__trace") + extern private static function nativeTrace(message:String, posInfo:Dynamic):Void; + + public static dynamic function trace(v:Dynamic, ?infos:PosInfos):Void { + if (infos != null && infos.customParams != null) { + var extra:String = ""; + for (v in infos.customParams) + extra += "," + v; + nativeTrace(v + extra, infos); + } else + nativeTrace(v, infos); + } + + public static function formatOutput(v:Dynamic, infos:PosInfos):String { + var str = Std.string(v); + if (infos == null) + return str; + var pstr = infos.fileName + ":" + infos.lineNumber; + if (infos != null && infos.customParams != null) + for (v in infos.customParams) + str += ", " + Std.string(v); + return pstr + ": " + str; + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/haxe/NativeStackTrace.hx b/build/linux64_569e52e/std/cpp/_std/haxe/NativeStackTrace.hx new file mode 100644 index 0000000..1d0760d --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/haxe/NativeStackTrace.hx @@ -0,0 +1,42 @@ +package haxe; + +import haxe.CallStack.StackItem; + +/** + Do not use manually. +**/ +@:dox(hide) +@:noCompletion +class NativeStackTrace { + @:ifFeature('haxe.NativeStackTrace.exceptionStack') + static public inline function saveStack(exception:Any):Void { + } + + @:noDebug //Do not mess up the exception stack + static public function callStack():Array { + return untyped __global__.__hxcpp_get_call_stack(true); + } + + @:noDebug //Do not mess up the exception stack/ + static public function exceptionStack():Array { + return untyped __global__.__hxcpp_get_exception_stack(); + } + + static public function toHaxe(native:Array, skip:Int = 0):Array { + var stack:Array = native; + var m = new Array(); + for (i in 0...stack.length) { + if(skip > i) { + continue; + } + var words = stack[i].split("::"); + if (words.length == 0) + m.push(CFunction) + else if (words.length == 2) + m.push(Method(words[0], words[1])); + else if (words.length == 4) + m.push(FilePos(Method(words[0], words[1]), words[2], Std.parseInt(words[3]))); + } + return m; + } +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/cpp/_std/haxe/Resource.hx b/build/linux64_569e52e/std/cpp/_std/haxe/Resource.hx new file mode 100644 index 0000000..6f574b3 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/haxe/Resource.hx @@ -0,0 +1,41 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +@:coreApi +class Resource { + public static function listNames():Array { + return untyped __global__.__hxcpp_resource_names(); + } + + public static function getString(name:String):String { + return untyped __global__.__hxcpp_resource_string(name); + } + + public static function getBytes(name:String):haxe.io.Bytes { + var array:haxe.io.BytesData = untyped __global__.__hxcpp_resource_bytes(name); + if (array == null) + return null; + return haxe.io.Bytes.ofData(array); + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/haxe/Utf8.hx b/build/linux64_569e52e/std/cpp/_std/haxe/Utf8.hx new file mode 100644 index 0000000..65b4420 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/haxe/Utf8.hx @@ -0,0 +1,85 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +using cpp.NativeString; + +@:coreApi +@:deprecated('haxe.Utf8 is deprecated. Use UnicodeString instead.') +class Utf8 { + var __s:Array; + + public function new(?size:Int):Void { + __s = new Array(); + if (size != null && size > 0) + cpp.NativeArray.reserve(__s, size); + } + + public function addChar(c:Int):Void { + __s.push(c); + } + + public function toString():String { + return untyped __global__.__hxcpp_char_array_to_utf8_string(__s); + } + + // Incoming string is array of bytes containing possibly invalid utf8 chars + // Result is the same string with the bytes expanded into utf8 sequences + public static function encode(s:String):String { + return untyped __global__.__hxcpp_char_bytes_to_utf8_string(s); + } + + // Incoming string is array of bytes representing valid utf8 chars + // Result is a string containing the compressed bytes + public static function decode(s:String):String { + return untyped __global__.__hxcpp_utf8_string_to_char_bytes(s); + } + + public #if !cppia inline #end static function iter(s:String, chars:Int->Void):Void { + var src = s.c_str(); + var end = src.add(s.length); + + while (src.lt(end)) + chars(src.ptr.utf8DecodeAdvance()); + } + + public static function charCodeAt(s:String, index:Int):Int { + return s.utf8CharCodeAt(index); + } + + public static function validate(s:String):Bool { + return s.utf8IsValid(); + } + + public static function length(s:String):Int { + return s.utf8Length(); + } + + public static function compare(a:String, b:String):Int { + return a.compare(b); + } + + public static function sub(s:String, pos:Int, len:Int):String { + return s.utf8Sub(pos, len); + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/haxe/atomic/AtomicInt.hx b/build/linux64_569e52e/std/cpp/_std/haxe/atomic/AtomicInt.hx new file mode 100644 index 0000000..168a2d0 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/haxe/atomic/AtomicInt.hx @@ -0,0 +1,68 @@ +package haxe.atomic; + +#if cppia +extern +#end +abstract AtomicInt(cpp.Pointer) { + #if cppia + public function new(value:Int):Void; + + public function add(b:Int):Int; + + public function sub(b:Int):Int; + + public function and(b:Int):Int; + + public function or(b:Int):Int; + + public function xor(b:Int):Int; + + public function compareExchange(expected:Int, replacement:Int):Int; + + public function exchange(value:Int):Int; + + public function load():Int; + + public function store(value:Int):Int; + #else + public #if !scriptable inline #end function new(value:Int) { + this = cpp.Pointer.ofArray([value]); + } + + public #if !scriptable inline #end function add(b:Int):Int { + return untyped __cpp__("_hx_atomic_add({0}, {1})", this, b); + } + + public #if !scriptable inline #end function sub(b:Int):Int { + return untyped __cpp__("_hx_atomic_sub({0}, {1})", this, b); + } + + public #if !scriptable inline #end function and(b:Int):Int { + return untyped __cpp__("_hx_atomic_and({0}, {1})", this, b); + } + + public #if !scriptable inline #end function or(b:Int):Int { + return untyped __cpp__("_hx_atomic_or({0}, {1})", this, b); + } + + public #if !scriptable inline #end function xor(b:Int):Int { + return untyped __cpp__("_hx_atomic_xor({0}, {1})", this, b); + } + + public #if !scriptable inline #end function compareExchange(expected:Int, replacement:Int):Int { + return untyped __cpp__("_hx_atomic_compare_exchange({0}, {1}, {2})", this, expected, replacement); + } + + public #if !scriptable inline #end function exchange(value:Int):Int { + return untyped __cpp__("_hx_atomic_exchange({0}, {1})", this, value); + } + + public #if !scriptable inline #end function load():Int { + return untyped __cpp__("_hx_atomic_load({0})", this); + } + + public #if !scriptable inline #end function store(value:Int):Int { + return untyped __cpp__("_hx_atomic_store({0}, {1})", this, value); + } + #end +} diff --git a/build/linux64_569e52e/std/cpp/_std/haxe/ds/IntMap.hx b/build/linux64_569e52e/std/cpp/_std/haxe/ds/IntMap.hx new file mode 100644 index 0000000..0ee1b0c --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/haxe/ds/IntMap.hx @@ -0,0 +1,152 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +@:headerClassCode(" + inline void set(int key, ::null value) { __int_hash_set(HX_MAP_THIS,key,value); } + inline void set(int key, bool value) { __int_hash_set(HX_MAP_THIS,key,value); } + inline void set(int key, char value) { __int_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(int key, unsigned char value) { __int_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(int key, signed char value) { __int_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(int key, short value) { __int_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(int key, unsigned short value) { __int_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(int key, int value) { __int_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(int key, unsigned int value) { __int_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(int key, float value) { __int_hash_set_float(HX_MAP_THIS,key,value); } + inline void set(int key, double value) { __int_hash_set_float(HX_MAP_THIS,key,value); } + inline void set(int key, ::String value) { __int_hash_set_string(HX_MAP_THIS,key,value); } + inline void set(int key, cpp::Int64 value) { __int_hash_set_int64(HX_MAP_THIS,key,value); } + + template + inline void set(int key, const ::cpp::Struct &value) {__int_hash_set(HX_MAP_THIS,key,value); } + template + inline void set(int key, const ::cpp::Function &value) {__int_hash_set(HX_MAP_THIS,key,value); } + template + inline void set(int key, const ::cpp::Pointer &value) {__int_hash_set(HX_MAP_THIS,key,(Dynamic)value ); } + + template + inline void set(Dynamic &key, const VALUE &value) { set( (int)key, value ); } + + inline bool get_bool(int key) { return __int_hash_get_bool(h,key); } + inline int get_int(int key) { return __int_hash_get_int(h,key); } + inline Float get_float(int key) { return __int_hash_get_float(h,key); } + inline String get_string(int key) { return __int_hash_get_string(h,key); } + inline cpp::Int64 get_int64(int key) { return __int_hash_get_int64(h,key); } +") +@:coreApi class IntMap implements haxe.Constraints.IMap { + @:ifFeature("haxe.ds.IntMap.*") + private var h:Dynamic; + + public function new():Void {} + + public function set(key:Int, value:T):Void { + untyped __global__.__int_hash_set(__cpp__("HX_MAP_THIS"), key, value); + } + + public function get(key:Int):Null { + return untyped __global__.__int_hash_get(h, key); + } + + public function exists(key:Int):Bool { + return untyped __global__.__int_hash_exists(h, key); + } + + public function remove(key:Int):Bool { + return untyped __global__.__int_hash_remove(h, key); + } + + public function keys():Iterator { + var a:Array = untyped __global__.__int_hash_keys(h); + return a.iterator(); + } + + public function iterator():Iterator { + var a:Array = untyped __global__.__int_hash_values(h); + return a.iterator(); + } + + @:runtime public inline function keyValueIterator():KeyValueIterator { + return new haxe.iterators.MapKeyValueIterator(this); + } + + public function copy():IntMap { + var copied = new IntMap(); + for (key in keys()) + copied.set(key, get(key)); + return copied; + } + + public function toString():String { + return untyped __global__.__int_hash_to_string(h); + } + + public function clear():Void { + #if (hxcpp_api_level >= 400) + return untyped __global__.__int_hash_clear(h); + #else + h = null; + #end + } + + #if (scriptable) + private function setString(key:Int, val:String):Void { + untyped __int_hash_set_string(__cpp__("HX_MAP_THIS"), key, val); + } + + private function setInt(key:Int, val:Int):Void { + untyped __int_hash_set_int(__cpp__("HX_MAP_THIS"), key, val); + } + + private function setBool(key:Int, val:Bool):Void { + untyped __int_hash_set_int(__cpp__("HX_MAP_THIS"), key, val); + } + + private function setFloat(key:Int, val:Float):Void { + untyped __int_hash_set_float(__cpp__("HX_MAP_THIS"), key, val); + } + + private function setInt64(key:Int, val:haxe.Int64):Void { + untyped __int_hash_set_int64(__cpp__("HX_MAP_THIS"), key, val); + } + + private function getString(key:Int):String { + return untyped __int_hash_get_string(h, key); + } + + private function getInt(key:Int):Int { + return untyped __int_hash_get_int(h, key); + } + + private function getBool(key:Int):Bool { + return untyped __int_hash_get_bool(h, key); + } + + private function getFloat(key:Int):Float { + return untyped __int_hash_get_float(h, key); + } + + private function getInt64(key:Int):haxe.Int64 { + return untyped __int_hash_get_int64(h, key); + } + #end +} diff --git a/build/linux64_569e52e/std/cpp/_std/haxe/ds/Map.hx b/build/linux64_569e52e/std/cpp/_std/haxe/ds/Map.hx new file mode 100644 index 0000000..6e99f47 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/haxe/ds/Map.hx @@ -0,0 +1,209 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +import haxe.Int64; +import haxe.ds.StringMap; +import haxe.ds.IntMap; +import haxe.ds.HashMap; +import haxe.ds.ObjectMap; +import haxe.ds.WeakMap; +import haxe.ds.EnumValueMap; +import haxe.Constraints.IMap; +import cpp.Int64Map; + +/** + Map allows key to value mapping for arbitrary value types, and many key + types. + + This is a multi-type abstract, it is instantiated as one of its + specialization types depending on its type parameters. + + A Map can be instantiated without explicit type parameters. Type inference + will then determine the type parameters from the usage. + + Maps can also be created with `[key1 => value1, key2 => value2]` syntax. + + Map is an abstract type, it is not available at runtime. + + @see https://haxe.org/manual/std-Map.html +**/ +@:transitive +@:multiType(@:followWithAbstracts K) +abstract Map(IMap) { + /** + Creates a new Map. + + This becomes a constructor call to one of the specialization types in + the output. The rules for that are as follows: + + 1. if `K` is a `String`, `haxe.ds.StringMap` is used + 2. if `K` is an `Int`, `haxe.ds.IntMap` is used + 3. if `K` is an `EnumValue`, `haxe.ds.EnumValueMap` is used + 4. if `K` is any other class or structure, `haxe.ds.ObjectMap` is used + 5. if `K` is any other type, it causes a compile-time error + + (Cpp) Map does not use weak keys on `ObjectMap` by default. + **/ + public function new(); + + /** + Maps `key` to `value`. + + If `key` already has a mapping, the previous value disappears. + + If `key` is `null`, the result is unspecified. + **/ + public inline function set(key:K, value:V) + this.set(key, value); + + /** + Returns the current mapping of `key`. + + If no such mapping exists, `null` is returned. + + Note that a check like `map.get(key) == null` can hold for two reasons: + + 1. the map has no mapping for `key` + 2. the map has a mapping with a value of `null` + + If it is important to distinguish these cases, `exists()` should be + used. + + If `key` is `null`, the result is unspecified. + **/ + @:arrayAccess public inline function get(key:K) + return this.get(key); + + /** + Returns true if `key` has a mapping, false otherwise. + + If `key` is `null`, the result is unspecified. + **/ + public inline function exists(key:K) + return this.exists(key); + + /** + Removes the mapping of `key` and returns true if such a mapping existed, + false otherwise. + + If `key` is `null`, the result is unspecified. + **/ + public inline function remove(key:K) + return this.remove(key); + + /** + Returns an Iterator over the keys of `this` Map. + + The order of keys is undefined. + **/ + public inline function keys():Iterator { + return this.keys(); + } + + /** + Returns an Iterator over the values of `this` Map. + + The order of values is undefined. + **/ + public inline function iterator():Iterator { + return this.iterator(); + } + + /** + Returns an Iterator over the keys and values of `this` Map. + + The order of values is undefined. + **/ + public inline function keyValueIterator():KeyValueIterator { + return this.keyValueIterator(); + } + + /** + Returns a shallow copy of `this` map. + + The order of values is undefined. + **/ + public inline function copy():Map { + return cast this.copy(); + } + + /** + Returns a String representation of `this` Map. + + The exact representation depends on the platform and key-type. + **/ + public inline function toString():String { + return this.toString(); + } + + /** + Removes all keys from `this` Map. + **/ + public inline function clear():Void { + this.clear(); + } + + @:arrayAccess @:noCompletion public inline function arrayWrite(k:K, v:V):V { + this.set(k, v); + return v; + } + + @:to static inline function toStringMap(t:IMap):StringMap { + return new StringMap(); + } + + @:to static inline function toIntMap(t:IMap):IntMap { + return new IntMap(); + } + + @:noDoc + @:to static inline function toInt64Map(t:IMap):Int64Map { + return new Int64Map(); + } + + @:to static inline function toEnumValueMapMap(t:IMap):EnumValueMap { + return new EnumValueMap(); + } + + @:to static inline function toObjectMap(t:IMap):ObjectMap { + return new ObjectMap(); + } + + @:from static inline function fromStringMap(map:StringMap):Map { + return cast map; + } + + @:from static inline function fromIntMap(map:IntMap):Map { + return cast map; + } + + @:noDoc + @:from static inline function fromInt64Map(map:Int64Map):Map { + return cast map; + } + + @:from static inline function fromObjectMap(map:ObjectMap):Map { + return cast map; + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/haxe/ds/ObjectMap.hx b/build/linux64_569e52e/std/cpp/_std/haxe/ds/ObjectMap.hx new file mode 100644 index 0000000..21bc023 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/haxe/ds/ObjectMap.hx @@ -0,0 +1,151 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +@:headerClassCode(" + inline void set(Dynamic key, ::null value) { __object_hash_set(HX_MAP_THIS,key,value); } + inline void set(Dynamic key, bool value) { __object_hash_set(HX_MAP_THIS,key,value); } + inline void set(Dynamic key, char value) { __object_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(Dynamic key, unsigned char value) { __object_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(Dynamic key, signed char value) { __object_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(Dynamic key, short value) { __object_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(Dynamic key, unsigned short value) { __object_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(Dynamic key, int value) { __object_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(Dynamic key, unsigned int value) { __object_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(Dynamic key, float value) { __object_hash_set_float(HX_MAP_THIS,key,value); } + inline void set(Dynamic key, double value) { __object_hash_set_float(HX_MAP_THIS,key,value); } + inline void set(Dynamic key, ::String value) { __object_hash_set_string(HX_MAP_THIS,key,value); } + inline void set(Dynamic key, cpp::Int64 value) { __object_hash_set_int64(HX_MAP_THIS,key,value); } + + + template + inline void set(Dynamic key, const ::cpp::Struct &value) {__object_hash_set(HX_MAP_THIS,key,value); } + template + inline void set(Dynamic key, const ::cpp::Function &value) {__object_hash_set(HX_MAP_THIS,key,(Dynamic)value ); } + template + inline void set(Dynamic key, const ::cpp::Pointer &value) {__object_hash_set(HX_MAP_THIS,key,(Dynamic)value ); } + + inline bool get_bool(Dynamic key) { return __object_hash_get_bool(h,key); } + inline int get_int(Dynamic key) { return __object_hash_get_int(h,key); } + inline Float get_float(Dynamic key) { return __object_hash_get_float(h,key); } + inline String get_string(Dynamic key) { return __object_hash_get_string(h,key); } + inline cpp::Int64 get_int64(Dynamic key) { return __object_hash_get_int64(h,key); } +") +@:coreApi +class ObjectMap implements haxe.Constraints.IMap { + @:ifFeature("haxe.ds.ObjectMap.*") + private var h:Dynamic; + + public function new():Void {} + + public function set(key:K, value:V):Void { + untyped __global__.__object_hash_set(__cpp__("HX_MAP_THIS"), key, value); + } + + public function get(key:K):Null { + return untyped __global__.__object_hash_get(h, key); + } + + public function exists(key:K):Bool { + return untyped __global__.__object_hash_exists(h, key); + } + + public function remove(key:K):Bool { + return untyped __global__.__object_hash_remove(h, key); + } + + public function keys():Iterator { + var a:Array = untyped __global__.__object_hash_keys(h); + return a.iterator(); + } + + public function iterator():Iterator { + var a:Array = untyped __global__.__object_hash_values(h); + return a.iterator(); + } + + @:runtime public inline function keyValueIterator():KeyValueIterator { + return new haxe.iterators.MapKeyValueIterator(this); + } + + public function copy():ObjectMap { + var copied = new ObjectMap(); + for (key in keys()) + copied.set(key, get(key)); + return copied; + } + + public function toString():String { + return untyped __global__.__object_hash_to_string(h); + } + + public function clear():Void { + #if (hxcpp_api_level >= 400) + return untyped __global__.__object_hash_clear(h); + #else + h = null; + #end + } + + #if (scriptable) + private function setString(key:Dynamic, val:String):Void { + untyped __object_hash_set_string(__cpp__("HX_MAP_THIS"), key, val); + } + + private function setInt(key:Dynamic, val:Int):Void { + untyped __object_hash_set_int(__cpp__("HX_MAP_THIS"), key, val); + } + + private function setBool(key:Dynamic, val:Bool):Void { + untyped __object_hash_set_int(__cpp__("HX_MAP_THIS"), key, val); + } + + private function setFloat(key:Dynamic, val:Float):Void { + untyped __object_hash_set_float(__cpp__("HX_MAP_THIS"), key, val); + } + + private function setInt64(key:Dynamic, val:haxe.Int64):Void { + untyped __object_hash_set_int64(__cpp__("HX_MAP_THIS"), key, val); + } + + private function getString(key:Dynamic):String { + return untyped __object_hash_get_string(h, key); + } + + private function getInt(key:Dynamic):Int { + return untyped __object_hash_get_int(h, key); + } + + private function getBool(key:Dynamic):Bool { + return untyped __object_hash_get_bool(h, key); + } + + private function getFloat(key:Dynamic):Float { + return untyped __object_hash_get_float(h, key); + } + + private function getInt64(key:Dynamic):haxe.Int64 { + return untyped __object_hash_get_int64(h, key); + } + #end +} diff --git a/build/linux64_569e52e/std/cpp/_std/haxe/ds/StringMap.hx b/build/linux64_569e52e/std/cpp/_std/haxe/ds/StringMap.hx new file mode 100644 index 0000000..0ae5128 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/haxe/ds/StringMap.hx @@ -0,0 +1,152 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +@:headerClassCode(" + inline void set(String key, ::null value) { __string_hash_set(HX_MAP_THIS,key,value); } + inline void set(String key, bool value) { __string_hash_set(HX_MAP_THIS,key,value); } + inline void set(String key, char value) { __string_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(String key, unsigned char value) { __string_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(String key, signed char value) { __string_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(String key, short value) { __string_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(String key, unsigned short value) { __string_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(String key, int value) { __string_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(String key, unsigned int value) { __string_hash_set_int(HX_MAP_THIS,key,value); } + inline void set(String key, float value) { __string_hash_set_float(HX_MAP_THIS,key,value); } + inline void set(String key, double value) { __string_hash_set_float(HX_MAP_THIS,key,value); } + inline void set(String key, ::String value) { __string_hash_set_string(HX_MAP_THIS,key,value); } + inline void set(String key, cpp::Int64 value) { __string_hash_set_int64(HX_MAP_THIS,key,value); } + + template + inline void set(String key, const ::cpp::Struct &value) {__string_hash_set(HX_MAP_THIS,key,value); } + template + inline void set(String key, const ::cpp::Function &value) {__string_hash_set(HX_MAP_THIS,key,(Dynamic)value ); } + template + inline void set(String key, const ::cpp::Pointer &value) {__string_hash_set(HX_MAP_THIS,key,(Dynamic)value ); } + + template + inline void set(Dynamic &key, const VALUE &value) { set( (String)key, value ); } + + inline bool get_bool(String key) { return __string_hash_get_bool(h,key); } + inline int get_int(String key) { return __string_hash_get_int(h,key); } + inline Float get_float(String key) { return __string_hash_get_float(h,key); } + inline String get_string(String key) { return __string_hash_get_string(h,key); } + inline cpp::Int64 get_int64(String key) { return __string_hash_get_int64(h,key); } +") +@:coreApi class StringMap implements haxe.Constraints.IMap { + @:ifFeature("haxe.ds.StringMap.*") + private var h:Dynamic; + + public function new():Void {} + + public function set(key:String, value:T):Void { + untyped __global__.__string_hash_set(__cpp__("HX_MAP_THIS"), key, value); + } + + public function get(key:String):Null { + return untyped __global__.__string_hash_get(h, key); + } + + public function exists(key:String):Bool { + return untyped __global__.__string_hash_exists(h, key); + } + + public function remove(key:String):Bool { + return untyped __global__.__string_hash_remove(h, key); + } + + public function keys():Iterator { + var a:Array = untyped __global__.__string_hash_keys(h); + return a.iterator(); + } + + public function iterator():Iterator { + var a:Array = untyped __global__.__string_hash_values(h); + return a.iterator(); + } + + @:runtime public inline function keyValueIterator():KeyValueIterator { + return new haxe.iterators.MapKeyValueIterator(this); + } + + public function copy():StringMap { + var copied = new StringMap(); + for (key in keys()) + copied.set(key, get(key)); + return copied; + } + + public function toString():String { + return untyped __global__.__string_hash_to_string(h); + } + + public function clear():Void { + #if (hxcpp_api_level >= 400) + return untyped __global__.__string_hash_clear(h); + #else + h = null; + #end + } + + #if (scriptable) + private function setString(key:String, val:String):Void { + untyped __string_hash_set_string(__cpp__("HX_MAP_THIS"), key, val); + } + + private function setInt(key:String, val:Int):Void { + untyped __string_hash_set_int(__cpp__("HX_MAP_THIS"), key, val); + } + + private function setBool(key:String, val:Bool):Void { + untyped __string_hash_set_int(__cpp__("HX_MAP_THIS"), key, val); + } + + private function setFloat(key:String, val:Float):Void { + untyped __string_hash_set_float(__cpp__("HX_MAP_THIS"), key, val); + } + + private function setInt64(key:String, val:haxe.Int64):Void { + untyped __string_hash_set_int64(__cpp__("HX_MAP_THIS"), key, val); + } + + private function getString(key:String):String { + return untyped __string_hash_get_string(h, key); + } + + private function getInt(key:String):Int { + return untyped __string_hash_get_int(h, key); + } + + private function getBool(key:String):Bool { + return untyped __string_hash_get_bool(h, key); + } + + private function getFloat(key:String):Float { + return untyped __string_hash_get_float(h, key); + } + + private function getInt64(key:String):haxe.Int64 { + return untyped __string_hash_get_int64(h, key); + } + #end +} diff --git a/build/linux64_569e52e/std/cpp/_std/haxe/ds/WeakMap.hx b/build/linux64_569e52e/std/cpp/_std/haxe/ds/WeakMap.hx new file mode 100644 index 0000000..f4c2ef4 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/haxe/ds/WeakMap.hx @@ -0,0 +1,102 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +@:headerClassCode(" + inline void set(Dynamic key, ::null value) { __object_hash_set(HX_MAP_THIS,key,value,true); } + inline void set(Dynamic key, bool value) { __object_hash_set(HX_MAP_THIS,key,value,true); } + inline void set(Dynamic key, char value) { __object_hash_set_int(HX_MAP_THIS,key,value,true); } + inline void set(Dynamic key, unsigned char value) { __object_hash_set_int(HX_MAP_THIS,key,value,true); } + inline void set(Dynamic key, signed char value) { __object_hash_set_int(HX_MAP_THIS,key,value,true); } + inline void set(Dynamic key, short value) { __object_hash_set_int(HX_MAP_THIS,key,value,true); } + inline void set(Dynamic key, unsigned short value) { __object_hash_set_int(HX_MAP_THIS,key,value,true); } + inline void set(Dynamic key, int value) { __object_hash_set_int(HX_MAP_THIS,key,value,true); } + inline void set(Dynamic key, unsigned int value) { __object_hash_set_int(HX_MAP_THIS,key,value,true); } + inline void set(Dynamic key, float value) { __object_hash_set_float(HX_MAP_THIS,key,value,true); } + inline void set(Dynamic key, double value) { __object_hash_set_float(HX_MAP_THIS,key,value,true); } + inline void set(Dynamic key, ::String value) { __object_hash_set_string(HX_MAP_THIS,key,value,true); } + inline void set(Dynamic key, cpp::Int64 value) { __object_hash_set_int64(HX_MAP_THIS,key,value,true); } + + template + inline void set(Dynamic key, const ::cpp::Struct &value) {__object_hash_set(HX_MAP_THIS,key,value,true); } + template + inline void set(Dynamic key, const ::cpp::Pointer &value) {__object_hash_set(HX_MAP_THIS,key,(Dynamic)value,true ); } + template + inline void set(Dynamic key, const ::cpp::Function &value) {__object_hash_set(HX_MAP_THIS,key,(Dynamic)value,true ); } +") +@:coreApi +class WeakMap implements haxe.Constraints.IMap { + @:ifFeature("haxe.ds.WeakMap.*") + private var h:Dynamic; + + public function new():Void {} + + public function set(key:K, value:V):Void { + untyped __global__.__object_hash_set(__cpp__("HX_MAP_THIS"), key, value, true); + } + + public function get(key:K):Null { + return untyped __global__.__object_hash_get(h, key); + } + + public function exists(key:K):Bool { + return untyped __global__.__object_hash_exists(h, key); + } + + public function remove(key:K):Bool { + return untyped __global__.__object_hash_remove(h, key); + } + + public function keys():Iterator { + var a:Array = untyped __global__.__object_hash_keys(h); + return a.iterator(); + } + + public function iterator():Iterator { + var a:Array = untyped __global__.__object_hash_values(h); + return a.iterator(); + } + + public inline function keyValueIterator():KeyValueIterator { + return new haxe.iterators.MapKeyValueIterator(this); + } + + public function copy():WeakMap { + var copied = new WeakMap(); + for (key in keys()) + copied.set(key, get(key)); + return copied; + } + + public function toString():String { + return untyped __global__.__object_hash_to_string(h); + } + + public function clear():Void { + #if (hxcpp_api_level >= 400) + return untyped __global__.__object_hash_clear(h); + #else + h = null; + #end + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/haxe/zip/Compress.hx b/build/linux64_569e52e/std/cpp/_std/haxe/zip/Compress.hx new file mode 100644 index 0000000..4d7ef85 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/haxe/zip/Compress.hx @@ -0,0 +1,71 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.zip; + +@:coreApi @:buildXml('') +class Compress { + var s:Dynamic; + + public function new(level:Int):Void { + s = _deflate_init(level); + } + + public function execute(src:haxe.io.Bytes, srcPos:Int, dst:haxe.io.Bytes, dstPos:Int):{done:Bool, read:Int, write:Int} { + return _deflate_buffer(s, src.getData(), srcPos, dst.getData(), dstPos); + } + + public function setFlushMode(f:FlushMode):Void { + _set_flush_mode(s, Std.string(f)); + } + + public function close():Void { + _deflate_end(s); + } + + public static function run(s:haxe.io.Bytes, level:Int):haxe.io.Bytes { + var c = new Compress(level); + c.setFlushMode(FlushMode.FINISH); + var out = haxe.io.Bytes.alloc(_deflate_bound(c.s, s.length)); + var r = c.execute(s, 0, out, 0); + c.close(); + if (!r.done || r.read != s.length) + throw "Compression failed"; + return out.sub(0, r.write); + } + + @:native("_hx_deflate_init") + extern static function _deflate_init(level:Int):Dynamic; + + @:native("_hx_deflate_bound") + extern static function _deflate_bound(handle:Dynamic, length:Int):Int; + + @:native("_hx_deflate_buffer") + extern static function _deflate_buffer(handle:Dynamic, src:haxe.io.BytesData, srcPos:Int, dest:haxe.io.BytesData, + destPos:Int):{done:Bool, read:Int, write:Int}; + + @:native("_hx_deflate_end") + extern static function _deflate_end(handle:Dynamic):Void; + + @:native("_hx_zip_set_flush_mode") + extern static function _set_flush_mode(handle:Dynamic, flushMode:String):Void; +} diff --git a/build/linux64_569e52e/std/cpp/_std/haxe/zip/Uncompress.hx b/build/linux64_569e52e/std/cpp/_std/haxe/zip/Uncompress.hx new file mode 100644 index 0000000..1168ba3 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/haxe/zip/Uncompress.hx @@ -0,0 +1,76 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.zip; + +@:coreApi @:buildXml('') +class Uncompress { + var s:Dynamic; + + public function new(?windowBits:Int):Void { + s = _inflate_init(windowBits); + } + + public function execute(src:haxe.io.Bytes, srcPos:Int, dst:haxe.io.Bytes, dstPos:Int):{done:Bool, read:Int, write:Int} { + return _inflate_buffer(s, src.getData(), srcPos, dst.getData(), dstPos); + } + + public function setFlushMode(f:FlushMode):Void { + _set_flush_mode(s, untyped f.__Tag()); + } + + public function close():Void { + _inflate_end(s); + } + + public static function run(src:haxe.io.Bytes, ?bufsize:Int):haxe.io.Bytes { + var u = new Uncompress(null); + if (bufsize == null) + bufsize = 1 << 16; // 64K + var tmp = haxe.io.Bytes.alloc(bufsize); + var b = new haxe.io.BytesBuffer(); + var pos = 0; + u.setFlushMode(FlushMode.SYNC); + while (true) { + var r = u.execute(src, pos, tmp, 0); + b.addBytes(tmp, 0, r.write); + pos += r.read; + if (r.done) + break; + } + u.close(); + return b.getBytes(); + } + + @:native("_hx_inflate_init") + extern static function _inflate_init(windowBits:Dynamic):Dynamic; + + @:native("_hx_inflate_buffer") + extern static function _inflate_buffer(handle:Dynamic, src:haxe.io.BytesData, srcPos:Int, dest:haxe.io.BytesData, + destPos:Int):{done:Bool, read:Int, write:Int}; + + @:native("_hx_inflate_end") + extern static function _inflate_end(handle:Dynamic):Void; + + @:native("_hx_zip_set_flush_mode") + extern static function _set_flush_mode(handle:Dynamic, flushMode:String):Void; +} diff --git a/build/linux64_569e52e/std/cpp/_std/sys/FileSystem.hx b/build/linux64_569e52e/std/cpp/_std/sys/FileSystem.hx new file mode 100644 index 0000000..df10183 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/sys/FileSystem.hx @@ -0,0 +1,113 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys; + +import cpp.NativeSys; + +@:buildXml('') +@:coreApi +class FileSystem { + public static function exists(path:String):Bool { + return NativeSys.sys_exists(makeCompatiblePath(path)); + } + + public static function rename(path:String, newPath:String):Void { + NativeSys.sys_rename(path, newPath); + } + + public static function stat(path:String):FileStat { + var s:FileStat = NativeSys.sys_stat(makeCompatiblePath(path)); + if (s == null) + return { + gid: 0, + uid: 0, + atime: Date.fromTime(0), + mtime: Date.fromTime(0), + ctime: Date.fromTime(0), + dev: 0, + ino: 0, + nlink: 0, + rdev: 0, + size: 0, + mode: 0 + }; + s.atime = Date.fromTime(1000.0 * (untyped s.atime)); + s.mtime = Date.fromTime(1000.0 * (untyped s.mtime)); + s.ctime = Date.fromTime(1000.0 * (untyped s.ctime)); + return s; + } + + public static function fullPath(relPath:String):String { + return NativeSys.file_full_path(relPath); + } + + public static function absolutePath(relPath:String):String { + if (haxe.io.Path.isAbsolute(relPath)) + return relPath; + return haxe.io.Path.join([Sys.getCwd(), relPath]); + } + + inline static function kind(path:String):String { + return NativeSys.sys_file_type(makeCompatiblePath(path)); + } + + public static function isDirectory(path:String):Bool { + return kind(path) == "dir"; + } + + public static function createDirectory(path:String):Void { + var path = haxe.io.Path.addTrailingSlash(path); + var _p = null; + var parts = []; + while (path != (_p = haxe.io.Path.directory(path))) { + parts.unshift(path); + path = _p; + } + for (part in parts) { + if (part.charCodeAt(part.length - 1) != ":".code && !exists(part) && !NativeSys.sys_create_dir(part, 493)) + throw "Could not create directory:" + part; + } + } + + public static function deleteFile(path:String):Void { + NativeSys.file_delete(path); + } + + public static function deleteDirectory(path:String):Void { + NativeSys.sys_remove_dir(path); + } + + public static function readDirectory(path:String):Array { + return NativeSys.sys_read_dir(path); + } + + private static inline function makeCompatiblePath(path:String):String { + return if (path.charCodeAt(1) == ":".code && path.length <= 3) { + haxe.io.Path.addTrailingSlash(path); + } else if (path == "/") { + "/"; + } else { + haxe.io.Path.removeTrailingSlashes(path); + } + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/sys/io/File.hx b/build/linux64_569e52e/std/cpp/_std/sys/io/File.hx new file mode 100644 index 0000000..78fdebd --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/sys/io/File.hx @@ -0,0 +1,76 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.io; + +import cpp.NativeFile; + +@:coreApi +class File { + public static function getContent(path:String):String { + return NativeFile.file_contents_string(path); + } + + public static function getBytes(path:String):haxe.io.Bytes { + var data = NativeFile.file_contents_bytes(path); + return haxe.io.Bytes.ofData(data); + } + + public static function saveContent(path:String, content:String):Void { + var f = write(path); + f.writeString(content); + f.close(); + } + + public static function saveBytes(path:String, bytes:haxe.io.Bytes):Void { + var f = write(path); + f.write(bytes); + f.close(); + } + + public static function read(path:String, binary:Bool = true):FileInput { + return untyped new FileInput(NativeFile.file_open(path, (if (binary) "rb" else "r"))); + } + + public static function write(path:String, binary:Bool = true):FileOutput { + return untyped new FileOutput(NativeFile.file_open(path, (if (binary) "wb" else "w"))); + } + + public static function append(path:String, binary:Bool = true):FileOutput { + return untyped new FileOutput(NativeFile.file_open(path, (if (binary) "ab" else "a"))); + } + + public static function update(path:String, binary:Bool = true):FileOutput { + if (!FileSystem.exists(path)) { + write(path).close(); + } + return untyped new FileOutput(NativeFile.file_open(path, (if (binary) "rb+" else "r+"))); + } + + public static function copy(srcPath:String, dstPath:String):Void { + var s = read(srcPath, true); + var d = write(dstPath, true); + d.writeInput(s); + s.close(); + d.close(); + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/sys/io/FileInput.hx b/build/linux64_569e52e/std/cpp/_std/sys/io/FileInput.hx new file mode 100644 index 0000000..df8aa1d --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/sys/io/FileInput.hx @@ -0,0 +1,74 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.io; + +import sys.io.FileSeek; +import cpp.NativeFile; + +@:coreApi +class FileInput extends haxe.io.Input { + private var __f:Dynamic; + + function new(f:Dynamic):Void { + __f = f; + } + + public override function readByte():Int { + return try { + NativeFile.file_read_char(__f); + } catch (e:Dynamic) { + if (untyped e.__IsArray()) + throw new haxe.io.Eof(); + else + throw haxe.io.Error.Custom(e); + } + } + + public override function readBytes(s:haxe.io.Bytes, p:Int, l:Int):Int { + return try { + NativeFile.file_read(__f, s.getData(), p, l); + } catch (e:Dynamic) { + if (untyped e.__IsArray()) + throw new haxe.io.Eof(); + else + throw haxe.io.Error.Custom(e); + } + } + + public override function close():Void { + super.close(); + NativeFile.file_close(__f); + } + + public function seek(p:Int, pos:FileSeek):Void { + NativeFile.file_seek(__f, p, pos == SeekBegin ? 0 : pos == SeekCur ? 1 : 2); + } + + public function tell():Int { + return NativeFile.file_tell(__f); + } + + public function eof():Bool { + return NativeFile.file_eof(__f); + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/sys/io/FileOutput.hx b/build/linux64_569e52e/std/cpp/_std/sys/io/FileOutput.hx new file mode 100644 index 0000000..19ea876 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/sys/io/FileOutput.hx @@ -0,0 +1,63 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.io; + +import sys.io.FileSeek; +import cpp.NativeFile; + +@:coreApi +class FileOutput extends haxe.io.Output { + private var __f:Dynamic; + + function new(f:Dynamic):Void { + __f = f; + } + + public override function writeByte(c:Int):Void { + try + NativeFile.file_write_char(__f, c) + catch (e:Dynamic) + throw haxe.io.Error.Custom(e); + } + + public override function writeBytes(s:haxe.io.Bytes, p:Int, l:Int):Int { + return try NativeFile.file_write(__f, s.getData(), p, l) catch (e:Dynamic) throw haxe.io.Error.Custom(e); + } + + public override function flush():Void { + NativeFile.file_flush(__f); + } + + public override function close():Void { + super.close(); + NativeFile.file_close(__f); + } + + public function seek(p:Int, pos:FileSeek):Void { + NativeFile.file_seek(__f, p, pos == SeekBegin ? 0 : pos == SeekCur ? 1 : 2); + } + + public function tell():Int { + return NativeFile.file_tell(__f); + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/sys/io/Process.hx b/build/linux64_569e52e/std/cpp/_std/sys/io/Process.hx new file mode 100644 index 0000000..37bbf3b --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/sys/io/Process.hx @@ -0,0 +1,118 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.io; + +import cpp.NativeProcess; + +private class Stdin extends haxe.io.Output { + var p:Dynamic; + var buf:haxe.io.Bytes; + + public function new(p:Dynamic) { + this.p = p; + buf = haxe.io.Bytes.alloc(1); + } + + public override function close() { + super.close(); + NativeProcess.process_stdin_close(p); + } + + public override function writeByte(c) { + buf.set(0, c); + writeBytes(buf, 0, 1); + } + + public override function writeBytes(buf:haxe.io.Bytes, pos:Int, len:Int):Int { + try { + return NativeProcess.process_stdin_write(p, buf.getData(), pos, len); + } catch (e:Dynamic) { + throw new haxe.io.Eof(); + } + return 0; + } +} + +private class Stdout extends haxe.io.Input { + var p:Dynamic; + var out:Bool; + var buf:haxe.io.Bytes; + + public function new(p:Dynamic, out) { + this.p = p; + this.out = out; + buf = haxe.io.Bytes.alloc(1); + } + + public override function readByte() { + if (readBytes(buf, 0, 1) == 0) + throw haxe.io.Error.Blocked; + return buf.get(0); + } + + public override function readBytes(str:haxe.io.Bytes, pos:Int, len:Int):Int { + var result:Int; + try { + result = out ? NativeProcess.process_stdout_read(p, str.getData(), pos, len) : NativeProcess.process_stderr_read(p, str.getData(), pos, len); + } catch (e:Dynamic) { + throw new haxe.io.Eof(); + } + if (result == 0) + throw new haxe.io.Eof(); + return result; + } +} + +@:coreApi +class Process { + var p:Dynamic; + + public var stdout(default, null):haxe.io.Input; + public var stderr(default, null):haxe.io.Input; + public var stdin(default, null):haxe.io.Output; + + public function new(cmd:String, ?args:Array, ?detached:Bool):Void { + if (detached) + throw "Detached process is not supported on this platform"; + p = try NativeProcess.process_run(cmd, args) catch (e:Dynamic) throw "Process creation failure : " + cmd; + stdin = new Stdin(p); + stdout = new Stdout(p, true); + stderr = new Stdout(p, false); + } + + public function getPid():Int { + return NativeProcess.process_pid(p); + } + + public function exitCode(block:Bool = true):Null { + return NativeProcess.process_exit(p, block); + } + + public function close():Void { + NativeProcess.process_close(p); + } + + public function kill():Void { + NativeProcess.process_kill(p); + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/sys/net/Host.hx b/build/linux64_569e52e/std/cpp/_std/sys/net/Host.hx new file mode 100644 index 0000000..f403b96 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/sys/net/Host.hx @@ -0,0 +1,59 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.net; + +import cpp.NativeSocket; + +@:coreApi +class Host { + public var host(default, null):String; + + public var ip(default, null):Int; + + private var ipv6(default, null):haxe.io.BytesData; + + public function new(name:String):Void { + host = name; + try { + ip = NativeSocket.host_resolve(name); + } catch (e:Dynamic) { + ipv6 = NativeSocket.host_resolve_ipv6(name); + } + } + + public function toString():String { + return ipv6 == null ? NativeSocket.host_to_string(ip) : NativeSocket.host_to_string_ipv6(ipv6); + } + + public function reverse():String { + return ipv6 == null ? NativeSocket.host_reverse(ip) : NativeSocket.host_reverse_ipv6(ipv6); + } + + public static function localhost():String { + return NativeSocket.host_local(); + } + + static function __init__():Void { + NativeSocket.socket_init(); + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/sys/net/Socket.hx b/build/linux64_569e52e/std/cpp/_std/sys/net/Socket.hx new file mode 100644 index 0000000..4c297cd --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/sys/net/Socket.hx @@ -0,0 +1,273 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.net; + +import haxe.io.Error; +import cpp.NativeSocket; +import cpp.NativeString; +import cpp.Pointer; + +private class SocketInput extends haxe.io.Input { + var __s:Dynamic; + + public function new(s:Dynamic) { + __s = s; + } + + public override function readByte() { + return try { + NativeSocket.socket_recv_char(__s); + } catch (e:Dynamic) { + if (e == "Blocking") + throw Blocked; + else if (__s == null) + throw Custom(e); + else + throw new haxe.io.Eof(); + } + } + + public override function readBytes(buf:haxe.io.Bytes, pos:Int, len:Int):Int { + var r; + if (__s == null) + throw "Invalid handle"; + try { + r = NativeSocket.socket_recv(__s, buf.getData(), pos, len); + } catch (e:Dynamic) { + if (e == "Blocking") + throw Blocked; + else + throw Custom(e); + } + if (r == 0) + throw new haxe.io.Eof(); + return r; + } + + public override function close() { + super.close(); + if (__s != null) + NativeSocket.socket_close(__s); + } +} + +private class SocketOutput extends haxe.io.Output { + var __s:Dynamic; + + public function new(s:Dynamic) { + __s = s; + } + + public override function writeByte(c:Int) { + if (__s == null) + throw "Invalid handle"; + try { + NativeSocket.socket_send_char(__s, c); + } catch (e:Dynamic) { + if (e == "Blocking") + throw Blocked; + else + throw Custom(e); + } + } + + public override function writeBytes(buf:haxe.io.Bytes, pos:Int, len:Int):Int { + return try { + NativeSocket.socket_send(__s, buf.getData(), pos, len); + } catch (e:Dynamic) { + if (e == "Blocking") + throw Blocked; + else if (e == "EOF") + throw new haxe.io.Eof(); + else + throw Custom(e); + } + } + + public override function close() { + super.close(); + if (__s != null) + NativeSocket.socket_close(__s); + } +} + +@:coreApi +class Socket { + private var __s:Dynamic; + + // We need to keep these values so that we can restore + // them if we re-create the socket for ipv6 as in + // connect() and bind() below. + private var __timeout:Float = 0.0; + private var __blocking:Bool = true; + private var __fastSend:Bool = false; + + public var input(default, null):haxe.io.Input; + public var output(default, null):haxe.io.Output; + public var custom:Dynamic; + + public function new():Void { + init(); + } + + private function init():Void { + if (__s == null) + __s = NativeSocket.socket_new(false); + // Restore these values if they changed. This can happen + // in connect() and bind() if using an ipv6 address. + setTimeout(__timeout); + setBlocking(__blocking); + setFastSend(__fastSend); + input = new SocketInput(__s); + output = new SocketOutput(__s); + } + + public function close():Void { + NativeSocket.socket_close(__s); + untyped { + var input:SocketInput = cast input; + var output:SocketOutput = cast output; + input.__s = null; + output.__s = null; + } + input.close(); + output.close(); + } + + public function read():String { + var bytes:haxe.io.BytesData = NativeSocket.socket_read(__s); + if (bytes == null) + return ""; + var arr:Array = cast bytes; + return NativeString.fromPointer(Pointer.ofArray(arr)); + } + + public function write(content:String):Void { + NativeSocket.socket_write(__s, haxe.io.Bytes.ofString(content).getData()); + } + + public function connect(host:Host, port:Int):Void { + try { + if (host.ip == 0 && host.host != "0.0.0.0") { + // hack, hack, hack + var ipv6:haxe.io.BytesData = Reflect.field(host, "ipv6"); + if (ipv6 != null) { + close(); + __s = NativeSocket.socket_new_ip(false, true); + init(); + NativeSocket.socket_connect_ipv6(__s, ipv6, port); + } else + throw "Unresolved host"; + } else + NativeSocket.socket_connect(__s, host.ip, port); + } catch (s:String) { + if (s == "Invalid socket handle") + throw "Failed to connect on " + host.toString() + ":" + port; + else if (s == "Blocking") { + // Do nothing, this is not a real error, it simply indicates + // that a non-blocking connect is in progress + } else + cpp.Lib.rethrow(s); + } + } + + public function listen(connections:Int):Void { + NativeSocket.socket_listen(__s, connections); + } + + public function shutdown(read:Bool, write:Bool):Void { + NativeSocket.socket_shutdown(__s, read, write); + } + + public function bind(host:Host, port:Int):Void { + if (host.ip == 0 && host.host != "0.0.0.0") { + var ipv6:haxe.io.BytesData = Reflect.field(host, "ipv6"); + if (ipv6 != null) { + close(); + __s = NativeSocket.socket_new_ip(false, true); + init(); + NativeSocket.socket_bind_ipv6(__s, ipv6, port); + } else + throw "Unresolved host"; + } else + NativeSocket.socket_bind(__s, host.ip, port); + } + + public function accept():Socket { + var c = NativeSocket.socket_accept(__s); + var s = Type.createEmptyInstance(Socket); + s.__s = c; + s.input = new SocketInput(c); + s.output = new SocketOutput(c); + return s; + } + + public function peer():{host:Host, port:Int} { + var a:Dynamic = NativeSocket.socket_peer(__s); + if (a == null) { + return null; + } + var h = new Host("127.0.0.1"); + untyped h.ip = a[0]; + return {host: h, port: a[1]}; + } + + public function host():{host:Host, port:Int} { + var a:Dynamic = NativeSocket.socket_host(__s); + if (a == null) { + return null; + } + var h = new Host("127.0.0.1"); + untyped h.ip = a[0]; + return {host: h, port: a[1]}; + } + + public function setTimeout(timeout:Float):Void { + __timeout = timeout; + NativeSocket.socket_set_timeout(__s, timeout); + } + + public function waitForRead():Void { + select([this], null, null, null); + } + + public function setBlocking(b:Bool):Void { + __blocking = b; + NativeSocket.socket_set_blocking(__s, b); + } + + public function setFastSend(b:Bool):Void { + __fastSend = b; + NativeSocket.socket_set_fast_send(__s, b); + } + + public static function select(read:Array, write:Array, others:Array, + ?timeout:Float):{read:Array, write:Array, others:Array} { + var neko_array = NativeSocket.socket_select(read, write, others, timeout); + if (neko_array == null) + throw "Select error"; + return @:fixed { + read:neko_array[0], write:neko_array[1], others:neko_array[2] + }; + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/sys/net/UdpSocket.hx b/build/linux64_569e52e/std/cpp/_std/sys/net/UdpSocket.hx new file mode 100644 index 0000000..dc4728c --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/sys/net/UdpSocket.hx @@ -0,0 +1,64 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.net; + +import haxe.io.Error; +import cpp.NativeSocket; + +@:coreApi +class UdpSocket extends Socket { + private override function init():Void { + __s = NativeSocket.socket_new(true); + super.init(); + } + + public function sendTo(buf:haxe.io.Bytes, pos:Int, len:Int, addr:Address):Int { + return try { + NativeSocket.socket_send_to(__s, buf.getData(), pos, len, addr); + } catch (e:Dynamic) { + if (e == "Blocking") + throw Blocked; + else + throw Custom(e); + } + } + + public function readFrom(buf:haxe.io.Bytes, pos:Int, len:Int, addr:Address):Int { + var r; + try { + r = NativeSocket.socket_recv_from(__s, buf.getData(), pos, len, addr); + } catch (e:Dynamic) { + if (e == "Blocking") + throw Blocked; + else + throw Custom(e); + } + if (r == 0) + throw new haxe.io.Eof(); + return r; + } + + public function setBroadcast(b:Bool):Void { + NativeSocket.socket_set_broadcast(__s, b); + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/sys/ssl/Certificate.hx b/build/linux64_569e52e/std/cpp/_std/sys/ssl/Certificate.hx new file mode 100644 index 0000000..ea7adcf --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/sys/ssl/Certificate.hx @@ -0,0 +1,136 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.ssl; + +import cpp.NativeSsl; + +@:coreApi +class Certificate { + var __h:Null; + var __x:Dynamic; + + @:allow(sys.ssl.Socket) + function new(x:Dynamic, ?h:Certificate) { + __x = x; + __h = h; + } + + public static function loadFile(file:String):Certificate { + return new Certificate(NativeSsl.cert_load_file(file)); + } + + public static function loadPath(path:String):Certificate { + return new Certificate(NativeSsl.cert_load_path(path)); + } + + public static function fromString(str:String):Certificate { + return new Certificate(NativeSsl.cert_add_pem(null, str)); + } + + public static function loadDefaults():Certificate { + var x = NativeSsl.cert_load_defaults(); + if (x != null) + return new Certificate(x); + + var defPaths = null; + switch (Sys.systemName()) { + case "Linux": + defPaths = [ + "/etc/ssl/certs/ca-certificates.crt", // Debian/Ubuntu/Gentoo etc. + "/etc/pki/tls/certs/ca-bundle.crt", // Fedora/RHEL + "/etc/ssl/ca-bundle.pem", // OpenSUSE + "/etc/pki/tls/cacert.pem", // OpenELEC + "/etc/ssl/certs", // SLES10/SLES11 + "/system/etc/security/cacerts" // Android + ]; + case "BSD": + defPaths = [ + "/usr/local/share/certs/ca-root-nss.crt", // FreeBSD/DragonFly + "/etc/ssl/cert.pem", // OpenBSD + "/etc/openssl/certs/ca-certificates.crt", // NetBSD + ]; + case "Android": + defPaths = ["/system/etc/security/cacerts"]; + default: + } + if (defPaths != null) { + for (path in defPaths) { + if (sys.FileSystem.exists(path)) { + if (sys.FileSystem.isDirectory(path)) + return loadPath(path); + else + return loadFile(path); + } + } + } + return null; + } + + public var commonName(get, null):Null; + public var altNames(get, null):Array; + public var notBefore(get, null):Date; + public var notAfter(get, null):Date; + + function get_commonName():Null { + return subject("CN"); + } + + function get_altNames():Array { + return NativeSsl.cert_get_altnames(__x); + } + + public function subject(field:String):Null { + return NativeSsl.cert_get_subject(__x, field); + } + + public function issuer(field:String):Null { + return NativeSsl.cert_get_issuer(__x, field); + } + + function get_notBefore():Date { + var a = NativeSsl.cert_get_notbefore(__x); + return new Date(a[0], a[1] - 1, a[2], a[3], a[4], a[5]); + } + + function get_notAfter():Date { + var a = NativeSsl.cert_get_notafter(__x); + return new Date(a[0], a[1] - 1, a[2], a[3], a[4], a[5]); + } + + public function next():Null { + var n = NativeSsl.cert_get_next(__x); + return n == null ? null : new Certificate(n, __h == null ? this : __h); + } + + public function add(pem:String):Void { + NativeSsl.cert_add_pem(__x, pem); + } + + public function addDER(der:haxe.io.Bytes):Void { + NativeSsl.cert_add_der(__x, der.getData()); + } + + static function __init__():Void { + NativeSsl.init(); + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/sys/ssl/Digest.hx b/build/linux64_569e52e/std/cpp/_std/sys/ssl/Digest.hx new file mode 100644 index 0000000..4130887 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/sys/ssl/Digest.hx @@ -0,0 +1,40 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.ssl; + +import cpp.NativeSsl; + +@:coreApi +class Digest { + public static function make(data:haxe.io.Bytes, alg:DigestAlgorithm):haxe.io.Bytes { + return haxe.io.Bytes.ofData(NativeSsl.dgst_make(data.getData(), alg)); + } + + public static function sign(data:haxe.io.Bytes, privKey:Key, alg:DigestAlgorithm):haxe.io.Bytes { + return haxe.io.Bytes.ofData(NativeSsl.dgst_sign(data.getData(), @:privateAccess privKey.__k, alg)); + } + + public static function verify(data:haxe.io.Bytes, signature:haxe.io.Bytes, pubKey:Key, alg:DigestAlgorithm):Bool { + return NativeSsl.dgst_verify(data.getData(), signature.getData(), @:privateAccess pubKey.__k, alg); + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/sys/ssl/Key.hx b/build/linux64_569e52e/std/cpp/_std/sys/ssl/Key.hx new file mode 100644 index 0000000..26c0bee --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/sys/ssl/Key.hx @@ -0,0 +1,57 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.ssl; + +import cpp.NativeSsl; + +private typedef PKEY = Dynamic; + +@:coreApi +class Key { + private var __k:PKEY; + + private function new(k:PKEY) { + __k = k; + } + + public static function loadFile(file:String, ?isPublic:Bool, ?pass:String):Key { + var data = sys.io.File.getBytes(file); + var str = cpp.Lib.stringReference(data); + if (str.indexOf("-----BEGIN ") >= 0) + return readPEM(str, isPublic == true, pass); + else + return readDER(data, isPublic == true); + } + + public static function readPEM(data:String, isPublic:Bool, ?pass:String):Key { + return new Key(NativeSsl.key_from_pem(data, isPublic, pass)); + } + + public static function readDER(data:haxe.io.Bytes, isPublic:Bool):Key { + return new Key(NativeSsl.key_from_der(data.getData(), isPublic)); + } + + static function __init__():Void { + NativeSsl.init(); + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/sys/ssl/Socket.hx b/build/linux64_569e52e/std/cpp/_std/sys/ssl/Socket.hx new file mode 100644 index 0000000..5357877 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/sys/ssl/Socket.hx @@ -0,0 +1,297 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.ssl; + +import cpp.NativeSocket; +import cpp.NativeSsl; + +private typedef SocketHandle = Dynamic; +private typedef CONF = Dynamic; +private typedef SSL = Dynamic; + +private class SocketInput extends haxe.io.Input { + @:allow(sys.ssl.Socket) private var __s:Socket; + + public function new(s:Socket) { + this.__s = s; + } + + public override function readByte() { + return try { + __s.handshake(); + NativeSsl.ssl_recv_char(@:privateAccess __s.ssl); + } catch (e:Dynamic) { + if (e == "Blocking") + throw haxe.io.Error.Blocked; + else if (__s == null) + throw haxe.io.Error.Custom(e); + else + throw new haxe.io.Eof(); + } + } + + public override function readBytes(buf:haxe.io.Bytes, pos:Int, len:Int):Int { + var r:Int; + if (__s == null) + throw "Invalid handle"; + try { + __s.handshake(); + r = NativeSsl.ssl_recv(@:privateAccess __s.ssl, buf.getData(), pos, len); + } catch (e:Dynamic) { + if (e == "Blocking") + throw haxe.io.Error.Blocked; + else + throw haxe.io.Error.Custom(e); + } + if (r == 0) + throw new haxe.io.Eof(); + return r; + } + + public override function close() { + super.close(); + if (__s != null) + __s.close(); + } +} + +private class SocketOutput extends haxe.io.Output { + @:allow(sys.ssl.Socket) private var __s:Socket; + + public function new(s:Socket) { + this.__s = s; + } + + public override function writeByte(c:Int) { + if (__s == null) + throw "Invalid handle"; + try { + __s.handshake(); + NativeSsl.ssl_send_char(@:privateAccess __s.ssl, c); + } catch (e:Dynamic) { + if (e == "Blocking") + throw haxe.io.Error.Blocked; + else + throw haxe.io.Error.Custom(e); + } + } + + public override function writeBytes(buf:haxe.io.Bytes, pos:Int, len:Int):Int { + return try { + __s.handshake(); + NativeSsl.ssl_send(@:privateAccess __s.ssl, buf.getData(), pos, len); + } catch (e:Dynamic) { + if (e == "Blocking") + throw haxe.io.Error.Blocked; + else + throw haxe.io.Error.Custom(e); + } + } + + public override function close() { + super.close(); + if (__s != null) + __s.close(); + } +} + +@:coreApi +class Socket extends sys.net.Socket { + public static var DEFAULT_VERIFY_CERT:Null = true; + + public static var DEFAULT_CA:Null; + + private var conf:CONF; + private var ssl:SSL; + + public var verifyCert:Null; + + private var caCert:Null; + private var hostname:String; + + private var ownCert:Null; + private var ownKey:Null; + private var altSNIContexts:NullBool, key:Key, cert:Certificate}>>; + private var sniCallback:Dynamic; + private var handshakeDone:Bool; + + private override function init():Void { + __s = NativeSocket.socket_new(false); + input = new SocketInput(this); + output = new SocketOutput(this); + if (DEFAULT_VERIFY_CERT && DEFAULT_CA == null) { + try { + DEFAULT_CA = Certificate.loadDefaults(); + } catch (e:Dynamic) {} + } + caCert = DEFAULT_CA; + verifyCert = DEFAULT_VERIFY_CERT; + } + + public override function connect(host:sys.net.Host, port:Int):Void { + try { + conf = buildSSLConfig(false); + ssl = NativeSsl.ssl_new(conf); + handshakeDone = false; + NativeSsl.ssl_set_socket(ssl, __s); + if (hostname == null) + hostname = host.host; + if (hostname != null) + NativeSsl.ssl_set_hostname(ssl, hostname); + NativeSocket.socket_connect(__s, host.ip, port); + handshake(); + } catch (s:String) { + if (s == "Invalid socket handle") + throw "Failed to connect on " + host.host + ":" + port; + else + cpp.Lib.rethrow(s); + } catch (e:Dynamic) { + cpp.Lib.rethrow(e); + } + } + + public function handshake():Void { + if (!handshakeDone) { + try { + NativeSsl.ssl_handshake(ssl); + handshakeDone = true; + } catch (e:Dynamic) { + if (e == "Blocking") + throw haxe.io.Error.Blocked; + else + cpp.Lib.rethrow(e); + } + } + } + + public function setCA(cert:Certificate):Void { + caCert = cert; + } + + public function setHostname(name:String):Void { + hostname = name; + } + + public function setCertificate(cert:Certificate, key:Key):Void { + ownCert = cert; + ownKey = key; + } + + public override function read():String { + handshake(); + var b = NativeSsl.ssl_read(ssl); + if (b == null) + return ""; + return haxe.io.Bytes.ofData(b).toString(); + } + + public override function write(content:String):Void { + handshake(); + NativeSsl.ssl_write(ssl, haxe.io.Bytes.ofString(content).getData()); + } + + public override function close():Void { + if (ssl != null) + NativeSsl.ssl_close(ssl); + if (conf != null) + NativeSsl.conf_close(conf); + if (altSNIContexts != null) + sniCallback = null; + NativeSocket.socket_close(__s); + var input:SocketInput = cast input; + var output:SocketOutput = cast output; + @:privateAccess input.__s = output.__s = null; + input.close(); + output.close(); + } + + public function addSNICertificate(cbServernameMatch:String->Bool, cert:Certificate, key:Key):Void { + if (altSNIContexts == null) + altSNIContexts = []; + altSNIContexts.push({match: cbServernameMatch, cert: cert, key: key}); + } + + public override function bind(host:sys.net.Host, port:Int):Void { + conf = buildSSLConfig(true); + + NativeSocket.socket_bind(__s, host.ip, port); + } + + public override function accept():Socket { + var c = NativeSocket.socket_accept(__s); + var ssl = NativeSsl.ssl_new(conf); + NativeSsl.ssl_set_socket(ssl, c); + + var s = Type.createEmptyInstance(sys.ssl.Socket); + s.__s = c; + s.ssl = ssl; + s.input = new SocketInput(s); + s.output = new SocketOutput(s); + s.handshakeDone = false; + + return s; + } + + public function peerCertificate():sys.ssl.Certificate { + var x = NativeSsl.ssl_get_peer_certificate(ssl); + return x == null ? null : new sys.ssl.Certificate(x); + } + + private function buildSSLConfig(server:Bool):CONF { + var conf:CONF = NativeSsl.conf_new(server); + + if (ownCert != null && ownKey != null) + NativeSsl.conf_set_cert(conf, @:privateAccess ownCert.__x, @:privateAccess ownKey.__k); + + if (altSNIContexts != null) { + sniCallback = function(servername) { + var servername = new String(cast servername); + for (c in altSNIContexts) { + if (c.match(servername)) + return @:privateAccess { + key:c.key.__k, cert:c.cert.__x + }; + } + if (ownKey != null && ownCert != null) + return @:privateAccess { + key:ownKey.__k, cert:ownCert.__x + }; + return null; + } + NativeSsl.conf_set_servername_callback(conf, sniCallback); + } + + if (caCert != null) + NativeSsl.conf_set_ca(conf, caCert == null ? null : @:privateAccess caCert.__x); + if (verifyCert == null) + NativeSsl.conf_set_verify(conf, 2); + else + NativeSsl.conf_set_verify(conf, verifyCert ? 1 : 0); + + return conf; + } + + static function __init__():Void { + NativeSsl.init(); + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/sys/thread/Condition.hx b/build/linux64_569e52e/std/cpp/_std/sys/thread/Condition.hx new file mode 100644 index 0000000..484db3c --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/sys/thread/Condition.hx @@ -0,0 +1,33 @@ +package sys.thread; + +@:coreApi +class Condition { + var c:Dynamic; + public function new():Void { + c = untyped __global__.__hxcpp_condition_create(); + } + + public function acquire():Void { + untyped __global__.__hxcpp_condition_acquire(c); + } + + public function tryAcquire():Bool { + return untyped __global__.__hxcpp_condition_try_acquire(c); + } + + public function release():Void { + untyped __global__.__hxcpp_condition_release(c); + } + + public function wait():Void { + untyped __global__.__hxcpp_condition_wait(c); + } + + public function signal():Void { + untyped __global__.__hxcpp_condition_signal(c); + } + + public function broadcast():Void { + untyped __global__.__hxcpp_condition_broadcast(c); + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/sys/thread/Deque.hx b/build/linux64_569e52e/std/cpp/_std/sys/thread/Deque.hx new file mode 100644 index 0000000..36a6ed9 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/sys/thread/Deque.hx @@ -0,0 +1,44 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.thread; + +@:coreApi +class Deque { + var q:Dynamic; + + public function new() { + q = untyped __global__.__hxcpp_deque_create(); + } + + public function add(i:T):Void { + untyped __global__.__hxcpp_deque_add(q, i); + } + + public function push(i:T):Void { + untyped __global__.__hxcpp_deque_push(q, i); + } + + public function pop(block:Bool):Null { + return untyped __global__.__hxcpp_deque_pop(q, block); + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/sys/thread/Lock.hx b/build/linux64_569e52e/std/cpp/_std/sys/thread/Lock.hx new file mode 100644 index 0000000..992d4d1 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/sys/thread/Lock.hx @@ -0,0 +1,40 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.thread; + +@:coreApi +class Lock { + var l:Dynamic; + + public function new() { + l = untyped __global__.__hxcpp_lock_create(); + } + + public function wait(?timeout:Float = -1):Bool { + return untyped __global__.__hxcpp_lock_wait(l, timeout); + } + + public function release():Void { + untyped __global__.__hxcpp_lock_release(l); + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/sys/thread/Mutex.hx b/build/linux64_569e52e/std/cpp/_std/sys/thread/Mutex.hx new file mode 100644 index 0000000..8d10509 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/sys/thread/Mutex.hx @@ -0,0 +1,44 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.thread; + +@:coreApi +class Mutex { + var m:Dynamic; + + public function new() { + m = untyped __global__.__hxcpp_mutex_create(); + } + + public function acquire():Void { + untyped __global__.__hxcpp_mutex_acquire(m); + } + + public function tryAcquire():Bool { + return untyped __global__.__hxcpp_mutex_try(m); + } + + public function release():Void { + untyped __global__.__hxcpp_mutex_release(m); + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/sys/thread/Semaphore.hx b/build/linux64_569e52e/std/cpp/_std/sys/thread/Semaphore.hx new file mode 100644 index 0000000..a09774f --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/sys/thread/Semaphore.hx @@ -0,0 +1,22 @@ +package sys.thread; + +@:coreApi +class Semaphore { + var m:Dynamic; + + public function new(value:Int) { + m = untyped __global__.__hxcpp_semaphore_create(value); + } + + public function acquire():Void { + untyped __global__.__hxcpp_semaphore_acquire(m); + } + + public function tryAcquire(?timeout:Float):Bool { + return untyped __global__.__hxcpp_semaphore_try_acquire(m, timeout == null ? 0 : (timeout:Float)); + } + + public function release():Void { + untyped __global__.__hxcpp_semaphore_release(m); + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/sys/thread/Thread.hx b/build/linux64_569e52e/std/cpp/_std/sys/thread/Thread.hx new file mode 100644 index 0000000..f97de44 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/sys/thread/Thread.hx @@ -0,0 +1,189 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.thread; + +private typedef ThreadImpl = HaxeThread; + +abstract Thread(ThreadImpl) from ThreadImpl { + public var events(get,never):EventLoop; + + public inline function sendMessage(msg:Dynamic):Void { + this.sendMessage(msg); + } + + public static inline function current():Thread { + return HaxeThread.current(); + } + + public static inline function create(job:()->Void):Thread { + return HaxeThread.create(job, false); + } + + public static inline function runWithEventLoop(job:()->Void):Void { + HaxeThread.runWithEventLoop(job); + } + + public static inline function createWithEventLoop(job:()->Void):Thread { + return HaxeThread.create(job, true); + } + + public static function readMessage(block:Bool):Dynamic { + return HaxeThread.readMessage(block); + } + + function get_events():EventLoop { + if(this.events == null) + throw new NoEventLoopException(); + return this.events; + } + + @:keep + static public function processEvents() { + HaxeThread.current().events.loop(); + } +} + +@:callable +@:coreType +private abstract NativeThreadHandle {} + +private typedef ThreadHandle = NativeThreadHandle; + + +private class HaxeThread { + static var threads:Array<{thread:HaxeThread, handle:ThreadHandle}>; + static var threadsMutex:Mutex; + static var mainThreadHandle:ThreadHandle; + static var mainThread:HaxeThread; + + static function __init__() { + threads = []; + threadsMutex = new Mutex(); + mainThreadHandle = currentHandle(); + mainThread = new HaxeThread(currentHandle()); + mainThread.events = new EventLoop(); + } + + public var events(default,null):Null; + public var handle:ThreadHandle; + final messages = new Deque(); + + static public function current():HaxeThread { + var handle = currentHandle(); + if(handle == mainThreadHandle) { + return mainThread; + } + threadsMutex.acquire(); + var thread = null; + for(item in threads) { + if(item.handle == handle) { + thread = item.thread; + break; + } + } + if(thread == null) { + thread = new HaxeThread(handle); + threads.push({thread:thread, handle:handle}); + } + threadsMutex.release(); + return thread; + } + + public static function create(job:()->Void, withEventLoop:Bool):Thread { + var item = {handle:null, thread:new HaxeThread(null)}; + threadsMutex.acquire(); + var index = threads.push(item); + threadsMutex.release(); + if(withEventLoop) + item.thread.events = new EventLoop(); + item.handle = createHandle(() -> { + if(item.thread.handle == null) { + item.handle = currentHandle(); + item.thread.handle = item.handle; + } + try { + job(); + if(withEventLoop) + item.thread.events.loop(); + } catch(e) { + dropThread(item, index); + throw e; + } + dropThread(item, index); + }); + item.thread.handle = item.handle; + return item.thread; + } + + public static function runWithEventLoop(job:()->Void):Void { + var thread = current(); + if(thread.events == null) { + thread.events = new EventLoop(); + try { + job(); + thread.events.loop(); + thread.events = null; + } catch(e) { + thread.events = null; + throw e; + } + } else { + job(); + } + } + + static function dropThread(item, probableIndex:Int) { + threadsMutex.acquire(); + if(threads[probableIndex] == item) { + threads.splice(probableIndex, 1); + } else { + for(i => item2 in threads) { + if(item2 == item) { + threads.splice(i, 1); + break; + } + } + } + threadsMutex.release(); + } + + function new(h:ThreadHandle):Void { + handle = h; + } + + public inline function sendMessage(msg:Dynamic):Void { + messages.add(msg); + } + + static #if !scriptable inline #end function currentHandle():ThreadHandle { + return untyped __global__.__hxcpp_thread_current(); + } + + static #if !scriptable inline #end function createHandle(callb:Void->Void):ThreadHandle { + return untyped __global__.__hxcpp_thread_create(callb); + } + + public static #if !scriptable inline #end function readMessage(block:Bool):Dynamic { + return current().messages.pop(block); + } +} diff --git a/build/linux64_569e52e/std/cpp/_std/sys/thread/Tls.hx b/build/linux64_569e52e/std/cpp/_std/sys/thread/Tls.hx new file mode 100644 index 0000000..7baad6c --- /dev/null +++ b/build/linux64_569e52e/std/cpp/_std/sys/thread/Tls.hx @@ -0,0 +1,45 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.thread; + +@:coreApi +class Tls { + static var sFreeSlot = 0; + + var mTLSID:Int; + + public var value(get, set):T; + + public function new() { + mTLSID = sFreeSlot++; + } + + function get_value():T { + return untyped __global__.__hxcpp_tls_get(mTLSID); + } + + function set_value(v:T):T { + untyped __global__.__hxcpp_tls_set(mTLSID, v); + return v; + } +} diff --git a/build/linux64_569e52e/std/cpp/abi/Abi.hx b/build/linux64_569e52e/std/cpp/abi/Abi.hx new file mode 100644 index 0000000..ca9b182 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/abi/Abi.hx @@ -0,0 +1,26 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.abi; + +// Base case, for calling conventions - means "use default" +extern class Abi {} diff --git a/build/linux64_569e52e/std/cpp/abi/CDecl.hx b/build/linux64_569e52e/std/cpp/abi/CDecl.hx new file mode 100644 index 0000000..efecc84 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/abi/CDecl.hx @@ -0,0 +1,26 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.abi; + +@:abi("__cdecl") +extern class CDecl extends Abi {} diff --git a/build/linux64_569e52e/std/cpp/abi/FastCall.hx b/build/linux64_569e52e/std/cpp/abi/FastCall.hx new file mode 100644 index 0000000..32b235e --- /dev/null +++ b/build/linux64_569e52e/std/cpp/abi/FastCall.hx @@ -0,0 +1,26 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.abi; + +@:abi("__fastcall") +extern class FastCall extends Abi {} diff --git a/build/linux64_569e52e/std/cpp/abi/StdCall.hx b/build/linux64_569e52e/std/cpp/abi/StdCall.hx new file mode 100644 index 0000000..f966adf --- /dev/null +++ b/build/linux64_569e52e/std/cpp/abi/StdCall.hx @@ -0,0 +1,26 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.abi; + +@:abi("__stdcall") +extern class StdCall extends Abi {} diff --git a/build/linux64_569e52e/std/cpp/abi/ThisCall.hx b/build/linux64_569e52e/std/cpp/abi/ThisCall.hx new file mode 100644 index 0000000..ce5f6e9 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/abi/ThisCall.hx @@ -0,0 +1,26 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.abi; + +@:abi("__thiscall") +extern class ThisCall extends Abi {} diff --git a/build/linux64_569e52e/std/cpp/abi/Winapi.hx b/build/linux64_569e52e/std/cpp/abi/Winapi.hx new file mode 100644 index 0000000..36580f9 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/abi/Winapi.hx @@ -0,0 +1,26 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.abi; + +@:abi("__stdcall") +extern class Winapi extends Abi {} diff --git a/build/linux64_569e52e/std/cpp/cppia/Host.hx b/build/linux64_569e52e/std/cpp/cppia/Host.hx new file mode 100644 index 0000000..af4dcdd --- /dev/null +++ b/build/linux64_569e52e/std/cpp/cppia/Host.hx @@ -0,0 +1,66 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.cppia; + +class Host { + #if utf16 + public static function run(source:haxe.io.Bytes) { + var module = Module.fromData(source.getData()); + module.boot(); + module.run(); + } + #else + public static function run(source:String) { + var module = Module.fromString(source); + module.boot(); + module.run(); + } + #end + + @:native("::hx::EnableJit") + extern public static function enableJit(enable:Bool):Void; + + public static function runFile(filename:String) { + var source = sys.io.File.getBytes(filename); + var module = Module.fromData(source.getData()); + module.boot(); + module.run(); + } + + public static function main() { + var args = Sys.args(); + if (args.remove("-jit")) + enableJit(true); + + var script = args[0]; + + #if (!scriptable && !doc_gen) + #error "Please define scriptable to use cppia" + #end + if (script == null) { + Sys.println("Usage : Cppia scriptname"); + } else { + runFile(script); + } + } +} diff --git a/build/linux64_569e52e/std/cpp/cppia/HostClasses.hx b/build/linux64_569e52e/std/cpp/cppia/HostClasses.hx new file mode 100644 index 0000000..8f40fa3 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/cppia/HostClasses.hx @@ -0,0 +1,240 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.cppia; + +import haxe.macro.Compiler; +import haxe.macro.Context; +import haxe.macro.Type; +#if !macro +#if cppia +@:build(cpp.cppia.HostClasses.exclude()) +#end +class HostClasses {} +#else +import Sys; +import haxe.Constraints; + +@:noPackageRestrict +class HostClasses { + static var classes = [ + "cpp.Lib", + "cpp.NativeArray", + "cpp.NativeString", + "cpp.vm.Debugger", + "sys.thread.Deque", + "sys.thread.Lock", + "sys.thread.Mutex", + "sys.thread.Thread", + "sys.thread.Tls", + "sys.thread.Semaphore", + "sys.thread.Condition", + "cpp.vm.ExecutionTrace", + "cpp.vm.Gc", + "cpp.vm.Profiler", + "cpp.vm.Unsafe", + "cpp.vm.WeakRef", + "cpp.Object", + "cpp.Int64", + "cpp.Int64Map", + "cpp.Finalizable", + "Std", + "StringBuf", + "sys.FileSystem", + "sys.io.File", + "sys.io.FileInput", + "sys.io.Process", + "sys.net.UdpSocket", + "sys.net.Socket", + "sys.ssl.Certificate", + "sys.ssl.Digest", + "sys.ssl.Key", + "sys.ssl.Socket", + "Enum", + "EnumValue", + // "Sys", + "Type", + "Xml", + "Date", + "Lambda", + "DateTools", + "List", + "Math", + "Reflect", + "StringBuf", + "StringTools", + "haxe.ds.IntMap", + "haxe.ds.ObjectMap", + "haxe.ds.StringMap", + "haxe.ds.BalancedTree", + "haxe.NativeStackTrace", + "haxe.Serializer", + "haxe.Unserializer", + "haxe.Resource", + "haxe.Template", + "haxe.Utf8", + "haxe.Log", + "haxe.zip.Compress", + "haxe.zip.Uncompress", + "haxe.crypto.BaseCode", + "haxe.crypto.Sha256", + "haxe.crypto.Hmac", + "haxe.crypto.Crc32", + "haxe.crypto.Base64", + "haxe.crypto.Adler32", + "haxe.crypto.Md5", + "haxe.crypto.Sha1", + "haxe.io.BufferInput", + "haxe.io.Bytes", + "haxe.io.BytesBuffer", + "haxe.io.BytesData", + "haxe.io.BytesInput", + "haxe.io.BytesOutput", + "haxe.io.Eof", + "haxe.io.Error", + "haxe.io.FPHelper", + "haxe.io.Input", + "haxe.io.Output", + "haxe.io.Path", + "haxe.io.StringInput", + "haxe.xml.Parser", + "haxe.Json", + "haxe.NativeStackTrace", + "haxe.Resource", + "haxe.Utf8", + "haxe.Int64", + "haxe.Int32", + "haxe.Serializer", + "haxe.Unserializer", + "haxe.ds.ArraySort", + "haxe.ds.GenericStack", + "haxe.ds.ObjectMap", + "haxe.ds.Vector", + "haxe.ds.BalancedTree", + "haxe.ds.HashMap", + "haxe.ds.Option", + "haxe.ds.WeakMap", + "haxe.ds.EnumValueMap", + "haxe.ds.IntMap", + "haxe.ds.StringMap", + "haxe.iterators.MapKeyValueIterator", + "StdTypes", + "Array", + "Class", + "Date", + "EReg", + "Enum", + "EnumValue", + // "IntIterator", + "List", + "Map", + "String", + "haxe.atomic.AtomicInt" + ]; + + static function parseClassInfo(externs:Map, filename:String) { + if (sys.FileSystem.exists(filename)) { + var file = sys.io.File.read(filename); + try { + while (true) { + var line = file.readLine(); + var parts = line.split(" "); + if (parts[0] == "class" || parts[0] == "interface" || parts[0] == "enum") + externs.set(parts[1], true); + } + } catch (e:Dynamic) {} + if (file != null) + file.close(); + } + } + + static function onGenerateCppia(types:Array):Void { + var externs = new Map(); + externs.set("Sys", true); + externs.set("haxe.IMap", true); + externs.set("haxe.crypto.HashMethod", true); + externs.set("haxe._Int64.Int64_Impl_", true); + externs.set("haxe._Int64.___Int64", true); + externs.set("haxe._Int32.Int32_Impl_", true); + externs.set("haxe._Int32.___Int32", true); + // Hidded in implementation classes + // externs.set("sys.db.RecordType",true); + externs.set("sys.net._Socket.SocketInput", true); + externs.set("sys.net._Socket.SocketOutput", true); + externs.set("sys.ssl._Socket.SocketInput", true); + externs.set("sys.ssl._Socket.SocketOutput", true); + externs.set("sys.thread._Thread.HaxeThread",true); + externs.set("haxe.ds.TreeNode", true); + externs.set("haxe.xml.XmlParserException", true); + for (e in classes) + externs.set(e, true); + + var define = Context.defined("dll_import") ? Context.definedValue("dll_import") : "1"; + if (define != "1") + parseClassInfo(externs, define); + else { + var tried = new Map(); + for (path in Context.getClassPath()) + if (!tried.exists(path)) { + tried.set(path, true); + parseClassInfo(externs, path + "/export_classes.info"); + } + } + + for (type in types) { + switch (type) { + case TInst(classRef, params): + if (externs.exists(classRef.toString())) + classRef.get().exclude(); + case TEnum(enumRef, params): + if (externs.exists(enumRef.toString())) + enumRef.get().exclude(); + default: + } + } + } + + // Exclude the standard classes, and any described in 'export_classes.info' files found in the classpath + public static function exclude() { + if (Context.defined("cppia")) + Context.onGenerate(onGenerateCppia); + else + Context.error("cpp.cppia.excludeHostFiles is only for cppia code", Context.currentPos()); + return Context.getBuildFields(); + } + + // Ensure that the standard classes are included in the host + public static function include() { + Compiler.keep("haxe.IMap"); + Compiler.keep("haxe.crypto.HashMethod"); + Compiler.keep("haxe._Int64.Int64_Impl_"); + Compiler.keep("haxe._Int32.Int32_Impl_"); + Compiler.keep("haxe._Int64.___Int64"); + Compiler.keep("haxe._Int32.___Int32"); + for (cls in classes) { + Context.getModule(cls); + Compiler.keep(cls); + } + return Context.getBuildFields(); + } +} +#end diff --git a/build/linux64_569e52e/std/cpp/cppia/Module.hx b/build/linux64_569e52e/std/cpp/cppia/Module.hx new file mode 100644 index 0000000..5ef46fa --- /dev/null +++ b/build/linux64_569e52e/std/cpp/cppia/Module.hx @@ -0,0 +1,36 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.cppia; + +@:native("::hx::CppiaLoadedModule") +@:build(cpp.cppia.HostClasses.include()) +extern class Module { + @:native("__scriptable_cppia_from_string") + static function fromString(sourceCode:String):Module; + @:native("__scriptable_cppia_from_data") + static function fromData(data:haxe.io.BytesData):Module; + + function boot():Void; + function run():Void; + function resolveClass(inName:String):Class; +} diff --git a/build/linux64_569e52e/std/cpp/link/StaticMysql.hx b/build/linux64_569e52e/std/cpp/link/StaticMysql.hx new file mode 100644 index 0000000..39c5874 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/link/StaticMysql.hx @@ -0,0 +1,40 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.link; + +#if (hxcpp_api_level >= 330) +class StaticMysql {} +#else +@:cppFileCode('extern "C" int mysql_register_prims();') +@:buildXml(" + + + + +") +@:keep class StaticMysql { + static function __init__() { + untyped __cpp__("mysql_register_prims();"); + } +} +#end diff --git a/build/linux64_569e52e/std/cpp/link/StaticRegexp.hx b/build/linux64_569e52e/std/cpp/link/StaticRegexp.hx new file mode 100644 index 0000000..e9a984d --- /dev/null +++ b/build/linux64_569e52e/std/cpp/link/StaticRegexp.hx @@ -0,0 +1,39 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.link; + +#if (hxcpp_api_level >= 330) +class StaticRegexp {} +#else +@:cppFileCode('extern "C" int regexp_register_prims();') +@:buildXml(" + + + +") +@:keep class StaticRegexp { + static function __init__() { + untyped __cpp__("regexp_register_prims();"); + } +} +#end diff --git a/build/linux64_569e52e/std/cpp/link/StaticSqlite.hx b/build/linux64_569e52e/std/cpp/link/StaticSqlite.hx new file mode 100644 index 0000000..23e0ded --- /dev/null +++ b/build/linux64_569e52e/std/cpp/link/StaticSqlite.hx @@ -0,0 +1,40 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.link; + +#if (hxcpp_api_level >= 330) +class StaticSqlite {} +#else +@:cppFileCode('extern "C" int sqlite_register_prims();') +@:buildXml(" + + + + +") +@:keep class StaticSqlite { + static function __init__() { + untyped __cpp__("sqlite_register_prims();"); + } +} +#end diff --git a/build/linux64_569e52e/std/cpp/link/StaticStd.hx b/build/linux64_569e52e/std/cpp/link/StaticStd.hx new file mode 100644 index 0000000..ca7b46f --- /dev/null +++ b/build/linux64_569e52e/std/cpp/link/StaticStd.hx @@ -0,0 +1,40 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.link; + +#if (hxcpp_api_level >= 330) +class StaticStd {} +#else +@:cppFileCode('extern "C" int std_register_prims();') +@:buildXml(" + + + + +") +@:keep class StaticStd { + static function __init__() { + untyped __cpp__("std_register_prims();"); + } +} +#end diff --git a/build/linux64_569e52e/std/cpp/link/StaticZlib.hx b/build/linux64_569e52e/std/cpp/link/StaticZlib.hx new file mode 100644 index 0000000..a47741f --- /dev/null +++ b/build/linux64_569e52e/std/cpp/link/StaticZlib.hx @@ -0,0 +1,39 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.link; + +#if (hxcpp_api_level >= 330) +class StaticZlib {} +#else +@:cppFileCode('extern "C" int zlib_register_prims();') +@:buildXml(" + + + +") +@:keep class StaticZlib { + static function __init__() { + untyped __cpp__("zlib_register_prims();"); + } +} +#end diff --git a/build/linux64_569e52e/std/cpp/net/Poll.hx b/build/linux64_569e52e/std/cpp/net/Poll.hx new file mode 100644 index 0000000..fb7dbf7 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/net/Poll.hx @@ -0,0 +1,57 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.net; + +import sys.net.Socket; +import cpp.NativeSocket; + +class Poll { + var mPollHandle:Dynamic; + + public var readIndexes:Array; + public var writeIndexes:Array; + + public function new(n:Int) { + mPollHandle = NativeSocket.socket_poll_alloc(n); + readIndexes = []; + writeIndexes = []; + } + + public function prepare(read:Array, write:Array) { + var k = NativeSocket.socket_poll_prepare(mPollHandle, read, write); + readIndexes = k[0]; + writeIndexes = k[1]; + } + + public function events(?t:Float) { + if (t == null) + t = -1.0; + NativeSocket.socket_poll_events(mPollHandle, t); + } + + public function poll(a:Array, ?t:Float):Array { + if (t == null) + t = -1.0; + return NativeSocket.socket_poll(a, mPollHandle, t); + } +} diff --git a/build/linux64_569e52e/std/cpp/net/ThreadServer.hx b/build/linux64_569e52e/std/cpp/net/ThreadServer.hx new file mode 100644 index 0000000..a3f7a74 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/net/ThreadServer.hx @@ -0,0 +1,363 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.net; + +import cpp.vm.Thread; +import cpp.net.Poll; +import cpp.vm.Lock; + +private typedef ThreadInfos = { + var id:Int; + var t:Thread; + var p:Poll; + var socks:Array; +} + +private typedef ClientInfos = { + var client:Client; + var sock:sys.net.Socket; + var thread:ThreadInfos; + var buf:haxe.io.Bytes; + var bufpos:Int; +} + +/** + The ThreadServer can be used to easily create a multithreaded server where each thread polls multiple connections. + To use it, at a minimum you must override or rebind clientConnected, readClientMessage, and clientMessage and you must define your Client and Message. +**/ +class ThreadServer { + var threads:Array; + var sock:sys.net.Socket; + var worker:Thread; + var timer:Thread; + + /** + Number of total connections the server will accept. + **/ + public var listen:Int; + + /** + Number of server threads. + **/ + public var nthreads:Int; + + /** + Polling timeout. + **/ + public var connectLag:Float; + + /** + Stream to send error messages. + **/ + public var errorOutput:haxe.io.Output; + + /** + Space allocated to buffers when they are created. + **/ + public var initialBufferSize:Int; + + /** + Maximum size of buffered data read from a socket. An exception is thrown if the buffer exceeds this value. + **/ + public var maxBufferSize:Int; + + /** + Minimum message size. + **/ + public var messageHeaderSize:Int; + + /** + Time between calls to update. + **/ + public var updateTime:Float; + + /** + The most sockets a thread will handle. + **/ + public var maxSockPerThread:Int; + + /** + Creates a ThreadServer. + **/ + public function new() { + threads = new Array(); + nthreads = if (Sys.systemName() == "Windows") 150 else 10; + messageHeaderSize = 1; + listen = 10; + connectLag = 0.5; + errorOutput = Sys.stderr(); + initialBufferSize = (1 << 10); + maxBufferSize = (1 << 16); + maxSockPerThread = 64; + updateTime = 1; + } + + function runThread(t) { + while (true) { + try { + loopThread(t); + } catch (e:Dynamic) { + logError(e); + } + } + } + + function readClientData(c:ClientInfos) { + var available = c.buf.length - c.bufpos; + if (available == 0) { + var newsize = c.buf.length * 2; + if (newsize > maxBufferSize) { + newsize = maxBufferSize; + if (c.buf.length == maxBufferSize) + throw "Max buffer size reached"; + } + var newbuf = haxe.io.Bytes.alloc(newsize); + newbuf.blit(0, c.buf, 0, c.bufpos); + c.buf = newbuf; + available = newsize - c.bufpos; + } + var bytes = c.sock.input.readBytes(c.buf, c.bufpos, available); + var pos = 0; + var len = c.bufpos + bytes; + while (len >= messageHeaderSize) { + var m = readClientMessage(c.client, c.buf, pos, len); + if (m == null) + break; + pos += m.bytes; + len -= m.bytes; + work(clientMessage.bind(c.client, m.msg)); + } + if (pos > 0) + c.buf.blit(0, c.buf, pos, len); + c.bufpos = len; + } + + function loopThread(t:ThreadInfos) { + if (t.socks.length > 0) + for (s in t.p.poll(t.socks, connectLag)) { + var infos:ClientInfos = s.custom; + try { + readClientData(infos); + } catch (e:Dynamic) { + t.socks.remove(s); + if (!Std.isOfType(e, haxe.io.Eof) && !Std.isOfType(e, haxe.io.Error)) + logError(e); + work(doClientDisconnected.bind(s, infos.client)); + } + } + while (true) { + var m:{s:sys.net.Socket, cnx:Bool} = Thread.readMessage(t.socks.length == 0); + if (m == null) + break; + if (m.cnx) + t.socks.push(m.s); + else if (t.socks.remove(m.s)) { + var infos:ClientInfos = m.s.custom; + work(doClientDisconnected.bind(m.s, infos.client)); + } + } + } + + function doClientDisconnected(s:sys.net.Socket, c) { + try + s.close() + catch (e:Dynamic) {}; + clientDisconnected(c); + } + + function runWorker() { + while (true) { + var f = Thread.readMessage(true); + try { + f(); + } catch (e:Dynamic) { + logError(e); + } + try { + afterEvent(); + } catch (e:Dynamic) { + logError(e); + } + } + } + + /** + Internally used to delegate something to the worker thread. + **/ + public function work(f:Void->Void) { + worker.sendMessage(f); + } + + function logError(e:Dynamic) { + var stack = haxe.CallStack.exceptionStack(); + if (Thread.current() == worker) + onError(e, stack); + else + work(onError.bind(e, stack)); + } + + function addClient(sock:sys.net.Socket) { + var start = Std.random(nthreads); + for (i in 0...nthreads) { + var t = threads[(start + i) % nthreads]; + if (t.socks.length < maxSockPerThread) { + var infos:ClientInfos = { + thread: t, + client: clientConnected(sock), + sock: sock, + buf: haxe.io.Bytes.alloc(initialBufferSize), + bufpos: 0, + }; + sock.custom = infos; + infos.thread.t.sendMessage({s: sock, cnx: true}); + return; + } + } + refuseClient(sock); + } + + function refuseClient(sock:sys.net.Socket) { + // we have reached maximum number of active clients + sock.close(); + } + + function runTimer() { + var l = new Lock(); + while (true) { + l.wait(updateTime); + work(update); + } + } + + function init() { + worker = Thread.create(runWorker); + timer = Thread.create(runTimer); + for (i in 0...nthreads) { + var t = { + id: i, + t: null, + socks: new Array(), + p: new Poll(maxSockPerThread), + }; + threads.push(t); + t.t = Thread.create(runThread.bind(t)); + } + } + + /** + Called when the server gets a new connection. + **/ + public function addSocket(s:sys.net.Socket) { + s.setBlocking(false); + work(addClient.bind(s)); + } + + /** + Start the server at the specified host and port. + **/ + public function run(host, port) { + sock = new sys.net.Socket(); + sock.bind(new sys.net.Host(host), port); + sock.listen(listen); + init(); + while (true) { + try { + addSocket(sock.accept()); + } catch (e:Dynamic) { + logError(e); + } + } + } + + /** + Send data to a client. + **/ + public function sendData(s:sys.net.Socket, data:String) { + try { + s.write(data); + } catch (e:Dynamic) { + stopClient(s); + } + } + + /** + Shutdown a client's connection and remove them from the server. + **/ + public function stopClient(s:sys.net.Socket) { + var infos:ClientInfos = s.custom; + try + s.shutdown(true, true) + catch (e:Dynamic) {}; + infos.thread.t.sendMessage({s: s, cnx: false}); + } + + // --- CUSTOMIZABLE API --- + + /** + Called when an error has ocurred. + **/ + public dynamic function onError(e:Dynamic, stack) { + var estr = try Std.string(e) catch (e2:Dynamic) "???" + try "[" + Std.string(e2) + "]" catch (e:Dynamic) ""; + errorOutput.writeString(estr + "\n" + haxe.CallStack.toString(stack)); + errorOutput.flush(); + } + + /** + Called when a client connects. Returns a client object. + **/ + public dynamic function clientConnected(s:sys.net.Socket):Client { + return null; + } + + /** + Called when a client disconnects or an error forces the connection to close. + **/ + public dynamic function clientDisconnected(c:Client) {} + + /** + Called when data has been read from a socket. This method should try to extract a message from the buffer. + The available data resides in buf, starts at pos, and is len bytes wide. Return the new message and the number of bytes read from the buffer. + If no message could be read, return null. + **/ + public dynamic function readClientMessage(c:Client, buf:haxe.io.Bytes, pos:Int, len:Int):{msg:Message, bytes:Int} { + return { + msg: null, + bytes: len, + }; + } + + /** + Called when a message has been recieved. Message handling code should go here. + **/ + public dynamic function clientMessage(c:Client, msg:Message) {} + + /** + This method is called periodically. It can be used to do server maintenance. + **/ + public dynamic function update() {} + + /** + Called after a client connects, disconnects, a message is received, or an update is performed. + **/ + public dynamic function afterEvent() {} +} diff --git a/build/linux64_569e52e/std/cpp/objc/NSData.hx b/build/linux64_569e52e/std/cpp/objc/NSData.hx new file mode 100644 index 0000000..d73348c --- /dev/null +++ b/build/linux64_569e52e/std/cpp/objc/NSData.hx @@ -0,0 +1,52 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.objc; + +@:native("NSData") @:objc extern class NSDataData {} + +@:objc +extern abstract NSData(NSDataData) { + @:native("_hx_value_to_objc") extern static function to_data(b:haxe.io.BytesData):NSData; + + @:native("_hx_value_to_objc") extern static function to_data_data(b:haxe.io.BytesData):NSDataData; + + @:native("_hx_objc_to_bytes") extern static function NSDataDataToBytes(d:NSDataData):haxe.io.BytesData; + + inline function new(d:NSDataData) + this = d; + + @:from extern static public inline function fromBytesData(d:haxe.io.BytesData):NSData + return new NSData(to_data_data(d)); + + @:from extern static public inline function fromBytes(d:haxe.io.Bytes):NSData + return new NSData(to_data_data(d.getData())); + + @:to extern public inline function toBytesData():haxe.io.BytesData + return NSDataDataToBytes(this); + + @:to extern public inline function toBytes():haxe.io.Bytes + return haxe.io.Bytes.ofData(NSDataDataToBytes(this)); + + @:to extern public inline function toNSObject():NSObject + return cast this; +} diff --git a/build/linux64_569e52e/std/cpp/objc/NSDictionary.hx b/build/linux64_569e52e/std/cpp/objc/NSDictionary.hx new file mode 100644 index 0000000..e26ae98 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/objc/NSDictionary.hx @@ -0,0 +1,44 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.objc; + +@:native("NSDictionary") @:objc extern class DictionaryData {} + +@:objc +extern abstract NSDictionary(DictionaryData) { + @:native("_hx_obj_to_nsdictionary") extern static function _hx_obj_to_nsdictionary(obj:Dynamic):DictionaryData; + + @:native("_hx_nsdictionary_to_obj") extern static function _hx_nsdictionary_to_obj(d:DictionaryData):Dynamic; + + inline function new(dict:DictionaryData) + this = dict; + + @:from extern static public inline function fromDynamic(o:Dynamic):NSDictionary + return new NSDictionary(_hx_obj_to_nsdictionary(o)); + + @:to extern public inline function toDynamic():Dynamic + return _hx_nsdictionary_to_obj(this); + + @:to extern public inline function toNSObject():NSObject + return cast this; +} diff --git a/build/linux64_569e52e/std/cpp/objc/NSError.hx b/build/linux64_569e52e/std/cpp/objc/NSError.hx new file mode 100644 index 0000000..06c8b7d --- /dev/null +++ b/build/linux64_569e52e/std/cpp/objc/NSError.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.objc; + +@:objc +@:native("NSError") +extern class NSError { + var localizedDescription(default, null):NSString; +} diff --git a/build/linux64_569e52e/std/cpp/objc/NSLog.hx b/build/linux64_569e52e/std/cpp/objc/NSLog.hx new file mode 100644 index 0000000..cba71e8 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/objc/NSLog.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.objc; + +extern class NSLog { + @:native("NSLog") + @:overload(function(format:NSString, a0:NSObject):Void {}) + @:overload(function(format:NSString, a0:NSObject, a1:NSObject):Void {}) + static function log(format:NSString):Void; +} diff --git a/build/linux64_569e52e/std/cpp/objc/NSObject.hx b/build/linux64_569e52e/std/cpp/objc/NSObject.hx new file mode 100644 index 0000000..6055999 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/objc/NSObject.hx @@ -0,0 +1,41 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.objc; + +@:native("id") @:objc extern class NSObjectData {} + +@:objc +extern abstract NSObject(NSObjectData) { + @:native("_hx_value_to_objc") extern static function _hx_value_to_objc(obj:Dynamic):NSObject; + + @:native("_hx_objc_to_dynamic") extern static function _hx_objc_to_dynamic(d:NSObjectData):Dynamic; + + inline function new(d:NSObjectData) + this = d; + + @:from extern static public inline function fromHaxe(d:Dynamic):NSObject + return _hx_value_to_objc(d); + + @:to extern public inline function toHaxe():Dynamic + return _hx_objc_to_dynamic(this); +} diff --git a/build/linux64_569e52e/std/cpp/objc/NSString.hx b/build/linux64_569e52e/std/cpp/objc/NSString.hx new file mode 100644 index 0000000..49c8487 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/objc/NSString.hx @@ -0,0 +1,46 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.objc; + +@:native("NSString") @:objc extern class NSStringData {} + +@:objc +extern abstract NSString(NSStringData) { + inline function new(s:NSStringData) + this = s; + + @:native("(id)") extern static function toObject(d:NSStringData):NSObject; + + @:native("(NSString *)") extern static function castFromString(s:String):NSString; + + @:native("String") extern static function castToString(s:NSStringData):String; + + @:from extern static public inline function fromString(s:String):NSString + return castFromString(s); + + @:to extern public inline function toString():String + return castToString(this); + + @:to extern public inline function toNSObject():NSObject + return toObject(this); +} diff --git a/build/linux64_569e52e/std/cpp/objc/ObjcBlock.hx b/build/linux64_569e52e/std/cpp/objc/ObjcBlock.hx new file mode 100644 index 0000000..0b252cc --- /dev/null +++ b/build/linux64_569e52e/std/cpp/objc/ObjcBlock.hx @@ -0,0 +1,26 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.objc; + +@:objc +typedef ObjcBlock = T; diff --git a/build/linux64_569e52e/std/cpp/objc/Protocol.hx b/build/linux64_569e52e/std/cpp/objc/Protocol.hx new file mode 100644 index 0000000..1469a08 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/objc/Protocol.hx @@ -0,0 +1,26 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.objc; + +@:objc +typedef Protocol = T; diff --git a/build/linux64_569e52e/std/cpp/rtti/FieldIntegerLookup.hx b/build/linux64_569e52e/std/cpp/rtti/FieldIntegerLookup.hx new file mode 100644 index 0000000..c90fbae --- /dev/null +++ b/build/linux64_569e52e/std/cpp/rtti/FieldIntegerLookup.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.rtti; + +/** + If you implement this interface, then the backend will generate code that + allows fast dynamic access to fields by integer id. This should speed up the CFFI. +**/ +interface FieldIntegerLookup {} diff --git a/build/linux64_569e52e/std/cpp/rtti/FieldNumericIntegerLookup.hx b/build/linux64_569e52e/std/cpp/rtti/FieldNumericIntegerLookup.hx new file mode 100644 index 0000000..3efa444 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/rtti/FieldNumericIntegerLookup.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.rtti; + +/** + If you implement this interface, then the backend will generate code that + allows fast numeric access to fields by integer id. This should speed up the CFFI. +**/ +interface FieldNumericIntegerLookup {} diff --git a/build/linux64_569e52e/std/cpp/vm/Debugger.hx b/build/linux64_569e52e/std/cpp/vm/Debugger.hx new file mode 100644 index 0000000..8f5f86d --- /dev/null +++ b/build/linux64_569e52e/std/cpp/vm/Debugger.hx @@ -0,0 +1,353 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.vm; + +/** + Parameter describes a function parameter. Instances of this class are + embedded in stack frame objects to describe the function parameters that + were used in the invocation of the function that defines that stack frame. +**/ +class Parameter { + public var name(default, null):String; + public var value(default, null):Dynamic; + + public function new(name:String, value:Dynamic) { + this.name = name; + this.value = value; + } +} + +/** + `StackFrame` describes one call stack frame. +**/ +class StackFrame { + public var fileName(default, null):String; + public var lineNumber(default, null):Int; + public var className(default, null):String; + public var functionName(default, null):String; + public var parameters(default, null):Array; + + public function new(fileName:String, lineNumber:Int, className:String, functionName:String) { + this.fileName = fileName; + this.lineNumber = lineNumber; + this.className = className; + this.functionName = functionName; + this.parameters = new Array(); + } +} + +/** + `ThreadInfo` describes the state of a single thread. +**/ +class ThreadInfo { + public static inline var STATUS_RUNNING = 1; + public static inline var STATUS_STOPPED_BREAK_IMMEDIATE = 2; + public static inline var STATUS_STOPPED_BREAKPOINT = 3; + public static inline var STATUS_STOPPED_UNCAUGHT_EXCEPTION = 4; + public static inline var STATUS_STOPPED_CRITICAL_ERROR = 5; + + /** 0 is never a valid thread number **/ + public var number(default, null):Int; + + public var status(default, null):Int; + + /** If status is "stopped breakpoint", this is the breakpoint number **/ + public var breakpoint(default, null):Int; + + /** If status is "critical error", this describes the error **/ + public var criticalErrorDescription(default, null):String; + + /** Stack will be listed with the lowest frame first **/ + public var stack(default, null):Array; + + public function new(number:Int, status:Int, breakpoint:Int = -1, criticalErrorDescription:String = null) { + this.number = number; + this.status = status; + this.breakpoint = breakpoint; + this.criticalErrorDescription = criticalErrorDescription; + this.stack = new Array(); + } +} + +/** + This class wraps the hxcpp C++ implementation to provide a Haxe interface + to the low level debugging features +**/ +class Debugger { + public static inline var THREAD_CREATED = 1; + public static inline var THREAD_TERMINATED = 2; + public static inline var THREAD_STARTED = 3; + public static inline var THREAD_STOPPED = 4; + + public static inline var STEP_INTO = 1; + public static inline var STEP_OVER = 2; + public static inline var STEP_OUT = 3; + + /** + This tagging value is returned by `getStackVariableValue()` and + `setStackVariableValue()` if the requested value does not exist at the + requested stack frame + **/ + public static var NONEXISTENT_VALUE = "NONEXISTENT_VALUE"; + + /** + This tagging value is returned by `getStackVariableValue()` and + `setStackVariableValue()` if the stack variable that is being set is on a + thread that is running, in which case the set does not take place. + **/ + public static var THREAD_NOT_STOPPED = "THREAD_NOT_STOPPED"; + + /** + Sets the handler callback to be made when asynchronous events occur, + specifically, when threads are created, terminated, started, or + stopped. The calling thread becomes the "debugger" thread, which means + that it will be discluded from any breakpoints and will not be reported + on by any thread reporting requests. + + Be aware that this callback is made asynchronously and possibly by + multiple threads simultaneously. + + Setting this to `null` prevents further callbacks. + + Throws a string exception if the program does not support debugging + because it was not compiled with the `HXCPP_DEBUGGER` flag set. + + @param handler is a function that will be called back by asynchronous + thread events. Note that this function is called directly from + the thread experiencing the event and the handler should return + quickly to avoid blocking the calling thread unnecessarily. + The parameters to handler are: + - `threadNumber`, the thread number of the event + - event, one of `THREAD_CREATED`, `THREAD_TERMINATED`, + `THREAD_STARTED`, or `THREAD_STOPPED` + - stackFrame, the stack frame number at which the thread is stopped, + undefined if event is not `THREAD_STOPPED` + - `className`, the class name at which the thread is stopped, + undefined if event is not `THREAD_STOPPED` + - `functionName`, the function name at which the thread is + stopped, undefined if event is not `THREAD_STOPPED` + - `fileName`, the file name at which the thread is stopped, + undefined if event is not `THREAD_STOPPED` + - `lineNumber`, the line number at which the thread is stopped, + undefined if event is not `THREAD_STOPPED` + **/ + public static function setEventNotificationHandler(handler:(threadNumber:Int, event:Int, stackFrame:Int, className:String, functionName:String, + fileName:String, lineNumber:Int) -> Void) { + untyped __global__.__hxcpp_dbg_setEventNotificationHandler(handler); + } + + /** + This can be called to turn off (and then back on) all stopping of + debugged threads temporarily. It should only be used by classes that + actually implement the debugger to hide themselves from the debugger as + necessary. + **/ + public static function enableCurrentThreadDebugging(enabled:Bool) { + untyped __global__.__hxcpp_dbg_enableCurrentThreadDebugging(enabled); + } + + /** + Returns the thread number of the calling thread. + + @return the thread number of the calling thread. + **/ + public static function getCurrentThreadNumber():Int { + return untyped __global__.__hxcpp_dbg_getCurrentThreadNumber(); + } + + /** + Returns the set of source files known to the debugger. This is a copy + of the original array and could be quite large. The caller should + cache this value to avoid multiple copies needing to be made. + + @return the set of source files known to the debugger. + **/ + public static function getFiles():Array { + return untyped __global__.__hxcpp_dbg_getFiles(); + } + + /** + Returns the full paths of the set of source files known to the debugger. + This is a copy of the original array and could be quite large. + It is possible that this set will be empty, in which case the full paths are not known. + The index of these files matches the index from `getFiles()`, so the full path for + a given short path can be calculated. + + @return the known full paths of the set of source files + **/ + public static function getFilesFullPath():Array { + return untyped __global__.__hxcpp_dbg_getFilesFullPath(); + } + + /** + Returns the set of class names of all classes known to the debugger. + This is a copy of the original array and could be quite large. The + caller should cache this value to avoid multiple copies needing to be + made. + + @return the set of class names of all classes known to the debugger. + **/ + public static function getClasses():Array { + return untyped __global__.__hxcpp_dbg_getClasses(); + } + + /** + Returns a `ThreadInfo` object describing every thread that existed at the + moment that the call was made, except for the debugger thread. + **/ + public static function getThreadInfos():Array { + return untyped __global__.__hxcpp_dbg_getThreadInfos(); + } + + /** + Returns a `ThreadInfo` object describing a single thread, or `null` if + there is no such thread or the thread queried about was the debugger + thread and `unsafe` was not `true`. + **/ + public static function getThreadInfo(threadNumber:Int, unsafe:Bool):ThreadInfo { + return untyped __global__.__hxcpp_dbg_getThreadInfo(threadNumber, unsafe); + } + + /** + Adds a new `file:line` breakpoint. The breakpoint number of the newly + added breakpoint is returned. + **/ + public static function addFileLineBreakpoint(file:String, line:Int):Int { + return untyped __global__.__hxcpp_dbg_addFileLineBreakpoint(file, line); + } + + /** + Adds a new `class:function` breakpoint. The breakpoint number of the + newly added breakpoint is returned. + **/ + public static function addClassFunctionBreakpoint(className:String, functionName:String):Int { + return untyped __global__.__hxcpp_dbg_addClassFunctionBreakpoint(className, functionName); + } + + /** + Deletes a breakpoint, or all breakpoints. + **/ + public static function deleteBreakpoint(number:Null) { + if (number == null) { + untyped __global__.__hxcpp_dbg_deleteAllBreakpoints(); + } else { + untyped __global__.__hxcpp_dbg_deleteBreakpoint(cast(number, Int)); + } + } + + /** + Breaks all threads except the debugger thread (which should be the same + as the calling thread!). + + If `wait` is `true`, waits up to 2 seconds for all threads to be broken. + Threads which are in blocking system calls and cannot break after 2 + seconds remain running when this function returns. + **/ + public static function breakNow(wait:Bool = true) { + untyped __global__.__hxcpp_dbg_breakNow(wait); + } + + /** + Continue execution of all stopped threads. If `specialThreadNumber` + is a valid thread number, then it will be continued past + `continueCount` breakpoints instead of just 1 like all of the other + threads. + **/ + public static function continueThreads(specialThreadNumber:Int, continueCount:Int) { + untyped __global__.__hxcpp_dbg_continueThreads(specialThreadNumber, continueCount); + } + + /** + Single steps the given thread. + **/ + public static function stepThread(threadNumber:Int, stepType:Int, stepCount:Int = 1) { + untyped __global__.__hxcpp_dbg_stepThread(threadNumber, stepType, stepCount); + } + + /** + Returns the list of local variables (including `this`, function + arguments, and local variables) visible to the given thread at the + given stack frame. + + Returns a list with a single entry, `THREAD_NOT_STOPPED`, if the + thread is not stopped and thus variables cannot be fetched and + `unsafe` is not `true`. + + @return the list of local variables (including `this`, function + arguments, and local variables) visible to the given thread at + the given stack frame. + **/ + public static function getStackVariables(threadNumber:Int, stackFrameNumber:Int, unsafe:Bool):Array { + return untyped __global__.__hxcpp_dbg_getStackVariables(threadNumber, stackFrameNumber, unsafe, THREAD_NOT_STOPPED); + } + + /** + Returns the value of a stack variable, or `NONEXISTENT_VALUE` if the + requested value does not exist. If the thread is actively running + and `unsafe` is not `true`, returns `THREAD_NOT_STOPPED`. + **/ + public static function getStackVariableValue(threadNumber:Int, stackFrameNumber:Int, name:String, unsafe:Bool):Dynamic { + return untyped __global__.__hxcpp_dbg_getStackVariableValue(threadNumber, stackFrameNumber, name, unsafe, NONEXISTENT_VALUE, THREAD_NOT_STOPPED); + } + + /** + Sets the value of a stack variable and returns that value. If the + variable does not exist, on the stack, this function returns + `NONEXISTENT_VALUE`. If the thread is actively running and `unsafe` is not + `true`, returns `THREAD_NOT_STOPPED`, and the value is not set. + **/ + public static function setStackVariableValue(threadNumber:Int, stackFrameNumber:Int, name:String, value:Dynamic, unsafe:Bool):Dynamic { + return untyped __global__.__hxcpp_dbg_setStackVariableValue(threadNumber, stackFrameNumber, name, value, unsafe, NONEXISTENT_VALUE, + THREAD_NOT_STOPPED); + } + + // The hxcpp runtime calls back through these functions to create Haxe + // objects as needed, which allows the C++ implementation code to create + // Haxe objects without having to actually know the structure of those + // objects + private static function __init__() { + untyped __global__.__hxcpp_dbg_setNewParameterFunction(function(name:String, value:Dynamic):Dynamic { + return new Parameter(name, value); + }); + + untyped __global__.__hxcpp_dbg_setNewStackFrameFunction(function(fileName:String, lineNumber:Int, className:String, functionName:String) { + return new StackFrame(fileName, lineNumber, className, functionName); + }); + + untyped __global__.__hxcpp_dbg_setNewThreadInfoFunction(function(number:Int, status:Int, breakpoint:Int, criticalErrorDescription:String):Dynamic { + return new ThreadInfo(number, status, breakpoint, criticalErrorDescription); + }); + + untyped __global__.__hxcpp_dbg_setAddParameterToStackFrameFunction(function(inStackFrame:Dynamic, inParameter:Dynamic) { + var stackFrame:StackFrame = cast inStackFrame; + var parameter:Parameter = cast inParameter; + stackFrame.parameters.push(parameter); + }); + + untyped __global__.__hxcpp_dbg_setAddStackFrameToThreadInfoFunction(function(inThreadInfo:Dynamic, inStackFrame:Dynamic) { + var threadInfo:ThreadInfo = cast inThreadInfo; + var stackFrame:StackFrame = cast inStackFrame; + threadInfo.stack.push(stackFrame); + }); + } +} diff --git a/build/linux64_569e52e/std/cpp/vm/Deque.hx b/build/linux64_569e52e/std/cpp/vm/Deque.hx new file mode 100644 index 0000000..6858dff --- /dev/null +++ b/build/linux64_569e52e/std/cpp/vm/Deque.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.vm; + +@:deprecated typedef Deque = sys.thread.Deque; diff --git a/build/linux64_569e52e/std/cpp/vm/ExecutionTrace.hx b/build/linux64_569e52e/std/cpp/vm/ExecutionTrace.hx new file mode 100644 index 0000000..61e52b9 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/vm/ExecutionTrace.hx @@ -0,0 +1,37 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.vm; + +class ExecutionTrace { + public static function traceOff() { + untyped __hxcpp_execution_trace(0); + } + + public static function traceFunctions() { + untyped __hxcpp_execution_trace(1); + } + + public static function traceLines() { + untyped __hxcpp_execution_trace(2); + } +} diff --git a/build/linux64_569e52e/std/cpp/vm/Gc.hx b/build/linux64_569e52e/std/cpp/vm/Gc.hx new file mode 100644 index 0000000..ce7ce88 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/vm/Gc.hx @@ -0,0 +1,131 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.vm; + +class Gc { + public static inline var MEM_INFO_USAGE = 0; + public static inline var MEM_INFO_RESERVED = 1; + public static inline var MEM_INFO_CURRENT = 2; + public static inline var MEM_INFO_LARGE = 3; + + /** + Introduced hxcpp_api_level 310 + + Returns stats on memory usage: + - `MEM_INFO_USAGE` - estimate of how much is needed by program (at last collect) + - `MEM_INFO_RESERVED` - memory allocated for possible use + - `MEM_INFO_CURRENT` - memory in use, includes uncollected garbage. + This will generally saw-tooth between USAGE and RESERVED + - `MEM_INFO_LARGE` - Size of separate pool used for large allocs. Included in all the above. + **/ + static public function memInfo(inWhatInfo:Int):Int { + return Std.int(NativeGc.memInfo(inWhatInfo)); + } + + // Returns Float + static public function memInfo64(inWhatInfo:Int):Float { + return NativeGc.memInfo(inWhatInfo); + } + + static public function memUsage():Int { + return Std.int(NativeGc.memInfo(MEM_INFO_USAGE)); + } + + static public function versionCheck() { + return true; + } + + static public function trace(sought:Class, printInstances:Bool = true):Int { + return cpp.NativeGc.nativeTrace(sought, printInstances); + } + + #if !cppia + inline + #end + static public function enable(inEnable:Bool):Void + cpp.NativeGc.enable(inEnable); + + #if !cppia + inline + #end + static public function run(major:Bool):Void + cpp.NativeGc.run(major); + + #if !cppia + inline + #end + static public function compact():Void + cpp.NativeGc.compact(); + + #if !cppia + inline + #end + static public function doNotKill(inObject:Dynamic):Void + cpp.NativeGc.doNotKill(inObject); + + #if !cppia + inline + #end + static public function getNextZombie():Dynamic + return cpp.NativeGc.getNextZombie(); + + #if !cppia + inline + #end + static public function safePoint():Void + cpp.NativeGc.safePoint(); + + #if !cppia + inline + #end + static public function enterGCFreeZone():Void + cpp.NativeGc.enterGCFreeZone(); + + #if !cppia + inline + #end + static public function exitGCFreeZone():Void + cpp.NativeGc.exitGCFreeZone(); + + #if !cppia + inline + #end + static public function setMinimumFreeSpace(inBytes:Int):Void + cpp.NativeGc.setMinimumFreeSpace(inBytes); + + #if !cppia + inline + #end + static public function setTargetFreeSpacePercentage(inPercentage:Int):Void + cpp.NativeGc.setTargetFreeSpacePercentage(inPercentage); + + #if !cppia + inline + #end + static public function setMinimumWorkingMemory(inBytes:Int):Void + cpp.NativeGc.setMinimumWorkingMemory(inBytes); + + #if !cppia + @:native("__hxcpp_set_finalizer") extern static public function setFinalizer(inObject:T, inFinalizer:cpp.CallableVoid>):Void; + #end +} diff --git a/build/linux64_569e52e/std/cpp/vm/Lock.hx b/build/linux64_569e52e/std/cpp/vm/Lock.hx new file mode 100644 index 0000000..9aa46bf --- /dev/null +++ b/build/linux64_569e52e/std/cpp/vm/Lock.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.vm; + +@:deprecated typedef Lock = sys.thread.Lock; diff --git a/build/linux64_569e52e/std/cpp/vm/Mutex.hx b/build/linux64_569e52e/std/cpp/vm/Mutex.hx new file mode 100644 index 0000000..de23e91 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/vm/Mutex.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.vm; + +@:deprecated typedef Mutex = sys.thread.Mutex; diff --git a/build/linux64_569e52e/std/cpp/vm/Profiler.hx b/build/linux64_569e52e/std/cpp/vm/Profiler.hx new file mode 100644 index 0000000..8cd4e40 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/vm/Profiler.hx @@ -0,0 +1,33 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.vm; + +class Profiler { + static public function start(?inDumpFile:String):Void { + untyped __global__.__hxcpp_start_profiler(inDumpFile); + } + + static public function stop():Void { + untyped __global__.__hxcpp_stop_profiler(); + } +} diff --git a/build/linux64_569e52e/std/cpp/vm/Thread.hx b/build/linux64_569e52e/std/cpp/vm/Thread.hx new file mode 100644 index 0000000..3909377 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/vm/Thread.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.vm; + +@:deprecated typedef Thread = sys.thread.Thread; diff --git a/build/linux64_569e52e/std/cpp/vm/Tls.hx b/build/linux64_569e52e/std/cpp/vm/Tls.hx new file mode 100644 index 0000000..e75d6a1 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/vm/Tls.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.vm; + +@:deprecated typedef Tls = sys.thread.Tls; diff --git a/build/linux64_569e52e/std/cpp/vm/Unsafe.hx b/build/linux64_569e52e/std/cpp/vm/Unsafe.hx new file mode 100644 index 0000000..984fd94 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/vm/Unsafe.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.vm; + +class Unsafe { + public static inline function unsafeSet(outForced:Dynamic, inValue:Dynamic):Void { + untyped __global__.__hxcpp_unsafe_set(outForced, inValue); + } +} diff --git a/build/linux64_569e52e/std/cpp/vm/WeakRef.hx b/build/linux64_569e52e/std/cpp/vm/WeakRef.hx new file mode 100644 index 0000000..d61ba8c --- /dev/null +++ b/build/linux64_569e52e/std/cpp/vm/WeakRef.hx @@ -0,0 +1,55 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.vm; + +class WeakRef { + var ref:Dynamic; + var hardRef:Bool; + + public function new(inObject:T, inHard:Bool = false) { + hardRef = inHard; + if (hardRef) + ref = inObject; + else + ref = untyped __global__.__hxcpp_weak_ref_create(inObject); + } + + public function get():T { + if (hardRef) + return ref; + + return untyped __global__.__hxcpp_weak_ref_get(ref); + } + + public function set(inObject:T):T { + if (hardRef) + ref = inObject; + else + ref = untyped __global__.__hxcpp_weak_ref_create(inObject); + return inObject; + } + + public function toString():String { + return "WeakRef(" + get() + ")"; + } +} diff --git a/build/linux64_569e52e/std/cpp/zip/Compress.hx b/build/linux64_569e52e/std/cpp/zip/Compress.hx new file mode 100644 index 0000000..295337a --- /dev/null +++ b/build/linux64_569e52e/std/cpp/zip/Compress.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.zip; + +typedef Compress = haxe.zip.Compress; diff --git a/build/linux64_569e52e/std/cpp/zip/Flush.hx b/build/linux64_569e52e/std/cpp/zip/Flush.hx new file mode 100644 index 0000000..f65f014 --- /dev/null +++ b/build/linux64_569e52e/std/cpp/zip/Flush.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.zip; + +typedef Flush = haxe.zip.FlushMode; diff --git a/build/linux64_569e52e/std/cpp/zip/Uncompress.hx b/build/linux64_569e52e/std/cpp/zip/Uncompress.hx new file mode 100644 index 0000000..6f5d3cb --- /dev/null +++ b/build/linux64_569e52e/std/cpp/zip/Uncompress.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package cpp.zip; + +typedef Uncompress = haxe.zip.Uncompress; diff --git a/build/linux64_569e52e/std/eval/NativeString.hx b/build/linux64_569e52e/std/eval/NativeString.hx new file mode 100644 index 0000000..27654f4 --- /dev/null +++ b/build/linux64_569e52e/std/eval/NativeString.hx @@ -0,0 +1,45 @@ +package eval; + +import haxe.io.Bytes; + +@:coreType abstract NativeString { + /** String length */ + public var length(get,never):Int; + function get_length():Int; + + @:from static public function fromString(s:String):NativeString; + + @:from static public function fromBytes(b:Bytes):NativeString; + + /** + Returns a character at the specified `index`. + + Throws an exception if `index` is outside of the string bounds. + **/ + public function char(index:Int):String; + + /** + Returns a character code at the specified `index`. + + Throws an exception if `index` is outside of the string bounds. + **/ + public function code(index:Int):Int; + + /** + Returns a fresh string up to `length` characters long, containing the + substring that starts at position `start`. + + If `length` is not specified the all characters from `start` to the end + of this string are returned. + + Throws an exception if `index` is outside of the string bounds. + **/ + public function sub(start:Int, ?length:Int):NativeString; + + public function toString():String; + + public function toBytes():Bytes; + + @:op(A + B) + public function concat(s:NativeString):NativeString; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/Vector.hx b/build/linux64_569e52e/std/eval/Vector.hx new file mode 100644 index 0000000..94ae2c4 --- /dev/null +++ b/build/linux64_569e52e/std/eval/Vector.hx @@ -0,0 +1,34 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package eval; + +extern class Vector implements ArrayAccess { + function new(size:Int):Void; + var length(default, null):Int; + function blit(srcPos:Int, dest:Vector, destPos:Int, len:Int):Void; + function toArray():Array; + static function fromArrayCopy(array:Array):Vector; + function copy():Vector; + function join(sep:String):String; + function map(f:T->S):Vector; +} diff --git a/build/linux64_569e52e/std/eval/_std/EReg.hx b/build/linux64_569e52e/std/eval/_std/EReg.hx new file mode 100644 index 0000000..9175206 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/EReg.hx @@ -0,0 +1,37 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +// We need this class so that calls to the empty standard implementations +// don't get optimized away. +@:coreApi +extern class EReg { + function new(r:String, opt:String):Void; + function match(s:String):Bool; + function matched(n:Int):String; + function matchedLeft():String; + function matchedRight():String; + function matchedPos():{pos:Int, len:Int}; + function matchSub(s:String, pos:Int, len:Int = -1):Bool; + function split(s:String):Array; + function replace(s:String, by:String):String; + function map(s:String, f:EReg->String):String; + static function escape(s:String):String; +} diff --git a/build/linux64_569e52e/std/eval/_std/StringBuf.hx b/build/linux64_569e52e/std/eval/_std/StringBuf.hx new file mode 100644 index 0000000..4d4fdf2 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/StringBuf.hx @@ -0,0 +1,31 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +@:coreApi +extern class StringBuf { + var length(get, never):Int; + function new():Void; + private function get_length():Int; + function add(x:T):Void; + function addChar(c:Int):Void; + function addSub(s:String, pos:Int, ?len:Int):Void; + function toString():String; +} diff --git a/build/linux64_569e52e/std/eval/_std/Sys.hx b/build/linux64_569e52e/std/eval/_std/Sys.hx new file mode 100644 index 0000000..28e2075 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/Sys.hx @@ -0,0 +1,96 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +import haxe.SysTools; + +@:require(sys) +@:coreApi +class Sys { + extern static public function print(v:Dynamic):Void; + + extern static public function println(v:Dynamic):Void; + + extern static public function args():Array; + + extern static public function getEnv(s:String):String; + + extern static public function putEnv(s:String, v:Null):Void; + + extern static public function environment():Map; + + extern static public function sleep(seconds:Float):Void; + + extern static public function setTimeLocale(loc:String):Bool; + + extern static public function getCwd():String; + + extern static public function setCwd(s:String):Void; + + extern static public function systemName():String; + + extern static function _command(cmd:String):Int; + + static public function command(cmd:String, ?args:Array):Int { + if (args == null) { + return _command(cmd); + } else { + switch (systemName()) { + case "Windows": + cmd = [ + for (a in [StringTools.replace(cmd, "/", "\\")].concat(args)) + SysTools.quoteWinArg(a, true) + ].join(" "); + return _command(cmd); + case _: + cmd = [cmd].concat(args).map(SysTools.quoteUnixArg).join(" "); + return _command(cmd); + } + } + } + + static public function executablePath():String { + return programPath(); + } + + extern static public function exit(code:Int):Void; + + extern static public function time():Float; + + extern static public function cpuTime():Float; + + extern static public function programPath():String; + + extern static public function getChar(echo:Bool):Int; + + extern static public function stdin():haxe.io.Input; + + extern static public function stdout():haxe.io.Output; + + extern static public function stderr():haxe.io.Output; + + static function __init__():Void { + // This nonsense causes the classes to be loaded. Otherwise they might not make + // it into the interpreter, and then stderr() et. al. don't work. + var _ = (null : sys.io.FileOutput); + var _ = (null : sys.io.FileInput); + } +} diff --git a/build/linux64_569e52e/std/eval/_std/haxe/Exception.hx b/build/linux64_569e52e/std/eval/_std/haxe/Exception.hx new file mode 100644 index 0000000..48467a0 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/haxe/Exception.hx @@ -0,0 +1,98 @@ +package haxe; + +@:coreApi +class Exception { + public var message(get,never):String; + public var stack(get,never):CallStack; + public var previous(get,never):Null; + public var native(get,never):Any; + + @:noCompletion var __exceptionMessage:String; + @:noCompletion var __exceptionStack:Null; + @:noCompletion var __nativeStack:CallStack; + @:noCompletion @:ifFeature("haxe.Exception.get_stack") var __skipStack:Int = 0; + @:noCompletion var __nativeException:Any; + @:noCompletion var __previousException:Null; + + static function caught(value:Any):Exception { + if(Std.isOfType(value, Exception)) { + return value; + } else { + var e = new ValueException(value, null, value); + // Undo automatic __shiftStack() + e.__unshiftStack(); + return e; + } + } + + static function thrown(value:Any):Any { + if(Std.isOfType(value, Exception)) { + return (value:Exception).native; + } else { + var e = new ValueException(value); + e.__shiftStack(); + return e; + } + } + + public function new(message:String, ?previous:Exception, ?native:Any) { + __exceptionMessage = message; + __previousException = previous; + if(native != null) { + __nativeStack = NativeStackTrace.exceptionStack(); + __nativeException = native; + } else { + __nativeStack = NativeStackTrace.callStack(); + __nativeException = this; + } + } + + function unwrap():Any { + return __nativeException; + } + + @:ifFeature("haxe.Exception.thrown") + public function toString():String { + return message; + } + + public function details():String { + return inline CallStack.exceptionToString(this); + } + + @:noCompletion + @:ifFeature("haxe.Exception.get_stack") + inline function __shiftStack():Void { + __skipStack++; + } + + @:noCompletion + @:ifFeature("haxe.Exception.get_stack") + inline function __unshiftStack():Void { + __skipStack--; + } + + function get_message():String { + return __exceptionMessage; + } + + function get_previous():Null { + return __previousException; + } + + final function get_native():Any { + return __nativeException; + } + + function get_stack():CallStack { + return switch __exceptionStack { + case null: + __exceptionStack = if(__skipStack > 0) { + __nativeStack.asArray().slice(__skipStack); + } else { + __nativeStack; + } + case s: s; + } + } +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/_std/haxe/NativeStackTrace.hx b/build/linux64_569e52e/std/eval/_std/haxe/NativeStackTrace.hx new file mode 100644 index 0000000..0443d90 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/haxe/NativeStackTrace.hx @@ -0,0 +1,32 @@ +package haxe; + +import haxe.CallStack.StackItem; + +/** + Do not use manually. +**/ +@:dox(hide) +@:noCompletion +class NativeStackTrace { + @:ifFeature('haxe.NativeStackTrace.exceptionStack') + static public inline function saveStack(exception:Any):Void { + } + + static public function callStack():Array { + return _callStack(); + } + + //implemented in the compiler + static function _callStack():Array { + return null; + } + + //implemented in the compiler + static public function exceptionStack():Array { + return null; + } + + static public inline function toHaxe(stack:Array, skip:Int = 0):Array { + return skip > 0 ? stack.slice(skip) : stack; + } +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/_std/haxe/Resource.hx b/build/linux64_569e52e/std/eval/_std/haxe/Resource.hx new file mode 100644 index 0000000..101ed64 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/haxe/Resource.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +@:coreApi +extern class Resource { + static function listNames():Array; + static function getString(name:String):String; + static function getBytes(name:String):haxe.io.Bytes; +} diff --git a/build/linux64_569e52e/std/eval/_std/haxe/Utf8.hx b/build/linux64_569e52e/std/eval/_std/haxe/Utf8.hx new file mode 100644 index 0000000..023138e --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/haxe/Utf8.hx @@ -0,0 +1,39 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +@:coreApi +@:deprecated('haxe.Utf8 is deprecated. Use UnicodeString instead.') +extern class Utf8 { + function new(?size:Int):Void; + function addChar(c:Int):Void; + function toString():String; + static function iter(s:String, chars:Int->Void):Void; + static function encode(s:String):String; + static function decode(s:String):String; + static function charCodeAt(s:String, index:Int):Int; + static function validate(s:String):Bool; + static function length(s:String):Int; + static function compare(a:String, b:String):Int; + static function sub(s:String, pos:Int, len:Int):String; +} diff --git a/build/linux64_569e52e/std/eval/_std/haxe/io/Bytes.hx b/build/linux64_569e52e/std/eval/_std/haxe/io/Bytes.hx new file mode 100644 index 0000000..03758d8 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/haxe/io/Bytes.hx @@ -0,0 +1,58 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +// @:coreApi +extern class Bytes { + function new(length:Int, b:BytesData):Void; + var length(default, null):Int; + function get(pos:Int):Int; + function set(pos:Int, v:Int):Void; + function blit(pos:Int, src:Bytes, srcpos:Int, len:Int):Void; + function fill(pos:Int, len:Int, value:Int):Void; + function sub(pos:Int, len:Int):Bytes; + function compare(other:Bytes):Int; + function getDouble(pos:Int):Float; + function getFloat(pos:Int):Float; + function setDouble(pos:Int, v:Float):Void; + function setFloat(pos:Int, v:Float):Void; + function getUInt16(pos:Int):Int; + function setUInt16(pos:Int, v:Int):Void; + function getInt32(pos:Int):Int; + function getInt64(pos:Int):haxe.Int64; + function setInt32(pos:Int, v:Int):Void; + function setInt64(pos:Int, v:haxe.Int64):Void; + function getString(pos:Int, len:Int, ?encoding:Encoding):String; + function toString():String; + function toHex():String; + function getData():BytesData; + static function alloc(length:Int):Bytes; + @:pure + static function ofString(s:String, ?encoding:Encoding):Bytes; + static function ofData(b:BytesData):Bytes; + static function ofHex(s:String):Bytes; + static function fastGet(b:BytesData, pos:Int):Int; + static function __init__():Void { + haxe.io.Error; + } +} diff --git a/build/linux64_569e52e/std/eval/_std/haxe/io/BytesBuffer.hx b/build/linux64_569e52e/std/eval/_std/haxe/io/BytesBuffer.hx new file mode 100644 index 0000000..b70b5e6 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/haxe/io/BytesBuffer.hx @@ -0,0 +1,39 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +@:coreApi +extern class BytesBuffer { + var length(get, never):Int; + function new():Void; + private function get_length():Int; + function addByte(byte:Int):Void; + function add(src:Bytes):Void; + function addString(v:String, ?encoding:Encoding):Void; + function addInt32(v:Int):Void; + function addInt64(v:haxe.Int64):Void; + function addFloat(v:Float):Void; + function addDouble(v:Float):Void; + function addBytes(src:Bytes, pos:Int, len:Int):Void; + function getBytes():Bytes; +} diff --git a/build/linux64_569e52e/std/eval/_std/haxe/io/BytesData.hx b/build/linux64_569e52e/std/eval/_std/haxe/io/BytesData.hx new file mode 100644 index 0000000..3bce238 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/haxe/io/BytesData.hx @@ -0,0 +1,34 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +@:forward +private abstract NativeBytesDataAbstract(Bytes) from Bytes to Bytes { + @:arrayAccess public inline function get(i:Int) + return this.get(i); + + @:arrayAccess public inline function set(i:Int, v:Dynamic) + this.set(i, v); +} + +typedef BytesData = NativeBytesDataAbstract; diff --git a/build/linux64_569e52e/std/eval/_std/haxe/zip/Compress.hx b/build/linux64_569e52e/std/eval/_std/haxe/zip/Compress.hx new file mode 100644 index 0000000..43a8225 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/haxe/zip/Compress.hx @@ -0,0 +1,31 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.zip; + +extern class Compress { + function new(level:Int):Void; + function execute(src:haxe.io.Bytes, srcPos:Int, dst:haxe.io.Bytes, dstPos:Int):{done:Bool, read:Int, write:Int}; + function setFlushMode(f:FlushMode):Void; + function close():Void; + static function run(s:haxe.io.Bytes, level:Int):haxe.io.Bytes; +} diff --git a/build/linux64_569e52e/std/eval/_std/haxe/zip/Uncompress.hx b/build/linux64_569e52e/std/eval/_std/haxe/zip/Uncompress.hx new file mode 100644 index 0000000..7bb31af --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/haxe/zip/Uncompress.hx @@ -0,0 +1,31 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.zip; + +extern class Uncompress { + function new(?windowBits:Int):Void; + function execute(src:haxe.io.Bytes, srcPos:Int, dst:haxe.io.Bytes, dstPos:Int):{done:Bool, read:Int, write:Int}; + function setFlushMode(f:FlushMode):Void; + function close():Void; + static function run(src:haxe.io.Bytes, ?bufsize:Int):haxe.io.Bytes; +} diff --git a/build/linux64_569e52e/std/eval/_std/mbedtls/Config.hx b/build/linux64_569e52e/std/eval/_std/mbedtls/Config.hx new file mode 100644 index 0000000..132a7f0 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/mbedtls/Config.hx @@ -0,0 +1,10 @@ +package mbedtls; + +extern class Config { + function new():Void; + + function authmode(authmode:SslAuthmode):Void; + function ca_chain(ca_chain:X509Crt):Void; + function defaults(endpoint:SslEndpoint, transport:SslTransport, preset:SslPreset):Int; + function rng(p_rng:T):Void; +} diff --git a/build/linux64_569e52e/std/eval/_std/mbedtls/CtrDrbg.hx b/build/linux64_569e52e/std/eval/_std/mbedtls/CtrDrbg.hx new file mode 100644 index 0000000..42a67bb --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/mbedtls/CtrDrbg.hx @@ -0,0 +1,10 @@ +package mbedtls; + +import haxe.io.Bytes; + +extern class CtrDrbg { + function new():Void; + + function random(output:Bytes, output_len:Int):Int; + function seed(entropy:Entropy, ?custom:String):Int; +} diff --git a/build/linux64_569e52e/std/eval/_std/mbedtls/Entropy.hx b/build/linux64_569e52e/std/eval/_std/mbedtls/Entropy.hx new file mode 100644 index 0000000..fb5a09d --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/mbedtls/Entropy.hx @@ -0,0 +1,5 @@ +package mbedtls; + +extern class Entropy { + function new():Void; +} diff --git a/build/linux64_569e52e/std/eval/_std/mbedtls/Error.hx b/build/linux64_569e52e/std/eval/_std/mbedtls/Error.hx new file mode 100644 index 0000000..343fb03 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/mbedtls/Error.hx @@ -0,0 +1,5 @@ +package mbedtls; + +class Error { + extern static public function strerror(code:Int):String; +} diff --git a/build/linux64_569e52e/std/eval/_std/mbedtls/PkContext.hx b/build/linux64_569e52e/std/eval/_std/mbedtls/PkContext.hx new file mode 100644 index 0000000..0c83a4a --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/mbedtls/PkContext.hx @@ -0,0 +1,12 @@ +package mbedtls; + +import haxe.io.Bytes; + +extern class PkContext { + function new():Void; + + function parse_key(key:Bytes, ?pwd:String):Int; + function parse_keyfile(path:String, ?password:String):Int; + function parse_public_key(key:Bytes):Int; + function parse_public_keyfile(path:String):Int; +} diff --git a/build/linux64_569e52e/std/eval/_std/mbedtls/Ssl.hx b/build/linux64_569e52e/std/eval/_std/mbedtls/Ssl.hx new file mode 100644 index 0000000..42fc684 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/mbedtls/Ssl.hx @@ -0,0 +1,15 @@ +package mbedtls; + +import mbedtls.X509Crt; +import haxe.io.Bytes; + +extern class Ssl { + function new():Void; + + function get_peer_cert():Null; + function handshake():Int; + function read(buf:Bytes, pos:Int, len:Int):Int; + function set_hostname(hostname:String):Int; + function setup(conf:Config):Int; + function write(buf:Bytes, pos:Int, len:Int):Int; +} diff --git a/build/linux64_569e52e/std/eval/_std/mbedtls/SslAuthmode.hx b/build/linux64_569e52e/std/eval/_std/mbedtls/SslAuthmode.hx new file mode 100644 index 0000000..f00c012 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/mbedtls/SslAuthmode.hx @@ -0,0 +1,8 @@ +package mbedtls; + +@:native("mbedtls.SslAuthmode") +extern enum abstract SslAuthmode(Int) { + var SSL_VERIFY_NONE; + var SSL_VERIFY_OPTIONAL; + var SSL_VERIFY_REQUIRED; +} diff --git a/build/linux64_569e52e/std/eval/_std/mbedtls/SslEndpoint.hx b/build/linux64_569e52e/std/eval/_std/mbedtls/SslEndpoint.hx new file mode 100644 index 0000000..1b5278a --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/mbedtls/SslEndpoint.hx @@ -0,0 +1,7 @@ +package mbedtls; + +@:native("mbedtls.SslEndpoint") +extern enum abstract SslEndpoint(Int) { + var SSL_IS_CLIENT; + var SSL_IS_SERVER; +} diff --git a/build/linux64_569e52e/std/eval/_std/mbedtls/SslPreset.hx b/build/linux64_569e52e/std/eval/_std/mbedtls/SslPreset.hx new file mode 100644 index 0000000..5316452 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/mbedtls/SslPreset.hx @@ -0,0 +1,7 @@ +package mbedtls; + +@:native("mbedtls.SslPreset") +extern enum abstract SslPreset(Int) { + var SSL_PRESET_DEFAULT; + var SSL_PRESET_SUITEB; +} diff --git a/build/linux64_569e52e/std/eval/_std/mbedtls/SslTransport.hx b/build/linux64_569e52e/std/eval/_std/mbedtls/SslTransport.hx new file mode 100644 index 0000000..a0a03c7 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/mbedtls/SslTransport.hx @@ -0,0 +1,7 @@ +package mbedtls; + +@:native("mbedtls.SslTransport") +extern enum abstract SslTransport(Int) { + var SSL_TRANSPORT_STREAM; + var SSL_TRANSPORT_DATAGRAM; +} diff --git a/build/linux64_569e52e/std/eval/_std/mbedtls/X509Crt.hx b/build/linux64_569e52e/std/eval/_std/mbedtls/X509Crt.hx new file mode 100644 index 0000000..04b64a3 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/mbedtls/X509Crt.hx @@ -0,0 +1,12 @@ +package mbedtls; + +import haxe.io.Bytes; + +extern class X509Crt { + function new():Void; + + function next():Null; + function parse(buf:Bytes):Int; + function parse_file(path:String):Int; + function parse_path(path:String):Int; +} diff --git a/build/linux64_569e52e/std/eval/_std/sys/FileSystem.hx b/build/linux64_569e52e/std/eval/_std/sys/FileSystem.hx new file mode 100644 index 0000000..ed3b4e1 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/sys/FileSystem.hx @@ -0,0 +1,52 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys; + +// This class is here so it re-shadows other FileSystem classes in macros, +// e.g. from hxnodejs. +@:coreApi +class FileSystem { + extern static public function exists(path:String):Bool; + + extern static public function rename(path:String, newPath:String):Void; + + extern static public function stat(path:String):FileStat; + + extern static public function fullPath(relPath:String):String; + + static public function absolutePath(relPath:String):String { + if (haxe.io.Path.isAbsolute(relPath)) + return relPath; + return haxe.io.Path.join([Sys.getCwd(), relPath]); + } + + extern static public function isDirectory(path:String):Bool; + + extern static public function createDirectory(path:String):Void; + + extern static public function deleteFile(path:String):Void; + + extern static public function deleteDirectory(path:String):Void; + + extern static public function readDirectory(path:String):Array; +} diff --git a/build/linux64_569e52e/std/eval/_std/sys/io/File.hx b/build/linux64_569e52e/std/eval/_std/sys/io/File.hx new file mode 100644 index 0000000..d3570b5 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/sys/io/File.hx @@ -0,0 +1,50 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.io; + +@:coreApi +class File { + extern static public function getContent(path:String):String; + + extern static public function saveContent(path:String, content:String):Void; + + extern static public function getBytes(path:String):haxe.io.Bytes; + + extern static public function saveBytes(path:String, bytes:haxe.io.Bytes):Void; + + extern static public function read(path:String, binary:Bool = true):FileInput; + + extern static public function write(path:String, binary:Bool = true):FileOutput; + + extern static public function append(path:String, binary:Bool = true):FileOutput; + + extern static public function update(path:String, binary:Bool = true):FileOutput; + + static public function copy(srcPath:String, dstPath:String):Void { + var s = read(srcPath, true); + var d = write(dstPath, true); + d.writeInput(s); + s.close(); + d.close(); + } +} diff --git a/build/linux64_569e52e/std/eval/_std/sys/io/FileInput.hx b/build/linux64_569e52e/std/eval/_std/sys/io/FileInput.hx new file mode 100644 index 0000000..1df7f0a --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/sys/io/FileInput.hx @@ -0,0 +1,39 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.io; + +// This class is not extern because externs overriding non-externs messes with DCE +@:coreApi +class FileInput extends haxe.io.Input { + extern public override function close():Void; + + extern public function eof():Bool; + + extern public function seek(p:Int, pos:FileSeek):Void; + + extern public function tell():Int; + + extern public override function readByte():Int; + + extern public override function readBytes(bytes:haxe.io.Bytes, pos:Int, len:Int):Int; +} diff --git a/build/linux64_569e52e/std/eval/_std/sys/io/FileOutput.hx b/build/linux64_569e52e/std/eval/_std/sys/io/FileOutput.hx new file mode 100644 index 0000000..4e97055 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/sys/io/FileOutput.hx @@ -0,0 +1,39 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.io; + +// This class is not extern because externs overriding non-externs messes with DCE +@:coreApi +class FileOutput extends haxe.io.Output { + extern public override function close():Void; + + extern public override function flush():Void; + + extern public function seek(p:Int, pos:FileSeek):Void; + + extern public function tell():Int; + + extern public override function writeByte(c:Int):Void; + + extern public override function writeBytes(bytes:haxe.io.Bytes, pos:Int, len:Int):Int; +} diff --git a/build/linux64_569e52e/std/eval/_std/sys/io/Process.hx b/build/linux64_569e52e/std/eval/_std/sys/io/Process.hx new file mode 100644 index 0000000..255411d --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/sys/io/Process.hx @@ -0,0 +1,133 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.io; + +private extern class NativeProcess { + function new(cmd:String, ?args:Array):Void; + + function close():Void; + function exitCode():Int; + function getPid():Int; + function kill():Void; + + function readStderr(bytes:haxe.io.Bytes, pos:Int, len:Int):Int; + function readStdout(bytes:haxe.io.Bytes, pos:Int, len:Int):Int; + + function closeStdin():Void; + function writeStdin(bytes:haxe.io.Bytes, pos:Int, len:Int):Int; +} + +private class Stdin extends haxe.io.Output { + var proc:NativeProcess; + var buf:haxe.io.Bytes; + + public function new(proc:NativeProcess) { + this.proc = proc; + buf = haxe.io.Bytes.alloc(1); + } + + public override function close() { + super.close(); + proc.closeStdin(); + } + + public override function writeByte(c:Int) { + buf.set(0, c); + writeBytes(buf, 0, 1); + } + + public override function writeBytes(buf:haxe.io.Bytes, pos:Int, len:Int) { + try { + return proc.writeStdin(buf, pos, len); + } catch (e:Dynamic) { + throw new haxe.io.Eof(); + } + } +} + +private class Stdout extends haxe.io.Input { + var proc:NativeProcess; + var out:Bool; + var buf:haxe.io.Bytes; + + public function new(proc:NativeProcess, out:Bool) { + this.proc = proc; + this.out = out; + buf = haxe.io.Bytes.alloc(1); + } + + public override function readByte() { + if (readBytes(buf, 0, 1) == 0) + throw haxe.io.Error.Blocked; + return buf.get(0); + } + + public override function readBytes(bytes:haxe.io.Bytes, pos:Int, len:Int):Int { + try { + if (out) { + return proc.readStdout(bytes, pos, len); + } else { + return proc.readStderr(bytes, pos, len); + } + } catch (e:Dynamic) { + throw new haxe.io.Eof(); + } + } +} + +@:coreApi +class Process { + public var stdout(default, null):haxe.io.Input; + public var stderr(default, null):haxe.io.Input; + public var stdin(default, null):haxe.io.Output; + + var proc:NativeProcess; + + public function new(cmd:String, ?args:Array, ?detached:Bool):Void { + if (detached) { + throw "Detached process is not supported on this platform"; + } + proc = new NativeProcess(cmd, args); + stdout = new Stdout(proc, true); + stderr = new Stdout(proc, false); + stdin = new Stdin(proc); + } + + public inline function getPid():Int { + return proc.getPid(); + } + + public function exitCode(block:Bool = true):Null { + if (block == false) + throw "Non blocking exitCode() not supported on this platform"; + return proc.exitCode(); + } + + public inline function close():Void { + proc.close(); + } + + public inline function kill():Void { + proc.kill(); + } +} diff --git a/build/linux64_569e52e/std/eval/_std/sys/net/Host.hx b/build/linux64_569e52e/std/eval/_std/sys/net/Host.hx new file mode 100644 index 0000000..cbc1adc --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/sys/net/Host.hx @@ -0,0 +1,53 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.net; + +class Host { + public var host(default, null):String; + public var ip(default, null):Int; + + public function new(name:String) { + host = name; + init(resolve(name)); + } + + public function toString() { + return hostToString(ip); + } + + public function reverse() { + return hostReverse(ip); + } + + function init(ip:Int) { + this.ip = ip; + } + + extern static public function localhost():String; + + extern static function hostReverse(ip:Int):String; + + extern static function hostToString(ip:Int):String; + + extern static function resolve(name:String):Int; +} diff --git a/build/linux64_569e52e/std/eval/_std/sys/net/Socket.hx b/build/linux64_569e52e/std/eval/_std/sys/net/Socket.hx new file mode 100644 index 0000000..9833a21 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/sys/net/Socket.hx @@ -0,0 +1,191 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.net; + +import haxe.io.Error; +import eval.vm.NativeSocket; + +private class SocketOutput extends haxe.io.Output { + var socket:NativeSocket; + + public function new(socket:NativeSocket) { + this.socket = socket; + } + + public override function writeByte(c:Int) { + try { + socket.sendChar(c); + } catch (e:Dynamic) { + if (e == "Blocking") + throw Blocked; + else if (e == "EOF") + throw new haxe.io.Eof(); + else + throw Custom(e); + } + } + + public override function writeBytes(buf:haxe.io.Bytes, pos:Int, len:Int) { + return try { + socket.send(buf, pos, len); + } catch (e:Dynamic) { + if (e == "Blocking") + throw Blocked; + else + throw Custom(e); + } + } + + public override function close() { + super.close(); + socket.close(); + } +} + +private class SocketInput extends haxe.io.Input { + var socket:NativeSocket; + + public function new(socket:NativeSocket) { + this.socket = socket; + } + + public override function readByte() { + return try { + socket.receiveChar(); + } catch (e:Dynamic) { + if (e == "Blocking") + throw Blocked; + else + throw new haxe.io.Eof(); + } + } + + public override function readBytes(buf:haxe.io.Bytes, pos:Int, len:Int) { + var r; + try { + r = socket.receive(buf, pos, len); + } catch (e:Dynamic) { + if (e == "Blocking") + throw Blocked; + else + throw Custom(e); + } + if (r == 0) + throw new haxe.io.Eof(); + return r; + } + + public override function close() { + super.close(); + socket.close(); + } +} + +@:coreApi +class Socket { + public var input(default, null):haxe.io.Input; + public var output(default, null):haxe.io.Output; + public var custom:Dynamic; + + @:ifFeature("sys.net.Socket.select") var socket:NativeSocket; + + public function new() { + init(new NativeSocket()); + } + + private function init(socket:NativeSocket):Void { + this.socket = socket; + input = new SocketInput(socket); + output = new SocketOutput(socket); + } + + public function close():Void { + socket.close(); + } + + public function read():String { + return input.readAll().toString(); + } + + public function write(content:String):Void { + output.writeString(content); + } + + public function connect(host:Host, port:Int):Void { + socket.connect(host.ip, port); + } + + public function listen(connections:Int):Void { + socket.listen(connections); + } + + public function shutdown(read:Bool, write:Bool):Void { + socket.shutdown(read, write); + } + + public function bind(host:Host, port:Int):Void { + socket.bind(host.ip, port); + } + + public function accept():Socket { + var nativeSocket = socket.accept(); + var socket:Socket = Type.createEmptyInstance(Socket); + socket.init(nativeSocket); + return socket; + } + + @:access(sys.net.Host.init) + public function peer():{host:Host, port:Int} { + var info = socket.peer(); + var host:Host = Type.createEmptyInstance(Host); + host.init(info.ip); + return {host: host, port: info.port}; + } + + @:access(sys.net.Host.init) + public function host():{host:Host, port:Int} { + var info = socket.host(); + var host:Host = Type.createEmptyInstance(Host); + host.init(info.ip); + return {host: host, port: info.port}; + } + + public function setTimeout(timeout:Float):Void { + socket.setTimeout(timeout); + } + + public function waitForRead():Void { + select([this], null, null, -1); + } + + public function setBlocking(b:Bool):Void {} // TODO: Don't know how to implement this... + + public function setFastSend(b:Bool):Void { + socket.setFastSend(b); + } + + public static function select(read:Array, write:Array, others:Array, + ?timeout:Float):{read:Array, write:Array, others:Array} { + return NativeSocket.select(read, write, others, timeout); + } +} diff --git a/build/linux64_569e52e/std/eval/_std/sys/ssl/Certificate.hx b/build/linux64_569e52e/std/eval/_std/sys/ssl/Certificate.hx new file mode 100644 index 0000000..6fc3079 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/sys/ssl/Certificate.hx @@ -0,0 +1,102 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.ssl; + +import haxe.io.Bytes; +import sys.ssl.Mbedtls; +import mbedtls.X509Crt; + +@:coreApi +class Certificate { + var native:X509Crt; + + function new(native:X509Crt) { + this.native = native; + } + + public static function loadFile(file:String):Certificate { + var cert = new X509Crt(); + cert.parse_file(file); + return new Certificate(cert); + } + + public static function loadPath(path:String):Certificate { + var cert = new X509Crt(); + cert.parse_path(path); + return new Certificate(cert); + } + + public static function fromString(str:String):Certificate { + var cert = new X509Crt(); + trace(mbedtls.Error.strerror(cert.parse(Bytes.ofString(str)))); + return new Certificate(cert); + } + + public static function loadDefaults():Certificate { + var cert = new X509Crt(); + Mbedtls.loadDefaultCertificates(cert); + return new Certificate(cert); + } + + public var commonName(get, null):Null; + + public var altNames(get, null):Array; + + public var notBefore(get, null):Date; + + public var notAfter(get, null):Date; + + extern public function subject(field:String):Null; + + extern public function issuer(field:String):Null; + + public function next():Null { + var cert = native.next(); + if (cert == null) { + return null; + } + return new Certificate(cert); + } + + public function add(pem:String):Void { + native.parse(Bytes.ofString(pem)); + } + + public function addDER(der:Bytes):Void { + native.parse(der); + } + + private function get_commonName():Null { + return subject("CN"); + } + + extern private function get_altNames():Array; + + extern private function get_notBefore():Date; + + extern private function get_notAfter():Date; + + private inline function getNative():X509Crt { + return native; + } +} diff --git a/build/linux64_569e52e/std/eval/_std/sys/ssl/Key.hx b/build/linux64_569e52e/std/eval/_std/sys/ssl/Key.hx new file mode 100644 index 0000000..67ea51a --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/sys/ssl/Key.hx @@ -0,0 +1,69 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.ssl; + +import haxe.io.Bytes; +import mbedtls.PkContext; + +@:coreApi +class Key { + var native:PkContext; + + function new() { + native = new PkContext(); + } + + static public function loadFile(file:String, ?isPublic:Bool, ?pass:String):Key { + var key = new Key(); + var code = if (isPublic) { + key.native.parse_public_keyfile(file); + } else { + key.native.parse_keyfile(file, pass); + } + if (code != 0) { + throw(mbedtls.Error.strerror(code)); + } + return key; + } + + static function parse(data:Bytes, isPublic:Bool, ?pass:String):Key { + var key = new Key(); + var code = if (isPublic) { + key.native.parse_public_key(data); + } else { + key.native.parse_key(data); + } + if (code != 0) { + throw(mbedtls.Error.strerror(code)); + } + return key; + } + + static public function readPEM(data:String, isPublic:Bool, ?pass:String):Key { + return parse(Bytes.ofString(data), isPublic, pass); + } + + static public function readDER(data:haxe.io.Bytes, isPublic:Bool):Key { + return parse(data, isPublic); + } +} diff --git a/build/linux64_569e52e/std/eval/_std/sys/ssl/Mbedtls.hx b/build/linux64_569e52e/std/eval/_std/sys/ssl/Mbedtls.hx new file mode 100644 index 0000000..e5ef79d --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/sys/ssl/Mbedtls.hx @@ -0,0 +1,66 @@ +package sys.ssl; + +import eval.vm.NativeSocket; +import mbedtls.Ssl; +import mbedtls.Entropy; +import mbedtls.CtrDrbg; +import mbedtls.X509Crt; + +class Mbedtls { + static var entropy:Null; + static var ctr:Null; + + static public function getDefaultEntropy() { + if (entropy == null) { + entropy = new Entropy(); + } + return entropy; + } + + static public function getDefaultCtrDrbg() { + if (ctr == null) { + ctr = new CtrDrbg(); + ctr.seed(getDefaultEntropy()); + } + return ctr; + } + + static public function loadDefaultCertificates(certificate:X509Crt) { + if (loadDefaults(certificate) == 0) { + return; + } + var defPaths = switch (Sys.systemName()) { + case "Linux": + [ + "/etc/ssl/certs/ca-certificates.crt", // Debian/Ubuntu/Gentoo etc. + "/etc/pki/tls/certs/ca-bundle.crt", // Fedora/RHEL + "/etc/ssl/ca-bundle.pem", // OpenSUSE + "/etc/pki/tls/cacert.pem", // OpenELEC + "/etc/ssl/certs", // SLES10/SLES11 + "/system/etc/security/cacerts" // Android + ]; + case "BSD": + [ + "/usr/local/share/certs/ca-root-nss.crt", // FreeBSD/DragonFly + "/etc/ssl/cert.pem", // OpenBSD + "/etc/openssl/certs/ca-certificates.crt", // NetBSD + ]; + case "Android": + ["/system/etc/security/cacerts"]; + default: + []; + } + for (path in defPaths) { + if (sys.FileSystem.exists(path)) { + if (sys.FileSystem.isDirectory(path)) + certificate.parse_path(path); + else + certificate.parse_file(path); + } + } + } + + extern static public function setSocket(ssl:Ssl, socket:NativeSocket):Int; + + extern static function loadDefaults(certificate:X509Crt):Int; +} diff --git a/build/linux64_569e52e/std/eval/_std/sys/ssl/Socket.hx b/build/linux64_569e52e/std/eval/_std/sys/ssl/Socket.hx new file mode 100644 index 0000000..96a3c7d --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/sys/ssl/Socket.hx @@ -0,0 +1,206 @@ +package sys.ssl; + +import haxe.io.Bytes; +import eval.vm.NativeSocket; +import mbedtls.Config; +import mbedtls.Ssl; + +private class SocketInput extends haxe.io.Input { + @:allow(sys.ssl.Socket) private var socket:Socket; + var readBuf:Bytes; + + public function new(s:Socket) { + this.socket = s; + readBuf = Bytes.alloc(1); + } + + public override function readByte() { + socket.handshake(); + var r = @:privateAccess socket.ssl.read(readBuf, 0, 1); + if (r == -1) + throw haxe.io.Error.Blocked; + else if (r < 0) + throw new haxe.io.Eof(); + return readBuf.get(0); + } + + public override function readBytes(buf:haxe.io.Bytes, pos:Int, len:Int):Int { + if (pos < 0 || len < 0 || ((pos + len) : UInt) > (buf.length : UInt)) + throw haxe.io.Error.OutsideBounds; + socket.handshake(); + var r = @:privateAccess socket.ssl.read(buf, pos, len); + if (r == -1) + throw haxe.io.Error.Blocked; + else if (r <= 0) + throw new haxe.io.Eof(); + return r; + } + + public override function close() { + super.close(); + if (socket != null) + socket.close(); + } +} + +private class SocketOutput extends haxe.io.Output { + @:allow(sys.ssl.Socket) private var socket:Socket; + var writeBuf:Bytes; + + public function new(s:Socket) { + this.socket = s; + writeBuf = Bytes.alloc(1); + } + + public override function writeByte(c:Int) { + socket.handshake(); + writeBuf.set(0, c); + var r = @:privateAccess socket.ssl.write(writeBuf, 0, 1); + if (r == -1) + throw haxe.io.Error.Blocked; + else if (r < 0) + throw new haxe.io.Eof(); + } + + public override function writeBytes(buf:haxe.io.Bytes, pos:Int, len:Int):Int { + if (pos < 0 || len < 0 || ((pos + len) : UInt) > (buf.length : UInt)) + throw haxe.io.Error.OutsideBounds; + socket.handshake(); + var r = @:privateAccess socket.ssl.write(buf, pos, len); + if (r == -1) + throw haxe.io.Error.Blocked; + else if (r < 0) + throw new haxe.io.Eof(); + return r; + } + + public override function close() { + super.close(); + if (socket != null) + socket.close(); + } +} + +@:coreApi +class Socket extends sys.net.Socket { + public static var DEFAULT_VERIFY_CERT:Null = true; + + public static var DEFAULT_CA:Null; + + private var conf:Config; + private var ssl:Ssl; + + public var verifyCert:Null; + + private var caCert:Null; + private var hostname:String; + + private var handshakeDone:Bool; + private var isBlocking:Bool = true; + + override function init(socket:NativeSocket):Void { + this.socket = socket; + input = new SocketInput(this); + output = new SocketOutput(this); + if (DEFAULT_VERIFY_CERT && DEFAULT_CA == null) { + DEFAULT_CA = Certificate.loadDefaults(); + } + verifyCert = DEFAULT_VERIFY_CERT; + caCert = DEFAULT_CA; + } + + public override function connect(host:sys.net.Host, port:Int):Void { + conf = buildConfig(false); + ssl = new Ssl(); + ssl.setup(conf); + Mbedtls.setSocket(ssl, socket); + handshakeDone = false; + if (hostname == null) + hostname = host.host; + if (hostname != null) + ssl.set_hostname(hostname); + socket.connect(host.ip, port); + if (isBlocking) + handshake(); + } + + public function handshake():Void { + if (!handshakeDone) { + var r = ssl.handshake(); + if (r == 0) + handshakeDone = true; + else if (r == -1) + throw haxe.io.Error.Blocked; + else + throw mbedtls.Error.strerror(r); + } + } + + override function setBlocking(b:Bool):Void { + super.setBlocking(b); + isBlocking = b; + } + + public function setCA(cert:Certificate):Void { + caCert = cert; + } + + public function setHostname(name:String):Void { + hostname = name; + } + + public override function close():Void { + super.close(); + var input:SocketInput = cast input; + var output:SocketOutput = cast output; + @:privateAccess input.socket = output.socket = null; + input.close(); + output.close(); + } + + public override function bind(host:sys.net.Host, port:Int):Void { + conf = buildConfig(true); + + socket.bind(host.ip, port); + } + + public override function accept():Socket { + var c = socket.accept(); + var cssl = new Ssl(); + cssl.setup(conf); + Mbedtls.setSocket(cssl, c); + + var s = Type.createEmptyInstance(sys.ssl.Socket); + s.socket = c; + s.ssl = cssl; + s.input = new SocketInput(s); + s.output = new SocketOutput(s); + s.handshakeDone = false; + + return s; + } + + public function addSNICertificate(cbServernameMatch:String->Bool, cert:Certificate, key:Key):Void { + throw new haxe.exceptions.NotImplementedException(); + } + + public function peerCertificate():Certificate { + return @:privateAccess new Certificate(ssl.get_peer_cert()); + } + + public function setCertificate(cert:Certificate, key:Key):Void { + throw new haxe.exceptions.NotImplementedException(); + } + + private function buildConfig(server:Bool):Config { + var conf = new Config(); + conf.defaults(server ? SSL_IS_SERVER : SSL_IS_CLIENT, SSL_TRANSPORT_STREAM, SSL_PRESET_DEFAULT); + conf.rng(Mbedtls.getDefaultCtrDrbg()); + + if (caCert != null) { + conf.ca_chain(@:privateAccess caCert.getNative()); + } + conf.authmode(if (verifyCert) SSL_VERIFY_REQUIRED else if (verifyCert == null) SSL_VERIFY_OPTIONAL else SSL_VERIFY_NONE); + return conf; + } +} diff --git a/build/linux64_569e52e/std/eval/_std/sys/thread/Condition.hx b/build/linux64_569e52e/std/eval/_std/sys/thread/Condition.hx new file mode 100644 index 0000000..15b6b18 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/sys/thread/Condition.hx @@ -0,0 +1,41 @@ +package sys.thread; + +@:coreApi class Condition { + final cond:eval.luv.Condition; + final mutex:eval.luv.Mutex; + + public function new():Void { + cond = eval.luv.Condition.init().resolve(); + mutex = eval.luv.Mutex.init(true).resolve(); + eval.vm.Gc.finalise(destroy, this); + } + + static function destroy(cond:Condition):Void { + cond.cond.destroy(); + cond.mutex.destroy(); + } + + public function acquire():Void { + mutex.lock(); + } + + public function tryAcquire():Bool { + return mutex.tryLock().isOk(); + } + + public function release():Void { + mutex.unlock(); + } + + public function wait():Void { + cond.wait(mutex); + } + + public function signal():Void { + cond.signal(); + } + + public function broadcast():Void { + cond.broadcast(); + } +} diff --git a/build/linux64_569e52e/std/eval/_std/sys/thread/EventLoop.hx b/build/linux64_569e52e/std/eval/_std/sys/thread/EventLoop.hx new file mode 100644 index 0000000..5b25958 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/sys/thread/EventLoop.hx @@ -0,0 +1,203 @@ +package sys.thread; + +import eval.luv.Loop; +import eval.luv.Async; +import eval.luv.Timer as LuvTimer; +import haxe.MainLoop; + +/** + When an event loop has an available event to execute. +**/ +@:coreApi +enum NextEventTime { + /** There's already an event waiting to be executed */ + Now; + /** No new events are expected. */ + Never; + /** + An event is expected to arrive at any time. + If `time` is specified, then the event will be ready at that time for sure. + */ + AnyTime(time:Null); + /** An event is expected to be ready for execution at `time`. */ + At(time:Float); +} + +abstract EventHandler(RegularEvent) from RegularEvent to RegularEvent {} + +private class RegularEvent { + public var timer:Null; + public var event:()->Void; + + public function new(e:()->Void) { + event = e; + } + + public function run() { + event(); + } +} + +/** + An event loop implementation used for `sys.thread.Thread` +**/ +@:coreApi +class EventLoop { + @:allow(eval.luv.Loop) + final handle:Loop; + + final mutex = new Mutex(); + final wakeup:Async; + var promisedEventsCount = 0; + var pending:Array<()->Void> = []; + var started:Bool = false; + + var isMainThread:Bool; + static var CREATED : Bool; + + public function new():Void { + isMainThread = !CREATED; + CREATED = true; + handle = Loop.init().resolve(); + wakeup = Async.init(handle, consumePending).resolve(); + wakeup.unref(); + } + + /** + Schedule event for execution every `intervalMs` milliseconds in current loop. + **/ + public function repeat(event:()->Void, intervalMs:Int):EventHandler { + var e = new RegularEvent(event); + mutex.acquire(); + e.timer = LuvTimer.init(handle).resolve(); + e.timer.start(e.run, intervalMs, intervalMs < 1 ? 1 : intervalMs).resolve(); + mutex.release(); + wakeup.send(); + return e; + } + + /** + Prevent execution of a previously scheduled event in current loop. + **/ + public function cancel(eventHandler:EventHandler):Void { + mutex.acquire(); + (eventHandler:RegularEvent).event = noop; + pending.push(() -> { + var timer = (eventHandler:RegularEvent).timer; + timer.stop().resolve(); + timer.close(noop); + }); + mutex.release(); + wakeup.send(); + } + static final noop = function() {} + + /** + Notify this loop about an upcoming event. + This makes the thread stay alive and wait for as many events as the number of + times `.promise()` was called. These events should be added via `.runPromised()`. + **/ + public function promise():Void { + mutex.acquire(); + ++promisedEventsCount; + pending.push(refUnref); + mutex.release(); + wakeup.send(); + } + + /** + Execute `event` as soon as possible. + **/ + public function run(event:()->Void):Void { + mutex.acquire(); + pending.push(event); + mutex.release(); + wakeup.send(); + } + + /** + Add previously promised `event` for execution. + **/ + public function runPromised(event:()->Void):Void { + mutex.acquire(); + --promisedEventsCount; + pending.push(refUnref); + pending.push(event); + mutex.release(); + wakeup.send(); + } + + function refUnref():Void { + if (promisedEventsCount > 0 || (isMainThread && haxe.MainLoop.hasEvents())) { + wakeup.ref(); + } else { + wakeup.unref(); + } + } + + public function progress():NextEventTime { + if (started) throw "Event loop already started"; + + if (handle.run(NOWAIT)) { + return AnyTime(null); + } else { + return Never; + } + } + + /** + Blocks until a new event is added or `timeout` (in seconds) to expires. + + Depending on a target platform this method may also automatically execute arriving + events while waiting. However if any event is executed it will stop waiting. + + Returns `true` if more events are expected. + Returns `false` if no more events expected. + + Depending on a target platform this method may be non-reentrant. It must + not be called from event callbacks. + **/ + public function wait(?timeout:Float):Bool { + if (started) throw "Event loop already started"; + + if(timeout != null) { + var timer = LuvTimer.init(handle).resolve(); + timer.start(() -> { + timer.stop().resolve(); + timer.close(() -> {}); + }, Std.int(timeout * 1000)); + return handle.run(ONCE); + } else { + return handle.run(ONCE); + } + } + + /** + Execute all pending events. + Wait and execute as many events as the number of times `promise()` was called. + Runs until all repeating events are cancelled and no more events are expected. + + Depending on a target platform this method may be non-reentrant. It must + not be called from event callbacks. + **/ + public function loop():Void { + if (started) throw "Event loop already started"; + started = true; + consumePending(); + handle.run(DEFAULT); + } + + function consumePending(?_:Async):Void { + mutex.acquire(); + var p = pending; + pending = []; + mutex.release(); + for(fn in p) fn(); + + if (started && isMainThread) { + var next = @:privateAccess MainLoop.tick(); + if (haxe.MainLoop.hasEvents()) wakeup.send(); + refUnref(); + } + } +} diff --git a/build/linux64_569e52e/std/eval/_std/sys/thread/Semaphore.hx b/build/linux64_569e52e/std/eval/_std/sys/thread/Semaphore.hx new file mode 100644 index 0000000..5c75b47 --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/sys/thread/Semaphore.hx @@ -0,0 +1,36 @@ +package sys.thread; + +@:coreApi class Semaphore { + final native:eval.luv.Semaphore; + + public function new(value:Int):Void { + native = eval.luv.Semaphore.init(value).resolve(); + eval.vm.Gc.finalise(destroy, this); + } + + static function destroy(sem:Semaphore):Void { + sem.native.destroy(); + } + + public function acquire():Void { + native.wait(); + } + + public function tryAcquire(?timeout:Float):Bool { + if (timeout == null) { + return native.tryWait().isOk(); + } else { + var t = Sys.time() + timeout; + while (Sys.time() < t) { + if (native.tryWait().isOk()) { + return true; + } + } + return false; + } + } + + public function release():Void { + native.post(); + } +} diff --git a/build/linux64_569e52e/std/eval/_std/sys/thread/Thread.hx b/build/linux64_569e52e/std/eval/_std/sys/thread/Thread.hx new file mode 100644 index 0000000..eb6eb1d --- /dev/null +++ b/build/linux64_569e52e/std/eval/_std/sys/thread/Thread.hx @@ -0,0 +1,105 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.thread; + +import eval.vm.NativeThread; + +private typedef ThreadImpl = NativeThread; + +abstract Thread(ThreadImpl) from ThreadImpl { + public var events(get,never):EventLoop; + + static function __init__() { + NativeThread.self().events = new EventLoop(); + } + + inline function new(h:NativeThread):Void { + this = h; + } + + public inline function sendMessage(msg:Dynamic):Void { + this.sendMessage(msg); + } + + public static inline function current():Thread { + return new Thread(NativeThread.self()); + } + + public static inline function create(job:()->Void):Thread { + return new Thread(new NativeThread(job)); + } + + public static function runWithEventLoop(job:()->Void):Void { + var thread = NativeThread.self(); + if(thread.events == null) { + thread.events = new EventLoop(); + try { + job(); + thread.events.loop(); + thread.events = null; + } catch(e) { + thread.events = null; + throw e; + } + } else { + job(); + } + } + + public static inline function createWithEventLoop(job:()->Void):Thread { + return new Thread(new NativeThread(() -> { + var thread = NativeThread.self(); + thread.events = new EventLoop(); + job(); + thread.events.loop(); + })); + } + + public static inline function readMessage(block:Bool):Dynamic { + return NativeThread.readMessage(block); + } + + public static inline function yield():Void { + NativeThread.yield(); + } + + @:op(A == B) + public inline function equals(other:Thread):Bool { + return getHandle().id() == other.getHandle().id(); + } + + inline function getHandle():NativeThread { + return this; + } + + function get_events():EventLoop { + if(this.events == null) + throw new NoEventLoopException(); + return this.events; + } + + @:keep + static function processEvents():Void { + NativeThread.self().events.loop(); + } +} diff --git a/build/linux64_569e52e/std/eval/integers/Int64.hx b/build/linux64_569e52e/std/eval/integers/Int64.hx new file mode 100644 index 0000000..28807c9 --- /dev/null +++ b/build/linux64_569e52e/std/eval/integers/Int64.hx @@ -0,0 +1,117 @@ +package eval.integers; + +/** + Signed 64-bit integer type and operations. +**/ +@:coreType abstract Int64 { + /** The greatest representable Int64 value. */ + extern static public final MAX:Int64; + /** The smallest representable Int64 value. */ + extern static public final MIN:Int64; + /** The integer `0` */ + extern static public final ZERO:Int64; + /** The integer `1` */ + extern static public final ONE:Int64; + + /** + Convert the given int value to Int64. + **/ + static public function ofInt(i:Int):Int64; + + /** + Parse the given string value to Int64. + Throws if the given string is not a valid representation of Int64. + **/ + static public function ofString(s:String):Int64; + + /** + Convert `haxe.Int64` to `eval.integers.Int64` + **/ + @:from static public function ofHxInt64(hx:haxe.Int64):Int64; + + /** + Returns the greater of `a` and `b`. + **/ + static public function max(a:Int64, b:Int64):Int64; + + /** + Returns the lesser of `a` and `b`. + **/ + static public function min(a:Int64, b:Int64):Int64; + + /** + Compare given values. + Returns `0` if the values are equal. + Returns negative integer if `a` is lesser than `b`. + Returns positive integer if `a` is greater than `b`. + **/ + static public function compare(a:Int64, b:Int64):Int; + + /** + Convert to an integer value. + The 64-bit signed integer is taken modulo 2{^32}, i.e. the top 32 bits + are lost during the conversion. + **/ + public function toInt():Int; + + /** + Convert to an unsigned integer value. + **/ + public function toUInt64():UInt64; + + /** + Convert to `haxe.Int64`. + **/ + @:to public function toHxInt64():haxe.Int64; + + /** + Return the string representation of this value. + **/ + public function toString():String; + + /** + Successor. + **/ + public function successor():String; + + /** + Predecessor. + **/ + public function predecessor():String; + + /** + Integer remainder. + Throws if the divisor is zero. + **/ + public function remainder(u:Int64):Int64; + + function add(u:Int64):Int64; + function sub(u:Int64):Int64; + function mul(u:Int64):Int64; + function div(u:Int64):Int64; + function logand(u:Int64):Int64; + function logor(u:Int64):Int64; + function logxor(u:Int64):Int64; + function shift_left(i:Int):Int64; + function shift_right(i:Int):Int64; + function lognot():Int64; + + @:op(A + B) inline function _add(u:Int64):Int64 return this.add(u); + @:op(A - B) inline function _sub(u:Int64):Int64 return this.sub(u); + @:op(A * B) inline function _mul(u:Int64):Int64 return this.mul(u); + @:op(A / B) inline function _div(u:Int64):Int64 return this.div(u); + @:op(A % B) inline function _mod(u:Int64):Int64 return this.remainder(u); + @:op(A & B) inline function _logand(u:Int64):Int64 return this.logand(u); + @:op(A | B) inline function _logor(u:Int64):Int64 return this.logor(u); + @:op(A ^ B) inline function _logxor(u:Int64):Int64 return this.logxor(u); + @:op(A << B) inline function _shift_left(i:Int):Int64 return this.shift_left(i); + @:op(A >> B) inline function _shift_right(i:Int):Int64 return this.shift_right(i); + @:op(~A) inline function _lognot():Int64 return this.lognot(); + + @:op(A != B) static inline function eq(a:Int64, b:Int64):Bool return compare(a, b) != 0; + @:op(A == B) static inline function ne(a:Int64, b:Int64):Bool return compare(a, b) == 0; + @:op(A < B) static inline function lt(a:Int64, b:Int64):Bool return compare(a, b) < 0; + @:op(A > B) static inline function gt(a:Int64, b:Int64):Bool return compare(a, b) > 0; + @:op(A <= B) static inline function lte(a:Int64, b:Int64):Bool return compare(a, b) <= 0; + @:op(A >= B) static inline function gte(a:Int64, b:Int64):Bool return compare(a, b) >= 0; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/integers/UInt64.hx b/build/linux64_569e52e/std/eval/integers/UInt64.hx new file mode 100644 index 0000000..082bff7 --- /dev/null +++ b/build/linux64_569e52e/std/eval/integers/UInt64.hx @@ -0,0 +1,106 @@ +package eval.integers; + +/** + Unsigned 64-bit integer type and operations. +**/ +@:coreType abstract UInt64 { + /** The greatest representable UInt64 value. */ + extern static public final MAX:UInt64; + /** The integer `0` */ + extern static public final ZERO:UInt64; + /** The integer `1` */ + extern static public final ONE:UInt64; + + /** + Convert the given int value to an unsigned integer. + **/ + static public function ofInt(i:Int):UInt64; + + /** + Parse the given string value to an unsigned integer. + Throws if the given string is not a valid representation of an unsigned + integer. + **/ + static public function ofString(s:String):UInt64; + + /** + Returns the greater of `a` and `b`. + **/ + static public function max(a:UInt64, b:UInt64):UInt64; + + /** + Returns the lesser of `a` and `b`. + **/ + static public function min(a:UInt64, b:UInt64):UInt64; + + /** + Compare given values. + Returns `0` if the values are equal. + Returns negative integer if `a` is lesser than `b`. + Returns positive integer if `a` is greater than `b`. + **/ + static public function compare(a:UInt64, b:UInt64):Int; + + /** + Convert to an integer value. + The 64-bit unsigned integer is taken modulo 2{^32}, i.e. the top 32 bits + are lost during the conversion. + **/ + public function toInt():Int; + + /** + Convert to a signed integer value. + **/ + public function toInt64():Int64; + + /** + Return the string representation of this value. + **/ + public function toString():String; + + /** + Successor. + **/ + public function successor():String; + + /** + Predecessor. + **/ + public function predecessor():String; + + /** + Integer remainder. + Throws if the divisor is zero. + **/ + public function remainder(u:UInt64):UInt64; + + function add(u:UInt64):UInt64; + function sub(u:UInt64):UInt64; + function mul(u:UInt64):UInt64; + function div(u:UInt64):UInt64; + function logand(u:UInt64):UInt64; + function logor(u:UInt64):UInt64; + function logxor(u:UInt64):UInt64; + function shift_left(i:Int):UInt64; + function shift_right(i:Int):UInt64; + function lognot():UInt64; + + @:op(A + B) inline function _add(u:UInt64):UInt64 return this.add(u); + @:op(A - B) inline function _sub(u:UInt64):UInt64 return this.sub(u); + @:op(A * B) inline function _mul(u:UInt64):UInt64 return this.mul(u); + @:op(A / B) inline function _div(u:UInt64):UInt64 return this.div(u); + @:op(A % B) inline function _mod(u:UInt64):UInt64 return this.remainder(u); + @:op(A & B) inline function _logand(u:UInt64):UInt64 return this.logand(u); + @:op(A | B) inline function _logor(u:UInt64):UInt64 return this.logor(u); + @:op(A ^ B) inline function _logxor(u:UInt64):UInt64 return this.logxor(u); + @:op(A << B) inline function _shift_left(i:Int):UInt64 return this.shift_left(i); + @:op(A >> B) inline function _shift_right(i:Int):UInt64 return this.shift_right(i); + @:op(~A) inline function _lognot():UInt64 return this.lognot(); + + @:op(A != B) static inline function eq(a:UInt64, b:UInt64):Bool return compare(a, b) != 0; + @:op(A == B) static inline function ne(a:UInt64, b:UInt64):Bool return compare(a, b) == 0; + @:op(A < B) static inline function lt(a:UInt64, b:UInt64):Bool return compare(a, b) < 0; + @:op(A > B) static inline function gt(a:UInt64, b:UInt64):Bool return compare(a, b) > 0; + @:op(A <= B) static inline function lte(a:UInt64, b:UInt64):Bool return compare(a, b) <= 0; + @:op(A >= B) static inline function gte(a:UInt64, b:UInt64):Bool return compare(a, b) >= 0; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Async.hx b/build/linux64_569e52e/std/eval/luv/Async.hx new file mode 100644 index 0000000..441a085 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Async.hx @@ -0,0 +1,21 @@ +package eval.luv; + +/** + Inter-loop communication. + + @see https://aantron.github.io/luv/luv/Luv/Async +**/ +@:using(eval.luv.Handle) +@:coreType abstract Async to Handle { + /** + Allocates and initializes an async handle. + + The handle should be cleaned up with `eval.luv.Handle.close` when no longer needed. + **/ + static public function init(loop:Loop, callback:(async:Async)->Void):Result; + + /** + Triggers a call to the handle's callback by the handle's loop. + **/ + public function send():Result; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Barrier.hx b/build/linux64_569e52e/std/eval/luv/Barrier.hx new file mode 100644 index 0000000..1475695 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Barrier.hx @@ -0,0 +1,23 @@ +package eval.luv; + +/** + Barriers. + + @see https://aantron.github.io/luv/luv/Luv/Barrier +**/ +@:coreType abstract Barrier { + /** + Allocates and initializes a barrier. + **/ + static public function init(count:Int):Result; + + /** + Cleans up a barrier. + **/ + public function destroy():Void; + + /** + Waits on a barrier. + **/ + public function wait():Bool; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Buffer.hx b/build/linux64_569e52e/std/eval/luv/Buffer.hx new file mode 100644 index 0000000..a7a7fdf --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Buffer.hx @@ -0,0 +1,120 @@ +package eval.luv; + +import haxe.io.Bytes; + +/** + Data buffers. + + @see https://aantron.github.io/luv/luv/Luv/Buffer +**/ +@:coreType abstract Buffer { + /** + Allocates a fresh buffer of the given size. + **/ + static public function create(size:Int):Buffer; + + /** + Creates a buffer from a string. + **/ + @:from static public function fromNativeString(s:NativeString):Buffer; + + /** + Creates a buffer from a string. + **/ + @:from static public function fromString(s:String):Buffer; + + /** + Creates a buffer from bytes. + **/ + @:from static public function fromBytes(b:Bytes):Buffer; + + /** + Evaluates to the sum of the sizes of the buffers in the array. + **/ + static public function totalSize(buffers:Array):Int; + + /** + `Buffer.drop(buffers, count)` drops the first `count` bytes from `buffers`. + + For example, if `buffers` contains two buffers of size 16, `Buffer.drop(buffers, 18)` + will evaluate to an array that has lost the reference to the first buffer, + and contains only a view into the second buffer of size 14. + **/ + static public function drop(buffers:Array, count:Int):Array; + + /** + Evaluates to the size of the buffer. + **/ + public function size():Int; + + /** + Retrieve a byte at the given index. + **/ + @:arrayAccess public function get(index:Int):Int; + + /** + Retrieve a byte at the given index without a bounds check. + **/ + public function unsafeGet(index:Int):Int; + + /** + Set byte value at the given index. + **/ + @:arrayAccess public function set(index:Int, byte:Int):Int; + + /** + Set byte value at the given index without a bounds check. + **/ + public function unsafeSet(index:Int, byte:Int):Int; + + /** + Creates a view into buffer that starts at the given `offset` and has the given `length`. + + No data is copied. + **/ + public function sub(offset:Int, length:Int):Buffer; + + /** + Copies data from this buffer to destination. + + The amount of data copied is the minimum of the two buffers' size. + **/ + public function blit(destination:Buffer):Void; + + /** + Fills the given buffer with the given byte. + **/ + public function fill(byte:Int):Void; + + /** + Creates a string with the same contents as the buffer. + **/ + public function toString():String; + + /** + Creates a native string with the same contents as the buffer. + **/ + public function toNativeString():NativeString; + + /** + Creates a `haxe.io.Bytes` instance with the same contents as this buffer. + **/ + public function toBytes():Bytes; + + /** + Copies data from a buffer to bytes buffer. + **/ + public function blitToBytes(destination:Bytes, destinationOffset:Int):Void; + + /** + Copies data from bytes to a buffer. + **/ + public function blitFromBytes(source:Bytes, sourceOffset:Int):Void; + + /** + Copies data from bytes to a buffer. + + Note: `sourceOffset` is not a character offset but a byte offset. + **/ + public function blitFromString(source:NativeString, sourceOffset:Int):Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Check.hx b/build/linux64_569e52e/std/eval/luv/Check.hx new file mode 100644 index 0000000..b3bd647 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Check.hx @@ -0,0 +1,26 @@ +package eval.luv; + +/** + Post-I/O callback. + + @see https://aantron.github.io/luv/luv/Luv/Check +**/ +@:using(eval.luv.Handle) +@:coreType abstract Check to Handle { + /** + Allocate and initialize a check handle. + + The handle should be cleaned up with `eval.luv.Handle.close` when no longer needed. + **/ + static public function init(loop:Loop):Result; + + /** + Starts the handle with the given callback. + **/ + public function start(callback:()->Void):Result; + + /** + Stops the handle. + **/ + public function stop():Result; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Condition.hx b/build/linux64_569e52e/std/eval/luv/Condition.hx new file mode 100644 index 0000000..8ce3aea --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Condition.hx @@ -0,0 +1,39 @@ +package eval.luv; + +/** + Condition variables. + + @see https://aantron.github.io/luv/luv/Luv/Condition +**/ +@:coreType abstract Condition { + /** + Allocates and initializes a condition variable. + **/ + static public function init():Result; + + /** + Cleans up a condition variable. + **/ + public function destroy():Void; + + /** + Signals a condition variable. + **/ + public function signal():Void; + + /** + Signals a condition variable, waking all waiters. + **/ + public function broadcast():Void; + + /** + Waits on a condition variable. + **/ + public function wait(mutex:Mutex):Void; + + /** + Waits on a condition variable with a timeout. + The timeout is given in nanoseconds. + **/ + public function timedWait(mutex:Mutex, timeout:Int):Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/ConnectedUdp.hx b/build/linux64_569e52e/std/eval/luv/ConnectedUdp.hx new file mode 100644 index 0000000..5df83a0 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/ConnectedUdp.hx @@ -0,0 +1,34 @@ +package eval.luv; + +import eval.luv.SockAddr; + +/** + Connected UDP sockets. + + @see https://aantron.github.io/luv/luv/Luv/UDP/Connected +**/ +@:forward +@:using(eval.luv.Handle) +abstract ConnectedUdp(Udp) to Udp to Handle { + /** + Removes the peer address assigned to the given socket. + **/ + extern public function disconnect():Result; + + /** + Retrieves the peer address assigned to the given socket. + **/ + extern public function getPeerName():Result; + + /** + Like `eval.luv.UDP.send`, but the remote address used is the peer address + assigned to the socket. + **/ + extern public function send(data:Array, callback:(result:Result)->Void):Void; + + /** + Like `eval.luv.UDP.trySend`, but the remote address used is the peer address + assigned to the socket. + **/ + extern public function trySend(data:Array):Result; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Dir.hx b/build/linux64_569e52e/std/eval/luv/Dir.hx new file mode 100644 index 0000000..4fd3f65 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Dir.hx @@ -0,0 +1,73 @@ +package eval.luv; + +import eval.luv.File; + +enum abstract DirentKind(Int) { + var UNKNOWN = 0; + var FILE = 1; + var DIR = 2; + var LINK = 3; + var FIFO = 4; + var SOCKET = 5; + var CHAR = 6; + var BLOCK = 7; +} + +typedef Dirent = { + var kind:DirentKind; + var name:NativeString; +} + +typedef DirectoryScan = { + /** + Retrieves the next directory entry. + **/ + function next():Null; + + /** + Cleans up after a directory scan. + **/ + function end():Void; +} + +/** + @see https://aantron.github.io/luv/luv/Luv/File#module-Dir +**/ +@:coreType abstract Dir { + /** + Opens the directory at the given path for listing. + **/ + static public function open(loop:Loop, path:NativeString, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Closes the directory. + **/ + public function close(loop:Loop, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Retrieves a directory entry. + **/ + public function read(loop:Loop, ?numberOfEntries:Int, ?request:FileRequest, callback:(result:Result>)->Void):Void; + + /** + Begins directory listing. + **/ + static public function scan(loop:Loop, path:NativeString, ?request:FileRequest, callback:(result:Result)->Void):Void; +} + +/** + Synchronous version of `eval.luv.Dir` API +**/ +extern class DirSync { + @:inheritDoc(eval.luv.Dir.open) + static public function open(path:NativeString):Result; + + @:inheritDoc(eval.luv.Dir.close) + static public function close(dir:Dir):Result; + + @:inheritDoc(eval.luv.Dir.read) + static public function read(dir:Dir, ?numberOfEntries:Int):Result>; + + @:inheritDoc(eval.luv.Dir.scan) + static public function scan(path:NativeString):Result; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Dns.hx b/build/linux64_569e52e/std/eval/luv/Dns.hx new file mode 100644 index 0000000..bb60974 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Dns.hx @@ -0,0 +1,69 @@ +package eval.luv; + +@:forward +abstract AddrInfoRequest(Request) to Request {} + +typedef AddrInfo = { + var family:SockAddr.AddressFamily; + var sockType:SockAddr.SocketType; + var protocol:Int; + var addr:SockAddr; + var ?canonName:String; +} + +typedef AddrInfoOptions = { + var ?request:AddrInfoRequest; + var ?family:SockAddr.AddressFamily; + var ?sockType:SockAddr.SocketType; + var ?protocol:Int; + var ?flags:Array; +} + +enum abstract AddrInfoFlag(Int) { + var PASSIVE = 0; + var CANONNAME = 1; + var NUMERICHOST = 2; + var NUMERICSERV = 3; + var V4MAPPED = 4; + var ALL = 5; + var ADDRCONFIG = 6; +} + +@:forward +abstract NameInfoRequest(Request) to Request {} + +enum abstract NameInfoFlag(Int) { + var NAMEREQD = 0; + var DGRAM = 1; + var NOFQDN = 2; + var NUMERICHOST = 3; + var NUMERICSERV = 4; +} + +typedef NameInfoOptions = { + var ?request:NameInfoRequest; + var ?flags:Array; +} + +/** + DNS queries. + + @see https://aantron.github.io/luv/luv/Luv/Dns +**/ +extern class Dns { + + static function createAddrRequest():AddrInfoRequest; + + static function createNameRequest():NameInfoRequest; + + /** + Retrieves addresses. + Either `node` or `service` may be `null` but not both. + **/ + static function getAddrInfo(loop:Loop, node:Null, service:Null, ?options:AddrInfoOptions, callback:(result:Result>)->Void):Void; + + /** + Retrieves host names. + **/ + static function getNameInfo(loop:Loop, addr:SockAddr, ?options:NameInfoOptions, callback:(result:Result<{hostName:String, service:String}>)->Void):Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Env.hx b/build/linux64_569e52e/std/eval/luv/Env.hx new file mode 100644 index 0000000..fae97f7 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Env.hx @@ -0,0 +1,28 @@ +package eval.luv; + +/** + Environment variables. + + @see https://aantron.github.io/luv/luv/Luv/Env +**/ +extern class Env { + /** + Retrieves the value of an environment variable. + **/ + static function getEnv(name:String):Result; + + /** + Sets an environment variable. + **/ + static function setEnv(name:String, value:NativeString):Result; + + /** + Deletes an environment variable. + **/ + static function unsetEnv(name:String):Result; + + /** + Retrieves all environment variables. + **/ + static function environ():Result>; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/File.hx b/build/linux64_569e52e/std/eval/luv/File.hx new file mode 100644 index 0000000..d623343 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/File.hx @@ -0,0 +1,424 @@ +package eval.luv; + +import eval.integers.Int64; +import eval.integers.UInt64; + +@:forward +abstract FileRequest(Request) to Request {} + +enum abstract FileOpenFlag(Int) { + var RDONLY = 0; + var WRONLY = 1; + var RDWR = 2; + var CREAT = 3; + var EXCL = 4; + var EXLOCK = 5; + var NOCTTY = 6; + var NOFOLLOW = 7; + var TEMPORARY = 8; + var TRUNC = 9; + var APPEND = 10; + var DIRECT = 11; + var DSYNC = 12; + var FILEMAP = 13; + var NOATIME = 14; + var NONBLOCK = 15; + var RANDOM = 16; + var SEQUENTIAL = 17; + var SHORT_LIVED = 18; + var SYMLINK = 19; + var SYNC = 20; +} + +/** + Permission bits. + @see https://aantron.github.io/luv/luv/Luv/File/Mode +**/ +enum FileMode { + IRWXU; + IRUSR; + IWUSR; + IXUSR; + IRWXG; + IRGRP; + IWGRP; + IXGRP; + IRWXO; + IROTH; + IWOTH; + IXOTH; + ISUID; + ISGID; + ISVTX; + IFMT; + IFREG; + IFDIR; + IFBLK; + IFCHR; + IFLNK; + IFIFO; + NUMERIC(mode:Int); +} + +/** + Abstract type for a bit field of permissions bits, i.e., an `int` in which + multiple bits may be set. These bit fields are returned by operations such + as `eval.luv.File.stat` +**/ +@:coreType abstract FileModeNumeric {} + +typedef FileStatTimeSpec = { + var sec:Int64; + var nsec:Int64; +} + +typedef FileStat = { + var dev:UInt64; + var mode:FileModeNumeric; + var nlink:UInt64; + var uid:UInt64; + var gid:UInt64; + var rdev:UInt64; + var ino:UInt64; + var size:UInt64; + var blksize:UInt64; + var blocks:UInt64; + var flags:UInt64; + var gen:UInt64; + var atim:FileStatTimeSpec; + var mtim:FileStatTimeSpec; + var ctim:FileStatTimeSpec; + var birthtim:FileStatTimeSpec; +} + +typedef FileStatFs = { + var type:UInt64; + var bsize:UInt64; + var blocks:UInt64; + var bfree:UInt64; + var bavail:UInt64; + var files:UInt64; + var ffree:UInt64; + var fspare:Array; +} + +enum abstract FileCopyFlag(Int) { + var COPYFILE_EXCL = 0; + var COPYFILE_FICLONE = 1; + var COPYFILE_FICLONE_FORCE = 2; +} + +enum abstract FileAccessFlag(Int) { + var F_OK = 0; + var R_OK = 1; + var W_OK = 2; + var X_OK = 3; +} + +enum abstract FileSymlinkFlag(Int) { + var SYMLINK_DIR = 0; + var SYMLINK_JUNCTION = 1; +} + +/** + Files. + + @see https://aantron.github.io/luv/luv/Luv/File +**/ +@:using(eval.luv.Handle) +@:coreType abstract File to Handle { + + extern static public final stdin:File; + extern static public final stdout:File; + extern static public final stderr:File; + + static public function createRequest():FileRequest; + + /** + Checks whether all the bits in `mask` are set in `bits`. + + For example, if `bits` is equal to octal 0o644, then + `eval.luv.File.testMode [IRUSR] bits` evaluates to `true`. + **/ + static public function testMode(mask:Array, bits:FileModeNumeric):Bool; + + /** + Opens the file at the given path. + The default value of the `mode` argument is equal to octal `0o644`. + **/ + static public function open(loop:Loop, path:NativeString, flags:Array, ?mode:Array, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Closes the file. + **/ + public function close(loop:Loop, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Reads from the file. + + The incoming data is written consecutively to into the given buffers. + The number of bytes that the operation tries to read is the total length + of the buffers. + + End of file is indicated by `Result.Ok(0)`. Note that this is different + from `eval.luv.Stream.readStart`. + **/ + public function read(loop:Loop, fileOffset:Int64, buffers:Array, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Writes to the file. + **/ + public function write(loop:Loop, fileOffset:Int64, buffers:Array, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Deletes the file at the given path. + **/ + static public function unlink(loop:Loop, path:NativeString, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Moves the file at the given path to the path given by `toPath` + **/ + static public function rename(loop:Loop, path:NativeString, toPath:NativeString, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Creates a temporary file with name based on the given pattern. + **/ + static public function mkstemp(loop:Loop, pattern:NativeString, ?request:FileRequest, callback:(result:Result<{name:NativeString,file:File}>)->Void):Void; + + /** + Creates a temporary directory with name based on the given pattern. + **/ + static public function mkdtemp(loop:Loop, pattern:NativeString, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Creates a directory. + **/ + static public function mkdir(loop:Loop, path:NativeString, ?mode:Array, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Deletes a directory. + **/ + static public function rmdir(loop:Loop, path:NativeString, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Retrieves status information for the file at the given path. + **/ + static public function stat(loop:Loop, path:NativeString, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Like `eval.luv.File.stat`, but does not dereference symlinks. + **/ + static public function lstat(loop:Loop, path:NativeString, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Retrieves status information for this file. + **/ + public function fstat(loop:Loop, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Retrieves status information for the filesystem containing the given path. + **/ + static public function statFs(loop:Loop, path:NativeString, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Flushes file changes to storage. + **/ + public function fsync(loop:Loop, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Like `eval.luv.File.fsync`, but may omit some metadata. + **/ + public function fdataSync(loop:Loop, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Truncates the given file to the given length. + **/ + public function ftruncate(loop:Loop, length:Int64, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Copies the file at the given path to the path given by `toPath`. + **/ + static public function copyFile(loop:Loop, path:NativeString, toPath:NativeString, ?flags:Array, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Transfers data between file descriptors. + **/ + public function sendFile(loop:Loop, toFile:File, offset:Int64, length:UInt64, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Checks whether the calling process can access the file at the given path. + **/ + static public function access(loop:Loop, path:NativeString, flags:Array, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Changes permissions of the file at the given path. + **/ + static public function chmod(loop:Loop, path:NativeString, mode:Array, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Changes permissions of the file. + **/ + public function fchmod(loop:Loop, mode:Array, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Sets timestamps of the file at the given path. + **/ + static public function utime(loop:Loop, path:NativeString, atime:Float, mtime:Float, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Sets timestamps of the file. + **/ + public function futime(loop:Loop, atime:Float, mtime:Float, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Sets timestamps of the file at the given path without dereferencing symlinks. + **/ + static public function lutime(loop:Loop, path:NativeString, atime:Float, mtime:Float, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Hardlinks a file at the location given by `link`. + **/ + static public function link(loop:Loop, path:NativeString, link:NativeString, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Symlinks a file at the location given by `link`. + **/ + static public function symlink(loop:Loop, path:NativeString, link:NativeString, ?flags:Array, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Reads the target path of a symlink. + **/ + static public function readLink(loop:Loop, path:NativeString, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Resolves a real absolute path to the given file. + **/ + static public function realPath(loop:Loop, path:NativeString, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Changes owneship of the file at the given path. + **/ + static public function chown(loop:Loop, path:NativeString, uid:Int, gid:Int, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Changes owneship of the file at the given path. without dereferencing symlinks. + **/ + static public function lchown(loop:Loop, path:NativeString, uid:Int, gid:Int, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Changes owneship of the file. + **/ + public function fchown(loop:Loop, uid:Int, gid:Int, ?request:FileRequest, callback:(result:Result)->Void):Void; + + /** + Returns the integer representation of `eval.luv.File`. + + `eval.luv.File` is defined as an integer file descriptor by libuv on all + platforms at the moment. This is a convenience function for interoperability + with `eval.luv.Process`, the API of which assumes that files are represented + by integers. + **/ + public function toInt():Int; +} + +/** + Synchronous version of `eval.luv.File` API +**/ +extern class FileSync { + @:inheritDoc(eval.luv.File.open) + static function open(path:NativeString, flags:Array, ?mode:Array):Result; + + @:inheritDoc(eval.luv.File.close) + static function close(file:File):Result; + + @:inheritDoc(eval.luv.File.read) + static function read(file:File, fileOffset:Int64, buffers:Array):Result; + + @:inheritDoc(eval.luv.File.write) + static function write(file:File, fileOffset:Int64, buffers:Array):Result; + + @:inheritDoc(eval.luv.File.unlink) + static function unlink(path:NativeString):Result; + + @:inheritDoc(eval.luv.File.rename) + static function rename(path:NativeString, toPath:NativeString):Result; + + @:inheritDoc(eval.luv.File.mkstemp) + static function mkstemp(pattern:NativeString):Result<{name:NativeString,file:File}>; + + @:inheritDoc(eval.luv.File.mkdtemp) + static function mkdtemp(pattern:NativeString):Result; + + @:inheritDoc(eval.luv.File.mkdir) + static function mkdir(path:NativeString, ?mode:Array):Result; + + @:inheritDoc(eval.luv.File.rmdir) + static function rmdir(path:NativeString):Result; + + @:inheritDoc(eval.luv.File.stat) + static function stat(path:NativeString):Result; + + @:inheritDoc(eval.luv.File.lstat) + static function lstat(path:NativeString):Result; + + @:inheritDoc(eval.luv.File.fstat) + static function fstat(file:File):Result; + + @:inheritDoc(eval.luv.File.statFs) + static function statFs(path:NativeString):Result; + + @:inheritDoc(eval.luv.File.fsync) + static function fsync(file:File):Result; + + @:inheritDoc(eval.luv.File.fdataSync) + static function fdataSync(file:File):Result; + + @:inheritDoc(eval.luv.File.ftruncate) + static function ftruncate(file:File, length:Int64):Result; + + @:inheritDoc(eval.luv.File.copyFile) + static function copyFile(path:NativeString, toPath:NativeString, ?flags:Array):Result; + + @:inheritDoc(eval.luv.File.sendFile) + static function sendFile(file:File, toFile:File, offset:Int64, length:UInt64):Result; + + @:inheritDoc(eval.luv.File.access) + static function access(path:NativeString, flags:Array):Result; + + @:inheritDoc(eval.luv.File.chmod) + static function chmod(path:NativeString, mode:Array):Result; + + @:inheritDoc(eval.luv.File.fchmod) + static function fchmod(file:File, mode:Array):Result; + + @:inheritDoc(eval.luv.File.utime) + static function utime(path:NativeString, atime:Float, mtime:Float):Result; + + @:inheritDoc(eval.luv.File.futime) + static function futime(file:File, atime:Float, mtime:Float):Result; + + @:inheritDoc(eval.luv.File.lutime) + static function lutime(path:NativeString, atime:Float, mtime:Float):Result; + + @:inheritDoc(eval.luv.File.link) + static function link(path:NativeString, link:NativeString):Result; + + @:inheritDoc(eval.luv.File.symlink) + static function symlink(path:NativeString, link:NativeString, ?flags:Array):Result; + + @:inheritDoc(eval.luv.File.readLink) + static function readLink(path:NativeString):Result; + + @:inheritDoc(eval.luv.File.realPath) + static function realPath(path:NativeString):Result; + + @:inheritDoc(eval.luv.File.chown) + static function chown(path:NativeString, uid:Int, gid:Int):Result; + + @:inheritDoc(eval.luv.File.lchown) + static function lchown(path:NativeString, uid:Int, gid:Int):Result; + + @:inheritDoc(eval.luv.File.fchown) + static function fchown(file:File, uid:Int, gid:Int):Result; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/FsEvent.hx b/build/linux64_569e52e/std/eval/luv/FsEvent.hx new file mode 100644 index 0000000..5571138 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/FsEvent.hx @@ -0,0 +1,36 @@ +package eval.luv; + +enum abstract FsEventType(Int) { + var RENAME = 0; + var CHANGE = 1; +} + +enum abstract FsEventFlag(Int) { + var FS_EVENT_WATCH_ENTRY = 0; + var FS_EVENT_STAT = 1; + var FS_EVENT_RECURSIVE = 2; +} + +/** + Filesystem events. + + @see https://aantron.github.io/luv/luv/Luv/FS_event +**/ +@:using(eval.luv.Handle) +@:coreType abstract FsEvent to Handle { + /** + Allocates and initializes an FS event handle. + **/ + static public function init(loop:Loop):Result; + + /** + Starts the handle and watches the given path for changes. + **/ + public function start(path:NativeString, ?flags:Array, callback:(result:Result<{file:NativeString,events:Array}>)->Void):Void; + + /** + Stops the handle. + **/ + public function stop():Result; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/FsPoll.hx b/build/linux64_569e52e/std/eval/luv/FsPoll.hx new file mode 100644 index 0000000..3587d84 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/FsPoll.hx @@ -0,0 +1,30 @@ +package eval.luv; + +import eval.luv.File; + +/** + Filesystem polling. + + @see https://aantron.github.io/luv/luv/Luv/FS_poll +**/ +@:using(eval.luv.Handle) +@:coreType abstract FsPoll to Handle { + /** + Allocates and initializes an FS polling handle. + + The handle should be cleaned up with `eval.luv.Handle.close` when no longer needed. + **/ + static public function init(loop:Loop):Result; + + /** + Starts the handle and polls the given path for changes. + + The default value of `interval` is 2000 (milliseconds). + **/ + public function start(path:NativeString, ?interval:Int, callback:(result:Result<{previous:FileStat,current:FileStat}>)->Void):Void; + + /** + Stops the handle. + **/ + public function stop():Result; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Handle.hx b/build/linux64_569e52e/std/eval/luv/Handle.hx new file mode 100644 index 0000000..53524ba --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Handle.hx @@ -0,0 +1,85 @@ +package eval.luv; + +@:coreType abstract SocketHandle {} + +/** + Handles. + + @see https://aantron.github.io/luv/luv/Luv/Handle +**/ +@:coreType abstract Handle { + /** + Closes the given handle. + **/ + extern static public function close(handle:Handle, callback:()->Void):Void; + + /** + Returns `true` if the handle is active, `false` otherwise. + **/ + static public function isActive(handle:Handle):Bool; + + /** + Returns `true` if the handle is closing or closed, `false` otherwise. + + Note: This function should only be used between the initialization of + the handle and the arrival of the close callback. + **/ + static public function isClosing(handle:Handle):Bool; + + /** + Reference the given handle. + + @see https://aantron.github.io/luv/luv/Luv/Handle/#val-ref + **/ + static public function ref(handle:Handle):Void; + + /** + Un-reference the given handle. + + @see https://aantron.github.io/luv/luv/Luv/Handle/#val-unref + **/ + static public function unref(handle:Handle):Void; + + /** + Returns `true` if the handle referenced, `false` otherwise. + + @see https://aantron.github.io/luv/luv/Luv/Handle/#val-has_ref + **/ + static public function hasRef(handle:Handle):Bool; + + /** + Gets the size of the OS send buffer for a socket. + + @see https://aantron.github.io/luv/luv/Luv/Handle/#val-send_buffer_size + **/ + static public function sendBufferSize(handle:SocketHandle):Result; + + /** + Sets the size of the OS send buffer for a socket. + + @see https://aantron.github.io/luv/luv/Luv/Handle/#val-set_send_buffer_size + **/ + static public function setSendBufferSize(handle:SocketHandle, size:Int):Result; + + /** + Gets the size of the OS receive buffer for a socket. + + @see https://aantron.github.io/luv/luv/Luv/Handle/#val-recv_buffer_size + **/ + static public function recvBufferSize(handle:SocketHandle):Result; + + /** + Sets the size of the OS receive buffer for a socket. + + @see https://aantron.github.io/luv/luv/Luv/Handle/#val-set_recv_buffer_size + **/ + static public function setRecvBufferSize(handle:SocketHandle, size:Int):Result; + +// TODO + // /** + // Retrieves the file descriptor associated with the handle. + + // @see https://aantron.github.io/luv/luv/Luv/Handle/#val-fileno + // **/ + // static public function fileno(handle:FileNo):Result; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Idle.hx b/build/linux64_569e52e/std/eval/luv/Idle.hx new file mode 100644 index 0000000..388fd66 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Idle.hx @@ -0,0 +1,26 @@ +package eval.luv; + +/** + Per-iteration callback. + + @see https://aantron.github.io/luv/luv/Luv/Idle +**/ +@:using(eval.luv.Handle) +@:coreType abstract Idle to Handle { + /** + Allocate and initialize an idle handle. + + The handle should be cleaned up with `eval.luv.Handle.close` when no longer needed. + **/ + static public function init(loop:Loop):Result; + + /** + Starts the handle with the given callback. + **/ + public function start(callback:()->Void):Result; + + /** + Stops the handle. + **/ + public function stop():Result; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Loop.hx b/build/linux64_569e52e/std/eval/luv/Loop.hx new file mode 100644 index 0000000..2122211 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Loop.hx @@ -0,0 +1,93 @@ +package eval.luv; + +enum abstract RunMode(Int) { + /** Runs the event loop until there are no more active and referenced handles or requests. */ + var DEFAULT = 0; + /** Poll for i/o once. Note that this mode blocks if there are no pending callbacks. */ + var ONCE = 1; + /** Poll for i/o once but don't block if there are no pending callbacks. */ + var NOWAIT = 2; +} + +/** + Configuration options. + @see http://docs.libuv.org/en/v1.x/loop.html#c.uv_loop_configure +**/ +enum abstract LoopOption(Int) { + extern static public final sigprof:Int; + + var LOOP_BLOCK_SIGNAL:LoopOption = 0; + var METRICS_IDLE_TIME:LoopOption = 1; +} + +/** + Event loops. + + @see https://aantron.github.io/luv/luv/Luv/Loop + + Haxe event loops define an implicit cast to libuv loops. That is, you can use + `sys.thread.Thread.current().events` in any place where `eval.luv.Loop` is + expected. +**/ +@:coreType abstract Loop { + @:from + static inline function fromHaxeEventLoop(events:sys.thread.EventLoop):Loop { + return events.handle; + } + + /** + Returns the default event loop. + **/ + static public function defaultLoop():Loop; + + /** + Allocates and initializes a new event loop. + **/ + static public function init():Result; + + /** + Releases any state libuv is holding on to. + + Normally there's no need to do this manually. + + Warning! Only call `Loop.libraryShutdown()` once. + Warning! Don’t call `Loop.libraryShutdown()` when there are still event loops or I/O requests active. + Warning! Don’t call libuv functions after calling `Loop.libraryShutdown()`. + **/ + static public function libraryShutdown():Void; + + /** + Runs an event loop. + **/ + public function run(mode:RunMode):Bool; + + /** + Releases resources associated with an event loop. + **/ + public function close():Result; + + /** + Indicates whether the loop is monitoring any activity. + **/ + public function alive():Bool; + + /** + Stops an event loop as soon as possible. + **/ + public function stop():Void; + + /** + Returns the cached loop timestamp. + **/ + public function now():eval.integers.UInt64; + + /** + Updates the cached loop timestamp. + **/ + public function updateTime():Void; + + /** + Sets the loop option. + **/ + public function configure(option:LoopOption, value:T):Result; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/LuvException.hx b/build/linux64_569e52e/std/eval/luv/LuvException.hx new file mode 100644 index 0000000..bf5f3a0 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/LuvException.hx @@ -0,0 +1,19 @@ +package eval.luv; + +/** + Exceptions thrown by functions in `eval.luv` package. +**/ +class LuvException extends haxe.Exception { + /** + The error. + **/ + public final error:UVError; + + /** + Instantiates an error with given message and position. + **/ + public function new(error:UVError, ?message:String, ?previous:haxe.Exception) { + super(message == null ? error.toString() : message, previous); + this.error = error; + } +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Metrics.hx b/build/linux64_569e52e/std/eval/luv/Metrics.hx new file mode 100644 index 0000000..2bb63a6 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Metrics.hx @@ -0,0 +1,13 @@ +package eval.luv; + +/** + Metrics. + + @see https://aantron.github.io/luv/luv/Luv/Metrics +**/ +extern class Metrics { + /** + Retrieves the amount of time the loop has been blocked waiting in the kernel. + **/ + static function idleTime(loop:Loop):eval.integers.UInt64; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Mutex.hx b/build/linux64_569e52e/std/eval/luv/Mutex.hx new file mode 100644 index 0000000..35f06bb --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Mutex.hx @@ -0,0 +1,35 @@ +package eval.luv; + +/** + Mutexes. + + @see https://aantron.github.io/luv/luv/Luv/Mutex +**/ +@:coreType abstract Mutex { + /** + Allocates and initializes a mutex. + **/ + static public function init(?recursive:Bool):Result; + + /** + Cleans up a mutex. + **/ + public function destroy():Void; + + /** + Takes the mutex. + + The calling thread is blocked until it obtains the mutex. + **/ + public function lock():Void; + + /** + Tries to take the mutex without blocking. + **/ + public function tryLock():Result; + + /** + Releases the mutex. + **/ + public function unlock():Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Network.hx b/build/linux64_569e52e/std/eval/luv/Network.hx new file mode 100644 index 0000000..611d35f --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Network.hx @@ -0,0 +1,36 @@ +package eval.luv; + +typedef InterfaceAddress = { + var name:String; + var isInternal:Bool; + var physical:NativeString; + var address:SockAddr; + var netmask:SockAddr; +} + +/** + Network interfaces and hostname. + + @see https://aantron.github.io/luv/luv/Luv/Network +**/ +extern class Network { + /** + Lists network interface addresses. + **/ + static function interfaceAddresses():Result>; + + /** + Retrieves a network interface name. + **/ + static function ifIndexToName(index:Int):Result; + + /** + Retrieves a network interface identifier suitable for use in an IPv6 scoped address. + **/ + static function ifIndexToIid(index:Int):Result; + + /** + Evaluates to the system's hostname. + **/ + static function getHostName():Result; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Once.hx b/build/linux64_569e52e/std/eval/luv/Once.hx new file mode 100644 index 0000000..6202d45 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Once.hx @@ -0,0 +1,18 @@ +package eval.luv; + +/** + Once-only initialization. + + @see https://aantron.github.io/luv/luv/Luv/Once +**/ +@:coreType abstract Once { + /** + Allocates and initializes a once-only barrier. + **/ + static public function init():Result; + + /** + Guards the given callback to be called only once. + **/ + public function once(callback:()->Void):Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/OsFd.hx b/build/linux64_569e52e/std/eval/luv/OsFd.hx new file mode 100644 index 0000000..a8652fa --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/OsFd.hx @@ -0,0 +1,6 @@ +package eval.luv; + +/** + @see https://aantron.github.io/luv/luv/Luv/Os_fd/Fd +**/ +@:coreType abstract OsFd {} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/OsSocket.hx b/build/linux64_569e52e/std/eval/luv/OsSocket.hx new file mode 100644 index 0000000..7e0eca6 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/OsSocket.hx @@ -0,0 +1,6 @@ +package eval.luv; + +/** + @see https://aantron.github.io/luv/luv/Luv/Os_fd/Socket +**/ +@:coreType abstract OsSocket {} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Passwd.hx b/build/linux64_569e52e/std/eval/luv/Passwd.hx new file mode 100644 index 0000000..87e506b --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Passwd.hx @@ -0,0 +1,21 @@ +package eval.luv; + +typedef PasswdData = { + var username:String; + var uid:Int; + var gid:Int; + var shell:Null; + var homedir:NativeString; +} + +/** + Current user information. + + @see https://aantron.github.io/luv/luv/Luv/Passwd +**/ +extern class Passwd { + /** + Gets passwd entry for the current user. + **/ + static function getPasswd():Result; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Path.hx b/build/linux64_569e52e/std/eval/luv/Path.hx new file mode 100644 index 0000000..758c94b --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Path.hx @@ -0,0 +1,37 @@ +package eval.luv; + +import eval.integers.Int64; +import eval.integers.UInt64; + +/** + Relevant directories. + + @see https://aantron.github.io/luv/luv/Luv/Path +**/ +extern class Path { + /** + Evaluates to the executable's path. + It's always the path to the Haxe compiler. + **/ + static function exePath():Result; + + /** + Evaluates to the current working directory. + **/ + static function cwd():Result; + + /** + Changes the current working directory. + **/ + static function chdir(dir:NativeString):Result; + + /** + Evaluates to the path of the home directory. + **/ + static function homedir():Result; + + /** + Evaluates to the path of the temporary directory. + **/ + static function tmpdir():Result; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Pid.hx b/build/linux64_569e52e/std/eval/luv/Pid.hx new file mode 100644 index 0000000..573f9c6 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Pid.hx @@ -0,0 +1,18 @@ +package eval.luv; + +/** + Process ids. + + @see https://aantron.github.io/luv/luv/Luv/Pid +**/ +extern class Pid { + /** + Evaluates to the pid of the current process. + **/ + static function getPid():Int; + + /** + Evaluates to the pid of the parent process. + **/ + static function getPPid():Int; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Pipe.hx b/build/linux64_569e52e/std/eval/luv/Pipe.hx new file mode 100644 index 0000000..bc04e93 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Pipe.hx @@ -0,0 +1,77 @@ +package eval.luv; + +enum abstract PipeMode(Int) { + var READ = 0; + var WRITE = 1; + var READ_WRITE = 2; +} + +enum ReceiveHandle { + NONE; + TCP(associate:(tcp:Tcp)->Result); + PIPE(associate:(pipe:Pipe)->Result); +} + +/** + Pipes + + @see https://aantron.github.io/luv/luv/Luv/Pipe +**/ +@:using(eval.luv.Handle) +@:using(eval.luv.Stream) +@:coreType abstract Pipe to Handle to Stream to Stream.TStream to Handle.SocketHandle { + /** + Allocates and initializes a pipe. + + The pipe is not yet connected to anything at this point. + + The handle should be cleaned up with `eval.luv.Handle.close` when no longer needed. + **/ + static public function init(loop:Loop, forHandlePassing:Bool = false):Result; + + /** + Assigns a pipe a name or an address. + **/ + public function bind(nameOrAddress:NativeString):Result; + + /** + Connects to the pipe at the given name or address. + **/ + public function connect(target:NativeString, callback:(result:Result)->Void):Void; + + /** + Retrieves the name or address assigned to the pipe. + **/ + public function getSockName():Result; + + /** + Retrieves the name or address of the pipe's peer. + **/ + public function getPeerName():Result; + + /** + Set the number of pending pipe instance handles when the pipe server is + waiting for connections. + **/ + public function pendingInstances(amount:Int):Void; + + /** + Receives a file descriptor over the given pipe. + + File descriptors are sent using the `sendHandle` argument of `eval.luv.Stream.write2`. + On the receiving end, call `eval.luv.Stream.readStart`. When that function + calls its callback, there may be file descriptors in the pipe, in addition + to the ordinary data provided to the callback. + + To check, call this function `eval.luv.Pipe.recieveHandle` in a loop until + it returns `NONE`. Each time it returns `TCP(associate)` or `PIPE(associate)`, + create an appropriate handle using either `eval.luv.TCP.init` or `eval.uv.Pipe.init`, + and call `associate` to receive the file descriptor and associate it with handle. + **/ + public function receiveHandle():ReceiveHandle; + + /** + Sets pipe permissions. + **/ + public function chmod(mode:PipeMode):Result; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Prepare.hx b/build/linux64_569e52e/std/eval/luv/Prepare.hx new file mode 100644 index 0000000..c74de43 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Prepare.hx @@ -0,0 +1,26 @@ +package eval.luv; + +/** + Pre-I/O callback. + + @see https://aantron.github.io/luv/luv/Luv/Prepare +**/ +@:using(eval.luv.Handle) +@:coreType abstract Prepare to Handle { + /** + Allocate and initialize a prepare handle. + + The handle should be cleaned up with `eval.luv.Handle.close` when no longer needed. + **/ + static public function init(loop:Loop):Result; + + /** + Starts the handle with the given callback. + **/ + public function start(callback:()->Void):Result; + + /** + Stops the handle. + **/ + public function stop():Result; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Process.hx b/build/linux64_569e52e/std/eval/luv/Process.hx new file mode 100644 index 0000000..9bbf4b9 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Process.hx @@ -0,0 +1,89 @@ +package eval.luv; + +import eval.integers.Int64; + +/** + File descriptor redirections for use with `eval.luv.Process.spawn` +**/ +@:coreType abstract Redirection {} + +/** + Options for spawning the process. +**/ +typedef ProcessOptions = { + var ?onExit:(p:Process, exitStatus:Int64, termSignal:Int)->Void; + var ?environment:Map; + var ?workingDirectory:NativeString; + var ?redirect:Array; + var ?uid:Int; + var ?gid:Int; + var ?windowsVerbatimArguments:Bool; + var ?detached:Bool; + var ?windowsHide:Bool; + var ?windowsHideConsole:Bool; + var ?windowsHideGui:Bool; +} + +/** + Subprocesses. + + @see https://aantron.github.io/luv/luv/Luv/Process +**/ +@:using(eval.luv.Handle) +@:coreType abstract Process to Handle { + extern static public final stdin:Int; + extern static public final stdout:Int; + extern static public final stderr:Int; + + /** + Causes `fd` in the child to be connected to `toParentPipe` in the parent. + + Binds `UV_CREATE_PIPE`. + + `readableInChild` sets `UV_READABLE_PIPE`, and `writableInChild` sets `UV_WRITABLE_PIPE`. + + `overlapped` sets `UV_OVERLAPPED_PIPE`. + **/ + static public function toParentPipe(fd:Int, parentPipe:Pipe, readableInChild:Bool, writableInChild:Bool, overlapped:Bool):Redirection; + + /** + Causes `fd` in the child to be connected to the same device or peer as `fromParentFd` in the parent. + + Binds `UV_INHERIT_FD` + **/ + static public function inheritFd(fd:Int, fromParentFd:Int):Redirection; + + /** + Same as `eval.luv.Process.inheritFd`, but takes an `eval.luv.Stream` for the parent file descriptor. + + Binds `UV_INHERIT_STREAM`. + **/ + static public function inheritStream(fd:Int, fromParentStream:Stream):Redirection; + + /** + Starts a process. + + The handle should be cleaned up with `eval.luv.Handle.close` when no longer needed. + **/ + static public function spawn(loop:Loop, cmd:NativeString, args:Array, ?options:ProcessOptions):Result; + + /** + Disables (tries) file descriptor inheritance for inherited descriptors. + **/ + static public function disableStdioInheritance():Void; + + /** + Sends the given signal to the process with the given pid. + **/ + static public function killPid(pid:Int, sigNum:Signal.SigNum):Result; + + /** + Sends the given signal to the process. + **/ + public function kill(sigNum:Signal.SigNum):Result; + + /** + Evaluates to the pid of the process. + **/ + public function pid():Int; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Random.hx b/build/linux64_569e52e/std/eval/luv/Random.hx new file mode 100644 index 0000000..de15936 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Random.hx @@ -0,0 +1,26 @@ +package eval.luv; + +@:forward +abstract RandomRequest(Request) to Request {} + +/** + System entropy source. + + @see https://aantron.github.io/luv/luv/Luv/Random +**/ +extern class Random { + + static function createRequest():RandomRequest; + + /** + Fills the given buffer with bits from the system entropy source. + **/ + static function random(loop:Loop, buffer:Buffer, ?request:RandomRequest, callback:(result:Result)->Void):Void; +} + +extern class RandomSync { + /** + Fills the given buffer with bits from the system entropy source. + **/ + static function random(buffer:Buffer):Result; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Request.hx b/build/linux64_569e52e/std/eval/luv/Request.hx new file mode 100644 index 0000000..ef3c146 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Request.hx @@ -0,0 +1,13 @@ +package eval.luv; + +/** + Requests. + + @see https://aantron.github.io/luv/luv/Luv/Request +**/ +@:coreType abstract Request { + /** + Tries to cancel a pending request. + **/ + public function cancel():Result; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Resource.hx b/build/linux64_569e52e/std/eval/luv/Resource.hx new file mode 100644 index 0000000..5457e74 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Resource.hx @@ -0,0 +1,78 @@ +package eval.luv; + +import eval.integers.UInt64; +import eval.integers.Int64; + +typedef RUsage = { + var utime:{sec:Int64, usec:Int64}; + var stime:{sec:Int64, usec:Int64}; + var maxrss:UInt64; + var ixrss:UInt64; + var idrss:UInt64; + var isrss:UInt64; + var minflt:UInt64; + var majflt:UInt64; + var nswap:UInt64; + var inblock:UInt64; + var oublock:UInt64; + var msgsnd:UInt64; + var msgrcv:UInt64; + var nsignals:UInt64; + var nvcsw:UInt64; + var nivcsw:UInt64; +} + +/** + Resource usage. + + @see https://aantron.github.io/luv/luv/Luv/Resource +**/ +extern class Resource { + /** + Evaluates to the current uptime. + **/ + static function uptime():Result; + + /** + Evaluates to the load average. + **/ + static function loadAvg():Array; + + /** + Evaluates to the amount of free memory, in bytes. + **/ + static function freeMemory():UInt64; + + /** + Evaluates to the total amount of memory, in bytes. + **/ + static function totalMemory():UInt64; + + /** + Gets the amount of memory available to the process (in bytes) based on + limits imposed by the OS. + If there is no such constraint returns `null` + **/ + static function constrainedMemory():Null; + + /** + Evaluates to the priority of the process with the given pid. + **/ + static function getPriority(pid:Int):Result; + + /** + Sets the priority of the process with the given pid. + **/ + static function setPriority(pid:Int, priority:Int):Result; + + /** + Evaluates to the resident set size for the current process. + **/ + static function residentSetMemory():Result; + + /** + Gets the resource usage measures for the current process. + **/ + static function getRUsage():Result; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Result.hx b/build/linux64_569e52e/std/eval/luv/Result.hx new file mode 100644 index 0000000..e48d34e --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Result.hx @@ -0,0 +1,40 @@ +package eval.luv; + +/** + Outcome of an operation. +**/ +@:using(eval.luv.Result.ResultTools) +enum Result { + /** Operation completed successfully. **/ + Ok(value:T); + /** Operation failed. **/ + Error(e:UVError); +} + +enum abstract NoData(Dynamic) { + var NoData = null; +} + +class ResultTools { + /** + Returns the result value on success or throws `eval.luv.LuvException` + on failure. + **/ + static public inline function resolve(result:Result):T { + switch result { + case Ok(v): return v; + case Error(e): throw new LuvException(e); + } + } + + /** + Returns `true` if the result is `Ok`. + Returns `false` if the result is `Error`. + **/ + static public inline function isOk(result:Result):Bool { + return switch result { + case Ok(_): true; + case Error(_): false; + } + } +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/RwLock.hx b/build/linux64_569e52e/std/eval/luv/RwLock.hx new file mode 100644 index 0000000..2fd943e --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/RwLock.hx @@ -0,0 +1,48 @@ +package eval.luv; + +/** + Read-write locks. + + @see https://aantron.github.io/luv/luv/Luv/Rwlock +**/ +@:coreType abstract RwLock { + /** + Allocates and initializes a read-write lock. + **/ + static public function init():Result; + + /** + Cleans up a read-write lock. + **/ + public function destroy():Void; + + /** + Takes a read-write lock for reading (shared access). + **/ + public function rdLock():Void; + + /** + Tries to take a read-write lock for reading without blocking. + **/ + public function rdTryLock():Result; + + /** + Releases a read-write lock after it was taken for reading. + **/ + public function rdUnlock():Void; + + /** + Takes a read-write lock for writing (exclusive access). + **/ + public function wrLock():Void; + + /** + Tries to take a read-write lock for writing without blocking. + **/ + public function wrTryLock():Result; + + /** + Releases a read-write lock after it was taken for writing. + **/ + public function wrUnlock():Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Semaphore.hx b/build/linux64_569e52e/std/eval/luv/Semaphore.hx new file mode 100644 index 0000000..bcbc4a3 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Semaphore.hx @@ -0,0 +1,33 @@ +package eval.luv; + +/** + Semaphores. + + @see https://aantron.github.io/luv/luv/Luv/Semaphore +**/ +@:coreType abstract Semaphore { + /** + Allocates and initializes a read-write lock. + **/ + static public function init(value:Int):Result; + + /** + Cleans up a semaphore. + **/ + public function destroy():Void; + + /** + Increments a semaphore. + **/ + public function post():Void; + + /** + Decrements a semaphore. + **/ + public function wait():Void; + + /** + Tries to decrement a semaphore without blocking. + **/ + public function tryWait():Result; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Signal.hx b/build/linux64_569e52e/std/eval/luv/Signal.hx new file mode 100644 index 0000000..5699c85 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Signal.hx @@ -0,0 +1,57 @@ +package eval.luv; + +/** + For the moment, the signals exposed are those that are both present on Unix + and present or emulated by libuv on Windows. + + You can also provide a plain integer signal code instead of the values of + this enum. + + @see https://aantron.github.io/luv/luv/Luv/Signal#signals +**/ +extern enum abstract SigNum(Int) from Int to Int { + var SIGABRT; + var SIGFPE; + var SIGHUP; + var SIGILL; + var SIGINT; + var SIGKILL; + var SIGSEGV; + var SIGTERM; + var SIGWINCH; +} + +/** + Signals. + + @see https://aantron.github.io/luv/luv/Luv/Signal +**/ +@:using(eval.luv.Handle) +@:coreType abstract Signal to Handle { + /** + Allocates and initializes a signal handle. + + The handle should be cleaned up with `eval.luv.Handle.close` when no longer needed. + **/ + static public function init(loop:Loop):Result; + + /** + Starts the signal handle. + **/ + public function start(sigNum:SigNum, callback:()->Void):Result; + + /** + Like `eval.luv.Signal.start`, but the handle is stopped after one callback call. + **/ + public function startOneshot(sigNum:SigNum, callback:()->Void):Result; + + /** + Stops the signal handle. + **/ + public function stop():Result; + + /** + Evaluates to the signal number associated with the handle. + **/ + public function signum():Int; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/SockAddr.hx b/build/linux64_569e52e/std/eval/luv/SockAddr.hx new file mode 100644 index 0000000..0fb0759 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/SockAddr.hx @@ -0,0 +1,47 @@ +package eval.luv; + +/** + Network address families. +**/ +enum AddressFamily { + UNSPEC; + INET; + INET6; + OTHER(i:Int); +} + +/** + Socket types. +**/ +enum SocketType { + STREAM; + DGRAM; + RAW; + OTHER(i:Int); +} + +/** + Binds `struct sockaddr`. + + @see https://aantron.github.io/luv/luv/Luv/Sockaddr +**/ +@:coreType abstract SockAddr { + /** Extracts the port in a network address. */ + public var port(get,never):Null; + function get_port():Null; + + /** + Converts a string and port number to an IPv4 struct sockaddr. + **/ + static public function ipv4(host:String, port:Int):Result; + + /** + Converts a string and port number to an IPv6 struct sockaddr. + **/ + static public function ipv6(host:String, port:Int):Result; + + /** + Converts a network address to a string. + **/ + public function toString():String; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Stream.hx b/build/linux64_569e52e/std/eval/luv/Stream.hx new file mode 100644 index 0000000..4768735 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Stream.hx @@ -0,0 +1,111 @@ +package eval.luv; + +@:coreType abstract TStream to Stream {} +// typedef TStream = Stream; + +enum SendHandle { + TCP(tcp:Tcp); + PIPE(pipe:Pipe); +} + +/** + Streams. + + @see https://aantron.github.io/luv/luv/Luv/Stream +**/ +@:coreType abstract Stream to Handle { + /** + Shuts down the write side of the stream. + **/ + extern static public function shutdown(stream:Stream, callback:(result:Result)->Void):Void; + + /** + Starts listening for incoming connections. + + `backlog` indicates the number of connections the kernel might queue. + When a new incoming connection is received the `callback` is called. + **/ + extern static public function listen(stream:Stream, callback:(result:Result)->Void, ?backlog:Int):Void; + + /** + This call is used in conjunction with `Stream.listen()` to accept incoming + connections. Call this function after receiving a `callback` of `listen(callback)` + to accept the connection. Before calling this function the client handle + must be initialized. + + When the `callback` of `listen(callback)` is called it is guaranteed that + this function will complete successfully the first time. + + `client` should be a freshly-initialized stream. + **/ + extern static public function accept(server:TStream, client:TStream):Result; + + /** + Calls the `callback` whenever data is available on the stream. + + The amount of data read is equal to the length of the buffer passed to + the `callback`. `allocate` is called immediately before each call to the + main `callback`, to create buffer, into which the data will be read. + + The end of the stream (typically, when the remote peer closes or shuts down + the connection) is indicated by `UVError.UV_EOF` being passed to the `callback`. + Note that this behavior is different from `eval.luv.File.read`. + + Zero-length reads are possible, and do not indicate the end of stream. Instead, + they usually indicate `UVError.UV_EAGAIN` inside libuv; libuv still calls the + `callback` in order to give the C user a chance to deallocate the data buffer. + This is not usually an issue in OCaml (which is the backend for eval target of + Haxe), so a wrapper of this function can usually simply ignore zero-length reads. + It is then also safe to convert `UVError.UV_EOF` to zero-length reads in a + higher-level API, for consistency with reading files, and in accordance with OS + API convention. + + To read only once, call `eval.luv.Stream.readStop` immediately, in the `callback`. + Otherwise, the main callback will be called repeatedly. + **/ + extern static public function readStart(stream:Stream, callback:(result:Result)->Void, ?allocate:(size:Int)->Buffer):Void; + + /** + Stops reading. + **/ + extern static public function readStop(stream:Stream):Result; + + /** + Writes the given buffer to the stream. + + The second argument passed to the `callback` is the number of bytes written. + libuv has an internal queue of writes, in part to implement retry. This means + that writes can be partial at the libuv API level, so it is possible to receive + both an `UVError` result, and for some data to have been successfully written. + **/ + extern static public function write(stream:Stream, data:Array, callback:(result:Result, bytesWritten:Int)->Void):Result; + + /** + Like `eval.luv.Stream.write`, but allows sending a TCP socket or pipe over the + stream. + **/ + extern static public function write2(stream:TStream, data:Array, sendHandle:SendHandle, callback:(result:Result, bytesWritten:Int)->Void):Result; + + /** + Same as `eval.luv.Stream.write()`, but won’t queue a write request if it can’t + be completed immediately. + + Returns the number of bytes written. + **/ + extern static public function tryWrite(stream:Stream, data:Array):Result; + + /** + Indicates whether the stream is readable (has data). + **/ + extern static public function isReadable(stream:Stream):Bool; + + /** + Indicates whether the stream is writable (has space in buffers). + **/ + extern static public function isWritable(stream:Stream):Bool; + + /** + Sets the blocking mode of the stream. + **/ + extern static public function setBlocking(stream:Stream, block:Bool):Result; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/SystemInfo.hx b/build/linux64_569e52e/std/eval/luv/SystemInfo.hx new file mode 100644 index 0000000..8c7574d --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/SystemInfo.hx @@ -0,0 +1,39 @@ +package eval.luv; + +import eval.integers.UInt64; + +typedef CpuInfo = { + var model:String; + var speed:Int; + var times:{ + var user:UInt64; + var nice:UInt64; + var sys:UInt64; + var idle:UInt64; + var irq:UInt64; + }; +} + +typedef Uname = { + var sysname:String; + var release:String; + var version:String; + var machine:String; +} + +/** + System information. + + @see https://aantron.github.io/luv/luv/Luv/System_info +**/ +extern class SystemInfo { + /** + Gets information about the CPUs on the system. + **/ + static function cpuInfo():Result>; + + /** + Gets information about the CPUs on the system. + **/ + static function uname():Result; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Tcp.hx b/build/linux64_569e52e/std/eval/luv/Tcp.hx new file mode 100644 index 0000000..abfab2d --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Tcp.hx @@ -0,0 +1,62 @@ +package eval.luv; + +import haxe.ds.Option; +import eval.luv.SockAddr; + +/** + TCP sockets. + + @see https://aantron.github.io/luv/luv/Luv/TCP +**/ +@:using(eval.luv.Handle) +@:using(eval.luv.Stream) +@:coreType abstract Tcp to Handle to Stream to Stream.TStream to Handle.SocketHandle { + /** + Allocates and initializes a TCP stream. + + The stream is not yet connected or listening. + + The handle should be cleaned up with `eval.luv.Handle.close` when no longer needed. + **/ + static public function init(loop:Loop, ?domain:AddressFamily):Result; + + /** + Sets TCP_NODELAY. + **/ + public function noDelay(enable:Bool):Result; + + /** + Sets the TCP keepalive. + **/ + public function keepAlive(value:Option):Result; + + /** + Sets simultaneous accept. + **/ + public function simultaneousAccepts(value:Bool):Result; + + /** + Assigns an address to the TCP socket. + **/ + public function bind(addr:SockAddr, ipv6Only:Bool = false):Result; + + /** + Retrieves the address assigned to the TCP socket. + **/ + public function getSockName():Result; + + /** + Retrieves the address of the TCP socket's peer. + **/ + public function getPeerName():Result; + + /** + Connects to a host. + **/ + public function connect(addr:SockAddr, callback:(result:Result)->Void):Void; + + /** + Resets the connection. + **/ + public function closeReset(callback:(result:Result)->Void):Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Thread.hx b/build/linux64_569e52e/std/eval/luv/Thread.hx new file mode 100644 index 0000000..6dd406a --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Thread.hx @@ -0,0 +1,34 @@ +package eval.luv; + +/** + Threads. + + @see https://aantron.github.io/luv/luv/Luv/Thread + + `eval.luv` integrates libuv with the OCaml runtime lock. This means that, as + in any other OCaml program, two threads cannot be running OCaml code at the + same time. Thus, two threads cannot be running Haxe code at the same time + because eval interpreter is written in OCaml. + However, `eval.luv` releases the lock when calling a potentially-blocking libuv API, + so that other threads can run while the calling thread is blocked. In particular, + the lock is released during calls to `eval.luv.Loop.run`, which means that other + threads can run in between when you make a call to a non-blocking API, and when + its callback is called by libuv. +**/ +@:coreType abstract Thread { + /** + Returns the representation of the calling thread. + **/ + static public function self():Thread; + + /** + Starts a new thread, which will run the given function. + **/ + static public function create(fn:()->Void, ?stackSize:Int):Result; + + /** + Waits for the thread to terminate. + **/ + public function join():Result; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/ThreadPool.hx b/build/linux64_569e52e/std/eval/luv/ThreadPool.hx new file mode 100644 index 0000000..4c6fd7c --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/ThreadPool.hx @@ -0,0 +1,31 @@ +package eval.luv; + +@:forward +abstract ThreadPoolRequest(Request) to Request {} + +/** + Thread pool. + + @see https://aantron.github.io/luv/luv/Luv/Thread_pool +**/ +extern class ThreadPool { + + static function createRequest():ThreadPoolRequest; + + /** + Schedules a function to be called by a thread in the thread pool. + + `work` is the function that will be called in the thread pool. + `callback` will be called by the `loop` after `work` completes, or + immediately, in case there is an error scheduling `work`. + **/ + static function queueWork(loop:Loop, ?request:ThreadPoolRequest, work:()->Void, callback:(result:Result)->Void):Void; + + /** + Sets thread pool size. + + This function should be called as soon during process startup as possible. + **/ + static function setSize(size:Int, ?ifNotAlreadySet:Bool):Void; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Time.hx b/build/linux64_569e52e/std/eval/luv/Time.hx new file mode 100644 index 0000000..d43dfa1 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Time.hx @@ -0,0 +1,27 @@ +package eval.luv; + +import eval.integers.Int64; +import eval.integers.UInt64; + +/** + Current time. + + @see https://aantron.github.io/luv/luv/Luv/Time +**/ +extern class Time { + /** + Get time. + **/ + static function getTimeOfDay():Result<{sec:Int64, usec:Int}>; + + /** + Samples the high-resolution timer. + **/ + static function hrTime():UInt64; + + /** + Suspends the calling thread for at least the given number of milliseconds. + **/ + static function sleep(duration:Int):Void; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Timer.hx b/build/linux64_569e52e/std/eval/luv/Timer.hx new file mode 100644 index 0000000..8b4f591 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Timer.hx @@ -0,0 +1,40 @@ +package eval.luv; + +/** + Timers. + + @see https://aantron.github.io/luv/luv/Luv/Timer +**/ +@:using(eval.luv.Handle) +@:coreType abstract Timer to Handle { + /** The timer repeat interval. */ + public var repeat(get,set):Int; + function get_repeat():Int; + function set_repeat(v:Int):Int; + + /** Evaluates to the time until the timer expires, or zero if it has already expired. */ + public var dueIn(get,never):Int; + function get_dueIn():Int; + + /** + Allocate and initialize an idle handle. + + The handle should be cleaned up with `eval.luv.Handle.close` when no longer needed. + **/ + static public function init(loop:Loop):Result; + + /** + Starts a timer. + **/ + public function start(callback:()->Void, timeoutMs:Int, ?repeatMs:Int):Result; + + /** + Stops a timer. + **/ + public function stop():Result; + + /** + Restarts a timer. + **/ + public function again():Result; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Tty.hx b/build/linux64_569e52e/std/eval/luv/Tty.hx new file mode 100644 index 0000000..5894048 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Tty.hx @@ -0,0 +1,63 @@ +package eval.luv; + +enum abstract TtyMode(Int) { + var NORMAL = 0; + var RAW = 1; + var IO = 2; +} + +enum abstract VTermState(Int) { + var SUPPORTED = 0; + var UNSUPPORTED = 1; +} + +/** + Consoles. + + @see https://aantron.github.io/luv/luv/Luv/Tty +**/ +@:using(eval.luv.Handle) +@:using(eval.luv.Stream) +@:coreType abstract Tty to Handle to Stream to Stream.TStream { + /** + To be called when the program exits. + Resets TTY settings to default values for the next process to take over. + **/ + static public function resetMode():Result; + + /** + Controls whether console virtual terminal sequences are processed by libuv + or console. Useful in particular for enabling ConEmu support of ANSI X3.64 + and Xterm 256 colors. Otherwise Windows10 consoles are usually detected + automatically. + + This function is only meaningful on Windows systems. On Unix it is silently + ignored. + **/ + static public function setVTermState(state:VTermState):Void; + + /** + Get the current state of whether console virtual terminal sequences are + handled by libuv or the console. + + This function is not implemented on Unix, where it returns `UVError.UV_ENOTSUP`. + **/ + static public function getVTermState():Result; + + /** + Allocates and initializes a TTY handle. + + The handle should be cleaned up with `eval.luv.Handle.close` when no longer needed. + **/ + static public function init(loop:Loop, file:File):Result; + + /** + Sets the TTY's mode. + **/ + public function setMode(mode:TtyMode):Result; + + /** + Retrieves the current window size. + **/ + public function getWinSize():Result<{width:Int, height:Int}>; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/UVError.hx b/build/linux64_569e52e/std/eval/luv/UVError.hx new file mode 100644 index 0000000..fd99941 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/UVError.hx @@ -0,0 +1,191 @@ +package eval.luv; + +/** + Error handling. + + @see https://aantron.github.io/luv/luv/Luv/Error +**/ +enum abstract UVError(Int) { + /** argument list too long */ + var UV_E2BIG = 0; + /** permission denied */ + var UV_EACCES = 1; + /** address already in use */ + var UV_EADDRINUSE = 2; + /** address not available */ + var UV_EADDRNOTAVAIL = 3; + /** address family not supported */ + var UV_EAFNOSUPPORT = 4; + /** resource temporarily unavailable */ + var UV_EAGAIN = 5; + /** address family not supported */ + var UV_EAI_ADDRFAMILY = 6; + /** temporary failure */ + var UV_EAI_AGAIN = 7; + /** bad ai_flags value */ + var UV_EAI_BADFLAGS = 8; + /** invalid value for hints */ + var UV_EAI_BADHINTS = 9; + /** request canceled */ + var UV_EAI_CANCELED = 10; + /** permanent failure */ + var UV_EAI_FAIL = 11; + /** ai_family not supported */ + var UV_EAI_FAMILY = 12; + /** out of memory */ + var UV_EAI_MEMORY = 13; + /** no address */ + var UV_EAI_NODATA = 14; + /** unknown node or service */ + var UV_EAI_NONAME = 15; + /** argument buffer overflow */ + var UV_EAI_OVERFLOW = 16; + /** resolved protocol is unknown */ + var UV_EAI_PROTOCOL = 17; + /** service not available for socket type */ + var UV_EAI_SERVICE = 18; + /** socket type not supported */ + var UV_EAI_SOCKTYPE = 19; + /** connection already in progress */ + var UV_EALREADY = 20; + /** bad file descriptor */ + var UV_EBADF = 21; + /** resource busy or locked */ + var UV_EBUSY = 22; + /** operation canceled */ + var UV_ECANCELED = 23; + /** invalid Unicode character */ + // var UV_ECHARSET = 24; // not defined in Luv ocaml library + /** software caused connection abort */ + var UV_ECONNABORTED = 25; + /** connection refused */ + var UV_ECONNREFUSED = 26; + /** connection reset by peer */ + var UV_ECONNRESET = 27; + /** destination address required */ + var UV_EDESTADDRREQ = 28; + /** file already exists */ + var UV_EEXIST = 29; + /** bad address in system call argument */ + var UV_EFAULT = 30; + /** file too large */ + var UV_EFBIG = 31; + /** host is unreachable */ + var UV_EHOSTUNREACH = 32; + /** interrupted system call */ + var UV_EINTR = 33; + /** invalid argument */ + var UV_EINVAL = 34; + /** i/o error */ + var UV_EIO = 35; + /** socket is already connected */ + var UV_EISCONN = 36; + /** illegal operation on a directory */ + var UV_EISDIR = 37; + /** too many symbolic links encountered */ + var UV_ELOOP = 38; + /** too many open files */ + var UV_EMFILE = 39; + /** message too long */ + var UV_EMSGSIZE = 40; + /** name too long */ + var UV_ENAMETOOLONG = 41; + /** network is down */ + var UV_ENETDOWN = 42; + /** network is unreachable */ + var UV_ENETUNREACH = 43; + /** file table overflow */ + var UV_ENFILE = 44; + /** no buffer space available */ + var UV_ENOBUFS = 45; + /** no such device */ + var UV_ENODEV = 46; + /** no such file or directory */ + var UV_ENOENT = 47; + /** not enough memory */ + var UV_ENOMEM = 48; + /** machine is not on the network */ + var UV_ENONET = 49; + /** protocol not available */ + var UV_ENOPROTOOPT = 50; + /** no space left on device */ + var UV_ENOSPC = 51; + /** function not implemented */ + var UV_ENOSYS = 52; + /** socket is not connected */ + var UV_ENOTCONN = 53; + /** not a directory */ + var UV_ENOTDIR = 54; + /** directory not empty */ + var UV_ENOTEMPTY = 55; + /** socket operation on non-socket */ + var UV_ENOTSOCK = 56; + /** operation not supported on socket */ + var UV_ENOTSUP = 57; + /** operation not permitted */ + var UV_EPERM = 58; + /** broken pipe */ + var UV_EPIPE = 59; + /** protocol error */ + var UV_EPROTO = 60; + /** protocol not supported */ + var UV_EPROTONOSUPPORT = 61; + /** protocol wrong type for socket */ + var UV_EPROTOTYPE = 62; + /** result too large */ + var UV_ERANGE = 63; + /** read-only file system */ + var UV_EROFS = 64; + /** cannot send after transport endpoint shutdown */ + var UV_ESHUTDOWN = 65; + /** invalid seek */ + var UV_ESPIPE = 66; + /** no such process */ + var UV_ESRCH = 67; + /** connection timed out */ + var UV_ETIMEDOUT = 68; + /** text file is busy */ + var UV_ETXTBSY = 69; + /** cross-device link not permitted */ + var UV_EXDEV = 70; + /** unknown error */ + var UV_UNKNOWN = 71; + /** end of file */ + var UV_EOF = 72; + /** no such device or address */ + var UV_ENXIO = 73; + /** too many links */ + var UV_EMLINK = 74; + /** inappropriate ioctl for device */ + var UV_ENOTTY = 75; + /** inappropriate file type or format */ + var UV_EFTYPE = 76; + /** illegal byte sequence */ + var UV_EILSEQ = 77; + /** value too large for defined data type **/ + var UV_EOVERFLOW = 78; + /** socket type not supported**/ + var UV_ESOCKTNOSUPPORT = 79; + + /** + Converts a system error code to a libuv error. + **/ + extern static public function translateSysError(code:Int):UVError; + + /** + Setup a callback for unhandled exceptions. + + @see https://aantron.github.io/luv/luv/Luv/Error#val-set_on_unhandled_exception + **/ + extern static public function setOnUnhandledException(callback:(e:haxe.Exception)->Void):Void; + + /** + Returns the name of the given error. + **/ + extern public function errName():String; + + /** + Returns the error message corresponding to the given error. + **/ + extern public function toString():String; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Udp.hx b/build/linux64_569e52e/std/eval/luv/Udp.hx new file mode 100644 index 0000000..1336006 --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Udp.hx @@ -0,0 +1,121 @@ +package eval.luv; + +import haxe.ds.Option; +import eval.luv.SockAddr; + +enum abstract UdpMembership(Int) { + var LEAVE_GROUP = 0; + var JOIN_GROUP = 1; +} + +enum abstract RecvFlag(Int) { + var PARTIAL = 0; + var MMSG_CHUNK = 1; + var MMSG_FREE = 2; +} + +/** + UDP sockets. + + @see https://aantron.github.io/luv/luv/Luv/UDP +**/ +@:using(eval.luv.Handle) +@:coreType abstract Udp to Handle to Handle.SocketHandle { + /** + Allocates and initializes a UDP socket. + + The handle should be cleaned up with `eval.luv.Handle.close` when no longer needed. + **/ + static public function init(loop:Loop, ?domain:AddressFamily, recvmmsg:Bool = false):Result; + + /** + Assigns an address to the UDP socket. + **/ + public function bind(addr:SockAddr, ipv6Only:Bool = false, reuseAddr:Bool = false):Result; + + /** + Assigns a peer address to the socket. + **/ + public function connect(addr:SockAddr):Result; + + /** + Retrieves the address assigned to the UDP socket. + **/ + public function getSockName():Result; + + /** + Sets multicast group membership. + **/ + public function setMembership(group:String, interfaceName:String, membership:UdpMembership):Result; + + /** + Sets source-specific multicast group membership. + **/ + public function setSourceMembership(group:String, interfaceName:String, source:String, membership:UdpMembership):Result; + + /** + Set multicast loopback. + **/ + public function setMulticastLoop(value:Bool):Result; + + /** + Set multicast TTL. + **/ + public function setMulticastTtl(value:Int):Result; + + /** + Sets the interface to be used for multicast. + **/ + public function setMulticastInterface(value:Int):Result; + + /** + Sets broadcast. + **/ + public function setBroadcast(value:Bool):Result; + + /** + Sets the TTL. + **/ + public function setTtl(value:Int):Result; + + /** + Sends a datagram. + + For connected UDP sockets, see `eval.luv.UDP.Connected.send`. + **/ + public function send(data:Array, addr:SockAddr, callback:(result:Result)->Void):Void; + + /** + Like `eval.luv.UDP.send`, but only attempts to send the datagram immediately. + **/ + public function trySend(data:Array, addr:SockAddr):Result; + + /** + Calls `callback` whenever a datagram is received on the UDP socket. + + @see https://aantron.github.io/luv/luv/Luv/UDP/index.html#val-recv_start + **/ + public function recvStart(callback:(result:Result<{data:Buffer, addr:Option, flags:Array}>, ?allocate:(size:Int)->Buffer)->Void):Void; + + /** + Stops the callback provided to `eval.luv.UDP.recvStart`. + **/ + public function recvStop():Result; + + /** + Evaluates to true if and only if the UDP was created with `recvmmsg = true` + and the platform supports recvmmsg(2). + **/ + public function usingRecvmmsg():Bool; + + /** + Number of bytes queued for sending. This field strictly shows how much + information is currently queued. + **/ + public function getSendQueueSize():Int; + + /** + Number of send requests currently in the queue awaiting to be processed. + **/ + public function getSendQueueCount():Int; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/luv/Version.hx b/build/linux64_569e52e/std/eval/luv/Version.hx new file mode 100644 index 0000000..804925e --- /dev/null +++ b/build/linux64_569e52e/std/eval/luv/Version.hx @@ -0,0 +1,44 @@ +package eval.luv; + +/** + Version information for the vendored libuv. + + @see https://aantron.github.io/luv/luv/Luv/Version +**/ +extern class Version { + /** + Returns the libuv version as a string. + **/ + static function string():String; + + /** + libuv major version number. + **/ + static final major:Int; + + /** + libuv minor version number. + **/ + static final minor:Int; + + /** + libuv patch version number. + **/ + static final patch:Int; + + /** + `true` if the libuv version is a release, and `false` if it is a development version. + This does not depend on Haxe compilation arguments and will almost always be `true`. + **/ + static final isRelease:Bool; + + /** + libuv version suffix for development releases. + **/ + static final suffix:String; + + /** + libuv version packed into a single integer. + **/ + static final hex:Int; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/eval/vm/Context.hx b/build/linux64_569e52e/std/eval/vm/Context.hx new file mode 100644 index 0000000..b5f7b36 --- /dev/null +++ b/build/linux64_569e52e/std/eval/vm/Context.hx @@ -0,0 +1,64 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package eval.vm; + +extern class Context { + static function addBreakpoint(file:String, line:Int):Void; + static function breakHere():Void; + static function callMacroApi(s:String):Dynamic; + + /** + Loads and returns a plugin from file `filePath`. + + If Haxe is built natively, the extension automatically defaults to `.cmxs`, + even if a different extension is provided in `filePath`. In bytecode mode, + the default extension is `.cmo`. + + Sample plugin: + + ```ocaml + open EvalValue + open EvalContext + open EvalEncode + + let add_int = vfun2 (fun v1 v2 -> match v1,v2 with + | VInt32 i1,VInt32 i2 -> vint32 (Int32.add i1 i2) + | _ -> exc_string "Expected int + int" + ) + ;; + EvalStdLib.StdContext.register ["add_int",add_int] + ``` + + Usage from Haxe: + + ```haxe + var module:TestPlugin = eval.vm.Context.loadPlugin("testPlugin.cmo"); + trace(module.add_int(4, 3)); + ``` + + Plugins have to be compiled with the same OCaml version as the Haxe compiler + and using the same Haxe version. If a plugin cannot be loaded, an exception + of type `String` is thrown. + **/ + static function loadPlugin(filePath:String):T; +} diff --git a/build/linux64_569e52e/std/eval/vm/Gc.hx b/build/linux64_569e52e/std/eval/vm/Gc.hx new file mode 100644 index 0000000..b52842b --- /dev/null +++ b/build/linux64_569e52e/std/eval/vm/Gc.hx @@ -0,0 +1,233 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package eval.vm; + +/** + The memory management counters are returned in a stat record. + The total amount of memory allocated by the program since it was started is (in words) minor_words + major_words - promoted_words. Multiply by the word size (4 on a 32-bit machine, 8 on a 64-bit machine) to get the number of bytes. +**/ +typedef Stat = { + /** + Number of words allocated in the minor heap since the program was started. This number is accurate in byte-code programs, but only an approximation in programs compiled to native code. + **/ + var minor_words:Float; + + /** + Number of words allocated in the minor heap that survived a minor collection and were moved to the major heap since the program was started. + **/ + var promoted_words:Float; + + /** + Number of words allocated in the major heap, including the promoted words, since the program was started. + **/ + var major_words:Float; + + /** + Number of minor collections since the program was started. + **/ + var minor_collections:Float; + + /** + Number of major collection cycles completed since the program was started. + **/ + var major_collections:Float; + + /** + Total size of the major heap, in words. + **/ + var heap_words:Int; + + /** + Number of contiguous pieces of memory that make up the major heap. + **/ + var heap_chunks:Int; + + /** + Number of words of live data in the major heap, including the header words. + **/ + var live_words:Int; + + /** + Number of live blocks in the major heap. + **/ + var live_blocks:Int; + + /** + Number of words in the free list. + **/ + var free_words:Int; + + /** + Number of blocks in the free list. + **/ + var free_blocks:Int; + + /** + Size (in words) of the largest block in the free list. + **/ + var largest_free:Int; + + /** + Number of wasted words due to fragmentation. These are 1-words free blocks placed between two live blocks. They are not available for allocation. + **/ + var fragments:Int; + + /** + Number of heap compactions since the program was started. + **/ + var compactions:Int; + + /** + Maximum size reached by the major heap, in words. + **/ + var top_heap_words:Int; + + /** + Current size of the stack, in words. + **/ + var stack_size:Int; +} + +/** + The GC parameters are given as a control record. Note that these parameters can also be initialised by setting the OCAMLRUNPARAM environment variable. See the documentation of ocamlrun. +**/ +typedef Control = { + /** + The size (in words) of the minor heap. Changing this parameter will trigger a minor collection. Default: 256k. + **/ + var minor_heap_size:Int; + + /** + How much to add to the major heap when increasing it. If this number is less than or equal to 1000, it is a percentage of the current heap size (i.e. setting it to 100 will double the heap size at each increase). If it is more than 1000, it is a fixed number of words that will be added to the heap. Default: 15. + **/ + var major_heap_increment:Int; + + /** + The major GC speed is computed from this parameter. This is the memory that will be "wasted" because the GC does not immediatly collect unreachable blocks. It is expressed as a percentage of the memory used for live data. The GC will work more (use more CPU time and collect blocks more eagerly) if space_overhead is smaller. Default: 80. + **/ + var space_overhead:Int; + + /** + This value controls the GC messages on standard error output. It is a sum of some of the following flags, to print messages on the corresponding events: + * 0x001 Start of major GC cycle. + * 0x002 Minor collection and major GC slice. + * 0x004 Growing and shrinking of the heap. + * 0x008 Resizing of stacks and memory manager tables. + * 0x010 Heap compaction. + * 0x020 Change of GC parameters. + * 0x040 Computation of major GC slice size. + * 0x080 Calling of finalisation functions. + * 0x100 Bytecode executable and shared library search at start-up. + * 0x200 Computation of compaction-triggering condition. + * 0x400 Output GC statistics at program exit. Default: 0. + **/ + var verbose:Int; + + /** + Heap compaction is triggered when the estimated amount of "wasted" memory is more than max_overhead percent of the amount of live data. If max_overhead is set to 0, heap compaction is triggered at the end of each major GC cycle (this setting is intended for testing purposes only). If max_overhead >= 1000000, compaction is never triggered. If compaction is permanently disabled, it is strongly suggested to set allocation_policy to 1. Default: 500. + **/ + var max_overhead:Int; + + /** + The maximum size of the stack (in words). This is only relevant to the byte-code runtime, as the native code runtime uses the operating system's stack. Default: 1024k. + **/ + var stack_limit:Int; + + /** + The policy used for allocating in the heap. Possible values are 0 and 1. 0 is the next-fit policy, which is quite fast but can result in fragmentation. 1 is the first-fit policy, which can be slower in some cases but can be better for programs with fragmentation problems. Default: 0. + **/ + var allocation_policy:Int; +} + +/** + Memory management control and statistics; finalised values. +**/ +extern class Gc { + /** + Return the total number of bytes allocated since the program was started. It is returned as a float to avoid overflow problems with int on 32-bit machines. + **/ + static function allocated_bytes():Float; + + /** + Perform a full major collection and compact the heap. Note that heap compaction is a lengthy operation. + **/ + static function compact():Void; + + /** + Return (minor_words, promoted_words, major_words). This function is as fast as quick_stat. + **/ + static function counters():{minor_words:Float, promoted_words:Float, major_words:Float}; + + /** + Registers f as a finalisation function for v. v must be heap-allocated. f will be called with v as argument at some point between the first time v becomes unreachable (including through weak pointers) and the time v is collected by the GC. Several functions can be registered for the same value, or even several instances of the same function. Each instance will be called once (or never, if the program terminates before v becomes unreachable). + The GC will call the finalisation functions in the order of deallocation. When several values become unreachable at the same time (i.e. during the same GC cycle), the finalisation functions will be called in the reverse order of the corresponding calls to finalise. If finalise is called in the same order as the values are allocated, that means each value is finalised before the values it depends upon. Of course, this becomes false if additional dependencies are introduced by assignments. + + In the presence of multiple OCaml threads it should be assumed that any particular finaliser may be executed in any of the threads. + **/ + static function finalise(f:T->Void, v:T):Void; + + /** + Do a minor collection, finish the current major collection cycle, and perform a complete new cycle. This will collect all currently unreachable blocks. + **/ + static function full_major():Void; + + /** + Return the current values of the GC parameters in a control record. + **/ + static function get():Control; + + /** + Do a minor collection and finish the current major collection cycle. + **/ + static function major():Void; + + /** + Do a minor collection and a slice of major collection. n is the size of the slice: the GC will do enough work to free (on average) n words of memory. If n = 0, the GC will try to do enough work to ensure that the next automatic slice has no work to do. This function returns an unspecified integer (currently: 0). + **/ + static function major_slice():Void; + + /** + Trigger a minor collection. + **/ + static function minor():Void; + + /** + Print the current values of the memory management counters (in human-readable form) into the channel argument. + **/ + static function print_stat(out_channel:haxe.io.Output):Void; + + /** + Same as stat except that live_words, live_blocks, free_words, free_blocks, largest_free, and fragments are set to 0. This function is much faster than stat because it does not need to go through the heap. + **/ + static function quick_stat():Stat; + + /** + Changes the GC parameters according to the control record r. + **/ + static function set(r:Control):Void; + + /** + Return the current values of the memory management counters in a stat record. This function examines every heap block to get the statistics. + **/ + static function stat():Stat; +} diff --git a/build/linux64_569e52e/std/eval/vm/NativeSocket.hx b/build/linux64_569e52e/std/eval/vm/NativeSocket.hx new file mode 100644 index 0000000..1943030 --- /dev/null +++ b/build/linux64_569e52e/std/eval/vm/NativeSocket.hx @@ -0,0 +1,46 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package eval.vm; + +import sys.net.Socket; + +extern class NativeSocket { + function new():Void; + function accept():NativeSocket; + function bind(host:Int, port:Int):Void; + function close():Void; + function connect(host:Int, port:Int):Void; + function host():{ip:Int, port:Int}; + function listen(connections:Int):Void; + function peer():{ip:Int, port:Int}; + function receive(buf:haxe.io.Bytes, pos:Int, len:Int):Int; + function receiveChar():Int; + function send(buf:haxe.io.Bytes, pos:Int, len:Int):Int; + function sendChar(char:Int):Void; + function setFastSend(b:Bool):Void; + function setTimeout(timeout:Float):Void; + function shutdown(read:Bool, write:Bool):Void; + + static function select(read:Array, write:Array, others:Array, + ?timeout:Float):{read:Array, write:Array, others:Array}; +} diff --git a/build/linux64_569e52e/std/eval/vm/NativeThread.hx b/build/linux64_569e52e/std/eval/vm/NativeThread.hx new file mode 100644 index 0000000..43f2217 --- /dev/null +++ b/build/linux64_569e52e/std/eval/vm/NativeThread.hx @@ -0,0 +1,82 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package eval.vm; + +extern class NativeThread { + /** + Creates a new thread that executes function `f`. + + Exceptions caused while executing `f` are printed to stderr and are not + propagated to the parent thread. + **/ + function new(f:Void->Void):Void; + + /** + Return the identifier of the given thread. A thread identifier is an integer + that identifies uniquely the thread. It can be used to build data structures + indexed by threads. + **/ + function id():Int; + + /** + Terminate prematurely the thread whose handle is given. This functionality is + available only with bytecode-level threads. + **/ + function kill():Int; + + /** + Suspends the execution of the calling thread for `f` seconds. The other program + threads continue to run during this time. + **/ + static function delay(f:Float):Void; + + /** + Terminate prematurely the currently executing thread. + **/ + static function exit():Void; + + /** + Suspends the execution of the calling thread until the thread `thread` has + terminated. + **/ + static function join(thread:NativeThread):Void; + + /** + Return the thread currently executing. + **/ + static function self():NativeThread; + + /** + Re-schedule the calling thread without suspending it. This function can be used + to give scheduling hints, telling the scheduler that now is a good time to switch + to other threads. + **/ + static function yield():Void; + + static function readMessage(block:Bool):T; + + function sendMessage(msg:T):Void; + + @:allow(sys.thread.Thread) + private var events(get,set):Null; +} diff --git a/build/linux64_569e52e/std/flash/AnyType.hx b/build/linux64_569e52e/std/flash/AnyType.hx new file mode 100644 index 0000000..0e35c32 --- /dev/null +++ b/build/linux64_569e52e/std/flash/AnyType.hx @@ -0,0 +1,9 @@ +package flash; + +/** + This type represents the Flash `*` type, which is + actually the absense of type. It can be used as a + type parameter for `flash.Vector` to represent the + native `Vector.<*>` type. +**/ +@:coreType abstract AnyType from Dynamic to Dynamic {} diff --git a/build/linux64_569e52e/std/flash/Boot.hx b/build/linux64_569e52e/std/flash/Boot.hx new file mode 100644 index 0000000..05c2b8b --- /dev/null +++ b/build/linux64_569e52e/std/flash/Boot.hx @@ -0,0 +1,390 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package flash; + +@:keep private class RealBoot extends Boot { + #if swc + public function new() { + super(); + } + + public static function initSwc(mc) { + flash.Lib.current = mc; + new RealBoot().init(); + } + #else + function new() { + super(); + if (flash.Lib.current == null) + flash.Lib.current = this; + start(); + } + #end +} + +@:dox(hide) +@:keep +class Boot extends flash.display.MovieClip { + static var tf:flash.text.TextField; + static var lines:Array; + static var lastError:flash.errors.Error; + + public static var skip_constructor = false; + + function start() { + #if dontWaitStage + init(); + #else + var c = flash.Lib.current; + try { + untyped if (c == this && c.stage != null && c.stage.align == "") + c.stage.align = cast "TOP_LEFT"; + } catch (e:Dynamic) { + // security error when loading from different domain + } + if (c.stage == null) + c.addEventListener(flash.events.Event.ADDED_TO_STAGE, doInitDelay); + else if (c.stage.stageWidth == 0 || c.stage.stageHeight == 0) + untyped __global__["flash.utils.setTimeout"](start, 1); + else + init(); + #end + } + + function doInitDelay(_) { + flash.Lib.current.removeEventListener(flash.events.Event.ADDED_TO_STAGE, doInitDelay); + start(); + } + + #if (swc && swf_protected) public #end function init() { + throw "assert"; + } + + static var IN_E = 0; + + public static function enum_to_string(e:{tag:String, params:Array}) { + if (e.params == null) + return e.tag; + var pstr = []; + if (IN_E > 15) { + pstr.push("..."); + } else { + IN_E++; + for (p in e.params) + pstr.push(__string_rec(p, "")); + IN_E--; + } + return e.tag + "(" + pstr.join(",") + ")"; + } + + public static function __instanceof(v:Dynamic, t:Dynamic) { + try { + if (t == Dynamic) + return v != null; + return untyped __is__(v, t); + } catch (e:Dynamic) {} + return false; + } + + public static function __clear_trace() { + if (tf == null) + return; + tf.parent.removeChild(tf); + tf = null; + lines = null; + } + + public static function __set_trace_color(rgb) { + var tf = getTrace(); + tf.textColor = rgb; + tf.filters = []; + } + + public static function getTrace() { + var mc = flash.Lib.current; + if (tf == null) { + tf = new flash.text.TextField(); + #if flash10_2 + var color = 0xFFFFFF, glow = 0; + if (mc.stage != null) { + glow = mc.stage.color; + color = 0xFFFFFF - glow; + } + tf.textColor = color; + tf.filters = [new flash.filters.GlowFilter(glow, 1, 2, 2, 20)]; + #end + var format = tf.getTextFormat(); + format.font = "_sans"; + tf.defaultTextFormat = format; + tf.selectable = false; + tf.width = if (mc.stage == null) 800 else mc.stage.stageWidth; + tf.autoSize = flash.text.TextFieldAutoSize.LEFT; + tf.mouseEnabled = false; + } + if (mc.stage == null) + mc.addChild(tf); + else + mc.stage.addChild(tf); // on top + return tf; + } + + public static function __trace(v:Dynamic, pos:haxe.PosInfos) { + var tf = getTrace(); + var pstr = if (pos == null) "(null)" else pos.fileName + ":" + pos.lineNumber; + if (lines == null) + lines = []; + var str = pstr + ": " + __string_rec(v, ""); + if (pos != null && pos.customParams != null) + for (v in pos.customParams) + str += "," + __string_rec(v, ""); + lines = lines.concat(str.split("\n")); + tf.text = lines.join("\n"); + var stage = flash.Lib.current.stage; + if (stage == null) + return; + while (lines.length > 1 && tf.height > stage.stageHeight) { + lines.shift(); + tf.text = lines.join("\n"); + } + } + + public static function __string_rec(v:Dynamic, str:String, maxRecursion:Int = 5) { + if (maxRecursion <= 0) { + return "<...>"; + } + var cname = untyped __global__["flash.utils.getQualifiedClassName"](v); + switch (cname) { + case "Object": + var k:Array = untyped __keys__(v); + var s = "{"; + var first = true; + for (i in 0...k.length) { + var key = k[i]; + if (key == "toString") + try + return v.toString() + catch (e:Dynamic) {} + if (first) + first = false; + else + s += ","; + s += " " + key + " : " + __string_rec(v[untyped key], str, maxRecursion - 1); + } + if (!first) + s += " "; + s += "}"; + return s; + case "Array": + if (v == Array) + return "#Array"; + var s = "["; + var i; + var first = true; + var a:Array = v; + for (i in 0...a.length) { + if (first) + first = false; + else + s += ","; + s += __string_rec(a[i], str, maxRecursion - 1); + } + return s + "]"; + default: + switch (untyped __typeof__(v)) { + case "function": return ""; + case "undefined": return "null"; + } + } + return new String(v); + } + + static public function fromCodePoint(code:Int) { + var o = new flash.utils.ByteArray(); + o.endian = LITTLE_ENDIAN; + o.writeShort((code >> 10) + 0xD7C0); + o.writeShort((code & 0x3FF) + 0xDC00); + o.position = 0; + return o.readMultiByte(4, "unicode"); + } + + static function __unprotect__(s:String) { + return s; + } + + static public function mapDynamic(d:Dynamic, f:Dynamic) { + if (Std.isOfType(d, Array)) { + return untyped d["mapHX"](f); + } else { + return untyped d["map"](f); + } + } + + static public function filterDynamic(d:Dynamic, f:Dynamic) { + if (Std.isOfType(d, Array)) { + return untyped d["filterHX"](f); + } else { + return untyped d["filter"](f); + } + } + + static function __init__() + untyped { + var d:Dynamic = Date; + d.now = function() { + return __new__(Date); + }; + d.fromTime = function(t) { + var d:Date = __new__(Date); + d.setTime(t); + return d; + }; + d.fromString = function(s:String) { + switch (s.length) { + case 8: // hh:mm:ss + var k = s.split(":"); + var d:Date = __new__(Date); + d.setTime(0); + d.setUTCHours(k[0]); + d.setUTCMinutes(k[1]); + d.setUTCSeconds(k[2]); + return d; + case 10: // YYYY-MM-DD + var k = s.split("-"); + return new Date(cast k[0], cast k[1] - 1, cast k[2], 0, 0, 0); + case 19: // YYYY-MM-DD hh:mm:ss + var k = s.split(" "); + var y = k[0].split("-"); + var t = k[1].split(":"); + return new Date(cast y[0], cast y[1] - 1, cast y[2], cast t[0], cast t[1], cast t[2]); + default: + throw "Invalid date format : " + s; + } + }; + d.prototype[#if no_flash_override "toStringHX" #else "toString" #end] = function() { + var date:Date = __this__; + var m = date.getMonth() + 1; + var d = date.getDate(); + var h = date.getHours(); + var mi = date.getMinutes(); + var s = date.getSeconds(); + return date.getFullYear() + "-" + (if (m < 10) "0" + m else "" + m) + "-" + (if (d < 10) "0" + d else "" + d) + " " + + (if (h < 10) "0" + h else "" + h) + ":" + (if (mi < 10) "0" + mi else "" + mi) + ":" + (if (s < 10) "0" + s else "" + s); + }; + var aproto = Array.prototype; + aproto.copy = function() { + return __this__.slice(); + }; + aproto.insert = function(i, x) { + __this__.splice(i, 0, x); + }; + aproto.contains = function(obj) { + return __this__.indexOf(obj) != -1; + } + aproto.remove = function(obj) { + var idx = __this__.indexOf(obj); + if (idx == -1) + return false; + #if flash19 + // removeAt is only available through as3 namespace and genswf9 will only generate it for a known Array, + // so we have to type it properly (thus the typecheck). See https://github.com/HaxeFoundation/haxe/issues/8612 + (__this__:Array).removeAt(idx); + #else + __this__.splice(idx, 1); + #end + return true; + } + aproto.iterator = function() { + return new haxe.iterators.ArrayIterator(cast __this__); + }; + aproto.keyValueIterator = function() { + return new haxe.iterators.ArrayKeyValueIterator(untyped __this__); + }; + aproto.resize = function(len) { + __this__.length = len; + }; + aproto.setPropertyIsEnumerable("copy", false); + aproto.setPropertyIsEnumerable("insert", false); + aproto.setPropertyIsEnumerable("contains", false); + aproto.setPropertyIsEnumerable("remove", false); + aproto.setPropertyIsEnumerable("iterator", false); + aproto.setPropertyIsEnumerable("keyValueIterator", false); + aproto.setPropertyIsEnumerable("resize", false); + #if no_flash_override + aproto.filterHX = function(f) { + var ret = []; + var i = 0; + var l = __this__.length; + while (i < l) { + if (f(__this__[i])) + ret.push(__this__[i]); + i++; + } + return ret; + }; + aproto.mapHX = function(f) { + var ret = []; + var i = 0; + var l = __this__.length; + while (i < l) { + ret.push(f(__this__[i])); + i++; + } + return ret; + }; + aproto.setPropertyIsEnumerable("mapHX", false); + aproto.setPropertyIsEnumerable("filterHX", false); + String.prototype.charCodeAtHX = function(i):Null { + #else + aproto["filter"] = function(f) { + var ret = []; + var i = 0; + var l = __this__.length; + while (i < l) { + if (f(__this__[i])) + ret.push(__this__[i]); + i++; + } + return ret; + }; + aproto["map"] = function(f) { + var ret = []; + var i = 0; + var l = __this__.length; + while (i < l) { + ret.push(f(__this__[i])); + i++; + } + return ret; + }; + aproto.setPropertyIsEnumerable("map", false); + aproto.setPropertyIsEnumerable("filter", false); + String.prototype.charCodeAt = function(i):Null { + #end + var s:String = __this__; + var x:Float = s.cca(i); + if (__global__["isNaN"](x)) + return null; + return Std.int(x); + }; + } +} diff --git a/build/linux64_569e52e/std/flash/Lib.hx b/build/linux64_569e52e/std/flash/Lib.hx new file mode 100644 index 0000000..d21f943 --- /dev/null +++ b/build/linux64_569e52e/std/flash/Lib.hx @@ -0,0 +1,109 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package flash; + +/** + Platform-specific Flash Library. Provides some platform-specific + functions for the Flash target. +**/ +class Lib { + public static var current:flash.display.MovieClip; + + public inline static function getTimer():Int { + return untyped __global__["flash.utils.getTimer"](); + } + + public static function eval(path:String):Dynamic { + var p = path.split("."); + var fields = new Array(); + var o:Dynamic = null; + while (p.length > 0) { + try { + o = untyped __global__["flash.utils.getDefinitionByName"](p.join(".")); + } catch (e:Dynamic) { + fields.unshift(p.pop()); + } + if (o != null) + break; + } + for (f in fields) { + if (o == null) + return null; + o = untyped o[f]; + } + return o; + } + + public static function getURL(url:flash.net.URLRequest, ?target:String) { + var f = untyped __global__["flash.net.navigateToURL"]; + if (target == null) + f(url); + else + (cast f)(url, target); + } + + public static function fscommand(cmd:String, ?param:String) { + untyped __global__["flash.system.fscommand"](cmd, if (param == null) "" else param); + } + + public static function trace(arg:Dynamic) { + untyped __global__["trace"](arg); + } + + public static function describeType(value:Dynamic):flash.xml.XML { + return untyped __global__["flash.utils.describeType"](value); + } + + public static function attach(name:String):flash.display.MovieClip { + var cl = untyped __as__(__global__["flash.utils.getDefinitionByName"](name), Class); + return untyped __new__(cl); + } + + public inline static function as(v:Dynamic, c:Class):Null { + return untyped __as__(v, c); + } + + public static function redirectTraces() { + if (flash.external.ExternalInterface.available) + haxe.Log.trace = traceToConsole; + } + + static function traceToConsole(v:Dynamic, ?inf:haxe.PosInfos) { + var type = if (inf != null && inf.customParams != null) inf.customParams[0] else null; + if (type != "warn" && type != "info" && type != "debug" && type != "error") + type = if (inf == null) "error" else "log"; + var str = if (inf == null) "" else inf.fileName + ":" + inf.lineNumber + " : "; + try + str += Std.string(v) + catch (e:Dynamic) + str += "????"; + str = str.split("\\").join("\\\\"); + flash.external.ExternalInterface.call("console." + type, str); + } + + public static var parseInt(get, never):(string:String, ?radix:Int) -> Float; + + extern static inline function get_parseInt():(string:String, ?radix:Int) -> Float { + return untyped __global__["parseInt"]; + } +} diff --git a/build/linux64_569e52e/std/flash/Memory.hx b/build/linux64_569e52e/std/flash/Memory.hx new file mode 100644 index 0000000..6dc6e82 --- /dev/null +++ b/build/linux64_569e52e/std/flash/Memory.hx @@ -0,0 +1,81 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package flash; + +extern class Memory { + static inline function select(b:flash.utils.ByteArray):Void { + flash.system.ApplicationDomain.currentDomain.domainMemory = b; + } + + static inline function setByte(addr:Int, v:Int):Void { + untyped __vmem_set__(0, addr, v); + } + + static inline function setI16(addr:Int, v:Int):Void { + untyped __vmem_set__(1, addr, v); + } + + static inline function setI32(addr:Int, v:Int):Void { + untyped __vmem_set__(2, addr, v); + } + + static inline function setFloat(addr:Int, v:Float):Void { + untyped __vmem_set__(3, addr, v); + } + + static inline function setDouble(addr:Int, v:Float):Void { + untyped __vmem_set__(4, addr, v); + } + + static inline function getByte(addr:Int):Int { + return untyped __vmem_get__(0, addr); + } + + static inline function getUI16(addr:Int):Int { + return untyped __vmem_get__(1, addr); + } + + static inline function getI32(addr:Int):Int { + return untyped __vmem_get__(2, addr); + } + + static inline function getFloat(addr:Int):Float { + return untyped __vmem_get__(3, addr); + } + + static inline function getDouble(addr:Int):Float { + return untyped __vmem_get__(4, addr); + } + + static inline function signExtend1(v:Int):Int { + return untyped __vmem_sign__(0, v); + } + + static inline function signExtend8(v:Int):Int { + return untyped __vmem_sign__(1, v); + } + + static inline function signExtend16(v:Int):Int { + return untyped __vmem_sign__(2, v); + } +} diff --git a/build/linux64_569e52e/std/flash/NativeXml.hx b/build/linux64_569e52e/std/flash/NativeXml.hx new file mode 100644 index 0000000..68b1d70 --- /dev/null +++ b/build/linux64_569e52e/std/flash/NativeXml.hx @@ -0,0 +1,418 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package flash; + +import flash.xml.XML; +import flash.xml.XMLList; + +extern enum XmlType {} +typedef NativeXml = Xml; + +class Xml { + public static var Element(default, null):XmlType; + public static var PCData(default, null):XmlType; + public static var CData(default, null):XmlType; + public static var Comment(default, null):XmlType; + public static var DocType(default, null):XmlType; + public static var ProcessingInstruction(default, null):XmlType; + public static var Document(default, null):XmlType; + + public var nodeType(default, null):XmlType; + public var nodeName(get, set):String; + public var nodeValue(get, set):String; + public var parent(get, null):Xml; + + var _node:flash.xml.XML; + + public static function parse(str:String):Xml { + XML.ignoreWhitespace = false; + XML.ignoreProcessingInstructions = false; + XML.ignoreComments = false; + var prefix = "<__document"; + var root = null; + while (root == null) { + try { + root = new flash.xml.XML(prefix + ">" + str + ""); + } catch (e:flash.errors.TypeError) { + // if we miss a namespace, let's add it ! + var r = ~/"([^"]+)"/; // " + if (e.errorID == 1083 && r.match(e.message)) { + var ns = r.matched(1); + prefix += " xmlns:" + ns + '="@' + ns + '"'; + } else + throw e; + } + } + return wrap(root, Xml.Document); + } + + @:keep static function compare(a:Xml, b:Xml):Bool { + return a == null ? b == null : (b == null ? false : a._node == b._node); + } + + private function new():Void {} + + public static function createElement(name:String):Xml { + return wrap(new flash.xml.XML("<" + name + "/>"), Xml.Element); + } + + public static function createPCData(data:String):Xml { + XML.ignoreWhitespace = false; + return wrap(new flash.xml.XML(data), Xml.PCData); + } + + public static function createCData(data:String):Xml { + return wrap(new flash.xml.XML(""), Xml.CData); + } + + public static function createComment(data:String):Xml { + XML.ignoreComments = false; + return wrap(new flash.xml.XML(""), Xml.Comment); + } + + public static function createDocType(data:String):Xml { + return wrap(new flash.xml.XML(""), Xml.DocType); + } + + public static function createProcessingInstruction(data:String):Xml { + XML.ignoreProcessingInstructions = false; + return wrap(new flash.xml.XML(""), Xml.ProcessingInstruction); + } + + public static function createDocument():Xml { + return wrap(new flash.xml.XML("<__document/>"), Xml.Document); + } + + private static function getNodeType(node:flash.xml.XML):XmlType { + switch (node.nodeKind()) { + case "element": + return Xml.Element; + case "text": + return Xml.PCData; + case "processing-instruction": + return Xml.ProcessingInstruction; + case "comment": + return Xml.Comment; + default: + throw "unimplemented node type: " + node.nodeType; + } + } + + private function get_nodeName():String { + if (nodeType != Xml.Element) + throw "bad nodeType"; + var ns = _node.namespace(); + return (ns.prefix == "") ? _node.localName() : ns.prefix + ":" + _node.localName(); + } + + private function set_nodeName(n:String):String { + if (nodeType != Xml.Element) + throw "bad nodeType"; + var ns = n.split(":"); + if (ns.length == 1) + _node.setLocalName(n); + else { + _node.setLocalName(ns[1]); + _node.setNamespace(_node.namespace(ns[0])); + } + return n; + } + + private function get_nodeValue():String { + var nodeType = nodeType; + if (nodeType == Xml.Element || nodeType == Xml.Document) + throw "bad nodeType"; + if (nodeType == Xml.Comment) + return _node.toString().substr(4, -7); + return _node.toString(); + } + + private function set_nodeValue(v:String):String { + var nodeType = nodeType; + var x = null; + if (nodeType == Xml.Element || nodeType == Xml.Document) + throw "bad nodeType"; + else if (nodeType == Xml.PCData) + x = createPCData(v); + else if (nodeType == Xml.CData) + x = createCData(v); + else if (nodeType == Xml.Comment) + x = createComment(v); + else if (nodeType == Xml.DocType) + x = createDocType(v); + else + x = createProcessingInstruction(v); + var p = _node.parent(); + if (p != null) { + p.insertChildAfter(_node, x._node); + var i = _node.childIndex(); + var children = p.children(); + untyped __delete__(children, Reflect.fields(children)[i]); + } + _node = x._node; + return v; + } + + private function get_parent():Xml { + var p = _node.parent(); + return p == null ? null : wrap(p); + } + + private static function wrap(node:XML, ?type:XmlType):Xml { + var x = new Xml(); + x._node = node; + x.nodeType = (type != null) ? type : getNodeType(node); + return x; + } + + private function wraps(xList:XMLList):Array { + var out = new Array(); + for (i in 0...xList.length()) + out.push(wrap(xList[i])); + return out; + } + + function getAttribNS(cur:XML, ns:Array):XMLList { + var n = cur.namespace(ns[0]); + if (n == null) { + var parent = cur.parent(); + if (parent == null) { + n = new flash.utils.Namespace(ns[0], "@" + ns[0]); + cur.addNamespace(n); + } else + return getAttribNS(parent, ns); + } + return _node.attribute(new flash.utils.QName(n, ns[1])); + } + + public function get(att:String):String { + if (nodeType != Xml.Element) + throw "bad nodeType"; + var ns = att.split(":"); + if (ns[0] == "xmlns") { + var n = _node.namespace((ns[1] == null) ? "" : ns[1]); + return (n == null) ? null : n.uri; + } + if (ns.length == 1) { + if (!Reflect.hasField(_node, "@" + att)) + return null; + return Reflect.field(_node, "@" + att); + } + var a = getAttribNS(_node, ns); + return (a.length() == 0) ? null : a.toString(); + } + + public function set(att:String, value:String):Void { + if (nodeType != Xml.Element) + throw "bad nodeType"; + var ns = att.split(":"); + if (ns[0] == "xmlns") { + var n = _node.namespace((ns[1] == null) ? "" : ns[1]); + if (n != null) + throw "Can't modify namespace"; + if (ns[1] == null) + throw "Can't set default namespace"; + _node.addNamespace(new flash.utils.Namespace(ns[1], value)); + return; + } + if (ns.length == 1) + Reflect.setField(_node, "@" + att, value); + else { + var a = getAttribNS(_node, ns); + untyped a[0] = value; + } + } + + public function remove(att:String):Void { + if (nodeType != Xml.Element) + throw "bad nodeType"; + var ns = att.split(":"); + if (ns.length == 1) + Reflect.deleteField(_node, "@" + att); + else + untyped __delete__(getAttribNS(_node, ns), 0); + } + + public function exists(att:String):Bool { + if (nodeType != Xml.Element) + throw "bad nodeType"; + var ns = att.split(":"); + if (ns[0] == "xmlns") + return _node.namespace((ns[1] == null) ? "" : ns[1]) != null; + if (ns.length == 1) + return Reflect.hasField(_node, "@" + att); + return getAttribNS(_node, ns).length() > 0; + } + + public function attributes():Iterator { + if (nodeType != Xml.Element) + throw "bad nodeType"; + var attributes:XMLList = _node.attributes(); + var names = Reflect.fields(attributes); + var cur = 0; + var nss = _node.namespaceDeclarations(); + return { + hasNext: function() { + return cur < names.length + nss.length; + }, + next: function() { + if (cur < names.length) { + return attributes[Std.parseInt(names[cur++])].name(); + } else { + var ns:flash.utils.Namespace = nss[cur++ - names.length]; + return "xmlns:" + ns.prefix; + } + } + } + } + + public function iterator():Iterator { + if (nodeType != Xml.Element && nodeType != Xml.Document) + throw "bad nodeType"; + var children:XMLList = _node.children(); + var wrappers:Array = wraps(children); + var cur = 0; + return { + hasNext: function() { + return cur < wrappers.length; + }, + next: function() { + return wrappers[cur++]; + } + }; + } + + public function elements():Iterator { + if (nodeType != Xml.Element && nodeType != Xml.Document) + throw "bad nodeType"; + var elements:XMLList = _node.elements(); + var wrappers:Array = wraps(elements); + var cur = 0; + return { + hasNext: function() { + return cur < wrappers.length; + }, + next: function() { + return wrappers[cur++]; + } + }; + } + + public function elementsNamed(name:String):Iterator { + if (nodeType != Xml.Element && nodeType != Xml.Document) + throw "bad nodeType"; + var ns = name.split(":"); + var elements:XMLList; + if (ns.length == 1) + elements = _node.elements(name); + else + elements = _node.elements(); + var wrappers:Array = wraps(elements); + if (ns.length != 1) + for (w in wrappers.copy()) + if (w._node.localName() != ns[1] || w._node.namespace().prefix != ns[0]) + wrappers.remove(w); + var cur = 0; + return { + hasNext: function() { + return cur < wrappers.length; + }, + next: function() { + return wrappers[cur++]; + } + }; + } + + public function firstChild():Xml { + if (nodeType != Xml.Element && nodeType != Xml.Document) + throw "bad nodeType"; + var children:XMLList = _node.children(); + if (children.length() == 0) + return null; + return wrap(children[0]); + } + + public function firstElement():Xml { + if (nodeType != Xml.Element && nodeType != Xml.Document) + throw "bad nodeType"; + var elements:XMLList = _node.elements(); + if (elements.length() == 0) + return null; + return wrap(elements[0]); + } + + public function addChild(x:Xml):Void { + if (nodeType != Xml.Element && nodeType != Xml.Document) + throw "bad nodeType"; + if (x.parent != null) + x.parent.removeChild(x); + var children:XMLList = _node.children(); + _node.appendChild(x._node); + } + + public function removeChild(x:Xml):Bool { + if (nodeType != Xml.Element && nodeType != Xml.Document) + throw "bad nodeType"; + var children:XMLList = _node.children(); + if (_node != x._node.parent()) + return false; + var i = x._node.childIndex(); + untyped __delete__(children, Reflect.fields(children)[i]); + return true; + } + + public function insertChild(x:Xml, pos:Int):Void { + if (nodeType != Xml.Element && nodeType != Xml.Document) + throw "bad nodeType"; + if (x.parent != null) + x.parent.removeChild(x); + var children:XMLList = _node.children(); + if (pos < children.length()) + _node.insertChildBefore(children[pos], x._node); + else + _node.appendChild(x._node); + } + + public function toString():String { + XML.prettyPrinting = false; + if (nodeType == Xml.Document) { + var str = _node.toXMLString(); + // remove <__document xmlns....>STR wrapper + str = str.substr(str.indexOf(">") + 1); + str = str.substr(0, str.length - 13); + return str; + } + return _node.toXMLString(); + } + + static function __init__():Void + untyped { + Element = "element"; + PCData = "pcdata"; + CData = "cdata"; + Comment = "comment"; + DocType = "doctype"; + ProcessingInstruction = "processingInstruction"; + Document = "document"; + } +} diff --git a/build/linux64_569e52e/std/flash/Vector.hx b/build/linux64_569e52e/std/flash/Vector.hx new file mode 100644 index 0000000..a4a96a5 --- /dev/null +++ b/build/linux64_569e52e/std/flash/Vector.hx @@ -0,0 +1,94 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package flash; + +/** + The Vector class is very similar to Array but is only supported by the Flash Player 10+ +**/ +@:require(flash10) extern class Vector implements ArrayAccess { + var length:Int; + var fixed:Bool; + + function new(?length:UInt, ?fixed:Bool):Void; + function concat(?a:Vector):Vector; + function join(sep:String):String; + function pop():Null; + function push(x:T):Int; + function reverse():Void; + function shift():Null; + function unshift(x:T):Void; + function slice(?pos:Int, ?end:Int):Vector; + function sort(f:T->T->Int):Void; + function splice(pos:Int, len:Int):Vector; + function toString():String; + function indexOf(x:T, ?from:Int):Int; + function lastIndexOf(x:T, ?from:Int):Int; + + #if flash19 + function insertAt(index:Int, element:T):Void; + #else + inline function insertAt(index:Int, element:T):Void { + (cast this).splice(index, 0, element); + } + #end + @:require(flash19) function removeAt(index:Int):T; + + inline static function ofArray(v:Array):Vector { + return untyped __vector__(v); + } + + inline static function convert(v:Vector):Vector { + return untyped __vector__(v); + } + + /** + Get a run-time value referencing the `Vector` class with concrete type parameters. + + Normally in Haxe, for most of the types, type parameters are eliminated at run-time, + so there is no way to check if a value is of a type with specific type parameters. + + However, on the Flash target, the `flash.Vector` values carry type parameter + information at run-time all the type-checks (such as `Std.isOfType` and `Std.downcast`) on them + must be done using a `Class` value that also carries the type parameters. However, + Haxe syntax does not allow creating such values and this function exists to mitigate + this limitation. + + It should be used as such: + ```haxe + var specificVectorType:Class> = Vector.typeReference(); + trace(Std.isOfType(vec, specificVectorType)); + ``` + or using the type-check syntax: + ```haxe + trace(Std.isOfType(vec, (Vector.typeReference() : Class>))); + ``` + + It's also helpful when working with native Flash libraries, that receive Class instances: + ```haxe + new Signal((Vector.typeReference() : Class>)); + ``` + **/ + inline static function typeReference():Class> { + return untyped __vector__(); + } +} diff --git a/build/linux64_569e52e/std/flash/_std/EReg.hx b/build/linux64_569e52e/std/flash/_std/EReg.hx new file mode 100644 index 0000000..fd7e37c --- /dev/null +++ b/build/linux64_569e52e/std/flash/_std/EReg.hx @@ -0,0 +1,123 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +@:coreApi class EReg { + var r:flash.utils.RegExp; + var result:Dynamic; + + public function new(r:String, opt:String):Void { + this.r = new flash.utils.RegExp(r, opt); + } + + public function match(s:String):Bool { + if (r.global) + r.lastIndex = 0; + result = r.exec(s); + return (result != null); + } + + public function matched(n:Int):String { + return if (result != null && n >= 0 && n < (result:Array).length) result[n] else throw "EReg::matched"; + } + + public function matchedLeft():String { + if (result == null) + throw "No string matched"; + var s:String = result.input; + return s.substr(0, result.index); + } + + public function matchedRight():String { + if (result == null) + throw "No string matched"; + var rl = (result.index : Int) + (result[0] : String).length; + var s:String = result.input; + return s.substr(rl, s.length - rl); + } + + public function matchedPos():{pos:Int, len:Int} { + if (result == null) + throw "No string matched"; + return {pos: result.index, len: (result[0] : String).length}; + } + + public function matchSub(s:String, pos:Int, len:Int = -1):Bool { + return if (r.global) { + r.lastIndex = pos; + result = r.exec(len < 0 ? s : s.substr(0, pos + len)); + var b = result != null; + if (b) { + result.input = s; + } + b; + } else { + var b = match(len < 0 ? s.substr(pos) : s.substr(pos, len)); + if (b) { + result.input = s; + result.index += pos; + } + b; + } + } + + public function split(s:String):Array { + // we can't use directly s.split because it's ignoring the 'g' flag + var d = "#__delim__#"; + var s:String = (s : Dynamic).replace(r, d); + return s.split(d); + } + + public function replace(s:String, by:String):String { + return (s : Dynamic).replace(r, by); + } + + public function map(s:String, f:EReg->String):String { + var offset = 0; + var buf = new StringBuf(); + var first = true; + do { + if (offset >= s.length) + break; + else if (!matchSub(s, offset)) { + buf.add(s.substr(offset)); + break; + } + var p = matchedPos(); + buf.add(s.substr(offset, p.pos - offset)); + buf.add(f(this)); + if (p.len == 0) { + buf.add(s.substr(p.pos, 1)); + offset = p.pos + 1; + } else + offset = p.pos + p.len; + first = false; + } while (r.global); + if (!r.global && offset > 0 && offset < s.length) + buf.add(s.substr(offset)); + return buf.toString(); + } + + public static inline function escape(s:String):String { + return (cast s).replace(escapeRe, "\\$&"); + } + + static var escapeRe = new flash.utils.RegExp("[.*+?^${}()|[\\]\\\\]", "g"); +} diff --git a/build/linux64_569e52e/std/flash/_std/Reflect.hx b/build/linux64_569e52e/std/flash/_std/Reflect.hx new file mode 100644 index 0000000..b4a9b8b --- /dev/null +++ b/build/linux64_569e52e/std/flash/_std/Reflect.hx @@ -0,0 +1,131 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +@:coreApi class Reflect { + public static function hasField(o:Dynamic, field:String):Bool + untyped { + return o.hasOwnProperty(field); + } + + public static function field(o:Dynamic, field:String):Dynamic + untyped { + return o != null && __in__(field, o) ? o[field] : null; + } + + public inline static function setField(o:Dynamic, field:String, value:Dynamic):Void + untyped { + o[field] = value; + } + + public static function getProperty(o:Dynamic, field:String):Dynamic + untyped { + if (o == null) + return null; + var getter = 'get_$field'; + if (__in__(getter, o)) { + return o[getter](); + } + return __in__(field, o) ? o[field] : null; + } + + public static function setProperty(o:Dynamic, field:String, value:Dynamic):Void + untyped { + var setter = 'set_$field'; + if (__in__(setter, o)) { + o[setter](value); + } else { + o[field] = value; + } + } + + public inline static function callMethod(o:Dynamic, func:haxe.Constraints.Function, args:Array):Dynamic + untyped { + return func.apply(o, args); + } + + public static function fields(o:Dynamic):Array + untyped { + if (o == null) + return new Array(); + var i = 0; + var a = []; + while (untyped __has_next__(o, i)) { + var prop = untyped __forin__(o, i); + if (o.hasOwnProperty(prop)) + a.push(prop); + } + return a; + } + + public static function isFunction(f:Dynamic):Bool + untyped { + return __typeof__(f) == "function"; + } + + public static function compare(a:T, b:T):Int { + var a:Dynamic = a; + var b:Dynamic = b; + return (a == b) ? 0 : ((a > b) ? 1 : -1); + } + + public static function compareMethods(f1:Dynamic, f2:Dynamic):Bool { + return f1 == f2; // VM-level closures + } + + public static function isObject(v:Dynamic):Bool + untyped { + if (v == null) + return false; + var t = __typeof__(v); + if (t == "object") { + return !isEnumValue(v); + } + return (t == "string"); + } + + public static function isEnumValue(v:Dynamic):Bool { + return try v.__enum__ == true catch (e:Dynamic) false; + } + + public static function deleteField(o:Dynamic, field:String):Bool + untyped { + if (o.hasOwnProperty(field) != true) + return false; + __delete__(o, field); + return true; + } + + public static function copy(o:Null):Null { + if (o == null) + return null; + var o2:Dynamic = {}; + for (f in Reflect.fields(o)) + Reflect.setField(o2, f, Reflect.field(o, f)); + return o2; + } + + @:overload(function(f:Array->Void):Dynamic {}) + public static function makeVarArgs(f:Array->Dynamic):Dynamic { + return function(__arguments__) { + return f(__arguments__); + }; + } +} diff --git a/build/linux64_569e52e/std/flash/_std/Std.hx b/build/linux64_569e52e/std/flash/_std/Std.hx new file mode 100644 index 0000000..1e409ff --- /dev/null +++ b/build/linux64_569e52e/std/flash/_std/Std.hx @@ -0,0 +1,66 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +import flash.Boot; + +@:coreApi class Std { + @:deprecated('Std.is is deprecated. Use Std.isOfType instead.') + public static inline function is(v:Dynamic, t:Dynamic):Bool { + return isOfType(v, t); + } + + public static function isOfType(v:Dynamic, t:Dynamic):Bool { + return flash.Boot.__instanceof(v, t); + } + + public static inline function downcast(value:T, c:Class):S { + return flash.Lib.as(value, c); + } + + @:deprecated('Std.instance() is deprecated. Use Std.downcast() instead.') + public static inline function instance(value:T, c:Class):S { + return downcast(value, c); + } + + public static function string(s:Dynamic):String { + return flash.Boot.__string_rec(s, ""); + } + + public inline static function int(x:Float):Int { + return untyped __int__(x); + } + + public static function parseInt(x:String):Null { + final v = flash.Lib.parseInt(x); + if (Math.isNaN(v)) + return null; + return cast v; + } + + public static function parseFloat(x:String):Float { + return untyped __global__["parseFloat"](x); + } + + public static function random(x:Int):Int { + return x <= 0 ? 0 : Math.floor(Math.random() * x); + } +} diff --git a/build/linux64_569e52e/std/flash/_std/String.hx b/build/linux64_569e52e/std/flash/_std/String.hx new file mode 100644 index 0000000..6893eb0 --- /dev/null +++ b/build/linux64_569e52e/std/flash/_std/String.hx @@ -0,0 +1,41 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +@:coreApi +extern class String { + var length(default, null):Int; + function new(string:String):Void; + function toUpperCase():String; + function toLowerCase():String; + function charAt(index:Int):String; + function charCodeAt(index:Int):Null; + function indexOf(str:String, ?startIndex:Int):Int; + function lastIndexOf(str:String, ?startIndex:Int):Int; + function split(delimiter:String):Array; + function substr(pos:Int, ?len:Int):String; + function substring(startIndex:Int, ?endIndex:Int):String; + function toString():String; + + @:pure static inline function fromCharCode(code:Int):String + untyped { + return code < 0x10000 ? String["fromCharCode"](code) : flash.Boot.fromCodePoint(code); + } +} diff --git a/build/linux64_569e52e/std/flash/_std/Type.hx b/build/linux64_569e52e/std/flash/_std/Type.hx new file mode 100644 index 0000000..5165b49 --- /dev/null +++ b/build/linux64_569e52e/std/flash/_std/Type.hx @@ -0,0 +1,308 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +enum ValueType { + TNull; + TInt; + TFloat; + TBool; + TObject; + TFunction; + TClass(c:Class); + TEnum(e:Enum); + TUnknown; +} + +@:coreApi class Type { + public static function getClass(o:T):Null> + untyped { + var cname = __global__["flash.utils.getQualifiedClassName"](o); + if (cname == "null" || cname == "Object" || cname == "int" || cname == "Number" || cname == "Boolean") + return null; + if (o.hasOwnProperty("prototype")) + return null; + var c = __as__(__global__["flash.utils.getDefinitionByName"](cname), Class); + if (c.__isenum) + return null; + return c; + } + + public static function getEnum(o:EnumValue):Enum + untyped { + var cname = __global__["flash.utils.getQualifiedClassName"](o); + if (cname == "null" || cname.substr(0, 8) == "builtin.") + return null; + // getEnum(Enum) should be null + if (o.hasOwnProperty("prototype")) + return null; + var c = __as__(__global__["flash.utils.getDefinitionByName"](cname), Class); + if (!c.__isenum) + return null; + return c; + } + + public static function getSuperClass(c:Class):Class + untyped { + var cname = __global__["flash.utils.getQualifiedSuperclassName"](c); + if (cname == null || cname == "Object") + return null; + return __as__(__global__["flash.utils.getDefinitionByName"](cname), Class); + } + + public static function getClassName(c:Class):String { + if (c == null) + return null; + var str:String = untyped __global__["flash.utils.getQualifiedClassName"](c); + switch (str) { + case "int": + return "Int"; + case "Number": + return "Float"; + case "Boolean": + return "Bool"; + case _: + var idx = str.lastIndexOf("::"); + if (idx == -1) { + return str; + } else { + return str.substring(0, idx) + "." + str.substring(idx + 2); + } + } + } + + public static function getEnumName(e:Enum):String { + return getClassName(cast e); + } + + public static function resolveClass(name:String):Class + untyped { + var cl:Class; + try { + cl = __as__(__global__["flash.utils.getDefinitionByName"](name), Class); + if (cl.__isenum) + return null; + return cl; // skip test below + } catch (e:Dynamic) { + switch (name) { + case "Int": + return Int; + case "Float": + return Float; + } + return null; + } + // ensure that this is a class + if (cl == null || cl.__name__ == null) + return null; + return cl; + } + + public static function resolveEnum(name:String):Enum + untyped { + var e:Dynamic; + try { + e = __global__["flash.utils.getDefinitionByName"](name); + if (!e.__isenum) + return null; + return e; + } catch (e:Dynamic) { + if (name == "Bool") + return Bool; + return null; + } + // ensure that this is an enum + if (e == null || e.__ename__ == null) + return null; + return e; + } + + public static function createInstance(cl:Class, args:Array):T + untyped { + return switch (args.length) { + case 0: __new__(cl); + case 1: __new__(cl, args[0]); + case 2: __new__(cl, args[0], args[1]); + case 3: __new__(cl, args[0], args[1], args[2]); + case 4: __new__(cl, args[0], args[1], args[2], args[3]); + case 5: __new__(cl, args[0], args[1], args[2], args[3], args[4]); + case 6: __new__(cl, args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: __new__(cl, args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + case 8: __new__(cl, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]); + case 9: __new__(cl, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]); + case 10: __new__(cl, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]); + case 11: __new__(cl, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10]); + case 12: __new__(cl, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11]); + case 13: __new__(cl, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12]); + case 14: __new__(cl, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], + args[13]); + default: throw "Too many arguments"; + } + } + + public static function createEmptyInstance(cl:Class):T + untyped { + try { + flash.Boot.skip_constructor = true; + var i = __new__(cl); + flash.Boot.skip_constructor = false; + return i; + } catch (e:Dynamic) { + flash.Boot.skip_constructor = false; + throw e; + } + return null; + } + + public static function createEnum(e:Enum, constr:String, ?params:Array):T { + var f:Dynamic = untyped e[constr]; + if (f == null) + throw "No such constructor " + constr; + if (Reflect.isFunction(f)) { + if (params == null) + throw "Constructor " + constr + " need parameters"; + return Reflect.callMethod(e, f, params); + } + if (params != null && params.length != 0) + throw "Constructor " + constr + " does not need parameters"; + return f; + } + + public static function createEnumIndex(e:Enum, index:Int, ?params:Array):T { + var c:String = (untyped e.__constructs__)[index]; + if (c == null) + throw index + " is not a valid enum constructor index"; + return createEnum(e, c, params); + } + + static function describe(t:Dynamic, fact:Bool):Array + untyped { + var fields = new Array(); + var xml:flash.xml.XML = __global__["flash.utils.describeType"](t); + if (fact) + xml = xml.factory[0]; + var methods = xml.child("method"); + for (i in 0...methods.length()) + fields.push(Std.string(methods[i].attribute("name"))); + var vars = xml.child("variable"); + for (i in 0...vars.length()) + fields.push(Std.string(vars[i].attribute("name"))); + var accs = xml.child("accessor"); + for (i in 0...accs.length()) + fields.push(Std.string(accs[i].attribute("name"))); + return fields; + } + + public static function getInstanceFields(c:Class):Array { + return describe(c, true); + } + + public static function getClassFields(c:Class):Array { + var a = describe(c, false); + a.remove("__construct__"); + a.remove("prototype"); + return a; + } + + public static function getEnumConstructs(e:Enum):Array { + var a:Array = untyped e.__constructs__; + return a.copy(); + } + + public static function typeof(v:Dynamic):ValueType + untyped { + var cname = __global__["flash.utils.getQualifiedClassName"](v); + switch (cname) { + case "null": + return TNull; + case "void": + return TNull; // undefined + case "int": + return TInt; + case "Number": + // integers >28 bits are stored as Numbers in avm2 + if ((v < -0x10000000 || v >= 0x10000000) && Std.int(v) == v) + return TInt; + return TFloat; + case "Boolean": + return TBool; + case "Object": + return TObject; + case "Function": + return TFunction; + default: + var c:Dynamic = null; + try { + c = __global__["flash.utils.getDefinitionByName"](cname); + if (v.hasOwnProperty("prototype")) + return TObject; + if (c.__isenum) + return TEnum(c); + return TClass(c); + } catch (e:Dynamic) { + if (cname == "builtin.as$0::MethodClosure" || cname.indexOf("-") != -1) + return TFunction; + return if (c == null) TFunction else TClass(c); + } + } + return null; + } + + public static function enumEq(a:T, b:T):Bool + untyped { + if (a == b) + return true; + try { + if (a.index != b.index) + return false; + var ap:Array = a.params; + var bp:Array = b.params; + for (i in 0...ap.length) + if (!enumEq(ap[i], bp[i])) + return false; + } catch (e:Dynamic) { + return false; + } + return true; + } + + public static function enumConstructor(e:EnumValue):String { + return untyped e.tag; + } + + public static function enumParameters(e:EnumValue):Array { + return untyped if (e.params == null) [] else e.params; + } + + extern public inline static function enumIndex(e:EnumValue):Int { + return untyped e.index; + } + + public static function allEnums(e:Enum):Array { + var all = []; + var cst:Array = untyped e.__constructs__; + for (c in cst) { + var v = Reflect.field(e, c); + if (!Reflect.isFunction(v)) + all.push(v); + } + return all; + } +} diff --git a/build/linux64_569e52e/std/flash/_std/haxe/Exception.hx b/build/linux64_569e52e/std/flash/_std/haxe/Exception.hx new file mode 100644 index 0000000..3768eaf --- /dev/null +++ b/build/linux64_569e52e/std/flash/_std/haxe/Exception.hx @@ -0,0 +1,100 @@ +package haxe; + +import flash.errors.Error; + +@:coreApi +class Exception extends NativeException { + public var message(get,never):String; + public var stack(get,never):CallStack; + public var previous(get,never):Null; + public var native(get,never):Any; + + @:noCompletion var __exceptionStack:Null; + @:noCompletion var __nativeStack:String; + @:noCompletion @:ifFeature("haxe.Exception.get_stack") var __skipStack:Int; + @:noCompletion var __nativeException:Error; + @:noCompletion var __previousException:Null; + + static function caught(value:Any):Exception { + if(Std.isOfType(value, Exception)) { + return value; + } else if(Std.isOfType(value, Error)) { + return new Exception((value:Error).message, null, value); + } else { + return new ValueException(value, null, value); + } + } + + static function thrown(value:Any):Any { + if(Std.isOfType(value, Exception)) { + return (value:Exception).native; + } else if(Std.isOfType(value, Error)) { + return value; + } else { + var e = new ValueException(value); + e.__shiftStack(); + return e; + } + } + + public function new(message:String, ?previous:Exception, ?native:Any) { + super(message); + __previousException = previous; + if(native != null && Std.isOfType(native, Error)) { + __nativeException = native; + __nativeStack = NativeStackTrace.normalize((native:Error).getStackTrace()); + } else { + __nativeException = cast this; + __nativeStack = NativeStackTrace.callStack(); + } + } + + function unwrap():Any { + return __nativeException; + } + + public function toString():String { + return message; + } + + public function details():String { + return inline CallStack.exceptionToString(this); + } + + @:noCompletion + @:ifFeature("haxe.Exception.get_stack") + inline function __shiftStack():Void { + __skipStack++; + } + + function get_message():String { + return (cast this:Error).message; + } + + function get_previous():Null { + return __previousException; + } + + final function get_native():Any { + return __nativeException; + } + + function get_stack():CallStack { + return switch __exceptionStack { + case null: + __exceptionStack = NativeStackTrace.toHaxe(__nativeStack, __skipStack); + case s: s; + } + } +} + +@:dox(hide) +@:native('flash.errors.Error') +extern class NativeException { + @:noCompletion @:flash.property private var errorID(get,never):Int; + // @:noCompletion private var message:Dynamic; + @:noCompletion private var name:Dynamic; + @:noCompletion private function new(?message:Dynamic, id:Dynamic = 0):Void; + @:noCompletion private function getStackTrace():String; + @:noCompletion private function get_errorID():Int; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/flash/_std/haxe/Http.hx b/build/linux64_569e52e/std/flash/_std/haxe/Http.hx new file mode 100644 index 0000000..df45418 --- /dev/null +++ b/build/linux64_569e52e/std/flash/_std/haxe/Http.hx @@ -0,0 +1,107 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +import haxe.io.Bytes; + +typedef Http = HttpFlash; + +class HttpFlash extends haxe.http.HttpBase { + var req:flash.net.URLLoader; + + /** + Cancels `this` Http request if `request` has been called and a response + has not yet been received. + **/ + public function cancel() { + if (req == null) + return; + req.close(); + req = null; + } + + public override function request(?post:Bool) { + responseAsString = null; + responseBytes = null; + var loader = req = new flash.net.URLLoader(); + loader.dataFormat = BINARY; + loader.addEventListener("complete", function(e) { + req = null; + success(Bytes.ofData(loader.data)); + }); + loader.addEventListener("httpStatus", function(e:flash.events.HTTPStatusEvent) { + // on Firefox 1.5, Flash calls onHTTPStatus with 0 (!??) + if (e.status != 0) + onStatus(e.status); + }); + loader.addEventListener("ioError", function(e:flash.events.IOErrorEvent) { + req = null; + responseBytes = Bytes.ofData(loader.data); + onError(e.text); + }); + loader.addEventListener("securityError", function(e:flash.events.SecurityErrorEvent) { + req = null; + onError(e.text); + }); + + // headers + var param = false; + var vars = new flash.net.URLVariables(); + for (p in params) { + param = true; + Reflect.setField(vars, p.name, p.value); + } + var small_url = url; + if (param && !post) { + var k = url.split("?"); + if (k.length > 1) { + small_url = k.shift(); + vars.decode(k.join("?")); + } + } + // Bug in flash player 9 ??? + small_url.split("xxx"); + + var request = new flash.net.URLRequest(small_url); + for (h in headers) + request.requestHeaders.push(new flash.net.URLRequestHeader(h.name, h.value)); + + if (postData != null) { + request.data = postData; + request.method = "POST"; + } else if (postBytes != null) { + request.data = postBytes.getData(); + request.method = "POST"; + } else { + request.data = vars; + request.method = if (post) "POST" else "GET"; + } + + try { + loader.load(request); + } catch (e:Dynamic) { + req = null; + onError("Exception: " + Std.string(e)); + } + } +} diff --git a/build/linux64_569e52e/std/flash/_std/haxe/Json.hx b/build/linux64_569e52e/std/flash/_std/haxe/Json.hx new file mode 100644 index 0000000..c56160a --- /dev/null +++ b/build/linux64_569e52e/std/flash/_std/haxe/Json.hx @@ -0,0 +1,46 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +@:coreApi +#if (!haxeJSON && flash11) +@:native("JSON") +extern +#end +class Json { + #if (haxeJSON || !flash11) + inline + #end + public static function parse(text:String):Dynamic + #if (!haxeJSON && flash11); #else { + return haxe.format.JsonParser.parse(text); + } #end + + #if (haxeJSON || !flash11) + inline + #end + public static function stringify(value:Dynamic, ?replacer:(key:Dynamic, value:Dynamic) -> Dynamic, ?space:String):String + #if (!haxeJSON && flash11); #else { + return haxe.format.JsonPrinter.print(value, replacer, space); + } #end +} diff --git a/build/linux64_569e52e/std/flash/_std/haxe/Log.hx b/build/linux64_569e52e/std/flash/_std/haxe/Log.hx new file mode 100644 index 0000000..7f32e7d --- /dev/null +++ b/build/linux64_569e52e/std/flash/_std/haxe/Log.hx @@ -0,0 +1,61 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +@:coreApi class Log { + public static function formatOutput(v:Dynamic, infos:PosInfos):String { + var str = Std.string(v); + if (infos == null) + return str; + var pstr = infos.fileName + ":" + infos.lineNumber; + if (infos != null && infos.customParams != null) + for (v in infos.customParams) + str += ", " + Std.string(v); + return pstr + ": " + str; + } + + public static dynamic function trace(v:Dynamic, ?infos:PosInfos):Void { + #if (fdb || native_trace) + var str = formatOutput(v, infos); + untyped __global__["trace"](str); + #else + flash.Boot.__trace(v, infos); + #end + } + + /** + Clears the trace output. + **/ + @:hack + public static dynamic function clear():Void { + flash.Boot.__clear_trace(); + } + + /** + Sets the color of the trace output to `rgb`. + **/ + @:hack + public static dynamic function setColor(rgb:Int):Void { + flash.Boot.__set_trace_color(rgb); + } +} diff --git a/build/linux64_569e52e/std/flash/_std/haxe/NativeStackTrace.hx b/build/linux64_569e52e/std/flash/_std/haxe/NativeStackTrace.hx new file mode 100644 index 0000000..e750887 --- /dev/null +++ b/build/linux64_569e52e/std/flash/_std/haxe/NativeStackTrace.hx @@ -0,0 +1,69 @@ +package haxe; + +import flash.errors.Error; +import haxe.CallStack.StackItem; + +/** + Do not use manually. +**/ +@:dox(hide) +@:noCompletion +@:allow(haxe.Exception) +class NativeStackTrace { + @:ifFeature('haxe.NativeStackTrace.exceptionStack') + static public inline function saveStack(e:Any):Void { + } + + static public inline function callStack():String { + return normalize(new Error().getStackTrace(), 1); + } + + static public function exceptionStack():String { + var err:Null = untyped flash.Boot.lastError; + return err == null ? '' : normalize(err.getStackTrace()); + } + + static public function toHaxe(native:String, skip:Int = 0):Array { + var a = new Array(); + var r = ~/at ([^\/]+?)\$?(\/[^\(]+)?\(\)(\[(.*?):([0-9]+)\])?/; + var rlambda = ~/^MethodInfo-([0-9]+)$/g; + var cnt = 0; + while (r.match(native)) { + native = r.matchedRight(); + if(skip > cnt++) { + continue; + } + var cl = r.matched(1).split("::").join("."); + var meth = r.matched(2); + var item; + if (meth == null) { + if (rlambda.match(cl)) + item = LocalFunction(Std.parseInt(rlambda.matched(1))); + else + item = Method(cl, "new"); + } else + item = Method(cl, meth.substring(1)); + if (r.matched(3) != null) + item = FilePos(item, r.matched(4), Std.parseInt(r.matched(5))); + a.push(item); + } + return a; + } + + static function normalize(stack:String, skipItems:Int = 0):String { + switch (stack:String).substring(0, 6) { + case 'Error:' | 'Error\n': skipItems += 1; + case _: + } + return skipLines(stack, skipItems); + } + + static function skipLines(stack:String, skip:Int, pos:Int = 0):String { + return if(skip > 0) { + pos = stack.indexOf('\n', pos); + return pos < 0 ? '' : skipLines(stack, --skip, pos + 1); + } else { + return stack.substring(pos); + } + } +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/flash/_std/haxe/Resource.hx b/build/linux64_569e52e/std/flash/_std/haxe/Resource.hx new file mode 100644 index 0000000..6021737 --- /dev/null +++ b/build/linux64_569e52e/std/flash/_std/haxe/Resource.hx @@ -0,0 +1,59 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +@:coreApi +class Resource { + static var content:Array<{name:String}>; + + public static function listNames():Array { + var names = new Array(); + for (x in content) + names.push(x.name); + return names; + } + + public static function getString(name:String):String { + var b = resolve(name); + return b == null ? null : b.readUTFBytes(b.length); + } + + public static function getBytes(name:String):haxe.io.Bytes { + var b = resolve(name); + return b == null ? null : haxe.io.Bytes.ofData(b); + } + + static function resolve(name:String):flash.utils.ByteArray { + try + untyped { + var c = __as__(__global__["flash.utils.getDefinitionByName"]("_res._" + name.split(".").join("_")), Class); + return __new__(c); + } catch (e:Dynamic) { + return null; + } + } + + static function __init__():Void { + content = untyped __resources__(); + } +} diff --git a/build/linux64_569e52e/std/flash/_std/haxe/ds/IntMap.hx b/build/linux64_569e52e/std/flash/_std/haxe/ds/IntMap.hx new file mode 100644 index 0000000..ebec393 --- /dev/null +++ b/build/linux64_569e52e/std/flash/_std/haxe/ds/IntMap.hx @@ -0,0 +1,142 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +@:coreApi class IntMap implements haxe.Constraints.IMap { + private var h:flash.utils.Dictionary; + + public function new():Void { + h = new flash.utils.Dictionary(); + } + + public inline function set(key:Int, value:T):Void { + untyped h[key] = value; + } + + public inline function get(key:Int):Null { + return untyped h[key]; + } + + public inline function exists(key:Int):Bool { + return untyped __in__(key, h); + } + + public function remove(key:Int):Bool { + if (!exists(key)) + return false; + untyped __delete__(h, key); + return true; + } + + public inline function keys():Iterator { + return new IntMapKeysIterator(h); + } + + public inline function iterator():Iterator { + return new IntMapValuesIterator(h); + } + + @:runtime public inline function keyValueIterator():KeyValueIterator { + return new haxe.iterators.MapKeyValueIterator(this); + } + + public function copy():IntMap { + var copied = new IntMap(); + for (key in keys()) + copied.set(key, get(key)); + return copied; + } + + public function toString():String { + var s = new StringBuf(); + s.add("["); + var it = keys(); + for (i in it) { + s.add(i); + s.add(" => "); + s.add(Std.string(get(i))); + if (it.hasNext()) + s.add(", "); + } + s.add("]"); + return s.toString(); + } + + public inline function clear():Void { + h = new flash.utils.Dictionary(); + } +} + +// this version uses __has_next__/__forin__ special SWF opcodes for iteration with no allocation + +@:allow(haxe.ds.IntMap) +private class IntMapKeysIterator { + var h:flash.utils.Dictionary; + var index:Int; + var nextIndex:Int; + + inline function new(h:flash.utils.Dictionary):Void { + this.h = h; + this.index = 0; + hasNext(); + } + + public inline function hasNext():Bool { + var h = h, index = index; // tmp vars required for __has_next + var n = untyped __has_next__(h, index); + this.nextIndex = index; // store next index + return n; + } + + public inline function next():Int { + var r:Int = untyped __forin__(h, nextIndex); + index = nextIndex; + return r; + } +} + +@:allow(haxe.ds.IntMap) +private class IntMapValuesIterator { + var h:flash.utils.Dictionary; + var index:Int; + var nextIndex:Int; + + inline function new(h:flash.utils.Dictionary):Void { + this.h = h; + this.index = 0; + hasNext(); + } + + public inline function hasNext():Bool { + var h = h, index = index; // tmp vars required for __has_next + var n = untyped __has_next__(h, index); + this.nextIndex = index; // store next index + return n; + } + + public inline function next():T { + var r = untyped __foreach__(h, nextIndex); + index = nextIndex; + return r; + } +} diff --git a/build/linux64_569e52e/std/flash/_std/haxe/ds/ObjectMap.hx b/build/linux64_569e52e/std/flash/_std/haxe/ds/ObjectMap.hx new file mode 100644 index 0000000..cb3f552 --- /dev/null +++ b/build/linux64_569e52e/std/flash/_std/haxe/ds/ObjectMap.hx @@ -0,0 +1,141 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +@:coreApi +class ObjectMap extends flash.utils.Dictionary implements haxe.Constraints.IMap { + public function new() { + super(false); + } + + public inline function get(key:K):Null { + return untyped this[key]; + } + + public inline function set(key:K, value:V):Void { + untyped this[key] = value; + } + + public inline function exists(key:K):Bool { + return untyped this[key] != null; + } + + public function remove(key:K):Bool { + var has = exists(key); + untyped __delete__(this, key); + return has; + } + + public function keys():Iterator { + return NativePropertyIterator.iterator(this); + } + + public function iterator():Iterator { + return NativeValueIterator.iterator(this); + } + + @:runtime public inline function keyValueIterator():KeyValueIterator { + return new haxe.iterators.MapKeyValueIterator(this); + } + + public function copy():ObjectMap { + var copied = new ObjectMap(); + for (key in keys()) + copied.set(key, get(key)); + return copied; + } + + public function toString():String { + var s = "["; + var it = keys(); + for (i in it) { + s += (s == "" ? "" : ",") + Std.string(i); + s += " => "; + s += Std.string(get(i)); + } + return s + "]"; + } + + public function clear():Void { + for (i in keys()) + untyped __delete__(this, i); + } +} + +private class NativePropertyIterator { + var collection:Dynamic; + var index:Int = 0; + + public static inline function iterator(collection:Dynamic):NativePropertyIterator { + var result = new NativePropertyIterator(); + result.collection = collection; + return result; + } + + function new() {} + + public inline function hasNext():Bool { + var c = collection; + var i = index; + var result = untyped __has_next__(c, i); + collection = c; + index = i; + return result; + } + + public inline function next():Dynamic { + var i = index; + var result = untyped __forin__(collection, i); + index = i; + return result; + } +} + +private class NativeValueIterator { + var collection:Dynamic; + var index:Int = 0; + + public static inline function iterator(collection:Dynamic):NativeValueIterator { + var result = new NativeValueIterator(); + result.collection = collection; + return result; + } + + function new() {} + + public inline function hasNext():Bool { + var c = collection; + var i = index; + var result = untyped __has_next__(c, i); + collection = c; + index = i; + return result; + } + + public inline function next():Dynamic { + var i = index; + var result = untyped __foreach__(collection, i); + index = i; + return result; + } +} diff --git a/build/linux64_569e52e/std/flash/_std/haxe/ds/StringMap.hx b/build/linux64_569e52e/std/flash/_std/haxe/ds/StringMap.hx new file mode 100644 index 0000000..960898b --- /dev/null +++ b/build/linux64_569e52e/std/flash/_std/haxe/ds/StringMap.hx @@ -0,0 +1,202 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +@:coreApi class StringMap implements haxe.Constraints.IMap { + private var h:Dynamic; + private var rh:Dynamic; + + static var reserved = {}; + + public function new():Void { + h = {}; + } + + inline function isReserved(key:String):Bool { + return untyped __in__(key, reserved); + } + + public inline function set(key:String, value:T):Void { + if (isReserved(key)) + setReserved(key, value); + else + untyped h[key] = value; + } + + public inline function get(key:String):Null { + if (isReserved(key)) + return getReserved(key); + return untyped h[key]; + } + + public inline function exists(key:String):Bool { + if (isReserved(key)) + return existsReserved(key); + return untyped __in__(key, h); + } + + function setReserved(key:String, value:T):Void { + if (rh == null) + rh = {}; + untyped rh["$" + key] = value; + } + + function getReserved(key:String):Null { + return rh == null ? null : untyped rh["$" + key]; + } + + function existsReserved(key:String):Bool { + if (rh == null) + return false; + return untyped __in__("$" + key, rh); + } + + public function remove(key:String):Bool { + if (isReserved(key)) { + key = "$" + key; + if (rh == null || !untyped __in__(key, rh)) + return false; + untyped __delete__(rh, key); + return true; + } else { + if (!untyped __in__(key, h)) + return false; + untyped __delete__(h, key); + return true; + } + } + + public inline function keys():Iterator { + return new StringMapKeysIterator(h, rh); + } + + public inline function iterator():Iterator { + return new StringMapValuesIterator(h, rh); + } + + @:runtime public inline function keyValueIterator():KeyValueIterator { + return new haxe.iterators.MapKeyValueIterator(this); + } + + public function copy():StringMap { + var copied = new StringMap(); + for (key in keys()) + copied.set(key, get(key)); + return copied; + } + + public function toString():String { + var s = new StringBuf(); + s.add("["); + var it = keys(); + for (i in it) { + s.add(i); + s.add(" => "); + s.add(Std.string(get(i))); + if (it.hasNext()) + s.add(", "); + } + s.add("]"); + return s.toString(); + } + + public inline function clear():Void { + h = {}; + rh = null; + } +} + +// this version uses __has_next__/__forin__ special SWF opcodes for iteration with no allocation + +@:allow(haxe.ds.StringMap) +private class StringMapKeysIterator { + var h:Dynamic; + var rh:Dynamic; + var index:Int; + var nextIndex:Int; + var isReserved:Bool; + + inline function new(h:Dynamic, rh:Dynamic):Void { + this.h = h; + this.rh = rh; + this.index = 0; + isReserved = false; + hasNext(); + } + + public inline function hasNext():Bool { + var h = h, index = index; // tmp vars required for __has_next + var n = untyped __has_next__(h, index); + if (!n && rh != null) { + h = this.h = rh; + index = this.index = 0; + rh = null; + isReserved = true; + n = untyped __has_next__(h, index); + } + this.nextIndex = index; // store next index + return n; + } + + public inline function next():String { + var r:String = untyped __forin__(h, nextIndex); + index = nextIndex; + if (isReserved) + r = r.substr(1); + return r; + } +} + +@:allow(haxe.ds.StringMap) +private class StringMapValuesIterator { + var h:Dynamic; + var rh:Dynamic; + var index:Int; + var nextIndex:Int; + + inline function new(h:Dynamic, rh:Dynamic):Void { + this.h = h; + this.rh = rh; + this.index = 0; + hasNext(); + } + + public inline function hasNext():Bool { + var h = h, index = index; // tmp vars required for __has_next + var n = untyped __has_next__(h, index); + if (!n && rh != null) { + h = this.h = rh; + index = this.index = 0; + rh = null; + n = untyped __has_next__(h, index); + } + this.nextIndex = index; // store next index + return n; + } + + public inline function next():T { + var r = untyped __foreach__(h, nextIndex); + index = nextIndex; + return r; + } +} diff --git a/build/linux64_569e52e/std/flash/_std/haxe/ds/UnsafeStringMap.hx b/build/linux64_569e52e/std/flash/_std/haxe/ds/UnsafeStringMap.hx new file mode 100644 index 0000000..daff473 --- /dev/null +++ b/build/linux64_569e52e/std/flash/_std/haxe/ds/UnsafeStringMap.hx @@ -0,0 +1,147 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +/** + This is similar to `StringMap` excepts that it does not sanitize the keys. + As a result, it will be faster to access the map for reading, but it might fail + with some reserved keys such as `constructor` or `prototype`. +**/ +class UnsafeStringMap implements haxe.Constraints.IMap { + private var h:flash.utils.Dictionary; + + public function new():Void { + h = new flash.utils.Dictionary(); + } + + public inline function set(key:String, value:T):Void { + untyped h[key] = value; + } + + public inline function get(key:String):Null { + return untyped h[key]; + } + + public inline function exists(key:String):Bool { + return untyped __in__(key, h); + } + + public function remove(key:String):Bool { + if (untyped !h.hasOwnProperty(key)) + return false; + untyped __delete__(h, key); + return true; + } + + public inline function keys():Iterator { + return new UnsafeStringMapKeysIterator(h); + } + + public inline function iterator():Iterator { + return new UnsafeStringMapValuesIterator(h); + } + + public inline function keyValueIterator():KeyValueIterator { + return new haxe.iterators.MapKeyValueIterator(this); + } + + public function copy():UnsafeStringMap { + var copied = new UnsafeStringMap(); + for (key in keys()) + copied.set(key, get(key)); + return copied; + } + + public function toString():String { + var s = new StringBuf(); + s.add("["); + var it = keys(); + for (i in it) { + s.add(i); + s.add(" => "); + s.add(Std.string(get(i))); + if (it.hasNext()) + s.add(", "); + } + s.add("]"); + return s.toString(); + } + + public inline function clear():Void { + h = new flash.utils.Dictionary(); + } +} + +// this version uses __has_next__/__forin__ special SWF opcodes for iteration with no allocation + +@:allow(haxe.ds.UnsafeStringMap) +private class UnsafeStringMapKeysIterator { + var h:flash.utils.Dictionary; + var index:Int; + var nextIndex:Int; + + inline function new(h:flash.utils.Dictionary):Void { + this.h = h; + this.index = 0; + hasNext(); + } + + public inline function hasNext():Bool { + var h = h, index = index; // tmp vars required for __has_next + var n = untyped __has_next__(h, index); + this.nextIndex = index; // store next index + return n; + } + + public inline function next():String { + var r:String = untyped __forin__(h, nextIndex); + index = nextIndex; + return r; + } +} + +@:allow(haxe.ds.UnsafeStringMap) +private class UnsafeStringMapValuesIterator { + var h:flash.utils.Dictionary; + var index:Int; + var nextIndex:Int; + + inline function new(h:flash.utils.Dictionary):Void { + this.h = h; + this.index = 0; + hasNext(); + } + + public inline function hasNext():Bool { + var h = h, index = index; // tmp vars required for __has_next + var n = untyped __has_next__(h, index); + this.nextIndex = index; // store next index + return n; + } + + public inline function next():T { + var r = untyped __foreach__(h, nextIndex); + index = nextIndex; + return r; + } +} diff --git a/build/linux64_569e52e/std/flash/_std/haxe/ds/WeakMap.hx b/build/linux64_569e52e/std/flash/_std/haxe/ds/WeakMap.hx new file mode 100644 index 0000000..c577a66 --- /dev/null +++ b/build/linux64_569e52e/std/flash/_std/haxe/ds/WeakMap.hx @@ -0,0 +1,141 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +@:coreApi +class WeakMap extends flash.utils.Dictionary implements haxe.Constraints.IMap { + public function new() { + super(true); + } + + public inline function get(key:K):Null { + return untyped this[key]; + } + + public inline function set(key:K, value:V):Void { + untyped this[key] = value; + } + + public inline function exists(key:K):Bool { + return untyped this[key] != null; + } + + public function remove(key:K):Bool { + var has = exists(key); + untyped __delete__(this, key); + return has; + } + + public function keys():Iterator { + return NativePropertyIterator.iterator(this); + } + + public function iterator():Iterator { + return NativeValueIterator.iterator(this); + } + + public inline function keyValueIterator():KeyValueIterator { + return new haxe.iterators.MapKeyValueIterator(this); + } + + public function copy():WeakMap { + var copied = new WeakMap(); + for (key in keys()) + copied.set(key, get(key)); + return copied; + } + + public function toString():String { + var s = "["; + var it = keys(); + for (i in it) { + s += (s == "" ? "" : ",") + Std.string(i); + s += " => "; + s += Std.string(get(i)); + } + return s + "]"; + } + + public function clear():Void { + for (i in keys()) + untyped __delete__(this, i); + } +} + +private class NativePropertyIterator { + var collection:Dynamic; + var index:Int = 0; + + public static inline function iterator(collection:Dynamic):NativePropertyIterator { + var result = new NativePropertyIterator(); + result.collection = collection; + return result; + } + + function new() {} + + public inline function hasNext():Bool { + var c = collection; + var i = index; + var result = untyped __has_next__(c, i); + collection = c; + index = i; + return result; + } + + public inline function next():Dynamic { + var i = index; + var result = untyped __forin__(collection, i); + index = i; + return result; + } +} + +private class NativeValueIterator { + var collection:Dynamic; + var index:Int = 0; + + public static inline function iterator(collection:Dynamic):NativeValueIterator { + var result = new NativeValueIterator(); + result.collection = collection; + return result; + } + + function new() {} + + public inline function hasNext():Bool { + var c = collection; + var i = index; + var result = untyped __has_next__(c, i); + collection = c; + index = i; + return result; + } + + public inline function next():Dynamic { + var i = index; + var result = untyped __foreach__(collection, i); + index = i; + return result; + } +} diff --git a/build/linux64_569e52e/std/flash/_std/haxe/zip/Compress.hx b/build/linux64_569e52e/std/flash/_std/haxe/zip/Compress.hx new file mode 100644 index 0000000..5f1ac98 --- /dev/null +++ b/build/linux64_569e52e/std/flash/_std/haxe/zip/Compress.hx @@ -0,0 +1,54 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.zip; + +@:coreApi +class Compress { + public function new(level:Int):Void { + throw new haxe.exceptions.NotImplementedException("Not implemented for this platform"); + } + + public function execute(src:haxe.io.Bytes, srcPos:Int, dst:haxe.io.Bytes, dstPos:Int):{done:Bool, read:Int, write:Int} { + return null; + } + + public function setFlushMode(f:FlushMode):Void {} + + public function close():Void {} + + public static function run(s:haxe.io.Bytes, level:Int):haxe.io.Bytes { + if (s.length == 0) { + // Flash returns 0 bytes for 0 length compress (which can't be decoded on other platforms...) + var b = haxe.io.Bytes.alloc(8); + b.set(0, 0x78); + b.set(1, 0xDA); + b.set(2, 0x03); + b.set(7, 0x01); + return b; + } + var tmp = new flash.utils.ByteArray(); + tmp.writeBytes(s.getData(), 0, s.length); + tmp.compress(); + return haxe.io.Bytes.ofData(tmp); + } +} diff --git a/build/linux64_569e52e/std/flash/_std/haxe/zip/Uncompress.hx b/build/linux64_569e52e/std/flash/_std/haxe/zip/Uncompress.hx new file mode 100644 index 0000000..27ba19b --- /dev/null +++ b/build/linux64_569e52e/std/flash/_std/haxe/zip/Uncompress.hx @@ -0,0 +1,45 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.zip; + +@:coreApi +class Uncompress { + public function new(?windowBits:Int):Void { + throw new haxe.exceptions.NotImplementedException("Not implemented for this platform"); + } + + public function execute(src:haxe.io.Bytes, srcPos:Int, dst:haxe.io.Bytes, dstPos:Int):{done:Bool, read:Int, write:Int} { + return null; + } + + public function setFlushMode(f:FlushMode):Void {} + + public function close():Void {} + + public static function run(src:haxe.io.Bytes, ?bufsize:Int):haxe.io.Bytes { + var tmp = new flash.utils.ByteArray(); + tmp.writeBytes(src.getData(), 0, src.length); + tmp.uncompress(); + return haxe.io.Bytes.ofData(tmp); + } +} diff --git a/build/linux64_569e52e/std/flash/accessibility/Accessibility.hx b/build/linux64_569e52e/std/flash/accessibility/Accessibility.hx new file mode 100644 index 0000000..e7e67e5 --- /dev/null +++ b/build/linux64_569e52e/std/flash/accessibility/Accessibility.hx @@ -0,0 +1,8 @@ +package flash.accessibility; + +extern class Accessibility { + @:flash.property static var active(get,never) : Bool; + private static function get_active() : Bool; + static function sendEvent(source : flash.display.DisplayObject, childID : UInt, eventType : UInt, nonHTML : Bool = false) : Void; + static function updateProperties() : Void; +} diff --git a/build/linux64_569e52e/std/flash/accessibility/AccessibilityImplementation.hx b/build/linux64_569e52e/std/flash/accessibility/AccessibilityImplementation.hx new file mode 100644 index 0000000..887f9d9 --- /dev/null +++ b/build/linux64_569e52e/std/flash/accessibility/AccessibilityImplementation.hx @@ -0,0 +1,21 @@ +package flash.accessibility; + +extern class AccessibilityImplementation { + var errno : UInt; + var stub : Bool; + function new() : Void; + function accDoDefaultAction(childID : UInt) : Void; + function accLocation(childID : UInt) : Dynamic; + function accSelect(operation : UInt, childID : UInt) : Void; + function getChildIDArray() : Array; + function get_accDefaultAction(childID : UInt) : String; + function get_accFocus() : UInt; + function get_accName(childID : UInt) : String; + function get_accRole(childID : UInt) : UInt; + function get_accSelection() : Array; + function get_accState(childID : UInt) : UInt; + function get_accValue(childID : UInt) : String; + function get_selectionActiveIndex() : Dynamic; + function get_selectionAnchorIndex() : Dynamic; + function isLabeledBy(labelBounds : flash.geom.Rectangle) : Bool; +} diff --git a/build/linux64_569e52e/std/flash/accessibility/AccessibilityProperties.hx b/build/linux64_569e52e/std/flash/accessibility/AccessibilityProperties.hx new file mode 100644 index 0000000..3a73bd5 --- /dev/null +++ b/build/linux64_569e52e/std/flash/accessibility/AccessibilityProperties.hx @@ -0,0 +1,11 @@ +package flash.accessibility; + +extern class AccessibilityProperties { + var description : String; + var forceSimple : Bool; + var name : String; + var noAutoLabeling : Bool; + var shortcut : String; + var silent : Bool; + function new() : Void; +} diff --git a/build/linux64_569e52e/std/flash/accessibility/ISearchableText.hx b/build/linux64_569e52e/std/flash/accessibility/ISearchableText.hx new file mode 100644 index 0000000..976eca4 --- /dev/null +++ b/build/linux64_569e52e/std/flash/accessibility/ISearchableText.hx @@ -0,0 +1,6 @@ +package flash.accessibility; + +@:require(flash10_1) extern interface ISearchableText { + @:flash.property var searchText(get,never) : String; + private function get_searchText() : String; +} diff --git a/build/linux64_569e52e/std/flash/accessibility/ISimpleTextSelection.hx b/build/linux64_569e52e/std/flash/accessibility/ISimpleTextSelection.hx new file mode 100644 index 0000000..3f32d93 --- /dev/null +++ b/build/linux64_569e52e/std/flash/accessibility/ISimpleTextSelection.hx @@ -0,0 +1,8 @@ +package flash.accessibility; + +@:require(flash10_1) extern interface ISimpleTextSelection { + @:flash.property var selectionActiveIndex(get,never) : Int; + @:flash.property var selectionAnchorIndex(get,never) : Int; + private function get_selectionActiveIndex() : Int; + private function get_selectionAnchorIndex() : Int; +} diff --git a/build/linux64_569e52e/std/flash/automation/ActionGenerator.hx b/build/linux64_569e52e/std/flash/automation/ActionGenerator.hx new file mode 100644 index 0000000..bb0cb60 --- /dev/null +++ b/build/linux64_569e52e/std/flash/automation/ActionGenerator.hx @@ -0,0 +1,7 @@ +package flash.automation; + +@:require(flash10_1) extern class ActionGenerator { + function new() : Void; + function generateAction(action : AutomationAction) : Void; + function generateActions(a : Array) : Void; +} diff --git a/build/linux64_569e52e/std/flash/automation/AutomationAction.hx b/build/linux64_569e52e/std/flash/automation/AutomationAction.hx new file mode 100644 index 0000000..31e68d5 --- /dev/null +++ b/build/linux64_569e52e/std/flash/automation/AutomationAction.hx @@ -0,0 +1,8 @@ +package flash.automation; + +@:require(flash10_1) extern class AutomationAction { + @:flash.property var type(get,set) : String; + function new() : Void; + private function get_type() : String; + private function set_type(value : String) : String; +} diff --git a/build/linux64_569e52e/std/flash/automation/Configuration.hx b/build/linux64_569e52e/std/flash/automation/Configuration.hx new file mode 100644 index 0000000..dbc6a2a --- /dev/null +++ b/build/linux64_569e52e/std/flash/automation/Configuration.hx @@ -0,0 +1,9 @@ +package flash.automation; + +@:require(flash10_1) extern class Configuration { + @:flash.property static var deviceConfiguration(get,set) : String; + @:flash.property static var testAutomationConfiguration(get,never) : String; + private static function get_deviceConfiguration() : String; + private static function get_testAutomationConfiguration() : String; + private static function set_deviceConfiguration(value : String) : String; +} diff --git a/build/linux64_569e52e/std/flash/automation/KeyboardAutomationAction.hx b/build/linux64_569e52e/std/flash/automation/KeyboardAutomationAction.hx new file mode 100644 index 0000000..4042474 --- /dev/null +++ b/build/linux64_569e52e/std/flash/automation/KeyboardAutomationAction.hx @@ -0,0 +1,10 @@ +package flash.automation; + +@:require(flash10_1) extern class KeyboardAutomationAction extends AutomationAction { + @:flash.property var keyCode(get,set) : UInt; + function new(type : String, keyCode : UInt = 0) : Void; + private function get_keyCode() : UInt; + private function set_keyCode(value : UInt) : UInt; + static final KEY_DOWN : String; + static final KEY_UP : String; +} diff --git a/build/linux64_569e52e/std/flash/automation/MouseAutomationAction.hx b/build/linux64_569e52e/std/flash/automation/MouseAutomationAction.hx new file mode 100644 index 0000000..260a735 --- /dev/null +++ b/build/linux64_569e52e/std/flash/automation/MouseAutomationAction.hx @@ -0,0 +1,22 @@ +package flash.automation; + +@:require(flash10_1) extern class MouseAutomationAction extends AutomationAction { + @:flash.property var delta(get,set) : Int; + @:flash.property var stageX(get,set) : Float; + @:flash.property var stageY(get,set) : Float; + function new(type : String, stageX : Float = 0, stageY : Float = 0, delta : Int = 0) : Void; + private function get_delta() : Int; + private function get_stageX() : Float; + private function get_stageY() : Float; + private function set_delta(value : Int) : Int; + private function set_stageX(value : Float) : Float; + private function set_stageY(value : Float) : Float; + static final MIDDLE_MOUSE_DOWN : String; + static final MIDDLE_MOUSE_UP : String; + static final MOUSE_DOWN : String; + static final MOUSE_MOVE : String; + static final MOUSE_UP : String; + static final MOUSE_WHEEL : String; + static final RIGHT_MOUSE_DOWN : String; + static final RIGHT_MOUSE_UP : String; +} diff --git a/build/linux64_569e52e/std/flash/automation/StageCapture.hx b/build/linux64_569e52e/std/flash/automation/StageCapture.hx new file mode 100644 index 0000000..81aca82 --- /dev/null +++ b/build/linux64_569e52e/std/flash/automation/StageCapture.hx @@ -0,0 +1,26 @@ +package flash.automation; + +@:require(flash10_1) extern class StageCapture extends flash.events.EventDispatcher { + @:flash.property var capturePTS(get,set) : Float; + @:flash.property var captureSource(get,set) : String; + @:flash.property var clipRect(get,set) : flash.geom.Rectangle; + @:flash.property var fileNameBase(get,set) : String; + function new() : Void; + function cancel() : Void; + function capture(type : String) : Void; + function captureBitmapData() : flash.display.BitmapData; + private function get_capturePTS() : Float; + private function get_captureSource() : String; + private function get_clipRect() : flash.geom.Rectangle; + private function get_fileNameBase() : String; + private function set_capturePTS(value : Float) : Float; + private function set_captureSource(value : String) : String; + private function set_clipRect(value : flash.geom.Rectangle) : flash.geom.Rectangle; + private function set_fileNameBase(value : String) : String; + static final CURRENT : String; + static final MULTIPLE : String; + static final NEXT : String; + static final RASTER : String; + static final SCREEN : String; + static final STAGE : String; +} diff --git a/build/linux64_569e52e/std/flash/automation/StageCaptureEvent.hx b/build/linux64_569e52e/std/flash/automation/StageCaptureEvent.hx new file mode 100644 index 0000000..dd0158a --- /dev/null +++ b/build/linux64_569e52e/std/flash/automation/StageCaptureEvent.hx @@ -0,0 +1,12 @@ +package flash.automation; + +@:require(flash10_1) extern class StageCaptureEvent extends flash.events.Event { + @:flash.property var checksum(get,never) : UInt; + @:flash.property var pts(get,never) : Float; + @:flash.property var url(get,never) : String; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?url : String, checksum : UInt = 0, pts : Float = 0) : Void; + private function get_checksum() : UInt; + private function get_pts() : Float; + private function get_url() : String; + static final CAPTURE : String; +} diff --git a/build/linux64_569e52e/std/flash/concurrent/Condition.hx b/build/linux64_569e52e/std/flash/concurrent/Condition.hx new file mode 100644 index 0000000..3d9dcda --- /dev/null +++ b/build/linux64_569e52e/std/flash/concurrent/Condition.hx @@ -0,0 +1,12 @@ +package flash.concurrent; + +@:require(flash11_4) extern final class Condition { + @:flash.property var mutex(get,never) : Mutex; + function new(mutex : Mutex) : Void; + private function get_mutex() : Mutex; + function notify() : Void; + function notifyAll() : Void; + function wait(timeout : Float = -1) : Bool; + @:flash.property static var isSupported(get,never) : Bool; + private static function get_isSupported() : Bool; +} diff --git a/build/linux64_569e52e/std/flash/concurrent/Mutex.hx b/build/linux64_569e52e/std/flash/concurrent/Mutex.hx new file mode 100644 index 0000000..db50005 --- /dev/null +++ b/build/linux64_569e52e/std/flash/concurrent/Mutex.hx @@ -0,0 +1,10 @@ +package flash.concurrent; + +@:require(flash11_4) extern final class Mutex { + function new() : Void; + function lock() : Void; + function tryLock() : Bool; + function unlock() : Void; + @:flash.property static var isSupported(get,never) : Bool; + private static function get_isSupported() : Bool; +} diff --git a/build/linux64_569e52e/std/flash/desktop/Clipboard.hx b/build/linux64_569e52e/std/flash/desktop/Clipboard.hx new file mode 100644 index 0000000..6fba4c5 --- /dev/null +++ b/build/linux64_569e52e/std/flash/desktop/Clipboard.hx @@ -0,0 +1,14 @@ +package flash.desktop; + +@:require(flash10) extern class Clipboard { + @:flash.property var formats(get,never) : Array; + function clear() : Void; + function clearData(format : ClipboardFormats) : Void; + function getData(format : ClipboardFormats, ?transferMode : ClipboardTransferMode) : flash.utils.Object; + private function get_formats() : Array; + function hasFormat(format : ClipboardFormats) : Bool; + function setData(format : ClipboardFormats, data : flash.utils.Object, serializable : Bool = true) : Bool; + function setDataHandler(format : ClipboardFormats, handler : flash.utils.Function, serializable : Bool = true) : Bool; + @:flash.property static var generalClipboard(get,never) : Clipboard; + private static function get_generalClipboard() : Clipboard; +} diff --git a/build/linux64_569e52e/std/flash/desktop/ClipboardFormats.hx b/build/linux64_569e52e/std/flash/desktop/ClipboardFormats.hx new file mode 100644 index 0000000..3f6e0b1 --- /dev/null +++ b/build/linux64_569e52e/std/flash/desktop/ClipboardFormats.hx @@ -0,0 +1,15 @@ +package flash.desktop; + +@:native("flash.desktop.ClipboardFormats") @:require(flash10) extern enum abstract ClipboardFormats(String) { + var AIR_PREFIX; + var BITMAP_FORMAT; + var FILE_LIST_FORMAT; + var FILE_PROMISE_LIST_FORMAT; + var FLASH_PREFIX; + var HTML_FORMAT; + var REFERENCE_PREFIX; + var RICH_TEXT_FORMAT; + var SERIALIZATION_PREFIX; + var TEXT_FORMAT; + var URL_FORMAT; +} diff --git a/build/linux64_569e52e/std/flash/desktop/ClipboardTransferMode.hx b/build/linux64_569e52e/std/flash/desktop/ClipboardTransferMode.hx new file mode 100644 index 0000000..52c05dd --- /dev/null +++ b/build/linux64_569e52e/std/flash/desktop/ClipboardTransferMode.hx @@ -0,0 +1,8 @@ +package flash.desktop; + +@:native("flash.desktop.ClipboardTransferMode") @:require(flash10) extern enum abstract ClipboardTransferMode(String) { + var CLONE_ONLY; + var CLONE_PREFERRED; + var ORIGINAL_ONLY; + var ORIGINAL_PREFERRED; +} diff --git a/build/linux64_569e52e/std/flash/display/AVLoader.hx b/build/linux64_569e52e/std/flash/display/AVLoader.hx new file mode 100644 index 0000000..4d47637 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/AVLoader.hx @@ -0,0 +1,5 @@ +package flash.display; + +extern class AVLoader extends Loader { + function new() : Void; +} diff --git a/build/linux64_569e52e/std/flash/display/AVM1Movie.hx b/build/linux64_569e52e/std/flash/display/AVM1Movie.hx new file mode 100644 index 0000000..f035bb6 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/AVM1Movie.hx @@ -0,0 +1,7 @@ +package flash.display; + +extern class AVM1Movie extends DisplayObject { + function new() : Void; + function addCallback(functionName : String, closure : flash.utils.Function) : Void; + function call(functionName : String, restArgs : haxe.extern.Rest) : Dynamic; +} diff --git a/build/linux64_569e52e/std/flash/display/ActionScriptVersion.hx b/build/linux64_569e52e/std/flash/display/ActionScriptVersion.hx new file mode 100644 index 0000000..497b372 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/ActionScriptVersion.hx @@ -0,0 +1,6 @@ +package flash.display; + +@:native("flash.display.ActionScriptVersion") extern enum abstract ActionScriptVersion(UInt) { + var ACTIONSCRIPT2; + var ACTIONSCRIPT3; +} diff --git a/build/linux64_569e52e/std/flash/display/Bitmap.hx b/build/linux64_569e52e/std/flash/display/Bitmap.hx new file mode 100644 index 0000000..b32e9aa --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/Bitmap.hx @@ -0,0 +1,14 @@ +package flash.display; + +extern class Bitmap extends DisplayObject { + @:flash.property var bitmapData(get,set) : BitmapData; + @:flash.property var pixelSnapping(get,set) : PixelSnapping; + @:flash.property var smoothing(get,set) : Bool; + function new(?bitmapData : BitmapData, ?pixelSnapping : PixelSnapping, smoothing : Bool = false) : Void; + private function get_bitmapData() : BitmapData; + private function get_pixelSnapping() : PixelSnapping; + private function get_smoothing() : Bool; + private function set_bitmapData(value : BitmapData) : BitmapData; + private function set_pixelSnapping(value : PixelSnapping) : PixelSnapping; + private function set_smoothing(value : Bool) : Bool; +} diff --git a/build/linux64_569e52e/std/flash/display/BitmapCompressColorSpace.hx b/build/linux64_569e52e/std/flash/display/BitmapCompressColorSpace.hx new file mode 100644 index 0000000..956e78f --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/BitmapCompressColorSpace.hx @@ -0,0 +1,8 @@ +package flash.display; + +@:native("flash.display.BitmapCompressColorSpace") extern enum abstract BitmapCompressColorSpace(String) { + var COLORSPACE_4_2_0; + var COLORSPACE_4_2_2; + var COLORSPACE_4_4_4; + var COLORSPACE_AUTO; +} diff --git a/build/linux64_569e52e/std/flash/display/BitmapData.hx b/build/linux64_569e52e/std/flash/display/BitmapData.hx new file mode 100644 index 0000000..3b7788f --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/BitmapData.hx @@ -0,0 +1,47 @@ +package flash.display; + +extern class BitmapData implements IBitmapDrawable { + @:flash.property var height(get,never) : Int; + @:flash.property var rect(get,never) : flash.geom.Rectangle; + @:flash.property var transparent(get,never) : Bool; + @:flash.property var width(get,never) : Int; + function new(width : Int, height : Int, transparent : Bool = true, fillColor : UInt = 0xFFFFFFFF) : Void; + function applyFilter(sourceBitmapData : BitmapData, sourceRect : flash.geom.Rectangle, destPoint : flash.geom.Point, filter : flash.filters.BitmapFilter) : Void; + function clone() : BitmapData; + function colorTransform(rect : flash.geom.Rectangle, colorTransform : flash.geom.ColorTransform) : Void; + function compare(otherBitmapData : BitmapData) : flash.utils.Object; + function copyChannel(sourceBitmapData : BitmapData, sourceRect : flash.geom.Rectangle, destPoint : flash.geom.Point, sourceChannel : UInt, destChannel : UInt) : Void; + function copyPixels(sourceBitmapData : BitmapData, sourceRect : flash.geom.Rectangle, destPoint : flash.geom.Point, ?alphaBitmapData : BitmapData, ?alphaPoint : flash.geom.Point, mergeAlpha : Bool = false) : Void; + @:require(flash11_4) function copyPixelsToByteArray(rect : flash.geom.Rectangle, data : flash.utils.ByteArray) : Void; + function dispose() : Void; + function draw(source : IBitmapDrawable, ?matrix : flash.geom.Matrix, ?colorTransform : flash.geom.ColorTransform, ?blendMode : BlendMode, ?clipRect : flash.geom.Rectangle, smoothing : Bool = false) : Void; + @:require(flash11_3) function drawWithQuality(source : IBitmapDrawable, ?matrix : flash.geom.Matrix, ?colorTransform : flash.geom.ColorTransform, ?blendMode : BlendMode, ?clipRect : flash.geom.Rectangle, smoothing : Bool = false, ?quality : StageQuality) : Void; + @:require(flash11_3) function encode(rect : flash.geom.Rectangle, compressor : flash.utils.Object, ?byteArray : flash.utils.ByteArray) : flash.utils.ByteArray; + function fillRect(rect : flash.geom.Rectangle, color : UInt) : Void; + function floodFill(x : Int, y : Int, color : UInt) : Void; + function generateFilterRect(sourceRect : flash.geom.Rectangle, filter : flash.filters.BitmapFilter) : flash.geom.Rectangle; + function getColorBoundsRect(mask : UInt, color : UInt, findColor : Bool = true) : flash.geom.Rectangle; + function getPixel(x : Int, y : Int) : UInt; + function getPixel32(x : Int, y : Int) : UInt; + function getPixels(rect : flash.geom.Rectangle) : flash.utils.ByteArray; + @:require(flash10) function getVector(rect : flash.geom.Rectangle) : flash.Vector; + private function get_height() : Int; + private function get_rect() : flash.geom.Rectangle; + private function get_transparent() : Bool; + private function get_width() : Int; + @:require(flash10) function histogram(?hRect : flash.geom.Rectangle) : flash.Vector>; + function hitTest(firstPoint : flash.geom.Point, firstAlphaThreshold : UInt, secondObject : flash.utils.Object, ?secondBitmapDataPoint : flash.geom.Point, secondAlphaThreshold : UInt = 1) : Bool; + function lock() : Void; + function merge(sourceBitmapData : BitmapData, sourceRect : flash.geom.Rectangle, destPoint : flash.geom.Point, redMultiplier : UInt, greenMultiplier : UInt, blueMultiplier : UInt, alphaMultiplier : UInt) : Void; + function noise(randomSeed : Int, low : UInt = 0, high : UInt = 255, channelOptions : UInt = 7, grayScale : Bool = false) : Void; + function paletteMap(sourceBitmapData : BitmapData, sourceRect : flash.geom.Rectangle, destPoint : flash.geom.Point, ?redArray : Array, ?greenArray : Array, ?blueArray : Array, ?alphaArray : Array) : Void; + function perlinNoise(baseX : Float, baseY : Float, numOctaves : UInt, randomSeed : Int, stitch : Bool, fractalNoise : Bool, channelOptions : UInt = 7, grayScale : Bool = false, ?offsets : Array) : Void; + function pixelDissolve(sourceBitmapData : BitmapData, sourceRect : flash.geom.Rectangle, destPoint : flash.geom.Point, randomSeed : Int = 0, numPixels : Int = 0, fillColor : UInt = 0) : Int; + function scroll(x : Int, y : Int) : Void; + function setPixel(x : Int, y : Int, color : UInt) : Void; + function setPixel32(x : Int, y : Int, color : UInt) : Void; + function setPixels(rect : flash.geom.Rectangle, inputByteArray : flash.utils.ByteArray) : Void; + @:require(flash10) function setVector(rect : flash.geom.Rectangle, inputVector : flash.Vector) : Void; + function threshold(sourceBitmapData : BitmapData, sourceRect : flash.geom.Rectangle, destPoint : flash.geom.Point, operation : String, threshold : UInt, color : UInt = 0, mask : UInt = 0xFFFFFFFF, copySource : Bool = false) : UInt; + function unlock(?changeRect : flash.geom.Rectangle) : Void; +} diff --git a/build/linux64_569e52e/std/flash/display/BitmapDataChannel.hx b/build/linux64_569e52e/std/flash/display/BitmapDataChannel.hx new file mode 100644 index 0000000..7dc8352 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/BitmapDataChannel.hx @@ -0,0 +1,8 @@ +package flash.display; + +extern class BitmapDataChannel { + public static inline var ALPHA = 8; + public static inline var BLUE = 4; + public static inline var GREEN = 2; + public static inline var RED = 1; +} diff --git a/build/linux64_569e52e/std/flash/display/BitmapEncodingColorSpace.hx b/build/linux64_569e52e/std/flash/display/BitmapEncodingColorSpace.hx new file mode 100644 index 0000000..5090d83 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/BitmapEncodingColorSpace.hx @@ -0,0 +1,8 @@ +package flash.display; + +@:native("flash.display.BitmapEncodingColorSpace") extern enum abstract BitmapEncodingColorSpace(String) { + var COLORSPACE_4_2_0; + var COLORSPACE_4_2_2; + var COLORSPACE_4_4_4; + var COLORSPACE_AUTO; +} diff --git a/build/linux64_569e52e/std/flash/display/BlendMode.hx b/build/linux64_569e52e/std/flash/display/BlendMode.hx new file mode 100644 index 0000000..d1b0031 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/BlendMode.hx @@ -0,0 +1,19 @@ +package flash.display; + +@:native("flash.display.BlendMode") extern enum abstract BlendMode(String) { + var ADD; + var ALPHA; + var DARKEN; + var DIFFERENCE; + var ERASE; + var HARDLIGHT; + var INVERT; + var LAYER; + var LIGHTEN; + var MULTIPLY; + var NORMAL; + var OVERLAY; + var SCREEN; + var SHADER; + var SUBTRACT; +} diff --git a/build/linux64_569e52e/std/flash/display/CapsStyle.hx b/build/linux64_569e52e/std/flash/display/CapsStyle.hx new file mode 100644 index 0000000..e173e17 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/CapsStyle.hx @@ -0,0 +1,7 @@ +package flash.display; + +@:native("flash.display.CapsStyle") extern enum abstract CapsStyle(String) { + var NONE; + var ROUND; + var SQUARE; +} diff --git a/build/linux64_569e52e/std/flash/display/ColorCorrection.hx b/build/linux64_569e52e/std/flash/display/ColorCorrection.hx new file mode 100644 index 0000000..6c48b62 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/ColorCorrection.hx @@ -0,0 +1,7 @@ +package flash.display; + +@:native("flash.display.ColorCorrection") @:require(flash10_1) extern enum abstract ColorCorrection(String) { + var DEFAULT; + var OFF; + var ON; +} diff --git a/build/linux64_569e52e/std/flash/display/ColorCorrectionSupport.hx b/build/linux64_569e52e/std/flash/display/ColorCorrectionSupport.hx new file mode 100644 index 0000000..f4aa3ac --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/ColorCorrectionSupport.hx @@ -0,0 +1,7 @@ +package flash.display; + +@:native("flash.display.ColorCorrectionSupport") @:require(flash10_1) extern enum abstract ColorCorrectionSupport(String) { + var DEFAULT_OFF; + var DEFAULT_ON; + var UNSUPPORTED; +} diff --git a/build/linux64_569e52e/std/flash/display/DisplayObject.hx b/build/linux64_569e52e/std/flash/display/DisplayObject.hx new file mode 100644 index 0000000..b140f2a --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/DisplayObject.hx @@ -0,0 +1,100 @@ +package flash.display; + +extern class DisplayObject extends flash.events.EventDispatcher implements IBitmapDrawable { + @:flash.property var accessibilityProperties(get,set) : flash.accessibility.AccessibilityProperties; + @:flash.property var alpha(get,set) : Float; + @:flash.property var blendMode(get,set) : BlendMode; + @:flash.property @:require(flash10) var blendShader(never,set) : Shader; + @:flash.property var cacheAsBitmap(get,set) : Bool; + @:flash.property var filters(get,set) : Array; + @:flash.property var height(get,set) : Float; + @:flash.property var loaderInfo(get,never) : LoaderInfo; + @:flash.property var mask(get,set) : DisplayObject; + @:flash.property var mouseX(get,never) : Float; + @:flash.property var mouseY(get,never) : Float; + @:flash.property var name(get,set) : String; + @:flash.property var opaqueBackground(get,set) : Null; + @:flash.property var parent(get,never) : DisplayObjectContainer; + @:flash.property var root(get,never) : DisplayObject; + @:flash.property var rotation(get,set) : Float; + @:flash.property @:require(flash10) var rotationX(get,set) : Float; + @:flash.property @:require(flash10) var rotationY(get,set) : Float; + @:flash.property @:require(flash10) var rotationZ(get,set) : Float; + @:flash.property var scale9Grid(get,set) : flash.geom.Rectangle; + @:flash.property var scaleX(get,set) : Float; + @:flash.property var scaleY(get,set) : Float; + @:flash.property @:require(flash10) var scaleZ(get,set) : Float; + @:flash.property var scrollRect(get,set) : flash.geom.Rectangle; + @:flash.property var stage(get,never) : Stage; + @:flash.property var transform(get,set) : flash.geom.Transform; + @:flash.property var visible(get,set) : Bool; + @:flash.property var width(get,set) : Float; + @:flash.property var x(get,set) : Float; + @:flash.property var y(get,set) : Float; + @:flash.property @:require(flash10) var z(get,set) : Float; + function getBounds(targetCoordinateSpace : DisplayObject) : flash.geom.Rectangle; + function getRect(targetCoordinateSpace : DisplayObject) : flash.geom.Rectangle; + private function get_accessibilityProperties() : flash.accessibility.AccessibilityProperties; + private function get_alpha() : Float; + private function get_blendMode() : BlendMode; + private function get_cacheAsBitmap() : Bool; + private function get_filters() : Array; + private function get_height() : Float; + private function get_loaderInfo() : LoaderInfo; + private function get_mask() : DisplayObject; + private function get_metaData() : Dynamic; + private function get_mouseX() : Float; + private function get_mouseY() : Float; + private function get_name() : String; + private function get_opaqueBackground() : Null; + private function get_parent() : DisplayObjectContainer; + private function get_root() : DisplayObject; + private function get_rotation() : Float; + private function get_rotationX() : Float; + private function get_rotationY() : Float; + private function get_rotationZ() : Float; + private function get_scale9Grid() : flash.geom.Rectangle; + private function get_scaleX() : Float; + private function get_scaleY() : Float; + private function get_scaleZ() : Float; + private function get_scrollRect() : flash.geom.Rectangle; + private function get_stage() : Stage; + private function get_transform() : flash.geom.Transform; + private function get_visible() : Bool; + private function get_width() : Float; + private function get_x() : Float; + private function get_y() : Float; + private function get_z() : Float; + function globalToLocal(point : flash.geom.Point) : flash.geom.Point; + @:require(flash10) function globalToLocal3D(point : flash.geom.Point) : flash.geom.Vector3D; + function hitTestObject(obj : DisplayObject) : Bool; + function hitTestPoint(x : Float, y : Float, shapeFlag : Bool = false) : Bool; + @:require(flash10) function local3DToGlobal(point3d : flash.geom.Vector3D) : flash.geom.Point; + function localToGlobal(point : flash.geom.Point) : flash.geom.Point; + private function set_accessibilityProperties(value : flash.accessibility.AccessibilityProperties) : flash.accessibility.AccessibilityProperties; + private function set_alpha(value : Float) : Float; + private function set_blendMode(value : BlendMode) : BlendMode; + private function set_blendShader(value : Shader) : Shader; + private function set_cacheAsBitmap(value : Bool) : Bool; + private function set_filters(value : Array) : Array; + private function set_height(value : Float) : Float; + private function set_mask(value : DisplayObject) : DisplayObject; + private function set_metaData(value : Dynamic) : Dynamic; + private function set_name(value : String) : String; + private function set_opaqueBackground(value : Null) : Null; + private function set_rotation(value : Float) : Float; + private function set_rotationX(value : Float) : Float; + private function set_rotationY(value : Float) : Float; + private function set_rotationZ(value : Float) : Float; + private function set_scale9Grid(value : flash.geom.Rectangle) : flash.geom.Rectangle; + private function set_scaleX(value : Float) : Float; + private function set_scaleY(value : Float) : Float; + private function set_scaleZ(value : Float) : Float; + private function set_scrollRect(value : flash.geom.Rectangle) : flash.geom.Rectangle; + private function set_transform(value : flash.geom.Transform) : flash.geom.Transform; + private function set_visible(value : Bool) : Bool; + private function set_width(value : Float) : Float; + private function set_x(value : Float) : Float; + private function set_y(value : Float) : Float; + private function set_z(value : Float) : Float; +} diff --git a/build/linux64_569e52e/std/flash/display/DisplayObjectContainer.hx b/build/linux64_569e52e/std/flash/display/DisplayObjectContainer.hx new file mode 100644 index 0000000..cd11f78 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/DisplayObjectContainer.hx @@ -0,0 +1,30 @@ +package flash.display; + +extern class DisplayObjectContainer extends InteractiveObject { + @:flash.property var mouseChildren(get,set) : Bool; + @:flash.property var numChildren(get,never) : Int; + @:flash.property var tabChildren(get,set) : Bool; + @:flash.property var textSnapshot(get,never) : flash.text.TextSnapshot; + function new() : Void; + function addChild(child : DisplayObject) : DisplayObject; + function addChildAt(child : DisplayObject, index : Int) : DisplayObject; + function areInaccessibleObjectsUnderPoint(point : flash.geom.Point) : Bool; + function contains(child : DisplayObject) : Bool; + function getChildAt(index : Int) : DisplayObject; + function getChildByName(name : String) : DisplayObject; + function getChildIndex(child : DisplayObject) : Int; + function getObjectsUnderPoint(point : flash.geom.Point) : Array; + private function get_mouseChildren() : Bool; + private function get_numChildren() : Int; + private function get_tabChildren() : Bool; + private function get_textSnapshot() : flash.text.TextSnapshot; + function removeChild(child : DisplayObject) : DisplayObject; + function removeChildAt(index : Int) : DisplayObject; + @:require(flash11) function removeChildren(beginIndex : Int = 0, endIndex : Int = 2147483647) : Void; + function setChildIndex(child : DisplayObject, index : Int) : Void; + private function set_mouseChildren(value : Bool) : Bool; + private function set_tabChildren(value : Bool) : Bool; + @:require(flash11_8) function stopAllMovieClips() : Void; + function swapChildren(child1 : DisplayObject, child2 : DisplayObject) : Void; + function swapChildrenAt(index1 : Int, index2 : Int) : Void; +} diff --git a/build/linux64_569e52e/std/flash/display/FocusDirection.hx b/build/linux64_569e52e/std/flash/display/FocusDirection.hx new file mode 100644 index 0000000..b36d567 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/FocusDirection.hx @@ -0,0 +1,7 @@ +package flash.display; + +@:native("flash.display.FocusDirection") @:require(flash10_1) extern enum abstract FocusDirection(String) { + var BOTTOM; + var NONE; + var TOP; +} diff --git a/build/linux64_569e52e/std/flash/display/FrameLabel.hx b/build/linux64_569e52e/std/flash/display/FrameLabel.hx new file mode 100644 index 0000000..bf56c19 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/FrameLabel.hx @@ -0,0 +1,9 @@ +package flash.display; + +extern final class FrameLabel extends flash.events.EventDispatcher { + @:flash.property var frame(get,never) : Int; + @:flash.property var name(get,never) : String; + function new(name : String, frame : Int) : Void; + private function get_frame() : Int; + private function get_name() : String; +} diff --git a/build/linux64_569e52e/std/flash/display/GradientType.hx b/build/linux64_569e52e/std/flash/display/GradientType.hx new file mode 100644 index 0000000..d488c60 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/GradientType.hx @@ -0,0 +1,6 @@ +package flash.display; + +@:native("flash.display.GradientType") extern enum abstract GradientType(String) { + var LINEAR; + var RADIAL; +} diff --git a/build/linux64_569e52e/std/flash/display/Graphics.hx b/build/linux64_569e52e/std/flash/display/Graphics.hx new file mode 100644 index 0000000..23d3ac2 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/Graphics.hx @@ -0,0 +1,29 @@ +package flash.display; + +extern final class Graphics { + function new() : Void; + function beginBitmapFill(bitmap : BitmapData, ?matrix : flash.geom.Matrix, repeat : Bool = true, smooth : Bool = false) : Void; + function beginFill(color : UInt, alpha : Float = 1) : Void; + function beginGradientFill(type : GradientType, colors : Array, alphas : Array, ratios : Array, ?matrix : flash.geom.Matrix, ?spreadMethod : SpreadMethod, ?interpolationMethod : InterpolationMethod, focalPointRatio : Float = 0) : Void; + @:require(flash10) function beginShaderFill(shader : Shader, ?matrix : flash.geom.Matrix) : Void; + function clear() : Void; + @:require(flash10) function copyFrom(sourceGraphics : Graphics) : Void; + @:require(flash11) function cubicCurveTo(controlX1 : Float, controlY1 : Float, controlX2 : Float, controlY2 : Float, anchorX : Float, anchorY : Float) : Void; + function curveTo(controlX : Float, controlY : Float, anchorX : Float, anchorY : Float) : Void; + function drawCircle(x : Float, y : Float, radius : Float) : Void; + function drawEllipse(x : Float, y : Float, width : Float, height : Float) : Void; + @:require(flash10) function drawGraphicsData(graphicsData : flash.Vector) : Void; + @:require(flash10) function drawPath(commands : flash.Vector, data : flash.Vector, ?winding : GraphicsPathWinding) : Void; + function drawRect(x : Float, y : Float, width : Float, height : Float) : Void; + function drawRoundRect(x : Float, y : Float, width : Float, height : Float, ellipseWidth : Float, ellipseHeight : Null = 0) : Void; + function drawRoundRectComplex(x : Float, y : Float, width : Float, height : Float, topLeftRadius : Float, topRightRadius : Float, bottomLeftRadius : Float, bottomRightRadius : Float) : Void; + @:require(flash10) function drawTriangles(vertices : flash.Vector, ?indices : flash.Vector, ?uvtData : flash.Vector, ?culling : TriangleCulling) : Void; + function endFill() : Void; + @:require(flash10) function lineBitmapStyle(bitmap : BitmapData, ?matrix : flash.geom.Matrix, repeat : Bool = true, smooth : Bool = false) : Void; + function lineGradientStyle(type : GradientType, colors : Array, alphas : Array, ratios : Array, ?matrix : flash.geom.Matrix, ?spreadMethod : SpreadMethod, ?interpolationMethod : InterpolationMethod, focalPointRatio : Float = 0) : Void; + @:require(flash10) function lineShaderStyle(shader : Shader, ?matrix : flash.geom.Matrix) : Void; + function lineStyle(thickness : Null = 0, color : UInt = 0, alpha : Float = 1, pixelHinting : Bool = false, ?scaleMode : LineScaleMode, ?caps : CapsStyle, ?joints : JointStyle, miterLimit : Float = 3) : Void; + function lineTo(x : Float, y : Float) : Void; + function moveTo(x : Float, y : Float) : Void; + @:require(flash11_6) function readGraphicsData(recurse : Bool = true) : flash.Vector; +} diff --git a/build/linux64_569e52e/std/flash/display/GraphicsBitmapFill.hx b/build/linux64_569e52e/std/flash/display/GraphicsBitmapFill.hx new file mode 100644 index 0000000..b42a39f --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/GraphicsBitmapFill.hx @@ -0,0 +1,9 @@ +package flash.display; + +extern final class GraphicsBitmapFill implements IGraphicsData implements IGraphicsFill { + var bitmapData : BitmapData; + var matrix : flash.geom.Matrix; + var repeat : Bool; + var smooth : Bool; + function new(?bitmapData : BitmapData, ?matrix : flash.geom.Matrix, repeat : Bool = true, smooth : Bool = false) : Void; +} diff --git a/build/linux64_569e52e/std/flash/display/GraphicsEndFill.hx b/build/linux64_569e52e/std/flash/display/GraphicsEndFill.hx new file mode 100644 index 0000000..b14d18d --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/GraphicsEndFill.hx @@ -0,0 +1,5 @@ +package flash.display; + +extern class GraphicsEndFill implements IGraphicsData implements IGraphicsFill { + function new() : Void; +} diff --git a/build/linux64_569e52e/std/flash/display/GraphicsGradientFill.hx b/build/linux64_569e52e/std/flash/display/GraphicsGradientFill.hx new file mode 100644 index 0000000..fa87f8c --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/GraphicsGradientFill.hx @@ -0,0 +1,19 @@ +package flash.display; + +extern final class GraphicsGradientFill implements IGraphicsData implements IGraphicsFill { + var alphas : Array; + var colors : Array; + var focalPointRatio : Float; + @:flash.property var interpolationMethod(get,set) : InterpolationMethod; + var matrix : flash.geom.Matrix; + var ratios : Array; + @:flash.property var spreadMethod(get,set) : SpreadMethod; + @:flash.property var type(get,set) : GradientType; + function new(?type : GradientType, ?colors : Array, ?alphas : Array, ?ratios : Array, ?matrix : flash.geom.Matrix, ?spreadMethod : SpreadMethod, ?interpolationMethod : InterpolationMethod, focalPointRatio : Float = 0) : Void; + private function get_interpolationMethod() : InterpolationMethod; + private function get_spreadMethod() : SpreadMethod; + private function get_type() : GradientType; + private function set_interpolationMethod(value : InterpolationMethod) : InterpolationMethod; + private function set_spreadMethod(value : SpreadMethod) : SpreadMethod; + private function set_type(value : GradientType) : GradientType; +} diff --git a/build/linux64_569e52e/std/flash/display/GraphicsPath.hx b/build/linux64_569e52e/std/flash/display/GraphicsPath.hx new file mode 100644 index 0000000..568c2d2 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/GraphicsPath.hx @@ -0,0 +1,16 @@ +package flash.display; + +extern final class GraphicsPath implements IGraphicsData implements IGraphicsPath { + var commands : flash.Vector; + var data : flash.Vector; + @:flash.property var winding(get,set) : GraphicsPathWinding; + function new(?commands : flash.Vector, ?data : flash.Vector, ?winding : GraphicsPathWinding) : Void; + @:require(flash11) function cubicCurveTo(controlX1 : Float, controlY1 : Float, controlX2 : Float, controlY2 : Float, anchorX : Float, anchorY : Float) : Void; + function curveTo(controlX : Float, controlY : Float, anchorX : Float, anchorY : Float) : Void; + private function get_winding() : GraphicsPathWinding; + function lineTo(x : Float, y : Float) : Void; + function moveTo(x : Float, y : Float) : Void; + private function set_winding(value : GraphicsPathWinding) : GraphicsPathWinding; + function wideLineTo(x : Float, y : Float) : Void; + function wideMoveTo(x : Float, y : Float) : Void; +} diff --git a/build/linux64_569e52e/std/flash/display/GraphicsPathCommand.hx b/build/linux64_569e52e/std/flash/display/GraphicsPathCommand.hx new file mode 100644 index 0000000..48eff4c --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/GraphicsPathCommand.hx @@ -0,0 +1,11 @@ +package flash.display; + +extern class GraphicsPathCommand { + public static inline var LINE_TO = 2; + public static inline var MOVE_TO = 1; + public static inline var CURVE_TO = 3; + @:require(flash11) public static inline var CUBIC_CURVE_TO = 6; + public static inline var WIDE_LINE_TO = 5; + public static inline var WIDE_MOVE_TO = 4; + public static inline var NO_OP = 0; +} diff --git a/build/linux64_569e52e/std/flash/display/GraphicsPathWinding.hx b/build/linux64_569e52e/std/flash/display/GraphicsPathWinding.hx new file mode 100644 index 0000000..ec3eb01 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/GraphicsPathWinding.hx @@ -0,0 +1,6 @@ +package flash.display; + +@:native("flash.display.GraphicsPathWinding") extern enum abstract GraphicsPathWinding(String) { + var EVEN_ODD; + var NON_ZERO; +} diff --git a/build/linux64_569e52e/std/flash/display/GraphicsShaderFill.hx b/build/linux64_569e52e/std/flash/display/GraphicsShaderFill.hx new file mode 100644 index 0000000..7878a00 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/GraphicsShaderFill.hx @@ -0,0 +1,7 @@ +package flash.display; + +extern final class GraphicsShaderFill implements IGraphicsData implements IGraphicsFill { + var matrix : flash.geom.Matrix; + var shader : Shader; + function new(?shader : Shader, ?matrix : flash.geom.Matrix) : Void; +} diff --git a/build/linux64_569e52e/std/flash/display/GraphicsSolidFill.hx b/build/linux64_569e52e/std/flash/display/GraphicsSolidFill.hx new file mode 100644 index 0000000..462f7c6 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/GraphicsSolidFill.hx @@ -0,0 +1,7 @@ +package flash.display; + +extern final class GraphicsSolidFill implements IGraphicsData implements IGraphicsFill { + var alpha : Float; + var color : UInt; + function new(color : UInt = 0, alpha : Float = 1) : Void; +} diff --git a/build/linux64_569e52e/std/flash/display/GraphicsStroke.hx b/build/linux64_569e52e/std/flash/display/GraphicsStroke.hx new file mode 100644 index 0000000..4ca9eda --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/GraphicsStroke.hx @@ -0,0 +1,18 @@ +package flash.display; + +extern final class GraphicsStroke implements IGraphicsData implements IGraphicsStroke { + @:flash.property var caps(get,set) : CapsStyle; + var fill : IGraphicsFill; + @:flash.property var joints(get,set) : JointStyle; + var miterLimit : Float; + var pixelHinting : Bool; + @:flash.property var scaleMode(get,set) : LineScaleMode; + var thickness : Float; + function new(thickness : Float = 0./*NaN*/, pixelHinting : Bool = false, ?scaleMode : LineScaleMode, ?caps : CapsStyle, ?joints : JointStyle, miterLimit : Float = 3, ?fill : IGraphicsFill) : Void; + private function get_caps() : CapsStyle; + private function get_joints() : JointStyle; + private function get_scaleMode() : LineScaleMode; + private function set_caps(value : CapsStyle) : CapsStyle; + private function set_joints(value : JointStyle) : JointStyle; + private function set_scaleMode(value : LineScaleMode) : LineScaleMode; +} diff --git a/build/linux64_569e52e/std/flash/display/GraphicsTrianglePath.hx b/build/linux64_569e52e/std/flash/display/GraphicsTrianglePath.hx new file mode 100644 index 0000000..39a56b0 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/GraphicsTrianglePath.hx @@ -0,0 +1,11 @@ +package flash.display; + +extern final class GraphicsTrianglePath implements IGraphicsData implements IGraphicsPath { + @:flash.property var culling(get,set) : TriangleCulling; + var indices : flash.Vector; + var uvtData : flash.Vector; + var vertices : flash.Vector; + function new(?vertices : flash.Vector, ?indices : flash.Vector, ?uvtData : flash.Vector, ?culling : TriangleCulling) : Void; + private function get_culling() : TriangleCulling; + private function set_culling(value : TriangleCulling) : TriangleCulling; +} diff --git a/build/linux64_569e52e/std/flash/display/IBitmapCompressOptions.hx b/build/linux64_569e52e/std/flash/display/IBitmapCompressOptions.hx new file mode 100644 index 0000000..708ac7a --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/IBitmapCompressOptions.hx @@ -0,0 +1,4 @@ +package flash.display; + +extern interface IBitmapCompressOptions { +} diff --git a/build/linux64_569e52e/std/flash/display/IBitmapDrawable.hx b/build/linux64_569e52e/std/flash/display/IBitmapDrawable.hx new file mode 100644 index 0000000..906e4f2 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/IBitmapDrawable.hx @@ -0,0 +1,4 @@ +package flash.display; + +extern interface IBitmapDrawable { +} diff --git a/build/linux64_569e52e/std/flash/display/IDrawCommand.hx b/build/linux64_569e52e/std/flash/display/IDrawCommand.hx new file mode 100644 index 0000000..5b7b627 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/IDrawCommand.hx @@ -0,0 +1,4 @@ +package flash.display; + +extern interface IDrawCommand { +} diff --git a/build/linux64_569e52e/std/flash/display/IGraphicsData.hx b/build/linux64_569e52e/std/flash/display/IGraphicsData.hx new file mode 100644 index 0000000..92bf7dc --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/IGraphicsData.hx @@ -0,0 +1,4 @@ +package flash.display; + +extern interface IGraphicsData { +} diff --git a/build/linux64_569e52e/std/flash/display/IGraphicsFill.hx b/build/linux64_569e52e/std/flash/display/IGraphicsFill.hx new file mode 100644 index 0000000..f2a6502 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/IGraphicsFill.hx @@ -0,0 +1,4 @@ +package flash.display; + +extern interface IGraphicsFill { +} diff --git a/build/linux64_569e52e/std/flash/display/IGraphicsPath.hx b/build/linux64_569e52e/std/flash/display/IGraphicsPath.hx new file mode 100644 index 0000000..f5083ef --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/IGraphicsPath.hx @@ -0,0 +1,4 @@ +package flash.display; + +extern interface IGraphicsPath { +} diff --git a/build/linux64_569e52e/std/flash/display/IGraphicsStroke.hx b/build/linux64_569e52e/std/flash/display/IGraphicsStroke.hx new file mode 100644 index 0000000..2839fd4 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/IGraphicsStroke.hx @@ -0,0 +1,4 @@ +package flash.display; + +extern interface IGraphicsStroke { +} diff --git a/build/linux64_569e52e/std/flash/display/InteractiveObject.hx b/build/linux64_569e52e/std/flash/display/InteractiveObject.hx new file mode 100644 index 0000000..8ab1f71 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/InteractiveObject.hx @@ -0,0 +1,33 @@ +package flash.display; + +extern class InteractiveObject extends DisplayObject { + @:flash.property var accessibilityImplementation(get,set) : flash.accessibility.AccessibilityImplementation; + @:flash.property var contextMenu(get,set) : flash.ui.ContextMenu; + @:flash.property var doubleClickEnabled(get,set) : Bool; + @:flash.property var focusRect(get,set) : Dynamic; + @:flash.property var mouseEnabled(get,set) : Bool; + @:flash.property @:require(flash11) var needsSoftKeyboard(get,set) : Bool; + @:flash.property @:require(flash11) var softKeyboardInputAreaOfInterest(get,set) : flash.geom.Rectangle; + @:flash.property var tabEnabled(get,set) : Bool; + @:flash.property var tabIndex(get,set) : Int; + function new() : Void; + private function get_accessibilityImplementation() : flash.accessibility.AccessibilityImplementation; + private function get_contextMenu() : flash.ui.ContextMenu; + private function get_doubleClickEnabled() : Bool; + private function get_focusRect() : Dynamic; + private function get_mouseEnabled() : Bool; + private function get_needsSoftKeyboard() : Bool; + private function get_softKeyboardInputAreaOfInterest() : flash.geom.Rectangle; + private function get_tabEnabled() : Bool; + private function get_tabIndex() : Int; + @:require(flash11) function requestSoftKeyboard() : Bool; + private function set_accessibilityImplementation(value : flash.accessibility.AccessibilityImplementation) : flash.accessibility.AccessibilityImplementation; + private function set_contextMenu(value : flash.ui.ContextMenu) : flash.ui.ContextMenu; + private function set_doubleClickEnabled(value : Bool) : Bool; + private function set_focusRect(value : Dynamic) : Dynamic; + private function set_mouseEnabled(value : Bool) : Bool; + private function set_needsSoftKeyboard(value : Bool) : Bool; + private function set_softKeyboardInputAreaOfInterest(value : flash.geom.Rectangle) : flash.geom.Rectangle; + private function set_tabEnabled(value : Bool) : Bool; + private function set_tabIndex(value : Int) : Int; +} diff --git a/build/linux64_569e52e/std/flash/display/InterpolationMethod.hx b/build/linux64_569e52e/std/flash/display/InterpolationMethod.hx new file mode 100644 index 0000000..58f14c2 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/InterpolationMethod.hx @@ -0,0 +1,6 @@ +package flash.display; + +@:native("flash.display.InterpolationMethod") extern enum abstract InterpolationMethod(String) { + var LINEAR_RGB; + var RGB; +} diff --git a/build/linux64_569e52e/std/flash/display/JPEGCompressOptions.hx b/build/linux64_569e52e/std/flash/display/JPEGCompressOptions.hx new file mode 100644 index 0000000..f4db4f2 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/JPEGCompressOptions.hx @@ -0,0 +1,6 @@ +package flash.display; + +extern final class JPEGCompressOptions implements IBitmapCompressOptions { + var quality : UInt; + function new(quality : UInt = 80) : Void; +} diff --git a/build/linux64_569e52e/std/flash/display/JPEGEncoderOptions.hx b/build/linux64_569e52e/std/flash/display/JPEGEncoderOptions.hx new file mode 100644 index 0000000..a861b7c --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/JPEGEncoderOptions.hx @@ -0,0 +1,6 @@ +package flash.display; + +extern final class JPEGEncoderOptions { + var quality : UInt; + function new(quality : UInt = 80) : Void; +} diff --git a/build/linux64_569e52e/std/flash/display/JPEGXRCompressOptions.hx b/build/linux64_569e52e/std/flash/display/JPEGXRCompressOptions.hx new file mode 100644 index 0000000..a605a96 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/JPEGXRCompressOptions.hx @@ -0,0 +1,8 @@ +package flash.display; + +extern final class JPEGXRCompressOptions implements IBitmapCompressOptions { + var colorSpace : String; + var quantization : UInt; + var trimFlexBits : UInt; + function new(quantization : UInt = 20, ?colorSpace : String, trimFlexBits : UInt = 0) : Void; +} diff --git a/build/linux64_569e52e/std/flash/display/JPEGXREncoderOptions.hx b/build/linux64_569e52e/std/flash/display/JPEGXREncoderOptions.hx new file mode 100644 index 0000000..3c01628 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/JPEGXREncoderOptions.hx @@ -0,0 +1,8 @@ +package flash.display; + +extern final class JPEGXREncoderOptions { + var colorSpace : BitmapEncodingColorSpace; + var quantization : UInt; + var trimFlexBits : UInt; + function new(quantization : UInt = 20, ?colorSpace : BitmapEncodingColorSpace, trimFlexBits : UInt = 0) : Void; +} diff --git a/build/linux64_569e52e/std/flash/display/JointStyle.hx b/build/linux64_569e52e/std/flash/display/JointStyle.hx new file mode 100644 index 0000000..981f7c9 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/JointStyle.hx @@ -0,0 +1,7 @@ +package flash.display; + +@:native("flash.display.JointStyle") extern enum abstract JointStyle(String) { + var BEVEL; + var MITER; + var ROUND; +} diff --git a/build/linux64_569e52e/std/flash/display/LineScaleMode.hx b/build/linux64_569e52e/std/flash/display/LineScaleMode.hx new file mode 100644 index 0000000..5c5f35a --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/LineScaleMode.hx @@ -0,0 +1,8 @@ +package flash.display; + +@:native("flash.display.LineScaleMode") extern enum abstract LineScaleMode(String) { + var HORIZONTAL; + var NONE; + var NORMAL; + var VERTICAL; +} diff --git a/build/linux64_569e52e/std/flash/display/Loader.hx b/build/linux64_569e52e/std/flash/display/Loader.hx new file mode 100644 index 0000000..0dc6ac3 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/Loader.hx @@ -0,0 +1,16 @@ +package flash.display; + +extern class Loader extends DisplayObjectContainer { + @:flash.property var content(get,never) : DisplayObject; + @:flash.property var contentLoaderInfo(get,never) : LoaderInfo; + @:flash.property @:require(flash10_1) var uncaughtErrorEvents(get,never) : flash.events.UncaughtErrorEvents; + function new() : Void; + function close() : Void; + private function get_content() : DisplayObject; + private function get_contentLoaderInfo() : LoaderInfo; + private function get_uncaughtErrorEvents() : flash.events.UncaughtErrorEvents; + function load(request : flash.net.URLRequest, ?context : flash.system.LoaderContext) : Void; + function loadBytes(bytes : flash.utils.ByteArray, ?context : flash.system.LoaderContext) : Void; + function unload() : Void; + @:require(flash10) function unloadAndStop(gc : Bool = true) : Void; +} diff --git a/build/linux64_569e52e/std/flash/display/LoaderInfo.hx b/build/linux64_569e52e/std/flash/display/LoaderInfo.hx new file mode 100644 index 0000000..a741b43 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/LoaderInfo.hx @@ -0,0 +1,53 @@ +package flash.display; + +extern class LoaderInfo extends flash.events.EventDispatcher { + @:flash.property var actionScriptVersion(get,never) : ActionScriptVersion; + @:flash.property var applicationDomain(get,never) : flash.system.ApplicationDomain; + @:flash.property var bytes(get,never) : flash.utils.ByteArray; + @:flash.property var bytesLoaded(get,never) : UInt; + @:flash.property var bytesTotal(get,never) : UInt; + @:flash.property var childAllowsParent(get,never) : Bool; + @:flash.property @:require(flash11_4) var childSandboxBridge(get,set) : Dynamic; + @:flash.property var content(get,never) : DisplayObject; + @:flash.property var contentType(get,never) : String; + @:flash.property var frameRate(get,never) : Float; + @:flash.property var height(get,never) : Int; + @:flash.property @:require(flash10_1) var isURLInaccessible(get,never) : Bool; + @:flash.property var loader(get,never) : Loader; + @:flash.property var loaderURL(get,never) : String; + @:flash.property var parameters(get,never) : Dynamic; + @:flash.property var parentAllowsChild(get,never) : Bool; + @:flash.property @:require(flash11_4) var parentSandboxBridge(get,set) : Dynamic; + @:flash.property var sameDomain(get,never) : Bool; + @:flash.property var sharedEvents(get,never) : flash.events.EventDispatcher; + @:flash.property var swfVersion(get,never) : UInt; + @:flash.property @:require(flash10_1) var uncaughtErrorEvents(get,never) : flash.events.UncaughtErrorEvents; + @:flash.property var url(get,never) : String; + @:flash.property var width(get,never) : Int; + private function get_actionScriptVersion() : ActionScriptVersion; + private function get_applicationDomain() : flash.system.ApplicationDomain; + private function get_bytes() : flash.utils.ByteArray; + private function get_bytesLoaded() : UInt; + private function get_bytesTotal() : UInt; + private function get_childAllowsParent() : Bool; + private function get_childSandboxBridge() : Dynamic; + private function get_content() : DisplayObject; + private function get_contentType() : String; + private function get_frameRate() : Float; + private function get_height() : Int; + private function get_isURLInaccessible() : Bool; + private function get_loader() : Loader; + private function get_loaderURL() : String; + private function get_parameters() : Dynamic; + private function get_parentAllowsChild() : Bool; + private function get_parentSandboxBridge() : Dynamic; + private function get_sameDomain() : Bool; + private function get_sharedEvents() : flash.events.EventDispatcher; + private function get_swfVersion() : UInt; + private function get_uncaughtErrorEvents() : flash.events.UncaughtErrorEvents; + private function get_url() : String; + private function get_width() : Int; + private function set_childSandboxBridge(value : Dynamic) : Dynamic; + private function set_parentSandboxBridge(value : Dynamic) : Dynamic; + static function getLoaderInfoByDefinition(object : Dynamic) : LoaderInfo; +} diff --git a/build/linux64_569e52e/std/flash/display/MorphShape.hx b/build/linux64_569e52e/std/flash/display/MorphShape.hx new file mode 100644 index 0000000..9dc2768 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/MorphShape.hx @@ -0,0 +1,4 @@ +package flash.display; + +extern class MorphShape extends DisplayObject { +} diff --git a/build/linux64_569e52e/std/flash/display/MovieClip.hx b/build/linux64_569e52e/std/flash/display/MovieClip.hx new file mode 100644 index 0000000..0f20402 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/MovieClip.hx @@ -0,0 +1,38 @@ +package flash.display; + +extern class MovieClip extends Sprite #if !flash_strict implements Dynamic #end { + @:flash.property var currentFrame(get,never) : Int; + @:flash.property @:require(flash10) var currentFrameLabel(get,never) : String; + @:flash.property var currentLabel(get,never) : String; + @:flash.property var currentLabels(get,never) : Array; + @:flash.property var currentScene(get,never) : Scene; + @:flash.property var enabled(get,set) : Bool; + @:flash.property var framesLoaded(get,never) : Int; + @:flash.property @:require(flash11) var isPlaying(get,never) : Bool; + @:flash.property var scenes(get,never) : Array; + @:flash.property var totalFrames(get,never) : Int; + @:flash.property var trackAsMenu(get,set) : Bool; + function new() : Void; + function addFrameScript(restArgs : haxe.extern.Rest) : Void; + private function get_currentFrame() : Int; + private function get_currentFrameLabel() : String; + private function get_currentLabel() : String; + private function get_currentLabels() : Array; + private function get_currentScene() : Scene; + private function get_enabled() : Bool; + private function get_framesLoaded() : Int; + private function get_isPlaying() : Bool; + private function get_scenes() : Array; + private function get_totalFrames() : Int; + private function get_trackAsMenu() : Bool; + function gotoAndPlay(frame : flash.utils.Object, ?scene : String) : Void; + function gotoAndStop(frame : flash.utils.Object, ?scene : String) : Void; + function nextFrame() : Void; + function nextScene() : Void; + function play() : Void; + function prevFrame() : Void; + function prevScene() : Void; + private function set_enabled(value : Bool) : Bool; + private function set_trackAsMenu(value : Bool) : Bool; + function stop() : Void; +} diff --git a/build/linux64_569e52e/std/flash/display/NativeMenu.hx b/build/linux64_569e52e/std/flash/display/NativeMenu.hx new file mode 100644 index 0000000..d5b1b3b --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/NativeMenu.hx @@ -0,0 +1,5 @@ +package flash.display; + +@:require(flash10_1) extern class NativeMenu extends flash.events.EventDispatcher { + function new() : Void; +} diff --git a/build/linux64_569e52e/std/flash/display/NativeMenuItem.hx b/build/linux64_569e52e/std/flash/display/NativeMenuItem.hx new file mode 100644 index 0000000..d484f96 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/NativeMenuItem.hx @@ -0,0 +1,8 @@ +package flash.display; + +@:require(flash10_1) extern class NativeMenuItem extends flash.events.EventDispatcher { + @:flash.property var enabled(get,set) : Bool; + function new() : Void; + private function get_enabled() : Bool; + private function set_enabled(value : Bool) : Bool; +} diff --git a/build/linux64_569e52e/std/flash/display/PNGCompressOptions.hx b/build/linux64_569e52e/std/flash/display/PNGCompressOptions.hx new file mode 100644 index 0000000..039eb55 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/PNGCompressOptions.hx @@ -0,0 +1,5 @@ +package flash.display; + +extern class PNGCompressOptions implements IBitmapCompressOptions { + function new() : Void; +} diff --git a/build/linux64_569e52e/std/flash/display/PNGEncoderOptions.hx b/build/linux64_569e52e/std/flash/display/PNGEncoderOptions.hx new file mode 100644 index 0000000..3d315ad --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/PNGEncoderOptions.hx @@ -0,0 +1,6 @@ +package flash.display; + +extern final class PNGEncoderOptions { + var fastCompression : Bool; + function new(fastCompression : Bool = false) : Void; +} diff --git a/build/linux64_569e52e/std/flash/display/PixelSnapping.hx b/build/linux64_569e52e/std/flash/display/PixelSnapping.hx new file mode 100644 index 0000000..c83ea30 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/PixelSnapping.hx @@ -0,0 +1,7 @@ +package flash.display; + +@:native("flash.display.PixelSnapping") extern enum abstract PixelSnapping(String) { + var ALWAYS; + var AUTO; + var NEVER; +} diff --git a/build/linux64_569e52e/std/flash/display/SWFVersion.hx b/build/linux64_569e52e/std/flash/display/SWFVersion.hx new file mode 100644 index 0000000..969368a --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/SWFVersion.hx @@ -0,0 +1,16 @@ +package flash.display; + +extern class SWFVersion { + static final FLASH1 : UInt; + static final FLASH10 : UInt; + static final FLASH11 : UInt; + static final FLASH12 : UInt; + static final FLASH2 : UInt; + static final FLASH3 : UInt; + static final FLASH4 : UInt; + static final FLASH5 : UInt; + static final FLASH6 : UInt; + static final FLASH7 : UInt; + static final FLASH8 : UInt; + static final FLASH9 : UInt; +} diff --git a/build/linux64_569e52e/std/flash/display/Scene.hx b/build/linux64_569e52e/std/flash/display/Scene.hx new file mode 100644 index 0000000..42d9b91 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/Scene.hx @@ -0,0 +1,11 @@ +package flash.display; + +extern final class Scene { + @:flash.property var labels(get,never) : Array; + @:flash.property var name(get,never) : String; + @:flash.property var numFrames(get,never) : Int; + function new(name : String, labels : Array, numFrames : Int) : Void; + private function get_labels() : Array; + private function get_name() : String; + private function get_numFrames() : Int; +} diff --git a/build/linux64_569e52e/std/flash/display/Shader.hx b/build/linux64_569e52e/std/flash/display/Shader.hx new file mode 100644 index 0000000..e35cf92 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/Shader.hx @@ -0,0 +1,13 @@ +package flash.display; + +@:require(flash10) extern class Shader { + @:flash.property var byteCode(never,set) : flash.utils.ByteArray; + @:flash.property var data(get,set) : ShaderData; + @:flash.property var precisionHint(get,set) : ShaderPrecision; + function new(?code : flash.utils.ByteArray) : Void; + private function get_data() : ShaderData; + private function get_precisionHint() : ShaderPrecision; + private function set_byteCode(value : flash.utils.ByteArray) : flash.utils.ByteArray; + private function set_data(value : ShaderData) : ShaderData; + private function set_precisionHint(value : ShaderPrecision) : ShaderPrecision; +} diff --git a/build/linux64_569e52e/std/flash/display/ShaderData.hx b/build/linux64_569e52e/std/flash/display/ShaderData.hx new file mode 100644 index 0000000..99e6742 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/ShaderData.hx @@ -0,0 +1,5 @@ +package flash.display; + +extern class ShaderData implements Dynamic { + function new(byteCode : flash.utils.ByteArray) : Void; +} diff --git a/build/linux64_569e52e/std/flash/display/ShaderInput.hx b/build/linux64_569e52e/std/flash/display/ShaderInput.hx new file mode 100644 index 0000000..abff29a --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/ShaderInput.hx @@ -0,0 +1,18 @@ +package flash.display; + +extern final class ShaderInput implements Dynamic { + @:flash.property var channels(get,never) : Int; + @:flash.property var height(get,set) : Int; + @:flash.property var index(get,never) : Int; + @:flash.property var input(get,set) : Dynamic; + @:flash.property var width(get,set) : Int; + function new() : Void; + private function get_channels() : Int; + private function get_height() : Int; + private function get_index() : Int; + private function get_input() : Dynamic; + private function get_width() : Int; + private function set_height(value : Int) : Int; + private function set_input(value : Dynamic) : Dynamic; + private function set_width(value : Int) : Int; +} diff --git a/build/linux64_569e52e/std/flash/display/ShaderJob.hx b/build/linux64_569e52e/std/flash/display/ShaderJob.hx new file mode 100644 index 0000000..cfe5770 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/ShaderJob.hx @@ -0,0 +1,21 @@ +package flash.display; + +extern class ShaderJob extends flash.events.EventDispatcher { + @:flash.property var height(get,set) : Int; + @:flash.property var progress(get,never) : Float; + @:flash.property var shader(get,set) : Shader; + @:flash.property var target(get,set) : Dynamic; + @:flash.property var width(get,set) : Int; + function new(?shader : Shader, ?target : Dynamic, width : Int = 0, height : Int = 0) : Void; + function cancel() : Void; + private function get_height() : Int; + private function get_progress() : Float; + private function get_shader() : Shader; + private function get_target() : Dynamic; + private function get_width() : Int; + private function set_height(value : Int) : Int; + private function set_shader(value : Shader) : Shader; + private function set_target(value : Dynamic) : Dynamic; + private function set_width(value : Int) : Int; + function start(waitForCompletion : Bool = false) : Void; +} diff --git a/build/linux64_569e52e/std/flash/display/ShaderParameter.hx b/build/linux64_569e52e/std/flash/display/ShaderParameter.hx new file mode 100644 index 0000000..b7dcae6 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/ShaderParameter.hx @@ -0,0 +1,11 @@ +package flash.display; + +extern final class ShaderParameter implements Dynamic { + @:flash.property var index(get,never) : Int; + @:flash.property var type(get,never) : ShaderParameterType; + @:flash.property var value(get,set) : Array; + private function get_index() : Int; + private function get_type() : ShaderParameterType; + private function get_value() : Array; + private function set_value(value : Array) : Array; +} diff --git a/build/linux64_569e52e/std/flash/display/ShaderParameterType.hx b/build/linux64_569e52e/std/flash/display/ShaderParameterType.hx new file mode 100644 index 0000000..78d867b --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/ShaderParameterType.hx @@ -0,0 +1,19 @@ +package flash.display; + +@:native("flash.display.ShaderParameterType") extern enum abstract ShaderParameterType(String) { + var BOOL; + var BOOL2; + var BOOL3; + var BOOL4; + var FLOAT; + var FLOAT2; + var FLOAT3; + var FLOAT4; + var INT; + var INT2; + var INT3; + var INT4; + var MATRIX2X2; + var MATRIX3X3; + var MATRIX4X4; +} diff --git a/build/linux64_569e52e/std/flash/display/ShaderPrecision.hx b/build/linux64_569e52e/std/flash/display/ShaderPrecision.hx new file mode 100644 index 0000000..941642b --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/ShaderPrecision.hx @@ -0,0 +1,6 @@ +package flash.display; + +@:native("flash.display.ShaderPrecision") extern enum abstract ShaderPrecision(String) { + var FAST; + var FULL; +} diff --git a/build/linux64_569e52e/std/flash/display/Shape.hx b/build/linux64_569e52e/std/flash/display/Shape.hx new file mode 100644 index 0000000..605fa9a --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/Shape.hx @@ -0,0 +1,7 @@ +package flash.display; + +extern class Shape extends DisplayObject { + @:flash.property var graphics(get,never) : Graphics; + function new() : Void; + private function get_graphics() : Graphics; +} diff --git a/build/linux64_569e52e/std/flash/display/SimpleButton.hx b/build/linux64_569e52e/std/flash/display/SimpleButton.hx new file mode 100644 index 0000000..fde09d2 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/SimpleButton.hx @@ -0,0 +1,29 @@ +package flash.display; + +extern class SimpleButton extends InteractiveObject { + @:flash.property var downState(get,set) : DisplayObject; + @:flash.property var enabled(get,set) : Bool; + @:flash.property var hitTestState(get,set) : DisplayObject; + @:flash.property var overState(get,set) : DisplayObject; + @:flash.property var soundTransform(get,set) : flash.media.SoundTransform; + @:flash.property var trackAsMenu(get,set) : Bool; + @:flash.property var upState(get,set) : DisplayObject; + @:flash.property var useHandCursor(get,set) : Bool; + function new(?upState : DisplayObject, ?overState : DisplayObject, ?downState : DisplayObject, ?hitTestState : DisplayObject) : Void; + private function get_downState() : DisplayObject; + private function get_enabled() : Bool; + private function get_hitTestState() : DisplayObject; + private function get_overState() : DisplayObject; + private function get_soundTransform() : flash.media.SoundTransform; + private function get_trackAsMenu() : Bool; + private function get_upState() : DisplayObject; + private function get_useHandCursor() : Bool; + private function set_downState(value : DisplayObject) : DisplayObject; + private function set_enabled(value : Bool) : Bool; + private function set_hitTestState(value : DisplayObject) : DisplayObject; + private function set_overState(value : DisplayObject) : DisplayObject; + private function set_soundTransform(value : flash.media.SoundTransform) : flash.media.SoundTransform; + private function set_trackAsMenu(value : Bool) : Bool; + private function set_upState(value : DisplayObject) : DisplayObject; + private function set_useHandCursor(value : Bool) : Bool; +} diff --git a/build/linux64_569e52e/std/flash/display/SpreadMethod.hx b/build/linux64_569e52e/std/flash/display/SpreadMethod.hx new file mode 100644 index 0000000..d2f8a18 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/SpreadMethod.hx @@ -0,0 +1,7 @@ +package flash.display; + +@:native("flash.display.SpreadMethod") extern enum abstract SpreadMethod(String) { + var PAD; + var REFLECT; + var REPEAT; +} diff --git a/build/linux64_569e52e/std/flash/display/Sprite.hx b/build/linux64_569e52e/std/flash/display/Sprite.hx new file mode 100644 index 0000000..b238ae8 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/Sprite.hx @@ -0,0 +1,25 @@ +package flash.display; + +extern class Sprite extends DisplayObjectContainer { + @:flash.property var buttonMode(get,set) : Bool; + @:flash.property var dropTarget(get,never) : DisplayObject; + @:flash.property var graphics(get,never) : Graphics; + @:flash.property var hitArea(get,set) : Sprite; + @:flash.property var soundTransform(get,set) : flash.media.SoundTransform; + @:flash.property var useHandCursor(get,set) : Bool; + function new() : Void; + private function get_buttonMode() : Bool; + private function get_dropTarget() : DisplayObject; + private function get_graphics() : Graphics; + private function get_hitArea() : Sprite; + private function get_soundTransform() : flash.media.SoundTransform; + private function get_useHandCursor() : Bool; + private function set_buttonMode(value : Bool) : Bool; + private function set_hitArea(value : Sprite) : Sprite; + private function set_soundTransform(value : flash.media.SoundTransform) : flash.media.SoundTransform; + private function set_useHandCursor(value : Bool) : Bool; + function startDrag(lockCenter : Bool = false, ?bounds : flash.geom.Rectangle) : Void; + @:require(flash10_1) function startTouchDrag(touchPointID : Int, lockCenter : Bool = false, ?bounds : flash.geom.Rectangle) : Void; + function stopDrag() : Void; + @:require(flash10_1) function stopTouchDrag(touchPointID : Int) : Void; +} diff --git a/build/linux64_569e52e/std/flash/display/Stage.hx b/build/linux64_569e52e/std/flash/display/Stage.hx new file mode 100644 index 0000000..0edf295 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/Stage.hx @@ -0,0 +1,74 @@ +package flash.display; + +extern class Stage extends DisplayObjectContainer { + @:flash.property var align(get,set) : StageAlign; + @:flash.property var allowsFullScreen(get,never) : Bool; + @:flash.property @:require(flash11_3) var allowsFullScreenInteractive(get,never) : Bool; + @:flash.property var browserZoomFactor(get,never) : Float; + @:flash.property @:require(flash10_2) var color(get,set) : UInt; + @:flash.property @:require(flash10) var colorCorrection(get,set) : ColorCorrection; + @:flash.property @:require(flash10) var colorCorrectionSupport(get,never) : ColorCorrectionSupport; + @:flash.property @:require(flash11_4) var contentsScaleFactor(get,never) : Float; + @:flash.property @:require(flash11) var displayContextInfo(get,never) : String; + @:flash.property var displayState(get,set) : StageDisplayState; + @:flash.property var focus(get,set) : InteractiveObject; + @:flash.property var frameRate(get,set) : Float; + @:flash.property var fullScreenHeight(get,never) : UInt; + @:flash.property var fullScreenSourceRect(get,set) : flash.geom.Rectangle; + @:flash.property var fullScreenWidth(get,never) : UInt; + @:flash.property @:require(flash11_2) var mouseLock(get,set) : Bool; + @:flash.property var quality(get,set) : StageQuality; + @:flash.property var scaleMode(get,set) : StageScaleMode; + @:flash.property var showDefaultContextMenu(get,set) : Bool; + @:flash.property @:require(flash11) var softKeyboardRect(get,never) : flash.geom.Rectangle; + @:flash.property @:require(flash11) var stage3Ds(get,never) : flash.Vector; + @:flash.property var stageFocusRect(get,set) : Bool; + @:flash.property var stageHeight(get,set) : Int; + @:flash.property @:require(flash10_2) var stageVideos(get,never) : flash.Vector; + @:flash.property var stageWidth(get,set) : Int; + @:flash.property @:require(flash10_1) var wmodeGPU(get,never) : Bool; + private function get_align() : StageAlign; + private function get_allowsFullScreen() : Bool; + private function get_allowsFullScreenInteractive() : Bool; + private function get_browserZoomFactor() : Float; + private function get_color() : UInt; + private function get_colorCorrection() : ColorCorrection; + private function get_colorCorrectionSupport() : ColorCorrectionSupport; + private function get_constructor() : Dynamic; + private function get_contentsScaleFactor() : Float; + private function get_displayContextInfo() : String; + private function get_displayState() : StageDisplayState; + private function get_focus() : InteractiveObject; + private function get_frameRate() : Float; + private function get_fullScreenHeight() : UInt; + private function get_fullScreenSourceRect() : flash.geom.Rectangle; + private function get_fullScreenWidth() : UInt; + private function get_mouseLock() : Bool; + private function get_quality() : StageQuality; + private function get_scaleMode() : StageScaleMode; + private function get_showDefaultContextMenu() : Bool; + private function get_softKeyboardRect() : flash.geom.Rectangle; + private function get_stage3Ds() : flash.Vector; + private function get_stageFocusRect() : Bool; + private function get_stageHeight() : Int; + private function get_stageVideos() : flash.Vector; + private function get_stageWidth() : Int; + private function get_wmodeGPU() : Bool; + function invalidate() : Void; + function isFocusInaccessible() : Bool; + private function set_align(value : StageAlign) : StageAlign; + private function set_color(value : UInt) : UInt; + private function set_colorCorrection(value : ColorCorrection) : ColorCorrection; + private function set_constructor(value : Dynamic) : Dynamic; + private function set_displayState(value : StageDisplayState) : StageDisplayState; + private function set_focus(value : InteractiveObject) : InteractiveObject; + private function set_frameRate(value : Float) : Float; + private function set_fullScreenSourceRect(value : flash.geom.Rectangle) : flash.geom.Rectangle; + private function set_mouseLock(value : Bool) : Bool; + private function set_quality(value : StageQuality) : StageQuality; + private function set_scaleMode(value : StageScaleMode) : StageScaleMode; + private function set_showDefaultContextMenu(value : Bool) : Bool; + private function set_stageFocusRect(value : Bool) : Bool; + private function set_stageHeight(value : Int) : Int; + private function set_stageWidth(value : Int) : Int; +} diff --git a/build/linux64_569e52e/std/flash/display/Stage3D.hx b/build/linux64_569e52e/std/flash/display/Stage3D.hx new file mode 100644 index 0000000..30abb2f --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/Stage3D.hx @@ -0,0 +1,17 @@ +package flash.display; + +@:require(flash11) extern class Stage3D extends flash.events.EventDispatcher { + @:flash.property var context3D(get,never) : flash.display3D.Context3D; + @:flash.property var visible(get,set) : Bool; + @:flash.property var x(get,set) : Float; + @:flash.property var y(get,set) : Float; + private function get_context3D() : flash.display3D.Context3D; + private function get_visible() : Bool; + private function get_x() : Float; + private function get_y() : Float; + function requestContext3D(?context3DRenderMode : String, ?profile : flash.display3D.Context3DProfile) : Void; + @:require(flash12) function requestContext3DMatchingProfiles(profiles : flash.Vector) : Void; + private function set_visible(value : Bool) : Bool; + private function set_x(value : Float) : Float; + private function set_y(value : Float) : Float; +} diff --git a/build/linux64_569e52e/std/flash/display/StageAlign.hx b/build/linux64_569e52e/std/flash/display/StageAlign.hx new file mode 100644 index 0000000..b236991 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/StageAlign.hx @@ -0,0 +1,12 @@ +package flash.display; + +@:native("flash.display.StageAlign") extern enum abstract StageAlign(String) { + var BOTTOM; + var BOTTOM_LEFT; + var BOTTOM_RIGHT; + var LEFT; + var RIGHT; + var TOP; + var TOP_LEFT; + var TOP_RIGHT; +} diff --git a/build/linux64_569e52e/std/flash/display/StageDisplayState.hx b/build/linux64_569e52e/std/flash/display/StageDisplayState.hx new file mode 100644 index 0000000..12311c7 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/StageDisplayState.hx @@ -0,0 +1,7 @@ +package flash.display; + +@:native("flash.display.StageDisplayState") extern enum abstract StageDisplayState(String) { + var FULL_SCREEN; + var FULL_SCREEN_INTERACTIVE; + var NORMAL; +} diff --git a/build/linux64_569e52e/std/flash/display/StageQuality.hx b/build/linux64_569e52e/std/flash/display/StageQuality.hx new file mode 100644 index 0000000..5237a4a --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/StageQuality.hx @@ -0,0 +1,12 @@ +package flash.display; + +@:native("flash.display.StageQuality") extern enum abstract StageQuality(String) { + var BEST; + var HIGH; + var HIGH_16X16; + var HIGH_16X16_LINEAR; + var HIGH_8X8; + var HIGH_8X8_LINEAR; + var LOW; + var MEDIUM; +} diff --git a/build/linux64_569e52e/std/flash/display/StageScaleMode.hx b/build/linux64_569e52e/std/flash/display/StageScaleMode.hx new file mode 100644 index 0000000..027fcbe --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/StageScaleMode.hx @@ -0,0 +1,8 @@ +package flash.display; + +@:native("flash.display.StageScaleMode") extern enum abstract StageScaleMode(String) { + var EXACT_FIT; + var NO_BORDER; + var NO_SCALE; + var SHOW_ALL; +} diff --git a/build/linux64_569e52e/std/flash/display/StageWorker.hx b/build/linux64_569e52e/std/flash/display/StageWorker.hx new file mode 100644 index 0000000..164675f --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/StageWorker.hx @@ -0,0 +1,7 @@ +package flash.display; + +@:require(flash11_2) extern final class StageWorker extends Sprite { + var scaleMode : String; + var viewport : flash.geom.Rectangle; + function new() : Void; +} diff --git a/build/linux64_569e52e/std/flash/display/TriangleCulling.hx b/build/linux64_569e52e/std/flash/display/TriangleCulling.hx new file mode 100644 index 0000000..01a2394 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/TriangleCulling.hx @@ -0,0 +1,7 @@ +package flash.display; + +@:native("flash.display.TriangleCulling") extern enum abstract TriangleCulling(String) { + var NEGATIVE; + var NONE; + var POSITIVE; +} diff --git a/build/linux64_569e52e/std/flash/display/Worker.hx b/build/linux64_569e52e/std/flash/display/Worker.hx new file mode 100644 index 0000000..71cdc28 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display/Worker.hx @@ -0,0 +1,9 @@ +package flash.display; + +@:require(flash11_2) extern final class Worker extends flash.events.EventDispatcher { + var running(default,null) : Bool; + var view(default,null) : StageWorker; + function new() : Void; + function load(request : flash.net.URLRequest) : Void; + function unload() : Void; +} diff --git a/build/linux64_569e52e/std/flash/display3D/Context3D.hx b/build/linux64_569e52e/std/flash/display3D/Context3D.hx new file mode 100644 index 0000000..549f13a --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/Context3D.hx @@ -0,0 +1,54 @@ +package flash.display3D; + +extern final class Context3D extends flash.events.EventDispatcher { + @:flash.property var backBufferHeight(get,never) : Int; + @:flash.property var backBufferWidth(get,never) : Int; + @:flash.property var driverInfo(get,never) : String; + @:flash.property var enableErrorChecking(get,set) : Bool; + @:flash.property var maxBackBufferHeight(get,set) : Int; + @:flash.property var maxBackBufferWidth(get,set) : Int; + @:flash.property @:require(flash12) var profile(get,never) : String; + @:flash.property var totalGPUMemory(get,never) : Float; + function clear(red : Float = 0, green : Float = 0, blue : Float = 0, alpha : Float = 1, depth : Float = 1, stencil : UInt = 0, mask : UInt = 0xFFFFFFFF) : Void; + function configureBackBuffer(width : Int, height : Int, antiAlias : Int, enableDepthAndStencil : Bool = true, wantsBestResolution : Bool = false, wantsBestResolutionOnBrowserZoom : Bool = false) : Void; + function createCubeTexture(size : Int, format : Context3DTextureFormat, optimizeForRenderToTexture : Bool, streamingLevels : Int = 0) : flash.display3D.textures.CubeTexture; + function createIndexBuffer(numIndices : Int, ?bufferUsage : Context3DBufferUsage) : IndexBuffer3D; + function createProgram() : Program3D; + @:require(flash11_8) function createRectangleTexture(width : Int, height : Int, format : Context3DTextureFormat, optimizeForRenderToTexture : Bool) : flash.display3D.textures.RectangleTexture; + function createTexture(width : Int, height : Int, format : Context3DTextureFormat, optimizeForRenderToTexture : Bool, streamingLevels : Int = 0) : flash.display3D.textures.Texture; + function createVertexBuffer(numVertices : Int, data32PerVertex : Int, ?bufferUsage : Context3DBufferUsage) : VertexBuffer3D; + function createVideoTexture() : flash.display3D.textures.VideoTexture; + function dispose(recreate : Bool = true) : Void; + function drawToBitmapData(destination : flash.display.BitmapData) : Void; + function drawTriangles(indexBuffer : IndexBuffer3D, firstIndex : Int = 0, numTriangles : Int = -1) : Void; + private function get_backBufferHeight() : Int; + private function get_backBufferWidth() : Int; + private function get_driverInfo() : String; + private function get_enableErrorChecking() : Bool; + private function get_maxBackBufferHeight() : Int; + private function get_maxBackBufferWidth() : Int; + private function get_profile() : String; + private function get_totalGPUMemory() : Float; + function present() : Void; + function setBlendFactors(sourceFactor : Context3DBlendFactor, destinationFactor : Context3DBlendFactor) : Void; + function setColorMask(red : Bool, green : Bool, blue : Bool, alpha : Bool) : Void; + function setCulling(triangleFaceToCull : Context3DTriangleFace) : Void; + function setDepthTest(depthMask : Bool, passCompareMode : Context3DCompareMode) : Void; + function setProgram(program : Program3D) : Void; + @:require(flash11_2) function setProgramConstantsFromByteArray(programType : Context3DProgramType, firstRegister : Int, numRegisters : Int, data : flash.utils.ByteArray, byteArrayOffset : UInt) : Void; + function setProgramConstantsFromMatrix(programType : Context3DProgramType, firstRegister : Int, matrix : flash.geom.Matrix3D, transposedMatrix : Bool = false) : Void; + function setProgramConstantsFromVector(programType : Context3DProgramType, firstRegister : Int, data : flash.Vector, numRegisters : Int = -1) : Void; + function setRenderToBackBuffer() : Void; + function setRenderToTexture(texture : flash.display3D.textures.TextureBase, enableDepthAndStencil : Bool = false, antiAlias : Int = 0, surfaceSelector : Int = 0, colorOutputIndex : Int = 0) : Void; + @:require(flash11_6) function setSamplerStateAt(sampler : Int, wrap : Context3DWrapMode, filter : Context3DTextureFilter, mipfilter : Context3DMipFilter) : Void; + function setScissorRectangle(rectangle : flash.geom.Rectangle) : Void; + function setStencilActions(?triangleFace : Context3DTriangleFace, ?compareMode : Context3DCompareMode, ?actionOnBothPass : Context3DStencilAction, ?actionOnDepthFail : Context3DStencilAction, ?actionOnDepthPassStencilFail : Context3DStencilAction) : Void; + function setStencilReferenceValue(referenceValue : UInt, readMask : UInt = 255, writeMask : UInt = 255) : Void; + function setTextureAt(sampler : Int, texture : flash.display3D.textures.TextureBase) : Void; + function setVertexBufferAt(index : Int, buffer : VertexBuffer3D, bufferOffset : Int = 0, ?format : Context3DVertexBufferFormat) : Void; + private function set_enableErrorChecking(value : Bool) : Bool; + private function set_maxBackBufferHeight(value : Int) : Int; + private function set_maxBackBufferWidth(value : Int) : Int; + @:flash.property static var supportsVideoTexture(get,never) : Bool; + private static function get_supportsVideoTexture() : Bool; +} diff --git a/build/linux64_569e52e/std/flash/display3D/Context3DBlendFactor.hx b/build/linux64_569e52e/std/flash/display3D/Context3DBlendFactor.hx new file mode 100644 index 0000000..225a678 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/Context3DBlendFactor.hx @@ -0,0 +1,14 @@ +package flash.display3D; + +@:native("flash.display3D.Context3DBlendFactor") extern enum abstract Context3DBlendFactor(String) { + var DESTINATION_ALPHA; + var DESTINATION_COLOR; + var ONE; + var ONE_MINUS_DESTINATION_ALPHA; + var ONE_MINUS_DESTINATION_COLOR; + var ONE_MINUS_SOURCE_ALPHA; + var ONE_MINUS_SOURCE_COLOR; + var SOURCE_ALPHA; + var SOURCE_COLOR; + var ZERO; +} diff --git a/build/linux64_569e52e/std/flash/display3D/Context3DBufferUsage.hx b/build/linux64_569e52e/std/flash/display3D/Context3DBufferUsage.hx new file mode 100644 index 0000000..f01b2ca --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/Context3DBufferUsage.hx @@ -0,0 +1,6 @@ +package flash.display3D; + +@:native("flash.display3D.Context3DBufferUsage") @:require(flash12) extern enum abstract Context3DBufferUsage(String) { + var DYNAMIC_DRAW; + var STATIC_DRAW; +} diff --git a/build/linux64_569e52e/std/flash/display3D/Context3DClearMask.hx b/build/linux64_569e52e/std/flash/display3D/Context3DClearMask.hx new file mode 100644 index 0000000..c20e86e --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/Context3DClearMask.hx @@ -0,0 +1,8 @@ +package flash.display3D; + +extern class Context3DClearMask { + static final ALL : Int; + static final COLOR : Int; + static final DEPTH : Int; + static final STENCIL : Int; +} diff --git a/build/linux64_569e52e/std/flash/display3D/Context3DCompareMode.hx b/build/linux64_569e52e/std/flash/display3D/Context3DCompareMode.hx new file mode 100644 index 0000000..7bca910 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/Context3DCompareMode.hx @@ -0,0 +1,12 @@ +package flash.display3D; + +@:native("flash.display3D.Context3DCompareMode") extern enum abstract Context3DCompareMode(String) { + var ALWAYS; + var EQUAL; + var GREATER; + var GREATER_EQUAL; + var LESS; + var LESS_EQUAL; + var NEVER; + var NOT_EQUAL; +} diff --git a/build/linux64_569e52e/std/flash/display3D/Context3DFillMode.hx b/build/linux64_569e52e/std/flash/display3D/Context3DFillMode.hx new file mode 100644 index 0000000..5c44208 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/Context3DFillMode.hx @@ -0,0 +1,6 @@ +package flash.display3D; + +@:native("flash.display3D.Context3DFillMode") @:require(flash16) extern enum abstract Context3DFillMode(String) { + var SOLID; + var WIREFRAME; +} diff --git a/build/linux64_569e52e/std/flash/display3D/Context3DMipFilter.hx b/build/linux64_569e52e/std/flash/display3D/Context3DMipFilter.hx new file mode 100644 index 0000000..6f10e9c --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/Context3DMipFilter.hx @@ -0,0 +1,7 @@ +package flash.display3D; + +@:native("flash.display3D.Context3DMipFilter") extern enum abstract Context3DMipFilter(String) { + var MIPLINEAR; + var MIPNEAREST; + var MIPNONE; +} diff --git a/build/linux64_569e52e/std/flash/display3D/Context3DProfile.hx b/build/linux64_569e52e/std/flash/display3D/Context3DProfile.hx new file mode 100644 index 0000000..6ff113f --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/Context3DProfile.hx @@ -0,0 +1,10 @@ +package flash.display3D; + +@:native("flash.display3D.Context3DProfile") extern enum abstract Context3DProfile(String) { + var BASELINE; + var BASELINE_CONSTRAINED; + var BASELINE_EXTENDED; + var STANDARD; + var STANDARD_CONSTRAINED; + var STANDARD_EXTENDED; +} diff --git a/build/linux64_569e52e/std/flash/display3D/Context3DProgramType.hx b/build/linux64_569e52e/std/flash/display3D/Context3DProgramType.hx new file mode 100644 index 0000000..e1447e3 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/Context3DProgramType.hx @@ -0,0 +1,6 @@ +package flash.display3D; + +@:native("flash.display3D.Context3DProgramType") extern enum abstract Context3DProgramType(String) { + var FRAGMENT; + var VERTEX; +} diff --git a/build/linux64_569e52e/std/flash/display3D/Context3DRenderMode.hx b/build/linux64_569e52e/std/flash/display3D/Context3DRenderMode.hx new file mode 100644 index 0000000..286cc67 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/Context3DRenderMode.hx @@ -0,0 +1,6 @@ +package flash.display3D; + +@:native("flash.display3D.Context3DRenderMode") extern enum abstract Context3DRenderMode(String) { + var AUTO; + var SOFTWARE; +} diff --git a/build/linux64_569e52e/std/flash/display3D/Context3DStencilAction.hx b/build/linux64_569e52e/std/flash/display3D/Context3DStencilAction.hx new file mode 100644 index 0000000..6b29fc8 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/Context3DStencilAction.hx @@ -0,0 +1,12 @@ +package flash.display3D; + +@:native("flash.display3D.Context3DStencilAction") extern enum abstract Context3DStencilAction(String) { + var DECREMENT_SATURATE; + var DECREMENT_WRAP; + var INCREMENT_SATURATE; + var INCREMENT_WRAP; + var INVERT; + var KEEP; + var SET; + var ZERO; +} diff --git a/build/linux64_569e52e/std/flash/display3D/Context3DTextureFilter.hx b/build/linux64_569e52e/std/flash/display3D/Context3DTextureFilter.hx new file mode 100644 index 0000000..2e3e231 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/Context3DTextureFilter.hx @@ -0,0 +1,10 @@ +package flash.display3D; + +@:native("flash.display3D.Context3DTextureFilter") extern enum abstract Context3DTextureFilter(String) { + var ANISOTROPIC16X; + var ANISOTROPIC2X; + var ANISOTROPIC4X; + var ANISOTROPIC8X; + var LINEAR; + var NEAREST; +} diff --git a/build/linux64_569e52e/std/flash/display3D/Context3DTextureFormat.hx b/build/linux64_569e52e/std/flash/display3D/Context3DTextureFormat.hx new file mode 100644 index 0000000..32f5747 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/Context3DTextureFormat.hx @@ -0,0 +1,10 @@ +package flash.display3D; + +@:native("flash.display3D.Context3DTextureFormat") extern enum abstract Context3DTextureFormat(String) { + var BGRA; + var BGRA_PACKED; + var BGR_PACKED; + var COMPRESSED; + var COMPRESSED_ALPHA; + var RGBA_HALF_FLOAT; +} diff --git a/build/linux64_569e52e/std/flash/display3D/Context3DTriangleFace.hx b/build/linux64_569e52e/std/flash/display3D/Context3DTriangleFace.hx new file mode 100644 index 0000000..5bf25be --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/Context3DTriangleFace.hx @@ -0,0 +1,8 @@ +package flash.display3D; + +@:native("flash.display3D.Context3DTriangleFace") extern enum abstract Context3DTriangleFace(String) { + var BACK; + var FRONT; + var FRONT_AND_BACK; + var NONE; +} diff --git a/build/linux64_569e52e/std/flash/display3D/Context3DVertexBufferFormat.hx b/build/linux64_569e52e/std/flash/display3D/Context3DVertexBufferFormat.hx new file mode 100644 index 0000000..743b927 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/Context3DVertexBufferFormat.hx @@ -0,0 +1,9 @@ +package flash.display3D; + +@:native("flash.display3D.Context3DVertexBufferFormat") extern enum abstract Context3DVertexBufferFormat(String) { + var BYTES_4; + var FLOAT_1; + var FLOAT_2; + var FLOAT_3; + var FLOAT_4; +} diff --git a/build/linux64_569e52e/std/flash/display3D/Context3DWrapMode.hx b/build/linux64_569e52e/std/flash/display3D/Context3DWrapMode.hx new file mode 100644 index 0000000..0af6e59 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/Context3DWrapMode.hx @@ -0,0 +1,8 @@ +package flash.display3D; + +@:native("flash.display3D.Context3DWrapMode") extern enum abstract Context3DWrapMode(String) { + var CLAMP; + var CLAMP_U_REPEAT_V; + var REPEAT; + var REPEAT_U_CLAMP_V; +} diff --git a/build/linux64_569e52e/std/flash/display3D/IndexBuffer3D.hx b/build/linux64_569e52e/std/flash/display3D/IndexBuffer3D.hx new file mode 100644 index 0000000..fc41aed --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/IndexBuffer3D.hx @@ -0,0 +1,7 @@ +package flash.display3D; + +extern final class IndexBuffer3D { + function dispose() : Void; + function uploadFromByteArray(data : flash.utils.ByteArray, byteArrayOffset : Int, startOffset : Int, count : Int) : Void; + function uploadFromVector(data : flash.Vector, startOffset : Int, count : Int) : Void; +} diff --git a/build/linux64_569e52e/std/flash/display3D/Program3D.hx b/build/linux64_569e52e/std/flash/display3D/Program3D.hx new file mode 100644 index 0000000..8ac34a4 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/Program3D.hx @@ -0,0 +1,6 @@ +package flash.display3D; + +extern final class Program3D { + function dispose() : Void; + function upload(vertexProgram : flash.utils.ByteArray, fragmentProgram : flash.utils.ByteArray) : Void; +} diff --git a/build/linux64_569e52e/std/flash/display3D/VertexBuffer3D.hx b/build/linux64_569e52e/std/flash/display3D/VertexBuffer3D.hx new file mode 100644 index 0000000..336d6f1 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/VertexBuffer3D.hx @@ -0,0 +1,7 @@ +package flash.display3D; + +extern class VertexBuffer3D { + function dispose() : Void; + function uploadFromByteArray(data : flash.utils.ByteArray, byteArrayOffset : Int, startVertex : Int, numVertices : Int) : Void; + function uploadFromVector(data : flash.Vector, startVertex : Int, numVertices : Int) : Void; +} diff --git a/build/linux64_569e52e/std/flash/display3D/textures/CubeTexture.hx b/build/linux64_569e52e/std/flash/display3D/textures/CubeTexture.hx new file mode 100644 index 0000000..1d93b40 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/textures/CubeTexture.hx @@ -0,0 +1,7 @@ +package flash.display3D.textures; + +extern final class CubeTexture extends TextureBase { + function uploadCompressedTextureFromByteArray(data : flash.utils.ByteArray, byteArrayOffset : UInt, async : Bool = false) : Void; + function uploadFromBitmapData(source : flash.display.BitmapData, side : UInt, miplevel : UInt = 0) : Void; + function uploadFromByteArray(data : flash.utils.ByteArray, byteArrayOffset : UInt, side : UInt, miplevel : UInt = 0) : Void; +} diff --git a/build/linux64_569e52e/std/flash/display3D/textures/RectangleTexture.hx b/build/linux64_569e52e/std/flash/display3D/textures/RectangleTexture.hx new file mode 100644 index 0000000..01a34ac --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/textures/RectangleTexture.hx @@ -0,0 +1,7 @@ +package flash.display3D.textures; + +extern final class RectangleTexture extends TextureBase { + function new() : Void; + function uploadFromBitmapData(source : flash.display.BitmapData) : Void; + function uploadFromByteArray(data : flash.utils.ByteArray, byteArrayOffset : UInt) : Void; +} diff --git a/build/linux64_569e52e/std/flash/display3D/textures/Texture.hx b/build/linux64_569e52e/std/flash/display3D/textures/Texture.hx new file mode 100644 index 0000000..b47e2e8 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/textures/Texture.hx @@ -0,0 +1,7 @@ +package flash.display3D.textures; + +extern final class Texture extends TextureBase { + function uploadCompressedTextureFromByteArray(data : flash.utils.ByteArray, byteArrayOffset : UInt, async : Bool = false) : Void; + function uploadFromBitmapData(source : flash.display.BitmapData, miplevel : UInt = 0) : Void; + function uploadFromByteArray(data : flash.utils.ByteArray, byteArrayOffset : UInt, miplevel : UInt = 0) : Void; +} diff --git a/build/linux64_569e52e/std/flash/display3D/textures/TextureBase.hx b/build/linux64_569e52e/std/flash/display3D/textures/TextureBase.hx new file mode 100644 index 0000000..e135784 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/textures/TextureBase.hx @@ -0,0 +1,5 @@ +package flash.display3D.textures; + +extern class TextureBase extends flash.events.EventDispatcher { + function dispose() : Void; +} diff --git a/build/linux64_569e52e/std/flash/display3D/textures/VideoTexture.hx b/build/linux64_569e52e/std/flash/display3D/textures/VideoTexture.hx new file mode 100644 index 0000000..3955c75 --- /dev/null +++ b/build/linux64_569e52e/std/flash/display3D/textures/VideoTexture.hx @@ -0,0 +1,11 @@ +package flash.display3D.textures; + +extern final class VideoTexture extends TextureBase { + @:flash.property var videoHeight(get,never) : Int; + @:flash.property var videoWidth(get,never) : Int; + function new() : Void; + function attachCamera(theCamera : flash.media.Camera) : Void; + function attachNetStream(netStream : flash.net.NetStream) : Void; + private function get_videoHeight() : Int; + private function get_videoWidth() : Int; +} diff --git a/build/linux64_569e52e/std/flash/errors/ArgumentError.hx b/build/linux64_569e52e/std/flash/errors/ArgumentError.hx new file mode 100644 index 0000000..ad86325 --- /dev/null +++ b/build/linux64_569e52e/std/flash/errors/ArgumentError.hx @@ -0,0 +1,4 @@ +package flash.errors; + +@:native("ArgumentError") extern class ArgumentError extends Error { +} diff --git a/build/linux64_569e52e/std/flash/errors/DRMManagerError.hx b/build/linux64_569e52e/std/flash/errors/DRMManagerError.hx new file mode 100644 index 0000000..357bb4f --- /dev/null +++ b/build/linux64_569e52e/std/flash/errors/DRMManagerError.hx @@ -0,0 +1,8 @@ +package flash.errors; + +@:require(flash10_1) extern class DRMManagerError extends Error { + @:flash.property var subErrorID(get,never) : Int; + function new(message : String, id : Int, subErrorID : Int) : Void; + private function get_subErrorID() : Int; + function toString() : String; +} diff --git a/build/linux64_569e52e/std/flash/errors/DefinitionError.hx b/build/linux64_569e52e/std/flash/errors/DefinitionError.hx new file mode 100644 index 0000000..b6540d5 --- /dev/null +++ b/build/linux64_569e52e/std/flash/errors/DefinitionError.hx @@ -0,0 +1,4 @@ +package flash.errors; + +@:native("DefinitionError") extern class DefinitionError extends flash.errors.Error { +} diff --git a/build/linux64_569e52e/std/flash/errors/EOFError.hx b/build/linux64_569e52e/std/flash/errors/EOFError.hx new file mode 100644 index 0000000..185e3d6 --- /dev/null +++ b/build/linux64_569e52e/std/flash/errors/EOFError.hx @@ -0,0 +1,5 @@ +package flash.errors; + +extern class EOFError extends IOError { + function new(?message : String, id : Int = 0) : Void; +} diff --git a/build/linux64_569e52e/std/flash/errors/Error.hx b/build/linux64_569e52e/std/flash/errors/Error.hx new file mode 100644 index 0000000..4711f68 --- /dev/null +++ b/build/linux64_569e52e/std/flash/errors/Error.hx @@ -0,0 +1,13 @@ +package flash.errors; + +extern class Error #if !flash_strict implements Dynamic #end { + @:flash.property var errorID(get,never) : Int; + var message : Dynamic; + var name : Dynamic; + function new(?message : Dynamic, id : Dynamic = 0) : Void; + function getStackTrace() : String; + private function get_errorID() : Int; + static final length : Int; + static function getErrorMessage(index : Int) : String; + static function throwError(type : Class, index : UInt, restArgs : haxe.extern.Rest) : Dynamic; +} diff --git a/build/linux64_569e52e/std/flash/errors/EvalError.hx b/build/linux64_569e52e/std/flash/errors/EvalError.hx new file mode 100644 index 0000000..608792a --- /dev/null +++ b/build/linux64_569e52e/std/flash/errors/EvalError.hx @@ -0,0 +1,4 @@ +package flash.errors; + +@:native("EvalError") extern class EvalError extends flash.errors.Error { +} diff --git a/build/linux64_569e52e/std/flash/errors/IOError.hx b/build/linux64_569e52e/std/flash/errors/IOError.hx new file mode 100644 index 0000000..cc2ec37 --- /dev/null +++ b/build/linux64_569e52e/std/flash/errors/IOError.hx @@ -0,0 +1,5 @@ +package flash.errors; + +extern class IOError extends Error { + function new(?message : String, id : Int = 0) : Void; +} diff --git a/build/linux64_569e52e/std/flash/errors/IllegalOperationError.hx b/build/linux64_569e52e/std/flash/errors/IllegalOperationError.hx new file mode 100644 index 0000000..2dae305 --- /dev/null +++ b/build/linux64_569e52e/std/flash/errors/IllegalOperationError.hx @@ -0,0 +1,5 @@ +package flash.errors; + +extern class IllegalOperationError extends Error { + function new(?message : String, id : Int = 0) : Void; +} diff --git a/build/linux64_569e52e/std/flash/errors/InvalidSWFError.hx b/build/linux64_569e52e/std/flash/errors/InvalidSWFError.hx new file mode 100644 index 0000000..41e19c4 --- /dev/null +++ b/build/linux64_569e52e/std/flash/errors/InvalidSWFError.hx @@ -0,0 +1,5 @@ +package flash.errors; + +extern class InvalidSWFError extends Error { + function new(?message : String, id : Int = 0) : Void; +} diff --git a/build/linux64_569e52e/std/flash/errors/MemoryError.hx b/build/linux64_569e52e/std/flash/errors/MemoryError.hx new file mode 100644 index 0000000..ac94da3 --- /dev/null +++ b/build/linux64_569e52e/std/flash/errors/MemoryError.hx @@ -0,0 +1,5 @@ +package flash.errors; + +extern class MemoryError extends Error { + function new(?message : String, id : Int = 0) : Void; +} diff --git a/build/linux64_569e52e/std/flash/errors/RangeError.hx b/build/linux64_569e52e/std/flash/errors/RangeError.hx new file mode 100644 index 0000000..de21305 --- /dev/null +++ b/build/linux64_569e52e/std/flash/errors/RangeError.hx @@ -0,0 +1,4 @@ +package flash.errors; + +@:native("RangeError") extern class RangeError extends flash.errors.Error { +} diff --git a/build/linux64_569e52e/std/flash/errors/ReferenceError.hx b/build/linux64_569e52e/std/flash/errors/ReferenceError.hx new file mode 100644 index 0000000..a3bae3b --- /dev/null +++ b/build/linux64_569e52e/std/flash/errors/ReferenceError.hx @@ -0,0 +1,4 @@ +package flash.errors; + +@:native("ReferenceError") extern class ReferenceError extends flash.errors.Error { +} diff --git a/build/linux64_569e52e/std/flash/errors/ScriptTimeoutError.hx b/build/linux64_569e52e/std/flash/errors/ScriptTimeoutError.hx new file mode 100644 index 0000000..d6fbf80 --- /dev/null +++ b/build/linux64_569e52e/std/flash/errors/ScriptTimeoutError.hx @@ -0,0 +1,5 @@ +package flash.errors; + +extern class ScriptTimeoutError extends Error { + function new(?message : String, id : Int = 0) : Void; +} diff --git a/build/linux64_569e52e/std/flash/errors/SecurityError.hx b/build/linux64_569e52e/std/flash/errors/SecurityError.hx new file mode 100644 index 0000000..ed8f5c0 --- /dev/null +++ b/build/linux64_569e52e/std/flash/errors/SecurityError.hx @@ -0,0 +1,4 @@ +package flash.errors; + +@:native("SecurityError") extern class SecurityError extends Error { +} diff --git a/build/linux64_569e52e/std/flash/errors/StackOverflowError.hx b/build/linux64_569e52e/std/flash/errors/StackOverflowError.hx new file mode 100644 index 0000000..fff13d2 --- /dev/null +++ b/build/linux64_569e52e/std/flash/errors/StackOverflowError.hx @@ -0,0 +1,5 @@ +package flash.errors; + +extern class StackOverflowError extends Error { + function new(?message : String, id : Int = 0) : Void; +} diff --git a/build/linux64_569e52e/std/flash/errors/SyntaxError.hx b/build/linux64_569e52e/std/flash/errors/SyntaxError.hx new file mode 100644 index 0000000..11024e3 --- /dev/null +++ b/build/linux64_569e52e/std/flash/errors/SyntaxError.hx @@ -0,0 +1,4 @@ +package flash.errors; + +@:native("SyntaxError") extern class SyntaxError extends flash.errors.Error { +} diff --git a/build/linux64_569e52e/std/flash/errors/TypeError.hx b/build/linux64_569e52e/std/flash/errors/TypeError.hx new file mode 100644 index 0000000..0fcd9e0 --- /dev/null +++ b/build/linux64_569e52e/std/flash/errors/TypeError.hx @@ -0,0 +1,4 @@ +package flash.errors; + +@:native("TypeError") extern class TypeError extends Error { +} diff --git a/build/linux64_569e52e/std/flash/errors/URIError.hx b/build/linux64_569e52e/std/flash/errors/URIError.hx new file mode 100644 index 0000000..44a5c5c --- /dev/null +++ b/build/linux64_569e52e/std/flash/errors/URIError.hx @@ -0,0 +1,4 @@ +package flash.errors; + +@:native("URIError") extern class URIError extends flash.errors.Error { +} diff --git a/build/linux64_569e52e/std/flash/errors/UninitializedError.hx b/build/linux64_569e52e/std/flash/errors/UninitializedError.hx new file mode 100644 index 0000000..6be0832 --- /dev/null +++ b/build/linux64_569e52e/std/flash/errors/UninitializedError.hx @@ -0,0 +1,4 @@ +package flash.errors; + +@:native("UninitializedError") extern class UninitializedError extends flash.errors.Error { +} diff --git a/build/linux64_569e52e/std/flash/errors/VerifyError.hx b/build/linux64_569e52e/std/flash/errors/VerifyError.hx new file mode 100644 index 0000000..97cd5fa --- /dev/null +++ b/build/linux64_569e52e/std/flash/errors/VerifyError.hx @@ -0,0 +1,4 @@ +package flash.errors; + +@:native("VerifyError") extern class VerifyError extends Error { +} diff --git a/build/linux64_569e52e/std/flash/events/AVDictionaryDataEvent.hx b/build/linux64_569e52e/std/flash/events/AVDictionaryDataEvent.hx new file mode 100644 index 0000000..c5d2c59 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/AVDictionaryDataEvent.hx @@ -0,0 +1,10 @@ +package flash.events; + +extern class AVDictionaryDataEvent extends Event { + @:flash.property var dictionary(get,never) : flash.utils.Dictionary; + @:flash.property var time(get,never) : Float; + function new(?type : String, bubbles : Bool = false, cancelable : Bool = false, ?init_dictionary : flash.utils.Dictionary, init_dataTime : Float = 0) : Void; + private function get_dictionary() : flash.utils.Dictionary; + private function get_time() : Float; + static final AV_DICTIONARY_DATA : String; +} diff --git a/build/linux64_569e52e/std/flash/events/AVHTTPStatusEvent.hx b/build/linux64_569e52e/std/flash/events/AVHTTPStatusEvent.hx new file mode 100644 index 0000000..cea61c4 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/AVHTTPStatusEvent.hx @@ -0,0 +1,14 @@ +package flash.events; + +extern class AVHTTPStatusEvent extends Event { + @:flash.property var responseHeaders(get,set) : Array; + @:flash.property var responseURL(get,set) : String; + @:flash.property var status(get,never) : Int; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, status : Int = 0, ?responseUrl : String, ?responseHeaders : Array) : Void; + private function get_responseHeaders() : Array; + private function get_responseURL() : String; + private function get_status() : Int; + private function set_responseHeaders(value : Array) : Array; + private function set_responseURL(value : String) : String; + static final AV_HTTP_RESPONSE_STATUS : String; +} diff --git a/build/linux64_569e52e/std/flash/events/AVLoadInfoEvent.hx b/build/linux64_569e52e/std/flash/events/AVLoadInfoEvent.hx new file mode 100644 index 0000000..cd23ef4 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/AVLoadInfoEvent.hx @@ -0,0 +1,8 @@ +package flash.events; + +extern class AVLoadInfoEvent extends Event { + @:flash.property var loadInfo(get,never) : flash.utils.Dictionary; + function new(?type : String, bubbles : Bool = false, cancelable : Bool = false, ?inLoadInfo : flash.utils.Dictionary) : Void; + private function get_loadInfo() : flash.utils.Dictionary; + static final AV_LOAD_INFO : Dynamic; +} diff --git a/build/linux64_569e52e/std/flash/events/AVManifestLoadEvent.hx b/build/linux64_569e52e/std/flash/events/AVManifestLoadEvent.hx new file mode 100644 index 0000000..be53c47 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/AVManifestLoadEvent.hx @@ -0,0 +1,14 @@ +package flash.events; + +extern class AVManifestLoadEvent extends Event { + @:flash.property var duration(get,never) : Float; + @:flash.property var handle(get,never) : Int; + @:flash.property var result(get,never) : flash.media.AVResult; + @:flash.property var userData(get,never) : Int; + function new(?type : String, bubbles : Bool = false, cancelable : Bool = false, inResult : Int = 0, inUserData : Int = 0, inHandle : Int = 0, inDuration : Float = 0) : Void; + private function get_duration() : Float; + private function get_handle() : Int; + private function get_result() : flash.media.AVResult; + private function get_userData() : Int; + static final AV_MANIFEST_LOAD : String; +} diff --git a/build/linux64_569e52e/std/flash/events/AVPauseAtPeriodEndEvent.hx b/build/linux64_569e52e/std/flash/events/AVPauseAtPeriodEndEvent.hx new file mode 100644 index 0000000..cbf9fa5 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/AVPauseAtPeriodEndEvent.hx @@ -0,0 +1,8 @@ +package flash.events; + +extern class AVPauseAtPeriodEndEvent extends Event { + @:flash.property var userData(get,never) : Int; + function new(?type : String, bubbles : Bool = false, cancelable : Bool = false, userData : Int = 0) : Void; + private function get_userData() : Int; + static final AV_PAUSE_AT_PERIOD_END : String; +} diff --git a/build/linux64_569e52e/std/flash/events/AVPlayStateEvent.hx b/build/linux64_569e52e/std/flash/events/AVPlayStateEvent.hx new file mode 100644 index 0000000..6613ac6 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/AVPlayStateEvent.hx @@ -0,0 +1,8 @@ +package flash.events; + +extern class AVPlayStateEvent extends Event { + @:flash.property var playState(get,never) : flash.media.AVPlayState; + function new(?type : String, bubbles : Bool = false, cancelable : Bool = false, inState : Int = 0) : Void; + private function get_playState() : flash.media.AVPlayState; + static final AV_PLAY_STATE : String; +} diff --git a/build/linux64_569e52e/std/flash/events/AVStatusEvent.hx b/build/linux64_569e52e/std/flash/events/AVStatusEvent.hx new file mode 100644 index 0000000..5a3a270 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/AVStatusEvent.hx @@ -0,0 +1,28 @@ +package flash.events; + +extern class AVStatusEvent extends Event { + @:flash.property var description(get,never) : String; + @:flash.property var notificationType(get,never) : String; + @:flash.property var result(get,never) : flash.media.AVResult; + function new(?type : String, bubbles : Bool = false, cancelable : Bool = false, ?inNotificationType : String, inResult : Int = 0, ?inDescription : String) : Void; + private function get_description() : String; + private function get_notificationType() : String; + private function get_result() : flash.media.AVResult; + static final AV_STATUS : String; + static final BACKGROUND_MANIFEST_ERROR : String; + static final BACKGROUND_MANIFEST_WARNING : String; + static final BUFFER_STATE : String; + static final DECODER_TYPE : String; + static final DIMENSION_CHANGE : String; + static final ERROR : String; + static final INSERTION_COMPLETE : String; + static final LOAD_COMPLETE : String; + static final MANIFEST_UPDATE : String; + static final PLAY_STATE : String; + static final RENDER_TYPE : String; + static final SEEK_COMPLETE : String; + static final STEP_COMPLETE : String; + static final STREAM_SWITCH : String; + static final TRICKPLAY_ENDED : String; + static final WARNING : String; +} diff --git a/build/linux64_569e52e/std/flash/events/AVStreamSwitchEvent.hx b/build/linux64_569e52e/std/flash/events/AVStreamSwitchEvent.hx new file mode 100644 index 0000000..3ffc530 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/AVStreamSwitchEvent.hx @@ -0,0 +1,18 @@ +package flash.events; + +extern class AVStreamSwitchEvent extends Event { + @:flash.property var bitrate(get,never) : Int; + @:flash.property var description(get,never) : String; + @:flash.property var switchType(get,never) : Int; + @:flash.property var time(get,never) : Float; + @:flash.property var userData(get,never) : Int; + function new(?type : String, bubbles : Bool = false, cancelable : Bool = false, time : Float = 0, switchType : Int = 0, bitrate : Int = 0, ?description : String, userData : Int = 0) : Void; + private function get_bitrate() : Int; + private function get_description() : String; + private function get_switchType() : Int; + private function get_time() : Float; + private function get_userData() : Int; + static final ABR_SWITCH : Int; + static final AV_STREAM_SWITCH : String; + static final PERIOD_SWITCH : Int; +} diff --git a/build/linux64_569e52e/std/flash/events/AccelerometerEvent.hx b/build/linux64_569e52e/std/flash/events/AccelerometerEvent.hx new file mode 100644 index 0000000..430d1d7 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/AccelerometerEvent.hx @@ -0,0 +1,18 @@ +package flash.events; + +@:require(flash10_1) extern class AccelerometerEvent extends Event { + @:flash.property var accelerationX(get,set) : Float; + @:flash.property var accelerationY(get,set) : Float; + @:flash.property var accelerationZ(get,set) : Float; + @:flash.property var timestamp(get,set) : Float; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, timestamp : Float = 0, accelerationX : Float = 0, accelerationY : Float = 0, accelerationZ : Float = 0) : Void; + private function get_accelerationX() : Float; + private function get_accelerationY() : Float; + private function get_accelerationZ() : Float; + private function get_timestamp() : Float; + private function set_accelerationX(value : Float) : Float; + private function set_accelerationY(value : Float) : Float; + private function set_accelerationZ(value : Float) : Float; + private function set_timestamp(value : Float) : Float; + static final UPDATE : String; +} diff --git a/build/linux64_569e52e/std/flash/events/ActivityEvent.hx b/build/linux64_569e52e/std/flash/events/ActivityEvent.hx new file mode 100644 index 0000000..a746a51 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/ActivityEvent.hx @@ -0,0 +1,9 @@ +package flash.events; + +extern class ActivityEvent extends Event { + @:flash.property var activating(get,set) : Bool; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, activating : Bool = false) : Void; + private function get_activating() : Bool; + private function set_activating(value : Bool) : Bool; + static final ACTIVITY : String; +} diff --git a/build/linux64_569e52e/std/flash/events/AsyncErrorEvent.hx b/build/linux64_569e52e/std/flash/events/AsyncErrorEvent.hx new file mode 100644 index 0000000..f80c605 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/AsyncErrorEvent.hx @@ -0,0 +1,7 @@ +package flash.events; + +extern class AsyncErrorEvent extends ErrorEvent { + var error : flash.errors.Error; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?text : String, ?error : flash.errors.Error) : Void; + static final ASYNC_ERROR : String; +} diff --git a/build/linux64_569e52e/std/flash/events/AudioOutputChangeEvent.hx b/build/linux64_569e52e/std/flash/events/AudioOutputChangeEvent.hx new file mode 100644 index 0000000..e0aab74 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/AudioOutputChangeEvent.hx @@ -0,0 +1,8 @@ +package flash.events; + +extern class AudioOutputChangeEvent extends Event { + @:flash.property var reason(get,never) : String; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?reason : String) : Void; + private function get_reason() : String; + static final AUDIO_OUTPUT_CHANGE : String; +} diff --git a/build/linux64_569e52e/std/flash/events/ContextMenuEvent.hx b/build/linux64_569e52e/std/flash/events/ContextMenuEvent.hx new file mode 100644 index 0000000..be2bc27 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/ContextMenuEvent.hx @@ -0,0 +1,16 @@ +package flash.events; + +extern class ContextMenuEvent extends Event { + @:flash.property var contextMenuOwner(get,set) : flash.display.InteractiveObject; + @:flash.property @:require(flash10) var isMouseTargetInaccessible(get,set) : Bool; + @:flash.property var mouseTarget(get,set) : flash.display.InteractiveObject; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?mouseTarget : flash.display.InteractiveObject, ?contextMenuOwner : flash.display.InteractiveObject) : Void; + private function get_contextMenuOwner() : flash.display.InteractiveObject; + private function get_isMouseTargetInaccessible() : Bool; + private function get_mouseTarget() : flash.display.InteractiveObject; + private function set_contextMenuOwner(value : flash.display.InteractiveObject) : flash.display.InteractiveObject; + private function set_isMouseTargetInaccessible(value : Bool) : Bool; + private function set_mouseTarget(value : flash.display.InteractiveObject) : flash.display.InteractiveObject; + static final MENU_ITEM_SELECT : String; + static final MENU_SELECT : String; +} diff --git a/build/linux64_569e52e/std/flash/events/DRMAuthenticateEvent.hx b/build/linux64_569e52e/std/flash/events/DRMAuthenticateEvent.hx new file mode 100644 index 0000000..4c7d735 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/DRMAuthenticateEvent.hx @@ -0,0 +1,20 @@ +package flash.events; + +@:require(flash10_1) extern class DRMAuthenticateEvent extends Event { + @:flash.property var authenticationType(get,never) : String; + @:flash.property var header(get,never) : String; + @:flash.property var netstream(get,never) : flash.net.NetStream; + @:flash.property var passwordPrompt(get,never) : String; + @:flash.property var urlPrompt(get,never) : String; + @:flash.property var usernamePrompt(get,never) : String; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?header : String, ?userPrompt : String, ?passPrompt : String, ?urlPrompt : String, ?authenticationType : String, ?netstream : flash.net.NetStream) : Void; + private function get_authenticationType() : String; + private function get_header() : String; + private function get_netstream() : flash.net.NetStream; + private function get_passwordPrompt() : String; + private function get_urlPrompt() : String; + private function get_usernamePrompt() : String; + static final AUTHENTICATION_TYPE_DRM : String; + static final AUTHENTICATION_TYPE_PROXY : String; + static final DRM_AUTHENTICATE : String; +} diff --git a/build/linux64_569e52e/std/flash/events/DRMAuthenticationCompleteEvent.hx b/build/linux64_569e52e/std/flash/events/DRMAuthenticationCompleteEvent.hx new file mode 100644 index 0000000..47c01ce --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/DRMAuthenticationCompleteEvent.hx @@ -0,0 +1,15 @@ +package flash.events; + +@:require(flash10_1) extern class DRMAuthenticationCompleteEvent extends Event { + @:flash.property var domain(get,set) : String; + @:flash.property var serverURL(get,set) : String; + @:flash.property var token(get,set) : flash.utils.ByteArray; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?inServerURL : String, ?inDomain : String, ?inToken : flash.utils.ByteArray) : Void; + private function get_domain() : String; + private function get_serverURL() : String; + private function get_token() : flash.utils.ByteArray; + private function set_domain(value : String) : String; + private function set_serverURL(value : String) : String; + private function set_token(value : flash.utils.ByteArray) : flash.utils.ByteArray; + static final AUTHENTICATION_COMPLETE : String; +} diff --git a/build/linux64_569e52e/std/flash/events/DRMAuthenticationErrorEvent.hx b/build/linux64_569e52e/std/flash/events/DRMAuthenticationErrorEvent.hx new file mode 100644 index 0000000..62217a9 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/DRMAuthenticationErrorEvent.hx @@ -0,0 +1,15 @@ +package flash.events; + +@:require(flash10_1) extern class DRMAuthenticationErrorEvent extends ErrorEvent { + @:flash.property var domain(get,set) : String; + @:flash.property var serverURL(get,set) : String; + @:flash.property var subErrorID(get,set) : Int; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?inDetail : String, inErrorID : Int = 0, inSubErrorID : Int = 0, ?inServerURL : String, ?inDomain : String) : Void; + private function get_domain() : String; + private function get_serverURL() : String; + private function get_subErrorID() : Int; + private function set_domain(value : String) : String; + private function set_serverURL(value : String) : String; + private function set_subErrorID(value : Int) : Int; + static final AUTHENTICATION_ERROR : String; +} diff --git a/build/linux64_569e52e/std/flash/events/DRMCustomProperties.hx b/build/linux64_569e52e/std/flash/events/DRMCustomProperties.hx new file mode 100644 index 0000000..4c57a6a --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/DRMCustomProperties.hx @@ -0,0 +1,5 @@ +package flash.events; + +@:require(flash10_1) extern class DRMCustomProperties { + function new() : Void; +} diff --git a/build/linux64_569e52e/std/flash/events/DRMDeviceGroupErrorEvent.hx b/build/linux64_569e52e/std/flash/events/DRMDeviceGroupErrorEvent.hx new file mode 100644 index 0000000..3585a8c --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/DRMDeviceGroupErrorEvent.hx @@ -0,0 +1,17 @@ +package flash.events; + +extern class DRMDeviceGroupErrorEvent extends ErrorEvent { + @:flash.property var deviceGroup(get,set) : flash.net.drm.DRMDeviceGroup; + @:flash.property var drmUpdateNeeded(get,never) : Bool; + @:flash.property var subErrorID(get,set) : Int; + @:flash.property var systemUpdateNeeded(get,never) : Bool; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?errorDetail : String, errorCode : Int = 0, subErrorID : Int = 0, ?deviceGroup : flash.net.drm.DRMDeviceGroup, systemUpdateNeeded : Bool = false, drmUpdateNeeded : Bool = false) : Void; + private function get_deviceGroup() : flash.net.drm.DRMDeviceGroup; + private function get_drmUpdateNeeded() : Bool; + private function get_subErrorID() : Int; + private function get_systemUpdateNeeded() : Bool; + private function set_deviceGroup(value : flash.net.drm.DRMDeviceGroup) : flash.net.drm.DRMDeviceGroup; + private function set_subErrorID(value : Int) : Int; + static final ADD_TO_DEVICE_GROUP_ERROR : String; + static final REMOVE_FROM_DEVICE_GROUP_ERROR : String; +} diff --git a/build/linux64_569e52e/std/flash/events/DRMDeviceGroupEvent.hx b/build/linux64_569e52e/std/flash/events/DRMDeviceGroupEvent.hx new file mode 100644 index 0000000..2b579c2 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/DRMDeviceGroupEvent.hx @@ -0,0 +1,10 @@ +package flash.events; + +extern class DRMDeviceGroupEvent extends Event { + @:flash.property var deviceGroup(get,set) : flash.net.drm.DRMDeviceGroup; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?deviceGroup : flash.net.drm.DRMDeviceGroup) : Void; + private function get_deviceGroup() : flash.net.drm.DRMDeviceGroup; + private function set_deviceGroup(value : flash.net.drm.DRMDeviceGroup) : flash.net.drm.DRMDeviceGroup; + static final ADD_TO_DEVICE_GROUP_COMPLETE : String; + static final REMOVE_FROM_DEVICE_GROUP_COMPLETE : String; +} diff --git a/build/linux64_569e52e/std/flash/events/DRMErrorEvent.hx b/build/linux64_569e52e/std/flash/events/DRMErrorEvent.hx new file mode 100644 index 0000000..0f3cce7 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/DRMErrorEvent.hx @@ -0,0 +1,16 @@ +package flash.events; + +@:require(flash10_1) extern class DRMErrorEvent extends ErrorEvent { + @:flash.property var contentData(get,set) : flash.net.drm.DRMContentData; + @:flash.property var drmUpdateNeeded(get,never) : Bool; + @:flash.property var subErrorID(get,never) : Int; + @:flash.property var systemUpdateNeeded(get,never) : Bool; + function new(?type : String, bubbles : Bool = false, cancelable : Bool = false, ?inErrorDetail : String, inErrorCode : Int = 0, insubErrorID : Int = 0, ?inMetadata : flash.net.drm.DRMContentData, inSystemUpdateNeeded : Bool = false, inDrmUpdateNeeded : Bool = false) : Void; + private function get_contentData() : flash.net.drm.DRMContentData; + private function get_drmUpdateNeeded() : Bool; + private function get_subErrorID() : Int; + private function get_systemUpdateNeeded() : Bool; + private function set_contentData(value : flash.net.drm.DRMContentData) : flash.net.drm.DRMContentData; + static final DRM_ERROR : String; + static final DRM_LOAD_DEVICEID_ERROR : String; +} diff --git a/build/linux64_569e52e/std/flash/events/DRMLicenseRequestEvent.hx b/build/linux64_569e52e/std/flash/events/DRMLicenseRequestEvent.hx new file mode 100644 index 0000000..745b46d --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/DRMLicenseRequestEvent.hx @@ -0,0 +1,9 @@ +package flash.events; + +extern class DRMLicenseRequestEvent extends Event { + @:flash.property var serverURL(get,set) : String; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?inServerURL : String) : Void; + private function get_serverURL() : String; + private function set_serverURL(value : String) : String; + static final LICENSE_REQUEST : String; +} diff --git a/build/linux64_569e52e/std/flash/events/DRMMetadataEvent.hx b/build/linux64_569e52e/std/flash/events/DRMMetadataEvent.hx new file mode 100644 index 0000000..f279c73 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/DRMMetadataEvent.hx @@ -0,0 +1,10 @@ +package flash.events; + +extern class DRMMetadataEvent extends Event { + @:flash.property var drmMetadata(get,never) : flash.net.drm.DRMContentData; + @:flash.property var timestamp(get,never) : Float; + function new(?type : String, bubbles : Bool = false, cancelable : Bool = false, ?inMetadata : flash.utils.ByteArray, inTimestamp : Float = 0) : Void; + private function get_drmMetadata() : flash.net.drm.DRMContentData; + private function get_timestamp() : Float; + static final DRM_METADATA : String; +} diff --git a/build/linux64_569e52e/std/flash/events/DRMReturnVoucherCompleteEvent.hx b/build/linux64_569e52e/std/flash/events/DRMReturnVoucherCompleteEvent.hx new file mode 100644 index 0000000..31ef37d --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/DRMReturnVoucherCompleteEvent.hx @@ -0,0 +1,18 @@ +package flash.events; + +extern class DRMReturnVoucherCompleteEvent extends Event { + @:flash.property var licenseID(get,set) : String; + @:flash.property var numberOfVouchersReturned(get,set) : Int; + @:flash.property var policyID(get,set) : String; + @:flash.property var serverURL(get,set) : String; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?inServerURL : String, ?inLicenseID : String, ?inPolicyID : String, inNumberOfVouchersReturned : Int = 0) : Void; + private function get_licenseID() : String; + private function get_numberOfVouchersReturned() : Int; + private function get_policyID() : String; + private function get_serverURL() : String; + private function set_licenseID(value : String) : String; + private function set_numberOfVouchersReturned(value : Int) : Int; + private function set_policyID(value : String) : String; + private function set_serverURL(value : String) : String; + static final RETURN_VOUCHER_COMPLETE : String; +} diff --git a/build/linux64_569e52e/std/flash/events/DRMReturnVoucherErrorEvent.hx b/build/linux64_569e52e/std/flash/events/DRMReturnVoucherErrorEvent.hx new file mode 100644 index 0000000..91fc46f --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/DRMReturnVoucherErrorEvent.hx @@ -0,0 +1,18 @@ +package flash.events; + +extern class DRMReturnVoucherErrorEvent extends ErrorEvent { + @:flash.property var licenseID(get,set) : String; + @:flash.property var policyID(get,set) : String; + @:flash.property var serverURL(get,set) : String; + @:flash.property var subErrorID(get,set) : Int; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?inDetail : String, inErrorID : Int = 0, inSubErrorID : Int = 0, ?inServerURL : String, ?inLicenseID : String, ?inPolicyID : String) : Void; + private function get_licenseID() : String; + private function get_policyID() : String; + private function get_serverURL() : String; + private function get_subErrorID() : Int; + private function set_licenseID(value : String) : String; + private function set_policyID(value : String) : String; + private function set_serverURL(value : String) : String; + private function set_subErrorID(value : Int) : Int; + static final RETURN_VOUCHER_ERROR : String; +} diff --git a/build/linux64_569e52e/std/flash/events/DRMStatusEvent.hx b/build/linux64_569e52e/std/flash/events/DRMStatusEvent.hx new file mode 100644 index 0000000..b9e6018 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/DRMStatusEvent.hx @@ -0,0 +1,15 @@ +package flash.events; + +@:require(flash10_1) extern class DRMStatusEvent extends Event { + @:flash.property var contentData(get,set) : flash.net.drm.DRMContentData; + @:flash.property var isLocal(get,set) : Bool; + @:flash.property var voucher(get,set) : flash.net.drm.DRMVoucher; + function new(?type : String, bubbles : Bool = false, cancelable : Bool = false, ?inMetadata : flash.net.drm.DRMContentData, ?inVoucher : flash.net.drm.DRMVoucher, inLocal : Bool = false) : Void; + private function get_contentData() : flash.net.drm.DRMContentData; + private function get_isLocal() : Bool; + private function get_voucher() : flash.net.drm.DRMVoucher; + private function set_contentData(value : flash.net.drm.DRMContentData) : flash.net.drm.DRMContentData; + private function set_isLocal(value : Bool) : Bool; + private function set_voucher(value : flash.net.drm.DRMVoucher) : flash.net.drm.DRMVoucher; + static final DRM_STATUS : String; +} diff --git a/build/linux64_569e52e/std/flash/events/DataEvent.hx b/build/linux64_569e52e/std/flash/events/DataEvent.hx new file mode 100644 index 0000000..bbbde23 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/DataEvent.hx @@ -0,0 +1,10 @@ +package flash.events; + +extern class DataEvent extends TextEvent { + @:flash.property var data(get,set) : String; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?data : String) : Void; + private function get_data() : String; + private function set_data(value : String) : String; + static final DATA : String; + static final UPLOAD_COMPLETE_DATA : String; +} diff --git a/build/linux64_569e52e/std/flash/events/ErrorEvent.hx b/build/linux64_569e52e/std/flash/events/ErrorEvent.hx new file mode 100644 index 0000000..a8ed65b --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/ErrorEvent.hx @@ -0,0 +1,8 @@ +package flash.events; + +extern class ErrorEvent extends TextEvent { + @:flash.property @:require(flash10_1) var errorID(get,never) : Int; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?text : String, id : Int = 0) : Void; + private function get_errorID() : Int; + static final ERROR : String; +} diff --git a/build/linux64_569e52e/std/flash/events/Event.hx b/build/linux64_569e52e/std/flash/events/Event.hx new file mode 100644 index 0000000..6594afd --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/Event.hx @@ -0,0 +1,67 @@ +package flash.events; + +extern class Event { + @:flash.property var bubbles(get,never) : Bool; + @:flash.property var cancelable(get,never) : Bool; + @:flash.property var currentTarget(get,never) : Dynamic; + @:flash.property var eventPhase(get,never) : EventPhase; + @:flash.property var target(get,never) : Dynamic; + @:flash.property var type(get,never) : String; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false) : Void; + function clone() : Event; + function formatToString(className : String, restArgs : haxe.extern.Rest) : String; + private function get_bubbles() : Bool; + private function get_cancelable() : Bool; + private function get_currentTarget() : Dynamic; + private function get_eventPhase() : EventPhase; + private function get_target() : Dynamic; + private function get_type() : String; + function isDefaultPrevented() : Bool; + function preventDefault() : Void; + function stopImmediatePropagation() : Void; + function stopPropagation() : Void; + function toString() : String; + static final ACTIVATE : String; + static final ADDED : String; + static final ADDED_TO_STAGE : String; + static final BROWSER_ZOOM_CHANGE : String; + static final CANCEL : String; + static final CHANGE : String; + static final CHANNEL_MESSAGE : String; + static final CHANNEL_STATE : String; + @:require(flash10) static final CLEAR : String; + static final CLOSE : String; + static final COMPLETE : String; + static final CONNECT : String; + @:require(flash11) static final CONTEXT3D_CREATE : String; + @:require(flash10) static final COPY : String; + @:require(flash10) static final CUT : String; + static final DEACTIVATE : String; + static final ENTER_FRAME : String; + @:require(flash10) static final EXIT_FRAME : String; + @:require(flash10) static final FRAME_CONSTRUCTED : String; + @:require(flash11_3) static final FRAME_LABEL : String; + static final FULLSCREEN : String; + static final ID3 : String; + static final INIT : String; + static final MOUSE_LEAVE : String; + static final OPEN : String; + @:require(flash10) static final PASTE : String; + static final REMOVED : String; + static final REMOVED_FROM_STAGE : String; + static final RENDER : String; + static final RESIZE : String; + static final SCROLL : String; + static final SELECT : String; + @:require(flash10) static final SELECT_ALL : String; + static final SOUND_COMPLETE : String; + @:require(flash11_3) static final SUSPEND : String; + static final TAB_CHILDREN_CHANGE : String; + static final TAB_ENABLED_CHANGE : String; + static final TAB_INDEX_CHANGE : String; + @:require(flash11_3) static final TEXTURE_READY : String; + @:require(flash11) static final TEXT_INTERACTION_MODE_CHANGE : String; + static final UNLOAD : String; + static final VIDEO_FRAME : String; + static final WORKER_STATE : String; +} diff --git a/build/linux64_569e52e/std/flash/events/EventDispatcher.hx b/build/linux64_569e52e/std/flash/events/EventDispatcher.hx new file mode 100644 index 0000000..95df215 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/EventDispatcher.hx @@ -0,0 +1,11 @@ +package flash.events; + +extern class EventDispatcher implements IEventDispatcher { + function new(?target : IEventDispatcher) : Void; + function addEventListener(type : String, listener : Dynamic -> Void, useCapture : Bool = false, priority : Int = 0, useWeakReference : Bool = false) : Void; + function dispatchEvent(event : Event) : Bool; + function hasEventListener(type : String) : Bool; + function removeEventListener(type : String, listener : Dynamic -> Void, useCapture : Bool = false) : Void; + function toString() : String; + function willTrigger(type : String) : Bool; +} diff --git a/build/linux64_569e52e/std/flash/events/EventPhase.hx b/build/linux64_569e52e/std/flash/events/EventPhase.hx new file mode 100644 index 0000000..87e3f21 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/EventPhase.hx @@ -0,0 +1,7 @@ +package flash.events; + +@:native("flash.events.EventPhase") extern enum abstract EventPhase(UInt) { + var AT_TARGET; + var BUBBLING_PHASE; + var CAPTURING_PHASE; +} diff --git a/build/linux64_569e52e/std/flash/events/FocusEvent.hx b/build/linux64_569e52e/std/flash/events/FocusEvent.hx new file mode 100644 index 0000000..98c0dc5 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/FocusEvent.hx @@ -0,0 +1,21 @@ +package flash.events; + +extern class FocusEvent extends Event { + @:flash.property @:require(flash10) var isRelatedObjectInaccessible(get,set) : Bool; + @:flash.property var keyCode(get,set) : UInt; + @:flash.property var relatedObject(get,set) : flash.display.InteractiveObject; + @:flash.property var shiftKey(get,set) : Bool; + function new(type : String, bubbles : Bool = true, cancelable : Bool = false, ?relatedObject : flash.display.InteractiveObject, shiftKey : Bool = false, keyCode : UInt = 0) : Void; + private function get_isRelatedObjectInaccessible() : Bool; + private function get_keyCode() : UInt; + private function get_relatedObject() : flash.display.InteractiveObject; + private function get_shiftKey() : Bool; + private function set_isRelatedObjectInaccessible(value : Bool) : Bool; + private function set_keyCode(value : UInt) : UInt; + private function set_relatedObject(value : flash.display.InteractiveObject) : flash.display.InteractiveObject; + private function set_shiftKey(value : Bool) : Bool; + static final FOCUS_IN : String; + static final FOCUS_OUT : String; + static final KEY_FOCUS_CHANGE : String; + static final MOUSE_FOCUS_CHANGE : String; +} diff --git a/build/linux64_569e52e/std/flash/events/FullScreenEvent.hx b/build/linux64_569e52e/std/flash/events/FullScreenEvent.hx new file mode 100644 index 0000000..4aa4541 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/FullScreenEvent.hx @@ -0,0 +1,11 @@ +package flash.events; + +extern class FullScreenEvent extends ActivityEvent { + @:flash.property var fullScreen(get,never) : Bool; + @:flash.property @:require(flash11_3) var interactive(get,never) : Bool; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, fullScreen : Bool = false, interactive : Bool = false) : Void; + private function get_fullScreen() : Bool; + private function get_interactive() : Bool; + static final FULL_SCREEN : String; + @:require(flash11_3) static final FULL_SCREEN_INTERACTIVE_ACCEPTED : String; +} diff --git a/build/linux64_569e52e/std/flash/events/GameInputEvent.hx b/build/linux64_569e52e/std/flash/events/GameInputEvent.hx new file mode 100644 index 0000000..5fd7288 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/GameInputEvent.hx @@ -0,0 +1,10 @@ +package flash.events; + +@:require(flash11_8) extern final class GameInputEvent extends Event { + @:flash.property var device(get,never) : flash.ui.GameInputDevice; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?device : flash.ui.GameInputDevice) : Void; + private function get_device() : flash.ui.GameInputDevice; + static final DEVICE_ADDED : String; + static final DEVICE_REMOVED : String; + static final DEVICE_UNUSABLE : String; +} diff --git a/build/linux64_569e52e/std/flash/events/GeolocationEvent.hx b/build/linux64_569e52e/std/flash/events/GeolocationEvent.hx new file mode 100644 index 0000000..2f2994a --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/GeolocationEvent.hx @@ -0,0 +1,30 @@ +package flash.events; + +@:require(flash10_1) extern class GeolocationEvent extends Event { + @:flash.property var altitude(get,set) : Float; + @:flash.property var heading(get,set) : Float; + @:flash.property var horizontalAccuracy(get,set) : Float; + @:flash.property var latitude(get,set) : Float; + @:flash.property var longitude(get,set) : Float; + @:flash.property var speed(get,set) : Float; + @:flash.property var timestamp(get,set) : Float; + @:flash.property var verticalAccuracy(get,set) : Float; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, latitude : Float = 0, longitude : Float = 0, altitude : Float = 0, hAccuracy : Float = 0, vAccuracy : Float = 0, speed : Float = 0, heading : Float = 0, timestamp : Float = 0) : Void; + private function get_altitude() : Float; + private function get_heading() : Float; + private function get_horizontalAccuracy() : Float; + private function get_latitude() : Float; + private function get_longitude() : Float; + private function get_speed() : Float; + private function get_timestamp() : Float; + private function get_verticalAccuracy() : Float; + private function set_altitude(value : Float) : Float; + private function set_heading(value : Float) : Float; + private function set_horizontalAccuracy(value : Float) : Float; + private function set_latitude(value : Float) : Float; + private function set_longitude(value : Float) : Float; + private function set_speed(value : Float) : Float; + private function set_timestamp(value : Float) : Float; + private function set_verticalAccuracy(value : Float) : Float; + static final UPDATE : String; +} diff --git a/build/linux64_569e52e/std/flash/events/GestureEvent.hx b/build/linux64_569e52e/std/flash/events/GestureEvent.hx new file mode 100644 index 0000000..6b061ab --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/GestureEvent.hx @@ -0,0 +1,29 @@ +package flash.events; + +@:require(flash10_1) extern class GestureEvent extends Event { + @:flash.property var altKey(get,set) : Bool; + @:flash.property var ctrlKey(get,set) : Bool; + @:flash.property var localX(get,set) : Float; + @:flash.property var localY(get,set) : Float; + @:flash.property var phase(get,set) : String; + @:flash.property var shiftKey(get,set) : Bool; + @:flash.property var stageX(get,never) : Float; + @:flash.property var stageY(get,never) : Float; + function new(type : String, bubbles : Bool = true, cancelable : Bool = false, ?phase : String, localX : Float = 0, localY : Float = 0, ctrlKey : Bool = false, altKey : Bool = false, shiftKey : Bool = false) : Void; + private function get_altKey() : Bool; + private function get_ctrlKey() : Bool; + private function get_localX() : Float; + private function get_localY() : Float; + private function get_phase() : String; + private function get_shiftKey() : Bool; + private function get_stageX() : Float; + private function get_stageY() : Float; + private function set_altKey(value : Bool) : Bool; + private function set_ctrlKey(value : Bool) : Bool; + private function set_localX(value : Float) : Float; + private function set_localY(value : Float) : Float; + private function set_phase(value : String) : String; + private function set_shiftKey(value : Bool) : Bool; + function updateAfterEvent() : Void; + static final GESTURE_TWO_FINGER_TAP : String; +} diff --git a/build/linux64_569e52e/std/flash/events/GesturePhase.hx b/build/linux64_569e52e/std/flash/events/GesturePhase.hx new file mode 100644 index 0000000..0780eb9 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/GesturePhase.hx @@ -0,0 +1,8 @@ +package flash.events; + +@:native("flash.events.GesturePhase") @:require(flash10_1) extern enum abstract GesturePhase(String) { + var ALL; + var BEGIN; + var END; + var UPDATE; +} diff --git a/build/linux64_569e52e/std/flash/events/HTTPStatusEvent.hx b/build/linux64_569e52e/std/flash/events/HTTPStatusEvent.hx new file mode 100644 index 0000000..fb75273 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/HTTPStatusEvent.hx @@ -0,0 +1,18 @@ +package flash.events; + +extern class HTTPStatusEvent extends Event { + @:flash.property var redirected(get,set) : Bool; + @:flash.property @:require(flash10_1) var responseHeaders(get,set) : Array; + @:flash.property @:require(flash10_1) var responseURL(get,set) : String; + @:flash.property var status(get,never) : Int; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, status : Int = 0, redirected : Bool = false) : Void; + private function get_redirected() : Bool; + private function get_responseHeaders() : Array; + private function get_responseURL() : String; + private function get_status() : Int; + private function set_redirected(value : Bool) : Bool; + private function set_responseHeaders(value : Array) : Array; + private function set_responseURL(value : String) : String; + @:require(flash10_1) static final HTTP_RESPONSE_STATUS : String; + static final HTTP_STATUS : String; +} diff --git a/build/linux64_569e52e/std/flash/events/IEventDispatcher.hx b/build/linux64_569e52e/std/flash/events/IEventDispatcher.hx new file mode 100644 index 0000000..4a7547f --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/IEventDispatcher.hx @@ -0,0 +1,9 @@ +package flash.events; + +extern interface IEventDispatcher { + function addEventListener(type : String, listener : Dynamic -> Void, useCapture : Bool = false, priority : Int = 0, useWeakReference : Bool = false) : Void; + function dispatchEvent(event : Event) : Bool; + function hasEventListener(type : String) : Bool; + function removeEventListener(type : String, listener : Dynamic -> Void, useCapture : Bool = false) : Void; + function willTrigger(type : String) : Bool; +} diff --git a/build/linux64_569e52e/std/flash/events/IMEEvent.hx b/build/linux64_569e52e/std/flash/events/IMEEvent.hx new file mode 100644 index 0000000..7b991dd --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/IMEEvent.hx @@ -0,0 +1,10 @@ +package flash.events; + +extern class IMEEvent extends TextEvent { + @:flash.property @:require(flash10_1) var imeClient(get,set) : flash.text.ime.IIMEClient; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?text : String, ?imeClient : flash.text.ime.IIMEClient) : Void; + private function get_imeClient() : flash.text.ime.IIMEClient; + private function set_imeClient(value : flash.text.ime.IIMEClient) : flash.text.ime.IIMEClient; + static final IME_COMPOSITION : String; + @:require(flash10_1) static final IME_START_COMPOSITION : String; +} diff --git a/build/linux64_569e52e/std/flash/events/IOErrorEvent.hx b/build/linux64_569e52e/std/flash/events/IOErrorEvent.hx new file mode 100644 index 0000000..3ca285b --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/IOErrorEvent.hx @@ -0,0 +1,9 @@ +package flash.events; + +extern class IOErrorEvent extends ErrorEvent { + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?text : String, id : Int = 0) : Void; + static final DISK_ERROR : String; + static final IO_ERROR : String; + static final NETWORK_ERROR : String; + static final VERIFY_ERROR : String; +} diff --git a/build/linux64_569e52e/std/flash/events/KeyboardEvent.hx b/build/linux64_569e52e/std/flash/events/KeyboardEvent.hx new file mode 100644 index 0000000..fee7714 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/KeyboardEvent.hx @@ -0,0 +1,26 @@ +package flash.events; + +extern class KeyboardEvent extends Event { + @:flash.property var altKey(get,set) : Bool; + @:flash.property var charCode(get,set) : UInt; + @:flash.property var ctrlKey(get,set) : Bool; + @:flash.property var keyCode(get,set) : UInt; + @:flash.property var keyLocation(get,set) : flash.ui.KeyLocation; + @:flash.property var shiftKey(get,set) : Bool; + function new(type : String, bubbles : Bool = true, cancelable : Bool = false, charCodeValue : UInt = 0, keyCodeValue : UInt = 0, keyLocationValue : flash.ui.KeyLocation = flash.ui.KeyLocation.D_PAD, ctrlKeyValue : Bool = false, altKeyValue : Bool = false, shiftKeyValue : Bool = false) : Void; + private function get_altKey() : Bool; + private function get_charCode() : UInt; + private function get_ctrlKey() : Bool; + private function get_keyCode() : UInt; + private function get_keyLocation() : flash.ui.KeyLocation; + private function get_shiftKey() : Bool; + private function set_altKey(value : Bool) : Bool; + private function set_charCode(value : UInt) : UInt; + private function set_ctrlKey(value : Bool) : Bool; + private function set_keyCode(value : UInt) : UInt; + private function set_keyLocation(value : flash.ui.KeyLocation) : flash.ui.KeyLocation; + private function set_shiftKey(value : Bool) : Bool; + function updateAfterEvent() : Void; + static final KEY_DOWN : String; + static final KEY_UP : String; +} diff --git a/build/linux64_569e52e/std/flash/events/MouseEvent.hx b/build/linux64_569e52e/std/flash/events/MouseEvent.hx new file mode 100644 index 0000000..9376f09 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/MouseEvent.hx @@ -0,0 +1,61 @@ +package flash.events; + +extern class MouseEvent extends Event { + @:flash.property var altKey(get,set) : Bool; + @:flash.property var buttonDown(get,set) : Bool; + @:flash.property var ctrlKey(get,set) : Bool; + @:flash.property var delta(get,set) : Int; + @:flash.property @:require(flash10) var isRelatedObjectInaccessible(get,set) : Bool; + @:flash.property var localX(get,set) : Float; + @:flash.property var localY(get,set) : Float; + @:flash.property @:require(flash11_2) var movementX(get,set) : Float; + @:flash.property @:require(flash11_2) var movementY(get,set) : Float; + @:flash.property var relatedObject(get,set) : flash.display.InteractiveObject; + @:flash.property var shiftKey(get,set) : Bool; + @:flash.property var stageX(get,never) : Float; + @:flash.property var stageY(get,never) : Float; + function new(type : String, bubbles : Bool = true, cancelable : Bool = false, localX : Null = 0, localY : Null = 0, ?relatedObject : flash.display.InteractiveObject, ctrlKey : Bool = false, altKey : Bool = false, shiftKey : Bool = false, buttonDown : Bool = false, delta : Int = 0) : Void; + private function get_altKey() : Bool; + private function get_buttonDown() : Bool; + private function get_ctrlKey() : Bool; + private function get_delta() : Int; + private function get_isRelatedObjectInaccessible() : Bool; + private function get_localX() : Float; + private function get_localY() : Float; + private function get_movementX() : Float; + private function get_movementY() : Float; + private function get_relatedObject() : flash.display.InteractiveObject; + private function get_shiftKey() : Bool; + private function get_stageX() : Float; + private function get_stageY() : Float; + private function set_altKey(value : Bool) : Bool; + private function set_buttonDown(value : Bool) : Bool; + private function set_ctrlKey(value : Bool) : Bool; + private function set_delta(value : Int) : Int; + private function set_isRelatedObjectInaccessible(value : Bool) : Bool; + private function set_localX(value : Float) : Float; + private function set_localY(value : Float) : Float; + private function set_movementX(value : Float) : Float; + private function set_movementY(value : Float) : Float; + private function set_relatedObject(value : flash.display.InteractiveObject) : flash.display.InteractiveObject; + private function set_shiftKey(value : Bool) : Bool; + function updateAfterEvent() : Void; + static final CLICK : String; + @:require(flash11_2) static final CONTEXT_MENU : String; + static final DOUBLE_CLICK : String; + @:require(flash11_2) static final MIDDLE_CLICK : String; + @:require(flash11_2) static final MIDDLE_MOUSE_DOWN : String; + @:require(flash11_2) static final MIDDLE_MOUSE_UP : String; + static final MOUSE_DOWN : String; + static final MOUSE_MOVE : String; + static final MOUSE_OUT : String; + static final MOUSE_OVER : String; + static final MOUSE_UP : String; + static final MOUSE_WHEEL : String; + @:require(flash11_3) static final RELEASE_OUTSIDE : String; + @:require(flash11_2) static final RIGHT_CLICK : String; + @:require(flash11_2) static final RIGHT_MOUSE_DOWN : String; + @:require(flash11_2) static final RIGHT_MOUSE_UP : String; + static final ROLL_OUT : String; + static final ROLL_OVER : String; +} diff --git a/build/linux64_569e52e/std/flash/events/NetDataEvent.hx b/build/linux64_569e52e/std/flash/events/NetDataEvent.hx new file mode 100644 index 0000000..686c600 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/NetDataEvent.hx @@ -0,0 +1,10 @@ +package flash.events; + +extern class NetDataEvent extends Event { + @:flash.property var info(get,never) : Dynamic; + @:flash.property var timestamp(get,never) : Float; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, timestamp : Float = 0, ?info : Dynamic) : Void; + private function get_info() : Dynamic; + private function get_timestamp() : Float; + static final MEDIA_TYPE_DATA : String; +} diff --git a/build/linux64_569e52e/std/flash/events/NetFilterEvent.hx b/build/linux64_569e52e/std/flash/events/NetFilterEvent.hx new file mode 100644 index 0000000..7d80a63 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/NetFilterEvent.hx @@ -0,0 +1,7 @@ +package flash.events; + +extern class NetFilterEvent extends Event { + var data : flash.utils.ByteArray; + var header : flash.utils.ByteArray; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?header : flash.utils.ByteArray, ?data : flash.utils.ByteArray) : Void; +} diff --git a/build/linux64_569e52e/std/flash/events/NetMonitorEvent.hx b/build/linux64_569e52e/std/flash/events/NetMonitorEvent.hx new file mode 100644 index 0000000..4355739 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/NetMonitorEvent.hx @@ -0,0 +1,8 @@ +package flash.events; + +extern class NetMonitorEvent extends Event { + @:flash.property var netStream(get,never) : flash.net.NetStream; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?netStream : flash.net.NetStream) : Void; + private function get_netStream() : flash.net.NetStream; + static final NET_STREAM_CREATE : String; +} diff --git a/build/linux64_569e52e/std/flash/events/NetStatusEvent.hx b/build/linux64_569e52e/std/flash/events/NetStatusEvent.hx new file mode 100644 index 0000000..60a4b87 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/NetStatusEvent.hx @@ -0,0 +1,9 @@ +package flash.events; + +extern class NetStatusEvent extends Event { + @:flash.property var info(get,set) : Dynamic; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?info : Dynamic) : Void; + private function get_info() : Dynamic; + private function set_info(value : Dynamic) : Dynamic; + static final NET_STATUS : String; +} diff --git a/build/linux64_569e52e/std/flash/events/OutputProgressEvent.hx b/build/linux64_569e52e/std/flash/events/OutputProgressEvent.hx new file mode 100644 index 0000000..358ffd9 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/OutputProgressEvent.hx @@ -0,0 +1,12 @@ +package flash.events; + +extern class OutputProgressEvent extends Event { + @:flash.property var bytesPending(get,set) : Float; + @:flash.property var bytesTotal(get,set) : Float; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, bytesPending : Float = 0, bytesTotal : Float = 0) : Void; + private function get_bytesPending() : Float; + private function get_bytesTotal() : Float; + private function set_bytesPending(value : Float) : Float; + private function set_bytesTotal(value : Float) : Float; + static final OUTPUT_PROGRESS : String; +} diff --git a/build/linux64_569e52e/std/flash/events/PressAndTapGestureEvent.hx b/build/linux64_569e52e/std/flash/events/PressAndTapGestureEvent.hx new file mode 100644 index 0000000..c1915b5 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/PressAndTapGestureEvent.hx @@ -0,0 +1,16 @@ +package flash.events; + +@:require(flash10_1) extern class PressAndTapGestureEvent extends GestureEvent { + @:flash.property var tapLocalX(get,set) : Float; + @:flash.property var tapLocalY(get,set) : Float; + @:flash.property var tapStageX(get,never) : Float; + @:flash.property var tapStageY(get,never) : Float; + function new(type : String, bubbles : Bool = true, cancelable : Bool = false, ?phase : String, localX : Float = 0, localY : Float = 0, tapLocalX : Float = 0, tapLocalY : Float = 0, ctrlKey : Bool = false, altKey : Bool = false, shiftKey : Bool = false) : Void; + private function get_tapLocalX() : Float; + private function get_tapLocalY() : Float; + private function get_tapStageX() : Float; + private function get_tapStageY() : Float; + private function set_tapLocalX(value : Float) : Float; + private function set_tapLocalY(value : Float) : Float; + static final GESTURE_PRESS_AND_TAP : String; +} diff --git a/build/linux64_569e52e/std/flash/events/ProgressEvent.hx b/build/linux64_569e52e/std/flash/events/ProgressEvent.hx new file mode 100644 index 0000000..21cc26a --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/ProgressEvent.hx @@ -0,0 +1,13 @@ +package flash.events; + +extern class ProgressEvent extends Event { + @:flash.property var bytesLoaded(get,set) : Float; + @:flash.property var bytesTotal(get,set) : Float; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, bytesLoaded : Float = 0, bytesTotal : Float = 0) : Void; + private function get_bytesLoaded() : Float; + private function get_bytesTotal() : Float; + private function set_bytesLoaded(value : Float) : Float; + private function set_bytesTotal(value : Float) : Float; + static final PROGRESS : String; + static final SOCKET_DATA : String; +} diff --git a/build/linux64_569e52e/std/flash/events/SampleDataEvent.hx b/build/linux64_569e52e/std/flash/events/SampleDataEvent.hx new file mode 100644 index 0000000..f9c9467 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/SampleDataEvent.hx @@ -0,0 +1,12 @@ +package flash.events; + +extern class SampleDataEvent extends Event { + @:flash.property var data(get,set) : flash.utils.ByteArray; + @:flash.property var position(get,set) : Float; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, theposition : Float = 0, ?thedata : flash.utils.ByteArray) : Void; + private function get_data() : flash.utils.ByteArray; + private function get_position() : Float; + private function set_data(value : flash.utils.ByteArray) : flash.utils.ByteArray; + private function set_position(value : Float) : Float; + static final SAMPLE_DATA : String; +} diff --git a/build/linux64_569e52e/std/flash/events/SecurityErrorEvent.hx b/build/linux64_569e52e/std/flash/events/SecurityErrorEvent.hx new file mode 100644 index 0000000..3baa8ed --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/SecurityErrorEvent.hx @@ -0,0 +1,6 @@ +package flash.events; + +extern class SecurityErrorEvent extends ErrorEvent { + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?text : String, id : Int = 0) : Void; + static final SECURITY_ERROR : String; +} diff --git a/build/linux64_569e52e/std/flash/events/ShaderEvent.hx b/build/linux64_569e52e/std/flash/events/ShaderEvent.hx new file mode 100644 index 0000000..2c09d4a --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/ShaderEvent.hx @@ -0,0 +1,15 @@ +package flash.events; + +extern class ShaderEvent extends Event { + @:flash.property var bitmapData(get,set) : flash.display.BitmapData; + @:flash.property var byteArray(get,set) : flash.utils.ByteArray; + @:flash.property var vector(get,set) : flash.Vector; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?bitmap : flash.display.BitmapData, ?array : flash.utils.ByteArray, ?vector : flash.Vector) : Void; + private function get_bitmapData() : flash.display.BitmapData; + private function get_byteArray() : flash.utils.ByteArray; + private function get_vector() : flash.Vector; + private function set_bitmapData(value : flash.display.BitmapData) : flash.display.BitmapData; + private function set_byteArray(value : flash.utils.ByteArray) : flash.utils.ByteArray; + private function set_vector(value : flash.Vector) : flash.Vector; + static final COMPLETE : String; +} diff --git a/build/linux64_569e52e/std/flash/events/SoftKeyboardEvent.hx b/build/linux64_569e52e/std/flash/events/SoftKeyboardEvent.hx new file mode 100644 index 0000000..1dcc37d --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/SoftKeyboardEvent.hx @@ -0,0 +1,13 @@ +package flash.events; + +extern class SoftKeyboardEvent extends Event { + @:flash.property var relatedObject(get,set) : flash.display.InteractiveObject; + @:flash.property var triggerType(get,never) : String; + function new(type : String, bubbles : Bool, cancelable : Bool, relatedObjectVal : flash.display.InteractiveObject, triggerTypeVal : String) : Void; + private function get_relatedObject() : flash.display.InteractiveObject; + private function get_triggerType() : String; + private function set_relatedObject(value : flash.display.InteractiveObject) : flash.display.InteractiveObject; + static final SOFT_KEYBOARD_ACTIVATE : String; + static final SOFT_KEYBOARD_ACTIVATING : String; + static final SOFT_KEYBOARD_DEACTIVATE : String; +} diff --git a/build/linux64_569e52e/std/flash/events/SoftKeyboardTrigger.hx b/build/linux64_569e52e/std/flash/events/SoftKeyboardTrigger.hx new file mode 100644 index 0000000..122d848 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/SoftKeyboardTrigger.hx @@ -0,0 +1,7 @@ +package flash.events; + +extern class SoftKeyboardTrigger { + function new() : Void; + static final CONTENT_TRIGGERED : String; + static final USER_TRIGGERED : String; +} diff --git a/build/linux64_569e52e/std/flash/events/StageVideoAvailabilityEvent.hx b/build/linux64_569e52e/std/flash/events/StageVideoAvailabilityEvent.hx new file mode 100644 index 0000000..d2dd353 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/StageVideoAvailabilityEvent.hx @@ -0,0 +1,10 @@ +package flash.events; + +extern class StageVideoAvailabilityEvent extends Event { + @:flash.property var availability(get,never) : String; + final driver : String; + final reason : String; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?availability : String) : Void; + private function get_availability() : String; + static final STAGE_VIDEO_AVAILABILITY : String; +} diff --git a/build/linux64_569e52e/std/flash/events/StageVideoEvent.hx b/build/linux64_569e52e/std/flash/events/StageVideoEvent.hx new file mode 100644 index 0000000..e54f0e2 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/StageVideoEvent.hx @@ -0,0 +1,14 @@ +package flash.events; + +@:require(flash10_2) extern class StageVideoEvent extends Event { + final codecInfo : String; + @:flash.property var colorSpace(get,never) : String; + @:flash.property var status(get,never) : String; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?status : String, ?colorSpace : String) : Void; + private function get_colorSpace() : String; + private function get_status() : String; + static final RENDER_STATE : String; + static final RENDER_STATUS_ACCELERATED : String; + static final RENDER_STATUS_SOFTWARE : String; + static final RENDER_STATUS_UNAVAILABLE : String; +} diff --git a/build/linux64_569e52e/std/flash/events/StatusEvent.hx b/build/linux64_569e52e/std/flash/events/StatusEvent.hx new file mode 100644 index 0000000..9831bcf --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/StatusEvent.hx @@ -0,0 +1,12 @@ +package flash.events; + +extern class StatusEvent extends Event { + @:flash.property var code(get,set) : String; + @:flash.property var level(get,set) : String; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?code : String, ?level : String) : Void; + private function get_code() : String; + private function get_level() : String; + private function set_code(value : String) : String; + private function set_level(value : String) : String; + static final STATUS : String; +} diff --git a/build/linux64_569e52e/std/flash/events/SyncEvent.hx b/build/linux64_569e52e/std/flash/events/SyncEvent.hx new file mode 100644 index 0000000..1d8718f --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/SyncEvent.hx @@ -0,0 +1,9 @@ +package flash.events; + +extern class SyncEvent extends Event { + @:flash.property var changeList(get,set) : Array; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?changeList : Array) : Void; + private function get_changeList() : Array; + private function set_changeList(value : Array) : Array; + static final SYNC : String; +} diff --git a/build/linux64_569e52e/std/flash/events/TextEvent.hx b/build/linux64_569e52e/std/flash/events/TextEvent.hx new file mode 100644 index 0000000..d1194bb --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/TextEvent.hx @@ -0,0 +1,10 @@ +package flash.events; + +extern class TextEvent extends Event { + @:flash.property var text(get,set) : String; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?text : String) : Void; + private function get_text() : String; + private function set_text(value : String) : String; + static final LINK : String; + static final TEXT_INPUT : String; +} diff --git a/build/linux64_569e52e/std/flash/events/ThrottleEvent.hx b/build/linux64_569e52e/std/flash/events/ThrottleEvent.hx new file mode 100644 index 0000000..0eb973e --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/ThrottleEvent.hx @@ -0,0 +1,10 @@ +package flash.events; + +@:require(flash11_2) extern class ThrottleEvent extends Event { + @:flash.property var state(get,never) : String; + @:flash.property var targetFrameRate(get,never) : Float; + function new(type : ThrottleType, bubbles : Bool = false, cancelable : Bool = false, ?state : String, targetFrameRate : Float = 0) : Void; + private function get_state() : String; + private function get_targetFrameRate() : Float; + static final THROTTLE : String; +} diff --git a/build/linux64_569e52e/std/flash/events/ThrottleType.hx b/build/linux64_569e52e/std/flash/events/ThrottleType.hx new file mode 100644 index 0000000..6b57d0c --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/ThrottleType.hx @@ -0,0 +1,7 @@ +package flash.events; + +@:native("flash.events.ThrottleType") extern enum abstract ThrottleType(String) { + var PAUSE; + var RESUME; + var THROTTLE; +} diff --git a/build/linux64_569e52e/std/flash/events/TimerEvent.hx b/build/linux64_569e52e/std/flash/events/TimerEvent.hx new file mode 100644 index 0000000..5ffc25b --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/TimerEvent.hx @@ -0,0 +1,8 @@ +package flash.events; + +extern class TimerEvent extends Event { + function new(type : String, bubbles : Bool = false, cancelable : Bool = false) : Void; + function updateAfterEvent() : Void; + static final TIMER : String; + static final TIMER_COMPLETE : String; +} diff --git a/build/linux64_569e52e/std/flash/events/TouchEvent.hx b/build/linux64_569e52e/std/flash/events/TouchEvent.hx new file mode 100644 index 0000000..616c75b --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/TouchEvent.hx @@ -0,0 +1,61 @@ +package flash.events; + +@:require(flash10_1) extern class TouchEvent extends Event { + @:flash.property var altKey(get,set) : Bool; + @:flash.property var ctrlKey(get,set) : Bool; + @:flash.property var isPrimaryTouchPoint(get,set) : Bool; + @:flash.property var isRelatedObjectInaccessible(get,set) : Bool; + @:flash.property var localX(get,set) : Float; + @:flash.property var localY(get,set) : Float; + @:flash.property var pressure(get,set) : Float; + @:flash.property var relatedObject(get,set) : flash.display.InteractiveObject; + @:flash.property var shiftKey(get,set) : Bool; + @:flash.property var sizeX(get,set) : Float; + @:flash.property var sizeY(get,set) : Float; + @:flash.property var stageX(get,never) : Float; + @:flash.property var stageY(get,never) : Float; + @:flash.property var touchPointID(get,set) : Int; + function new(type : String, bubbles : Bool = true, cancelable : Bool = false, touchPointID : Int = 0, isPrimaryTouchPoint : Bool = false, localX : Float = 0./*NaN*/, localY : Float = 0./*NaN*/, sizeX : Float = 0./*NaN*/, sizeY : Float = 0./*NaN*/, pressure : Float = 0./*NaN*/, ?relatedObject : flash.display.InteractiveObject, ctrlKey : Bool = false, altKey : Bool = false, shiftKey : Bool = false) : Void; + private function get_altKey() : Bool; + private function get_ctrlKey() : Bool; + private function get_isPrimaryTouchPoint() : Bool; + private function get_isRelatedObjectInaccessible() : Bool; + private function get_localX() : Float; + private function get_localY() : Float; + private function get_pressure() : Float; + private function get_relatedObject() : flash.display.InteractiveObject; + private function get_shiftKey() : Bool; + private function get_sizeX() : Float; + private function get_sizeY() : Float; + private function get_stageX() : Float; + private function get_stageY() : Float; + private function get_touchPointID() : Int; + private function set_altKey(value : Bool) : Bool; + private function set_ctrlKey(value : Bool) : Bool; + private function set_isPrimaryTouchPoint(value : Bool) : Bool; + private function set_isRelatedObjectInaccessible(value : Bool) : Bool; + private function set_localX(value : Float) : Float; + private function set_localY(value : Float) : Float; + private function set_pressure(value : Float) : Float; + private function set_relatedObject(value : flash.display.InteractiveObject) : flash.display.InteractiveObject; + private function set_shiftKey(value : Bool) : Bool; + private function set_sizeX(value : Float) : Float; + private function set_sizeY(value : Float) : Float; + private function set_touchPointID(value : Int) : Int; + function updateAfterEvent() : Void; + static final PROXIMITY_BEGIN : String; + static final PROXIMITY_END : String; + static final PROXIMITY_MOVE : String; + static final PROXIMITY_OUT : String; + static final PROXIMITY_OVER : String; + static final PROXIMITY_ROLL_OUT : String; + static final PROXIMITY_ROLL_OVER : String; + static final TOUCH_BEGIN : String; + static final TOUCH_END : String; + static final TOUCH_MOVE : String; + static final TOUCH_OUT : String; + static final TOUCH_OVER : String; + static final TOUCH_ROLL_OUT : String; + static final TOUCH_ROLL_OVER : String; + static final TOUCH_TAP : String; +} diff --git a/build/linux64_569e52e/std/flash/events/TransformGestureEvent.hx b/build/linux64_569e52e/std/flash/events/TransformGestureEvent.hx new file mode 100644 index 0000000..5345bb9 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/TransformGestureEvent.hx @@ -0,0 +1,28 @@ +package flash.events; + +@:require(flash10_1) extern class TransformGestureEvent extends GestureEvent { + @:flash.property var offsetX(get,set) : Float; + @:flash.property var offsetY(get,set) : Float; + @:flash.property var rotation(get,set) : Float; + @:flash.property var scaleX(get,set) : Float; + @:flash.property var scaleY(get,set) : Float; + @:flash.property var velocity(get,set) : Float; + function new(type : String, bubbles : Bool = true, cancelable : Bool = false, ?phase : String, localX : Float = 0, localY : Float = 0, scaleX : Float = 1, scaleY : Float = 1, rotation : Float = 0, offsetX : Float = 0, offsetY : Float = 0, ctrlKey : Bool = false, altKey : Bool = false, shiftKey : Bool = false) : Void; + private function get_offsetX() : Float; + private function get_offsetY() : Float; + private function get_rotation() : Float; + private function get_scaleX() : Float; + private function get_scaleY() : Float; + private function get_velocity() : Float; + private function set_offsetX(value : Float) : Float; + private function set_offsetY(value : Float) : Float; + private function set_rotation(value : Float) : Float; + private function set_scaleX(value : Float) : Float; + private function set_scaleY(value : Float) : Float; + private function set_velocity(value : Float) : Float; + static final GESTURE_DIRECTIONAL_TAP : String; + static final GESTURE_PAN : String; + static final GESTURE_ROTATE : String; + static final GESTURE_SWIPE : String; + static final GESTURE_ZOOM : String; +} diff --git a/build/linux64_569e52e/std/flash/events/UncaughtErrorEvent.hx b/build/linux64_569e52e/std/flash/events/UncaughtErrorEvent.hx new file mode 100644 index 0000000..fb4a6cf --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/UncaughtErrorEvent.hx @@ -0,0 +1,8 @@ +package flash.events; + +@:require(flash10_1) extern class UncaughtErrorEvent extends ErrorEvent { + @:flash.property var error(get,never) : Dynamic; + function new(?type : String, bubbles : Bool = true, cancelable : Bool = true, ?error_in : Dynamic) : Void; + private function get_error() : Dynamic; + static final UNCAUGHT_ERROR : String; +} diff --git a/build/linux64_569e52e/std/flash/events/UncaughtErrorEvents.hx b/build/linux64_569e52e/std/flash/events/UncaughtErrorEvents.hx new file mode 100644 index 0000000..b139216 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/UncaughtErrorEvents.hx @@ -0,0 +1,5 @@ +package flash.events; + +@:require(flash10_1) extern class UncaughtErrorEvents extends EventDispatcher { + function new() : Void; +} diff --git a/build/linux64_569e52e/std/flash/events/VideoEvent.hx b/build/linux64_569e52e/std/flash/events/VideoEvent.hx new file mode 100644 index 0000000..1760ae3 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/VideoEvent.hx @@ -0,0 +1,12 @@ +package flash.events; + +@:require(flash10_2) extern class VideoEvent extends Event { + final codecInfo : String; + @:flash.property var status(get,never) : String; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?status : String) : Void; + private function get_status() : String; + static final RENDER_STATE : String; + static final RENDER_STATUS_ACCELERATED : String; + static final RENDER_STATUS_SOFTWARE : String; + static final RENDER_STATUS_UNAVAILABLE : String; +} diff --git a/build/linux64_569e52e/std/flash/events/VideoTextureEvent.hx b/build/linux64_569e52e/std/flash/events/VideoTextureEvent.hx new file mode 100644 index 0000000..3551a49 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/VideoTextureEvent.hx @@ -0,0 +1,11 @@ +package flash.events; + +extern class VideoTextureEvent extends Event { + final codecInfo : String; + @:flash.property var colorSpace(get,never) : String; + @:flash.property var status(get,never) : String; + function new(type : String, bubbles : Bool = false, cancelable : Bool = false, ?status : String, ?colorSpace : String) : Void; + private function get_colorSpace() : String; + private function get_status() : String; + static final RENDER_STATE : String; +} diff --git a/build/linux64_569e52e/std/flash/events/WeakFunctionClosure.hx b/build/linux64_569e52e/std/flash/events/WeakFunctionClosure.hx new file mode 100644 index 0000000..eb20e25 --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/WeakFunctionClosure.hx @@ -0,0 +1,4 @@ +package flash.events; + +extern class WeakFunctionClosure { +} diff --git a/build/linux64_569e52e/std/flash/events/WeakMethodClosure.hx b/build/linux64_569e52e/std/flash/events/WeakMethodClosure.hx new file mode 100644 index 0000000..598b86c --- /dev/null +++ b/build/linux64_569e52e/std/flash/events/WeakMethodClosure.hx @@ -0,0 +1,5 @@ +package flash.events; + +extern class WeakMethodClosure { + function new() : Void; +} diff --git a/build/linux64_569e52e/std/flash/external/ExternalInterface.hx b/build/linux64_569e52e/std/flash/external/ExternalInterface.hx new file mode 100644 index 0000000..f408318 --- /dev/null +++ b/build/linux64_569e52e/std/flash/external/ExternalInterface.hx @@ -0,0 +1,11 @@ +package flash.external; + +extern class ExternalInterface { + @:flash.property static var available(get,never) : Bool; + static var marshallExceptions : Bool; + @:flash.property static var objectID(get,never) : String; + static function addCallback(functionName : String, closure : Dynamic) : Void; + static function call(functionName : String, restArgs : haxe.extern.Rest) : Dynamic; + private static function get_available() : Bool; + private static function get_objectID() : String; +} diff --git a/build/linux64_569e52e/std/flash/filters/BevelFilter.hx b/build/linux64_569e52e/std/flash/filters/BevelFilter.hx new file mode 100644 index 0000000..e6a0b14 --- /dev/null +++ b/build/linux64_569e52e/std/flash/filters/BevelFilter.hx @@ -0,0 +1,41 @@ +package flash.filters; + +extern final class BevelFilter extends BitmapFilter { + @:flash.property var angle(get,set) : Float; + @:flash.property var blurX(get,set) : Float; + @:flash.property var blurY(get,set) : Float; + @:flash.property var distance(get,set) : Float; + @:flash.property var highlightAlpha(get,set) : Float; + @:flash.property var highlightColor(get,set) : UInt; + @:flash.property var knockout(get,set) : Bool; + @:flash.property var quality(get,set) : Int; + @:flash.property var shadowAlpha(get,set) : Float; + @:flash.property var shadowColor(get,set) : UInt; + @:flash.property var strength(get,set) : Float; + @:flash.property var type(get,set) : BitmapFilterType; + function new(distance : Float = 4, angle : Float = 45, highlightColor : UInt = 0xFFFFFF, highlightAlpha : Float = 1, shadowColor : UInt = 0, shadowAlpha : Float = 1, blurX : Float = 4, blurY : Float = 4, strength : Float = 1, quality : Int = 1, ?type : BitmapFilterType, knockout : Bool = false) : Void; + private function get_angle() : Float; + private function get_blurX() : Float; + private function get_blurY() : Float; + private function get_distance() : Float; + private function get_highlightAlpha() : Float; + private function get_highlightColor() : UInt; + private function get_knockout() : Bool; + private function get_quality() : Int; + private function get_shadowAlpha() : Float; + private function get_shadowColor() : UInt; + private function get_strength() : Float; + private function get_type() : BitmapFilterType; + private function set_angle(value : Float) : Float; + private function set_blurX(value : Float) : Float; + private function set_blurY(value : Float) : Float; + private function set_distance(value : Float) : Float; + private function set_highlightAlpha(value : Float) : Float; + private function set_highlightColor(value : UInt) : UInt; + private function set_knockout(value : Bool) : Bool; + private function set_quality(value : Int) : Int; + private function set_shadowAlpha(value : Float) : Float; + private function set_shadowColor(value : UInt) : UInt; + private function set_strength(value : Float) : Float; + private function set_type(value : BitmapFilterType) : BitmapFilterType; +} diff --git a/build/linux64_569e52e/std/flash/filters/BitmapFilter.hx b/build/linux64_569e52e/std/flash/filters/BitmapFilter.hx new file mode 100644 index 0000000..b285d5f --- /dev/null +++ b/build/linux64_569e52e/std/flash/filters/BitmapFilter.hx @@ -0,0 +1,6 @@ +package flash.filters; + +extern class BitmapFilter { + function new() : Void; + function clone() : BitmapFilter; +} diff --git a/build/linux64_569e52e/std/flash/filters/BitmapFilterQuality.hx b/build/linux64_569e52e/std/flash/filters/BitmapFilterQuality.hx new file mode 100644 index 0000000..766c2a0 --- /dev/null +++ b/build/linux64_569e52e/std/flash/filters/BitmapFilterQuality.hx @@ -0,0 +1,7 @@ +package flash.filters; + +extern class BitmapFilterQuality { + static inline var HIGH : Int = 3; + static inline var LOW : Int = 1; + static inline var MEDIUM : Int = 2; +} diff --git a/build/linux64_569e52e/std/flash/filters/BitmapFilterType.hx b/build/linux64_569e52e/std/flash/filters/BitmapFilterType.hx new file mode 100644 index 0000000..ea45f12 --- /dev/null +++ b/build/linux64_569e52e/std/flash/filters/BitmapFilterType.hx @@ -0,0 +1,7 @@ +package flash.filters; + +@:native("flash.filters.BitmapFilterType") extern enum abstract BitmapFilterType(String) { + var FULL; + var INNER; + var OUTER; +} diff --git a/build/linux64_569e52e/std/flash/filters/BlurFilter.hx b/build/linux64_569e52e/std/flash/filters/BlurFilter.hx new file mode 100644 index 0000000..a106291 --- /dev/null +++ b/build/linux64_569e52e/std/flash/filters/BlurFilter.hx @@ -0,0 +1,14 @@ +package flash.filters; + +extern final class BlurFilter extends BitmapFilter { + @:flash.property var blurX(get,set) : Float; + @:flash.property var blurY(get,set) : Float; + @:flash.property var quality(get,set) : Int; + function new(blurX : Float = 4, blurY : Float = 4, quality : Int = 1) : Void; + private function get_blurX() : Float; + private function get_blurY() : Float; + private function get_quality() : Int; + private function set_blurX(value : Float) : Float; + private function set_blurY(value : Float) : Float; + private function set_quality(value : Int) : Int; +} diff --git a/build/linux64_569e52e/std/flash/filters/ColorMatrixFilter.hx b/build/linux64_569e52e/std/flash/filters/ColorMatrixFilter.hx new file mode 100644 index 0000000..050b334 --- /dev/null +++ b/build/linux64_569e52e/std/flash/filters/ColorMatrixFilter.hx @@ -0,0 +1,8 @@ +package flash.filters; + +extern final class ColorMatrixFilter extends BitmapFilter { + @:flash.property var matrix(get,set) : Array; + function new(?matrix : Array) : Void; + private function get_matrix() : Array; + private function set_matrix(value : Array) : Array; +} diff --git a/build/linux64_569e52e/std/flash/filters/ConvolutionFilter.hx b/build/linux64_569e52e/std/flash/filters/ConvolutionFilter.hx new file mode 100644 index 0000000..1411d52 --- /dev/null +++ b/build/linux64_569e52e/std/flash/filters/ConvolutionFilter.hx @@ -0,0 +1,32 @@ +package flash.filters; + +extern class ConvolutionFilter extends BitmapFilter { + @:flash.property var alpha(get,set) : Float; + @:flash.property var bias(get,set) : Float; + @:flash.property var clamp(get,set) : Bool; + @:flash.property var color(get,set) : UInt; + @:flash.property var divisor(get,set) : Float; + @:flash.property var matrix(get,set) : Array; + @:flash.property var matrixX(get,set) : Float; + @:flash.property var matrixY(get,set) : Float; + @:flash.property var preserveAlpha(get,set) : Bool; + function new(matrixX : Float = 0, matrixY : Float = 0, ?matrix : Array, divisor : Float = 1, bias : Float = 0, preserveAlpha : Bool = true, clamp : Bool = true, color : UInt = 0, alpha : Float = 0) : Void; + private function get_alpha() : Float; + private function get_bias() : Float; + private function get_clamp() : Bool; + private function get_color() : UInt; + private function get_divisor() : Float; + private function get_matrix() : Array; + private function get_matrixX() : Float; + private function get_matrixY() : Float; + private function get_preserveAlpha() : Bool; + private function set_alpha(value : Float) : Float; + private function set_bias(value : Float) : Float; + private function set_clamp(value : Bool) : Bool; + private function set_color(value : UInt) : UInt; + private function set_divisor(value : Float) : Float; + private function set_matrix(value : Array) : Array; + private function set_matrixX(value : Float) : Float; + private function set_matrixY(value : Float) : Float; + private function set_preserveAlpha(value : Bool) : Bool; +} diff --git a/build/linux64_569e52e/std/flash/filters/DisplacementMapFilter.hx b/build/linux64_569e52e/std/flash/filters/DisplacementMapFilter.hx new file mode 100644 index 0000000..4eb2a24 --- /dev/null +++ b/build/linux64_569e52e/std/flash/filters/DisplacementMapFilter.hx @@ -0,0 +1,32 @@ +package flash.filters; + +extern final class DisplacementMapFilter extends BitmapFilter { + @:flash.property var alpha(get,set) : Float; + @:flash.property var color(get,set) : UInt; + @:flash.property var componentX(get,set) : UInt; + @:flash.property var componentY(get,set) : UInt; + @:flash.property var mapBitmap(get,set) : flash.display.BitmapData; + @:flash.property var mapPoint(get,set) : flash.geom.Point; + @:flash.property var mode(get,set) : DisplacementMapFilterMode; + @:flash.property var scaleX(get,set) : Float; + @:flash.property var scaleY(get,set) : Float; + function new(?mapBitmap : flash.display.BitmapData, ?mapPoint : flash.geom.Point, componentX : UInt = 0, componentY : UInt = 0, scaleX : Float = 0, scaleY : Float = 0, ?mode : DisplacementMapFilterMode, color : UInt = 0, alpha : Float = 0) : Void; + private function get_alpha() : Float; + private function get_color() : UInt; + private function get_componentX() : UInt; + private function get_componentY() : UInt; + private function get_mapBitmap() : flash.display.BitmapData; + private function get_mapPoint() : flash.geom.Point; + private function get_mode() : DisplacementMapFilterMode; + private function get_scaleX() : Float; + private function get_scaleY() : Float; + private function set_alpha(value : Float) : Float; + private function set_color(value : UInt) : UInt; + private function set_componentX(value : UInt) : UInt; + private function set_componentY(value : UInt) : UInt; + private function set_mapBitmap(value : flash.display.BitmapData) : flash.display.BitmapData; + private function set_mapPoint(value : flash.geom.Point) : flash.geom.Point; + private function set_mode(value : DisplacementMapFilterMode) : DisplacementMapFilterMode; + private function set_scaleX(value : Float) : Float; + private function set_scaleY(value : Float) : Float; +} diff --git a/build/linux64_569e52e/std/flash/filters/DisplacementMapFilterMode.hx b/build/linux64_569e52e/std/flash/filters/DisplacementMapFilterMode.hx new file mode 100644 index 0000000..59a1603 --- /dev/null +++ b/build/linux64_569e52e/std/flash/filters/DisplacementMapFilterMode.hx @@ -0,0 +1,8 @@ +package flash.filters; + +@:native("flash.filters.DisplacementMapFilterMode") extern enum abstract DisplacementMapFilterMode(String) { + var CLAMP; + var COLOR; + var IGNORE; + var WRAP; +} diff --git a/build/linux64_569e52e/std/flash/filters/DropShadowFilter.hx b/build/linux64_569e52e/std/flash/filters/DropShadowFilter.hx new file mode 100644 index 0000000..462164c --- /dev/null +++ b/build/linux64_569e52e/std/flash/filters/DropShadowFilter.hx @@ -0,0 +1,38 @@ +package flash.filters; + +extern final class DropShadowFilter extends BitmapFilter { + @:flash.property var alpha(get,set) : Float; + @:flash.property var angle(get,set) : Float; + @:flash.property var blurX(get,set) : Float; + @:flash.property var blurY(get,set) : Float; + @:flash.property var color(get,set) : UInt; + @:flash.property var distance(get,set) : Float; + @:flash.property var hideObject(get,set) : Bool; + @:flash.property var inner(get,set) : Bool; + @:flash.property var knockout(get,set) : Bool; + @:flash.property var quality(get,set) : Int; + @:flash.property var strength(get,set) : Float; + function new(distance : Float = 4, angle : Float = 45, color : UInt = 0, alpha : Float = 1, blurX : Float = 4, blurY : Float = 4, strength : Float = 1, quality : Int = 1, inner : Bool = false, knockout : Bool = false, hideObject : Bool = false) : Void; + private function get_alpha() : Float; + private function get_angle() : Float; + private function get_blurX() : Float; + private function get_blurY() : Float; + private function get_color() : UInt; + private function get_distance() : Float; + private function get_hideObject() : Bool; + private function get_inner() : Bool; + private function get_knockout() : Bool; + private function get_quality() : Int; + private function get_strength() : Float; + private function set_alpha(value : Float) : Float; + private function set_angle(value : Float) : Float; + private function set_blurX(value : Float) : Float; + private function set_blurY(value : Float) : Float; + private function set_color(value : UInt) : UInt; + private function set_distance(value : Float) : Float; + private function set_hideObject(value : Bool) : Bool; + private function set_inner(value : Bool) : Bool; + private function set_knockout(value : Bool) : Bool; + private function set_quality(value : Int) : Int; + private function set_strength(value : Float) : Float; +} diff --git a/build/linux64_569e52e/std/flash/filters/GlowFilter.hx b/build/linux64_569e52e/std/flash/filters/GlowFilter.hx new file mode 100644 index 0000000..440c4c5 --- /dev/null +++ b/build/linux64_569e52e/std/flash/filters/GlowFilter.hx @@ -0,0 +1,29 @@ +package flash.filters; + +extern final class GlowFilter extends BitmapFilter { + @:flash.property var alpha(get,set) : Float; + @:flash.property var blurX(get,set) : Float; + @:flash.property var blurY(get,set) : Float; + @:flash.property var color(get,set) : UInt; + @:flash.property var inner(get,set) : Bool; + @:flash.property var knockout(get,set) : Bool; + @:flash.property var quality(get,set) : Int; + @:flash.property var strength(get,set) : Float; + function new(color : UInt = 16711680, alpha : Float = 1, blurX : Float = 6, blurY : Float = 6, strength : Float = 2, quality : Int = 1, inner : Bool = false, knockout : Bool = false) : Void; + private function get_alpha() : Float; + private function get_blurX() : Float; + private function get_blurY() : Float; + private function get_color() : UInt; + private function get_inner() : Bool; + private function get_knockout() : Bool; + private function get_quality() : Int; + private function get_strength() : Float; + private function set_alpha(value : Float) : Float; + private function set_blurX(value : Float) : Float; + private function set_blurY(value : Float) : Float; + private function set_color(value : UInt) : UInt; + private function set_inner(value : Bool) : Bool; + private function set_knockout(value : Bool) : Bool; + private function set_quality(value : Int) : Int; + private function set_strength(value : Float) : Float; +} diff --git a/build/linux64_569e52e/std/flash/filters/GradientBevelFilter.hx b/build/linux64_569e52e/std/flash/filters/GradientBevelFilter.hx new file mode 100644 index 0000000..93ee39e --- /dev/null +++ b/build/linux64_569e52e/std/flash/filters/GradientBevelFilter.hx @@ -0,0 +1,38 @@ +package flash.filters; + +extern final class GradientBevelFilter extends BitmapFilter { + @:flash.property var alphas(get,set) : Array; + @:flash.property var angle(get,set) : Float; + @:flash.property var blurX(get,set) : Float; + @:flash.property var blurY(get,set) : Float; + @:flash.property var colors(get,set) : Array; + @:flash.property var distance(get,set) : Float; + @:flash.property var knockout(get,set) : Bool; + @:flash.property var quality(get,set) : Int; + @:flash.property var ratios(get,set) : Array; + @:flash.property var strength(get,set) : Float; + @:flash.property var type(get,set) : String; + function new(distance : Float = 4, angle : Float = 45, ?colors : Array, ?alphas : Array, ?ratios : Array, blurX : Float = 4, blurY : Float = 4, strength : Float = 1, quality : Int = 1, ?type : String, knockout : Bool = false) : Void; + private function get_alphas() : Array; + private function get_angle() : Float; + private function get_blurX() : Float; + private function get_blurY() : Float; + private function get_colors() : Array; + private function get_distance() : Float; + private function get_knockout() : Bool; + private function get_quality() : Int; + private function get_ratios() : Array; + private function get_strength() : Float; + private function get_type() : String; + private function set_alphas(value : Array) : Array; + private function set_angle(value : Float) : Float; + private function set_blurX(value : Float) : Float; + private function set_blurY(value : Float) : Float; + private function set_colors(value : Array) : Array; + private function set_distance(value : Float) : Float; + private function set_knockout(value : Bool) : Bool; + private function set_quality(value : Int) : Int; + private function set_ratios(value : Array) : Array; + private function set_strength(value : Float) : Float; + private function set_type(value : String) : String; +} diff --git a/build/linux64_569e52e/std/flash/filters/GradientGlowFilter.hx b/build/linux64_569e52e/std/flash/filters/GradientGlowFilter.hx new file mode 100644 index 0000000..74be736 --- /dev/null +++ b/build/linux64_569e52e/std/flash/filters/GradientGlowFilter.hx @@ -0,0 +1,38 @@ +package flash.filters; + +extern final class GradientGlowFilter extends BitmapFilter { + @:flash.property var alphas(get,set) : Array; + @:flash.property var angle(get,set) : Float; + @:flash.property var blurX(get,set) : Float; + @:flash.property var blurY(get,set) : Float; + @:flash.property var colors(get,set) : Array; + @:flash.property var distance(get,set) : Float; + @:flash.property var knockout(get,set) : Bool; + @:flash.property var quality(get,set) : Int; + @:flash.property var ratios(get,set) : Array; + @:flash.property var strength(get,set) : Float; + @:flash.property var type(get,set) : BitmapFilterType; + function new(distance : Float = 4, angle : Float = 45, ?colors : Array, ?alphas : Array, ?ratios : Array, blurX : Float = 4, blurY : Float = 4, strength : Float = 1, quality : Int = 1, ?type : BitmapFilterType, knockout : Bool = false) : Void; + private function get_alphas() : Array; + private function get_angle() : Float; + private function get_blurX() : Float; + private function get_blurY() : Float; + private function get_colors() : Array; + private function get_distance() : Float; + private function get_knockout() : Bool; + private function get_quality() : Int; + private function get_ratios() : Array; + private function get_strength() : Float; + private function get_type() : BitmapFilterType; + private function set_alphas(value : Array) : Array; + private function set_angle(value : Float) : Float; + private function set_blurX(value : Float) : Float; + private function set_blurY(value : Float) : Float; + private function set_colors(value : Array) : Array; + private function set_distance(value : Float) : Float; + private function set_knockout(value : Bool) : Bool; + private function set_quality(value : Int) : Int; + private function set_ratios(value : Array) : Array; + private function set_strength(value : Float) : Float; + private function set_type(value : BitmapFilterType) : BitmapFilterType; +} diff --git a/build/linux64_569e52e/std/flash/filters/ShaderFilter.hx b/build/linux64_569e52e/std/flash/filters/ShaderFilter.hx new file mode 100644 index 0000000..e58a0de --- /dev/null +++ b/build/linux64_569e52e/std/flash/filters/ShaderFilter.hx @@ -0,0 +1,20 @@ +package flash.filters; + +extern class ShaderFilter extends BitmapFilter { + @:flash.property var bottomExtension(get,set) : Int; + @:flash.property var leftExtension(get,set) : Int; + @:flash.property var rightExtension(get,set) : Int; + @:flash.property var shader(get,set) : flash.display.Shader; + @:flash.property var topExtension(get,set) : Int; + function new(?shader : flash.display.Shader) : Void; + private function get_bottomExtension() : Int; + private function get_leftExtension() : Int; + private function get_rightExtension() : Int; + private function get_shader() : flash.display.Shader; + private function get_topExtension() : Int; + private function set_bottomExtension(value : Int) : Int; + private function set_leftExtension(value : Int) : Int; + private function set_rightExtension(value : Int) : Int; + private function set_shader(value : flash.display.Shader) : flash.display.Shader; + private function set_topExtension(value : Int) : Int; +} diff --git a/build/linux64_569e52e/std/flash/geom/ColorTransform.hx b/build/linux64_569e52e/std/flash/geom/ColorTransform.hx new file mode 100644 index 0000000..ef85afd --- /dev/null +++ b/build/linux64_569e52e/std/flash/geom/ColorTransform.hx @@ -0,0 +1,18 @@ +package flash.geom; + +extern class ColorTransform { + var alphaMultiplier : Float; + var alphaOffset : Float; + var blueMultiplier : Float; + var blueOffset : Float; + @:flash.property var color(get,set) : UInt; + var greenMultiplier : Float; + var greenOffset : Float; + var redMultiplier : Float; + var redOffset : Float; + function new(redMultiplier : Float = 1, greenMultiplier : Float = 1, blueMultiplier : Float = 1, alphaMultiplier : Float = 1, redOffset : Float = 0, greenOffset : Float = 0, blueOffset : Float = 0, alphaOffset : Float = 0) : Void; + function concat(second : ColorTransform) : Void; + private function get_color() : UInt; + private function set_color(value : UInt) : UInt; + function toString() : String; +} diff --git a/build/linux64_569e52e/std/flash/geom/Matrix.hx b/build/linux64_569e52e/std/flash/geom/Matrix.hx new file mode 100644 index 0000000..cba5c1c --- /dev/null +++ b/build/linux64_569e52e/std/flash/geom/Matrix.hx @@ -0,0 +1,29 @@ +package flash.geom; + +extern class Matrix { + var a : Float; + var b : Float; + var c : Float; + var d : Float; + var tx : Float; + var ty : Float; + function new(a : Float = 1, b : Float = 0, c : Float = 0, d : Float = 1, tx : Float = 0, ty : Float = 0) : Void; + function clone() : Matrix; + function concat(m : Matrix) : Void; + @:require(flash11) function copyColumnFrom(column : UInt, vector3D : Vector3D) : Void; + @:require(flash11) function copyColumnTo(column : UInt, vector3D : Vector3D) : Void; + @:require(flash11) function copyFrom(sourceMatrix : Matrix) : Void; + @:require(flash11) function copyRowFrom(row : UInt, vector3D : Vector3D) : Void; + @:require(flash11) function copyRowTo(row : UInt, vector3D : Vector3D) : Void; + function createBox(scaleX : Float, scaleY : Float, rotation : Float = 0, tx : Float = 0, ty : Float = 0) : Void; + function createGradientBox(width : Float, height : Float, rotation : Float = 0, tx : Float = 0, ty : Float = 0) : Void; + function deltaTransformPoint(point : Point) : Point; + function identity() : Void; + function invert() : Void; + function rotate(angle : Float) : Void; + function scale(sx : Float, sy : Float) : Void; + @:require(flash11) function setTo(aa : Float, ba : Float, ca : Float, da : Float, txa : Float, tya : Float) : Void; + function toString() : String; + function transformPoint(point : Point) : Point; + function translate(dx : Float, dy : Float) : Void; +} diff --git a/build/linux64_569e52e/std/flash/geom/Matrix3D.hx b/build/linux64_569e52e/std/flash/geom/Matrix3D.hx new file mode 100644 index 0000000..2e1e15d --- /dev/null +++ b/build/linux64_569e52e/std/flash/geom/Matrix3D.hx @@ -0,0 +1,41 @@ +package flash.geom; + +@:require(flash10) extern class Matrix3D { + @:flash.property var determinant(get,never) : Float; + @:flash.property var position(get,set) : Vector3D; + @:flash.property var rawData(get,set) : flash.Vector; + function new(?v : flash.Vector) : Void; + function append(lhs : Matrix3D) : Void; + function appendRotation(degrees : Float, axis : Vector3D, ?pivotPoint : Vector3D) : Void; + function appendScale(xScale : Float, yScale : Float, zScale : Float) : Void; + function appendTranslation(x : Float, y : Float, z : Float) : Void; + function clone() : Matrix3D; + @:require(flash11) function copyColumnFrom(column : UInt, vector3D : Vector3D) : Void; + @:require(flash11) function copyColumnTo(column : UInt, vector3D : Vector3D) : Void; + @:require(flash11) function copyFrom(sourceMatrix3D : Matrix3D) : Void; + @:require(flash11) function copyRawDataFrom(vector : flash.Vector, index : UInt = 0, transpose : Bool = false) : Void; + @:require(flash11) function copyRawDataTo(vector : flash.Vector, index : UInt = 0, transpose : Bool = false) : Void; + @:require(flash11) function copyRowFrom(row : UInt, vector3D : Vector3D) : Void; + @:require(flash11) function copyRowTo(row : UInt, vector3D : Vector3D) : Void; + @:require(flash11) function copyToMatrix3D(dest : Matrix3D) : Void; + function decompose(?orientationStyle : Orientation3D) : flash.Vector; + function deltaTransformVector(v : Vector3D) : Vector3D; + private function get_determinant() : Float; + private function get_position() : Vector3D; + private function get_rawData() : flash.Vector; + function identity() : Void; + function interpolateTo(toMat : Matrix3D, percent : Float) : Void; + function invert() : Bool; + function pointAt(pos : Vector3D, ?at : Vector3D, ?up : Vector3D) : Void; + function prepend(rhs : Matrix3D) : Void; + function prependRotation(degrees : Float, axis : Vector3D, ?pivotPoint : Vector3D) : Void; + function prependScale(xScale : Float, yScale : Float, zScale : Float) : Void; + function prependTranslation(x : Float, y : Float, z : Float) : Void; + function recompose(components : flash.Vector, ?orientationStyle : Orientation3D) : Bool; + private function set_position(value : Vector3D) : Vector3D; + private function set_rawData(value : flash.Vector) : flash.Vector; + function transformVector(v : Vector3D) : Vector3D; + function transformVectors(vin : flash.Vector, vout : flash.Vector) : Void; + function transpose() : Void; + static function interpolate(thisMat : Matrix3D, toMat : Matrix3D, percent : Float) : Matrix3D; +} diff --git a/build/linux64_569e52e/std/flash/geom/Orientation3D.hx b/build/linux64_569e52e/std/flash/geom/Orientation3D.hx new file mode 100644 index 0000000..f0df04b --- /dev/null +++ b/build/linux64_569e52e/std/flash/geom/Orientation3D.hx @@ -0,0 +1,7 @@ +package flash.geom; + +@:native("flash.geom.Orientation3D") extern enum abstract Orientation3D(String) { + var AXIS_ANGLE; + var EULER_ANGLES; + var QUATERNION; +} diff --git a/build/linux64_569e52e/std/flash/geom/PerspectiveProjection.hx b/build/linux64_569e52e/std/flash/geom/PerspectiveProjection.hx new file mode 100644 index 0000000..c5a6259 --- /dev/null +++ b/build/linux64_569e52e/std/flash/geom/PerspectiveProjection.hx @@ -0,0 +1,15 @@ +package flash.geom; + +@:require(flash10) extern class PerspectiveProjection { + @:flash.property var fieldOfView(get,set) : Float; + @:flash.property var focalLength(get,set) : Float; + @:flash.property var projectionCenter(get,set) : Point; + function new() : Void; + private function get_fieldOfView() : Float; + private function get_focalLength() : Float; + private function get_projectionCenter() : Point; + private function set_fieldOfView(value : Float) : Float; + private function set_focalLength(value : Float) : Float; + private function set_projectionCenter(value : Point) : Point; + function toMatrix3D() : Matrix3D; +} diff --git a/build/linux64_569e52e/std/flash/geom/Point.hx b/build/linux64_569e52e/std/flash/geom/Point.hx new file mode 100644 index 0000000..7c96a2a --- /dev/null +++ b/build/linux64_569e52e/std/flash/geom/Point.hx @@ -0,0 +1,21 @@ +package flash.geom; + +extern class Point { + @:flash.property var length(get,never) : Float; + var x : Float; + var y : Float; + function new(x : Float = 0, y : Float = 0) : Void; + function add(v : Point) : Point; + function clone() : Point; + @:require(flash11) function copyFrom(sourcePoint : Point) : Void; + function equals(toCompare : Point) : Bool; + private function get_length() : Float; + function normalize(thickness : Float) : Void; + function offset(dx : Float, dy : Float) : Void; + @:require(flash11) function setTo(xa : Float, ya : Float) : Void; + function subtract(v : Point) : Point; + function toString() : String; + static function distance(pt1 : Point, pt2 : Point) : Float; + static function interpolate(pt1 : Point, pt2 : Point, f : Float) : Point; + static function polar(len : Float, angle : Float) : Point; +} diff --git a/build/linux64_569e52e/std/flash/geom/Rectangle.hx b/build/linux64_569e52e/std/flash/geom/Rectangle.hx new file mode 100644 index 0000000..9f21bd7 --- /dev/null +++ b/build/linux64_569e52e/std/flash/geom/Rectangle.hx @@ -0,0 +1,47 @@ +package flash.geom; + +extern class Rectangle { + @:flash.property var bottom(get,set) : Float; + @:flash.property var bottomRight(get,set) : Point; + var height : Float; + @:flash.property var left(get,set) : Float; + @:flash.property var right(get,set) : Float; + @:flash.property var size(get,set) : Point; + @:flash.property var top(get,set) : Float; + @:flash.property var topLeft(get,set) : Point; + var width : Float; + var x : Float; + var y : Float; + function new(x : Float = 0, y : Float = 0, width : Float = 0, height : Float = 0) : Void; + function clone() : Rectangle; + function contains(x : Float, y : Float) : Bool; + function containsPoint(point : Point) : Bool; + function containsRect(rect : Rectangle) : Bool; + @:require(flash11) function copyFrom(sourceRect : Rectangle) : Void; + function equals(toCompare : Rectangle) : Bool; + private function get_bottom() : Float; + private function get_bottomRight() : Point; + private function get_left() : Float; + private function get_right() : Float; + private function get_size() : Point; + private function get_top() : Float; + private function get_topLeft() : Point; + function inflate(dx : Float, dy : Float) : Void; + function inflatePoint(point : Point) : Void; + function intersection(toIntersect : Rectangle) : Rectangle; + function intersects(toIntersect : Rectangle) : Bool; + function isEmpty() : Bool; + function offset(dx : Float, dy : Float) : Void; + function offsetPoint(point : Point) : Void; + function setEmpty() : Void; + @:require(flash11) function setTo(xa : Float, ya : Float, widtha : Float, heighta : Float) : Void; + private function set_bottom(value : Float) : Float; + private function set_bottomRight(value : Point) : Point; + private function set_left(value : Float) : Float; + private function set_right(value : Float) : Float; + private function set_size(value : Point) : Point; + private function set_top(value : Float) : Float; + private function set_topLeft(value : Point) : Point; + function toString() : String; + function union(toUnion : Rectangle) : Rectangle; +} diff --git a/build/linux64_569e52e/std/flash/geom/Transform.hx b/build/linux64_569e52e/std/flash/geom/Transform.hx new file mode 100644 index 0000000..dcd93fd --- /dev/null +++ b/build/linux64_569e52e/std/flash/geom/Transform.hx @@ -0,0 +1,24 @@ +package flash.geom; + +extern class Transform { + @:flash.property var colorTransform(get,set) : ColorTransform; + @:flash.property var concatenatedColorTransform(get,never) : ColorTransform; + @:flash.property var concatenatedMatrix(get,never) : Matrix; + @:flash.property var matrix(get,set) : Matrix; + @:flash.property @:require(flash10) var matrix3D(get,set) : Matrix3D; + @:flash.property @:require(flash10) var perspectiveProjection(get,set) : PerspectiveProjection; + @:flash.property var pixelBounds(get,never) : Rectangle; + function new(displayObject : flash.display.DisplayObject) : Void; + @:require(flash10) function getRelativeMatrix3D(relativeTo : flash.display.DisplayObject) : Matrix3D; + private function get_colorTransform() : ColorTransform; + private function get_concatenatedColorTransform() : ColorTransform; + private function get_concatenatedMatrix() : Matrix; + private function get_matrix() : Matrix; + private function get_matrix3D() : Matrix3D; + private function get_perspectiveProjection() : PerspectiveProjection; + private function get_pixelBounds() : Rectangle; + private function set_colorTransform(value : ColorTransform) : ColorTransform; + private function set_matrix(value : Matrix) : Matrix; + private function set_matrix3D(value : Matrix3D) : Matrix3D; + private function set_perspectiveProjection(value : PerspectiveProjection) : PerspectiveProjection; +} diff --git a/build/linux64_569e52e/std/flash/geom/Utils3D.hx b/build/linux64_569e52e/std/flash/geom/Utils3D.hx new file mode 100644 index 0000000..8048e83 --- /dev/null +++ b/build/linux64_569e52e/std/flash/geom/Utils3D.hx @@ -0,0 +1,7 @@ +package flash.geom; + +@:require(flash10) extern class Utils3D { + static function pointTowards(percent : Float, mat : Matrix3D, pos : Vector3D, ?at : Vector3D, ?up : Vector3D) : Matrix3D; + static function projectVector(m : Matrix3D, v : Vector3D) : Vector3D; + static function projectVectors(m : Matrix3D, verts : flash.Vector, projectedVerts : flash.Vector, uvts : flash.Vector) : Void; +} diff --git a/build/linux64_569e52e/std/flash/geom/Vector3D.hx b/build/linux64_569e52e/std/flash/geom/Vector3D.hx new file mode 100644 index 0000000..f03e51d --- /dev/null +++ b/build/linux64_569e52e/std/flash/geom/Vector3D.hx @@ -0,0 +1,34 @@ +package flash.geom; + +@:require(flash10) extern class Vector3D { + @:flash.property var length(get,never) : Float; + @:flash.property var lengthSquared(get,never) : Float; + var w : Float; + var x : Float; + var y : Float; + var z : Float; + function new(x : Float = 0, y : Float = 0, z : Float = 0, w : Float = 0) : Void; + function add(a : Vector3D) : Vector3D; + function clone() : Vector3D; + @:require(flash11) function copyFrom(sourceVector3D : Vector3D) : Void; + function crossProduct(a : Vector3D) : Vector3D; + function decrementBy(a : Vector3D) : Void; + function dotProduct(a : Vector3D) : Float; + function equals(toCompare : Vector3D, allFour : Bool = false) : Bool; + private function get_length() : Float; + private function get_lengthSquared() : Float; + function incrementBy(a : Vector3D) : Void; + function nearEquals(toCompare : Vector3D, tolerance : Float, allFour : Bool = false) : Bool; + function negate() : Void; + function normalize() : Float; + function project() : Void; + function scaleBy(s : Float) : Void; + @:require(flash11) function setTo(xa : Float, ya : Float, za : Float) : Void; + function subtract(a : Vector3D) : Vector3D; + function toString() : String; + static final X_AXIS : Vector3D; + static final Y_AXIS : Vector3D; + static final Z_AXIS : Vector3D; + static function angleBetween(a : Vector3D, b : Vector3D) : Float; + static function distance(pt1 : Vector3D, pt2 : Vector3D) : Float; +} diff --git a/build/linux64_569e52e/std/flash/globalization/Collator.hx b/build/linux64_569e52e/std/flash/globalization/Collator.hx new file mode 100644 index 0000000..4e2e137 --- /dev/null +++ b/build/linux64_569e52e/std/flash/globalization/Collator.hx @@ -0,0 +1,32 @@ +package flash.globalization; + +@:require(flash10_1) extern final class Collator { + @:flash.property var actualLocaleIDName(get,never) : String; + @:flash.property var ignoreCase(get,set) : Bool; + @:flash.property var ignoreCharacterWidth(get,set) : Bool; + @:flash.property var ignoreDiacritics(get,set) : Bool; + @:flash.property var ignoreKanaType(get,set) : Bool; + @:flash.property var ignoreSymbols(get,set) : Bool; + @:flash.property var lastOperationStatus(get,never) : LastOperationStatus; + @:flash.property var numericComparison(get,set) : Bool; + @:flash.property var requestedLocaleIDName(get,never) : String; + function new(requestedLocaleIDName : String, ?initialMode : CollatorMode) : Void; + function compare(string1 : String, string2 : String) : Int; + function equals(string1 : String, string2 : String) : Bool; + private function get_actualLocaleIDName() : String; + private function get_ignoreCase() : Bool; + private function get_ignoreCharacterWidth() : Bool; + private function get_ignoreDiacritics() : Bool; + private function get_ignoreKanaType() : Bool; + private function get_ignoreSymbols() : Bool; + private function get_lastOperationStatus() : LastOperationStatus; + private function get_numericComparison() : Bool; + private function get_requestedLocaleIDName() : String; + private function set_ignoreCase(value : Bool) : Bool; + private function set_ignoreCharacterWidth(value : Bool) : Bool; + private function set_ignoreDiacritics(value : Bool) : Bool; + private function set_ignoreKanaType(value : Bool) : Bool; + private function set_ignoreSymbols(value : Bool) : Bool; + private function set_numericComparison(value : Bool) : Bool; + static function getAvailableLocaleIDNames() : flash.Vector; +} diff --git a/build/linux64_569e52e/std/flash/globalization/CollatorMode.hx b/build/linux64_569e52e/std/flash/globalization/CollatorMode.hx new file mode 100644 index 0000000..4cdb561 --- /dev/null +++ b/build/linux64_569e52e/std/flash/globalization/CollatorMode.hx @@ -0,0 +1,6 @@ +package flash.globalization; + +@:native("flash.globalization.CollatorMode") extern enum abstract CollatorMode(String) { + var MATCHING; + var SORTING; +} diff --git a/build/linux64_569e52e/std/flash/globalization/CurrencyFormatter.hx b/build/linux64_569e52e/std/flash/globalization/CurrencyFormatter.hx new file mode 100644 index 0000000..97e1df5 --- /dev/null +++ b/build/linux64_569e52e/std/flash/globalization/CurrencyFormatter.hx @@ -0,0 +1,53 @@ +package flash.globalization; + +@:require(flash10_1) extern final class CurrencyFormatter { + @:flash.property var actualLocaleIDName(get,never) : String; + @:flash.property var currencyISOCode(get,never) : String; + @:flash.property var currencySymbol(get,never) : String; + @:flash.property var decimalSeparator(get,set) : String; + @:flash.property var digitsType(get,set) : UInt; + @:flash.property var fractionalDigits(get,set) : Int; + @:flash.property var groupingPattern(get,set) : String; + @:flash.property var groupingSeparator(get,set) : String; + @:flash.property var lastOperationStatus(get,never) : LastOperationStatus; + @:flash.property var leadingZero(get,set) : Bool; + @:flash.property var negativeCurrencyFormat(get,set) : UInt; + @:flash.property var negativeSymbol(get,set) : String; + @:flash.property var positiveCurrencyFormat(get,set) : UInt; + @:flash.property var requestedLocaleIDName(get,never) : String; + @:flash.property var trailingZeros(get,set) : Bool; + @:flash.property var useGrouping(get,set) : Bool; + function new(requestedLocaleIDName : String) : Void; + function format(value : Float, withCurrencySymbol : Bool = false) : String; + function formattingWithCurrencySymbolIsSafe(requestedISOCode : String) : Bool; + private function get_actualLocaleIDName() : String; + private function get_currencyISOCode() : String; + private function get_currencySymbol() : String; + private function get_decimalSeparator() : String; + private function get_digitsType() : UInt; + private function get_fractionalDigits() : Int; + private function get_groupingPattern() : String; + private function get_groupingSeparator() : String; + private function get_lastOperationStatus() : LastOperationStatus; + private function get_leadingZero() : Bool; + private function get_negativeCurrencyFormat() : UInt; + private function get_negativeSymbol() : String; + private function get_positiveCurrencyFormat() : UInt; + private function get_requestedLocaleIDName() : String; + private function get_trailingZeros() : Bool; + private function get_useGrouping() : Bool; + function parse(inputString : String) : CurrencyParseResult; + function setCurrency(currencyISOCode : String, currencySymbol : String) : Void; + private function set_decimalSeparator(value : String) : String; + private function set_digitsType(value : UInt) : UInt; + private function set_fractionalDigits(value : Int) : Int; + private function set_groupingPattern(value : String) : String; + private function set_groupingSeparator(value : String) : String; + private function set_leadingZero(value : Bool) : Bool; + private function set_negativeCurrencyFormat(value : UInt) : UInt; + private function set_negativeSymbol(value : String) : String; + private function set_positiveCurrencyFormat(value : UInt) : UInt; + private function set_trailingZeros(value : Bool) : Bool; + private function set_useGrouping(value : Bool) : Bool; + static function getAvailableLocaleIDNames() : flash.Vector; +} diff --git a/build/linux64_569e52e/std/flash/globalization/CurrencyParseResult.hx b/build/linux64_569e52e/std/flash/globalization/CurrencyParseResult.hx new file mode 100644 index 0000000..3df82ea --- /dev/null +++ b/build/linux64_569e52e/std/flash/globalization/CurrencyParseResult.hx @@ -0,0 +1,9 @@ +package flash.globalization; + +extern final class CurrencyParseResult { + @:flash.property var currencyString(get,never) : String; + @:flash.property var value(get,never) : Float; + function new(value : Float = 0./*NaN*/, ?symbol : String) : Void; + private function get_currencyString() : String; + private function get_value() : Float; +} diff --git a/build/linux64_569e52e/std/flash/globalization/DateTimeFormatter.hx b/build/linux64_569e52e/std/flash/globalization/DateTimeFormatter.hx new file mode 100644 index 0000000..da56e35 --- /dev/null +++ b/build/linux64_569e52e/std/flash/globalization/DateTimeFormatter.hx @@ -0,0 +1,22 @@ +package flash.globalization; + +@:require(flash10_1) extern final class DateTimeFormatter { + @:flash.property var actualLocaleIDName(get,never) : String; + @:flash.property var lastOperationStatus(get,never) : LastOperationStatus; + @:flash.property var requestedLocaleIDName(get,never) : String; + function new(requestedLocaleIDName : String, ?dateStyle : DateTimeStyle, ?timeStyle : DateTimeStyle) : Void; + function format(dateTime : Date) : String; + function formatUTC(dateTime : Date) : String; + function getDateStyle() : DateTimeStyle; + function getDateTimePattern() : String; + function getFirstWeekday() : Int; + function getMonthNames(?nameStyle : DateTimeNameStyle, ?context : DateTimeNameContext) : flash.Vector; + function getTimeStyle() : DateTimeStyle; + function getWeekdayNames(?nameStyle : DateTimeNameStyle, ?context : DateTimeNameContext) : flash.Vector; + private function get_actualLocaleIDName() : String; + private function get_lastOperationStatus() : LastOperationStatus; + private function get_requestedLocaleIDName() : String; + function setDateTimePattern(pattern : String) : Void; + function setDateTimeStyles(dateStyle : DateTimeStyle, timeStyle : DateTimeStyle) : Void; + static function getAvailableLocaleIDNames() : flash.Vector; +} diff --git a/build/linux64_569e52e/std/flash/globalization/DateTimeNameContext.hx b/build/linux64_569e52e/std/flash/globalization/DateTimeNameContext.hx new file mode 100644 index 0000000..0d1f2e4 --- /dev/null +++ b/build/linux64_569e52e/std/flash/globalization/DateTimeNameContext.hx @@ -0,0 +1,6 @@ +package flash.globalization; + +@:native("flash.globalization.DateTimeNameContext") extern enum abstract DateTimeNameContext(String) { + var FORMAT; + var STANDALONE; +} diff --git a/build/linux64_569e52e/std/flash/globalization/DateTimeNameStyle.hx b/build/linux64_569e52e/std/flash/globalization/DateTimeNameStyle.hx new file mode 100644 index 0000000..067fbf6 --- /dev/null +++ b/build/linux64_569e52e/std/flash/globalization/DateTimeNameStyle.hx @@ -0,0 +1,7 @@ +package flash.globalization; + +@:native("flash.globalization.DateTimeNameStyle") extern enum abstract DateTimeNameStyle(String) { + var FULL; + var LONG_ABBREVIATION; + var SHORT_ABBREVIATION; +} diff --git a/build/linux64_569e52e/std/flash/globalization/DateTimeStyle.hx b/build/linux64_569e52e/std/flash/globalization/DateTimeStyle.hx new file mode 100644 index 0000000..1c6b84b --- /dev/null +++ b/build/linux64_569e52e/std/flash/globalization/DateTimeStyle.hx @@ -0,0 +1,9 @@ +package flash.globalization; + +@:native("flash.globalization.DateTimeStyle") extern enum abstract DateTimeStyle(String) { + var CUSTOM; + var LONG; + var MEDIUM; + var NONE; + var SHORT; +} diff --git a/build/linux64_569e52e/std/flash/globalization/LastOperationStatus.hx b/build/linux64_569e52e/std/flash/globalization/LastOperationStatus.hx new file mode 100644 index 0000000..a18bf21 --- /dev/null +++ b/build/linux64_569e52e/std/flash/globalization/LastOperationStatus.hx @@ -0,0 +1,21 @@ +package flash.globalization; + +@:native("flash.globalization.LastOperationStatus") extern enum abstract LastOperationStatus(String) { + var BUFFER_OVERFLOW_ERROR; + var ERROR_CODE_UNKNOWN; + var ILLEGAL_ARGUMENT_ERROR; + var INDEX_OUT_OF_BOUNDS_ERROR; + var INVALID_ATTR_VALUE; + var INVALID_CHAR_FOUND; + var MEMORY_ALLOCATION_ERROR; + var NO_ERROR; + var NUMBER_OVERFLOW_ERROR; + var PARSE_ERROR; + var PATTERN_SYNTAX_ERROR; + var PLATFORM_API_FAILED; + var TRUNCATED_CHAR_FOUND; + var UNEXPECTED_TOKEN; + var UNSUPPORTED_ERROR; + var USING_DEFAULT_WARNING; + var USING_FALLBACK_WARNING; +} diff --git a/build/linux64_569e52e/std/flash/globalization/LocaleID.hx b/build/linux64_569e52e/std/flash/globalization/LocaleID.hx new file mode 100644 index 0000000..f86d0d7 --- /dev/null +++ b/build/linux64_569e52e/std/flash/globalization/LocaleID.hx @@ -0,0 +1,17 @@ +package flash.globalization; + +@:require(flash10_1) extern final class LocaleID { + @:flash.property var lastOperationStatus(get,never) : LastOperationStatus; + @:flash.property var name(get,never) : String; + function new(name : String) : Void; + function getKeysAndValues() : flash.utils.Object; + function getLanguage() : String; + function getRegion() : String; + function getScript() : String; + function getVariant() : String; + private function get_lastOperationStatus() : LastOperationStatus; + private function get_name() : String; + function isRightToLeft() : Bool; + static final DEFAULT : String; + static function determinePreferredLocales(want : flash.Vector, have : flash.Vector, ?keyword : String) : flash.Vector; +} diff --git a/build/linux64_569e52e/std/flash/globalization/NationalDigitsType.hx b/build/linux64_569e52e/std/flash/globalization/NationalDigitsType.hx new file mode 100644 index 0000000..af535ae --- /dev/null +++ b/build/linux64_569e52e/std/flash/globalization/NationalDigitsType.hx @@ -0,0 +1,36 @@ +package flash.globalization; + +@:native("flash.globalization.NationalDigitsType") extern enum abstract NationalDigitsType(UInt) { + var ARABIC_INDIC; + var BALINESE; + var BENGALI; + var CHAM; + var DEVANAGARI; + var EUROPEAN; + var EXTENDED_ARABIC_INDIC; + var FULL_WIDTH; + var GUJARATI; + var GURMUKHI; + var KANNADA; + var KAYAH_LI; + var KHMER; + var LAO; + var LEPCHA; + var LIMBU; + var MALAYALAM; + var MONGOLIAN; + var MYANMAR; + var MYANMAR_SHAN; + var NEW_TAI_LUE; + var NKO; + var OL_CHIKI; + var ORIYA; + var OSMANYA; + var SAURASHTRA; + var SUNDANESE; + var TAMIL; + var TELUGU; + var THAI; + var TIBETAN; + var VAI; +} diff --git a/build/linux64_569e52e/std/flash/globalization/NumberFormatter.hx b/build/linux64_569e52e/std/flash/globalization/NumberFormatter.hx new file mode 100644 index 0000000..27b3f85 --- /dev/null +++ b/build/linux64_569e52e/std/flash/globalization/NumberFormatter.hx @@ -0,0 +1,47 @@ +package flash.globalization; + +@:require(flash10_1) extern final class NumberFormatter { + @:flash.property var actualLocaleIDName(get,never) : String; + @:flash.property var decimalSeparator(get,set) : String; + @:flash.property var digitsType(get,set) : NationalDigitsType; + @:flash.property var fractionalDigits(get,set) : Int; + @:flash.property var groupingPattern(get,set) : String; + @:flash.property var groupingSeparator(get,set) : String; + @:flash.property var lastOperationStatus(get,never) : LastOperationStatus; + @:flash.property var leadingZero(get,set) : Bool; + @:flash.property var negativeNumberFormat(get,set) : UInt; + @:flash.property var negativeSymbol(get,set) : String; + @:flash.property var requestedLocaleIDName(get,never) : String; + @:flash.property var trailingZeros(get,set) : Bool; + @:flash.property var useGrouping(get,set) : Bool; + function new(requestedLocaleIDName : String) : Void; + function formatInt(value : Int) : String; + function formatNumber(value : Float) : String; + function formatUint(value : UInt) : String; + private function get_actualLocaleIDName() : String; + private function get_decimalSeparator() : String; + private function get_digitsType() : NationalDigitsType; + private function get_fractionalDigits() : Int; + private function get_groupingPattern() : String; + private function get_groupingSeparator() : String; + private function get_lastOperationStatus() : LastOperationStatus; + private function get_leadingZero() : Bool; + private function get_negativeNumberFormat() : UInt; + private function get_negativeSymbol() : String; + private function get_requestedLocaleIDName() : String; + private function get_trailingZeros() : Bool; + private function get_useGrouping() : Bool; + function parse(parseString : String) : NumberParseResult; + function parseNumber(parseString : String) : Float; + private function set_decimalSeparator(value : String) : String; + private function set_digitsType(value : NationalDigitsType) : NationalDigitsType; + private function set_fractionalDigits(value : Int) : Int; + private function set_groupingPattern(value : String) : String; + private function set_groupingSeparator(value : String) : String; + private function set_leadingZero(value : Bool) : Bool; + private function set_negativeNumberFormat(value : UInt) : UInt; + private function set_negativeSymbol(value : String) : String; + private function set_trailingZeros(value : Bool) : Bool; + private function set_useGrouping(value : Bool) : Bool; + static function getAvailableLocaleIDNames() : flash.Vector; +} diff --git a/build/linux64_569e52e/std/flash/globalization/NumberParseResult.hx b/build/linux64_569e52e/std/flash/globalization/NumberParseResult.hx new file mode 100644 index 0000000..9697303 --- /dev/null +++ b/build/linux64_569e52e/std/flash/globalization/NumberParseResult.hx @@ -0,0 +1,11 @@ +package flash.globalization; + +@:require(flash10_1) extern final class NumberParseResult { + @:flash.property var endIndex(get,never) : Int; + @:flash.property var startIndex(get,never) : Int; + @:flash.property var value(get,never) : Float; + function new(value : Float = 0./*NaN*/, startIndex : Int = 2147483647, endIndex : Int = 2147483647) : Void; + private function get_endIndex() : Int; + private function get_startIndex() : Int; + private function get_value() : Float; +} diff --git a/build/linux64_569e52e/std/flash/globalization/StringTools.hx b/build/linux64_569e52e/std/flash/globalization/StringTools.hx new file mode 100644 index 0000000..4badc73 --- /dev/null +++ b/build/linux64_569e52e/std/flash/globalization/StringTools.hx @@ -0,0 +1,14 @@ +package flash.globalization; + +@:require(flash10_1) extern final class StringTools { + @:flash.property var actualLocaleIDName(get,never) : String; + @:flash.property var lastOperationStatus(get,never) : LastOperationStatus; + @:flash.property var requestedLocaleIDName(get,never) : String; + function new(requestedLocaleIDName : String) : Void; + private function get_actualLocaleIDName() : String; + private function get_lastOperationStatus() : LastOperationStatus; + private function get_requestedLocaleIDName() : String; + function toLowerCase(s : String) : String; + function toUpperCase(s : String) : String; + static function getAvailableLocaleIDNames() : flash.Vector; +} diff --git a/build/linux64_569e52e/std/flash/media/AVABRParameters.hx b/build/linux64_569e52e/std/flash/media/AVABRParameters.hx new file mode 100644 index 0000000..249ce7f --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/AVABRParameters.hx @@ -0,0 +1,20 @@ +package flash.media; + +extern class AVABRParameters { + @:flash.property var maxBitsPerSecond(get,set) : Int; + @:flash.property var minBitsPerSecond(get,set) : Int; + @:flash.property var policy(get,set) : String; + @:flash.property var startBitsPerSecond(get,set) : Int; + function new(init_policy : String, init_startBitsPerSecond : UInt, init_minBitsPerSecond : UInt, init_maxBitsPerSecond : UInt) : Void; + private function get_maxBitsPerSecond() : Int; + private function get_minBitsPerSecond() : Int; + private function get_policy() : String; + private function get_startBitsPerSecond() : Int; + private function set_maxBitsPerSecond(value : Int) : Int; + private function set_minBitsPerSecond(value : Int) : Int; + private function set_policy(value : String) : String; + private function set_startBitsPerSecond(value : Int) : Int; + static final AGGRESSIVE : String; + static final CONSERVATIVE : String; + static final MODERATE : String; +} diff --git a/build/linux64_569e52e/std/flash/media/AVABRProfileInfo.hx b/build/linux64_569e52e/std/flash/media/AVABRProfileInfo.hx new file mode 100644 index 0000000..983e2c3 --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/AVABRProfileInfo.hx @@ -0,0 +1,11 @@ +package flash.media; + +extern class AVABRProfileInfo { + @:flash.property var bitsPerSecond(get,never) : Int; + @:flash.property var height(get,never) : Int; + @:flash.property var width(get,never) : Int; + function new(init_bitsPerSecond : Int, init_width : Int, init_height : Int) : Void; + private function get_bitsPerSecond() : Int; + private function get_height() : Int; + private function get_width() : Int; +} diff --git a/build/linux64_569e52e/std/flash/media/AVCaptionStyle.hx b/build/linux64_569e52e/std/flash/media/AVCaptionStyle.hx new file mode 100644 index 0000000..fc3c76f --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/AVCaptionStyle.hx @@ -0,0 +1,77 @@ +package flash.media; + +extern class AVCaptionStyle { + @:flash.property var backgroundColor(get,set) : String; + @:flash.property var backgroundOpacity(get,set) : String; + @:flash.property var bottomInset(get,set) : String; + @:flash.property var edgeColor(get,set) : String; + @:flash.property var fillColor(get,set) : String; + @:flash.property var fillOpacity(get,set) : String; + @:flash.property var font(get,set) : String; + @:flash.property var fontColor(get,set) : String; + @:flash.property var fontEdge(get,set) : String; + @:flash.property var fontOpacity(get,set) : String; + @:flash.property var size(get,set) : String; + function new() : Void; + private function get_backgroundColor() : String; + private function get_backgroundOpacity() : String; + private function get_bottomInset() : String; + private function get_edgeColor() : String; + private function get_fillColor() : String; + private function get_fillOpacity() : String; + private function get_font() : String; + private function get_fontColor() : String; + private function get_fontEdge() : String; + private function get_fontOpacity() : String; + private function get_size() : String; + private function set_backgroundColor(value : String) : String; + private function set_backgroundOpacity(value : String) : String; + private function set_bottomInset(value : String) : String; + private function set_edgeColor(value : String) : String; + private function set_fillColor(value : String) : String; + private function set_fillOpacity(value : String) : String; + private function set_font(value : String) : String; + private function set_fontColor(value : String) : String; + private function set_fontEdge(value : String) : String; + private function set_fontOpacity(value : String) : String; + private function set_size(value : String) : String; + static final BLACK : String; + static final BLUE : String; + static final BRIGHT_BLUE : String; + static final BRIGHT_CYAN : String; + static final BRIGHT_GREEN : String; + static final BRIGHT_MAGENTA : String; + static final BRIGHT_RED : String; + static final BRIGHT_WHITE : String; + static final BRIGHT_YELLOW : String; + static final CASUAL : String; + static final CURSIVE : String; + static final CYAN : String; + static final DARK_BLUE : String; + static final DARK_CYAN : String; + static final DARK_GREEN : String; + static final DARK_MAGENTA : String; + static final DARK_RED : String; + static final DARK_YELLOW : String; + static final DEFAULT : String; + static final DEPRESSED : String; + static final GRAY : String; + static final GREEN : String; + static final LARGE : String; + static final LEFT_DROP_SHADOW : String; + static final MAGENTA : String; + static final MEDIUM : String; + static final MONOSPACED_WITHOUT_SERIFS : String; + static final MONOSPACE_WITH_SERIFS : String; + static final NONE : String; + static final PROPORTIONAL_WITHOUT_SERIFS : String; + static final PROPORTIONAL_WITH_SERIFS : String; + static final RAISED : String; + static final RED : String; + static final RIGHT_DROP_SHADOW : String; + static final SMALL : String; + static final SMALL_CAPITALS : String; + static final UNIFORM : String; + static final WHITE : String; + static final YELLOW : String; +} diff --git a/build/linux64_569e52e/std/flash/media/AVCuePoint.hx b/build/linux64_569e52e/std/flash/media/AVCuePoint.hx new file mode 100644 index 0000000..34b2427 --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/AVCuePoint.hx @@ -0,0 +1,9 @@ +package flash.media; + +extern class AVCuePoint { + @:flash.property var dictionary(get,never) : flash.utils.Dictionary; + @:flash.property var localTime(get,never) : Float; + function new(init_dictionary : flash.utils.Dictionary, init_localTime : Float) : Void; + private function get_dictionary() : flash.utils.Dictionary; + private function get_localTime() : Float; +} diff --git a/build/linux64_569e52e/std/flash/media/AVInsertionResult.hx b/build/linux64_569e52e/std/flash/media/AVInsertionResult.hx new file mode 100644 index 0000000..8f1e555 --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/AVInsertionResult.hx @@ -0,0 +1,9 @@ +package flash.media; + +extern class AVInsertionResult extends AVResult { + @:flash.property var insertedBeforeReadHead(get,never) : Bool; + @:flash.property var periodIndex(get,never) : Int; + function new(result : Int, periodIndex : Int, insertedBeforeReadHead : Bool) : Void; + private function get_insertedBeforeReadHead() : Bool; + private function get_periodIndex() : Int; +} diff --git a/build/linux64_569e52e/std/flash/media/AVNetworkingParams.hx b/build/linux64_569e52e/std/flash/media/AVNetworkingParams.hx new file mode 100644 index 0000000..7bc5cbd --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/AVNetworkingParams.hx @@ -0,0 +1,20 @@ +package flash.media; + +extern class AVNetworkingParams { + @:flash.property var appendRandomQueryParameter(get,set) : String; + @:flash.property var forceNativeNetworking(get,set) : Bool; + @:flash.property var networkDownVerificationUrl(get,set) : String; + @:flash.property var readSetCookieHeader(get,set) : Bool; + @:flash.property var useCookieHeaderForAllRequests(get,set) : Bool; + function new(init_forceNativeNetworking : Bool = false, init_readSetCookieHeader : Bool = true, init_useCookieHeaderForAllRequests : Bool = false, ?init_networkDownVerificationUrl : String) : Void; + private function get_appendRandomQueryParameter() : String; + private function get_forceNativeNetworking() : Bool; + private function get_networkDownVerificationUrl() : String; + private function get_readSetCookieHeader() : Bool; + private function get_useCookieHeaderForAllRequests() : Bool; + private function set_appendRandomQueryParameter(value : String) : String; + private function set_forceNativeNetworking(value : Bool) : Bool; + private function set_networkDownVerificationUrl(value : String) : String; + private function set_readSetCookieHeader(value : Bool) : Bool; + private function set_useCookieHeaderForAllRequests(value : Bool) : Bool; +} diff --git a/build/linux64_569e52e/std/flash/media/AVPeriodInfo.hx b/build/linux64_569e52e/std/flash/media/AVPeriodInfo.hx new file mode 100644 index 0000000..5f49b21 --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/AVPeriodInfo.hx @@ -0,0 +1,25 @@ +package flash.media; + +extern class AVPeriodInfo { + @:flash.property var duration(get,never) : Float; + @:flash.property var firstCuePointIndex(get,never) : Int; + @:flash.property var firstSubscribedTagIndex(get,never) : Int; + @:flash.property var lastCuePointIndex(get,never) : Int; + @:flash.property var lastSubscribedTagIndex(get,never) : Int; + @:flash.property var localStartTime(get,never) : Float; + @:flash.property var supportsTrickPlay(get,never) : Bool; + @:flash.property var targetDuration(get,never) : Float; + @:flash.property var userData(get,never) : Int; + @:flash.property var virtualStartTime(get,never) : Float; + function new(init_localStartTime : Float, init_virtualStartTime : Float, init_duration : Float, init_firstCuePointIndex : Int, init_lastCuePointIndex : Int, init_firstSubscribedTagIndex : Int, init_lastSubscribedTagIndex : Int, init_userData : Int, init_supportsTrickPlay : Bool, init_targetDuration : Float) : Void; + private function get_duration() : Float; + private function get_firstCuePointIndex() : Int; + private function get_firstSubscribedTagIndex() : Int; + private function get_lastCuePointIndex() : Int; + private function get_lastSubscribedTagIndex() : Int; + private function get_localStartTime() : Float; + private function get_supportsTrickPlay() : Bool; + private function get_targetDuration() : Float; + private function get_userData() : Int; + private function get_virtualStartTime() : Float; +} diff --git a/build/linux64_569e52e/std/flash/media/AVPlayState.hx b/build/linux64_569e52e/std/flash/media/AVPlayState.hx new file mode 100644 index 0000000..00f4020 --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/AVPlayState.hx @@ -0,0 +1,16 @@ +package flash.media; + +extern class AVPlayState { + @:flash.property var state(get,never) : Int; + function new(state : UInt) : Void; + private function get_state() : Int; + static final BUFFERING : Int; + static final EOF : Int; + static final PAUSED : Int; + static final PLAYING : Int; + static final READY : Int; + static final SUSPENDED : Int; + static final TRICK_PLAY : Int; + static final UNINITIALIZED : Int; + static final UNRECOVERABLE_ERROR : Int; +} diff --git a/build/linux64_569e52e/std/flash/media/AVResult.hx b/build/linux64_569e52e/std/flash/media/AVResult.hx new file mode 100644 index 0000000..1594a40 --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/AVResult.hx @@ -0,0 +1,108 @@ +package flash.media; + +extern class AVResult { + @:flash.property var result(get,never) : Int; + function new(inResult : Int) : Void; + private function get_result() : Int; + static final ASYNC_OPERATION_IN_PROGRESS : Int; + static final AUDIO_ONLY_STREAM_END : Int; + static final AUDIO_ONLY_STREAM_START : Int; + static final AUDIO_START_ERROR : Int; + static final BAD_MANIFEST_SIGNATURE : Int; + static final BAD_MEDIASAMPLE_FOUND : Int; + static final BAD_MEDIA_INTERLEAVING : Int; + static final CALLED_FROM_WRONG_THREAD : Int; + static final CANNOT_ERASE_TIMELINE : Int; + static final CANNOT_FAIL_OVER : Int; + static final CANNOT_HANDLE_MAIN_MANIFEST_UPDATE : Int; + static final CANNOT_LOAD_PLAY_LIST : Int; + static final CANNOT_SPLIT_TIMELINE : Int; + static final CODEC_NOT_SUPPORTED : Int; + static final COMPONENT_CREATION_FAILURE : Int; + static final CONTAINER_NOT_SUPPORTED : Int; + static final CONTENT_LENGTH_MISMATCH : Int; + static final CRYPTO_ALGORITHM_NOT_SUPPORTED : Int; + static final CRYPTO_ERROR_BAD_CERTIFICATE : Int; + static final CRYPTO_ERROR_BAD_PARAMETER : Int; + static final CRYPTO_ERROR_BUFFER_TOO_SMALL : Int; + static final CRYPTO_ERROR_CORRUPTED_DATA : Int; + static final CRYPTO_ERROR_DIGEST_FINISH : Int; + static final CRYPTO_ERROR_DIGEST_UPDATE : Int; + static final CRYPTO_ERROR_UNKNOWN : Int; + static final CURRENT_PERIOD_EXPIRED : Int; + static final DECODER_FAILED : Int; + static final DEVICE_OPEN_ERROR : Int; + static final DID_NOT_GET_NEXT_FRAGMENT : Int; + static final DRM_INIT_ERROR : Int; + static final DRM_NOT_AVAILABLE : Int; + static final END_OF_PERIOD : Int; + static final EOF : Int; + static final FILE_NOT_FOUND : Int; + static final FILE_OPEN_ERROR : Int; + static final FILE_READ_ERROR : Int; + static final FILE_STRUCTURE_INVALID : Int; + static final FILE_WRITE_ERROR : Int; + static final FRAGMENT_READ_ERROR : Int; + static final GENERIC_ERROR : Int; + static final HTTP_TIME_OUT : Int; + static final ID3_PARSE_ERROR : Int; + static final INCOMPATIBLE_RENDER_MODE : Int; + static final INCOMPATIBLE_VERSION : Int; + static final INTERNAL_ERROR : Int; + static final INVALID_KEY : Int; + static final INVALID_OPERATION : Int; + static final INVALID_PARAMETER : Int; + static final INVALID_REPLACE_DURATION : Int; + static final INVALID_SEEK_TIME : Int; + static final INVALID_WITH_AUDIO_ONLY_FILE : Int; + static final IRRECOVERABLE_ERROR : Int; + static final KEY_NOT_FOUND : Int; + static final KEY_SERVER_NOT_FOUND : Int; + static final LISTENER_NOT_FOUND : Int; + static final LIVE_HOLD : Int; + static final LIVE_WINDOW_MOVED_BACKWARD : Int; + static final LOST_CONNECTION_RECOVERABLE : Int; + static final MAIN_MANIFEST_UPDATE_TO_BE_HANDLED : Int; + static final MANIFEST_FILE_UNEXPECTEDLY_CHANGED : Int; + static final NETWORK_DOWN : Int; + static final NETWORK_ERROR : Int; + static final NETWORK_UNAVAILABLE : Int; + static final NOT_IMPLEMENTED : Int; + static final NO_AUDIO_SINK : Int; + static final NO_FIXED_SIZE : Int; + static final NO_TIMELINE : Int; + static final NO_USEABLE_BITRATE_PROFILE : Int; + static final NULL_OPERATION : Int; + static final ONLY_ALLOWED_IN_PAUSED_STATE : Int; + static final OPERATION_ABORTED : Int; + static final OUT_OF_MEMORY : Int; + static final OVERFLOW : Int; + static final PARSE_ERROR : Int; + static final PARTIAL_REPLACEMENT : Int; + static final PERIOD_HOLD : Int; + static final PERIOD_NOT_LOADED : Int; + static final PLAYBACK_NOT_ENABLED : Int; + static final POSTROLL_WITH_LIVE_NOT_ALLOWED : Int; + static final PREVIOUS_STEP_SEEK_IN_PROGRESS : Int; + static final PROTOCOL_NOT_SUPPORTED : Int; + static final RANGE_ERROR : Int; + static final RANGE_SPANS_READHEAD : Int; + static final RENDITION_M3U8_ERROR : Int; + static final REPLACEMENT_FAILED : Int; + static final RESOURCE_NOT_SPECIFIED : Int; + static final SECURITY_ERROR : Int; + static final SEEK_FAILED : Int; + static final SEGMENT_SKIPPED_ON_FAILURE : Int; + static final SIZE_UNKNOWN : Int; + static final SPS_PPS_FOUND_OUTSIDE_AVCC : Int; + static final SUCCESS : Int; + static final SWITCH_TO_ASYMMETRIC_PROFILE : Int; + static final TIMELINE_TOO_SHORT : Int; + static final UNDERFLOW : Int; + static final UNREPORTED_TIME_DISCONTINUITY_FOUND : Int; + static final UNSUPPORTED_CONFIGURATION : Int; + static final UNSUPPORTED_HLS_VERSION : Int; + static final UNSUPPORTED_OPERATION : Int; + static final VIDEO_PROFILE_NOT_SUPPORTED : Int; + static final WAITING_FOR_INIT : Int; +} diff --git a/build/linux64_569e52e/std/flash/media/AVSegmentedSource.hx b/build/linux64_569e52e/std/flash/media/AVSegmentedSource.hx new file mode 100644 index 0000000..b9fa0ec --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/AVSegmentedSource.hx @@ -0,0 +1,60 @@ +package flash.media; + +extern class AVSegmentedSource extends AVSource { + @:flash.property var cookieHeader(never,set) : String; + @:flash.property var masterUpdateInterval(never,set) : Int; + @:flash.property var networkingParams(get,set) : AVNetworkingParams; + @:flash.property var useRedirectedUrl(never,set) : Bool; + function new() : Void; + function addCustomHeader(headerName : String, args : flash.Vector) : Void; + function clearPauseAtPeriodEnd(periodIndex : Int) : AVResult; + function getABRProfileCount(periodIndex : Int) : Int; + function getABRProfileInfoAtIndex(periodIndex : Int, abrProfileIndex : Int) : AVABRProfileInfo; + function getBackgroundPeriodInfo(periodIndex : Int) : AVPeriodInfo; + function getBackgroundTimeline() : AVTimeline; + function getCuePoint(periodIndex : Int, cuePointIndex : Int) : AVCuePoint; + function getMediaPreferredStartTime() : Float; + function getPerceivedBandwidth() : UInt; + function getPeriodInfo(periodIndex : Int) : AVPeriodInfo; + function getPeriodInfoWithTagsAcrossIndexes(periodIndex : Int, startPeriodIndex : Int) : AVPeriodInfo; + function getSubscribedTag(periodIndex : Int, tagDataIndex : Int) : AVTagData; + function getSubscribedTagForBackgroundManifest(periodIndex : Int, tagDataIndex : Int) : AVTagData; + function getTimeline() : AVTimeline; + function getTimelineSubscribedTag(tagDataIndex : Int) : AVTagData; + function getTimelineSubscribedTagForBackgroundManifest(tagDataIndex : Int) : AVTagData; + function getTrackCount(periodIndex : Int, payloadType : String) : Int; + function getTrackInfo(periodIndex : Int, payloadType : String, trackIndex : Int) : AVTrackInfo; + private function get_networkingParams() : AVNetworkingParams; + function insertByLocalTime(periodIndex : Int, insertionTime : Float, handle : Int, userData : Int = 0, replaceDuration : Float = 0) : AVInsertionResult; + function insertByVirtualTime(insertionTime : Float, handle : Int, userData : Int = 0, replaceDuration : Float = 0) : AVInsertionResult; + function load(url : String, ?containerType : String, userData : Int = 0) : AVResult; + function loadManifest(uri : String, userData : Int = 0, ?containerType : String) : AVResult; + function loadWithBackgroundManifest(url : String, containerType : String, userData : Int, backgroundManifest : String) : AVResult; + function releaseManifest(handle : Int) : AVResult; + function removeByLocalTime(periodIndex : Int, timeStart : Float, timeEnd : Float, replaceWithMainMedia : Bool) : AVResult; + function removeByVirtualTime(virtualTimeStart : Float, virtualTimeEnd : Float) : AVResult; + function removeByVirtualTimeWithReplacement(virtualTimeStart : Float, virtualTimeEnd : Float, replaceWithMainMedia : Bool) : AVResult; + function selectTrack(periodIndex : Int, payloadType : String, trackIndex : Int) : AVResult; + function selectTrackString(periodIndex : Int, payloadType : String, trackString : String) : AVResult; + function setABRParameters(params : AVABRParameters) : AVResult; + function setBandwidth(bitsPerSecond : Int) : AVResult; + function setCuePointTags(tagArray : Array) : AVResult; + function setHoldAt(time : Float) : AVResult; + function setPauseAtPeriodEnd(periodIndex : Int, userData : Int = 0) : AVResult; + function setSubscribedTags(tagArray : Array) : AVResult; + function setSubscribedTagsForBackgroundManifest(tagArray : Array) : AVResult; + private function set_cookieHeader(value : String) : String; + private function set_masterUpdateInterval(value : Int) : Int; + private function set_networkingParams(value : AVNetworkingParams) : AVNetworkingParams; + private function set_useRedirectedUrl(value : Bool) : Bool; + static final AUDIO : String; + static final AUDIO_DESCRIPTION : String; + static final AUDIO_LANGUAGE : String; + static final AUDIO_PID : String; + static final DASH : String; + static final DATA : String; + static final DATA_DESCRIPTION : String; + static final HLS : String; + static final VIDEO : String; + static final VIDEO_DESCRIPTION : String; +} diff --git a/build/linux64_569e52e/std/flash/media/AVSource.hx b/build/linux64_569e52e/std/flash/media/AVSource.hx new file mode 100644 index 0000000..c5fb4a5 --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/AVSource.hx @@ -0,0 +1,6 @@ +package flash.media; + +extern class AVSource extends flash.events.EventDispatcher { + function new() : Void; + function dispose() : Void; +} diff --git a/build/linux64_569e52e/std/flash/media/AVStream.hx b/build/linux64_569e52e/std/flash/media/AVStream.hx new file mode 100644 index 0000000..272037b --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/AVStream.hx @@ -0,0 +1,57 @@ +package flash.media; + +extern class AVStream extends flash.events.EventDispatcher { + @:flash.property var backBufferLength(get,never) : Float; + @:flash.property var backBufferTime(never,set) : Float; + @:flash.property var bufferLength(get,never) : Float; + @:flash.property var bufferTime(never,set) : Float; + @:flash.property var captionStyle(never,set) : AVCaptionStyle; + @:flash.property var captionsEnabled(get,set) : Bool; + @:flash.property var clientLivePoint(get,never) : Float; + @:flash.property var currentFPS(get,never) : Float; + @:flash.property var decoderType(get,never) : String; + @:flash.property var droppedFrames(get,never) : Int; + @:flash.property var frameTime(get,never) : Float; + @:flash.property var initialBufferTime(never,set) : Float; + @:flash.property var playState(get,never) : AVPlayState; + @:flash.property var renderType(get,never) : String; + @:flash.property var time(get,never) : Float; + @:flash.property var useHardwareDecoder(get,set) : Bool; + @:flash.property var volume(get,set) : Float; + function new(source : AVSource) : Void; + function dispose() : Void; + function fastForward(rate : Float) : AVResult; + private function get_backBufferLength() : Float; + private function get_bufferLength() : Float; + private function get_captionsEnabled() : Bool; + private function get_clientLivePoint() : Float; + private function get_currentFPS() : Float; + private function get_decoderType() : String; + private function get_droppedFrames() : Int; + private function get_frameTime() : Float; + private function get_playState() : AVPlayState; + private function get_renderType() : String; + private function get_time() : Float; + private function get_useHardwareDecoder() : Bool; + private function get_volume() : Float; + function pause() : AVResult; + function play() : AVResult; + function resume() : Bool; + function rewind(rate : Float) : AVResult; + function seek(offset : Float, inBufferSeek : Bool = true) : AVResult; + function seekToKeyFrame(offset : Float, inBufferSeek : Bool = true) : AVResult; + function seekToLivePoint() : AVResult; + function seekToLocalTime(periodIndex : Int, time : Float) : AVResult; + function setPlaySpeed(speed : Float, reserved : Float) : Void; + private function set_backBufferTime(value : Float) : Float; + private function set_bufferTime(value : Float) : Float; + private function set_captionStyle(value : AVCaptionStyle) : AVCaptionStyle; + private function set_captionsEnabled(value : Bool) : Bool; + private function set_initialBufferTime(value : Float) : Float; + private function set_useHardwareDecoder(value : Bool) : Bool; + private function set_volume(value : Float) : Float; + function step(frames : Int) : AVResult; + static final HARDWARE : String; + static final SOFTWARE : String; + static final UNDEFINED : String; +} diff --git a/build/linux64_569e52e/std/flash/media/AVTagData.hx b/build/linux64_569e52e/std/flash/media/AVTagData.hx new file mode 100644 index 0000000..0d1272a --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/AVTagData.hx @@ -0,0 +1,9 @@ +package flash.media; + +extern class AVTagData { + @:flash.property var data(get,never) : String; + @:flash.property var localTime(get,never) : Float; + function new(init_data : String, init_localTime : Float) : Void; + private function get_data() : String; + private function get_localTime() : Float; +} diff --git a/build/linux64_569e52e/std/flash/media/AVTimeline.hx b/build/linux64_569e52e/std/flash/media/AVTimeline.hx new file mode 100644 index 0000000..e939c8c --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/AVTimeline.hx @@ -0,0 +1,21 @@ +package flash.media; + +extern class AVTimeline { + @:flash.property var complete(get,never) : Bool; + @:flash.property var firstPeriodIndex(get,never) : Int; + @:flash.property var firstSubscribedTagIndex(get,never) : Int; + @:flash.property var lastPeriodIndex(get,never) : Int; + @:flash.property var lastSubscribedTagIndex(get,never) : Int; + @:flash.property var type(get,never) : String; + @:flash.property var virtualDuration(get,never) : Float; + @:flash.property var virtualStartTime(get,never) : Float; + function new(init_type : String, init_virtualStartTime : Float, init_virtualDuration : Float, init_firstPeriodIndex : Int, init_lastPeriodIndex : Int, init_firstSubscribedIndex : Int, init_lastSubscribedIndex : Int, init_complete : Bool) : Void; + private function get_complete() : Bool; + private function get_firstPeriodIndex() : Int; + private function get_firstSubscribedTagIndex() : Int; + private function get_lastPeriodIndex() : Int; + private function get_lastSubscribedTagIndex() : Int; + private function get_type() : String; + private function get_virtualDuration() : Float; + private function get_virtualStartTime() : Float; +} diff --git a/build/linux64_569e52e/std/flash/media/AVTrackInfo.hx b/build/linux64_569e52e/std/flash/media/AVTrackInfo.hx new file mode 100644 index 0000000..08dbd28 --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/AVTrackInfo.hx @@ -0,0 +1,24 @@ +package flash.media; + +extern class AVTrackInfo { + @:flash.property var activity(get,never) : Bool; + @:flash.property var autoSelect(get,never) : Bool; + @:flash.property var dataTrackInfoServiceType(get,never) : String; + @:flash.property var defaultTrack(get,never) : Bool; + @:flash.property var description(get,never) : String; + @:flash.property var forced(get,never) : Bool; + @:flash.property var language(get,never) : String; + @:flash.property var pid(get,never) : Int; + function new(init_description : String, init_language : String, init_defaultTrack : Bool, init_autoSelect : Bool, init_forced : Bool, init_activity : Bool, init_dataTrackInfoServiceType : String, init_pid : Int) : Void; + private function get_activity() : Bool; + private function get_autoSelect() : Bool; + private function get_dataTrackInfoServiceType() : String; + private function get_defaultTrack() : Bool; + private function get_description() : String; + private function get_forced() : Bool; + private function get_language() : String; + private function get_pid() : Int; + static final DTI_608_CAPTIONS : String; + static final DTI_708_CAPTIONS : String; + static final DTI_WEBVTT_CAPTIONS : String; +} diff --git a/build/linux64_569e52e/std/flash/media/AVURLLoader.hx b/build/linux64_569e52e/std/flash/media/AVURLLoader.hx new file mode 100644 index 0000000..4f9fd81 --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/AVURLLoader.hx @@ -0,0 +1,8 @@ +package flash.media; + +extern class AVURLLoader extends flash.net.URLLoader { + @:flash.property var cookieHeader(never,set) : String; + var stream : AVURLStream; + function new(?request : flash.net.URLRequest) : Void; + private function set_cookieHeader(value : String) : String; +} diff --git a/build/linux64_569e52e/std/flash/media/AVURLStream.hx b/build/linux64_569e52e/std/flash/media/AVURLStream.hx new file mode 100644 index 0000000..ea59d65 --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/AVURLStream.hx @@ -0,0 +1,7 @@ +package flash.media; + +extern class AVURLStream extends flash.net.URLStream { + @:flash.property var cookieHeader(never,set) : String; + function new() : Void; + private function set_cookieHeader(value : String) : String; +} diff --git a/build/linux64_569e52e/std/flash/media/AudioDecoder.hx b/build/linux64_569e52e/std/flash/media/AudioDecoder.hx new file mode 100644 index 0000000..a4cac29 --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/AudioDecoder.hx @@ -0,0 +1,11 @@ +package flash.media; + +extern class AudioDecoder { + function new() : Void; + static final DOLBY_DIGITAL : String; + static final DOLBY_DIGITAL_PLUS : String; + static final DTS : String; + static final DTS_EXPRESS : String; + static final DTS_HD_HIGH_RESOLUTION_AUDIO : String; + static final DTS_HD_MASTER_AUDIO : String; +} diff --git a/build/linux64_569e52e/std/flash/media/AudioDeviceManager.hx b/build/linux64_569e52e/std/flash/media/AudioDeviceManager.hx new file mode 100644 index 0000000..791aba6 --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/AudioDeviceManager.hx @@ -0,0 +1,14 @@ +package flash.media; + +extern final class AudioDeviceManager extends flash.events.EventDispatcher { + @:flash.property var deviceNames(get,never) : Array; + @:flash.property var selectedDeviceIndex(get,set) : Int; + function new() : Void; + private function get_deviceNames() : Array; + private function get_selectedDeviceIndex() : Int; + private function set_selectedDeviceIndex(value : Int) : Int; + @:flash.property static var audioDeviceManager(get,never) : AudioDeviceManager; + @:flash.property static var isSupported(get,never) : Bool; + private static function get_audioDeviceManager() : AudioDeviceManager; + private static function get_isSupported() : Bool; +} diff --git a/build/linux64_569e52e/std/flash/media/AudioOutputChangeReason.hx b/build/linux64_569e52e/std/flash/media/AudioOutputChangeReason.hx new file mode 100644 index 0000000..3e12b6c --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/AudioOutputChangeReason.hx @@ -0,0 +1,7 @@ +package flash.media; + +extern class AudioOutputChangeReason { + function new() : Void; + static final DEVICE_CHANGE : String; + static final USER_SELECTION : String; +} diff --git a/build/linux64_569e52e/std/flash/media/Camera.hx b/build/linux64_569e52e/std/flash/media/Camera.hx new file mode 100644 index 0000000..033410a --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/Camera.hx @@ -0,0 +1,50 @@ +package flash.media; + +extern final class Camera extends flash.events.EventDispatcher { + @:flash.property var activityLevel(get,never) : Float; + @:flash.property var bandwidth(get,never) : Int; + @:flash.property var currentFPS(get,never) : Float; + @:flash.property var fps(get,never) : Float; + @:flash.property var height(get,never) : Int; + @:flash.property var index(get,never) : Int; + @:flash.property var keyFrameInterval(get,never) : Int; + @:flash.property var loopback(get,never) : Bool; + @:flash.property var motionLevel(get,never) : Int; + @:flash.property var motionTimeout(get,never) : Int; + @:flash.property var muted(get,never) : Bool; + @:flash.property var name(get,never) : String; + @:flash.property @:require(flash11_2) var position(get,never) : String; + @:flash.property var quality(get,never) : Int; + @:flash.property var width(get,never) : Int; + function new() : Void; + @:require(flash11_4) function copyToByteArray(rect : flash.geom.Rectangle, destination : flash.utils.ByteArray) : Void; + @:require(flash11_4) function copyToVector(rect : flash.geom.Rectangle, destination : flash.Vector) : Void; + @:require(flash11_4) function drawToBitmapData(destination : flash.display.BitmapData) : Void; + private function get_activityLevel() : Float; + private function get_bandwidth() : Int; + private function get_currentFPS() : Float; + private function get_fps() : Float; + private function get_height() : Int; + private function get_index() : Int; + private function get_keyFrameInterval() : Int; + private function get_loopback() : Bool; + private function get_motionLevel() : Int; + private function get_motionTimeout() : Int; + private function get_muted() : Bool; + private function get_name() : String; + private function get_position() : String; + private function get_quality() : Int; + private function get_width() : Int; + function setCursor(value : Bool) : Void; + function setKeyFrameInterval(keyFrameInterval : Int) : Void; + function setLoopback(compress : Bool = false) : Void; + function setMode(width : Int, height : Int, fps : Float, favorArea : Bool = true) : Void; + function setMotionLevel(motionLevel : Int, timeout : Int = 2000) : Void; + function setQuality(bandwidth : Int, quality : Int) : Void; + @:flash.property @:require(flash10_1) static var isSupported(get,never) : Bool; + @:flash.property static var names(get,never) : Array; + @:ns("flash.media",internal) @:require(flash10_1) static function _scanHardware() : Void; + static function getCamera(?name : String) : Camera; + private static function get_isSupported() : Bool; + private static function get_names() : Array; +} diff --git a/build/linux64_569e52e/std/flash/media/H264Level.hx b/build/linux64_569e52e/std/flash/media/H264Level.hx new file mode 100644 index 0000000..e908c84 --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/H264Level.hx @@ -0,0 +1,21 @@ +package flash.media; + +extern class H264Level { + function new() : Void; + static final LEVEL_1 : String; + static final LEVEL_1B : String; + static final LEVEL_1_1 : String; + static final LEVEL_1_2 : String; + static final LEVEL_1_3 : String; + static final LEVEL_2 : String; + static final LEVEL_2_1 : String; + static final LEVEL_2_2 : String; + static final LEVEL_3 : String; + static final LEVEL_3_1 : String; + static final LEVEL_3_2 : String; + static final LEVEL_4 : String; + static final LEVEL_4_1 : String; + static final LEVEL_4_2 : String; + static final LEVEL_5 : String; + static final LEVEL_5_1 : String; +} diff --git a/build/linux64_569e52e/std/flash/media/H264Profile.hx b/build/linux64_569e52e/std/flash/media/H264Profile.hx new file mode 100644 index 0000000..41ba13a --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/H264Profile.hx @@ -0,0 +1,7 @@ +package flash.media; + +extern class H264Profile { + function new() : Void; + static final BASELINE : String; + static final MAIN : String; +} diff --git a/build/linux64_569e52e/std/flash/media/H264VideoStreamSettings.hx b/build/linux64_569e52e/std/flash/media/H264VideoStreamSettings.hx new file mode 100644 index 0000000..7086be1 --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/H264VideoStreamSettings.hx @@ -0,0 +1,10 @@ +package flash.media; + +extern class H264VideoStreamSettings extends VideoStreamSettings { + @:flash.property var level(get,never) : String; + @:flash.property var profile(get,never) : String; + function new() : Void; + private function get_level() : String; + private function get_profile() : String; + function setProfileLevel(profile : String, level : String) : Void; +} diff --git a/build/linux64_569e52e/std/flash/media/ID3Info.hx b/build/linux64_569e52e/std/flash/media/ID3Info.hx new file mode 100644 index 0000000..aef5c75 --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/ID3Info.hx @@ -0,0 +1,12 @@ +package flash.media; + +extern final class ID3Info implements Dynamic { + var album : String; + var artist : String; + var comment : String; + var genre : String; + var songName : String; + var track : String; + var year : String; + function new() : Void; +} diff --git a/build/linux64_569e52e/std/flash/media/Microphone.hx b/build/linux64_569e52e/std/flash/media/Microphone.hx new file mode 100644 index 0000000..4fd568f --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/Microphone.hx @@ -0,0 +1,55 @@ +package flash.media; + +extern final class Microphone extends flash.events.EventDispatcher { + @:flash.property var activityLevel(get,never) : Float; + @:flash.property @:require(flash10) var codec(get,set) : SoundCodec; + @:flash.property @:require(flash10_1) var enableVAD(get,set) : Bool; + @:flash.property @:require(flash10) var encodeQuality(get,set) : Int; + @:flash.property @:require(flash10_2) var enhancedOptions(get,set) : MicrophoneEnhancedOptions; + @:flash.property @:require(flash10) var framesPerPacket(get,set) : Int; + @:flash.property var gain(get,set) : Float; + @:flash.property var index(get,never) : Int; + @:flash.property var muted(get,never) : Bool; + @:flash.property var name(get,never) : String; + @:flash.property @:require(flash10_1) var noiseSuppressionLevel(get,set) : Int; + @:flash.property var rate(get,set) : Int; + @:flash.property var silenceLevel(get,never) : Float; + @:flash.property var silenceTimeout(get,never) : Int; + @:flash.property var soundTransform(get,set) : SoundTransform; + @:flash.property var useEchoSuppression(get,never) : Bool; + function new() : Void; + private function get_activityLevel() : Float; + private function get_codec() : SoundCodec; + private function get_enableVAD() : Bool; + private function get_encodeQuality() : Int; + private function get_enhancedOptions() : MicrophoneEnhancedOptions; + private function get_framesPerPacket() : Int; + private function get_gain() : Float; + private function get_index() : Int; + private function get_muted() : Bool; + private function get_name() : String; + private function get_noiseSuppressionLevel() : Int; + private function get_rate() : Int; + private function get_silenceLevel() : Float; + private function get_silenceTimeout() : Int; + private function get_soundTransform() : SoundTransform; + private function get_useEchoSuppression() : Bool; + function setLoopBack(state : Bool = true) : Void; + function setSilenceLevel(silenceLevel : Float, timeout : Int = -1) : Void; + function setUseEchoSuppression(useEchoSuppression : Bool) : Void; + private function set_codec(value : SoundCodec) : SoundCodec; + private function set_enableVAD(value : Bool) : Bool; + private function set_encodeQuality(value : Int) : Int; + private function set_enhancedOptions(value : MicrophoneEnhancedOptions) : MicrophoneEnhancedOptions; + private function set_framesPerPacket(value : Int) : Int; + private function set_gain(value : Float) : Float; + private function set_noiseSuppressionLevel(value : Int) : Int; + private function set_rate(value : Int) : Int; + private function set_soundTransform(value : SoundTransform) : SoundTransform; + @:flash.property @:require(flash10_1) static var isSupported(get,never) : Bool; + @:flash.property static var names(get,never) : Array; + @:require(flash10_2) static function getEnhancedMicrophone(index : Int = -1) : Microphone; + static function getMicrophone(index : Int = -1) : Microphone; + private static function get_isSupported() : Bool; + private static function get_names() : Array; +} diff --git a/build/linux64_569e52e/std/flash/media/MicrophoneEnhancedMode.hx b/build/linux64_569e52e/std/flash/media/MicrophoneEnhancedMode.hx new file mode 100644 index 0000000..7d21c3f --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/MicrophoneEnhancedMode.hx @@ -0,0 +1,9 @@ +package flash.media; + +@:native("flash.media.MicrophoneEnhancedMode") @:require(flash10_2) extern enum abstract MicrophoneEnhancedMode(String) { + var FULL_DUPLEX; + var HALF_DUPLEX; + var HEADSET; + var OFF; + var SPEAKER_MUTE; +} diff --git a/build/linux64_569e52e/std/flash/media/MicrophoneEnhancedOptions.hx b/build/linux64_569e52e/std/flash/media/MicrophoneEnhancedOptions.hx new file mode 100644 index 0000000..d9bd921 --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/MicrophoneEnhancedOptions.hx @@ -0,0 +1,20 @@ +package flash.media; + +@:require(flash10_2) extern final class MicrophoneEnhancedOptions { + @:flash.property var autoGain(get,set) : Bool; + @:flash.property var echoPath(get,set) : Int; + @:flash.property var isVoiceDetected(get,set) : Int; + @:flash.property var mode(get,set) : MicrophoneEnhancedMode; + @:flash.property var nonLinearProcessing(get,set) : Bool; + function new() : Void; + private function get_autoGain() : Bool; + private function get_echoPath() : Int; + private function get_isVoiceDetected() : Int; + private function get_mode() : MicrophoneEnhancedMode; + private function get_nonLinearProcessing() : Bool; + private function set_autoGain(value : Bool) : Bool; + private function set_echoPath(value : Int) : Int; + private function set_isVoiceDetected(value : Int) : Int; + private function set_mode(value : MicrophoneEnhancedMode) : MicrophoneEnhancedMode; + private function set_nonLinearProcessing(value : Bool) : Bool; +} diff --git a/build/linux64_569e52e/std/flash/media/Sound.hx b/build/linux64_569e52e/std/flash/media/Sound.hx new file mode 100644 index 0000000..45b2e19 --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/Sound.hx @@ -0,0 +1,25 @@ +package flash.media; + +extern class Sound extends flash.events.EventDispatcher { + @:flash.property var bytesLoaded(get,never) : UInt; + @:flash.property var bytesTotal(get,never) : Int; + @:flash.property var id3(get,never) : ID3Info; + @:flash.property var isBuffering(get,never) : Bool; + @:flash.property @:require(flash10_1) var isURLInaccessible(get,never) : Bool; + @:flash.property var length(get,never) : Float; + @:flash.property var url(get,never) : String; + function new(?stream : flash.net.URLRequest, ?context : SoundLoaderContext) : Void; + function close() : Void; + @:require(flash10) function extract(target : flash.utils.ByteArray, length : Float, startPosition : Float = -1) : Float; + private function get_bytesLoaded() : UInt; + private function get_bytesTotal() : Int; + private function get_id3() : ID3Info; + private function get_isBuffering() : Bool; + private function get_isURLInaccessible() : Bool; + private function get_length() : Float; + private function get_url() : String; + function load(stream : flash.net.URLRequest, ?context : SoundLoaderContext) : Void; + @:require(flash11) function loadCompressedDataFromByteArray(bytes : flash.utils.ByteArray, bytesLength : UInt) : Void; + @:require(flash11) function loadPCMFromByteArray(bytes : flash.utils.ByteArray, samples : UInt, ?format : String, stereo : Bool = true, sampleRate : Float = 44100) : Void; + function play(startTime : Float = 0, loops : Int = 0, ?sndTransform : SoundTransform) : SoundChannel; +} diff --git a/build/linux64_569e52e/std/flash/media/SoundChannel.hx b/build/linux64_569e52e/std/flash/media/SoundChannel.hx new file mode 100644 index 0000000..f487499 --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/SoundChannel.hx @@ -0,0 +1,15 @@ +package flash.media; + +extern final class SoundChannel extends flash.events.EventDispatcher { + @:flash.property var leftPeak(get,never) : Float; + @:flash.property var position(get,never) : Float; + @:flash.property var rightPeak(get,never) : Float; + @:flash.property var soundTransform(get,set) : SoundTransform; + function new() : Void; + private function get_leftPeak() : Float; + private function get_position() : Float; + private function get_rightPeak() : Float; + private function get_soundTransform() : SoundTransform; + private function set_soundTransform(value : SoundTransform) : SoundTransform; + function stop() : Void; +} diff --git a/build/linux64_569e52e/std/flash/media/SoundCodec.hx b/build/linux64_569e52e/std/flash/media/SoundCodec.hx new file mode 100644 index 0000000..ec09fde --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/SoundCodec.hx @@ -0,0 +1,8 @@ +package flash.media; + +@:native("flash.media.SoundCodec") extern enum abstract SoundCodec(String) { + var NELLYMOSER; + var PCMA; + var PCMU; + var SPEEX; +} diff --git a/build/linux64_569e52e/std/flash/media/SoundLoaderContext.hx b/build/linux64_569e52e/std/flash/media/SoundLoaderContext.hx new file mode 100644 index 0000000..0385429 --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/SoundLoaderContext.hx @@ -0,0 +1,7 @@ +package flash.media; + +extern class SoundLoaderContext { + var bufferTime : Float; + var checkPolicyFile : Bool; + function new(bufferTime : Float = 1000, checkPolicyFile : Bool = false) : Void; +} diff --git a/build/linux64_569e52e/std/flash/media/SoundMixer.hx b/build/linux64_569e52e/std/flash/media/SoundMixer.hx new file mode 100644 index 0000000..5b31805 --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/SoundMixer.hx @@ -0,0 +1,19 @@ +package flash.media; + +extern class SoundMixer { + @:flash.property static var audioPlaybackMode(get,set) : String; + @:flash.property static var bufferTime(get,set) : Int; + @:flash.property static var soundTransform(get,set) : SoundTransform; + @:flash.property static var useSpeakerphoneForVoice(get,set) : Bool; + static function areSoundsInaccessible() : Bool; + static function computeSpectrum(outputArray : flash.utils.ByteArray, FFTMode : Bool = false, stretchFactor : Int = 0) : Void; + private static function get_audioPlaybackMode() : String; + private static function get_bufferTime() : Int; + private static function get_soundTransform() : SoundTransform; + private static function get_useSpeakerphoneForVoice() : Bool; + private static function set_audioPlaybackMode(value : String) : String; + private static function set_bufferTime(value : Int) : Int; + private static function set_soundTransform(value : SoundTransform) : SoundTransform; + private static function set_useSpeakerphoneForVoice(value : Bool) : Bool; + static function stopAll() : Void; +} diff --git a/build/linux64_569e52e/std/flash/media/SoundTransform.hx b/build/linux64_569e52e/std/flash/media/SoundTransform.hx new file mode 100644 index 0000000..53ec3de --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/SoundTransform.hx @@ -0,0 +1,23 @@ +package flash.media; + +extern final class SoundTransform { + @:flash.property var leftToLeft(get,set) : Float; + @:flash.property var leftToRight(get,set) : Float; + @:flash.property var pan(get,set) : Float; + @:flash.property var rightToLeft(get,set) : Float; + @:flash.property var rightToRight(get,set) : Float; + @:flash.property var volume(get,set) : Float; + function new(vol : Float = 1, panning : Float = 0) : Void; + private function get_leftToLeft() : Float; + private function get_leftToRight() : Float; + private function get_pan() : Float; + private function get_rightToLeft() : Float; + private function get_rightToRight() : Float; + private function get_volume() : Float; + private function set_leftToLeft(value : Float) : Float; + private function set_leftToRight(value : Float) : Float; + private function set_pan(value : Float) : Float; + private function set_rightToLeft(value : Float) : Float; + private function set_rightToRight(value : Float) : Float; + private function set_volume(value : Float) : Float; +} diff --git a/build/linux64_569e52e/std/flash/media/StageVideo.hx b/build/linux64_569e52e/std/flash/media/StageVideo.hx new file mode 100644 index 0000000..70e3b0a --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/StageVideo.hx @@ -0,0 +1,26 @@ +package flash.media; + +@:require(flash10_2) extern class StageVideo extends flash.events.EventDispatcher { + @:flash.property var colorSpaces(get,never) : flash.Vector; + @:flash.property var depth(get,set) : Int; + @:flash.property var pan(get,set) : flash.geom.Point; + @:flash.property var videoHeight(get,never) : Int; + @:flash.property var videoWidth(get,never) : Int; + @:flash.property var viewPort(get,set) : flash.geom.Rectangle; + @:flash.property var zoom(get,set) : flash.geom.Point; + function new() : Void; + @:require(flash11_7) function attachAVStream(avStream : AVStream) : Void; + @:require(flash11_4) function attachCamera(theCamera : Camera) : Void; + function attachNetStream(netStream : flash.net.NetStream) : Void; + private function get_colorSpaces() : flash.Vector; + private function get_depth() : Int; + private function get_pan() : flash.geom.Point; + private function get_videoHeight() : Int; + private function get_videoWidth() : Int; + private function get_viewPort() : flash.geom.Rectangle; + private function get_zoom() : flash.geom.Point; + private function set_depth(value : Int) : Int; + private function set_pan(value : flash.geom.Point) : flash.geom.Point; + private function set_viewPort(value : flash.geom.Rectangle) : flash.geom.Rectangle; + private function set_zoom(value : flash.geom.Point) : flash.geom.Point; +} diff --git a/build/linux64_569e52e/std/flash/media/StageVideoAvailability.hx b/build/linux64_569e52e/std/flash/media/StageVideoAvailability.hx new file mode 100644 index 0000000..cdc3676 --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/StageVideoAvailability.hx @@ -0,0 +1,7 @@ +package flash.media; + +extern class StageVideoAvailability { + function new() : Void; + static final AVAILABLE : String; + static final UNAVAILABLE : String; +} diff --git a/build/linux64_569e52e/std/flash/media/StageVideoAvailabilityReason.hx b/build/linux64_569e52e/std/flash/media/StageVideoAvailabilityReason.hx new file mode 100644 index 0000000..82ff954 --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/StageVideoAvailabilityReason.hx @@ -0,0 +1,10 @@ +package flash.media; + +extern class StageVideoAvailabilityReason { + function new() : Void; + static final DRIVER_TOO_OLD : String; + static final NO_ERROR : String; + static final UNAVAILABLE : String; + static final USER_DISABLED : String; + static final WMODE_INCOMPATIBLE : String; +} diff --git a/build/linux64_569e52e/std/flash/media/Video.hx b/build/linux64_569e52e/std/flash/media/Video.hx new file mode 100644 index 0000000..d39918a --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/Video.hx @@ -0,0 +1,18 @@ +package flash.media; + +extern class Video extends flash.display.DisplayObject { + @:flash.property var deblocking(get,set) : Int; + @:flash.property var smoothing(get,set) : Bool; + @:flash.property var videoHeight(get,never) : Int; + @:flash.property var videoWidth(get,never) : Int; + function new(width : Int = 320, height : Int = 240) : Void; + function attachCamera(camera : Camera) : Void; + function attachNetStream(netStream : flash.net.NetStream) : Void; + function clear() : Void; + private function get_deblocking() : Int; + private function get_smoothing() : Bool; + private function get_videoHeight() : Int; + private function get_videoWidth() : Int; + private function set_deblocking(value : Int) : Int; + private function set_smoothing(value : Bool) : Bool; +} diff --git a/build/linux64_569e52e/std/flash/media/VideoCodec.hx b/build/linux64_569e52e/std/flash/media/VideoCodec.hx new file mode 100644 index 0000000..42afa7c --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/VideoCodec.hx @@ -0,0 +1,8 @@ +package flash.media; + +extern class VideoCodec { + function new() : Void; + static final H264AVC : String; + static final SORENSON : String; + static final VP6 : String; +} diff --git a/build/linux64_569e52e/std/flash/media/VideoStatus.hx b/build/linux64_569e52e/std/flash/media/VideoStatus.hx new file mode 100644 index 0000000..92e357c --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/VideoStatus.hx @@ -0,0 +1,8 @@ +package flash.media; + +extern class VideoStatus { + function new() : Void; + static final ACCELERATED : String; + static final SOFTWARE : String; + static final UNAVAILABLE : String; +} diff --git a/build/linux64_569e52e/std/flash/media/VideoStreamSettings.hx b/build/linux64_569e52e/std/flash/media/VideoStreamSettings.hx new file mode 100644 index 0000000..fb1a931 --- /dev/null +++ b/build/linux64_569e52e/std/flash/media/VideoStreamSettings.hx @@ -0,0 +1,22 @@ +package flash.media; + +extern class VideoStreamSettings { + @:flash.property var bandwidth(get,never) : Int; + @:flash.property var codec(get,never) : String; + @:flash.property var fps(get,never) : Float; + @:flash.property var height(get,never) : Int; + @:flash.property var keyFrameInterval(get,never) : Int; + @:flash.property var quality(get,never) : Int; + @:flash.property var width(get,never) : Int; + function new() : Void; + private function get_bandwidth() : Int; + private function get_codec() : String; + private function get_fps() : Float; + private function get_height() : Int; + private function get_keyFrameInterval() : Int; + private function get_quality() : Int; + private function get_width() : Int; + function setKeyFrameInterval(keyFrameInterval : Int) : Void; + function setMode(width : Int, height : Int, fps : Float) : Void; + function setQuality(bandwidth : Int, quality : Int) : Void; +} diff --git a/build/linux64_569e52e/std/flash/net/DynamicPropertyOutput.hx b/build/linux64_569e52e/std/flash/net/DynamicPropertyOutput.hx new file mode 100644 index 0000000..836d902 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/DynamicPropertyOutput.hx @@ -0,0 +1,6 @@ +package flash.net; + +extern class DynamicPropertyOutput implements IDynamicPropertyOutput { + function new() : Void; + function writeDynamicProperty(name : String, value : Dynamic) : Void; +} diff --git a/build/linux64_569e52e/std/flash/net/FileFilter.hx b/build/linux64_569e52e/std/flash/net/FileFilter.hx new file mode 100644 index 0000000..c56204c --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/FileFilter.hx @@ -0,0 +1,14 @@ +package flash.net; + +extern final class FileFilter { + @:flash.property var description(get,set) : String; + @:flash.property var extension(get,set) : String; + @:flash.property var macType(get,set) : String; + function new(description : String, extension : String, ?macType : String) : Void; + private function get_description() : String; + private function get_extension() : String; + private function get_macType() : String; + private function set_description(value : String) : String; + private function set_extension(value : String) : String; + private function set_macType(value : String) : String; +} diff --git a/build/linux64_569e52e/std/flash/net/FileReference.hx b/build/linux64_569e52e/std/flash/net/FileReference.hx new file mode 100644 index 0000000..1ff113f --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/FileReference.hx @@ -0,0 +1,25 @@ +package flash.net; + +extern class FileReference extends flash.events.EventDispatcher { + @:flash.property var creationDate(get,never) : Date; + @:flash.property var creator(get,never) : String; + @:flash.property @:require(flash10) var data(get,never) : flash.utils.ByteArray; + @:flash.property var modificationDate(get,never) : Date; + @:flash.property var name(get,never) : String; + @:flash.property var size(get,never) : Float; + @:flash.property var type(get,never) : String; + function new() : Void; + function browse(?typeFilter : Array) : Bool; + function cancel() : Void; + function download(request : URLRequest, ?defaultFileName : String) : Void; + private function get_creationDate() : Date; + private function get_creator() : String; + private function get_data() : flash.utils.ByteArray; + private function get_modificationDate() : Date; + private function get_name() : String; + private function get_size() : Float; + private function get_type() : String; + @:require(flash10) function load() : Void; + @:require(flash10) function save(data : Dynamic, ?defaultFileName : String) : Void; + function upload(request : URLRequest, ?uploadDataFieldName : String, testUpload : Bool = false) : Void; +} diff --git a/build/linux64_569e52e/std/flash/net/FileReferenceList.hx b/build/linux64_569e52e/std/flash/net/FileReferenceList.hx new file mode 100644 index 0000000..65a2a3f --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/FileReferenceList.hx @@ -0,0 +1,8 @@ +package flash.net; + +extern class FileReferenceList extends flash.events.EventDispatcher { + @:flash.property var fileList(get,never) : Array; + function new() : Void; + function browse(?typeFilter : Array) : Bool; + private function get_fileList() : Array; +} diff --git a/build/linux64_569e52e/std/flash/net/GroupSpecifier.hx b/build/linux64_569e52e/std/flash/net/GroupSpecifier.hx new file mode 100644 index 0000000..bf76d5c --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/GroupSpecifier.hx @@ -0,0 +1,44 @@ +package flash.net; + +@:require(flash10_1) extern class GroupSpecifier { + @:flash.property var ipMulticastMemberUpdatesEnabled(get,set) : Bool; + @:flash.property var minGroupspecVersion(get,set) : Int; + @:flash.property var multicastEnabled(get,set) : Bool; + @:flash.property var objectReplicationEnabled(get,set) : Bool; + @:flash.property var peerToPeerDisabled(get,set) : Bool; + @:flash.property var postingEnabled(get,set) : Bool; + @:flash.property var routingEnabled(get,set) : Bool; + @:flash.property var serverChannelEnabled(get,set) : Bool; + function new(name : String) : Void; + function addBootstrapPeer(peerID : String) : Void; + function addIPMulticastAddress(address : String, ?port : Dynamic, ?source : String) : Void; + function authorizations() : String; + private function get_ipMulticastMemberUpdatesEnabled() : Bool; + private function get_minGroupspecVersion() : Int; + private function get_multicastEnabled() : Bool; + private function get_objectReplicationEnabled() : Bool; + private function get_peerToPeerDisabled() : Bool; + private function get_postingEnabled() : Bool; + private function get_routingEnabled() : Bool; + private function get_serverChannelEnabled() : Bool; + function groupspecWithAuthorizations() : String; + function groupspecWithoutAuthorizations() : String; + function makeUnique() : Void; + function setPostingPassword(?password : String, ?salt : String) : Void; + function setPublishPassword(?password : String, ?salt : String) : Void; + private function set_ipMulticastMemberUpdatesEnabled(value : Bool) : Bool; + private function set_minGroupspecVersion(value : Int) : Int; + private function set_multicastEnabled(value : Bool) : Bool; + private function set_objectReplicationEnabled(value : Bool) : Bool; + private function set_peerToPeerDisabled(value : Bool) : Bool; + private function set_postingEnabled(value : Bool) : Bool; + private function set_routingEnabled(value : Bool) : Bool; + private function set_serverChannelEnabled(value : Bool) : Bool; + function toString() : String; + @:flash.property static var maxSupportedGroupspecVersion(get,never) : Int; + static function encodeBootstrapPeerIDSpec(peerID : String) : String; + static function encodeIPMulticastAddressSpec(address : String, ?port : Dynamic, ?source : String) : String; + static function encodePostingAuthorization(password : String) : String; + static function encodePublishAuthorization(password : String) : String; + private static function get_maxSupportedGroupspecVersion() : Int; +} diff --git a/build/linux64_569e52e/std/flash/net/IDynamicPropertyOutput.hx b/build/linux64_569e52e/std/flash/net/IDynamicPropertyOutput.hx new file mode 100644 index 0000000..08601ba --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/IDynamicPropertyOutput.hx @@ -0,0 +1,5 @@ +package flash.net; + +extern interface IDynamicPropertyOutput { + function writeDynamicProperty(name : String, value : Dynamic) : Void; +} diff --git a/build/linux64_569e52e/std/flash/net/IDynamicPropertyWriter.hx b/build/linux64_569e52e/std/flash/net/IDynamicPropertyWriter.hx new file mode 100644 index 0000000..cc80b60 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/IDynamicPropertyWriter.hx @@ -0,0 +1,5 @@ +package flash.net; + +extern interface IDynamicPropertyWriter { + function writeDynamicProperties(obj : flash.utils.Object, output : IDynamicPropertyOutput) : Void; +} diff --git a/build/linux64_569e52e/std/flash/net/LocalConnection.hx b/build/linux64_569e52e/std/flash/net/LocalConnection.hx new file mode 100644 index 0000000..c3aad34 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/LocalConnection.hx @@ -0,0 +1,20 @@ +package flash.net; + +extern class LocalConnection extends flash.events.EventDispatcher { + @:flash.property var client(get,set) : Dynamic; + @:flash.property var domain(get,never) : String; + @:flash.property @:require(flash10_1) var isPerUser(get,set) : Bool; + function new() : Void; + function allowDomain(restArgs : haxe.extern.Rest) : Void; + function allowInsecureDomain(restArgs : haxe.extern.Rest) : Void; + function close() : Void; + function connect(connectionName : String) : Void; + private function get_client() : Dynamic; + private function get_domain() : String; + private function get_isPerUser() : Bool; + function send(connectionName : String, methodName : String, restArgs : haxe.extern.Rest) : Void; + private function set_client(value : Dynamic) : Dynamic; + private function set_isPerUser(value : Bool) : Bool; + @:flash.property @:require(flash10_1) static var isSupported(get,never) : Bool; + private static function get_isSupported() : Bool; +} diff --git a/build/linux64_569e52e/std/flash/net/NetConnection.hx b/build/linux64_569e52e/std/flash/net/NetConnection.hx new file mode 100644 index 0000000..e5b2230 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/NetConnection.hx @@ -0,0 +1,44 @@ +package flash.net; + +extern class NetConnection extends flash.events.EventDispatcher { + @:flash.property var client(get,set) : Dynamic; + @:flash.property var connected(get,never) : Bool; + @:flash.property var connectedProxyType(get,never) : String; + @:flash.property @:require(flash10) var farID(get,never) : String; + @:flash.property @:require(flash10) var farNonce(get,never) : String; + @:flash.property @:require(flash10) var maxPeerConnections(get,set) : UInt; + @:flash.property @:require(flash10) var nearID(get,never) : String; + @:flash.property @:require(flash10) var nearNonce(get,never) : String; + @:flash.property var objectEncoding(get,set) : UInt; + @:flash.property @:require(flash10) var protocol(get,never) : String; + @:flash.property var proxyType(get,set) : String; + @:flash.property @:require(flash10) var unconnectedPeerStreams(get,never) : Array; + @:flash.property var uri(get,never) : String; + @:flash.property var usingTLS(get,never) : Bool; + function new() : Void; + function addHeader(operation : String, mustUnderstand : Bool = false, ?param : flash.utils.Object) : Void; + function call(command : String, responder : Responder, restArgs : haxe.extern.Rest) : Void; + function close() : Void; + function connect(command : String, restArgs : haxe.extern.Rest) : Void; + private function get_client() : Dynamic; + private function get_connected() : Bool; + private function get_connectedProxyType() : String; + private function get_farID() : String; + private function get_farNonce() : String; + private function get_maxPeerConnections() : UInt; + private function get_nearID() : String; + private function get_nearNonce() : String; + private function get_objectEncoding() : UInt; + private function get_protocol() : String; + private function get_proxyType() : String; + private function get_unconnectedPeerStreams() : Array; + private function get_uri() : String; + private function get_usingTLS() : Bool; + private function set_client(value : Dynamic) : Dynamic; + private function set_maxPeerConnections(value : UInt) : UInt; + private function set_objectEncoding(value : UInt) : UInt; + private function set_proxyType(value : String) : String; + @:flash.property static var defaultObjectEncoding(get,set) : UInt; + private static function get_defaultObjectEncoding() : UInt; + private static function set_defaultObjectEncoding(value : UInt) : UInt; +} diff --git a/build/linux64_569e52e/std/flash/net/NetGroup.hx b/build/linux64_569e52e/std/flash/net/NetGroup.hx new file mode 100644 index 0000000..3e1f90f --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/NetGroup.hx @@ -0,0 +1,35 @@ +package flash.net; + +@:require(flash10_1) extern class NetGroup extends flash.events.EventDispatcher { + @:flash.property var estimatedMemberCount(get,never) : Float; + @:flash.property var info(get,never) : NetGroupInfo; + @:flash.property var localCoverageFrom(get,never) : String; + @:flash.property var localCoverageTo(get,never) : String; + @:flash.property var neighborCount(get,never) : Float; + @:flash.property var receiveMode(get,set) : String; + @:flash.property var replicationStrategy(get,set) : String; + function new(connection : NetConnection, groupspec : String) : Void; + function addHaveObjects(startIndex : Float, endIndex : Float) : Void; + function addMemberHint(peerID : String) : Bool; + function addNeighbor(peerID : String) : Bool; + function addWantObjects(startIndex : Float, endIndex : Float) : Void; + function close() : Void; + function convertPeerIDToGroupAddress(peerID : String) : String; + function denyRequestedObject(requestID : Int) : Void; + private function get_estimatedMemberCount() : Float; + private function get_info() : NetGroupInfo; + private function get_localCoverageFrom() : String; + private function get_localCoverageTo() : String; + private function get_neighborCount() : Float; + private function get_receiveMode() : String; + private function get_replicationStrategy() : String; + function post(message : flash.utils.Object) : String; + function removeHaveObjects(startIndex : Float, endIndex : Float) : Void; + function removeWantObjects(startIndex : Float, endIndex : Float) : Void; + function sendToAllNeighbors(message : flash.utils.Object) : String; + function sendToNearest(message : flash.utils.Object, groupAddress : String) : String; + function sendToNeighbor(message : flash.utils.Object, sendMode : String) : String; + private function set_receiveMode(value : String) : String; + private function set_replicationStrategy(value : String) : String; + function writeRequestedObject(requestID : Int, object : flash.utils.Object) : Void; +} diff --git a/build/linux64_569e52e/std/flash/net/NetGroupInfo.hx b/build/linux64_569e52e/std/flash/net/NetGroupInfo.hx new file mode 100644 index 0000000..e1746fe --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/NetGroupInfo.hx @@ -0,0 +1,22 @@ +package flash.net; + +@:require(flash10_1) extern final class NetGroupInfo { + @:flash.property var objectReplicationReceiveBytesPerSecond(get,never) : Float; + @:flash.property var objectReplicationSendBytesPerSecond(get,never) : Float; + @:flash.property var postingReceiveControlBytesPerSecond(get,never) : Float; + @:flash.property var postingReceiveDataBytesPerSecond(get,never) : Float; + @:flash.property var postingSendControlBytesPerSecond(get,never) : Float; + @:flash.property var postingSendDataBytesPerSecond(get,never) : Float; + @:flash.property var routingReceiveBytesPerSecond(get,never) : Float; + @:flash.property var routingSendBytesPerSecond(get,never) : Float; + function new(postingSendDataBytesPerSecond : Float, postingSendControlBytesPerSecond : Float, postingReceiveDataBytesPerSecond : Float, postingReceiveControlBytesPerSecond : Float, routingSendBytesPerSecond : Float, routingReceiveBytesPerSecond : Float, objectReplicationSendBytesPerSecond : Float, objectReplicationReceiveBytesPerSecond : Float) : Void; + private function get_objectReplicationReceiveBytesPerSecond() : Float; + private function get_objectReplicationSendBytesPerSecond() : Float; + private function get_postingReceiveControlBytesPerSecond() : Float; + private function get_postingReceiveDataBytesPerSecond() : Float; + private function get_postingSendControlBytesPerSecond() : Float; + private function get_postingSendDataBytesPerSecond() : Float; + private function get_routingReceiveBytesPerSecond() : Float; + private function get_routingSendBytesPerSecond() : Float; + function toString() : String; +} diff --git a/build/linux64_569e52e/std/flash/net/NetGroupReceiveMode.hx b/build/linux64_569e52e/std/flash/net/NetGroupReceiveMode.hx new file mode 100644 index 0000000..48d50c9 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/NetGroupReceiveMode.hx @@ -0,0 +1,7 @@ +package flash.net; + +extern class NetGroupReceiveMode { + function new() : Void; + static final EXACT : String; + static final NEAREST : String; +} diff --git a/build/linux64_569e52e/std/flash/net/NetGroupReplicationStrategy.hx b/build/linux64_569e52e/std/flash/net/NetGroupReplicationStrategy.hx new file mode 100644 index 0000000..a6521be --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/NetGroupReplicationStrategy.hx @@ -0,0 +1,7 @@ +package flash.net; + +extern class NetGroupReplicationStrategy { + function new() : Void; + static final LOWEST_FIRST : String; + static final RAREST_FIRST : String; +} diff --git a/build/linux64_569e52e/std/flash/net/NetGroupSendMode.hx b/build/linux64_569e52e/std/flash/net/NetGroupSendMode.hx new file mode 100644 index 0000000..fdd6129 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/NetGroupSendMode.hx @@ -0,0 +1,7 @@ +package flash.net; + +extern class NetGroupSendMode { + function new() : Void; + static final NEXT_DECREASING : String; + static final NEXT_INCREASING : String; +} diff --git a/build/linux64_569e52e/std/flash/net/NetGroupSendResult.hx b/build/linux64_569e52e/std/flash/net/NetGroupSendResult.hx new file mode 100644 index 0000000..901d62e --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/NetGroupSendResult.hx @@ -0,0 +1,8 @@ +package flash.net; + +extern class NetGroupSendResult { + function new() : Void; + static final ERROR : String; + static final NO_ROUTE : String; + static final SENT : String; +} diff --git a/build/linux64_569e52e/std/flash/net/NetMonitor.hx b/build/linux64_569e52e/std/flash/net/NetMonitor.hx new file mode 100644 index 0000000..a338962 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/NetMonitor.hx @@ -0,0 +1,6 @@ +package flash.net; + +@:require(flash11) extern class NetMonitor extends flash.events.EventDispatcher { + function new() : Void; + function listStreams() : flash.Vector; +} diff --git a/build/linux64_569e52e/std/flash/net/NetStream.hx b/build/linux64_569e52e/std/flash/net/NetStream.hx new file mode 100644 index 0000000..792976f --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/NetStream.hx @@ -0,0 +1,128 @@ +package flash.net; + +extern class NetStream extends flash.events.EventDispatcher { + @:flash.property var audioCodec(get,never) : UInt; + @:flash.property @:require(flash10_1) var audioReliable(get,set) : Bool; + @:flash.property @:require(flash10_1) var audioSampleAccess(get,set) : Bool; + @:flash.property @:require(flash10_1) var backBufferLength(get,never) : Float; + @:flash.property @:require(flash10_1) var backBufferTime(get,set) : Float; + @:flash.property var bufferLength(get,never) : Float; + @:flash.property var bufferTime(get,set) : Float; + @:flash.property @:require(flash10_1) var bufferTimeMax(get,set) : Float; + @:flash.property var bytesLoaded(get,never) : UInt; + @:flash.property var bytesTotal(get,never) : UInt; + @:flash.property var checkPolicyFile(get,set) : Bool; + @:flash.property var client(get,set) : Dynamic; + @:flash.property var currentFPS(get,never) : Float; + @:flash.property @:require(flash10_1) var dataReliable(get,set) : Bool; + @:flash.property var decodedFrames(get,never) : UInt; + @:flash.property @:require(flash10) var farID(get,never) : String; + @:flash.property @:require(flash10) var farNonce(get,never) : String; + @:flash.property @:require(flash10_1) var inBufferSeek(get,set) : Bool; + @:flash.property @:require(flash10) var info(get,never) : NetStreamInfo; + @:flash.property var liveDelay(get,never) : Float; + @:flash.property @:require(flash10) var maxPauseBufferTime(get,set) : Float; + @:flash.property @:require(flash10_1) var multicastAvailabilitySendToAll(get,set) : Bool; + @:flash.property @:require(flash10_1) var multicastAvailabilityUpdatePeriod(get,set) : Float; + @:flash.property @:require(flash10_1) var multicastFetchPeriod(get,set) : Float; + @:flash.property @:require(flash10_1) var multicastInfo(get,never) : NetStreamMulticastInfo; + @:flash.property @:require(flash10_1) var multicastPushNeighborLimit(get,set) : Float; + @:flash.property @:require(flash10_1) var multicastRelayMarginDuration(get,set) : Float; + @:flash.property @:require(flash10_1) var multicastWindowDuration(get,set) : Float; + @:flash.property @:require(flash10) var nearNonce(get,never) : String; + @:flash.property var objectEncoding(get,never) : UInt; + @:flash.property @:require(flash10) var peerStreams(get,never) : Array; + @:flash.property var soundTransform(get,set) : flash.media.SoundTransform; + @:flash.property var time(get,never) : Float; + @:flash.property @:require(flash11) var useHardwareDecoder(get,set) : Bool; + @:flash.property @:require(flash11_3) var useJitterBuffer(get,set) : Bool; + @:flash.property var videoCodec(get,never) : UInt; + @:flash.property @:require(flash10_1) var videoReliable(get,set) : Bool; + @:flash.property @:require(flash10_1) var videoSampleAccess(get,set) : Bool; + @:flash.property @:require(flash11) var videoStreamSettings(get,set) : flash.media.VideoStreamSettings; + function new(connection : NetConnection, ?peerID : String) : Void; + @:require(flash10_1) function appendBytes(bytes : flash.utils.ByteArray) : Void; + @:require(flash10_1) function appendBytesAction(netStreamAppendBytesAction : String) : Void; + @:require(flash10_1) function attach(connection : NetConnection) : Void; + function attachAudio(microphone : flash.media.Microphone) : Void; + function attachCamera(theCamera : flash.media.Camera, snapshotMilliseconds : Int = -1) : Void; + function close() : Void; + @:require(flash11_2) function dispose() : Void; + private function get_audioCodec() : UInt; + private function get_audioReliable() : Bool; + private function get_audioSampleAccess() : Bool; + private function get_backBufferLength() : Float; + private function get_backBufferTime() : Float; + private function get_bufferLength() : Float; + private function get_bufferTime() : Float; + private function get_bufferTimeMax() : Float; + private function get_bytesLoaded() : UInt; + private function get_bytesTotal() : UInt; + private function get_checkPolicyFile() : Bool; + private function get_client() : Dynamic; + private function get_currentFPS() : Float; + private function get_dataReliable() : Bool; + private function get_decodedFrames() : UInt; + private function get_farID() : String; + private function get_farNonce() : String; + private function get_inBufferSeek() : Bool; + private function get_info() : NetStreamInfo; + private function get_liveDelay() : Float; + private function get_maxPauseBufferTime() : Float; + private function get_multicastAvailabilitySendToAll() : Bool; + private function get_multicastAvailabilityUpdatePeriod() : Float; + private function get_multicastFetchPeriod() : Float; + private function get_multicastInfo() : NetStreamMulticastInfo; + private function get_multicastPushNeighborLimit() : Float; + private function get_multicastRelayMarginDuration() : Float; + private function get_multicastWindowDuration() : Float; + private function get_nearNonce() : String; + private function get_objectEncoding() : UInt; + private function get_peerStreams() : Array; + private function get_soundTransform() : flash.media.SoundTransform; + private function get_time() : Float; + private function get_useHardwareDecoder() : Bool; + private function get_useJitterBuffer() : Bool; + private function get_videoCodec() : UInt; + private function get_videoReliable() : Bool; + private function get_videoSampleAccess() : Bool; + private function get_videoStreamSettings() : flash.media.VideoStreamSettings; + @:require(flash10) function onPeerConnect(subscriber : NetStream) : Bool; + function pause() : Void; + function play(restArgs : haxe.extern.Rest) : Void; + @:require(flash10) function play2(param : NetStreamPlayOptions) : Void; + function publish(?name : String, ?type : String) : Void; + function receiveAudio(flag : Bool) : Void; + function receiveVideo(flag : Bool) : Void; + function receiveVideoFPS(FPS : Float) : Void; + function resume() : Void; + function seek(offset : Float) : Void; + function send(handlerName : String, restArgs : haxe.extern.Rest) : Void; + private function set_audioReliable(value : Bool) : Bool; + private function set_audioSampleAccess(value : Bool) : Bool; + private function set_backBufferTime(value : Float) : Float; + private function set_bufferTime(value : Float) : Float; + private function set_bufferTimeMax(value : Float) : Float; + private function set_checkPolicyFile(value : Bool) : Bool; + private function set_client(value : Dynamic) : Dynamic; + private function set_dataReliable(value : Bool) : Bool; + private function set_inBufferSeek(value : Bool) : Bool; + private function set_maxPauseBufferTime(value : Float) : Float; + private function set_multicastAvailabilitySendToAll(value : Bool) : Bool; + private function set_multicastAvailabilityUpdatePeriod(value : Float) : Float; + private function set_multicastFetchPeriod(value : Float) : Float; + private function set_multicastPushNeighborLimit(value : Float) : Float; + private function set_multicastRelayMarginDuration(value : Float) : Float; + private function set_multicastWindowDuration(value : Float) : Float; + private function set_soundTransform(value : flash.media.SoundTransform) : flash.media.SoundTransform; + private function set_useHardwareDecoder(value : Bool) : Bool; + private function set_useJitterBuffer(value : Bool) : Bool; + private function set_videoReliable(value : Bool) : Bool; + private function set_videoSampleAccess(value : Bool) : Bool; + private function set_videoStreamSettings(value : flash.media.VideoStreamSettings) : flash.media.VideoStreamSettings; + @:require(flash10_1) function step(frames : Int) : Void; + function togglePause() : Void; + @:require(flash10) static final CONNECT_TO_FMS : String; + @:require(flash10) static final DIRECT_CONNECTIONS : String; + static function resetDRMVouchers() : Void; +} diff --git a/build/linux64_569e52e/std/flash/net/NetStreamAppendBytesAction.hx b/build/linux64_569e52e/std/flash/net/NetStreamAppendBytesAction.hx new file mode 100644 index 0000000..a03f27f --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/NetStreamAppendBytesAction.hx @@ -0,0 +1,8 @@ +package flash.net; + +extern class NetStreamAppendBytesAction { + function new() : Void; + static final END_SEQUENCE : String; + static final RESET_BEGIN : String; + static final RESET_SEEK : String; +} diff --git a/build/linux64_569e52e/std/flash/net/NetStreamInfo.hx b/build/linux64_569e52e/std/flash/net/NetStreamInfo.hx new file mode 100644 index 0000000..7c461e0 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/NetStreamInfo.hx @@ -0,0 +1,56 @@ +package flash.net; + +extern final class NetStreamInfo { + @:flash.property var SRTT(get,never) : Float; + @:flash.property var audioBufferByteLength(get,never) : Float; + @:flash.property var audioBufferLength(get,never) : Float; + @:flash.property var audioByteCount(get,never) : Float; + @:flash.property var audioBytesPerSecond(get,never) : Float; + @:flash.property var audioLossRate(get,never) : Float; + @:flash.property var byteCount(get,never) : Float; + @:flash.property var currentBytesPerSecond(get,never) : Float; + @:flash.property var dataBufferByteLength(get,never) : Float; + @:flash.property var dataBufferLength(get,never) : Float; + @:flash.property var dataByteCount(get,never) : Float; + @:flash.property var dataBytesPerSecond(get,never) : Float; + @:flash.property var droppedFrames(get,never) : Float; + @:flash.property var isLive(get,never) : Bool; + @:flash.property var maxBytesPerSecond(get,never) : Float; + @:flash.property var metaData(get,never) : Dynamic; + @:flash.property var playbackBytesPerSecond(get,never) : Float; + @:flash.property var resourceName(get,never) : String; + @:flash.property var uri(get,never) : String; + @:flash.property var videoBufferByteLength(get,never) : Float; + @:flash.property var videoBufferLength(get,never) : Float; + @:flash.property var videoByteCount(get,never) : Float; + @:flash.property var videoBytesPerSecond(get,never) : Float; + @:flash.property @:require(flash10_1) var videoLossRate(get,never) : Float; + @:flash.property var xmpData(get,never) : Dynamic; + function new(curBPS : Float, byteCount : Float, maxBPS : Float, audioBPS : Float, audioByteCount : Float, videoBPS : Float, videoByteCount : Float, dataBPS : Float, dataByteCount : Float, playbackBPS : Float, droppedFrames : Float, audioBufferByteLength : Float, videoBufferByteLength : Float, dataBufferByteLength : Float, audioBufferLength : Float, videoBufferLength : Float, dataBufferLength : Float, srtt : Float, audioLossRate : Float, videoLossRate : Float, ?metaData : Dynamic, ?xmpData : Dynamic, ?uri : String, ?resourceName : String, isLive : Bool = true) : Void; + private function get_SRTT() : Float; + private function get_audioBufferByteLength() : Float; + private function get_audioBufferLength() : Float; + private function get_audioByteCount() : Float; + private function get_audioBytesPerSecond() : Float; + private function get_audioLossRate() : Float; + private function get_byteCount() : Float; + private function get_currentBytesPerSecond() : Float; + private function get_dataBufferByteLength() : Float; + private function get_dataBufferLength() : Float; + private function get_dataByteCount() : Float; + private function get_dataBytesPerSecond() : Float; + private function get_droppedFrames() : Float; + private function get_isLive() : Bool; + private function get_maxBytesPerSecond() : Float; + private function get_metaData() : Dynamic; + private function get_playbackBytesPerSecond() : Float; + private function get_resourceName() : String; + private function get_uri() : String; + private function get_videoBufferByteLength() : Float; + private function get_videoBufferLength() : Float; + private function get_videoByteCount() : Float; + private function get_videoBytesPerSecond() : Float; + private function get_videoLossRate() : Float; + private function get_xmpData() : Dynamic; + function toString() : String; +} diff --git a/build/linux64_569e52e/std/flash/net/NetStreamMulticastInfo.hx b/build/linux64_569e52e/std/flash/net/NetStreamMulticastInfo.hx new file mode 100644 index 0000000..5a40bb5 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/NetStreamMulticastInfo.hx @@ -0,0 +1,44 @@ +package flash.net; + +@:require(flash10_1) extern final class NetStreamMulticastInfo { + @:flash.property var bytesPushedFromPeers(get,never) : Float; + @:flash.property var bytesPushedToPeers(get,never) : Float; + @:flash.property var bytesReceivedFromIPMulticast(get,never) : Float; + @:flash.property var bytesReceivedFromServer(get,never) : Float; + @:flash.property var bytesRequestedByPeers(get,never) : Float; + @:flash.property var bytesRequestedFromPeers(get,never) : Float; + @:flash.property var fragmentsPushedFromPeers(get,never) : Float; + @:flash.property var fragmentsPushedToPeers(get,never) : Float; + @:flash.property var fragmentsReceivedFromIPMulticast(get,never) : Float; + @:flash.property var fragmentsReceivedFromServer(get,never) : Float; + @:flash.property var fragmentsRequestedByPeers(get,never) : Float; + @:flash.property var fragmentsRequestedFromPeers(get,never) : Float; + @:flash.property var receiveControlBytesPerSecond(get,never) : Float; + @:flash.property var receiveDataBytesPerSecond(get,never) : Float; + @:flash.property var receiveDataBytesPerSecondFromIPMulticast(get,never) : Float; + @:flash.property var receiveDataBytesPerSecondFromServer(get,never) : Float; + @:flash.property var sendControlBytesPerSecond(get,never) : Float; + @:flash.property var sendControlBytesPerSecondToServer(get,never) : Float; + @:flash.property var sendDataBytesPerSecond(get,never) : Float; + function new(sendDataBytesPerSecond : Float, sendControlBytesPerSecond : Float, receiveDataBytesPerSecond : Float, receiveControlBytesPerSecond : Float, bytesPushedToPeers : Float, fragmentsPushedToPeers : Float, bytesRequestedByPeers : Float, fragmentsRequestedByPeers : Float, bytesPushedFromPeers : Float, fragmentsPushedFromPeers : Float, bytesRequestedFromPeers : Float, fragmentsRequestedFromPeers : Float, sendControlBytesPerSecondToServer : Float, receiveDataBytesPerSecondFromServer : Float, bytesReceivedFromServer : Float, fragmentsReceivedFromServer : Float, receiveDataBytesPerSecondFromIPMulticast : Float, bytesReceivedFromIPMulticast : Float, fragmentsReceivedFromIPMulticast : Float) : Void; + private function get_bytesPushedFromPeers() : Float; + private function get_bytesPushedToPeers() : Float; + private function get_bytesReceivedFromIPMulticast() : Float; + private function get_bytesReceivedFromServer() : Float; + private function get_bytesRequestedByPeers() : Float; + private function get_bytesRequestedFromPeers() : Float; + private function get_fragmentsPushedFromPeers() : Float; + private function get_fragmentsPushedToPeers() : Float; + private function get_fragmentsReceivedFromIPMulticast() : Float; + private function get_fragmentsReceivedFromServer() : Float; + private function get_fragmentsRequestedByPeers() : Float; + private function get_fragmentsRequestedFromPeers() : Float; + private function get_receiveControlBytesPerSecond() : Float; + private function get_receiveDataBytesPerSecond() : Float; + private function get_receiveDataBytesPerSecondFromIPMulticast() : Float; + private function get_receiveDataBytesPerSecondFromServer() : Float; + private function get_sendControlBytesPerSecond() : Float; + private function get_sendControlBytesPerSecondToServer() : Float; + private function get_sendDataBytesPerSecond() : Float; + function toString() : String; +} diff --git a/build/linux64_569e52e/std/flash/net/NetStreamPlayOptions.hx b/build/linux64_569e52e/std/flash/net/NetStreamPlayOptions.hx new file mode 100644 index 0000000..6f66ef1 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/NetStreamPlayOptions.hx @@ -0,0 +1,11 @@ +package flash.net; + +extern class NetStreamPlayOptions extends flash.events.EventDispatcher implements Dynamic { + var len : Float; + @:require(flash10_1) var offset : Float; + var oldStreamName : String; + var start : Float; + var streamName : String; + var transition : String; + function new() : Void; +} diff --git a/build/linux64_569e52e/std/flash/net/NetStreamPlayTransitions.hx b/build/linux64_569e52e/std/flash/net/NetStreamPlayTransitions.hx new file mode 100644 index 0000000..68cc762 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/NetStreamPlayTransitions.hx @@ -0,0 +1,9 @@ +package flash.net; + +extern enum NetStreamPlayTransitions { + SWAP; + SWITCH; + STOP; + APPEND; + RESET; +} diff --git a/build/linux64_569e52e/std/flash/net/ObjectEncoding.hx b/build/linux64_569e52e/std/flash/net/ObjectEncoding.hx new file mode 100644 index 0000000..305ddfe --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/ObjectEncoding.hx @@ -0,0 +1,10 @@ +package flash.net; + +extern class ObjectEncoding { + static final AMF0 : UInt; + static final AMF3 : UInt; + static final DEFAULT : UInt; + @:flash.property static var dynamicPropertyWriter(get,set) : IDynamicPropertyWriter; + private static function get_dynamicPropertyWriter() : IDynamicPropertyWriter; + private static function set_dynamicPropertyWriter(value : IDynamicPropertyWriter) : IDynamicPropertyWriter; +} diff --git a/build/linux64_569e52e/std/flash/net/Responder.hx b/build/linux64_569e52e/std/flash/net/Responder.hx new file mode 100644 index 0000000..ee2ee06 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/Responder.hx @@ -0,0 +1,5 @@ +package flash.net; + +extern class Responder { + function new(result : Dynamic, ?status : Dynamic) : Void; +} diff --git a/build/linux64_569e52e/std/flash/net/SecureSocket.hx b/build/linux64_569e52e/std/flash/net/SecureSocket.hx new file mode 100644 index 0000000..a19352f --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/SecureSocket.hx @@ -0,0 +1,12 @@ +package flash.net; + +@:require(flash11) extern class SecureSocket extends Socket { + @:flash.property var serverCertificate(get,never) : flash.security.X509Certificate; + @:flash.property var serverCertificateStatus(get,never) : String; + function new() : Void; + function addBinaryChainBuildingCertificate(certificate : flash.utils.ByteArray, trusted : Bool) : Void; + private function get_serverCertificate() : flash.security.X509Certificate; + private function get_serverCertificateStatus() : String; + @:flash.property static var isSupported(get,never) : Bool; + private static function get_isSupported() : Bool; +} diff --git a/build/linux64_569e52e/std/flash/net/SharedObject.hx b/build/linux64_569e52e/std/flash/net/SharedObject.hx new file mode 100644 index 0000000..cc152a3 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/SharedObject.hx @@ -0,0 +1,34 @@ +package flash.net; + +extern class SharedObject extends flash.events.EventDispatcher { + @:flash.property var client(get,set) : Dynamic; + @:flash.property var data(get,never) : Dynamic; + @:flash.property var fps(never,set) : Float; + @:flash.property var objectEncoding(get,set) : UInt; + @:flash.property var size(get,never) : UInt; + function new() : Void; + function clear() : Void; + function close() : Void; + function connect(myConnection : NetConnection, ?params : String) : Void; + function flush(minDiskSpace : Int = 0) : String; + private function get_client() : Dynamic; + private function get_data() : Dynamic; + private function get_objectEncoding() : UInt; + private function get_size() : UInt; + function send(restArgs : haxe.extern.Rest) : Void; + function setDirty(propertyName : String) : Void; + function setProperty(propertyName : String, ?value : flash.utils.Object) : Void; + private function set_client(value : Dynamic) : Dynamic; + private function set_fps(value : Float) : Float; + private function set_objectEncoding(value : UInt) : UInt; + @:flash.property static var defaultObjectEncoding(get,set) : UInt; + @:flash.property @:require(flash11_7) static var preventBackup(get,set) : Bool; + static function deleteAll(url : String) : Int; + static function getDiskUsage(url : String) : Int; + static function getLocal(name : String, ?localPath : String, secure : Bool = false) : SharedObject; + static function getRemote(name : String, ?remotePath : String, persistence : Dynamic = false, secure : Bool = false) : SharedObject; + private static function get_defaultObjectEncoding() : UInt; + private static function get_preventBackup() : Bool; + private static function set_defaultObjectEncoding(value : UInt) : UInt; + private static function set_preventBackup(value : Bool) : Bool; +} diff --git a/build/linux64_569e52e/std/flash/net/SharedObjectFlushStatus.hx b/build/linux64_569e52e/std/flash/net/SharedObjectFlushStatus.hx new file mode 100644 index 0000000..15e6031 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/SharedObjectFlushStatus.hx @@ -0,0 +1,7 @@ +package flash.net; + +extern class SharedObjectFlushStatus { + function new() : Void; + static final FLUSHED : String; + static final PENDING : String; +} diff --git a/build/linux64_569e52e/std/flash/net/Socket.hx b/build/linux64_569e52e/std/flash/net/Socket.hx new file mode 100644 index 0000000..2c8716b --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/Socket.hx @@ -0,0 +1,49 @@ +package flash.net; + +extern class Socket extends flash.events.EventDispatcher implements flash.utils.IDataOutput implements flash.utils.IDataInput { + @:flash.property var bytesAvailable(get,never) : UInt; + @:flash.property @:require(flash11) var bytesPending(get,never) : UInt; + @:flash.property var connected(get,never) : Bool; + @:flash.property var endian(get,set) : flash.utils.Endian; + @:flash.property var objectEncoding(get,set) : UInt; + @:flash.property @:require(flash10) var timeout(get,set) : UInt; + function new(?host : String, port : Int = 0) : Void; + function close() : Void; + function connect(host : String, port : Int) : Void; + function flush() : Void; + private function get_bytesAvailable() : UInt; + private function get_bytesPending() : UInt; + private function get_connected() : Bool; + private function get_endian() : flash.utils.Endian; + private function get_objectEncoding() : UInt; + private function get_timeout() : UInt; + function readBoolean() : Bool; + function readByte() : Int; + function readBytes(bytes : flash.utils.ByteArray, offset : UInt = 0, length : UInt = 0) : Void; + function readDouble() : Float; + function readFloat() : Float; + function readInt() : Int; + function readMultiByte(length : UInt, charSet : String) : String; + function readObject() : Dynamic; + function readShort() : Int; + function readUTF() : String; + function readUTFBytes(length : UInt) : String; + function readUnsignedByte() : UInt; + function readUnsignedInt() : UInt; + function readUnsignedShort() : UInt; + private function set_endian(value : flash.utils.Endian) : flash.utils.Endian; + private function set_objectEncoding(value : UInt) : UInt; + private function set_timeout(value : UInt) : UInt; + function writeBoolean(value : Bool) : Void; + function writeByte(value : Int) : Void; + function writeBytes(bytes : flash.utils.ByteArray, offset : UInt = 0, length : UInt = 0) : Void; + function writeDouble(value : Float) : Void; + function writeFloat(value : Float) : Void; + function writeInt(value : Int) : Void; + function writeMultiByte(value : String, charSet : String) : Void; + function writeObject(object : Dynamic) : Void; + function writeShort(value : Int) : Void; + function writeUTF(value : String) : Void; + function writeUTFBytes(value : String) : Void; + function writeUnsignedInt(value : UInt) : Void; +} diff --git a/build/linux64_569e52e/std/flash/net/URLLoader.hx b/build/linux64_569e52e/std/flash/net/URLLoader.hx new file mode 100644 index 0000000..2e9c8e5 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/URLLoader.hx @@ -0,0 +1,11 @@ +package flash.net; + +extern class URLLoader extends flash.events.EventDispatcher { + var bytesLoaded : UInt; + var bytesTotal : UInt; + var data : Dynamic; + var dataFormat : URLLoaderDataFormat; + function new(?request : URLRequest) : Void; + function close() : Void; + function load(request : URLRequest) : Void; +} diff --git a/build/linux64_569e52e/std/flash/net/URLLoaderDataFormat.hx b/build/linux64_569e52e/std/flash/net/URLLoaderDataFormat.hx new file mode 100644 index 0000000..19bf1b9 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/URLLoaderDataFormat.hx @@ -0,0 +1,7 @@ +package flash.net; + +@:native("flash.net.URLLoaderDataFormat") extern enum abstract URLLoaderDataFormat(String) { + var BINARY; + var TEXT; + var VARIABLES; +} diff --git a/build/linux64_569e52e/std/flash/net/URLRequest.hx b/build/linux64_569e52e/std/flash/net/URLRequest.hx new file mode 100644 index 0000000..213fd1f --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/URLRequest.hx @@ -0,0 +1,24 @@ +package flash.net; + +extern final class URLRequest { + @:flash.property var contentType(get,set) : String; + @:flash.property var data(get,set) : Dynamic; + @:flash.property var digest(get,set) : String; + @:flash.property var method(get,set) : String; + @:flash.property var requestHeaders(get,set) : Array; + @:flash.property var url(get,set) : String; + function new(?url : String) : Void; + private function get_contentType() : String; + private function get_data() : Dynamic; + private function get_digest() : String; + private function get_method() : String; + private function get_requestHeaders() : Array; + private function get_url() : String; + private function set_contentType(value : String) : String; + private function set_data(value : Dynamic) : Dynamic; + private function set_digest(value : String) : String; + private function set_method(value : String) : String; + private function set_requestHeaders(value : Array) : Array; + private function set_url(value : String) : String; + function useRedirectedURL(sourceRequest : URLRequest, wholeURL : Bool = false, ?pattern : Dynamic, ?replace : String) : Void; +} diff --git a/build/linux64_569e52e/std/flash/net/URLRequestHeader.hx b/build/linux64_569e52e/std/flash/net/URLRequestHeader.hx new file mode 100644 index 0000000..e8c4e46 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/URLRequestHeader.hx @@ -0,0 +1,7 @@ +package flash.net; + +extern final class URLRequestHeader { + var name : String; + var value : String; + function new(?name : String, ?value : String) : Void; +} diff --git a/build/linux64_569e52e/std/flash/net/URLRequestMethod.hx b/build/linux64_569e52e/std/flash/net/URLRequestMethod.hx new file mode 100644 index 0000000..62a8413 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/URLRequestMethod.hx @@ -0,0 +1,10 @@ +package flash.net; + +extern class URLRequestMethod { + @:require(flash10_1) static final DELETE : String; + static final GET : String; + @:require(flash10_1) static final HEAD : String; + @:require(flash10_1) static final OPTIONS : String; + static final POST : String; + @:require(flash10_1) static final PUT : String; +} diff --git a/build/linux64_569e52e/std/flash/net/URLStream.hx b/build/linux64_569e52e/std/flash/net/URLStream.hx new file mode 100644 index 0000000..d33139f --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/URLStream.hx @@ -0,0 +1,39 @@ +package flash.net; + +extern class URLStream extends flash.events.EventDispatcher implements flash.utils.IDataInput { + @:flash.property var bytesAvailable(get,never) : UInt; + @:flash.property var connected(get,never) : Bool; + @:flash.property @:require(flash11_4) var diskCacheEnabled(get,never) : Bool; + @:flash.property var endian(get,set) : flash.utils.Endian; + @:flash.property @:require(flash11_4) var length(get,never) : Float; + @:flash.property var objectEncoding(get,set) : UInt; + @:flash.property @:require(flash11_4) var position(get,set) : Float; + function new() : Void; + function close() : Void; + private function get_bytesAvailable() : UInt; + private function get_connected() : Bool; + private function get_diskCacheEnabled() : Bool; + private function get_endian() : flash.utils.Endian; + private function get_length() : Float; + private function get_objectEncoding() : UInt; + private function get_position() : Float; + function load(request : URLRequest) : Void; + function readBoolean() : Bool; + function readByte() : Int; + function readBytes(bytes : flash.utils.ByteArray, offset : UInt = 0, length : UInt = 0) : Void; + function readDouble() : Float; + function readFloat() : Float; + function readInt() : Int; + function readMultiByte(length : UInt, charSet : String) : String; + function readObject() : Dynamic; + function readShort() : Int; + function readUTF() : String; + function readUTFBytes(length : UInt) : String; + function readUnsignedByte() : UInt; + function readUnsignedInt() : UInt; + function readUnsignedShort() : UInt; + private function set_endian(value : flash.utils.Endian) : flash.utils.Endian; + private function set_objectEncoding(value : UInt) : UInt; + private function set_position(value : Float) : Float; + @:require(flash11_4) function stop() : Void; +} diff --git a/build/linux64_569e52e/std/flash/net/URLVariables.hx b/build/linux64_569e52e/std/flash/net/URLVariables.hx new file mode 100644 index 0000000..0d98161 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/URLVariables.hx @@ -0,0 +1,7 @@ +package flash.net; + +extern class URLVariables implements Dynamic { + function new(?source : String) : Void; + function decode(source : String) : Void; + function toString() : String; +} diff --git a/build/linux64_569e52e/std/flash/net/XMLSocket.hx b/build/linux64_569e52e/std/flash/net/XMLSocket.hx new file mode 100644 index 0000000..777e99e --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/XMLSocket.hx @@ -0,0 +1,13 @@ +package flash.net; + +extern class XMLSocket extends flash.events.EventDispatcher { + @:flash.property var connected(get,never) : Bool; + @:flash.property @:require(flash10) var timeout(get,set) : Int; + function new(?host : String, port : Int = 0) : Void; + function close() : Void; + function connect(host : String, port : Int) : Void; + private function get_connected() : Bool; + private function get_timeout() : Int; + function send(object : Dynamic) : Void; + private function set_timeout(value : Int) : Int; +} diff --git a/build/linux64_569e52e/std/flash/net/drm/AddToDeviceGroupSetting.hx b/build/linux64_569e52e/std/flash/net/drm/AddToDeviceGroupSetting.hx new file mode 100644 index 0000000..bed0442 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/drm/AddToDeviceGroupSetting.hx @@ -0,0 +1,8 @@ +package flash.net.drm; + +extern class AddToDeviceGroupSetting { + function new() : Void; + static final ALLOW_SERVER : String; + static final FORCE_REFRESH : String; + static final LOCAL_ONLY : String; +} diff --git a/build/linux64_569e52e/std/flash/net/drm/AuthenticationMethod.hx b/build/linux64_569e52e/std/flash/net/drm/AuthenticationMethod.hx new file mode 100644 index 0000000..6b9e13a --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/drm/AuthenticationMethod.hx @@ -0,0 +1,7 @@ +package flash.net.drm; + +extern class AuthenticationMethod { + function new() : Void; + static final ANONYMOUS : String; + static final USERNAME_AND_PASSWORD : String; +} diff --git a/build/linux64_569e52e/std/flash/net/drm/DRMAddToDeviceGroupContext.hx b/build/linux64_569e52e/std/flash/net/drm/DRMAddToDeviceGroupContext.hx new file mode 100644 index 0000000..1ae4817 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/drm/DRMAddToDeviceGroupContext.hx @@ -0,0 +1,6 @@ +package flash.net.drm; + +extern class DRMAddToDeviceGroupContext extends DRMManagerSession { + function new() : Void; + function addToDeviceGroup(deviceGroup : DRMDeviceGroup, forceRefresh : Bool) : Void; +} diff --git a/build/linux64_569e52e/std/flash/net/drm/DRMAuthenticationContext.hx b/build/linux64_569e52e/std/flash/net/drm/DRMAuthenticationContext.hx new file mode 100644 index 0000000..dbe94a3 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/drm/DRMAuthenticationContext.hx @@ -0,0 +1,8 @@ +package flash.net.drm; + +extern class DRMAuthenticationContext extends DRMManagerSession { + @:flash.property var authenticationToken(get,never) : flash.utils.ByteArray; + function new() : Void; + function authenticate(url : String, domain : String, username : String, password : String) : Void; + private function get_authenticationToken() : flash.utils.ByteArray; +} diff --git a/build/linux64_569e52e/std/flash/net/drm/DRMContentData.hx b/build/linux64_569e52e/std/flash/net/drm/DRMContentData.hx new file mode 100644 index 0000000..f128694 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/drm/DRMContentData.hx @@ -0,0 +1,14 @@ +package flash.net.drm; + +extern class DRMContentData { + @:flash.property var authenticationMethod(get,never) : String; + @:flash.property var domain(get,never) : String; + @:flash.property var licenseID(get,never) : String; + @:flash.property var serverURL(get,never) : String; + function new(?rawData : flash.utils.ByteArray) : Void; + function getVoucherAccessInfo() : flash.Vector; + private function get_authenticationMethod() : String; + private function get_domain() : String; + private function get_licenseID() : String; + private function get_serverURL() : String; +} diff --git a/build/linux64_569e52e/std/flash/net/drm/DRMDeviceGroup.hx b/build/linux64_569e52e/std/flash/net/drm/DRMDeviceGroup.hx new file mode 100644 index 0000000..bd2ad81 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/drm/DRMDeviceGroup.hx @@ -0,0 +1,14 @@ +package flash.net.drm; + +extern final class DRMDeviceGroup { + @:flash.property var authenticationMethod(get,never) : String; + @:flash.property var domain(get,never) : String; + @:flash.property var name(get,set) : String; + @:flash.property var serverURL(get,never) : String; + function new() : Void; + private function get_authenticationMethod() : String; + private function get_domain() : String; + private function get_name() : String; + private function get_serverURL() : String; + private function set_name(value : String) : String; +} diff --git a/build/linux64_569e52e/std/flash/net/drm/DRMManager.hx b/build/linux64_569e52e/std/flash/net/drm/DRMManager.hx new file mode 100644 index 0000000..4c2a4f0 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/drm/DRMManager.hx @@ -0,0 +1,22 @@ +package flash.net.drm; + +extern class DRMManager extends flash.events.EventDispatcher { + function new() : Void; + function addToDeviceGroup(deviceGroup : DRMDeviceGroup, forceRefresh : Bool = false) : Void; + function authenticate(serverURL : String, domain : String, username : String, password : String) : Void; + function loadPreviewVoucher(contentData : DRMContentData) : Void; + function loadVoucher(contentData : DRMContentData, setting : String) : Void; + function removeFromDeviceGroup(deviceGroup : DRMDeviceGroup) : Void; + function resetDRMVouchers() : Void; + @:ns("flash.net.drm",internal) function resetDRMVouchersInternal(isAutoReset : Bool) : Void; + function returnVoucher(inServerURL : String, immediateCommit : Bool, licenseID : String, policyID : String) : Void; + function setAuthenticationToken(serverUrl : String, domain : String, token : flash.utils.ByteArray) : Void; + function storeVoucher(voucher : flash.utils.ByteArray) : Void; + @:flash.property static var isSupported(get,never) : Bool; + @:flash.property static var networkIdleTimeout(get,set) : Float; + static function getDRMManager() : DRMManager; + @:ns("flash.net.drm",internal) static function getDRMManagerInternal() : DRMManager; + private static function get_isSupported() : Bool; + private static function get_networkIdleTimeout() : Float; + private static function set_networkIdleTimeout(value : Float) : Float; +} diff --git a/build/linux64_569e52e/std/flash/net/drm/DRMManagerSession.hx b/build/linux64_569e52e/std/flash/net/drm/DRMManagerSession.hx new file mode 100644 index 0000000..3ffb9ed --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/drm/DRMManagerSession.hx @@ -0,0 +1,23 @@ +package flash.net.drm; + +extern class DRMManagerSession extends flash.events.EventDispatcher { + var m_isInSession : Bool; + @:flash.property var metadata(get,set) : DRMContentData; + function new() : Void; + function checkStatus() : UInt; + function errorCodeToThrow(errorCode : UInt) : Void; + function getLastError() : UInt; + function getLastServerErrorString() : String; + function getLastSubErrorID() : UInt; + private function get_metadata() : DRMContentData; + function issueDRMErrorEvent(metadata : DRMContentData, errorID : Int, subErrorID : Int, serverErrorString : String) : Void; + function issueDRMStatusEvent(inMetadata : DRMContentData, voucher : DRMVoucher) : Dynamic; + function onSessionComplete() : Void; + function onSessionError() : Void; + function setTimerUp() : Void; + private function set_metadata(value : DRMContentData) : DRMContentData; + @:ns("flash.net.drm",internal) static final STATUS_FAILED : UInt; + @:ns("flash.net.drm",internal) static final STATUS_NOTREADY : UInt; + @:ns("flash.net.drm",internal) static final STATUS_READY : UInt; + @:ns("flash.net.drm",internal) static final STATUS_UNKNOWN : UInt; +} diff --git a/build/linux64_569e52e/std/flash/net/drm/DRMModuleCycleProvider.hx b/build/linux64_569e52e/std/flash/net/drm/DRMModuleCycleProvider.hx new file mode 100644 index 0000000..d15edb8 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/drm/DRMModuleCycleProvider.hx @@ -0,0 +1,5 @@ +package flash.net.drm; + +extern class DRMModuleCycleProvider { + function new() : Void; +} diff --git a/build/linux64_569e52e/std/flash/net/drm/DRMPlaybackTimeWindow.hx b/build/linux64_569e52e/std/flash/net/drm/DRMPlaybackTimeWindow.hx new file mode 100644 index 0000000..f4252d3 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/drm/DRMPlaybackTimeWindow.hx @@ -0,0 +1,11 @@ +package flash.net.drm; + +extern class DRMPlaybackTimeWindow { + @:flash.property var endDate(get,never) : Date; + @:flash.property var period(get,never) : UInt; + @:flash.property var startDate(get,never) : Date; + function new() : Void; + private function get_endDate() : Date; + private function get_period() : UInt; + private function get_startDate() : Date; +} diff --git a/build/linux64_569e52e/std/flash/net/drm/DRMRemoveFromDeviceGroupContext.hx b/build/linux64_569e52e/std/flash/net/drm/DRMRemoveFromDeviceGroupContext.hx new file mode 100644 index 0000000..251558f --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/drm/DRMRemoveFromDeviceGroupContext.hx @@ -0,0 +1,6 @@ +package flash.net.drm; + +extern class DRMRemoveFromDeviceGroupContext extends DRMManagerSession { + function new() : Void; + function removeFromDeviceGroup(deviceGroup : DRMDeviceGroup) : Void; +} diff --git a/build/linux64_569e52e/std/flash/net/drm/DRMResetContext.hx b/build/linux64_569e52e/std/flash/net/drm/DRMResetContext.hx new file mode 100644 index 0000000..b5c647f --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/drm/DRMResetContext.hx @@ -0,0 +1,7 @@ +package flash.net.drm; + +extern class DRMResetContext extends DRMManagerSession { + var m_isAutoReset : Bool; + function new(isAutoReset : Bool) : Void; + function doReset() : Void; +} diff --git a/build/linux64_569e52e/std/flash/net/drm/DRMReturnVoucherContext.hx b/build/linux64_569e52e/std/flash/net/drm/DRMReturnVoucherContext.hx new file mode 100644 index 0000000..45fec93 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/drm/DRMReturnVoucherContext.hx @@ -0,0 +1,6 @@ +package flash.net.drm; + +extern class DRMReturnVoucherContext extends DRMManagerSession { + function new() : Void; + function returnVoucher(inServerURL : String, immediateCommit : Bool, licenseID : String, policyID : String) : Void; +} diff --git a/build/linux64_569e52e/std/flash/net/drm/DRMStoreVoucherContext.hx b/build/linux64_569e52e/std/flash/net/drm/DRMStoreVoucherContext.hx new file mode 100644 index 0000000..5a18224 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/drm/DRMStoreVoucherContext.hx @@ -0,0 +1,6 @@ +package flash.net.drm; + +extern class DRMStoreVoucherContext extends DRMManagerSession { + function new(voucher : flash.utils.ByteArray) : Void; + function doStoreVoucher() : Void; +} diff --git a/build/linux64_569e52e/std/flash/net/drm/DRMURLDownloadContext.hx b/build/linux64_569e52e/std/flash/net/drm/DRMURLDownloadContext.hx new file mode 100644 index 0000000..9cf8636 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/drm/DRMURLDownloadContext.hx @@ -0,0 +1,7 @@ +package flash.net.drm; + +extern class DRMURLDownloadContext extends flash.events.EventDispatcher { + function new() : Void; + function httpGetASync(url : String) : Void; + function httpPostAndReceiveASync(url : String, headerName : String, headerValue : String, data : flash.utils.ByteArray, serverType : UInt) : Void; +} diff --git a/build/linux64_569e52e/std/flash/net/drm/DRMVoucher.hx b/build/linux64_569e52e/std/flash/net/drm/DRMVoucher.hx new file mode 100644 index 0000000..fc694a2 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/drm/DRMVoucher.hx @@ -0,0 +1,24 @@ +package flash.net.drm; + +extern class DRMVoucher { + @:flash.property var licenseID(get,never) : String; + @:flash.property var offlineLeaseEndDate(get,never) : Date; + @:flash.property var offlineLeaseStartDate(get,never) : Date; + @:flash.property var playbackTimeWindow(get,never) : DRMPlaybackTimeWindow; + @:flash.property var policies(get,never) : Dynamic; + @:flash.property var policyID(get,never) : String; + @:flash.property var serverURL(get,never) : String; + @:flash.property var voucherEndDate(get,never) : Date; + @:flash.property var voucherStartDate(get,never) : Date; + function new() : Void; + private function get_licenseID() : String; + private function get_offlineLeaseEndDate() : Date; + private function get_offlineLeaseStartDate() : Date; + private function get_playbackTimeWindow() : DRMPlaybackTimeWindow; + private function get_policies() : Dynamic; + private function get_policyID() : String; + private function get_serverURL() : String; + private function get_voucherEndDate() : Date; + private function get_voucherStartDate() : Date; + function toByteArray() : flash.utils.ByteArray; +} diff --git a/build/linux64_569e52e/std/flash/net/drm/DRMVoucherDownloadContext.hx b/build/linux64_569e52e/std/flash/net/drm/DRMVoucherDownloadContext.hx new file mode 100644 index 0000000..62b34c0 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/drm/DRMVoucherDownloadContext.hx @@ -0,0 +1,8 @@ +package flash.net.drm; + +extern class DRMVoucherDownloadContext extends DRMManagerSession { + @:flash.property var voucher(get,never) : DRMVoucher; + function new() : Void; + function download(inMetadata : DRMContentData, previewVoucher : Bool = false) : Void; + private function get_voucher() : DRMVoucher; +} diff --git a/build/linux64_569e52e/std/flash/net/drm/DRMVoucherStoreContext.hx b/build/linux64_569e52e/std/flash/net/drm/DRMVoucherStoreContext.hx new file mode 100644 index 0000000..bbc7b0a --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/drm/DRMVoucherStoreContext.hx @@ -0,0 +1,8 @@ +package flash.net.drm; + +extern class DRMVoucherStoreContext extends DRMManagerSession { + @:flash.property var voucher(get,never) : DRMVoucher; + function new() : Void; + function getVoucherFromStore(inMetadata : DRMContentData) : Void; + private function get_voucher() : DRMVoucher; +} diff --git a/build/linux64_569e52e/std/flash/net/drm/LoadVoucherSetting.hx b/build/linux64_569e52e/std/flash/net/drm/LoadVoucherSetting.hx new file mode 100644 index 0000000..7fb9162 --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/drm/LoadVoucherSetting.hx @@ -0,0 +1,8 @@ +package flash.net.drm; + +extern class LoadVoucherSetting { + function new() : Void; + static final ALLOW_SERVER : String; + static final FORCE_REFRESH : String; + static final LOCAL_ONLY : String; +} diff --git a/build/linux64_569e52e/std/flash/net/drm/VoucherAccessInfo.hx b/build/linux64_569e52e/std/flash/net/drm/VoucherAccessInfo.hx new file mode 100644 index 0000000..ce0c64c --- /dev/null +++ b/build/linux64_569e52e/std/flash/net/drm/VoucherAccessInfo.hx @@ -0,0 +1,15 @@ +package flash.net.drm; + +extern final class VoucherAccessInfo { + @:flash.property var authenticationMethod(get,never) : String; + @:flash.property var deviceGroup(get,never) : DRMDeviceGroup; + @:flash.property var displayName(get,never) : String; + @:flash.property var domain(get,never) : String; + @:flash.property var policyID(get,never) : String; + function new() : Void; + private function get_authenticationMethod() : String; + private function get_deviceGroup() : DRMDeviceGroup; + private function get_displayName() : String; + private function get_domain() : String; + private function get_policyID() : String; +} diff --git a/build/linux64_569e52e/std/flash/printing/PrintJob.hx b/build/linux64_569e52e/std/flash/printing/PrintJob.hx new file mode 100644 index 0000000..1f870be --- /dev/null +++ b/build/linux64_569e52e/std/flash/printing/PrintJob.hx @@ -0,0 +1,20 @@ +package flash.printing; + +extern class PrintJob extends flash.events.EventDispatcher { + @:flash.property var orientation(get,never) : PrintJobOrientation; + @:flash.property var pageHeight(get,never) : Int; + @:flash.property var pageWidth(get,never) : Int; + @:flash.property var paperHeight(get,never) : Int; + @:flash.property var paperWidth(get,never) : Int; + function new() : Void; + function addPage(sprite : flash.display.Sprite, ?printArea : flash.geom.Rectangle, ?options : PrintJobOptions, frameNum : Int = 0) : Void; + private function get_orientation() : PrintJobOrientation; + private function get_pageHeight() : Int; + private function get_pageWidth() : Int; + private function get_paperHeight() : Int; + private function get_paperWidth() : Int; + function send() : Void; + function start() : Bool; + @:flash.property @:require(flash10_1) static var isSupported(get,never) : Bool; + private static function get_isSupported() : Bool; +} diff --git a/build/linux64_569e52e/std/flash/printing/PrintJobOptions.hx b/build/linux64_569e52e/std/flash/printing/PrintJobOptions.hx new file mode 100644 index 0000000..58c3799 --- /dev/null +++ b/build/linux64_569e52e/std/flash/printing/PrintJobOptions.hx @@ -0,0 +1,6 @@ +package flash.printing; + +extern class PrintJobOptions { + var printAsBitmap : Bool; + function new(printAsBitmap : Bool = false) : Void; +} diff --git a/build/linux64_569e52e/std/flash/printing/PrintJobOrientation.hx b/build/linux64_569e52e/std/flash/printing/PrintJobOrientation.hx new file mode 100644 index 0000000..82f1d04 --- /dev/null +++ b/build/linux64_569e52e/std/flash/printing/PrintJobOrientation.hx @@ -0,0 +1,6 @@ +package flash.printing; + +@:native("flash.printing.PrintJobOrientation") extern enum abstract PrintJobOrientation(String) { + var LANDSCAPE; + var PORTRAIT; +} diff --git a/build/linux64_569e52e/std/flash/profiler/Telemetry.hx b/build/linux64_569e52e/std/flash/profiler/Telemetry.hx new file mode 100644 index 0000000..377ebfe --- /dev/null +++ b/build/linux64_569e52e/std/flash/profiler/Telemetry.hx @@ -0,0 +1,13 @@ +package flash.profiler; + +extern class Telemetry { + function new() : Void; + @:flash.property static var connected(get,never) : Bool; + @:flash.property static var spanMarker(get,never) : Float; + private static function get_connected() : Bool; + private static function get_spanMarker() : Float; + static function registerCommandHandler(commandName : String, handler : Dynamic) : Bool; + static function sendMetric(metric : String, value : Dynamic) : Void; + static function sendSpanMetric(metric : String, startSpanMarker : Float, ?value : Dynamic) : Void; + static function unregisterCommandHandler(commandName : String) : Bool; +} diff --git a/build/linux64_569e52e/std/flash/sampler/Api.hx b/build/linux64_569e52e/std/flash/sampler/Api.hx new file mode 100644 index 0000000..7cabe40 --- /dev/null +++ b/build/linux64_569e52e/std/flash/sampler/Api.hx @@ -0,0 +1,73 @@ +package flash.sampler; + +extern class Api { + + public inline static function clearSamples() : Void { + untyped __global__["flash.sampler.clearSamples"](); + } + + public inline static function getGetterInvocationCount( obj : Dynamic, qname : flash.utils.QName ) : Float { + return untyped __global__["flash.sampler.getGetterInvocationCount"](obj,qname); + } + + public inline static function getSetterInvocationCount( obj : Dynamic, qname : flash.utils.QName ) : Float { + return untyped __global__["flash.sampler.getSetterInvocationCount"](obj,qname); + } + + public inline static function getInvocationCount( obj : Dynamic, qname : flash.utils.QName ) : Float { + return untyped __global__["flash.sampler.getInvocationCount"](obj,qname); + } + + public inline static function getMemberNames( obj : Dynamic, instanceNames : Bool = false ) : Dynamic { + return untyped __global__["flash.sampler.getMemberNames"](obj,instanceNames); + } + + public inline static function getSampleCount() : Float { + return untyped __global__["flash.sampler.getSampleCount"](); + } + + public inline static function getSamples() : Array { + return untyped __foreach__(__global__["flash.sampler.getSamples"]()); + } + + public inline static function getSize( obj : Dynamic ) : Float { + return untyped __global__["flash.sampler.getSize"](obj); + } + + public inline static function isGetterSetter( obj : Dynamic, qname : flash.utils.QName ) : Bool { + return untyped __global__["flash.sampler.isGetterSetter"](obj,qname); + } + + public inline static function pauseSampling() : Void { + untyped __global__["flash.sampler.pauseSampling"](); + } + + public inline static function startSampling() : Void { + untyped __global__["flash.sampler.startSampling"](); + } + + public inline static function stopSampling() : Void { + untyped __global__["flash.sampler.stopSampling"](); + } + + public inline static function getLexicalScopes( fun : Dynamic ) : Array { + return untyped __global__["flash.sampler.getLexicalScopes"](fun); + } + + public inline static function getMasterString( s : String ) : String { + return untyped __global__["flash.sampler.getMasterString"](s); + } + + public inline static function getSavedThis( fun : Dynamic ) : Dynamic { + return untyped __global__["flash.sampler.getSavedThis"](fun); + } + + public inline static function sampleInternalAllocs( b : Bool ) : Void { + untyped __global__["flash.sampler.sampleInternalAllocs"](b); + } + + public inline static function setSamplerCallback( callb : Dynamic ) : Void { + untyped __global__["flash.sampler.setSamplerCallback"](callb); + } + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/flash/sampler/ClassFactory.hx b/build/linux64_569e52e/std/flash/sampler/ClassFactory.hx new file mode 100644 index 0000000..ba016eb --- /dev/null +++ b/build/linux64_569e52e/std/flash/sampler/ClassFactory.hx @@ -0,0 +1,9 @@ +package flash.sampler; + +extern class ClassFactory { + function new() : Void; + static final DeleteObjectSampleClass : Class; + static final NewObjectSampleClass : Class; + static final SampleClass : Class; + static final StackFrameClass : Class; +} diff --git a/build/linux64_569e52e/std/flash/sampler/DeleteObjectSample.hx b/build/linux64_569e52e/std/flash/sampler/DeleteObjectSample.hx new file mode 100644 index 0000000..1766d47 --- /dev/null +++ b/build/linux64_569e52e/std/flash/sampler/DeleteObjectSample.hx @@ -0,0 +1,6 @@ +package flash.sampler; + +extern final class DeleteObjectSample extends Sample { + final id : Float; + final size : Float; +} diff --git a/build/linux64_569e52e/std/flash/sampler/NewObjectSample.hx b/build/linux64_569e52e/std/flash/sampler/NewObjectSample.hx new file mode 100644 index 0000000..22c3e8f --- /dev/null +++ b/build/linux64_569e52e/std/flash/sampler/NewObjectSample.hx @@ -0,0 +1,10 @@ +package flash.sampler; + +extern final class NewObjectSample extends Sample { + final id : Float; + @:flash.property var object(get,never) : Dynamic; + @:flash.property @:require(flash10_1) var size(get,never) : Float; + final type : Class; + private function get_object() : Dynamic; + private function get_size() : Float; +} diff --git a/build/linux64_569e52e/std/flash/sampler/Sample.hx b/build/linux64_569e52e/std/flash/sampler/Sample.hx new file mode 100644 index 0000000..f6d80cb --- /dev/null +++ b/build/linux64_569e52e/std/flash/sampler/Sample.hx @@ -0,0 +1,6 @@ +package flash.sampler; + +extern class Sample { + final stack : Array; + final time : Float; +} diff --git a/build/linux64_569e52e/std/flash/sampler/StackFrame.hx b/build/linux64_569e52e/std/flash/sampler/StackFrame.hx new file mode 100644 index 0000000..2e4fa85 --- /dev/null +++ b/build/linux64_569e52e/std/flash/sampler/StackFrame.hx @@ -0,0 +1,9 @@ +package flash.sampler; + +extern final class StackFrame { + final file : String; + final line : UInt; + final name : String; + @:require(flash10_1) final scriptID : Float; + function toString() : String; +} diff --git a/build/linux64_569e52e/std/flash/security/CertificateStatus.hx b/build/linux64_569e52e/std/flash/security/CertificateStatus.hx new file mode 100644 index 0000000..886f07e --- /dev/null +++ b/build/linux64_569e52e/std/flash/security/CertificateStatus.hx @@ -0,0 +1,14 @@ +package flash.security; + +extern class CertificateStatus { + function new() : Void; + static final EXPIRED : String; + static final INVALID : String; + static final INVALID_CHAIN : String; + static final NOT_YET_VALID : String; + static final PRINCIPAL_MISMATCH : String; + static final REVOKED : String; + static final TRUSTED : String; + static final UNKNOWN : String; + static final UNTRUSTED_SIGNERS : String; +} diff --git a/build/linux64_569e52e/std/flash/security/X500DistinguishedName.hx b/build/linux64_569e52e/std/flash/security/X500DistinguishedName.hx new file mode 100644 index 0000000..b69ae56 --- /dev/null +++ b/build/linux64_569e52e/std/flash/security/X500DistinguishedName.hx @@ -0,0 +1,18 @@ +package flash.security; + +extern class X500DistinguishedName { + @:flash.property var commonName(get,never) : String; + @:flash.property var countryName(get,never) : String; + @:flash.property var localityName(get,never) : String; + @:flash.property var organizationName(get,never) : String; + @:flash.property var organizationalUnitName(get,never) : String; + @:flash.property var stateOrProvinceName(get,never) : String; + function new() : Void; + private function get_commonName() : String; + private function get_countryName() : String; + private function get_localityName() : String; + private function get_organizationName() : String; + private function get_organizationalUnitName() : String; + private function get_stateOrProvinceName() : String; + function toString() : String; +} diff --git a/build/linux64_569e52e/std/flash/security/X509Certificate.hx b/build/linux64_569e52e/std/flash/security/X509Certificate.hx new file mode 100644 index 0000000..b1e7d10 --- /dev/null +++ b/build/linux64_569e52e/std/flash/security/X509Certificate.hx @@ -0,0 +1,31 @@ +package flash.security; + +extern class X509Certificate { + @:flash.property var encoded(get,never) : flash.utils.ByteArray; + @:flash.property var issuer(get,never) : X500DistinguishedName; + @:flash.property var issuerUniqueID(get,never) : String; + @:flash.property var serialNumber(get,never) : String; + @:flash.property var signatureAlgorithmOID(get,never) : String; + @:flash.property var signatureAlgorithmParams(get,never) : flash.utils.ByteArray; + @:flash.property var subject(get,never) : X500DistinguishedName; + @:flash.property var subjectPublicKey(get,never) : String; + @:flash.property var subjectPublicKeyAlgorithmOID(get,never) : String; + @:flash.property var subjectUniqueID(get,never) : String; + @:flash.property var validNotAfter(get,never) : Date; + @:flash.property var validNotBefore(get,never) : Date; + @:flash.property var version(get,never) : UInt; + function new() : Void; + private function get_encoded() : flash.utils.ByteArray; + private function get_issuer() : X500DistinguishedName; + private function get_issuerUniqueID() : String; + private function get_serialNumber() : String; + private function get_signatureAlgorithmOID() : String; + private function get_signatureAlgorithmParams() : flash.utils.ByteArray; + private function get_subject() : X500DistinguishedName; + private function get_subjectPublicKey() : String; + private function get_subjectPublicKeyAlgorithmOID() : String; + private function get_subjectUniqueID() : String; + private function get_validNotAfter() : Date; + private function get_validNotBefore() : Date; + private function get_version() : UInt; +} diff --git a/build/linux64_569e52e/std/flash/sensors/Accelerometer.hx b/build/linux64_569e52e/std/flash/sensors/Accelerometer.hx new file mode 100644 index 0000000..ad34121 --- /dev/null +++ b/build/linux64_569e52e/std/flash/sensors/Accelerometer.hx @@ -0,0 +1,10 @@ +package flash.sensors; + +@:require(flash10_1) extern class Accelerometer extends flash.events.EventDispatcher { + @:flash.property var muted(get,never) : Bool; + function new() : Void; + private function get_muted() : Bool; + function setRequestedUpdateInterval(interval : Float) : Void; + @:flash.property static var isSupported(get,never) : Bool; + private static function get_isSupported() : Bool; +} diff --git a/build/linux64_569e52e/std/flash/sensors/Geolocation.hx b/build/linux64_569e52e/std/flash/sensors/Geolocation.hx new file mode 100644 index 0000000..d87fc25 --- /dev/null +++ b/build/linux64_569e52e/std/flash/sensors/Geolocation.hx @@ -0,0 +1,10 @@ +package flash.sensors; + +@:require(flash10_1) extern class Geolocation extends flash.events.EventDispatcher { + @:flash.property var muted(get,never) : Bool; + function new() : Void; + private function get_muted() : Bool; + function setRequestedUpdateInterval(interval : Float) : Void; + @:flash.property static var isSupported(get,never) : Bool; + private static function get_isSupported() : Bool; +} diff --git a/build/linux64_569e52e/std/flash/system/ApplicationDomain.hx b/build/linux64_569e52e/std/flash/system/ApplicationDomain.hx new file mode 100644 index 0000000..5b0f783 --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/ApplicationDomain.hx @@ -0,0 +1,17 @@ +package flash.system; + +extern final class ApplicationDomain { + @:flash.property @:require(flash10) var domainMemory(get,set) : flash.utils.ByteArray; + @:flash.property var parentDomain(get,never) : ApplicationDomain; + function new(?parentDomain : ApplicationDomain) : Void; + function getDefinition(name : String) : flash.utils.Object; + @:require(flash11_3) function getQualifiedDefinitionNames() : flash.Vector; + private function get_domainMemory() : flash.utils.ByteArray; + private function get_parentDomain() : ApplicationDomain; + function hasDefinition(name : String) : Bool; + private function set_domainMemory(value : flash.utils.ByteArray) : flash.utils.ByteArray; + @:flash.property @:require(flash10) static var MIN_DOMAIN_MEMORY_LENGTH(get,never) : UInt; + @:flash.property static var currentDomain(get,never) : ApplicationDomain; + private static function get_MIN_DOMAIN_MEMORY_LENGTH() : UInt; + private static function get_currentDomain() : ApplicationDomain; +} diff --git a/build/linux64_569e52e/std/flash/system/ApplicationInstaller.hx b/build/linux64_569e52e/std/flash/system/ApplicationInstaller.hx new file mode 100644 index 0000000..5249193 --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/ApplicationInstaller.hx @@ -0,0 +1,10 @@ +package flash.system; + +@:require(flash11_3) extern final class ApplicationInstaller extends flash.events.EventDispatcher { + @:flash.property var isInstalled(get,never) : Bool; + function new() : Void; + private function get_isInstalled() : Bool; + function install(?mode : String) : Void; + static function iconDigest(icon : flash.utils.ByteArray) : String; + static function stringsDigest(strings : flash.xml.XML) : String; +} diff --git a/build/linux64_569e52e/std/flash/system/ApplicationInstallerMode.hx b/build/linux64_569e52e/std/flash/system/ApplicationInstallerMode.hx new file mode 100644 index 0000000..4d67e6b --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/ApplicationInstallerMode.hx @@ -0,0 +1,7 @@ +package flash.system; + +@:native("flash.system.ApplicationInstallerMode") extern enum abstract ApplicationInstallerMode(String) { + var INSTALL_ONLY; + var INSTALL_WITH_SHORTCUTS; + var SHORTCUTS_ONLY; +} diff --git a/build/linux64_569e52e/std/flash/system/AuthorizedFeatures.hx b/build/linux64_569e52e/std/flash/system/AuthorizedFeatures.hx new file mode 100644 index 0000000..cfc84b1 --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/AuthorizedFeatures.hx @@ -0,0 +1,14 @@ +package flash.system; + +@:require(flash11_3) extern final class AuthorizedFeatures { + function new() : Void; + function createApplicationInstaller(strings : flash.xml.XML, icon : flash.utils.ByteArray) : ApplicationInstaller; + function enableAVLoader(loader : flash.display.AVLoader) : Bool; + function enableAVURLLoader(loader : flash.media.AVURLLoader) : Bool; + function enableAVURLStream(stream : flash.media.AVURLStream) : Bool; + @:require(flash11_4) function enableDiskCache(stream : flash.net.URLStream) : Bool; + @:require(flash11_7) function enableHLSPlayback(stream : flash.media.AVStream) : Bool; + function enableMediaPlayerHLSPlayback(player : Dynamic) : Bool; + @:ns("flash.system",internal) @:require(flash11_4) function isFeatureEnabled(feature : String, ?data : String) : Bool; + @:ns("flash.system",internal) @:require(flash11_4) function isNegativeToken() : Bool; +} diff --git a/build/linux64_569e52e/std/flash/system/AuthorizedFeaturesLoader.hx b/build/linux64_569e52e/std/flash/system/AuthorizedFeaturesLoader.hx new file mode 100644 index 0000000..8ce6f16 --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/AuthorizedFeaturesLoader.hx @@ -0,0 +1,10 @@ +package flash.system; + +@:require(flash11_3) extern final class AuthorizedFeaturesLoader extends flash.events.EventDispatcher { + @:flash.property var authorizedFeatures(get,never) : AuthorizedFeatures; + function new() : Void; + private function get_authorizedFeatures() : AuthorizedFeatures; + function loadAuthorizedFeatures() : Void; + @:require(flash11_7) function loadAuthorizedFeaturesFromData(data : flash.utils.ByteArray) : Void; + @:ns("flash.system",internal) @:require(flash11_4) function makeGlobal() : Void; +} diff --git a/build/linux64_569e52e/std/flash/system/Capabilities.hx b/build/linux64_569e52e/std/flash/system/Capabilities.hx new file mode 100644 index 0000000..22f1f86 --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/Capabilities.hx @@ -0,0 +1,75 @@ +package flash.system; + +extern class Capabilities { + @:flash.property static var _internal(get,never) : UInt; + @:flash.property static var avHardwareDisable(get,never) : Bool; + @:flash.property static var cpuAddressSize(get,never) : Float; + @:flash.property @:require(flash10_1) static var cpuArchitecture(get,never) : String; + @:flash.property static var hasAccessibility(get,never) : Bool; + @:flash.property static var hasAudio(get,never) : Bool; + @:flash.property static var hasAudioEncoder(get,never) : Bool; + @:flash.property static var hasEmbeddedVideo(get,never) : Bool; + @:flash.property static var hasIME(get,never) : Bool; + @:flash.property static var hasMP3(get,never) : Bool; + @:flash.property static var hasPrinting(get,never) : Bool; + @:flash.property static var hasScreenBroadcast(get,never) : Bool; + @:flash.property static var hasScreenPlayback(get,never) : Bool; + @:flash.property static var hasStreamingAudio(get,never) : Bool; + @:flash.property static var hasStreamingVideo(get,never) : Bool; + @:flash.property static var hasTLS(get,never) : Bool; + @:flash.property static var hasVideoEncoder(get,never) : Bool; + @:flash.property static var isDebugger(get,never) : Bool; + @:flash.property @:require(flash10) static var isEmbeddedInAcrobat(get,never) : Bool; + @:flash.property static var language(get,never) : String; + @:flash.property static var localFileReadDisable(get,never) : Bool; + @:flash.property static var manufacturer(get,never) : String; + @:flash.property @:require(flash10) static var maxLevelIDC(get,never) : String; + @:flash.property static var os(get,never) : String; + @:flash.property static var pixelAspectRatio(get,never) : Float; + @:flash.property static var playerType(get,never) : String; + @:flash.property static var screenColor(get,never) : String; + @:flash.property static var screenDPI(get,never) : Float; + @:flash.property static var screenResolutionX(get,never) : Float; + @:flash.property static var screenResolutionY(get,never) : Float; + @:flash.property static var serverString(get,never) : String; + @:flash.property @:require(flash10_1) static var supports32BitProcesses(get,never) : Bool; + @:flash.property @:require(flash10_1) static var supports64BitProcesses(get,never) : Bool; + @:flash.property @:require(flash10_1) static var touchscreenType(get,never) : TouchscreenType; + @:flash.property static var version(get,never) : String; + private static function get__internal() : UInt; + private static function get_avHardwareDisable() : Bool; + private static function get_cpuAddressSize() : Float; + private static function get_cpuArchitecture() : String; + private static function get_hasAccessibility() : Bool; + private static function get_hasAudio() : Bool; + private static function get_hasAudioEncoder() : Bool; + private static function get_hasEmbeddedVideo() : Bool; + private static function get_hasIME() : Bool; + private static function get_hasMP3() : Bool; + private static function get_hasPrinting() : Bool; + private static function get_hasScreenBroadcast() : Bool; + private static function get_hasScreenPlayback() : Bool; + private static function get_hasStreamingAudio() : Bool; + private static function get_hasStreamingVideo() : Bool; + private static function get_hasTLS() : Bool; + private static function get_hasVideoEncoder() : Bool; + private static function get_isDebugger() : Bool; + private static function get_isEmbeddedInAcrobat() : Bool; + private static function get_language() : String; + private static function get_localFileReadDisable() : Bool; + private static function get_manufacturer() : String; + private static function get_maxLevelIDC() : String; + private static function get_os() : String; + private static function get_pixelAspectRatio() : Float; + private static function get_playerType() : String; + private static function get_screenColor() : String; + private static function get_screenDPI() : Float; + private static function get_screenResolutionX() : Float; + private static function get_screenResolutionY() : Float; + private static function get_serverString() : String; + private static function get_supports32BitProcesses() : Bool; + private static function get_supports64BitProcesses() : Bool; + private static function get_touchscreenType() : TouchscreenType; + private static function get_version() : String; + @:require(flash11) static function hasMultiChannelAudio(type : String) : Bool; +} diff --git a/build/linux64_569e52e/std/flash/system/ConnexionsClient.hx b/build/linux64_569e52e/std/flash/system/ConnexionsClient.hx new file mode 100644 index 0000000..68300cc --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/ConnexionsClient.hx @@ -0,0 +1,9 @@ +package flash.system; + +extern final class ConnexionsClient { + function new() : Void; + function Connexions() : Dynamic; + function _init(topLocation : String, documentReferrer : String, windowLocation : String, movie : String, userAgent : String, timeout : UInt) : Void; + function autoAdd(port : Int) : Dynamic; + function manualAdd(port : Int) : Dynamic; +} diff --git a/build/linux64_569e52e/std/flash/system/DomainMemoryWithStage3D.hx b/build/linux64_569e52e/std/flash/system/DomainMemoryWithStage3D.hx new file mode 100644 index 0000000..d763f52 --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/DomainMemoryWithStage3D.hx @@ -0,0 +1,5 @@ +package flash.system; + +extern class DomainMemoryWithStage3D { + function new() : Void; +} diff --git a/build/linux64_569e52e/std/flash/system/FSCommand.hx b/build/linux64_569e52e/std/flash/system/FSCommand.hx new file mode 100644 index 0000000..78e2bc8 --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/FSCommand.hx @@ -0,0 +1,5 @@ +package flash.system; + +extern class FSCommand { + static function _fscommand(command : String, args : String) : Void; +} diff --git a/build/linux64_569e52e/std/flash/system/IME.hx b/build/linux64_569e52e/std/flash/system/IME.hx new file mode 100644 index 0000000..7a6659f --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/IME.hx @@ -0,0 +1,16 @@ +package flash.system; + +extern class IME extends flash.events.EventDispatcher { + @:flash.property static var conversionMode(get,set) : IMEConversionMode; + @:flash.property static var enabled(get,set) : Bool; + @:flash.property @:require(flash10_1) static var isSupported(get,never) : Bool; + @:require(flash10_1) static function compositionAbandoned() : Void; + @:require(flash10_1) static function compositionSelectionChanged(start : Int, end : Int) : Void; + static function doConversion() : Void; + private static function get_conversionMode() : IMEConversionMode; + private static function get_enabled() : Bool; + private static function get_isSupported() : Bool; + static function setCompositionString(composition : String) : Void; + private static function set_conversionMode(value : IMEConversionMode) : IMEConversionMode; + private static function set_enabled(value : Bool) : Bool; +} diff --git a/build/linux64_569e52e/std/flash/system/IMEConversionMode.hx b/build/linux64_569e52e/std/flash/system/IMEConversionMode.hx new file mode 100644 index 0000000..102baa9 --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/IMEConversionMode.hx @@ -0,0 +1,12 @@ +package flash.system; + +@:native("flash.system.IMEConversionMode") extern enum abstract IMEConversionMode(String) { + var ALPHANUMERIC_FULL; + var ALPHANUMERIC_HALF; + var CHINESE; + var JAPANESE_HIRAGANA; + var JAPANESE_KATAKANA_FULL; + var JAPANESE_KATAKANA_HALF; + var KOREAN; + var UNKNOWN; +} diff --git a/build/linux64_569e52e/std/flash/system/ImageDecodingPolicy.hx b/build/linux64_569e52e/std/flash/system/ImageDecodingPolicy.hx new file mode 100644 index 0000000..195b187 --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/ImageDecodingPolicy.hx @@ -0,0 +1,6 @@ +package flash.system; + +@:native("flash.system.ImageDecodingPolicy") extern enum abstract ImageDecodingPolicy(String) { + var ON_DEMAND; + var ON_LOAD; +} diff --git a/build/linux64_569e52e/std/flash/system/JPEGLoaderContext.hx b/build/linux64_569e52e/std/flash/system/JPEGLoaderContext.hx new file mode 100644 index 0000000..b6bae94 --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/JPEGLoaderContext.hx @@ -0,0 +1,6 @@ +package flash.system; + +@:require(flash10) extern class JPEGLoaderContext extends LoaderContext { + var deblockingFilter : Float; + function new(deblockingFilter : Float = 0, checkPolicyFile : Bool = false, ?applicationDomain : ApplicationDomain, ?securityDomain : SecurityDomain) : Void; +} diff --git a/build/linux64_569e52e/std/flash/system/LoaderContext.hx b/build/linux64_569e52e/std/flash/system/LoaderContext.hx new file mode 100644 index 0000000..3f5e6f5 --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/LoaderContext.hx @@ -0,0 +1,15 @@ +package flash.system; + +extern class LoaderContext { + @:require(flash10_1) var allowCodeImport : Bool; + @:flash.property @:require(flash10_1) var allowLoadBytesCodeExecution(get,set) : Bool; + var applicationDomain : ApplicationDomain; + var checkPolicyFile : Bool; + @:require(flash11) var imageDecodingPolicy : ImageDecodingPolicy; + @:require(flash11) var parameters : Dynamic; + @:require(flash11) var requestedContentParent : flash.display.DisplayObjectContainer; + var securityDomain : SecurityDomain; + function new(checkPolicyFile : Bool = false, ?applicationDomain : ApplicationDomain, ?securityDomain : SecurityDomain) : Void; + private function get_allowLoadBytesCodeExecution() : Bool; + private function set_allowLoadBytesCodeExecution(value : Bool) : Bool; +} diff --git a/build/linux64_569e52e/std/flash/system/MessageChannel.hx b/build/linux64_569e52e/std/flash/system/MessageChannel.hx new file mode 100644 index 0000000..1a184cd --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/MessageChannel.hx @@ -0,0 +1,11 @@ +package flash.system; + +@:require(flash11_4) extern final class MessageChannel extends flash.events.EventDispatcher { + @:flash.property var messageAvailable(get,never) : Bool; + @:flash.property var state(get,never) : MessageChannelState; + function close() : Void; + private function get_messageAvailable() : Bool; + private function get_state() : MessageChannelState; + function receive(blockUntilReceived : Bool = false) : Dynamic; + function send(arg : Dynamic, queueLimit : Int = -1) : Void; +} diff --git a/build/linux64_569e52e/std/flash/system/MessageChannelState.hx b/build/linux64_569e52e/std/flash/system/MessageChannelState.hx new file mode 100644 index 0000000..e845906 --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/MessageChannelState.hx @@ -0,0 +1,7 @@ +package flash.system; + +@:native("flash.system.MessageChannelState") extern enum abstract MessageChannelState(String) { + var CLOSED; + var CLOSING; + var OPEN; +} diff --git a/build/linux64_569e52e/std/flash/system/Security.hx b/build/linux64_569e52e/std/flash/system/Security.hx new file mode 100644 index 0000000..70db3ef --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/Security.hx @@ -0,0 +1,25 @@ +package flash.system; + +extern class Security { + @:require(flash10_1) static final APPLICATION : String; + static final LOCAL_TRUSTED : String; + static final LOCAL_WITH_FILE : String; + static final LOCAL_WITH_NETWORK : String; + static final REMOTE : String; + @:flash.property static var disableAVM1Loading(get,set) : Bool; + @:flash.property static var exactSettings(get,set) : Bool; + @:flash.property @:require(flash11) static var pageDomain(get,never) : String; + @:flash.property static var sandboxType(get,never) : String; + static function allowDomain(restArgs : haxe.extern.Rest) : Void; + static function allowInsecureDomain(restArgs : haxe.extern.Rest) : Void; + @:ns("flash.system",internal) @:require(flash10_1) static function duplicateSandboxBridgeInputArguments(toplevel : Dynamic, args : Array) : Array; + @:ns("flash.system",internal) @:require(flash10_1) static function duplicateSandboxBridgeOutputArgument(toplevel : Dynamic, arg : Dynamic) : Dynamic; + private static function get_disableAVM1Loading() : Bool; + private static function get_exactSettings() : Bool; + private static function get_pageDomain() : String; + private static function get_sandboxType() : String; + static function loadPolicyFile(url : String) : Void; + private static function set_disableAVM1Loading(value : Bool) : Bool; + private static function set_exactSettings(value : Bool) : Bool; + static function showSettings(?panel : SecurityPanel) : Void; +} diff --git a/build/linux64_569e52e/std/flash/system/SecurityDomain.hx b/build/linux64_569e52e/std/flash/system/SecurityDomain.hx new file mode 100644 index 0000000..ba6b7db --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/SecurityDomain.hx @@ -0,0 +1,8 @@ +package flash.system; + +extern class SecurityDomain { + @:flash.property @:require(flash11_3) var domainID(get,never) : String; + private function get_domainID() : String; + @:flash.property static var currentDomain(get,never) : SecurityDomain; + private static function get_currentDomain() : SecurityDomain; +} diff --git a/build/linux64_569e52e/std/flash/system/SecurityPanel.hx b/build/linux64_569e52e/std/flash/system/SecurityPanel.hx new file mode 100644 index 0000000..aa88021 --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/SecurityPanel.hx @@ -0,0 +1,11 @@ +package flash.system; + +@:native("flash.system.SecurityPanel") extern enum abstract SecurityPanel(String) { + var CAMERA; + var DEFAULT; + var DISPLAY; + var LOCAL_STORAGE; + var MICROPHONE; + var PRIVACY; + var SETTINGS_MANAGER; +} diff --git a/build/linux64_569e52e/std/flash/system/System.hx b/build/linux64_569e52e/std/flash/system/System.hx new file mode 100644 index 0000000..ba8c567 --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/System.hx @@ -0,0 +1,28 @@ +package flash.system; + +extern class System { + @:flash.property @:require(flash10_1) static var freeMemory(get,never) : Float; + @:flash.property static var ime(get,never) : IME; + @:flash.property @:require(flash10_1) static var privateMemory(get,never) : Float; + @:flash.property @:require(flash11) static var processCPUUsage(get,never) : Float; + @:flash.property static var totalMemory(get,never) : UInt; + @:flash.property @:require(flash10_1) static var totalMemoryNumber(get,never) : Float; + @:flash.property static var useCodePage(get,set) : Bool; + @:flash.property static var vmVersion(get,never) : String; + @:require(flash10_1) static function disposeXML(node : flash.xml.XML) : Void; + static function exit(code : UInt) : Void; + static function gc() : Void; + private static function get_freeMemory() : Float; + private static function get_ime() : IME; + private static function get_privateMemory() : Float; + private static function get_processCPUUsage() : Float; + private static function get_totalMemory() : UInt; + private static function get_totalMemoryNumber() : Float; + private static function get_useCodePage() : Bool; + private static function get_vmVersion() : String; + static function pause() : Void; + @:require(flash11) static function pauseForGCIfCollectionImminent(imminence : Float = 0.75) : Void; + static function resume() : Void; + static function setClipboard(string : String) : Void; + private static function set_useCodePage(value : Bool) : Bool; +} diff --git a/build/linux64_569e52e/std/flash/system/SystemUpdater.hx b/build/linux64_569e52e/std/flash/system/SystemUpdater.hx new file mode 100644 index 0000000..c8bd2b9 --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/SystemUpdater.hx @@ -0,0 +1,7 @@ +package flash.system; + +@:require(flash10_1) extern class SystemUpdater extends flash.events.EventDispatcher { + function new() : Void; + function cancel() : Void; + function update(type : SystemUpdaterType) : Void; +} diff --git a/build/linux64_569e52e/std/flash/system/SystemUpdaterType.hx b/build/linux64_569e52e/std/flash/system/SystemUpdaterType.hx new file mode 100644 index 0000000..fc5ac33 --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/SystemUpdaterType.hx @@ -0,0 +1,6 @@ +package flash.system; + +@:native("flash.system.SystemUpdaterType") extern enum abstract SystemUpdaterType(String) { + var DRM; + var SYSTEM; +} diff --git a/build/linux64_569e52e/std/flash/system/TouchscreenType.hx b/build/linux64_569e52e/std/flash/system/TouchscreenType.hx new file mode 100644 index 0000000..463911d --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/TouchscreenType.hx @@ -0,0 +1,7 @@ +package flash.system; + +@:native("flash.system.TouchscreenType") extern enum abstract TouchscreenType(String) { + var FINGER; + var NONE; + var STYLUS; +} diff --git a/build/linux64_569e52e/std/flash/system/Worker.hx b/build/linux64_569e52e/std/flash/system/Worker.hx new file mode 100644 index 0000000..6abfee2 --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/Worker.hx @@ -0,0 +1,17 @@ +package flash.system; + +@:require(flash11_4) extern final class Worker extends flash.events.EventDispatcher { + @:flash.property var isPrimordial(get,never) : Bool; + @:flash.property var state(get,never) : WorkerState; + function createMessageChannel(receiver : Worker) : MessageChannel; + function getSharedProperty(key : String) : Dynamic; + private function get_isPrimordial() : Bool; + private function get_state() : WorkerState; + function setSharedProperty(key : String, value : Dynamic) : Void; + function start() : Void; + function terminate() : Bool; + @:flash.property static var current(get,never) : Worker; + @:flash.property static var isSupported(get,never) : Bool; + private static function get_current() : Worker; + private static function get_isSupported() : Bool; +} diff --git a/build/linux64_569e52e/std/flash/system/WorkerDomain.hx b/build/linux64_569e52e/std/flash/system/WorkerDomain.hx new file mode 100644 index 0000000..a6070e4 --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/WorkerDomain.hx @@ -0,0 +1,11 @@ +package flash.system; + +@:require(flash11_4) extern final class WorkerDomain { + function new() : Void; + function createWorker(swf : flash.utils.ByteArray, giveAppPrivileges : Bool = false) : Worker; + function listWorkers() : flash.Vector; + @:flash.property static var current(get,never) : WorkerDomain; + @:flash.property static var isSupported(get,never) : Bool; + private static function get_current() : WorkerDomain; + private static function get_isSupported() : Bool; +} diff --git a/build/linux64_569e52e/std/flash/system/WorkerState.hx b/build/linux64_569e52e/std/flash/system/WorkerState.hx new file mode 100644 index 0000000..ed3ab4e --- /dev/null +++ b/build/linux64_569e52e/std/flash/system/WorkerState.hx @@ -0,0 +1,7 @@ +package flash.system; + +@:native("flash.system.WorkerState") extern enum abstract WorkerState(String) { + var NEW; + var RUNNING; + var TERMINATED; +} diff --git a/build/linux64_569e52e/std/flash/text/AntiAliasType.hx b/build/linux64_569e52e/std/flash/text/AntiAliasType.hx new file mode 100644 index 0000000..8ccc1c5 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/AntiAliasType.hx @@ -0,0 +1,6 @@ +package flash.text; + +@:native("flash.text.AntiAliasType") extern enum abstract AntiAliasType(String) { + var ADVANCED; + var NORMAL; +} diff --git a/build/linux64_569e52e/std/flash/text/CSMSettings.hx b/build/linux64_569e52e/std/flash/text/CSMSettings.hx new file mode 100644 index 0000000..4ea19e7 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/CSMSettings.hx @@ -0,0 +1,8 @@ +package flash.text; + +extern final class CSMSettings { + var fontSize : Float; + var insideCutoff : Float; + var outsideCutoff : Float; + function new(fontSize : Float, insideCutoff : Float, outsideCutoff : Float) : Void; +} diff --git a/build/linux64_569e52e/std/flash/text/Font.hx b/build/linux64_569e52e/std/flash/text/Font.hx new file mode 100644 index 0000000..4e974f4 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/Font.hx @@ -0,0 +1,14 @@ +package flash.text; + +extern class Font { + @:flash.property var fontName(get,never) : String; + @:flash.property var fontStyle(get,never) : FontStyle; + @:flash.property var fontType(get,never) : FontType; + function new() : Void; + private function get_fontName() : String; + private function get_fontStyle() : FontStyle; + private function get_fontType() : FontType; + function hasGlyphs(str : String) : Bool; + static function enumerateFonts(enumerateDeviceFonts : Bool = false) : Array; + static function registerFont(font : Class) : Void; +} diff --git a/build/linux64_569e52e/std/flash/text/FontStyle.hx b/build/linux64_569e52e/std/flash/text/FontStyle.hx new file mode 100644 index 0000000..2c7242e --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/FontStyle.hx @@ -0,0 +1,8 @@ +package flash.text; + +@:native("flash.text.FontStyle") extern enum abstract FontStyle(String) { + var BOLD; + var BOLD_ITALIC; + var ITALIC; + var REGULAR; +} diff --git a/build/linux64_569e52e/std/flash/text/FontType.hx b/build/linux64_569e52e/std/flash/text/FontType.hx new file mode 100644 index 0000000..9c8cef0 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/FontType.hx @@ -0,0 +1,7 @@ +package flash.text; + +@:native("flash.text.FontType") extern enum abstract FontType(String) { + var DEVICE; + var EMBEDDED; + var EMBEDDED_CFF; +} diff --git a/build/linux64_569e52e/std/flash/text/GridFitType.hx b/build/linux64_569e52e/std/flash/text/GridFitType.hx new file mode 100644 index 0000000..f24bf93 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/GridFitType.hx @@ -0,0 +1,7 @@ +package flash.text; + +@:native("flash.text.GridFitType") extern enum abstract GridFitType(String) { + var NONE; + var PIXEL; + var SUBPIXEL; +} diff --git a/build/linux64_569e52e/std/flash/text/StaticText.hx b/build/linux64_569e52e/std/flash/text/StaticText.hx new file mode 100644 index 0000000..1b9c995 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/StaticText.hx @@ -0,0 +1,7 @@ +package flash.text; + +extern final class StaticText extends flash.display.DisplayObject { + @:flash.property var text(get,never) : String; + function new() : Void; + private function get_text() : String; +} diff --git a/build/linux64_569e52e/std/flash/text/StyleSheet.hx b/build/linux64_569e52e/std/flash/text/StyleSheet.hx new file mode 100644 index 0000000..443bd0a --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/StyleSheet.hx @@ -0,0 +1,12 @@ +package flash.text; + +extern class StyleSheet extends flash.events.EventDispatcher implements Dynamic { + @:flash.property var styleNames(get,never) : Array; + function new() : Void; + function clear() : Void; + function getStyle(styleName : String) : flash.utils.Object; + private function get_styleNames() : Array; + function parseCSS(CSSText : String) : Void; + function setStyle(styleName : String, styleObject : flash.utils.Object) : Void; + function transform(formatObject : flash.utils.Object) : TextFormat; +} diff --git a/build/linux64_569e52e/std/flash/text/TextColorType.hx b/build/linux64_569e52e/std/flash/text/TextColorType.hx new file mode 100644 index 0000000..804dab9 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/TextColorType.hx @@ -0,0 +1,6 @@ +package flash.text; + +@:native("flash.text.TextColorType") extern enum abstract TextColorType(String) { + var DARK_COLOR; + var LIGHT_COLOR; +} diff --git a/build/linux64_569e52e/std/flash/text/TextDisplayMode.hx b/build/linux64_569e52e/std/flash/text/TextDisplayMode.hx new file mode 100644 index 0000000..0a0cd65 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/TextDisplayMode.hx @@ -0,0 +1,7 @@ +package flash.text; + +@:native("flash.text.TextDisplayMode") extern enum abstract TextDisplayMode(String) { + var CRT; + var DEFAULT; + var LCD; +} diff --git a/build/linux64_569e52e/std/flash/text/TextExtent.hx b/build/linux64_569e52e/std/flash/text/TextExtent.hx new file mode 100644 index 0000000..1574b5a --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/TextExtent.hx @@ -0,0 +1,11 @@ +package flash.text; + +extern class TextExtent { + var ascent : Float; + var descent : Float; + var height : Float; + var textFieldHeight : Float; + var textFieldWidth : Float; + var width : Float; + function new(width : Float, height : Float, textFieldWidth : Float, textFieldHeight : Float, ascent : Float, descent : Float) : Void; +} diff --git a/build/linux64_569e52e/std/flash/text/TextField.hx b/build/linux64_569e52e/std/flash/text/TextField.hx new file mode 100644 index 0000000..487be74 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/TextField.hx @@ -0,0 +1,137 @@ +package flash.text; + +extern class TextField extends flash.display.InteractiveObject { + @:flash.property var alwaysShowSelection(get,set) : Bool; + @:flash.property var antiAliasType(get,set) : AntiAliasType; + @:flash.property var autoSize(get,set) : TextFieldAutoSize; + @:flash.property var background(get,set) : Bool; + @:flash.property var backgroundColor(get,set) : UInt; + @:flash.property var border(get,set) : Bool; + @:flash.property var borderColor(get,set) : UInt; + @:flash.property var bottomScrollV(get,never) : Int; + @:flash.property var caretIndex(get,never) : Int; + @:flash.property var condenseWhite(get,set) : Bool; + @:flash.property var defaultTextFormat(get,set) : TextFormat; + @:flash.property var displayAsPassword(get,set) : Bool; + @:flash.property var embedFonts(get,set) : Bool; + @:flash.property var gridFitType(get,set) : GridFitType; + @:flash.property var htmlText(get,set) : String; + @:flash.property var length(get,never) : Int; + @:flash.property var maxChars(get,set) : Int; + @:flash.property var maxScrollH(get,never) : Int; + @:flash.property var maxScrollV(get,never) : Int; + @:flash.property var mouseWheelEnabled(get,set) : Bool; + @:flash.property var multiline(get,set) : Bool; + @:flash.property var numLines(get,never) : Int; + @:flash.property var restrict(get,set) : String; + @:flash.property var scrollH(get,set) : Int; + @:flash.property var scrollV(get,set) : Int; + @:flash.property var selectable(get,set) : Bool; + @:flash.property var selectedText(get,never) : String; + @:flash.property var selectionBeginIndex(get,never) : Int; + @:flash.property var selectionEndIndex(get,never) : Int; + @:flash.property var sharpness(get,set) : Float; + @:flash.property var styleSheet(get,set) : StyleSheet; + @:flash.property var text(get,set) : String; + @:flash.property var textColor(get,set) : UInt; + @:flash.property var textHeight(get,never) : Float; + @:flash.property @:require(flash11) var textInteractionMode(get,never) : TextInteractionMode; + @:flash.property var textWidth(get,never) : Float; + @:flash.property var thickness(get,set) : Float; + @:flash.property var type(get,set) : TextFieldType; + @:flash.property var useRichTextClipboard(get,set) : Bool; + @:flash.property var wordWrap(get,set) : Bool; + function new() : Void; + function appendText(newText : String) : Void; + @:ns("flash.text",internal) function copyRichText() : String; + function getCharBoundaries(charIndex : Int) : flash.geom.Rectangle; + function getCharIndexAtPoint(x : Float, y : Float) : Int; + function getFirstCharInParagraph(charIndex : Int) : Int; + function getImageReference(id : String) : flash.display.DisplayObject; + function getLineIndexAtPoint(x : Float, y : Float) : Int; + function getLineIndexOfChar(charIndex : Int) : Int; + function getLineLength(lineIndex : Int) : Int; + function getLineMetrics(lineIndex : Int) : TextLineMetrics; + function getLineOffset(lineIndex : Int) : Int; + function getLineText(lineIndex : Int) : String; + function getParagraphLength(charIndex : Int) : Int; + function getRawText() : String; + function getTextFormat(beginIndex : Int = -1, endIndex : Int = -1) : TextFormat; + function getTextRuns(beginIndex : Int = 0, endIndex : Int = 2147483647) : Array; + function getXMLText(beginIndex : Int = 0, endIndex : Int = 2147483647) : String; + private function get_alwaysShowSelection() : Bool; + private function get_antiAliasType() : AntiAliasType; + private function get_autoSize() : TextFieldAutoSize; + private function get_background() : Bool; + private function get_backgroundColor() : UInt; + private function get_border() : Bool; + private function get_borderColor() : UInt; + private function get_bottomScrollV() : Int; + private function get_caretIndex() : Int; + private function get_condenseWhite() : Bool; + private function get_defaultTextFormat() : TextFormat; + private function get_displayAsPassword() : Bool; + private function get_embedFonts() : Bool; + private function get_gridFitType() : GridFitType; + private function get_htmlText() : String; + private function get_length() : Int; + private function get_maxChars() : Int; + private function get_maxScrollH() : Int; + private function get_maxScrollV() : Int; + private function get_mouseWheelEnabled() : Bool; + private function get_multiline() : Bool; + private function get_numLines() : Int; + private function get_restrict() : String; + private function get_scrollH() : Int; + private function get_scrollV() : Int; + private function get_selectable() : Bool; + private function get_selectedText() : String; + private function get_selectionBeginIndex() : Int; + private function get_selectionEndIndex() : Int; + private function get_sharpness() : Float; + private function get_styleSheet() : StyleSheet; + private function get_text() : String; + private function get_textColor() : UInt; + private function get_textHeight() : Float; + private function get_textInteractionMode() : TextInteractionMode; + private function get_textWidth() : Float; + private function get_thickness() : Float; + private function get_type() : TextFieldType; + private function get_useRichTextClipboard() : Bool; + private function get_wordWrap() : Bool; + function insertXMLText(beginIndex : Int, endIndex : Int, richText : String, pasting : Bool = false) : Void; + @:ns("flash.text",internal) function pasteRichText(richText : String) : Bool; + function replaceSelectedText(value : String) : Void; + function replaceText(beginIndex : Int, endIndex : Int, newText : String) : Void; + function setSelection(beginIndex : Int, endIndex : Int) : Void; + function setTextFormat(format : TextFormat, beginIndex : Int = -1, endIndex : Int = -1) : Void; + private function set_alwaysShowSelection(value : Bool) : Bool; + private function set_antiAliasType(value : AntiAliasType) : AntiAliasType; + private function set_autoSize(value : TextFieldAutoSize) : TextFieldAutoSize; + private function set_background(value : Bool) : Bool; + private function set_backgroundColor(value : UInt) : UInt; + private function set_border(value : Bool) : Bool; + private function set_borderColor(value : UInt) : UInt; + private function set_condenseWhite(value : Bool) : Bool; + private function set_defaultTextFormat(value : TextFormat) : TextFormat; + private function set_displayAsPassword(value : Bool) : Bool; + private function set_embedFonts(value : Bool) : Bool; + private function set_gridFitType(value : GridFitType) : GridFitType; + private function set_htmlText(value : String) : String; + private function set_maxChars(value : Int) : Int; + private function set_mouseWheelEnabled(value : Bool) : Bool; + private function set_multiline(value : Bool) : Bool; + private function set_restrict(value : String) : String; + private function set_scrollH(value : Int) : Int; + private function set_scrollV(value : Int) : Int; + private function set_selectable(value : Bool) : Bool; + private function set_sharpness(value : Float) : Float; + private function set_styleSheet(value : StyleSheet) : StyleSheet; + private function set_text(value : String) : String; + private function set_textColor(value : UInt) : UInt; + private function set_thickness(value : Float) : Float; + private function set_type(value : TextFieldType) : TextFieldType; + private function set_useRichTextClipboard(value : Bool) : Bool; + private function set_wordWrap(value : Bool) : Bool; + @:require(flash10) static function isFontCompatible(fontName : String, fontStyle : String) : Bool; +} diff --git a/build/linux64_569e52e/std/flash/text/TextFieldAutoSize.hx b/build/linux64_569e52e/std/flash/text/TextFieldAutoSize.hx new file mode 100644 index 0000000..67a59a1 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/TextFieldAutoSize.hx @@ -0,0 +1,8 @@ +package flash.text; + +@:native("flash.text.TextFieldAutoSize") extern enum abstract TextFieldAutoSize(String) { + var CENTER; + var LEFT; + var NONE; + var RIGHT; +} diff --git a/build/linux64_569e52e/std/flash/text/TextFieldType.hx b/build/linux64_569e52e/std/flash/text/TextFieldType.hx new file mode 100644 index 0000000..7580dc2 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/TextFieldType.hx @@ -0,0 +1,6 @@ +package flash.text; + +@:native("flash.text.TextFieldType") extern enum abstract TextFieldType(String) { + var DYNAMIC; + var INPUT; +} diff --git a/build/linux64_569e52e/std/flash/text/TextFormat.hx b/build/linux64_569e52e/std/flash/text/TextFormat.hx new file mode 100644 index 0000000..277755e --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/TextFormat.hx @@ -0,0 +1,62 @@ +package flash.text; + +extern class TextFormat { + @:flash.property var align(get,set) : TextFormatAlign; + @:flash.property var blockIndent(get,set) : Null; + @:flash.property var bold(get,set) : Null; + @:flash.property var bullet(get,set) : Null; + @:flash.property var color(get,set) : Null; + @:flash.property var display(get,set) : TextFormatDisplay; + @:flash.property var font(get,set) : String; + @:flash.property var indent(get,set) : Null; + @:flash.property var italic(get,set) : Null; + @:flash.property var kerning(get,set) : Null; + @:flash.property var leading(get,set) : Null; + @:flash.property var leftMargin(get,set) : Null; + @:flash.property var letterSpacing(get,set) : Null; + @:flash.property var rightMargin(get,set) : Null; + @:flash.property var size(get,set) : Null; + @:flash.property var tabStops(get,set) : Array; + @:flash.property var target(get,set) : String; + @:flash.property var underline(get,set) : Null; + @:flash.property var url(get,set) : String; + function new(?font : String, size : Null = 0, color : Null = 0, bold : Null = false, italic : Null = false, underline : Null = false, ?url : String, ?target : String, ?align : TextFormatAlign, leftMargin : Null = 0, rightMargin : Null = 0, indent : Null = 0, leading : Null = 0) : Void; + private function get_align() : TextFormatAlign; + private function get_blockIndent() : Null; + private function get_bold() : Null; + private function get_bullet() : Null; + private function get_color() : Null; + private function get_display() : TextFormatDisplay; + private function get_font() : String; + private function get_indent() : Null; + private function get_italic() : Null; + private function get_kerning() : Null; + private function get_leading() : Null; + private function get_leftMargin() : Null; + private function get_letterSpacing() : Null; + private function get_rightMargin() : Null; + private function get_size() : Null; + private function get_tabStops() : Array; + private function get_target() : String; + private function get_underline() : Null; + private function get_url() : String; + private function set_align(value : TextFormatAlign) : TextFormatAlign; + private function set_blockIndent(value : Null) : Null; + private function set_bold(value : Null) : Null; + private function set_bullet(value : Null) : Null; + private function set_color(value : Null) : Null; + private function set_display(value : TextFormatDisplay) : TextFormatDisplay; + private function set_font(value : String) : String; + private function set_indent(value : Null) : Null; + private function set_italic(value : Null) : Null; + private function set_kerning(value : Null) : Null; + private function set_leading(value : Null) : Null; + private function set_leftMargin(value : Null) : Null; + private function set_letterSpacing(value : Null) : Null; + private function set_rightMargin(value : Null) : Null; + private function set_size(value : Null) : Null; + private function set_tabStops(value : Array) : Array; + private function set_target(value : String) : String; + private function set_underline(value : Null) : Null; + private function set_url(value : String) : String; +} diff --git a/build/linux64_569e52e/std/flash/text/TextFormatAlign.hx b/build/linux64_569e52e/std/flash/text/TextFormatAlign.hx new file mode 100644 index 0000000..b826cab --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/TextFormatAlign.hx @@ -0,0 +1,10 @@ +package flash.text; + +@:native("flash.text.TextFormatAlign") extern enum abstract TextFormatAlign(String) { + var CENTER; + var END; + var JUSTIFY; + var LEFT; + var RIGHT; + var START; +} diff --git a/build/linux64_569e52e/std/flash/text/TextFormatDisplay.hx b/build/linux64_569e52e/std/flash/text/TextFormatDisplay.hx new file mode 100644 index 0000000..917d36f --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/TextFormatDisplay.hx @@ -0,0 +1,6 @@ +package flash.text; + +@:native("flash.text.TextFormatDisplay") extern enum abstract TextFormatDisplay(String) { + var BLOCK; + var INLINE; +} diff --git a/build/linux64_569e52e/std/flash/text/TextInteractionMode.hx b/build/linux64_569e52e/std/flash/text/TextInteractionMode.hx new file mode 100644 index 0000000..3724886 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/TextInteractionMode.hx @@ -0,0 +1,6 @@ +package flash.text; + +@:native("flash.text.TextInteractionMode") extern enum abstract TextInteractionMode(String) { + var NORMAL; + var SELECTION; +} diff --git a/build/linux64_569e52e/std/flash/text/TextLineMetrics.hx b/build/linux64_569e52e/std/flash/text/TextLineMetrics.hx new file mode 100644 index 0000000..3b1abb7 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/TextLineMetrics.hx @@ -0,0 +1,11 @@ +package flash.text; + +extern class TextLineMetrics { + var ascent : Float; + var descent : Float; + var height : Float; + var leading : Float; + var width : Float; + var x : Float; + function new(x : Float, width : Float, height : Float, ascent : Float, descent : Float, leading : Float) : Void; +} diff --git a/build/linux64_569e52e/std/flash/text/TextRenderer.hx b/build/linux64_569e52e/std/flash/text/TextRenderer.hx new file mode 100644 index 0000000..db747a9 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/TextRenderer.hx @@ -0,0 +1,14 @@ +package flash.text; + +extern class TextRenderer { + @:flash.property static var antiAliasType(get,set) : AntiAliasType; + @:flash.property static var displayMode(get,set) : TextDisplayMode; + @:flash.property static var maxLevel(get,set) : Int; + private static function get_antiAliasType() : AntiAliasType; + private static function get_displayMode() : TextDisplayMode; + private static function get_maxLevel() : Int; + static function setAdvancedAntiAliasingTable(fontName : String, fontStyle : FontStyle, colorType : TextColorType, advancedAntiAliasingTable : Array) : Void; + private static function set_antiAliasType(value : AntiAliasType) : AntiAliasType; + private static function set_displayMode(value : TextDisplayMode) : TextDisplayMode; + private static function set_maxLevel(value : Int) : Int; +} diff --git a/build/linux64_569e52e/std/flash/text/TextRun.hx b/build/linux64_569e52e/std/flash/text/TextRun.hx new file mode 100644 index 0000000..9cb7722 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/TextRun.hx @@ -0,0 +1,8 @@ +package flash.text; + +extern class TextRun { + var beginIndex : Int; + var endIndex : Int; + var textFormat : TextFormat; + function new(beginIndex : Int, endIndex : Int, textFormat : TextFormat) : Void; +} diff --git a/build/linux64_569e52e/std/flash/text/TextSnapshot.hx b/build/linux64_569e52e/std/flash/text/TextSnapshot.hx new file mode 100644 index 0000000..cea8b30 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/TextSnapshot.hx @@ -0,0 +1,15 @@ +package flash.text; + +extern class TextSnapshot { + @:flash.property var charCount(get,never) : Int; + function new() : Void; + function findText(beginIndex : Int, textToFind : String, caseSensitive : Bool) : Int; + function getSelected(beginIndex : Int, endIndex : Int) : Bool; + function getSelectedText(includeLineEndings : Bool = false) : String; + function getText(beginIndex : Int, endIndex : Int, includeLineEndings : Bool = false) : String; + function getTextRunInfo(beginIndex : Int, endIndex : Int) : Array; + private function get_charCount() : Int; + function hitTestTextNearPos(x : Float, y : Float, maxDistance : Float = 0) : Float; + function setSelectColor(hexColor : UInt = 16776960) : Void; + function setSelected(beginIndex : Int, endIndex : Int, select : Bool) : Void; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/BreakOpportunity.hx b/build/linux64_569e52e/std/flash/text/engine/BreakOpportunity.hx new file mode 100644 index 0000000..0b5d515 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/BreakOpportunity.hx @@ -0,0 +1,8 @@ +package flash.text.engine; + +@:native("flash.text.engine.BreakOpportunity") extern enum abstract BreakOpportunity(String) { + var ALL; + var ANY; + var AUTO; + var NONE; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/CFFHinting.hx b/build/linux64_569e52e/std/flash/text/engine/CFFHinting.hx new file mode 100644 index 0000000..09d2abf --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/CFFHinting.hx @@ -0,0 +1,6 @@ +package flash.text.engine; + +@:native("flash.text.engine.CFFHinting") extern enum abstract CFFHinting(String) { + var HORIZONTAL_STEM; + var NONE; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/ContentElement.hx b/build/linux64_569e52e/std/flash/text/engine/ContentElement.hx new file mode 100644 index 0000000..b4e6148 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/ContentElement.hx @@ -0,0 +1,26 @@ +package flash.text.engine; + +extern class ContentElement { + @:flash.property var elementFormat(get,set) : ElementFormat; + @:flash.property var eventMirror(get,set) : flash.events.EventDispatcher; + @:flash.property var groupElement(get,never) : GroupElement; + @:flash.property var rawText(get,never) : String; + @:flash.property var text(get,never) : String; + @:flash.property var textBlock(get,never) : TextBlock; + @:flash.property var textBlockBeginIndex(get,never) : Int; + @:flash.property var textRotation(get,set) : TextRotation; + var userData : Dynamic; + function new(?elementFormat : ElementFormat, ?eventMirror : flash.events.EventDispatcher, ?textRotation : TextRotation) : Void; + private function get_elementFormat() : ElementFormat; + private function get_eventMirror() : flash.events.EventDispatcher; + private function get_groupElement() : GroupElement; + private function get_rawText() : String; + private function get_text() : String; + private function get_textBlock() : TextBlock; + private function get_textBlockBeginIndex() : Int; + private function get_textRotation() : TextRotation; + private function set_elementFormat(value : ElementFormat) : ElementFormat; + private function set_eventMirror(value : flash.events.EventDispatcher) : flash.events.EventDispatcher; + private function set_textRotation(value : TextRotation) : TextRotation; + static final GRAPHIC_ELEMENT : UInt; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/DigitCase.hx b/build/linux64_569e52e/std/flash/text/engine/DigitCase.hx new file mode 100644 index 0000000..598d602 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/DigitCase.hx @@ -0,0 +1,7 @@ +package flash.text.engine; + +@:native("flash.text.engine.DigitCase") extern enum abstract DigitCase(String) { + var DEFAULT; + var LINING; + var OLD_STYLE; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/DigitWidth.hx b/build/linux64_569e52e/std/flash/text/engine/DigitWidth.hx new file mode 100644 index 0000000..46cbc83 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/DigitWidth.hx @@ -0,0 +1,7 @@ +package flash.text.engine; + +@:native("flash.text.engine.DigitWidth") extern enum abstract DigitWidth(String) { + var DEFAULT; + var PROPORTIONAL; + var TABULAR; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/EastAsianJustifier.hx b/build/linux64_569e52e/std/flash/text/engine/EastAsianJustifier.hx new file mode 100644 index 0000000..57b8136 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/EastAsianJustifier.hx @@ -0,0 +1,11 @@ +package flash.text.engine; + +extern final class EastAsianJustifier extends TextJustifier { + @:flash.property var composeTrailingIdeographicSpaces(get,set) : Bool; + @:flash.property var justificationStyle(get,set) : JustificationStyle; + function new(?locale : String, ?lineJustification : LineJustification, ?justificationStyle : JustificationStyle) : Void; + private function get_composeTrailingIdeographicSpaces() : Bool; + private function get_justificationStyle() : JustificationStyle; + private function set_composeTrailingIdeographicSpaces(value : Bool) : Bool; + private function set_justificationStyle(value : JustificationStyle) : JustificationStyle; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/ElementFormat.hx b/build/linux64_569e52e/std/flash/text/engine/ElementFormat.hx new file mode 100644 index 0000000..6c139a8 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/ElementFormat.hx @@ -0,0 +1,61 @@ +package flash.text.engine; + +extern final class ElementFormat { + @:flash.property var alignmentBaseline(get,set) : TextBaseline; + @:flash.property var alpha(get,set) : Float; + @:flash.property var baselineShift(get,set) : Float; + @:flash.property var breakOpportunity(get,set) : BreakOpportunity; + @:flash.property var color(get,set) : UInt; + @:flash.property var digitCase(get,set) : DigitCase; + @:flash.property var digitWidth(get,set) : DigitWidth; + @:flash.property var dominantBaseline(get,set) : TextBaseline; + @:flash.property var fontDescription(get,set) : FontDescription; + @:flash.property var fontSize(get,set) : Float; + @:flash.property var kerning(get,set) : Kerning; + @:flash.property var ligatureLevel(get,set) : LigatureLevel; + @:flash.property var locale(get,set) : String; + @:flash.property var locked(get,set) : Bool; + @:flash.property var textRotation(get,set) : TextRotation; + @:flash.property var trackingLeft(get,set) : Float; + @:flash.property var trackingRight(get,set) : Float; + @:flash.property var typographicCase(get,set) : TypographicCase; + function new(?fontDescription : FontDescription, fontSize : Float = 12, color : UInt = 0, alpha : Float = 1, ?textRotation : TextRotation, ?dominantBaseline : TextBaseline, ?alignmentBaseline : TextBaseline, baselineShift : Float = 0, ?kerning : Kerning, trackingRight : Float = 0, trackingLeft : Float = 0, ?locale : String, ?breakOpportunity : BreakOpportunity, ?digitCase : DigitCase, ?digitWidth : DigitWidth, ?ligatureLevel : LigatureLevel, ?typographicCase : TypographicCase) : Void; + function clone() : ElementFormat; + function getFontMetrics() : FontMetrics; + private function get_alignmentBaseline() : TextBaseline; + private function get_alpha() : Float; + private function get_baselineShift() : Float; + private function get_breakOpportunity() : BreakOpportunity; + private function get_color() : UInt; + private function get_digitCase() : DigitCase; + private function get_digitWidth() : DigitWidth; + private function get_dominantBaseline() : TextBaseline; + private function get_fontDescription() : FontDescription; + private function get_fontSize() : Float; + private function get_kerning() : Kerning; + private function get_ligatureLevel() : LigatureLevel; + private function get_locale() : String; + private function get_locked() : Bool; + private function get_textRotation() : TextRotation; + private function get_trackingLeft() : Float; + private function get_trackingRight() : Float; + private function get_typographicCase() : TypographicCase; + private function set_alignmentBaseline(value : TextBaseline) : TextBaseline; + private function set_alpha(value : Float) : Float; + private function set_baselineShift(value : Float) : Float; + private function set_breakOpportunity(value : BreakOpportunity) : BreakOpportunity; + private function set_color(value : UInt) : UInt; + private function set_digitCase(value : DigitCase) : DigitCase; + private function set_digitWidth(value : DigitWidth) : DigitWidth; + private function set_dominantBaseline(value : TextBaseline) : TextBaseline; + private function set_fontDescription(value : FontDescription) : FontDescription; + private function set_fontSize(value : Float) : Float; + private function set_kerning(value : Kerning) : Kerning; + private function set_ligatureLevel(value : LigatureLevel) : LigatureLevel; + private function set_locale(value : String) : String; + private function set_locked(value : Bool) : Bool; + private function set_textRotation(value : TextRotation) : TextRotation; + private function set_trackingLeft(value : Float) : Float; + private function set_trackingRight(value : Float) : Float; + private function set_typographicCase(value : TypographicCase) : TypographicCase; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/FontDescription.hx b/build/linux64_569e52e/std/flash/text/engine/FontDescription.hx new file mode 100644 index 0000000..2954df1 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/FontDescription.hx @@ -0,0 +1,29 @@ +package flash.text.engine; + +extern final class FontDescription { + @:flash.property var cffHinting(get,set) : CFFHinting; + @:flash.property var fontLookup(get,set) : FontLookup; + @:flash.property var fontName(get,set) : String; + @:flash.property var fontPosture(get,set) : FontPosture; + @:flash.property var fontWeight(get,set) : FontWeight; + @:flash.property var locked(get,set) : Bool; + @:flash.property var renderingMode(get,set) : RenderingMode; + function new(?fontName : String, ?fontWeight : FontWeight, ?fontPosture : FontPosture, ?fontLookup : FontLookup, ?renderingMode : RenderingMode, ?cffHinting : CFFHinting) : Void; + function clone() : FontDescription; + private function get_cffHinting() : CFFHinting; + private function get_fontLookup() : FontLookup; + private function get_fontName() : String; + private function get_fontPosture() : FontPosture; + private function get_fontWeight() : FontWeight; + private function get_locked() : Bool; + private function get_renderingMode() : RenderingMode; + private function set_cffHinting(value : CFFHinting) : CFFHinting; + private function set_fontLookup(value : FontLookup) : FontLookup; + private function set_fontName(value : String) : String; + private function set_fontPosture(value : FontPosture) : FontPosture; + private function set_fontWeight(value : FontWeight) : FontWeight; + private function set_locked(value : Bool) : Bool; + private function set_renderingMode(value : RenderingMode) : RenderingMode; + @:require(flash10_1) static function isDeviceFontCompatible(fontName : String, fontWeight : FontWeight, fontPosture : FontPosture) : Bool; + static function isFontCompatible(fontName : String, fontWeight : FontWeight, fontPosture : FontPosture) : Bool; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/FontLookup.hx b/build/linux64_569e52e/std/flash/text/engine/FontLookup.hx new file mode 100644 index 0000000..38de1f5 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/FontLookup.hx @@ -0,0 +1,6 @@ +package flash.text.engine; + +@:native("flash.text.engine.FontLookup") extern enum abstract FontLookup(String) { + var DEVICE; + var EMBEDDED_CFF; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/FontMetrics.hx b/build/linux64_569e52e/std/flash/text/engine/FontMetrics.hx new file mode 100644 index 0000000..5b184ba --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/FontMetrics.hx @@ -0,0 +1,15 @@ +package flash.text.engine; + +extern final class FontMetrics { + var emBox : flash.geom.Rectangle; + var lineGap : Float; + var strikethroughOffset : Float; + var strikethroughThickness : Float; + var subscriptOffset : Float; + var subscriptScale : Float; + var superscriptOffset : Float; + var superscriptScale : Float; + var underlineOffset : Float; + var underlineThickness : Float; + function new(emBox : flash.geom.Rectangle, strikethroughOffset : Float, strikethroughThickness : Float, underlineOffset : Float, underlineThickness : Float, subscriptOffset : Float, subscriptScale : Float, superscriptOffset : Float, superscriptScale : Float, lineGap : Float = 0) : Void; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/FontPosture.hx b/build/linux64_569e52e/std/flash/text/engine/FontPosture.hx new file mode 100644 index 0000000..e771f39 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/FontPosture.hx @@ -0,0 +1,6 @@ +package flash.text.engine; + +@:native("flash.text.engine.FontPosture") extern enum abstract FontPosture(String) { + var ITALIC; + var NORMAL; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/FontWeight.hx b/build/linux64_569e52e/std/flash/text/engine/FontWeight.hx new file mode 100644 index 0000000..3180321 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/FontWeight.hx @@ -0,0 +1,6 @@ +package flash.text.engine; + +@:native("flash.text.engine.FontWeight") extern enum abstract FontWeight(String) { + var BOLD; + var NORMAL; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/GraphicElement.hx b/build/linux64_569e52e/std/flash/text/engine/GraphicElement.hx new file mode 100644 index 0000000..f412d3b --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/GraphicElement.hx @@ -0,0 +1,14 @@ +package flash.text.engine; + +extern final class GraphicElement extends ContentElement { + @:flash.property var elementHeight(get,set) : Float; + @:flash.property var elementWidth(get,set) : Float; + @:flash.property var graphic(get,set) : flash.display.DisplayObject; + function new(?graphic : flash.display.DisplayObject, elementWidth : Float = 15, elementHeight : Float = 15, ?elementFormat : ElementFormat, ?eventMirror : flash.events.EventDispatcher, ?textRotation : TextRotation) : Void; + private function get_elementHeight() : Float; + private function get_elementWidth() : Float; + private function get_graphic() : flash.display.DisplayObject; + private function set_elementHeight(value : Float) : Float; + private function set_elementWidth(value : Float) : Float; + private function set_graphic(value : flash.display.DisplayObject) : flash.display.DisplayObject; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/GroupElement.hx b/build/linux64_569e52e/std/flash/text/engine/GroupElement.hx new file mode 100644 index 0000000..7d031d8 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/GroupElement.hx @@ -0,0 +1,16 @@ +package flash.text.engine; + +extern final class GroupElement extends ContentElement { + @:flash.property var elementCount(get,never) : Int; + function new(?elements : flash.Vector, ?elementFormat : ElementFormat, ?eventMirror : flash.events.EventDispatcher, ?textRotation : TextRotation) : Void; + function getElementAt(index : Int) : ContentElement; + function getElementAtCharIndex(charIndex : Int) : ContentElement; + function getElementIndex(element : ContentElement) : Int; + private function get_elementCount() : Int; + function groupElements(beginIndex : Int, endIndex : Int) : GroupElement; + function mergeTextElements(beginIndex : Int, endIndex : Int) : TextElement; + function replaceElements(beginIndex : Int, endIndex : Int, newElements : flash.Vector) : flash.Vector; + function setElements(value : flash.Vector) : Void; + function splitTextElement(elementIndex : Int, splitIndex : Int) : TextElement; + function ungroupElements(groupIndex : Int) : Void; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/JustificationStyle.hx b/build/linux64_569e52e/std/flash/text/engine/JustificationStyle.hx new file mode 100644 index 0000000..1b665fb --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/JustificationStyle.hx @@ -0,0 +1,7 @@ +package flash.text.engine; + +@:native("flash.text.engine.JustificationStyle") extern enum abstract JustificationStyle(String) { + var PRIORITIZE_LEAST_ADJUSTMENT; + var PUSH_IN_KINSOKU; + var PUSH_OUT_ONLY; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/Kerning.hx b/build/linux64_569e52e/std/flash/text/engine/Kerning.hx new file mode 100644 index 0000000..a6c6e86 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/Kerning.hx @@ -0,0 +1,7 @@ +package flash.text.engine; + +@:native("flash.text.engine.Kerning") extern enum abstract Kerning(String) { + var AUTO; + var OFF; + var ON; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/LigatureLevel.hx b/build/linux64_569e52e/std/flash/text/engine/LigatureLevel.hx new file mode 100644 index 0000000..476dcd4 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/LigatureLevel.hx @@ -0,0 +1,9 @@ +package flash.text.engine; + +@:native("flash.text.engine.LigatureLevel") extern enum abstract LigatureLevel(String) { + var COMMON; + var EXOTIC; + var MINIMUM; + var NONE; + var UNCOMMON; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/LineJustification.hx b/build/linux64_569e52e/std/flash/text/engine/LineJustification.hx new file mode 100644 index 0000000..a348f8e --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/LineJustification.hx @@ -0,0 +1,8 @@ +package flash.text.engine; + +@:native("flash.text.engine.LineJustification") extern enum abstract LineJustification(String) { + var ALL_BUT_LAST; + var ALL_BUT_MANDATORY_BREAK; + var ALL_INCLUDING_LAST; + var UNJUSTIFIED; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/RenderingMode.hx b/build/linux64_569e52e/std/flash/text/engine/RenderingMode.hx new file mode 100644 index 0000000..c48997f --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/RenderingMode.hx @@ -0,0 +1,6 @@ +package flash.text.engine; + +@:native("flash.text.engine.RenderingMode") extern enum abstract RenderingMode(String) { + var CFF; + var NORMAL; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/SpaceJustifier.hx b/build/linux64_569e52e/std/flash/text/engine/SpaceJustifier.hx new file mode 100644 index 0000000..e1a9028 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/SpaceJustifier.hx @@ -0,0 +1,17 @@ +package flash.text.engine; + +extern final class SpaceJustifier extends TextJustifier { + @:flash.property var letterSpacing(get,set) : Bool; + @:flash.property @:require(flash10_1) var maximumSpacing(get,set) : Float; + @:flash.property @:require(flash10_1) var minimumSpacing(get,set) : Float; + @:flash.property @:require(flash10_1) var optimumSpacing(get,set) : Float; + function new(?locale : String, ?lineJustification : LineJustification, letterSpacing : Bool = false) : Void; + private function get_letterSpacing() : Bool; + private function get_maximumSpacing() : Float; + private function get_minimumSpacing() : Float; + private function get_optimumSpacing() : Float; + private function set_letterSpacing(value : Bool) : Bool; + private function set_maximumSpacing(value : Float) : Float; + private function set_minimumSpacing(value : Float) : Float; + private function set_optimumSpacing(value : Float) : Float; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/TabAlignment.hx b/build/linux64_569e52e/std/flash/text/engine/TabAlignment.hx new file mode 100644 index 0000000..f22d655 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/TabAlignment.hx @@ -0,0 +1,8 @@ +package flash.text.engine; + +@:native("flash.text.engine.TabAlignment") extern enum abstract TabAlignment(String) { + var CENTER; + var DECIMAL; + var END; + var START; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/TabStop.hx b/build/linux64_569e52e/std/flash/text/engine/TabStop.hx new file mode 100644 index 0000000..16998be --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/TabStop.hx @@ -0,0 +1,14 @@ +package flash.text.engine; + +extern final class TabStop { + @:flash.property var alignment(get,set) : TabAlignment; + @:flash.property var decimalAlignmentToken(get,set) : String; + @:flash.property var position(get,set) : Float; + function new(?alignment : TabAlignment, position : Float = 0, ?decimalAlignmentToken : String) : Void; + private function get_alignment() : TabAlignment; + private function get_decimalAlignmentToken() : String; + private function get_position() : Float; + private function set_alignment(value : TabAlignment) : TabAlignment; + private function set_decimalAlignmentToken(value : String) : String; + private function set_position(value : Float) : Float; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/TextBaseline.hx b/build/linux64_569e52e/std/flash/text/engine/TextBaseline.hx new file mode 100644 index 0000000..f618150 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/TextBaseline.hx @@ -0,0 +1,11 @@ +package flash.text.engine; + +@:native("flash.text.engine.TextBaseline") extern enum abstract TextBaseline(String) { + var ASCENT; + var DESCENT; + var IDEOGRAPHIC_BOTTOM; + var IDEOGRAPHIC_CENTER; + var IDEOGRAPHIC_TOP; + var ROMAN; + var USE_DOMINANT_BASELINE; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/TextBlock.hx b/build/linux64_569e52e/std/flash/text/engine/TextBlock.hx new file mode 100644 index 0000000..873596e --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/TextBlock.hx @@ -0,0 +1,51 @@ +package flash.text.engine; + +extern final class TextBlock { + @:flash.property var applyNonLinearFontScaling(get,set) : Bool; + @:flash.property var baselineFontDescription(get,set) : FontDescription; + @:flash.property var baselineFontSize(get,set) : Float; + @:flash.property var baselineZero(get,set) : TextBaseline; + @:flash.property var bidiLevel(get,set) : Int; + @:flash.property var content(get,set) : ContentElement; + @:flash.property var firstInvalidLine(get,never) : TextLine; + @:flash.property var firstLine(get,never) : TextLine; + @:flash.property var lastLine(get,never) : TextLine; + @:flash.property var lineRotation(get,set) : TextRotation; + @:flash.property var tabStops(get,set) : flash.Vector; + @:flash.property var textJustifier(get,set) : TextJustifier; + @:flash.property var textLineCreationResult(get,never) : TextLineCreationResult; + var userData : Dynamic; + function new(?content : ContentElement, ?tabStops : flash.Vector, ?textJustifier : TextJustifier, ?lineRotation : TextRotation, ?baselineZero : TextBaseline, bidiLevel : Int = 0, applyNonLinearFontScaling : Bool = true, ?baselineFontDescription : FontDescription, baselineFontSize : Float = 12) : Void; + function createTextLine(?previousLine : TextLine, width : Float = 1000000, lineOffset : Float = 0, fitSomething : Bool = false) : TextLine; + function dump() : String; + function findNextAtomBoundary(afterCharIndex : Int) : Int; + function findNextWordBoundary(afterCharIndex : Int) : Int; + function findPreviousAtomBoundary(beforeCharIndex : Int) : Int; + function findPreviousWordBoundary(beforeCharIndex : Int) : Int; + function getTextLineAtCharIndex(charIndex : Int) : TextLine; + private function get_applyNonLinearFontScaling() : Bool; + private function get_baselineFontDescription() : FontDescription; + private function get_baselineFontSize() : Float; + private function get_baselineZero() : TextBaseline; + private function get_bidiLevel() : Int; + private function get_content() : ContentElement; + private function get_firstInvalidLine() : TextLine; + private function get_firstLine() : TextLine; + private function get_lastLine() : TextLine; + private function get_lineRotation() : TextRotation; + private function get_tabStops() : flash.Vector; + private function get_textJustifier() : TextJustifier; + private function get_textLineCreationResult() : TextLineCreationResult; + @:require(flash10_1) function recreateTextLine(textLine : TextLine, ?previousLine : TextLine, width : Float = 1000000, lineOffset : Float = 0, fitSomething : Bool = false) : TextLine; + @:require(flash10_1) function releaseLineCreationData() : Void; + function releaseLines(firstLine : TextLine, lastLine : TextLine) : Void; + private function set_applyNonLinearFontScaling(value : Bool) : Bool; + private function set_baselineFontDescription(value : FontDescription) : FontDescription; + private function set_baselineFontSize(value : Float) : Float; + private function set_baselineZero(value : TextBaseline) : TextBaseline; + private function set_bidiLevel(value : Int) : Int; + private function set_content(value : ContentElement) : ContentElement; + private function set_lineRotation(value : TextRotation) : TextRotation; + private function set_tabStops(value : flash.Vector) : flash.Vector; + private function set_textJustifier(value : TextJustifier) : TextJustifier; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/TextElement.hx b/build/linux64_569e52e/std/flash/text/engine/TextElement.hx new file mode 100644 index 0000000..d32c30e --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/TextElement.hx @@ -0,0 +1,7 @@ +package flash.text.engine; + +extern final class TextElement extends ContentElement { + function new(?text : String, ?elementFormat : ElementFormat, ?eventMirror : flash.events.EventDispatcher, ?textRotation : TextRotation) : Void; + function replaceText(beginIndex : Int, endIndex : Int, newText : String) : Void; + private function set_text(value : String) : String; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/TextJustifier.hx b/build/linux64_569e52e/std/flash/text/engine/TextJustifier.hx new file mode 100644 index 0000000..abc6f44 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/TextJustifier.hx @@ -0,0 +1,12 @@ +package flash.text.engine; + +extern class TextJustifier { + @:flash.property var lineJustification(get,set) : LineJustification; + @:flash.property var locale(get,never) : String; + function new(locale : String, lineJustification : LineJustification) : Void; + function clone() : TextJustifier; + private function get_lineJustification() : LineJustification; + private function get_locale() : String; + private function set_lineJustification(value : LineJustification) : LineJustification; + static function getJustifierForLocale(locale : String) : TextJustifier; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/TextLine.hx b/build/linux64_569e52e/std/flash/text/engine/TextLine.hx new file mode 100644 index 0000000..fd34009 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/TextLine.hx @@ -0,0 +1,60 @@ +package flash.text.engine; + +extern final class TextLine extends flash.display.DisplayObjectContainer { + @:flash.property var ascent(get,never) : Float; + @:flash.property var atomCount(get,never) : Int; + @:flash.property var descent(get,never) : Float; + @:flash.property var hasGraphicElement(get,never) : Bool; + @:flash.property @:require(flash10_1) var hasTabs(get,never) : Bool; + @:flash.property var mirrorRegions(get,never) : flash.Vector; + @:flash.property var nextLine(get,never) : TextLine; + @:flash.property var previousLine(get,never) : TextLine; + @:flash.property var rawTextLength(get,never) : Int; + @:flash.property var specifiedWidth(get,never) : Float; + @:flash.property var textBlock(get,never) : TextBlock; + @:flash.property var textBlockBeginIndex(get,never) : Int; + @:flash.property var textHeight(get,never) : Float; + @:flash.property var textWidth(get,never) : Float; + @:flash.property var totalAscent(get,never) : Float; + @:flash.property var totalDescent(get,never) : Float; + @:flash.property var totalHeight(get,never) : Float; + @:flash.property var unjustifiedTextWidth(get,never) : Float; + var userData : Dynamic; + @:flash.property var validity(get,set) : String; + function new() : Void; + function dump() : String; + function flushAtomData() : Void; + function getAtomBidiLevel(atomIndex : Int) : Int; + function getAtomBounds(atomIndex : Int) : flash.geom.Rectangle; + function getAtomCenter(atomIndex : Int) : Float; + function getAtomGraphic(atomIndex : Int) : flash.display.DisplayObject; + function getAtomIndexAtCharIndex(charIndex : Int) : Int; + function getAtomIndexAtPoint(stageX : Float, stageY : Float) : Int; + function getAtomTextBlockBeginIndex(atomIndex : Int) : Int; + function getAtomTextBlockEndIndex(atomIndex : Int) : Int; + function getAtomTextRotation(atomIndex : Int) : String; + function getAtomWordBoundaryOnLeft(atomIndex : Int) : Bool; + function getBaselinePosition(baseline : String) : Float; + function getMirrorRegion(mirror : flash.events.EventDispatcher) : TextLineMirrorRegion; + private function get_ascent() : Float; + private function get_atomCount() : Int; + private function get_descent() : Float; + private function get_hasGraphicElement() : Bool; + private function get_hasTabs() : Bool; + private function get_mirrorRegions() : flash.Vector; + private function get_nextLine() : TextLine; + private function get_previousLine() : TextLine; + private function get_rawTextLength() : Int; + private function get_specifiedWidth() : Float; + private function get_textBlock() : TextBlock; + private function get_textBlockBeginIndex() : Int; + private function get_textHeight() : Float; + private function get_textWidth() : Float; + private function get_totalAscent() : Float; + private function get_totalDescent() : Float; + private function get_totalHeight() : Float; + private function get_unjustifiedTextWidth() : Float; + private function get_validity() : String; + private function set_validity(value : String) : String; + static final MAX_LINE_WIDTH : Int; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/TextLineCreationResult.hx b/build/linux64_569e52e/std/flash/text/engine/TextLineCreationResult.hx new file mode 100644 index 0000000..34531b2 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/TextLineCreationResult.hx @@ -0,0 +1,8 @@ +package flash.text.engine; + +@:native("flash.text.engine.TextLineCreationResult") extern enum abstract TextLineCreationResult(String) { + var COMPLETE; + var EMERGENCY; + var INSUFFICIENT_WIDTH; + var SUCCESS; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/TextLineMirrorRegion.hx b/build/linux64_569e52e/std/flash/text/engine/TextLineMirrorRegion.hx new file mode 100644 index 0000000..0d4aa8e --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/TextLineMirrorRegion.hx @@ -0,0 +1,17 @@ +package flash.text.engine; + +extern final class TextLineMirrorRegion { + @:flash.property var bounds(get,never) : flash.geom.Rectangle; + @:flash.property var element(get,never) : ContentElement; + @:flash.property var mirror(get,never) : flash.events.EventDispatcher; + @:flash.property var nextRegion(get,never) : TextLineMirrorRegion; + @:flash.property var previousRegion(get,never) : TextLineMirrorRegion; + @:flash.property var textLine(get,never) : TextLine; + function new() : Void; + private function get_bounds() : flash.geom.Rectangle; + private function get_element() : ContentElement; + private function get_mirror() : flash.events.EventDispatcher; + private function get_nextRegion() : TextLineMirrorRegion; + private function get_previousRegion() : TextLineMirrorRegion; + private function get_textLine() : TextLine; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/TextLineValidity.hx b/build/linux64_569e52e/std/flash/text/engine/TextLineValidity.hx new file mode 100644 index 0000000..d8b773f --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/TextLineValidity.hx @@ -0,0 +1,8 @@ +package flash.text.engine; + +@:native("flash.text.engine.TextLineValidity") extern enum abstract TextLineValidity(String) { + var INVALID; + var POSSIBLY_INVALID; + var STATIC; + var VALID; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/TextRotation.hx b/build/linux64_569e52e/std/flash/text/engine/TextRotation.hx new file mode 100644 index 0000000..b424d9d --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/TextRotation.hx @@ -0,0 +1,9 @@ +package flash.text.engine; + +@:native("flash.text.engine.TextRotation") extern enum abstract TextRotation(String) { + var AUTO; + var ROTATE_0; + var ROTATE_180; + var ROTATE_270; + var ROTATE_90; +} diff --git a/build/linux64_569e52e/std/flash/text/engine/TypographicCase.hx b/build/linux64_569e52e/std/flash/text/engine/TypographicCase.hx new file mode 100644 index 0000000..2d5c0ff --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/engine/TypographicCase.hx @@ -0,0 +1,11 @@ +package flash.text.engine; + +@:native("flash.text.engine.TypographicCase") extern enum abstract TypographicCase(String) { + var CAPS; + var CAPS_AND_SMALL_CAPS; + var DEFAULT; + var LOWERCASE; + var SMALL_CAPS; + var TITLE; + var UPPERCASE; +} diff --git a/build/linux64_569e52e/std/flash/text/ime/CompositionAttributeRange.hx b/build/linux64_569e52e/std/flash/text/ime/CompositionAttributeRange.hx new file mode 100644 index 0000000..2a4d60b --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/ime/CompositionAttributeRange.hx @@ -0,0 +1,9 @@ +package flash.text.ime; + +extern final class CompositionAttributeRange { + var converted : Bool; + var relativeEnd : Int; + var relativeStart : Int; + var selected : Bool; + function new(relativeStart : Int, relativeEnd : Int, selected : Bool, converted : Bool) : Void; +} diff --git a/build/linux64_569e52e/std/flash/text/ime/IIMEClient.hx b/build/linux64_569e52e/std/flash/text/ime/IIMEClient.hx new file mode 100644 index 0000000..f525995 --- /dev/null +++ b/build/linux64_569e52e/std/flash/text/ime/IIMEClient.hx @@ -0,0 +1,19 @@ +package flash.text.ime; + +extern interface IIMEClient { + @:flash.property var compositionEndIndex(get,never) : Int; + @:flash.property var compositionStartIndex(get,never) : Int; + @:flash.property var selectionActiveIndex(get,never) : Int; + @:flash.property var selectionAnchorIndex(get,never) : Int; + @:flash.property var verticalTextLayout(get,never) : Bool; + function confirmComposition(?text : String, preserveSelection : Bool = false) : Void; + function getTextBounds(startIndex : Int, endIndex : Int) : flash.geom.Rectangle; + function getTextInRange(startIndex : Int, endIndex : Int) : String; + private function get_compositionEndIndex() : Int; + private function get_compositionStartIndex() : Int; + private function get_selectionActiveIndex() : Int; + private function get_selectionAnchorIndex() : Int; + private function get_verticalTextLayout() : Bool; + function selectRange(anchorIndex : Int, activeIndex : Int) : Void; + function updateComposition(text : String, attributes : flash.Vector, compositionStartIndex : Int, compositionEndIndex : Int) : Void; +} diff --git a/build/linux64_569e52e/std/flash/trace/Trace.hx b/build/linux64_569e52e/std/flash/trace/Trace.hx new file mode 100644 index 0000000..ba01597 --- /dev/null +++ b/build/linux64_569e52e/std/flash/trace/Trace.hx @@ -0,0 +1,15 @@ +package flash.trace; + +extern class Trace { + static final FILE : Dynamic; + static final LISTENER : Dynamic; + static final METHODS : Int; + static final METHODS_AND_LINES : Int; + static final METHODS_AND_LINES_WITH_ARGS : Int; + static final METHODS_WITH_ARGS : Int; + static final OFF : Int; + static function getLevel(target : Int = 2) : Int; + static function getListener() : Dynamic; + static function setLevel(l : Int, target : Int = 2) : Dynamic; + static function setListener(f : Dynamic) : Dynamic; +} diff --git a/build/linux64_569e52e/std/flash/ui/ContextMenu.hx b/build/linux64_569e52e/std/flash/ui/ContextMenu.hx new file mode 100644 index 0000000..4372e8b --- /dev/null +++ b/build/linux64_569e52e/std/flash/ui/ContextMenu.hx @@ -0,0 +1,24 @@ +package flash.ui; + +extern final class ContextMenu extends flash.display.NativeMenu { + @:flash.property var builtInItems(get,set) : ContextMenuBuiltInItems; + @:flash.property @:require(flash10) var clipboardItems(get,set) : ContextMenuClipboardItems; + @:flash.property @:require(flash10) var clipboardMenu(get,set) : Bool; + @:flash.property var customItems(get,set) : Array; + @:flash.property @:require(flash10) var link(get,set) : flash.net.URLRequest; + function new() : Void; + function clone() : ContextMenu; + private function get_builtInItems() : ContextMenuBuiltInItems; + private function get_clipboardItems() : ContextMenuClipboardItems; + private function get_clipboardMenu() : Bool; + private function get_customItems() : Array; + private function get_link() : flash.net.URLRequest; + function hideBuiltInItems() : Void; + private function set_builtInItems(value : ContextMenuBuiltInItems) : ContextMenuBuiltInItems; + private function set_clipboardItems(value : ContextMenuClipboardItems) : ContextMenuClipboardItems; + private function set_clipboardMenu(value : Bool) : Bool; + private function set_customItems(value : Array) : Array; + private function set_link(value : flash.net.URLRequest) : flash.net.URLRequest; + @:flash.property @:require(flash10_1) static var isSupported(get,never) : Bool; + private static function get_isSupported() : Bool; +} diff --git a/build/linux64_569e52e/std/flash/ui/ContextMenuBuiltInItems.hx b/build/linux64_569e52e/std/flash/ui/ContextMenuBuiltInItems.hx new file mode 100644 index 0000000..fa9fca1 --- /dev/null +++ b/build/linux64_569e52e/std/flash/ui/ContextMenuBuiltInItems.hx @@ -0,0 +1,30 @@ +package flash.ui; + +extern final class ContextMenuBuiltInItems { + @:flash.property var forwardAndBack(get,set) : Bool; + @:flash.property var loop(get,set) : Bool; + @:flash.property var play(get,set) : Bool; + @:flash.property var print(get,set) : Bool; + @:flash.property var quality(get,set) : Bool; + @:flash.property var rewind(get,set) : Bool; + @:flash.property var save(get,set) : Bool; + @:flash.property var zoom(get,set) : Bool; + function new() : Void; + function clone() : ContextMenuBuiltInItems; + private function get_forwardAndBack() : Bool; + private function get_loop() : Bool; + private function get_play() : Bool; + private function get_print() : Bool; + private function get_quality() : Bool; + private function get_rewind() : Bool; + private function get_save() : Bool; + private function get_zoom() : Bool; + private function set_forwardAndBack(value : Bool) : Bool; + private function set_loop(value : Bool) : Bool; + private function set_play(value : Bool) : Bool; + private function set_print(value : Bool) : Bool; + private function set_quality(value : Bool) : Bool; + private function set_rewind(value : Bool) : Bool; + private function set_save(value : Bool) : Bool; + private function set_zoom(value : Bool) : Bool; +} diff --git a/build/linux64_569e52e/std/flash/ui/ContextMenuClipboardItems.hx b/build/linux64_569e52e/std/flash/ui/ContextMenuClipboardItems.hx new file mode 100644 index 0000000..8e49f9c --- /dev/null +++ b/build/linux64_569e52e/std/flash/ui/ContextMenuClipboardItems.hx @@ -0,0 +1,21 @@ +package flash.ui; + +extern final class ContextMenuClipboardItems { + @:flash.property var clear(get,set) : Bool; + @:flash.property var copy(get,set) : Bool; + @:flash.property var cut(get,set) : Bool; + @:flash.property var paste(get,set) : Bool; + @:flash.property var selectAll(get,set) : Bool; + function new() : Void; + function clone() : ContextMenuClipboardItems; + private function get_clear() : Bool; + private function get_copy() : Bool; + private function get_cut() : Bool; + private function get_paste() : Bool; + private function get_selectAll() : Bool; + private function set_clear(value : Bool) : Bool; + private function set_copy(value : Bool) : Bool; + private function set_cut(value : Bool) : Bool; + private function set_paste(value : Bool) : Bool; + private function set_selectAll(value : Bool) : Bool; +} diff --git a/build/linux64_569e52e/std/flash/ui/ContextMenuItem.hx b/build/linux64_569e52e/std/flash/ui/ContextMenuItem.hx new file mode 100644 index 0000000..2e6cf0b --- /dev/null +++ b/build/linux64_569e52e/std/flash/ui/ContextMenuItem.hx @@ -0,0 +1,15 @@ +package flash.ui; + +extern final class ContextMenuItem extends flash.display.NativeMenuItem { + @:flash.property var caption(get,set) : String; + @:flash.property var separatorBefore(get,set) : Bool; + @:flash.property var visible(get,set) : Bool; + function new(caption : String, separatorBefore : Bool = false, enabled : Bool = true, visible : Bool = true) : Void; + function clone() : ContextMenuItem; + private function get_caption() : String; + private function get_separatorBefore() : Bool; + private function get_visible() : Bool; + private function set_caption(value : String) : String; + private function set_separatorBefore(value : Bool) : Bool; + private function set_visible(value : Bool) : Bool; +} diff --git a/build/linux64_569e52e/std/flash/ui/GameInput.hx b/build/linux64_569e52e/std/flash/ui/GameInput.hx new file mode 100644 index 0000000..49aec66 --- /dev/null +++ b/build/linux64_569e52e/std/flash/ui/GameInput.hx @@ -0,0 +1,9 @@ +package flash.ui; + +@:require(flash11_8) extern class GameInput extends flash.events.EventDispatcher { + @:flash.property static var isSupported(get,never) : Bool; + @:flash.property static var numDevices(get,never) : Int; + static function getDeviceAt(index : Int) : GameInputDevice; + private static function get_isSupported() : Bool; + private static function get_numDevices() : Int; +} diff --git a/build/linux64_569e52e/std/flash/ui/GameInputControl.hx b/build/linux64_569e52e/std/flash/ui/GameInputControl.hx new file mode 100644 index 0000000..18549d4 --- /dev/null +++ b/build/linux64_569e52e/std/flash/ui/GameInputControl.hx @@ -0,0 +1,15 @@ +package flash.ui; + +extern class GameInputControl extends flash.events.EventDispatcher implements Dynamic { + @:flash.property var device(get,never) : GameInputDevice; + @:flash.property var id(get,never) : String; + @:flash.property var maxValue(get,never) : Float; + @:flash.property var minValue(get,never) : Float; + @:flash.property var value(get,never) : Float; + function new() : Void; + private function get_device() : GameInputDevice; + private function get_id() : String; + private function get_maxValue() : Float; + private function get_minValue() : Float; + private function get_value() : Float; +} diff --git a/build/linux64_569e52e/std/flash/ui/GameInputControlType.hx b/build/linux64_569e52e/std/flash/ui/GameInputControlType.hx new file mode 100644 index 0000000..cb4497e --- /dev/null +++ b/build/linux64_569e52e/std/flash/ui/GameInputControlType.hx @@ -0,0 +1,10 @@ +package flash.ui; + +@:native("flash.ui.GameInputControlType") extern enum abstract GameInputControlType(String) { + var ACCELERATION; + var BUTTON; + var DIRECTION; + var MOVEMENT; + var ROTATION; + var TRIGGER; +} diff --git a/build/linux64_569e52e/std/flash/ui/GameInputDevice.hx b/build/linux64_569e52e/std/flash/ui/GameInputDevice.hx new file mode 100644 index 0000000..2201d58 --- /dev/null +++ b/build/linux64_569e52e/std/flash/ui/GameInputDevice.hx @@ -0,0 +1,22 @@ +package flash.ui; + +@:require(flash11_8) extern final class GameInputDevice { + @:flash.property var enabled(get,set) : Bool; + @:flash.property var id(get,never) : String; + @:flash.property var name(get,never) : String; + @:flash.property var numControls(get,never) : Int; + @:flash.property var sampleInterval(get,set) : Int; + function new() : Void; + function getCachedSamples(data : flash.utils.ByteArray, append : Bool = false) : Int; + function getControlAt(i : Int) : GameInputControl; + private function get_enabled() : Bool; + private function get_id() : String; + private function get_name() : String; + private function get_numControls() : Int; + private function get_sampleInterval() : Int; + private function set_enabled(value : Bool) : Bool; + private function set_sampleInterval(value : Int) : Int; + function startCachingSamples(numSamples : Int, controls : flash.Vector) : Void; + function stopCachingSamples() : Void; + static final MAX_BUFFER_SIZE : Int; +} diff --git a/build/linux64_569e52e/std/flash/ui/GameInputFinger.hx b/build/linux64_569e52e/std/flash/ui/GameInputFinger.hx new file mode 100644 index 0000000..52275fd --- /dev/null +++ b/build/linux64_569e52e/std/flash/ui/GameInputFinger.hx @@ -0,0 +1,8 @@ +package flash.ui; + +@:native("flash.ui.GameInputFinger") extern enum abstract GameInputFinger(String) { + var INDEX; + var MIDDLE; + var THUMB; + var UNKNOWN; +} diff --git a/build/linux64_569e52e/std/flash/ui/GameInputHand.hx b/build/linux64_569e52e/std/flash/ui/GameInputHand.hx new file mode 100644 index 0000000..842286f --- /dev/null +++ b/build/linux64_569e52e/std/flash/ui/GameInputHand.hx @@ -0,0 +1,7 @@ +package flash.ui; + +@:native("flash.ui.GameInputHand") extern enum abstract GameInputHand(String) { + var LEFT; + var RIGHT; + var UNKNOWN; +} diff --git a/build/linux64_569e52e/std/flash/ui/KeyLocation.hx b/build/linux64_569e52e/std/flash/ui/KeyLocation.hx new file mode 100644 index 0000000..eac4a30 --- /dev/null +++ b/build/linux64_569e52e/std/flash/ui/KeyLocation.hx @@ -0,0 +1,9 @@ +package flash.ui; + +@:native("flash.ui.KeyLocation") extern enum abstract KeyLocation(UInt) { + var D_PAD; + var LEFT; + var NUM_PAD; + var RIGHT; + var STANDARD; +} diff --git a/build/linux64_569e52e/std/flash/ui/Keyboard.hx b/build/linux64_569e52e/std/flash/ui/Keyboard.hx new file mode 100644 index 0000000..e65f70e --- /dev/null +++ b/build/linux64_569e52e/std/flash/ui/Keyboard.hx @@ -0,0 +1,291 @@ +package flash.ui; + +extern class Keyboard { + @:require(flash10_1) static final A : UInt; + @:require(flash10_1) static final ALTERNATE : UInt; + @:require(flash10_2) static final AUDIO : UInt; + @:require(flash10_1) static final B : UInt; + @:require(flash10_2) static final BACK : UInt; + @:require(flash10_1) static final BACKQUOTE : UInt; + @:require(flash10_1) static final BACKSLASH : UInt; + static final BACKSPACE : UInt; + @:require(flash10_2) static final BLUE : UInt; + @:require(flash10_1) static final C : UInt; + static final CAPS_LOCK : UInt; + @:require(flash10_2) static final CHANNEL_DOWN : UInt; + @:require(flash10_2) static final CHANNEL_UP : UInt; + @:require(flash10_1) static final COMMA : UInt; + @:require(flash10_1) static final COMMAND : UInt; + static final CONTROL : UInt; + @:require(flash10_1) static final CharCodeStrings : Array; + @:require(flash10_1) static final D : UInt; + static final DELETE : UInt; + static final DOWN : UInt; + @:require(flash10_2) static final DVR : UInt; + @:require(flash10_1) static final E : UInt; + static final END : UInt; + static final ENTER : UInt; + @:require(flash10_1) static final EQUAL : UInt; + static final ESCAPE : UInt; + @:require(flash10_2) static final EXIT : UInt; + @:require(flash10_1) static final F : UInt; + static final F1 : UInt; + static final F10 : UInt; + static final F11 : UInt; + static final F12 : UInt; + static final F13 : UInt; + static final F14 : UInt; + static final F15 : UInt; + static final F2 : UInt; + static final F3 : UInt; + static final F4 : UInt; + static final F5 : UInt; + static final F6 : UInt; + static final F7 : UInt; + static final F8 : UInt; + static final F9 : UInt; + @:require(flash10_2) static final FAST_FORWARD : UInt; + @:require(flash10_1) static final G : UInt; + @:require(flash10_2) static final GREEN : UInt; + @:require(flash10_2) static final GUIDE : UInt; + @:require(flash10_1) static final H : UInt; + @:require(flash10_2) static final HELP : UInt; + static final HOME : UInt; + @:require(flash10_1) static final I : UInt; + @:require(flash10_2) static final INFO : UInt; + @:require(flash10_2) static final INPUT : UInt; + static final INSERT : UInt; + @:require(flash10_1) static final J : UInt; + @:require(flash10_1) static final K : UInt; + @:require(flash10_1) static final KEYNAME_BEGIN : String; + @:require(flash10_1) static final KEYNAME_BREAK : String; + @:require(flash10_1) static final KEYNAME_CLEARDISPLAY : String; + @:require(flash10_1) static final KEYNAME_CLEARLINE : String; + @:require(flash10_1) static final KEYNAME_DELETE : String; + @:require(flash10_1) static final KEYNAME_DELETECHAR : String; + @:require(flash10_1) static final KEYNAME_DELETELINE : String; + @:require(flash10_1) static final KEYNAME_DOWNARROW : String; + @:require(flash10_1) static final KEYNAME_END : String; + @:require(flash10_1) static final KEYNAME_EXECUTE : String; + @:require(flash10_1) static final KEYNAME_F1 : String; + @:require(flash10_1) static final KEYNAME_F10 : String; + @:require(flash10_1) static final KEYNAME_F11 : String; + @:require(flash10_1) static final KEYNAME_F12 : String; + @:require(flash10_1) static final KEYNAME_F13 : String; + @:require(flash10_1) static final KEYNAME_F14 : String; + @:require(flash10_1) static final KEYNAME_F15 : String; + @:require(flash10_1) static final KEYNAME_F16 : String; + @:require(flash10_1) static final KEYNAME_F17 : String; + @:require(flash10_1) static final KEYNAME_F18 : String; + @:require(flash10_1) static final KEYNAME_F19 : String; + @:require(flash10_1) static final KEYNAME_F2 : String; + @:require(flash10_1) static final KEYNAME_F20 : String; + @:require(flash10_1) static final KEYNAME_F21 : String; + @:require(flash10_1) static final KEYNAME_F22 : String; + @:require(flash10_1) static final KEYNAME_F23 : String; + @:require(flash10_1) static final KEYNAME_F24 : String; + @:require(flash10_1) static final KEYNAME_F25 : String; + @:require(flash10_1) static final KEYNAME_F26 : String; + @:require(flash10_1) static final KEYNAME_F27 : String; + @:require(flash10_1) static final KEYNAME_F28 : String; + @:require(flash10_1) static final KEYNAME_F29 : String; + @:require(flash10_1) static final KEYNAME_F3 : String; + @:require(flash10_1) static final KEYNAME_F30 : String; + @:require(flash10_1) static final KEYNAME_F31 : String; + @:require(flash10_1) static final KEYNAME_F32 : String; + @:require(flash10_1) static final KEYNAME_F33 : String; + @:require(flash10_1) static final KEYNAME_F34 : String; + @:require(flash10_1) static final KEYNAME_F35 : String; + @:require(flash10_1) static final KEYNAME_F4 : String; + @:require(flash10_1) static final KEYNAME_F5 : String; + @:require(flash10_1) static final KEYNAME_F6 : String; + @:require(flash10_1) static final KEYNAME_F7 : String; + @:require(flash10_1) static final KEYNAME_F8 : String; + @:require(flash10_1) static final KEYNAME_F9 : String; + @:require(flash10_1) static final KEYNAME_FIND : String; + @:require(flash10_1) static final KEYNAME_HELP : String; + @:require(flash10_1) static final KEYNAME_HOME : String; + @:require(flash10_1) static final KEYNAME_INSERT : String; + @:require(flash10_1) static final KEYNAME_INSERTCHAR : String; + @:require(flash10_1) static final KEYNAME_INSERTLINE : String; + @:require(flash10_1) static final KEYNAME_LEFTARROW : String; + @:require(flash10_1) static final KEYNAME_MENU : String; + @:require(flash10_1) static final KEYNAME_MODESWITCH : String; + @:require(flash10_1) static final KEYNAME_NEXT : String; + @:require(flash10_1) static final KEYNAME_PAGEDOWN : String; + @:require(flash10_1) static final KEYNAME_PAGEUP : String; + @:require(flash10_1) static final KEYNAME_PAUSE : String; + static final KEYNAME_PLAYPAUSE : String; + @:require(flash10_1) static final KEYNAME_PREV : String; + @:require(flash10_1) static final KEYNAME_PRINT : String; + @:require(flash10_1) static final KEYNAME_PRINTSCREEN : String; + @:require(flash10_1) static final KEYNAME_REDO : String; + @:require(flash10_1) static final KEYNAME_RESET : String; + @:require(flash10_1) static final KEYNAME_RIGHTARROW : String; + @:require(flash10_1) static final KEYNAME_SCROLLLOCK : String; + @:require(flash10_1) static final KEYNAME_SELECT : String; + @:require(flash10_1) static final KEYNAME_STOP : String; + @:require(flash10_1) static final KEYNAME_SYSREQ : String; + @:require(flash10_1) static final KEYNAME_SYSTEM : String; + @:require(flash10_1) static final KEYNAME_UNDO : String; + @:require(flash10_1) static final KEYNAME_UPARROW : String; + @:require(flash10_1) static final KEYNAME_USER : String; + @:require(flash10_1) static final L : UInt; + @:require(flash10_2) static final LAST : UInt; + static final LEFT : UInt; + @:require(flash10_1) static final LEFTBRACKET : UInt; + @:require(flash10_2) static final LIVE : UInt; + @:require(flash10_1) static final M : UInt; + @:require(flash10_2) static final MASTER_SHELL : UInt; + @:require(flash10_2) static final MENU : UInt; + @:require(flash10_1) static final MINUS : UInt; + @:require(flash10_1) static final N : UInt; + @:require(flash10_2) static final NEXT : UInt; + @:require(flash10_1) static final NUMBER_0 : UInt; + @:require(flash10_1) static final NUMBER_1 : UInt; + @:require(flash10_1) static final NUMBER_2 : UInt; + @:require(flash10_1) static final NUMBER_3 : UInt; + @:require(flash10_1) static final NUMBER_4 : UInt; + @:require(flash10_1) static final NUMBER_5 : UInt; + @:require(flash10_1) static final NUMBER_6 : UInt; + @:require(flash10_1) static final NUMBER_7 : UInt; + @:require(flash10_1) static final NUMBER_8 : UInt; + @:require(flash10_1) static final NUMBER_9 : UInt; + @:require(flash10_1) static final NUMPAD : UInt; + static final NUMPAD_0 : UInt; + static final NUMPAD_1 : UInt; + static final NUMPAD_2 : UInt; + static final NUMPAD_3 : UInt; + static final NUMPAD_4 : UInt; + static final NUMPAD_5 : UInt; + static final NUMPAD_6 : UInt; + static final NUMPAD_7 : UInt; + static final NUMPAD_8 : UInt; + static final NUMPAD_9 : UInt; + static final NUMPAD_ADD : UInt; + static final NUMPAD_DECIMAL : UInt; + static final NUMPAD_DIVIDE : UInt; + static final NUMPAD_ENTER : UInt; + static final NUMPAD_MULTIPLY : UInt; + static final NUMPAD_SUBTRACT : UInt; + @:require(flash10_1) static final O : UInt; + @:require(flash10_1) static final P : UInt; + static final PAGE_DOWN : UInt; + static final PAGE_UP : UInt; + @:require(flash10_2) static final PAUSE : UInt; + @:require(flash10_1) static final PERIOD : UInt; + @:require(flash10_2) static final PLAY : UInt; + static final PLAY_PAUSE : UInt; + @:require(flash10_2) static final PREVIOUS : UInt; + @:require(flash10_1) static final Q : UInt; + @:require(flash10_1) static final QUOTE : UInt; + @:require(flash10_1) static final R : UInt; + @:require(flash10_2) static final RECORD : UInt; + @:require(flash10_2) static final RED : UInt; + @:require(flash10_2) static final REWIND : UInt; + static final RIGHT : UInt; + @:require(flash10_1) static final RIGHTBRACKET : UInt; + @:require(flash10_1) static final S : UInt; + @:require(flash10_2) static final SEARCH : UInt; + @:require(flash10_1) static final SEMICOLON : UInt; + @:require(flash10_2) static final SETUP : UInt; + static final SHIFT : UInt; + @:require(flash10_2) static final SKIP_BACKWARD : UInt; + @:require(flash10_2) static final SKIP_FORWARD : UInt; + @:require(flash10_1) static final SLASH : UInt; + static final SPACE : UInt; + @:require(flash10_2) static final STOP : UInt; + @:require(flash10_1) static final STRING_BEGIN : String; + @:require(flash10_1) static final STRING_BREAK : String; + @:require(flash10_1) static final STRING_CLEARDISPLAY : String; + @:require(flash10_1) static final STRING_CLEARLINE : String; + @:require(flash10_1) static final STRING_DELETE : String; + @:require(flash10_1) static final STRING_DELETECHAR : String; + @:require(flash10_1) static final STRING_DELETELINE : String; + @:require(flash10_1) static final STRING_DOWNARROW : String; + @:require(flash10_1) static final STRING_END : String; + @:require(flash10_1) static final STRING_EXECUTE : String; + @:require(flash10_1) static final STRING_F1 : String; + @:require(flash10_1) static final STRING_F10 : String; + @:require(flash10_1) static final STRING_F11 : String; + @:require(flash10_1) static final STRING_F12 : String; + @:require(flash10_1) static final STRING_F13 : String; + @:require(flash10_1) static final STRING_F14 : String; + @:require(flash10_1) static final STRING_F15 : String; + @:require(flash10_1) static final STRING_F16 : String; + @:require(flash10_1) static final STRING_F17 : String; + @:require(flash10_1) static final STRING_F18 : String; + @:require(flash10_1) static final STRING_F19 : String; + @:require(flash10_1) static final STRING_F2 : String; + @:require(flash10_1) static final STRING_F20 : String; + @:require(flash10_1) static final STRING_F21 : String; + @:require(flash10_1) static final STRING_F22 : String; + @:require(flash10_1) static final STRING_F23 : String; + @:require(flash10_1) static final STRING_F24 : String; + @:require(flash10_1) static final STRING_F25 : String; + @:require(flash10_1) static final STRING_F26 : String; + @:require(flash10_1) static final STRING_F27 : String; + @:require(flash10_1) static final STRING_F28 : String; + @:require(flash10_1) static final STRING_F29 : String; + @:require(flash10_1) static final STRING_F3 : String; + @:require(flash10_1) static final STRING_F30 : String; + @:require(flash10_1) static final STRING_F31 : String; + @:require(flash10_1) static final STRING_F32 : String; + @:require(flash10_1) static final STRING_F33 : String; + @:require(flash10_1) static final STRING_F34 : String; + @:require(flash10_1) static final STRING_F35 : String; + @:require(flash10_1) static final STRING_F4 : String; + @:require(flash10_1) static final STRING_F5 : String; + @:require(flash10_1) static final STRING_F6 : String; + @:require(flash10_1) static final STRING_F7 : String; + @:require(flash10_1) static final STRING_F8 : String; + @:require(flash10_1) static final STRING_F9 : String; + @:require(flash10_1) static final STRING_FIND : String; + @:require(flash10_1) static final STRING_HELP : String; + @:require(flash10_1) static final STRING_HOME : String; + @:require(flash10_1) static final STRING_INSERT : String; + @:require(flash10_1) static final STRING_INSERTCHAR : String; + @:require(flash10_1) static final STRING_INSERTLINE : String; + @:require(flash10_1) static final STRING_LEFTARROW : String; + @:require(flash10_1) static final STRING_MENU : String; + @:require(flash10_1) static final STRING_MODESWITCH : String; + @:require(flash10_1) static final STRING_NEXT : String; + @:require(flash10_1) static final STRING_PAGEDOWN : String; + @:require(flash10_1) static final STRING_PAGEUP : String; + @:require(flash10_1) static final STRING_PAUSE : String; + @:require(flash10_1) static final STRING_PREV : String; + @:require(flash10_1) static final STRING_PRINT : String; + @:require(flash10_1) static final STRING_PRINTSCREEN : String; + @:require(flash10_1) static final STRING_REDO : String; + @:require(flash10_1) static final STRING_RESET : String; + @:require(flash10_1) static final STRING_RIGHTARROW : String; + @:require(flash10_1) static final STRING_SCROLLLOCK : String; + @:require(flash10_1) static final STRING_SELECT : String; + @:require(flash10_1) static final STRING_STOP : String; + @:require(flash10_1) static final STRING_SYSREQ : String; + @:require(flash10_1) static final STRING_SYSTEM : String; + @:require(flash10_1) static final STRING_UNDO : String; + @:require(flash10_1) static final STRING_UPARROW : String; + @:require(flash10_1) static final STRING_USER : String; + @:require(flash10_2) static final SUBTITLE : UInt; + @:require(flash10_1) static final T : UInt; + static final TAB : UInt; + @:require(flash10_1) static final U : UInt; + static final UP : UInt; + @:require(flash10_1) static final V : UInt; + @:require(flash10_2) static final VOD : UInt; + @:require(flash10_1) static final W : UInt; + @:require(flash10_1) static final X : UInt; + @:require(flash10_1) static final Y : UInt; + @:require(flash10_2) static final YELLOW : UInt; + @:require(flash10_1) static final Z : UInt; + @:flash.property static var capsLock(get,never) : Bool; + @:flash.property @:require(flash10_1) static var hasVirtualKeyboard(get,never) : Bool; + @:flash.property static var numLock(get,never) : Bool; + @:flash.property @:require(flash10_1) static var physicalKeyboardType(get,never) : KeyboardType; + private static function get_capsLock() : Bool; + private static function get_hasVirtualKeyboard() : Bool; + private static function get_numLock() : Bool; + private static function get_physicalKeyboardType() : KeyboardType; + static function isAccessible() : Bool; +} diff --git a/build/linux64_569e52e/std/flash/ui/KeyboardType.hx b/build/linux64_569e52e/std/flash/ui/KeyboardType.hx new file mode 100644 index 0000000..f2a589a --- /dev/null +++ b/build/linux64_569e52e/std/flash/ui/KeyboardType.hx @@ -0,0 +1,7 @@ +package flash.ui; + +@:native("flash.ui.KeyboardType") extern enum abstract KeyboardType(String) { + var ALPHANUMERIC; + var KEYPAD; + var NONE; +} diff --git a/build/linux64_569e52e/std/flash/ui/Mouse.hx b/build/linux64_569e52e/std/flash/ui/Mouse.hx new file mode 100644 index 0000000..93cd0e8 --- /dev/null +++ b/build/linux64_569e52e/std/flash/ui/Mouse.hx @@ -0,0 +1,15 @@ +package flash.ui; + +extern class Mouse { + @:flash.property @:require(flash10) static var cursor(get,set) : Dynamic; + @:flash.property @:require(flash10_1) static var supportsCursor(get,never) : Bool; + @:flash.property @:require(flash10_2) static var supportsNativeCursor(get,never) : Bool; + private static function get_cursor() : Dynamic; + private static function get_supportsCursor() : Bool; + private static function get_supportsNativeCursor() : Bool; + static function hide() : Void; + @:require(flash10_2) static function registerCursor(name : String, cursor : MouseCursorData) : Void; + private static function set_cursor(value : Dynamic) : Dynamic; + static function show() : Void; + @:require(flash10_2) static function unregisterCursor(name : String) : Void; +} diff --git a/build/linux64_569e52e/std/flash/ui/MouseCursor.hx b/build/linux64_569e52e/std/flash/ui/MouseCursor.hx new file mode 100644 index 0000000..93bd0cc --- /dev/null +++ b/build/linux64_569e52e/std/flash/ui/MouseCursor.hx @@ -0,0 +1,9 @@ +package flash.ui; + +extern class MouseCursor { + static final ARROW : String; + static final AUTO : String; + static final BUTTON : String; + static final HAND : String; + static final IBEAM : String; +} diff --git a/build/linux64_569e52e/std/flash/ui/MouseCursorData.hx b/build/linux64_569e52e/std/flash/ui/MouseCursorData.hx new file mode 100644 index 0000000..93f4db8 --- /dev/null +++ b/build/linux64_569e52e/std/flash/ui/MouseCursorData.hx @@ -0,0 +1,14 @@ +package flash.ui; + +@:require(flash10_2) extern final class MouseCursorData { + @:flash.property var data(get,set) : flash.Vector; + @:flash.property var frameRate(get,set) : Float; + @:flash.property var hotSpot(get,set) : flash.geom.Point; + function new() : Void; + private function get_data() : flash.Vector; + private function get_frameRate() : Float; + private function get_hotSpot() : flash.geom.Point; + private function set_data(value : flash.Vector) : flash.Vector; + private function set_frameRate(value : Float) : Float; + private function set_hotSpot(value : flash.geom.Point) : flash.geom.Point; +} diff --git a/build/linux64_569e52e/std/flash/ui/Multitouch.hx b/build/linux64_569e52e/std/flash/ui/Multitouch.hx new file mode 100644 index 0000000..6cfa29f --- /dev/null +++ b/build/linux64_569e52e/std/flash/ui/Multitouch.hx @@ -0,0 +1,18 @@ +package flash.ui; + +@:require(flash10_1) extern class Multitouch { + @:flash.property static var inputMode(get,set) : MultitouchInputMode; + @:flash.property static var mapTouchToMouse(get,set) : Bool; + @:flash.property static var maxTouchPoints(get,never) : Int; + @:flash.property static var supportedGestures(get,never) : flash.Vector; + @:flash.property static var supportsGestureEvents(get,never) : Bool; + @:flash.property static var supportsTouchEvents(get,never) : Bool; + private static function get_inputMode() : MultitouchInputMode; + private static function get_mapTouchToMouse() : Bool; + private static function get_maxTouchPoints() : Int; + private static function get_supportedGestures() : flash.Vector; + private static function get_supportsGestureEvents() : Bool; + private static function get_supportsTouchEvents() : Bool; + private static function set_inputMode(value : MultitouchInputMode) : MultitouchInputMode; + private static function set_mapTouchToMouse(value : Bool) : Bool; +} diff --git a/build/linux64_569e52e/std/flash/ui/MultitouchInputMode.hx b/build/linux64_569e52e/std/flash/ui/MultitouchInputMode.hx new file mode 100644 index 0000000..29cdf52 --- /dev/null +++ b/build/linux64_569e52e/std/flash/ui/MultitouchInputMode.hx @@ -0,0 +1,7 @@ +package flash.ui; + +@:native("flash.ui.MultitouchInputMode") @:require(flash10_1) extern enum abstract MultitouchInputMode(String) { + var GESTURE; + var NONE; + var TOUCH_POINT; +} diff --git a/build/linux64_569e52e/std/flash/utils/ByteArray.hx b/build/linux64_569e52e/std/flash/utils/ByteArray.hx new file mode 100644 index 0000000..866b611 --- /dev/null +++ b/build/linux64_569e52e/std/flash/utils/ByteArray.hx @@ -0,0 +1,59 @@ +package flash.utils; + +extern class ByteArray implements IDataOutput2 implements IDataInput2 implements ArrayAccess { + @:flash.property var bytesAvailable(get,never) : UInt; + @:flash.property var endian(get,set) : Endian; + @:flash.property var length(get,set) : UInt; + @:flash.property var objectEncoding(get,set) : UInt; + @:flash.property var position(get,set) : UInt; + @:flash.property @:require(flash11_4) var shareable(get,set) : Bool; + function new() : Void; + @:require(flash11_4) function atomicCompareAndSwapIntAt(byteIndex : Int, expectedValue : Int, newValue : Int) : Int; + @:require(flash11_4) function atomicCompareAndSwapLength(expectedLength : Int, newLength : Int) : Int; + @:require(flash10) function clear() : Void; + function compress(?algorithm : CompressionAlgorithm) : Void; + @:require(flash10) function deflate() : Void; + private function get_bytesAvailable() : UInt; + private function get_endian() : Endian; + private function get_length() : UInt; + private function get_objectEncoding() : UInt; + private function get_position() : UInt; + private function get_shareable() : Bool; + @:require(flash10) function inflate() : Void; + function readBoolean() : Bool; + function readByte() : Int; + function readBytes(bytes : ByteArray, offset : UInt = 0, length : UInt = 0) : Void; + function readDouble() : Float; + function readFloat() : Float; + function readInt() : Int; + function readMultiByte(length : UInt, charSet : String) : String; + function readObject() : Dynamic; + function readShort() : Int; + function readUTF() : String; + function readUTFBytes(length : UInt) : String; + function readUnsignedByte() : UInt; + function readUnsignedInt() : UInt; + function readUnsignedShort() : UInt; + private function set_endian(value : Endian) : Endian; + private function set_length(value : UInt) : UInt; + private function set_objectEncoding(value : UInt) : UInt; + private function set_position(value : UInt) : UInt; + private function set_shareable(value : Bool) : Bool; + function toString() : String; + function uncompress(?algorithm : CompressionAlgorithm) : Void; + function writeBoolean(value : Bool) : Void; + function writeByte(value : Int) : Void; + function writeBytes(bytes : ByteArray, offset : UInt = 0, length : UInt = 0) : Void; + function writeDouble(value : Float) : Void; + function writeFloat(value : Float) : Void; + function writeInt(value : Int) : Void; + function writeMultiByte(value : String, charSet : String) : Void; + function writeObject(object : Dynamic) : Void; + function writeShort(value : Int) : Void; + function writeUTF(value : String) : Void; + function writeUTFBytes(value : String) : Void; + function writeUnsignedInt(value : UInt) : Void; + @:flash.property static var defaultObjectEncoding(get,set) : UInt; + private static function get_defaultObjectEncoding() : UInt; + private static function set_defaultObjectEncoding(value : UInt) : UInt; +} diff --git a/build/linux64_569e52e/std/flash/utils/CompressionAlgorithm.hx b/build/linux64_569e52e/std/flash/utils/CompressionAlgorithm.hx new file mode 100644 index 0000000..b2057a7 --- /dev/null +++ b/build/linux64_569e52e/std/flash/utils/CompressionAlgorithm.hx @@ -0,0 +1,7 @@ +package flash.utils; + +@:native("flash.utils.CompressionAlgorithm") @:require(flash11) extern enum abstract CompressionAlgorithm(String) { + var DEFLATE; + var LZMA; + var ZLIB; +} diff --git a/build/linux64_569e52e/std/flash/utils/Dictionary.hx b/build/linux64_569e52e/std/flash/utils/Dictionary.hx new file mode 100644 index 0000000..0082839 --- /dev/null +++ b/build/linux64_569e52e/std/flash/utils/Dictionary.hx @@ -0,0 +1,5 @@ +package flash.utils; + +extern class Dictionary implements ArrayAccess { + function new(weakKeys : Bool = false) : Void; +} diff --git a/build/linux64_569e52e/std/flash/utils/Endian.hx b/build/linux64_569e52e/std/flash/utils/Endian.hx new file mode 100644 index 0000000..9378bc4 --- /dev/null +++ b/build/linux64_569e52e/std/flash/utils/Endian.hx @@ -0,0 +1,6 @@ +package flash.utils; + +@:native("flash.utils.Endian") extern enum abstract Endian(String) { + var BIG_ENDIAN; + var LITTLE_ENDIAN; +} diff --git a/build/linux64_569e52e/std/flash/utils/Function.hx b/build/linux64_569e52e/std/flash/utils/Function.hx new file mode 100644 index 0000000..96b2d6d --- /dev/null +++ b/build/linux64_569e52e/std/flash/utils/Function.hx @@ -0,0 +1,3 @@ +package flash.utils; + +typedef Function = Dynamic diff --git a/build/linux64_569e52e/std/flash/utils/IDataInput.hx b/build/linux64_569e52e/std/flash/utils/IDataInput.hx new file mode 100644 index 0000000..e60c2c3 --- /dev/null +++ b/build/linux64_569e52e/std/flash/utils/IDataInput.hx @@ -0,0 +1,26 @@ +package flash.utils; + +extern interface IDataInput { + @:flash.property var bytesAvailable(get,never) : UInt; + @:flash.property var endian(get,set) : Endian; + @:flash.property var objectEncoding(get,set) : UInt; + private function get_bytesAvailable() : UInt; + private function get_endian() : Endian; + private function get_objectEncoding() : UInt; + function readBoolean() : Bool; + function readByte() : Int; + function readBytes(bytes : ByteArray, offset : UInt = 0, length : UInt = 0) : Void; + function readDouble() : Float; + function readFloat() : Float; + function readInt() : Int; + function readMultiByte(length : UInt, charSet : String) : String; + function readObject() : Dynamic; + function readShort() : Int; + function readUTF() : String; + function readUTFBytes(length : UInt) : String; + function readUnsignedByte() : UInt; + function readUnsignedInt() : UInt; + function readUnsignedShort() : UInt; + private function set_endian(value : Endian) : Endian; + private function set_objectEncoding(value : UInt) : UInt; +} diff --git a/build/linux64_569e52e/std/flash/utils/IDataInput2.hx b/build/linux64_569e52e/std/flash/utils/IDataInput2.hx new file mode 100644 index 0000000..6ed0d72 --- /dev/null +++ b/build/linux64_569e52e/std/flash/utils/IDataInput2.hx @@ -0,0 +1,4 @@ +package flash.utils; + +extern interface IDataInput2 extends IDataInput { +} diff --git a/build/linux64_569e52e/std/flash/utils/IDataOutput.hx b/build/linux64_569e52e/std/flash/utils/IDataOutput.hx new file mode 100644 index 0000000..c5db432 --- /dev/null +++ b/build/linux64_569e52e/std/flash/utils/IDataOutput.hx @@ -0,0 +1,22 @@ +package flash.utils; + +extern interface IDataOutput { + @:flash.property var endian(get,set) : Endian; + @:flash.property var objectEncoding(get,set) : UInt; + private function get_endian() : Endian; + private function get_objectEncoding() : UInt; + private function set_endian(value : Endian) : Endian; + private function set_objectEncoding(value : UInt) : UInt; + function writeBoolean(value : Bool) : Void; + function writeByte(value : Int) : Void; + function writeBytes(bytes : ByteArray, offset : UInt = 0, length : UInt = 0) : Void; + function writeDouble(value : Float) : Void; + function writeFloat(value : Float) : Void; + function writeInt(value : Int) : Void; + function writeMultiByte(value : String, charSet : String) : Void; + function writeObject(object : Dynamic) : Void; + function writeShort(value : Int) : Void; + function writeUTF(value : String) : Void; + function writeUTFBytes(value : String) : Void; + function writeUnsignedInt(value : UInt) : Void; +} diff --git a/build/linux64_569e52e/std/flash/utils/IDataOutput2.hx b/build/linux64_569e52e/std/flash/utils/IDataOutput2.hx new file mode 100644 index 0000000..fa9e9c2 --- /dev/null +++ b/build/linux64_569e52e/std/flash/utils/IDataOutput2.hx @@ -0,0 +1,4 @@ +package flash.utils; + +extern interface IDataOutput2 extends IDataOutput { +} diff --git a/build/linux64_569e52e/std/flash/utils/IExternalizable.hx b/build/linux64_569e52e/std/flash/utils/IExternalizable.hx new file mode 100644 index 0000000..6df4a21 --- /dev/null +++ b/build/linux64_569e52e/std/flash/utils/IExternalizable.hx @@ -0,0 +1,6 @@ +package flash.utils; + +extern interface IExternalizable { + function readExternal(input : IDataInput) : Void; + function writeExternal(output : IDataOutput) : Void; +} diff --git a/build/linux64_569e52e/std/flash/utils/JSON.hx b/build/linux64_569e52e/std/flash/utils/JSON.hx new file mode 100644 index 0000000..5354306 --- /dev/null +++ b/build/linux64_569e52e/std/flash/utils/JSON.hx @@ -0,0 +1,6 @@ +package flash.utils; + +@:native("JSON") @:require(flash11) extern class JSON { + static function parse(text : String, ?reviver : Dynamic) : Dynamic; + static function stringify(value : Dynamic, ?replacer : Dynamic, ?space : Dynamic) : String; +} diff --git a/build/linux64_569e52e/std/flash/utils/Namespace.hx b/build/linux64_569e52e/std/flash/utils/Namespace.hx new file mode 100644 index 0000000..ea08b67 --- /dev/null +++ b/build/linux64_569e52e/std/flash/utils/Namespace.hx @@ -0,0 +1,9 @@ +package flash.utils; + +extern final class Namespace { + @:flash.property var prefix(get,never) : Dynamic; + @:flash.property var uri(get,never) : String; + function new(?prefix : Dynamic, ?uri : Dynamic) : Void; + private function get_prefix() : Dynamic; + private function get_uri() : String; +} diff --git a/build/linux64_569e52e/std/flash/utils/Object.hx b/build/linux64_569e52e/std/flash/utils/Object.hx new file mode 100644 index 0000000..94f153c --- /dev/null +++ b/build/linux64_569e52e/std/flash/utils/Object.hx @@ -0,0 +1,4 @@ +package flash.utils; + +@:coreType @:runtimeValue +abstract Object from Dynamic to Dynamic {} diff --git a/build/linux64_569e52e/std/flash/utils/ObjectInput.hx b/build/linux64_569e52e/std/flash/utils/ObjectInput.hx new file mode 100644 index 0000000..b2620be --- /dev/null +++ b/build/linux64_569e52e/std/flash/utils/ObjectInput.hx @@ -0,0 +1,27 @@ +package flash.utils; + +extern class ObjectInput implements IDataInput { + @:flash.property var bytesAvailable(get,never) : UInt; + @:flash.property var endian(get,set) : Endian; + @:flash.property var objectEncoding(get,set) : UInt; + function new() : Void; + private function get_bytesAvailable() : UInt; + private function get_endian() : Endian; + private function get_objectEncoding() : UInt; + function readBoolean() : Bool; + function readByte() : Int; + function readBytes(bytes : ByteArray, offset : UInt = 0, length : UInt = 0) : Void; + function readDouble() : Float; + function readFloat() : Float; + function readInt() : Int; + function readMultiByte(length : UInt, charSet : String) : String; + function readObject() : Dynamic; + function readShort() : Int; + function readUTF() : String; + function readUTFBytes(length : UInt) : String; + function readUnsignedByte() : UInt; + function readUnsignedInt() : UInt; + function readUnsignedShort() : UInt; + private function set_endian(value : Endian) : Endian; + private function set_objectEncoding(value : UInt) : UInt; +} diff --git a/build/linux64_569e52e/std/flash/utils/ObjectOutput.hx b/build/linux64_569e52e/std/flash/utils/ObjectOutput.hx new file mode 100644 index 0000000..4e85645 --- /dev/null +++ b/build/linux64_569e52e/std/flash/utils/ObjectOutput.hx @@ -0,0 +1,23 @@ +package flash.utils; + +extern class ObjectOutput implements IDataOutput { + @:flash.property var endian(get,set) : Endian; + @:flash.property var objectEncoding(get,set) : UInt; + function new() : Void; + private function get_endian() : Endian; + private function get_objectEncoding() : UInt; + private function set_endian(value : Endian) : Endian; + private function set_objectEncoding(value : UInt) : UInt; + function writeBoolean(value : Bool) : Void; + function writeByte(value : Int) : Void; + function writeBytes(bytes : ByteArray, offset : UInt = 0, length : UInt = 0) : Void; + function writeDouble(value : Float) : Void; + function writeFloat(value : Float) : Void; + function writeInt(value : Int) : Void; + function writeMultiByte(value : String, charSet : String) : Void; + function writeObject(object : Dynamic) : Void; + function writeShort(value : Int) : Void; + function writeUTF(value : String) : Void; + function writeUTFBytes(value : String) : Void; + function writeUnsignedInt(value : UInt) : Void; +} diff --git a/build/linux64_569e52e/std/flash/utils/Proxy.hx b/build/linux64_569e52e/std/flash/utils/Proxy.hx new file mode 100644 index 0000000..0cddd76 --- /dev/null +++ b/build/linux64_569e52e/std/flash/utils/Proxy.hx @@ -0,0 +1,15 @@ +package flash.utils; + +extern class Proxy { + function new() : Void; + @:ns("http://www.adobe.com/2006/actionscript/flash/proxy") function callProperty(name : Dynamic, restArgs : haxe.extern.Rest) : Dynamic; + @:ns("http://www.adobe.com/2006/actionscript/flash/proxy") function deleteProperty(name : Dynamic) : Bool; + @:ns("http://www.adobe.com/2006/actionscript/flash/proxy") function getDescendants(name : Dynamic) : Dynamic; + @:ns("http://www.adobe.com/2006/actionscript/flash/proxy") function getProperty(name : Dynamic) : Dynamic; + @:ns("http://www.adobe.com/2006/actionscript/flash/proxy") function hasProperty(name : Dynamic) : Bool; + @:ns("http://www.adobe.com/2006/actionscript/flash/proxy") function isAttribute(name : Dynamic) : Bool; + @:ns("http://www.adobe.com/2006/actionscript/flash/proxy") function nextName(index : Int) : String; + @:ns("http://www.adobe.com/2006/actionscript/flash/proxy") function nextNameIndex(index : Int) : Int; + @:ns("http://www.adobe.com/2006/actionscript/flash/proxy") function nextValue(index : Int) : Dynamic; + @:ns("http://www.adobe.com/2006/actionscript/flash/proxy") function setProperty(name : Dynamic, value : Dynamic) : Void; +} diff --git a/build/linux64_569e52e/std/flash/utils/QName.hx b/build/linux64_569e52e/std/flash/utils/QName.hx new file mode 100644 index 0000000..1ceb4bb --- /dev/null +++ b/build/linux64_569e52e/std/flash/utils/QName.hx @@ -0,0 +1,9 @@ +package flash.utils; + +extern final class QName { + @:flash.property var localName(get,never) : String; + @:flash.property var uri(get,never) : Dynamic; + function new(?namespace : Dynamic, ?name : Dynamic) : Void; + private function get_localName() : String; + private function get_uri() : Dynamic; +} diff --git a/build/linux64_569e52e/std/flash/utils/RegExp.hx b/build/linux64_569e52e/std/flash/utils/RegExp.hx new file mode 100644 index 0000000..fc20310 --- /dev/null +++ b/build/linux64_569e52e/std/flash/utils/RegExp.hx @@ -0,0 +1,22 @@ +package flash.utils; + +@:realPath("flash.utils.RegExp") @:native("RegExp") extern class RegExp implements Dynamic { + @:flash.property var dotall(get,never) : Bool; + @:flash.property var extended(get,never) : Bool; + @:flash.property var global(get,never) : Bool; + @:flash.property var ignoreCase(get,never) : Bool; + @:flash.property var lastIndex(get,set) : Int; + @:flash.property var multiline(get,never) : Bool; + @:flash.property var source(get,never) : String; + function new(?pattern : Dynamic, ?options : Dynamic) : Void; + @:ns("http://adobe.com/AS3/2006/builtin") function exec(?s : String) : Dynamic; + private function get_dotall() : Bool; + private function get_extended() : Bool; + private function get_global() : Bool; + private function get_ignoreCase() : Bool; + private function get_lastIndex() : Int; + private function get_multiline() : Bool; + private function get_source() : String; + private function set_lastIndex(value : Int) : Int; + @:ns("http://adobe.com/AS3/2006/builtin") function test(?s : String) : Bool; +} diff --git a/build/linux64_569e52e/std/flash/utils/SetIntervalTimer.hx b/build/linux64_569e52e/std/flash/utils/SetIntervalTimer.hx new file mode 100644 index 0000000..1c0c589 --- /dev/null +++ b/build/linux64_569e52e/std/flash/utils/SetIntervalTimer.hx @@ -0,0 +1,7 @@ +package flash.utils; + +extern final class SetIntervalTimer extends Timer { + @:ns("flash.utils",internal) var id : UInt; + function new(closure : Dynamic, delay : Float, repeats : Bool, rest : Array) : Void; + @:ns("flash.utils",internal) static function clearInterval(id_to_clear : UInt) : Void; +} diff --git a/build/linux64_569e52e/std/flash/utils/Telemetry.hx b/build/linux64_569e52e/std/flash/utils/Telemetry.hx new file mode 100644 index 0000000..7d2c943 --- /dev/null +++ b/build/linux64_569e52e/std/flash/utils/Telemetry.hx @@ -0,0 +1,10 @@ +package flash.utils; + +@:require(flash11_4) @:native("flash.profiler.Telemetry") extern class Telemetry extends flash.events.EventDispatcher { + static var connected(default,null) : Bool; + static var spanMarker(default,null) : Float; + static function registerCommandHandler(commandName : String, handler : Dynamic) : Bool; + static function unregisterCommandHandler(commandName : String) : Bool; + static function sendMetric(metric : String, value : Dynamic) : Void; + static function sendSpanMetric(metric : String, startMarker : Float) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/flash/utils/Timer.hx b/build/linux64_569e52e/std/flash/utils/Timer.hx new file mode 100644 index 0000000..9e5029a --- /dev/null +++ b/build/linux64_569e52e/std/flash/utils/Timer.hx @@ -0,0 +1,18 @@ +package flash.utils; + +extern class Timer extends flash.events.EventDispatcher { + @:flash.property var currentCount(get,never) : Int; + @:flash.property var delay(get,set) : Float; + @:flash.property var repeatCount(get,set) : Int; + @:flash.property var running(get,never) : Bool; + function new(delay : Float, repeatCount : Int = 0) : Void; + private function get_currentCount() : Int; + private function get_delay() : Float; + private function get_repeatCount() : Int; + private function get_running() : Bool; + function reset() : Void; + private function set_delay(value : Float) : Float; + private function set_repeatCount(value : Int) : Int; + function start() : Void; + function stop() : Void; +} diff --git a/build/linux64_569e52e/std/flash/xml/XML.hx b/build/linux64_569e52e/std/flash/xml/XML.hx new file mode 100644 index 0000000..2ba80c2 --- /dev/null +++ b/build/linux64_569e52e/std/flash/xml/XML.hx @@ -0,0 +1,63 @@ +package flash.xml; + +extern final class XML implements Dynamic { + function new(?value : Dynamic) : Void; + function addNamespace(ns : Dynamic) : XML; + function appendChild(child : Dynamic) : XML; + function attribute(arg : Dynamic) : XMLList; + function attributes() : XMLList; + function child(propertyName : Dynamic) : XMLList; + function childIndex() : Int; + function children() : XMLList; + function comments() : XMLList; + function contains(value : Dynamic) : Bool; + function copy() : XML; + function descendants(?name : Dynamic) : XMLList; + function elements(?name : Dynamic) : XMLList; + function hasComplexContent() : Bool; + function hasSimpleContent() : Bool; + function inScopeNamespaces() : Array; + function insertChildAfter(child1 : Dynamic, child2 : Dynamic) : Dynamic; + function insertChildBefore(child1 : Dynamic, child2 : Dynamic) : Dynamic; + function length() : Int; + function localName() : flash.utils.Object; + function name() : flash.utils.Object; + function namespace(?prefix : Dynamic) : flash.utils.Namespace; + function namespaceDeclarations() : Array; + function nodeKind() : String; + function normalize() : XML; + function notification() : flash.utils.Function; + function parent() : XML; + function prependChild(value : Dynamic) : XML; + function processingInstructions(?name : Dynamic) : XMLList; + function removeNamespace(ns : Dynamic) : XML; + function replace(propertyName : Dynamic, value : Dynamic) : XML; + function setChildren(value : Dynamic) : XML; + function setLocalName(name : Dynamic) : Void; + function setName(name : Dynamic) : Void; + function setNamespace(ns : Dynamic) : Void; + function setNotification(f : flash.utils.Function) : Dynamic; + function text() : XMLList; + @:require(flash11) function toJSON(k : String) : Dynamic; + function toString() : String; + function toXMLString() : String; + function valueOf() : XML; + @:flash.property static var ignoreComments(get,set) : Bool; + @:flash.property static var ignoreProcessingInstructions(get,set) : Bool; + @:flash.property static var ignoreWhitespace(get,set) : Bool; + @:flash.property static var prettyIndent(get,set) : Int; + @:flash.property static var prettyPrinting(get,set) : Bool; + static function defaultSettings() : Dynamic; + private static function get_ignoreComments() : Bool; + private static function get_ignoreProcessingInstructions() : Bool; + private static function get_ignoreWhitespace() : Bool; + private static function get_prettyIndent() : Int; + private static function get_prettyPrinting() : Bool; + static function setSettings(?o : Dynamic) : Void; + private static function set_ignoreComments(value : Bool) : Bool; + private static function set_ignoreProcessingInstructions(value : Bool) : Bool; + private static function set_ignoreWhitespace(value : Bool) : Bool; + private static function set_prettyIndent(value : Int) : Int; + private static function set_prettyPrinting(value : Bool) : Bool; + static function settings() : Dynamic; +} diff --git a/build/linux64_569e52e/std/flash/xml/XMLDocument.hx b/build/linux64_569e52e/std/flash/xml/XMLDocument.hx new file mode 100644 index 0000000..3d4a174 --- /dev/null +++ b/build/linux64_569e52e/std/flash/xml/XMLDocument.hx @@ -0,0 +1,12 @@ +package flash.xml; + +extern class XMLDocument extends XMLNode { + var docTypeDecl : Dynamic; + var idMap : Dynamic; + var ignoreWhite : Bool; + var xmlDecl : Dynamic; + function new(?source : String) : Void; + function createElement(name : String) : XMLNode; + function createTextNode(text : String) : XMLNode; + function parseXML(source : String) : Void; +} diff --git a/build/linux64_569e52e/std/flash/xml/XMLList.hx b/build/linux64_569e52e/std/flash/xml/XMLList.hx new file mode 100644 index 0000000..d46b83a --- /dev/null +++ b/build/linux64_569e52e/std/flash/xml/XMLList.hx @@ -0,0 +1,43 @@ +package flash.xml; + +extern final class XMLList implements ArrayAccess { + function new(?value : Dynamic) : Void; + function addNamespace(ns : Dynamic) : XML; + function appendChild(child : Dynamic) : XML; + function attribute(arg : Dynamic) : XMLList; + function attributes() : XMLList; + function child(propertyName : Dynamic) : XMLList; + function childIndex() : Int; + function children() : XMLList; + function comments() : XMLList; + function contains(value : Dynamic) : Bool; + function copy() : XMLList; + function descendants(?name : Dynamic) : XMLList; + function elements(?name : Dynamic) : XMLList; + function hasComplexContent() : Bool; + function hasSimpleContent() : Bool; + function inScopeNamespaces() : Array; + function insertChildAfter(child1 : Dynamic, child2 : Dynamic) : Dynamic; + function insertChildBefore(child1 : Dynamic, child2 : Dynamic) : Dynamic; + function length() : Int; + function localName() : flash.utils.Object; + function name() : flash.utils.Object; + function namespace(?prefix : Dynamic) : flash.utils.Namespace; + function namespaceDeclarations() : Array; + function nodeKind() : String; + function normalize() : XMLList; + function parent() : XML; + function prependChild(value : Dynamic) : XML; + function processingInstructions(?name : Dynamic) : XMLList; + function removeNamespace(ns : Dynamic) : XML; + function replace(propertyName : Dynamic, value : Dynamic) : XML; + function setChildren(value : Dynamic) : XML; + function setLocalName(name : Dynamic) : Void; + function setName(name : Dynamic) : Void; + function setNamespace(ns : Dynamic) : Void; + function text() : XMLList; + @:require(flash11) function toJSON(k : String) : Dynamic; + function toString() : String; + function toXMLString() : String; + function valueOf() : XMLList; +} diff --git a/build/linux64_569e52e/std/flash/xml/XMLNode.hx b/build/linux64_569e52e/std/flash/xml/XMLNode.hx new file mode 100644 index 0000000..9ba371d --- /dev/null +++ b/build/linux64_569e52e/std/flash/xml/XMLNode.hx @@ -0,0 +1,32 @@ +package flash.xml; + +extern class XMLNode { + @:flash.property var attributes(get,set) : Dynamic; + @:flash.property var childNodes(get,never) : Array; + var firstChild : XMLNode; + var lastChild : XMLNode; + @:flash.property var localName(get,never) : String; + @:flash.property var namespaceURI(get,never) : String; + var nextSibling : XMLNode; + var nodeName : String; + var nodeType : XMLNodeType; + var nodeValue : String; + var parentNode : XMLNode; + @:flash.property var prefix(get,never) : String; + var previousSibling : XMLNode; + function new(type : XMLNodeType, value : String) : Void; + function appendChild(node : XMLNode) : Void; + function cloneNode(deep : Bool) : XMLNode; + function getNamespaceForPrefix(prefix : String) : String; + function getPrefixForNamespace(ns : String) : String; + private function get_attributes() : Dynamic; + private function get_childNodes() : Array; + private function get_localName() : String; + private function get_namespaceURI() : String; + private function get_prefix() : String; + function hasChildNodes() : Bool; + function insertBefore(node : XMLNode, before : XMLNode) : Void; + function removeNode() : Void; + private function set_attributes(value : Dynamic) : Dynamic; + function toString() : String; +} diff --git a/build/linux64_569e52e/std/flash/xml/XMLNodeType.hx b/build/linux64_569e52e/std/flash/xml/XMLNodeType.hx new file mode 100644 index 0000000..36f75cb --- /dev/null +++ b/build/linux64_569e52e/std/flash/xml/XMLNodeType.hx @@ -0,0 +1,11 @@ +package flash.xml; + +@:native("flash.xml.XMLNodeType") extern enum abstract XMLNodeType(UInt) { + var CDATA_NODE; + var COMMENT_NODE; + var DOCUMENT_TYPE_NODE; + var ELEMENT_NODE; + var PROCESSING_INSTRUCTION_NODE; + var TEXT_NODE; + var XML_DECLARATION; +} diff --git a/build/linux64_569e52e/std/flash/xml/XMLParser.hx b/build/linux64_569e52e/std/flash/xml/XMLParser.hx new file mode 100644 index 0000000..ef9441d --- /dev/null +++ b/build/linux64_569e52e/std/flash/xml/XMLParser.hx @@ -0,0 +1,7 @@ +package flash.xml; + +extern final class XMLParser { + function new() : Void; + function getNext(tag : XMLTag) : Int; + function startParse(source : String, ignoreWhite : Bool) : Void; +} diff --git a/build/linux64_569e52e/std/flash/xml/XMLTag.hx b/build/linux64_569e52e/std/flash/xml/XMLTag.hx new file mode 100644 index 0000000..468fda4 --- /dev/null +++ b/build/linux64_569e52e/std/flash/xml/XMLTag.hx @@ -0,0 +1,17 @@ +package flash.xml; + +extern final class XMLTag { + @:flash.property var attrs(get,set) : Dynamic; + @:flash.property var empty(get,set) : Bool; + @:flash.property var type(get,set) : XMLNodeType; + @:flash.property var value(get,set) : String; + function new() : Void; + private function get_attrs() : Dynamic; + private function get_empty() : Bool; + private function get_type() : XMLNodeType; + private function get_value() : String; + private function set_attrs(value : Dynamic) : Dynamic; + private function set_empty(value : Bool) : Bool; + private function set_type(value : XMLNodeType) : XMLNodeType; + private function set_value(value : String) : String; +} diff --git a/build/linux64_569e52e/std/haxe/CallStack.hx b/build/linux64_569e52e/std/haxe/CallStack.hx new file mode 100644 index 0000000..e9260b7 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/CallStack.hx @@ -0,0 +1,185 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +/** + Elements return by `CallStack` methods. +**/ +enum StackItem { + CFunction; + Module(m:String); + FilePos(s:Null, file:String, line:Int, ?column:Int); + Method(classname:Null, method:String); + LocalFunction(?v:Int); +} + +/** + Get information about the call stack. +**/ +@:allow(haxe.Exception) +@:using(haxe.CallStack) +abstract CallStack(Array) from Array { + /** + The length of this stack. + **/ + public var length(get,never):Int; + inline function get_length():Int return this.length; + + /** + Return the call stack elements, or an empty array if not available. + **/ + public static function callStack():Array { + return NativeStackTrace.toHaxe(NativeStackTrace.callStack()); + } + + /** + Return the exception stack : this is the stack elements between + the place the last exception was thrown and the place it was + caught, or an empty array if not available. + Set `fullStack` parameter to true in order to return the full exception stack. + + May not work if catch type was a derivative from `haxe.Exception`. + **/ + public static function exceptionStack( fullStack = false ):Array { + var eStack:CallStack = NativeStackTrace.toHaxe(NativeStackTrace.exceptionStack()); + return (fullStack ? eStack : eStack.subtract(callStack())).asArray(); + } + + /** + Returns a representation of the stack as a printable string. + **/ + static public function toString(stack:CallStack):String { + var b = new StringBuf(); + for (s in stack.asArray()) { + b.add('\nCalled from '); + itemToString(b, s); + } + return b.toString(); + } + + /** + Returns a range of entries of current stack from the beginning to the the + common part of this and `stack`. + **/ + public function subtract(stack:CallStack):CallStack { + var startIndex = -1; + var i = -1; + while(++i < this.length) { + for(j in 0...stack.length) { + if(equalItems(this[i], stack[j])) { + if(startIndex < 0) { + startIndex = i; + } + ++i; + if(i >= this.length) break; + } else { + startIndex = -1; + } + } + if(startIndex >= 0) break; + } + return startIndex >= 0 ? this.slice(0, startIndex) : this; + } + + /** + Make a copy of the stack. + **/ + public inline function copy():CallStack { + return this.copy(); + } + + @:arrayAccess public inline function get(index:Int):StackItem { + return this[index]; + } + + inline function asArray():Array { + return this; + } + + static function equalItems(item1:Null, item2:Null):Bool { + return switch([item1, item2]) { + case [null, null]: true; + case [CFunction, CFunction]: true; + case [Module(m1), Module(m2)]: + m1 == m2; + case [FilePos(item1, file1, line1, col1), FilePos(item2, file2, line2, col2)]: + file1 == file2 && line1 == line2 && col1 == col2 && equalItems(item1, item2); + case [Method(class1, method1), Method(class2, method2)]: + class1 == class2 && method1 == method2; + case [LocalFunction(v1), LocalFunction(v2)]: + v1 == v2; + case _: false; + } + } + + static function exceptionToString(e:Exception):String { + if(e.previous == null) { + return 'Exception: ${e.toString()}${e.stack}'; + } + var result = ''; + var e:Null = e; + var prev:Null = null; + while(e != null) { + if(prev == null) { + result = 'Exception: ${e.message}${e.stack}' + result; + } else { + var prevStack = @:privateAccess e.stack.subtract(prev.stack); + result = 'Exception: ${e.message}${prevStack}\n\nNext ' + result; + } + prev = e; + e = e.previous; + } + return result; + } + + static function itemToString(b:StringBuf, s) { + switch (s) { + case CFunction: + b.add("a C function"); + case Module(m): + b.add("module "); + b.add(m); + case FilePos(s, file, line, col): + if (s != null) { + itemToString(b, s); + b.add(" ("); + } + b.add(file); + b.add(" line "); + b.add(line); + if (col != null) { + b.add(" column "); + b.add(col); + } + if (s != null) + b.add(")"); + case Method(cname, meth): + b.add(cname == null ? "" : cname); + b.add("."); + b.add(meth); + case LocalFunction(n): + b.add("local function #"); + b.add(n); + } + } +} diff --git a/build/linux64_569e52e/std/haxe/Constraints.hx b/build/linux64_569e52e/std/haxe/Constraints.hx new file mode 100644 index 0000000..e0138e5 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/Constraints.hx @@ -0,0 +1,78 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +/** + This type unifies with any function type. + + It is intended to be used as a type parameter constraint. If used as a real + type, the underlying type will be `Dynamic`. +**/ +@:callable +abstract Function(Dynamic) {} + +/** + This type unifies with an enum instance if all constructors of the enum + require no arguments. + + It is intended to be used as a type parameter constraint. If used as a real + type, the underlying type will be `Dynamic`. +**/ +abstract FlatEnum(Dynamic) {} + +/** + This type unifies with anything but `Void`. + + It is intended to be used as a type parameter constraint. If used as a real + type, the underlying type will be `Dynamic`. +**/ +abstract NotVoid(Dynamic) { } + +/** + This type unifies with any instance of classes that have a constructor + which + + * is `public` and + * unifies with the type used for type parameter `T`. + + If a type parameter `A` is assigned to a type parameter `B` which is constrained + to `Constructible`, A must be explicitly constrained to + `Constructible` as well. + + It is intended to be used as a type parameter constraint. If used as a real + type, the underlying type will be `Dynamic`. +**/ +abstract Constructible(Dynamic) {} + +interface IMap { + function get(k:K):Null; + function set(k:K, v:V):Void; + function exists(k:K):Bool; + function remove(k:K):Bool; + function keys():Iterator; + function iterator():Iterator; + function keyValueIterator():KeyValueIterator; + function copy():IMap; + function toString():String; + function clear():Void; +} diff --git a/build/linux64_569e52e/std/haxe/DynamicAccess.hx b/build/linux64_569e52e/std/haxe/DynamicAccess.hx new file mode 100644 index 0000000..91f552b --- /dev/null +++ b/build/linux64_569e52e/std/haxe/DynamicAccess.hx @@ -0,0 +1,125 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +import haxe.iterators.DynamicAccessIterator; +import haxe.iterators.DynamicAccessKeyValueIterator; + +/** + DynamicAccess is an abstract type for working with anonymous structures + that are intended to hold collections of objects by the string key. + + For example, these types of structures are often created from JSON. + + Basically, it wraps `Reflect` calls in a `Map`-like interface. +**/ +abstract DynamicAccess(Dynamic) from Dynamic to Dynamic { + /** + Creates a new structure. + **/ + public inline function new() + this = {}; + + /** + Returns a value by specified `key`. + + If the structure does not contain the given key, `null` is returned. + + If `key` is `null`, the result is unspecified. + **/ + @:arrayAccess + public inline function get(key:String):Null { + #if js + return untyped this[key]; // we know it's an object, so we don't need a check + #else + return Reflect.field(this, key); + #end + } + + /** + Sets a `value` for a specified `key`. + + If the structure contains the given key, its value will be overwritten. + + Returns the given value. + + If `key` is `null`, the result is unspecified. + **/ + @:arrayAccess + public inline function set(key:String, value:T):T { + #if js + return untyped this[key] = value; + #else + Reflect.setField(this, key, value); + return value; + #end + } + + /** + Tells if the structure contains a specified `key`. + + If `key` is `null`, the result is unspecified. + **/ + public inline function exists(key:String):Bool + return Reflect.hasField(this, key); + + /** + Removes a specified `key` from the structure. + + Returns true, if `key` was present in structure, or false otherwise. + + If `key` is `null`, the result is unspecified. + **/ + public inline function remove(key:String):Bool + return Reflect.deleteField(this, key); + + /** + Returns an array of `keys` in a structure. + **/ + public inline function keys():Array + return Reflect.fields(this); + + /** + Returns a shallow copy of the structure + **/ + public inline function copy():DynamicAccess + return Reflect.copy(this); + + /** + Returns an Iterator over the values of this `DynamicAccess`. + + The order of values is undefined. + **/ + public inline function iterator():DynamicAccessIterator { + return new DynamicAccessIterator(this); + } + + /** + Returns an Iterator over the keys and values of this `DynamicAccess`. + + The order of values is undefined. + **/ + public inline function keyValueIterator():DynamicAccessKeyValueIterator { + return new DynamicAccessKeyValueIterator(this); + } +} diff --git a/build/linux64_569e52e/std/haxe/EntryPoint.hx b/build/linux64_569e52e/std/haxe/EntryPoint.hx new file mode 100644 index 0000000..56d8959 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/EntryPoint.hx @@ -0,0 +1,182 @@ +package haxe; + +#if (target.threaded && !cppia) +import sys.thread.Lock; +import sys.thread.Mutex; +import sys.thread.Thread; +#elseif sys +private class Lock { + public function new() {} + + public inline function release() {} + + public inline function wait(?t:Float) {} +} + +private class Mutex { + public function new() {} + + public inline function acquire() {} + + public inline function release() {} +} + +private class Thread { + public static function create(f:Void->Void) { + f(); + } +} +#end + +/** + If `haxe.MainLoop` is kept from DCE, then we will insert an `haxe.EntryPoint.run()` call just at then end of `main()`. + This class can be redefined by custom frameworks so they can handle their own main loop logic. +**/ +class EntryPoint { + #if sys + static var mutex = new Mutex(); + #if (target.threaded && !cppia) + static var mainThread:Thread = Thread.current(); + #else + static var sleepLock = new Lock(); + #end + #end + static var pending = new ArrayVoid>(); + public static var threadCount(default, null):Int = 0; + + /** + Wakeup a sleeping `run()` + **/ + public static function wakeup() { + #if (sys && !(target.threaded && !cppia)) + sleepLock.release(); + #end + } + + public static function runInMainThread(f:Void->Void) { + #if sys + #if (target.threaded && !cppia) + mainThread.events.run(f); + #else + mutex.acquire(); + pending.push(f); + mutex.release(); + wakeup(); + #end + #else + pending.push(f); + #end + } + + public static function addThread(f:Void->Void) { + #if sys + mutex.acquire(); + threadCount++; + mutex.release(); + #if (target.threaded && !cppia) + mainThread.events.promise(); + #end + Thread.create(function() { + f(); + mutex.acquire(); + threadCount--; + if (threadCount == 0) + wakeup(); + mutex.release(); + #if (target.threaded && !cppia) + mainThread.events.runPromised(() -> {}); + #end + }); + #else + threadCount++; + pending.push(function() { + f(); + threadCount--; + }); + #end + } + + static function processEvents():Float { + #if (target.threaded && !cppia) + return -1; + #else + // flush all pending calls + while (true) { + #if sys + mutex.acquire(); + var f = pending.shift(); + mutex.release(); + #else + var f = pending.shift(); + #end + if (f == null) + break; + f(); + } + var time = @:privateAccess MainLoop.tick(); + if (!MainLoop.hasEvents() && threadCount == 0) + return -1; + return time; + #end + } + + /** + Start the main loop. Depending on the platform, this can return immediately or will only return when the application exits. + **/ + @:keep public static function run() @:privateAccess { + #if js + var nextTick = processEvents(); + inline function setTimeoutNextTick() { + if (nextTick >= 0) { + (untyped setTimeout)(run, nextTick * 1000); + } + } + #if nodejs + setTimeoutNextTick(); + #else + if(js.Lib.typeof(js.Browser.window) != 'undefined') { + var window:Dynamic = js.Browser.window; + var rqf:Dynamic = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame; + if(rqf != null) { + rqf(run); + } else { + setTimeoutNextTick(); + } + } else { + setTimeoutNextTick(); + } + #end + #elseif flash + flash.Lib.current.stage.addEventListener(flash.events.Event.ENTER_FRAME, function(_) processEvents()); + #elseif (target.threaded && !cppia) + //everything is delegated to sys.thread.EventLoop + #elseif lua + inline function luvRun(mode:String):Bool + return untyped __lua__('_hx_luv.run({0})', mode); + while (true) { + var nextTick = processEvents(); + if(untyped __lua__('_hx_luv.loop_alive()')) { + if(nextTick < 0) + luvRun("once") + else + luvRun("nowait"); + } else { + if (nextTick < 0) + break; + if (nextTick > 0) + sleepLock.wait(nextTick); + } + } + #elseif sys + while (true) { + var nextTick = processEvents(); + if (nextTick < 0) + break; + if (nextTick > 0) + sleepLock.wait(nextTick); // wait until nextTick or wakeup() call + } + #else + // no implementation available, let's exit immediately + #end + } +} diff --git a/build/linux64_569e52e/std/haxe/EnumFlags.hx b/build/linux64_569e52e/std/haxe/EnumFlags.hx new file mode 100644 index 0000000..b6458f0 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/EnumFlags.hx @@ -0,0 +1,118 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +/** + A typed interface for bit flags. This is not a real object, only a typed + interface for an actual Int. Each flag can be tested/set with the + corresponding enum instance. Up to 32 flags can be stored that way. + + Enum constructor indices are preserved from Haxe syntax, so the first + declared is index 0, the next index 1 etc. The methods are optimized if the + enum instance is passed directly, e.g. as `has(EnumCtor)`. Otherwise + `Type.enumIndex()` reflection is used. +**/ +abstract EnumFlags(Int) { + /** + Initializes the bitflags to `i`. + **/ + public inline function new(i = 0) { + this = i; + } + + @:from static function from(e:T) : EnumFlags { + return new EnumFlags(1 << e.getIndex()); + } + + @:op(a|b) function or(f:haxe.EnumFlags) : haxe.EnumFlags; + @:op(a&b) function and(f:haxe.EnumFlags) : haxe.EnumFlags; + @:op(a^b) function xor(f:haxe.EnumFlags) : haxe.EnumFlags; + + /** + Checks if the index of enum instance `v` is set. + + This method is optimized if `v` is an enum instance expression such as + `SomeEnum.SomeCtor`. + + If `v` is `null`, the result is unspecified. + **/ + public inline function has(v:T):Bool { + return this & (1 << Type.enumIndex(v)) != 0; + } + + /** + Sets the index of enum instance `v`. + + This method is optimized if `v` is an enum instance expression such as + `SomeEnum.SomeCtor`. + + If `v` is `null`, the result is unspecified. + **/ + public inline function set(v:T):Void { + this |= 1 << Type.enumIndex(v); + } + + /** + Unsets the index of enum instance `v`. + + This method is optimized if `v` is an enum instance expression such as + `SomeEnum.SomeCtor`. + + If `v` is `null`, the result is unspecified. + **/ + public inline function unset(v:T):Void { + this &= 0xFFFFFFFF - (1 << Type.enumIndex(v)); + } + + /** + Depending on the value of `condition` sets (`condition=true`) or unsets (`condition=false`) + the index of enum instance `v`. + + This method is optimized if `v` is an enum instance expression such as + `SomeEnum.SomeCtor`. + + If `v` is `null`, the result is unspecified. + **/ + public inline function setTo(v:T, condition:Bool):Void { + if(condition) + set(v) + else + unset(v); + } + + /** + Convert a integer bitflag into a typed one (this is a no-op, it does not + have any impact on speed). + **/ + public inline static function ofInt(i:Int):EnumFlags { + return new EnumFlags(i); + } + + /** + Convert the typed bitflag into the corresponding int value (this is a + no-op, it doesn't have any impact on speed). + **/ + public inline function toInt():Int { + return this; + } +} diff --git a/build/linux64_569e52e/std/haxe/EnumTools.hx b/build/linux64_569e52e/std/haxe/EnumTools.hx new file mode 100644 index 0000000..35c787e --- /dev/null +++ b/build/linux64_569e52e/std/haxe/EnumTools.hx @@ -0,0 +1,178 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +/** + This class provides advanced methods on enums. It is ideally used with + `using EnumTools` and then acts as an + [extension](https://haxe.org/manual/lf-static-extension.html) to the + `enum` types. + + If the first argument to any of the methods is `null`, the result is + unspecified. +**/ +extern class EnumTools { + /** + Returns the name of enum `e`, including its path. + + If `e` is inside a package, the package structure is returned dot- + separated, with another dot separating the enum name: + + pack1.pack2.(...).packN.EnumName + + If `e` is a sub-type of a Haxe module, that module is not part of the + package structure. + + If `e` has no package, the enum name is returned. + + If `e` is `null`, the result is unspecified. + + The enum name does not include any type parameters. + **/ + static inline function getName(e:Enum):String { + return Type.getEnumName(e); + } + + /** + Creates an instance of enum `e` by calling its constructor `constr` with + arguments `params`. + + If `e` or `constr` is `null`, or if enum `e` has no constructor named + `constr`, or if the number of elements in `params` does not match the + expected number of constructor arguments, or if any argument has an + invalid type, the result is unspecified. + **/ + static inline function createByName(e:Enum, constr:String, ?params:Array):T { + return Type.createEnum(e, constr, params); + } + + /** + Creates an instance of enum `e` by calling its constructor number + `index` with arguments `params`. + + The constructor indices are preserved from Haxe syntax, so the first + declared is index 0, the next index 1 etc. + + If `e` or `index` is `null`, or if enum `e` has no constructor + corresponding to index `index`, or if the number of elements in `params` + does not match the expected number of constructor arguments, or if any + argument has an invalid type, the result is unspecified. + **/ + static inline function createByIndex(e:Enum, index:Int, ?params:Array):T { + return Type.createEnumIndex(e, index, params); + } + + /** + Returns a list of all constructors of enum `e` that require no + arguments. + + This may return the empty Array `[]` if all constructors of `e` require + arguments. + + Otherwise an instance of `e` constructed through each of its non- + argument constructors is returned, in the order of the constructor + declaration. + + If `e` is `null`, the result is unspecified. + **/ + static inline function createAll(e:Enum):Array { + return Type.allEnums(e); + } + + /** + Returns a list of the names of all constructors of enum `e`. + + The order of the constructor names in the returned Array is preserved + from the original syntax. + + If `c` is `null`, the result is unspecified. + **/ + static inline function getConstructors(e:Enum):Array { + return Type.getEnumConstructs(e); + } + + #if (java && jvm) + @:noCompletion + extern static function values(en:Enum):java.NativeArray>; + #end +} + +/** + This class provides advanced methods on enum values. It is ideally used with + `using EnumValueTools` and then acts as an + [extension](https://haxe.org/manual/lf-static-extension.html) to the + `EnumValue` types. + + If the first argument to any of the methods is `null`, the result is + unspecified. +**/ +extern class EnumValueTools { + /** + Recursively compares two enum instances `a` and `b` by value. + + Unlike `a == b`, this function performs a deep equality check on the + arguments of the constructors (if there are any). + + If `a` or `b` are `null`, the result is unspecified. + **/ + static inline function equals(a:T, b:T):Bool { + return Type.enumEq(a, b); + } + + /** + Returns the constructor name of enum instance `e`. + + The result String does not contain any constructor arguments. + + If `e` is `null`, the result is unspecified. + **/ + static inline function getName(e:EnumValue):String { + return Type.enumConstructor(e); + } + + /** + Returns a list of the constructor arguments of enum instance `e`. + + If `e` has no arguments, the result is `[]`. + + Otherwise the result are the values that were used as arguments to `e`, + in the order of their declaration. + + If `e` is `null`, the result is unspecified. + **/ + static inline function getParameters(e:EnumValue):Array { + return Type.enumParameters(e); + } + + /** + Returns the index of enum instance `e`. + + This corresponds to the original syntactic position of `e`. The index of + the first declared constructor is 0, the next one is 1 etc. + + If `e` is `null`, the result is unspecified. + **/ + static inline function getIndex(e:EnumValue):Int { + return Type.enumIndex(e); + } +} diff --git a/build/linux64_569e52e/std/haxe/Exception.hx b/build/linux64_569e52e/std/haxe/Exception.hx new file mode 100644 index 0000000..256515a --- /dev/null +++ b/build/linux64_569e52e/std/haxe/Exception.hx @@ -0,0 +1,117 @@ +package haxe; + +/** + Base class for exceptions. + + If this class (or derivatives) is used to catch an exception, then + `haxe.CallStack.exceptionStack()` will not return a stack for the exception + caught. Use `haxe.Exception.stack` property instead: + ```haxe + try { + throwSomething(); + } catch(e:Exception) { + trace(e.stack); + } + ``` + + Custom exceptions should extend this class: + ```haxe + class MyException extends haxe.Exception {} + //... + throw new MyException('terrible exception'); + ``` + + `haxe.Exception` is also a wildcard type to catch any exception: + ```haxe + try { + throw 'Catch me!'; + } catch(e:haxe.Exception) { + trace(e.message); // Output: Catch me! + } + ``` + + To rethrow an exception just throw it again. + Haxe will try to rethrow an original native exception whenever possible. + ```haxe + try { + var a:Array = null; + a.push(1); // generates target-specific null-pointer exception + } catch(e:haxe.Exception) { + throw e; // rethrows native exception instead of haxe.Exception + } + ``` +**/ +extern class Exception { + /** + Exception message. + **/ + public var message(get,never):String; + private function get_message():String; + + /** + The call stack at the moment of the exception creation. + **/ + public var stack(get,never):CallStack; + private function get_stack():CallStack; + + /** + Contains an exception, which was passed to `previous` constructor argument. + **/ + public var previous(get,never):Null; + private function get_previous():Null; + + /** + Native exception, which caused this exception. + **/ + public var native(get,never):Any; + final private function get_native():Any; + + /** + Used internally for wildcard catches like `catch(e:Exception)`. + **/ + static private function caught(value:Any):Exception; + + /** + Used internally for wrapping non-throwable values for `throw` expressions. + **/ + static private function thrown(value:Any):Any; + + /** + Create a new Exception instance. + + The `previous` argument could be used for exception chaining. + + The `native` argument is for internal usage only. + There is no need to provide `native` argument manually and no need to keep it + upon extending `haxe.Exception` unless you know what you're doing. + **/ + public function new(message:String, ?previous:Exception, ?native:Any):Void; + + /** + Extract an originally thrown value. + + Used internally for catching non-native exceptions. + Do _not_ override unless you know what you are doing. + **/ + private function unwrap():Any; + + /** + Returns exception message. + **/ + public function toString():String; + + /** + Detailed exception description. + + Includes message, stack and the chain of previous exceptions (if set). + **/ + public function details():String; + + /** + If this field is defined in a target implementation, then a call to this + field will be generated automatically in every constructor of derived classes + to make exception stacks point to derived constructor invocations instead of + `super` calls. + **/ + // @:noCompletion @:ifFeature("haxe.Exception.stack") private function __shiftStack():Void; +} diff --git a/build/linux64_569e52e/std/haxe/Http.hx b/build/linux64_569e52e/std/haxe/Http.hx new file mode 100644 index 0000000..2d23db2 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/Http.hx @@ -0,0 +1,33 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +#if sys +typedef Http = sys.Http; +#elseif nodejs +typedef Http = haxe.http.HttpNodeJs; +#elseif js +typedef Http = haxe.http.HttpJs; +#else +typedef Http = haxe.http.HttpBase; +#end diff --git a/build/linux64_569e52e/std/haxe/Int32.hx b/build/linux64_569e52e/std/haxe/Int32.hx new file mode 100644 index 0000000..615bea1 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/Int32.hx @@ -0,0 +1,282 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +/** + Int32 provides a 32-bit integer with consistent overflow behavior across + all platforms. +**/ +@:transitive +abstract Int32(Int) from Int to Int { + @:op(-A) private inline function negate():Int32 + return clamp(~this + 1); + + @:op(++A) private inline function preIncrement():Int32 + return this = clamp(++this); + + @:op(A++) private inline function postIncrement():Int32 { + var ret = this++; + this = clamp(this); + return ret; + } + + @:op(--A) private inline function preDecrement():Int32 + return this = clamp(--this); + + @:op(A--) private inline function postDecrement():Int32 { + var ret = this--; + this = clamp(this); + return ret; + } + + @:op(A + B) private static inline function add(a:Int32, b:Int32):Int32 + return clamp((a : Int) + (b : Int)); + + @:op(A + B) @:commutative private static inline function addInt(a:Int32, b:Int):Int32 + return clamp((a : Int) + (b : Int)); + + @:op(A + B) @:commutative private static function addFloat(a:Int32, b:Float):Float; + + @:op(A - B) private static inline function sub(a:Int32, b:Int32):Int32 + return clamp((a : Int) - (b : Int)); + + @:op(A - B) private static inline function subInt(a:Int32, b:Int):Int32 + return clamp((a : Int) - (b : Int)); + + @:op(A - B) private static inline function intSub(a:Int, b:Int32):Int32 + return clamp((a : Int) - (b : Int)); + + @:op(A - B) private static function subFloat(a:Int32, b:Float):Float; + + @:op(A - B) private static function floatSub(a:Float, b:Int32):Float; + + #if (js || php || python || lua) + #if js + // on JS we want to try using Math.imul, but we have to assign that function to Int32.mul only once, + // or else V8 will deoptimize it, so we need to be a bit funky with this. + // See https://github.com/HaxeFoundation/haxe/issues/5367 for benchmarks. + @:op(A * B) inline static function mul(a:Int32, b:Int32):Int32 + return _mul(a, b); + + static var _mul:Int32->Int32->Int32 = untyped if (Math.imul != null) + Math.imul + else + function(a:Int32, b:Int32):Int32 return clamp((a : Int) * ((b : Int) & 0xFFFF) + clamp((a : Int) * ((b : Int) >>> 16) << 16)); + #else + @:op(A * B) private static function mul(a:Int32, b:Int32):Int32 + return clamp((a : Int) * ((b : Int) & 0xFFFF) + clamp((a : Int) * ((b : Int) >>> 16) << 16)); + #end + + @:op(A * B) @:commutative private static inline function mulInt(a:Int32, b:Int):Int32 + return mul(a, b); + #else + @:op(A * B) private static function mul(a:Int32, b:Int32):Int32; + + @:op(A * B) @:commutative private static function mulInt(a:Int32, b:Int):Int32; + #end + + @:op(A * B) @:commutative private static function mulFloat(a:Int32, b:Float):Float; + + @:op(A / B) private static function div(a:Int32, b:Int32):Float; + + @:op(A / B) private static function divInt(a:Int32, b:Int):Float; + + @:op(A / B) private static function intDiv(a:Int, b:Int32):Float; + + @:op(A / B) private static function divFloat(a:Int32, b:Float):Float; + + @:op(A / B) private static function floatDiv(a:Float, b:Int32):Float; + + @:op(A % B) private static function mod(a:Int32, b:Int32):Int32; + + @:op(A % B) private static function modInt(a:Int32, b:Int):Int; + + @:op(A % B) private static function intMod(a:Int, b:Int32):Int; + + @:op(A % B) private static function modFloat(a:Int32, b:Float):Float; + + @:op(A % B) private static function floatMod(a:Float, b:Int32):Float; + + @:op(A == B) private static function eq(a:Int32, b:Int32):Bool; + + @:op(A == B) @:commutative private static function eqInt(a:Int32, b:Int):Bool; + + @:op(A == B) @:commutative private static function eqFloat(a:Int32, b:Float):Bool; + + @:op(A != B) private static function neq(a:Int32, b:Int32):Bool; + + @:op(A != B) @:commutative private static function neqInt(a:Int32, b:Int):Bool; + + @:op(A != B) @:commutative private static function neqFloat(a:Int32, b:Float):Bool; + + @:op(A < B) private static function lt(a:Int32, b:Int32):Bool; + + @:op(A < B) private static function ltInt(a:Int32, b:Int):Bool; + + @:op(A < B) private static function intLt(a:Int, b:Int32):Bool; + + @:op(A < B) private static function ltFloat(a:Int32, b:Float):Bool; + + @:op(A < B) private static function floatLt(a:Float, b:Int32):Bool; + + @:op(A <= B) private static function lte(a:Int32, b:Int32):Bool; + + @:op(A <= B) private static function lteInt(a:Int32, b:Int):Bool; + + @:op(A <= B) private static function intLte(a:Int, b:Int32):Bool; + + @:op(A <= B) private static function lteFloat(a:Int32, b:Float):Bool; + + @:op(A <= B) private static function floatLte(a:Float, b:Int32):Bool; + + @:op(A > B) private static function gt(a:Int32, b:Int32):Bool; + + @:op(A > B) private static function gtInt(a:Int32, b:Int):Bool; + + @:op(A > B) private static function intGt(a:Int, b:Int32):Bool; + + @:op(A > B) private static function gtFloat(a:Int32, b:Float):Bool; + + @:op(A > B) private static function floatGt(a:Float, b:Int32):Bool; + + @:op(A >= B) private static function gte(a:Int32, b:Int32):Bool; + + @:op(A >= B) private static function gteInt(a:Int32, b:Int):Bool; + + @:op(A >= B) private static function intGte(a:Int, b:Int32):Bool; + + @:op(A >= B) private static function gteFloat(a:Int32, b:Float):Bool; + + @:op(A >= B) private static function floatGte(a:Float, b:Int32):Bool; + + #if (lua || python || php) + @:op(~A) private static inline function complement(a:Int32):Int32 + #if lua return lua.Boot.clampInt32(~a); #else return clamp(~a); #end + #else + @:op(~A) private function complement():Int32; + #end + + @:op(A & B) private static function and(a:Int32, b:Int32):Int32; + + @:op(A & B) @:commutative private static function andInt(a:Int32, b:Int):Int32; + + #if (lua || python || php) + @:op(A | B) private static #if (python || php) inline #end function or(a:Int32, b:Int32):Int32 + return clamp((a : Int) | (b : Int)); + + @:op(A | B) @:commutative private #if (python || php) inline #end static function orInt(a:Int32, b:Int):Int32 + return clamp((a : Int) | b); + #else + @:op(A | B) private static function or(a:Int32, b:Int32):Int32; + + @:op(A | B) @:commutative private static function orInt(a:Int32, b:Int):Int32; + #end + + #if (lua || python || php) + @:op(A ^ B) private static #if (python || php) inline #end function xor(a:Int32, b:Int32):Int32 + return clamp((a : Int) ^ (b : Int)); + + @:op(A ^ B) @:commutative private static #if (python || php) inline #end function xorInt(a:Int32, b:Int):Int32 + return clamp((a : Int) ^ b); + #else + @:op(A ^ B) private static function xor(a:Int32, b:Int32):Int32; + + @:op(A ^ B) @:commutative private static function xorInt(a:Int32, b:Int):Int32; + #end + + #if (lua || python || php) + @:op(A >> B) private static #if (python || php) inline #end function shr(a:Int32, b:Int32):Int32 + return clamp((a : Int) >> (b : Int)); + + @:op(A >> B) private static #if (python || php) inline #end function shrInt(a:Int32, b:Int):Int32 + return clamp((a : Int) >> b); + + @:op(A >> B) private static #if (python || php) inline #end function intShr(a:Int, b:Int32):Int32 + return clamp(a >> (b : Int)); + #else + @:op(A >> B) private static function shr(a:Int32, b:Int32):Int32; + + @:op(A >> B) private static function shrInt(a:Int32, b:Int):Int32; + + @:op(A >> B) private static function intShr(a:Int, b:Int32):Int32; + #end + + @:op(A >>> B) private static function ushr(a:Int32, b:Int32):Int32; + + @:op(A >>> B) private static function ushrInt(a:Int32, b:Int):Int32; + + @:op(A >>> B) private static function intUshr(a:Int, b:Int32):Int32; + + #if (php || python || lua) + // PHP may be 64-bit, so shifts must be clamped + @:op(A << B) private static inline function shl(a:Int32, b:Int32):Int32 + return clamp((a : Int) << (b : Int)); + + @:op(A << B) private static inline function shlInt(a:Int32, b:Int):Int32 + return clamp((a : Int) << b); + + @:op(A << B) private static inline function intShl(a:Int, b:Int32):Int32 + return clamp(a << (b : Int)); + #else + @:op(A << B) private static function shl(a:Int32, b:Int32):Int32; + + @:op(A << B) private static function shlInt(a:Int32, b:Int):Int32; + + @:op(A << B) private static function intShl(a:Int, b:Int32):Int32; + #end + + @:to private inline function toFloat():Float + return this; + + /** + Compare `a` and `b` in unsigned mode. + **/ + public static function ucompare(a:Int32, b:Int32):Int { + if (a < 0) + return b < 0 ? (~b - ~a) : 1; + return b < 0 ? -1 : (a - b); + } + + #if php + static var extraBits:Int = php.Const.PHP_INT_SIZE * 8 - 32; + #end + + #if !lua + inline + #end + static function clamp(x:Int):Int { + // force to-int conversion on platforms that require it + #if js + return x | 0; + #elseif php + // we might be on 64-bit php, so sign extend from 32-bit + return (x << extraBits) >> extraBits; + #elseif python + return (python.Syntax.code("{0} % {1}", (x + python.Syntax.opPow(2, 31)), python.Syntax.opPow(2, 32)) : Int) - python.Syntax.opPow(2, 31); + #elseif lua + return lua.Boot.clampInt32(x); + #else + return (x); + #end + } +} diff --git a/build/linux64_569e52e/std/haxe/Int64.hx b/build/linux64_569e52e/std/haxe/Int64.hx new file mode 100644 index 0000000..06c256c --- /dev/null +++ b/build/linux64_569e52e/std/haxe/Int64.hx @@ -0,0 +1,485 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +using haxe.Int64; + +/** + A cross-platform signed 64-bit integer. + Int64 instances can be created from two 32-bit words using `Int64.make()`. +**/ +#if flash +@:notNull +#end +@:transitive +abstract Int64(__Int64) from __Int64 to __Int64 { + private inline function new(x:__Int64) + this = x; + + /** + Makes a copy of `this` Int64. + **/ + public inline function copy():Int64 + return make(high, low); + + /** + Construct an Int64 from two 32-bit words `high` and `low`. + **/ + public static inline function make(high:Int32, low:Int32):Int64 + return new Int64(new __Int64(high, low)); + + /** + Returns an Int64 with the value of the Int `x`. + `x` is sign-extended to fill 64 bits. + **/ + @:from public static inline function ofInt(x:Int):Int64 + #if lua return make((x : Int32) >> 31, (x : Int32)); #else return make(x >> 31, x); #end + + /** + Returns an Int with the value of the Int64 `x`. + Throws an exception if `x` cannot be represented in 32 bits. + **/ + public static inline function toInt(x:Int64):Int { + if (x.high != x.low >> 31) + throw "Overflow"; + + return x.low; + } + + @:deprecated('haxe.Int64.is() is deprecated. Use haxe.Int64.isInt64() instead') + inline public static function is(val:Dynamic):Bool { + return isInt64(val); + } + + /** + Returns whether the value `val` is of type `haxe.Int64` + **/ + inline public static function isInt64(val:Dynamic):Bool + return Std.isOfType(val, __Int64); + + /** + Returns the high 32-bit word of `x`. + **/ + @:deprecated("Use high instead") + public static inline function getHigh(x:Int64):Int32 + return x.high; + + /** + Returns the low 32-bit word of `x`. + **/ + @:deprecated("Use low instead") + public static inline function getLow(x:Int64):Int32 + return x.low; + + /** + Returns `true` if `x` is less than zero. + **/ + public static inline function isNeg(x:Int64):Bool + return x.high < 0; + + /** + Returns `true` if `x` is exactly zero. + **/ + public static inline function isZero(x:Int64):Bool + return x == 0; + + /** + Compares `a` and `b` in signed mode. + Returns a negative value if `a < b`, positive if `a > b`, + or 0 if `a == b`. + **/ + public static inline function compare(a:Int64, b:Int64):Int { + var v = a.high - b.high; + v = if (v != 0) v else Int32.ucompare(a.low, b.low); + return a.high < 0 ? (b.high < 0 ? v : -1) : (b.high >= 0 ? v : 1); + } + + /** + Compares `a` and `b` in unsigned mode. + Returns a negative value if `a < b`, positive if `a > b`, + or 0 if `a == b`. + **/ + public static inline function ucompare(a:Int64, b:Int64):Int { + var v = Int32.ucompare(a.high, b.high); + return if (v != 0) v else Int32.ucompare(a.low, b.low); + } + + /** + Returns a signed decimal `String` representation of `x`. + **/ + public static inline function toStr(x:Int64):String + return x.toString(); + + function toString():String { + var i:Int64 = cast this; + if (i == 0) + return "0"; + var str = ""; + var neg = false; + if (i.isNeg()) { + neg = true; + // i = -i; cannot negate here as --9223372036854775808 = -9223372036854775808 + } + var ten:Int64 = 10; + while (i != 0) { + var r = i.divMod(ten); + if (r.modulus.isNeg()) { + str = Int64.neg(r.modulus).low + str; + i = Int64.neg(r.quotient); + } else { + str = r.modulus.low + str; + i = r.quotient; + } + } + if (neg) + str = "-" + str; + return str; + } + + public static inline function parseString(sParam:String):Int64 { + return Int64Helper.parseString(sParam); + } + + public static inline function fromFloat(f:Float):Int64 { + return Int64Helper.fromFloat(f); + } + + /** + Performs signed integer divison of `dividend` by `divisor`. + Returns `{ quotient : Int64, modulus : Int64 }`. + **/ + public static function divMod(dividend:Int64, divisor:Int64):{quotient:Int64, modulus:Int64} { + // Handle special cases of 0 and 1 + if (divisor.high == 0) { + switch (divisor.low) { + case 0: + throw "divide by zero"; + case 1: + return {quotient: dividend.copy(), modulus: 0}; + } + } + + var divSign = dividend.isNeg() != divisor.isNeg(); + + var modulus = dividend.isNeg() ? -dividend : dividend.copy(); + divisor = divisor.isNeg() ? -divisor : divisor; + + var quotient:Int64 = 0; + var mask:Int64 = 1; + + while (!divisor.isNeg()) { + var cmp = ucompare(divisor, modulus); + divisor <<= 1; + mask <<= 1; + if (cmp >= 0) + break; + } + + while (mask != 0) { + if (ucompare(modulus, divisor) >= 0) { + quotient |= mask; + modulus -= divisor; + } + mask >>>= 1; + divisor >>>= 1; + } + + if (divSign) + quotient = -quotient; + if (dividend.isNeg()) + modulus = -modulus; + + return { + quotient: quotient, + modulus: modulus + }; + } + + /** + Returns the negative of `x`. + **/ + @:op(-A) public static inline function neg(x:Int64):Int64 { + var high = ~x.high; + var low = -x.low; + if (low == 0) + high++; + return make(high, low); + } + + @:op(++A) private inline function preIncrement():Int64 { + this = copy(); + this.low++; + if (this.low == 0) + this.high++; + return cast this; + } + + @:op(A++) private inline function postIncrement():Int64 { + var ret = this; + preIncrement(); + return ret; + } + + @:op(--A) private inline function preDecrement():Int64 { + this = copy(); + if (this.low == 0) + this.high--; + this.low--; + return cast this; + } + + @:op(A--) private inline function postDecrement():Int64 { + var ret = this; + preDecrement(); + return ret; + } + + /** + Returns the sum of `a` and `b`. + **/ + @:op(A + B) public static inline function add(a:Int64, b:Int64):Int64 { + var high = a.high + b.high; + var low = a.low + b.low; + if (Int32.ucompare(low, a.low) < 0) + high++; + return make(high, low); + } + + @:op(A + B) @:commutative private static inline function addInt(a:Int64, b:Int):Int64 + return add(a, b); + + /** + Returns `a` minus `b`. + **/ + @:op(A - B) public static inline function sub(a:Int64, b:Int64):Int64 { + var high = a.high - b.high; + var low = a.low - b.low; + if (Int32.ucompare(a.low, b.low) < 0) + high--; + return make(high, low); + } + + @:op(A - B) private static inline function subInt(a:Int64, b:Int):Int64 + return sub(a, b); + + @:op(A - B) private static inline function intSub(a:Int, b:Int64):Int64 + return sub(a, b); + + /** + Returns the product of `a` and `b`. + **/ + @:op(A * B) + public static #if !lua inline #end function mul(a:Int64, b:Int64):Int64 { + var mask = 0xFFFF; + var al = a.low & mask, ah = a.low >>> 16; + var bl = b.low & mask, bh = b.low >>> 16; + var p00 = al * bl; + var p10 = ah * bl; + var p01 = al * bh; + var p11 = ah * bh; + var low = p00; + var high = p11 + (p01 >>> 16) + (p10 >>> 16); + p01 <<= 16; + low += p01; + if (Int32.ucompare(low, p01) < 0) + high++; + p10 <<= 16; + low += p10; + if (Int32.ucompare(low, p10) < 0) + high++; + high += a.low * b.high + a.high * b.low; + return make(high, low); + } + + @:op(A * B) @:commutative private static inline function mulInt(a:Int64, b:Int):Int64 + return mul(a, b); + + /** + Returns the quotient of `a` divided by `b`. + **/ + @:op(A / B) public static inline function div(a:Int64, b:Int64):Int64 + return divMod(a, b).quotient; + + @:op(A / B) private static inline function divInt(a:Int64, b:Int):Int64 + return div(a, b); + + @:op(A / B) private static inline function intDiv(a:Int, b:Int64):Int64 + return div(a, b).toInt(); + + /** + Returns the modulus of `a` divided by `b`. + **/ + @:op(A % B) public static inline function mod(a:Int64, b:Int64):Int64 + return divMod(a, b).modulus; + + @:op(A % B) private static inline function modInt(a:Int64, b:Int):Int64 + return mod(a, b).toInt(); + + @:op(A % B) private static inline function intMod(a:Int, b:Int64):Int64 + return mod(a, b).toInt(); + + /** + Returns `true` if `a` is equal to `b`. + **/ + @:op(A == B) public static inline function eq(a:Int64, b:Int64):Bool + return a.high == b.high && a.low == b.low; + + @:op(A == B) @:commutative private static inline function eqInt(a:Int64, b:Int):Bool + return eq(a, b); + + /** + Returns `true` if `a` is not equal to `b`. + **/ + @:op(A != B) public static inline function neq(a:Int64, b:Int64):Bool + return a.high != b.high || a.low != b.low; + + @:op(A != B) @:commutative private static inline function neqInt(a:Int64, b:Int):Bool + return neq(a, b); + + @:op(A < B) private static inline function lt(a:Int64, b:Int64):Bool + return compare(a, b) < 0; + + @:op(A < B) private static inline function ltInt(a:Int64, b:Int):Bool + return lt(a, b); + + @:op(A < B) private static inline function intLt(a:Int, b:Int64):Bool + return lt(a, b); + + @:op(A <= B) private static inline function lte(a:Int64, b:Int64):Bool + return compare(a, b) <= 0; + + @:op(A <= B) private static inline function lteInt(a:Int64, b:Int):Bool + return lte(a, b); + + @:op(A <= B) private static inline function intLte(a:Int, b:Int64):Bool + return lte(a, b); + + @:op(A > B) private static inline function gt(a:Int64, b:Int64):Bool + return compare(a, b) > 0; + + @:op(A > B) private static inline function gtInt(a:Int64, b:Int):Bool + return gt(a, b); + + @:op(A > B) private static inline function intGt(a:Int, b:Int64):Bool + return gt(a, b); + + @:op(A >= B) private static inline function gte(a:Int64, b:Int64):Bool + return compare(a, b) >= 0; + + @:op(A >= B) private static inline function gteInt(a:Int64, b:Int):Bool + return gte(a, b); + + @:op(A >= B) private static inline function intGte(a:Int, b:Int64):Bool + return gte(a, b); + + /** + Returns the bitwise NOT of `a`. + **/ + @:op(~A) private static inline function complement(a:Int64):Int64 + return make(~a.high, ~a.low); + + /** + Returns the bitwise AND of `a` and `b`. + **/ + @:op(A & B) public static inline function and(a:Int64, b:Int64):Int64 + return make(a.high & b.high, a.low & b.low); + + /** + Returns the bitwise OR of `a` and `b`. + **/ + @:op(A | B) public static inline function or(a:Int64, b:Int64):Int64 + return make(a.high | b.high, a.low | b.low); + + /** + Returns the bitwise XOR of `a` and `b`. + **/ + @:op(A ^ B) public static inline function xor(a:Int64, b:Int64):Int64 + return make(a.high ^ b.high, a.low ^ b.low); + + /** + Returns `a` left-shifted by `b` bits. + **/ + @:op(A << B) public static inline function shl(a:Int64, b:Int):Int64 { + b &= 63; + return if (b == 0) a.copy() else if (b < 32) make((a.high << b) | (a.low >>> (32 - b)), a.low << b) else make(a.low << (b - 32), 0); + } + + /** + Returns `a` right-shifted by `b` bits in signed mode. + `a` is sign-extended. + **/ + @:op(A >> B) public static inline function shr(a:Int64, b:Int):Int64 { + b &= 63; + return if (b == 0) a.copy() else if (b < 32) make(a.high >> b, (a.high << (32 - b)) | (a.low >>> b)); else make(a.high >> 31, a.high >> (b - 32)); + } + + /** + Returns `a` right-shifted by `b` bits in unsigned mode. + `a` is padded with zeroes. + **/ + @:op(A >>> B) public static inline function ushr(a:Int64, b:Int):Int64 { + b &= 63; + return if (b == 0) a.copy() else if (b < 32) make(a.high >>> b, (a.high << (32 - b)) | (a.low >>> b)); else make(0, a.high >>> (b - 32)); + } + + public var high(get, never):Int32; + + private inline function get_high() + return this.high; + + private inline function set_high(x) + return this.high = x; + + public var low(get, never):Int32; + + private inline function get_low() + return this.low; + + private inline function set_low(x) + return this.low = x; +} + +/** + This typedef will fool `@:coreApi` into thinking that we are using + the same underlying type, even though it might be different on + specific platforms. +**/ +private typedef __Int64 = ___Int64; + +private class ___Int64 { + public var high:Int32; + public var low:Int32; + + public inline function new(high, low) { + this.high = high; + this.low = low; + } + + /** + We also define toString here to ensure we always get a pretty string + when tracing or calling `Std.string`. This tends not to happen when + `toString` is only in the abstract. + **/ + public function toString():String + return Int64.toStr(cast this); +} diff --git a/build/linux64_569e52e/std/haxe/Int64Helper.hx b/build/linux64_569e52e/std/haxe/Int64Helper.hx new file mode 100644 index 0000000..bd34c34 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/Int64Helper.hx @@ -0,0 +1,116 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +using haxe.Int64; + +import StringTools; + +/** + Helper for parsing to `Int64` instances. +**/ +class Int64Helper { + /** + Create `Int64` from given string. + **/ + public static function parseString(sParam:String):Int64 { + var base = Int64.ofInt(10); + var current = Int64.ofInt(0); + var multiplier = Int64.ofInt(1); + var sIsNegative = false; + + var s = StringTools.trim(sParam); + if (s.charAt(0) == "-") { + sIsNegative = true; + s = s.substring(1, s.length); + } + var len = s.length; + + for (i in 0...len) { + var digitInt = s.charCodeAt(len - 1 - i) - '0'.code; + + if (digitInt < 0 || digitInt > 9) { + throw "NumberFormatError"; + } + + if (digitInt != 0) { + var digit:Int64 = Int64.ofInt(digitInt); + if (sIsNegative) { + current = Int64.sub(current, Int64.mul(multiplier, digit)); + if (!Int64.isNeg(current)) { + throw "NumberFormatError: Underflow"; + } + } else { + current = Int64.add(current, Int64.mul(multiplier, digit)); + if (Int64.isNeg(current)) { + throw "NumberFormatError: Overflow"; + } + } + } + + multiplier = Int64.mul(multiplier, base); + } + return current; + } + + /** + Create `Int64` from given float. + **/ + public static function fromFloat(f:Float):Int64 { + if (Math.isNaN(f) || !Math.isFinite(f)) { + throw "Number is NaN or Infinite"; + } + + var noFractions = f - (f % 1); + + // 2^53-1 and -2^53+1: these are parseable without loss of precision. + // In theory 2^53 and -2^53 are parseable too, but then there's no way to + // distinguish 2^53 from 2^53+1 + // (i.e. trace(9007199254740992. + 1. > 9007199254740992.); // false!) + if (noFractions > 9007199254740991) { + throw "Conversion overflow"; + } + if (noFractions < -9007199254740991) { + throw "Conversion underflow"; + } + + var result = Int64.ofInt(0); + var neg = noFractions < 0; + var rest = neg ? -noFractions : noFractions; + + var i = 0; + while (rest >= 1) { + var curr = rest % 2; + rest = rest / 2; + if (curr >= 1) { + result = Int64.add(result, Int64.shl(Int64.ofInt(1), i)); + } + i++; + } + + if (neg) { + result = Int64.neg(result); + } + return result; + } +} diff --git a/build/linux64_569e52e/std/haxe/Json.hx b/build/linux64_569e52e/std/haxe/Json.hx new file mode 100644 index 0000000..c0fd2e5 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/Json.hx @@ -0,0 +1,62 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +/** + Cross-platform JSON API: it will automatically use the optimized native API if available. + Use `-D haxeJSON` to force usage of the Haxe implementation even if a native API is found: + This will provide extra encoding (but not decoding) features such as enums (replaced by their index) and StringMaps. + + @see https://haxe.org/manual/std-Json.html +**/ +class Json { + /** + Parses given JSON-encoded `text` and returns the resulting object. + + JSON objects are parsed into anonymous structures and JSON arrays + are parsed into `Array`. + + If given `text` is not valid JSON, an exception will be thrown. + + @see https://haxe.org/manual/std-Json-parsing.html + **/ + public static inline function parse(text:String):Dynamic { + return haxe.format.JsonParser.parse(text); + } + + /** + Encodes the given `value` and returns the resulting JSON string. + + If `replacer` is given and is not null, it is used to retrieve the + actual object to be encoded. The `replacer` function takes two parameters, + the key and the value being encoded. Initial key value is an empty string. + + If `space` is given and is not null, the result will be pretty-printed. + Successive levels will be indented by this string. + + @see https://haxe.org/manual/std-Json-encoding.html + **/ + public static inline function stringify(value:Dynamic, ?replacer:(key:Dynamic, value:Dynamic) -> Dynamic, ?space:String):String { + return haxe.format.JsonPrinter.print(value, replacer, space); + } +} diff --git a/build/linux64_569e52e/std/haxe/Log.hx b/build/linux64_569e52e/std/haxe/Log.hx new file mode 100644 index 0000000..08d8b7f --- /dev/null +++ b/build/linux64_569e52e/std/haxe/Log.hx @@ -0,0 +1,75 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +/** + Log primarily provides the `trace()` method, which is invoked upon a call to + `trace()` in Haxe code. +**/ +class Log { + /** + Format the output of `trace` before printing it. + **/ + public static function formatOutput(v:Dynamic, infos:Null):String { + var str = Std.string(v); + if (infos == null) + return str; + var pstr = infos.fileName + ":" + infos.lineNumber; + if (infos.customParams != null) + for (v in infos.customParams) + str += ", " + Std.string(v); + return pstr + ": " + str; + } + + /** + Outputs `v` in a platform-dependent way. + + The second parameter `infos` is injected by the compiler and contains + information about the position where the `trace()` call was made. + + This method can be rebound to a custom function: + + var oldTrace = haxe.Log.trace; // store old function + haxe.Log.trace = function(v, ?infos) { + // handle trace + } + ... + haxe.Log.trace = oldTrace; + + If it is bound to null, subsequent calls to `trace()` will cause an + exception. + **/ + public static dynamic function trace(v:Dynamic, ?infos:PosInfos):Void { + var str = formatOutput(v, infos); + #if js + if (js.Syntax.typeof(untyped console) != "undefined" && (untyped console).log != null) + (untyped console).log(str); + #elseif lua + untyped __define_feature__("use._hx_print", _hx_print(str)); + #elseif sys + Sys.println(str); + #else + throw new haxe.exceptions.NotImplementedException() + #end + } +} diff --git a/build/linux64_569e52e/std/haxe/MainLoop.hx b/build/linux64_569e52e/std/haxe/MainLoop.hx new file mode 100644 index 0000000..60f2f16 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/MainLoop.hx @@ -0,0 +1,186 @@ +package haxe; + +import haxe.EntryPoint; +#if (target.threaded && !cppia) +import sys.thread.EventLoop; +import sys.thread.Thread; +#end + +class MainEvent { + var f:Void->Void; + var prev:MainEvent; + var next:MainEvent; + + /** + Tells if the event can lock the process from exiting (default:true) + **/ + public var isBlocking:Bool = true; + + public var nextRun(default, null):Float; + public var priority(default, null):Int; + + function new(f, p) { + this.f = f; + this.priority = p; + nextRun = Math.NEGATIVE_INFINITY; + } + + /** + Delay the execution of the event for the given time, in seconds. + If t is null, the event will be run at tick() time. + **/ + public function delay(t:Null) { + nextRun = t == null ? Math.NEGATIVE_INFINITY : haxe.Timer.stamp() + t; + } + + /** + Call the event. Will do nothing if the event has been stopped. + **/ + public inline function call() { + if (f != null) + f(); + } + + /** + Stop the event from firing anymore. + **/ + public function stop() { + if (f == null) + return; + f = null; + nextRun = Math.NEGATIVE_INFINITY; + if (prev == null) + @:privateAccess MainLoop.pending = next; + else + prev.next = next; + if (next != null) + next.prev = prev; + } +} + +@:access(haxe.MainEvent) +class MainLoop { + + static var pending:MainEvent; + + public static var threadCount(get, never):Int; + + inline static function get_threadCount() + return EntryPoint.threadCount; + + public static function hasEvents() { + var p = pending; + while (p != null) { + if (p.isBlocking) + return true; + p = p.next; + } + return false; + } + + public static function addThread(f:Void->Void) { + EntryPoint.addThread(f); + } + + public static function runInMainThread(f:Void->Void) { + EntryPoint.runInMainThread(f); + } + + /** + Add a pending event to be run into the main loop. + **/ + public static function add(f:Void->Void, priority = 0) : MainEvent { + if (f == null) + throw "Event function is null"; + var e = new MainEvent(f, priority); + var head = pending; + if (head != null) + head.prev = e; + e.next = head; + pending = e; + return e; + } + + static function sortEvents() { + // pending = haxe.ds.ListSort.sort(pending, function(e1, e2) return e1.nextRun > e2.nextRun ? -1 : 1); + // we can't use directly ListSort because it requires prev/next to be public, which we don't want here + // we do then a manual inline, this also allow use to do a Float comparison of nextRun + var list = pending; + + if (list == null) + return; + + var insize = 1, nmerges, psize = 0, qsize = 0; + var p, q, e, tail:MainEvent; + + while (true) { + p = list; + list = null; + tail = null; + nmerges = 0; + while (p != null) { + nmerges++; + q = p; + psize = 0; + for (i in 0...insize) { + psize++; + q = q.next; + if (q == null) + break; + } + qsize = insize; + while (psize > 0 || (qsize > 0 && q != null)) { + if (psize == 0) { + e = q; + q = q.next; + qsize--; + } else if (qsize == 0 + || q == null + || (p.priority > q.priority || (p.priority == q.priority && p.nextRun <= q.nextRun))) { + e = p; + p = p.next; + psize--; + } else { + e = q; + q = q.next; + qsize--; + } + if (tail != null) + tail.next = e; + else + list = e; + e.prev = tail; + tail = e; + } + p = q; + } + tail.next = null; + if (nmerges <= 1) + break; + insize *= 2; + } + list.prev = null; // not cycling + pending = list; + } + + /** + Run the pending events. Return the time for next event. + **/ + static function tick() { + sortEvents(); + var e = pending; + var now = haxe.Timer.stamp(); + var wait = 1e9; + while (e != null) { + var next = e.next; + var wt = e.nextRun - now; + if (wt <= 0) { + wait = 0; + e.call(); + } else if (wait > wt) + wait = wt; + e = next; + } + return wait; + } +} diff --git a/build/linux64_569e52e/std/haxe/NativeStackTrace.hx b/build/linux64_569e52e/std/haxe/NativeStackTrace.hx new file mode 100644 index 0000000..d2ca552 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/NativeStackTrace.hx @@ -0,0 +1,15 @@ +package haxe; + +import haxe.CallStack.StackItem; + +/** + Do not use manually. +**/ +@:dox(hide) +@:noCompletion +extern class NativeStackTrace { + static public function saveStack(exception:Any):Void; + static public function callStack():Any; + static public function exceptionStack():Any; + static public function toHaxe(nativeStackTrace:Any, skip:Int = 0):Array; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/haxe/PosInfos.hx b/build/linux64_569e52e/std/haxe/PosInfos.hx new file mode 100644 index 0000000..944de6c --- /dev/null +++ b/build/linux64_569e52e/std/haxe/PosInfos.hx @@ -0,0 +1,42 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +/** + `PosInfos` is a magic type which can be used to generate position information + into the output for debugging use. + + If a function has a final optional argument of this type, i.e. + `(..., ?pos:haxe.PosInfos)`, each call to that function which does not assign + a value to that argument has its position added as call argument. + + This can be used to track positions of calls in e.g. a unit testing + framework. +**/ +typedef PosInfos = { + var fileName:String; + var lineNumber:Int; + var className:String; + var methodName:String; + var ?customParams:Array; +} diff --git a/build/linux64_569e52e/std/haxe/Resource.hx b/build/linux64_569e52e/std/haxe/Resource.hx new file mode 100644 index 0000000..ed92050 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/Resource.hx @@ -0,0 +1,80 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +/** + Resource can be used to access resources that were added through the + `--resource file@name` command line parameter. + + Depending on their type they can be obtained as `String` through + `getString(name)`, or as binary data through `getBytes(name)`. + + A list of all available resource names can be obtained from `listNames()`. +**/ +class Resource { + static var content:Array<{name:String, data:String, str:String}>; + + /** + Lists all available resource names. The resource name is the name part + of the `--resource file@name` command line parameter. + **/ + public static function listNames():Array { + return [for (x in content) x.name]; + } + + /** + Retrieves the resource identified by `name` as a `String`. + + If `name` does not match any resource name, `null` is returned. + **/ + public static function getString(name:String):String { + for (x in content) + if (x.name == name) { + if (x.str != null) + return x.str; + var b:haxe.io.Bytes = haxe.crypto.Base64.decode(x.data); + return b.toString(); + } + return null; + } + + /** + Retrieves the resource identified by `name` as an instance of + haxe.io.Bytes. + + If `name` does not match any resource name, `null` is returned. + **/ + public static function getBytes(name:String):haxe.io.Bytes { + for (x in content) + if (x.name == name) { + if (x.str != null) + return haxe.io.Bytes.ofString(x.str); + return haxe.crypto.Base64.decode(x.data); + } + return null; + } + + static function __init__() { + content = untyped __resources__(); + } +} diff --git a/build/linux64_569e52e/std/haxe/Rest.hx b/build/linux64_569e52e/std/haxe/Rest.hx new file mode 100644 index 0000000..40a52a2 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/Rest.hx @@ -0,0 +1,91 @@ +package haxe; + +import haxe.iterators.RestIterator; +import haxe.iterators.RestKeyValueIterator; + +private typedef NativeRest = Array; + +/** + A special type that represents a "rest" function argument. + + The special `...` syntax can be used for convenience and improved readability: + + ```haxe + function f(...rest:Int) { + $type(rest); // haxe.Rest + } + + f(1, 2, 3); + + final array = [1, 2, 3]; + f(...array); + ``` + + Should be used as a type for the last argument of a method, indicating that + an arbitrary number of arguments of the given type can be passed to that method. + + Allows to use array access by index to get values of rest arguments. + If the index exceeds the amount of rest arguments passed, the result is unspecified. +**/ +@:coreApi +abstract Rest(NativeRest) { + /** Amount of arguments passed as rest arguments */ + public var length(get,never):Int; + inline function get_length():Int + return this.length; + + /** + Create rest arguments using contents of `array`. + + WARNING: + Depending on a target platform modifying `array` after using this method + may affect the created `Rest` instance. + Use `Rest.of(array.copy())` to avoid that. + **/ + @:from static public inline function of(array:Array):Rest + return new Rest(array); + + inline function new(array:Array):Void + this = array; + + @:arrayAccess inline function get(index:Int):T + return this[index]; + + /** + Creates an array containing all the values of rest arguments. + **/ + @:to public #if !cppia inline #end function toArray():Array + return this.copy(); + + public inline function iterator():RestIterator + return new RestIterator(this); + + public inline function keyValueIterator():RestKeyValueIterator + return new RestKeyValueIterator(this); + + /** + Create a new rest arguments collection by appending `item` to this one. + **/ + public function append(item:T):Rest { + var result = this.copy(); + result.push(item); + return new Rest(result); + } + + /** + Create a new rest arguments collection by prepending this one with `item`. + **/ + public function prepend(item:T):Rest { + var result = this.copy(); + result.unshift(item); + return new Rest(result); + } + + public inline function toString():String { + #if (flash || js) + return '[${this.toString()}]'; + #else + return this.toString(); + #end + } +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/haxe/Serializer.hx b/build/linux64_569e52e/std/haxe/Serializer.hx new file mode 100644 index 0000000..411b85f --- /dev/null +++ b/build/linux64_569e52e/std/haxe/Serializer.hx @@ -0,0 +1,591 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +import haxe.ds.List; + +/** + The Serializer class can be used to encode values and objects into a `String`, + from which the `Unserializer` class can recreate the original representation. + + This class can be used in two ways: + + - create a `new Serializer()` instance, call its `serialize()` method with + any argument and finally retrieve the String representation from + `toString()` + - call `Serializer.run()` to obtain the serialized representation of a + single argument + + Serialization is guaranteed to work for all haxe-defined classes, but may + or may not work for instances of external/native classes. + + The specification of the serialization format can be found here: + +**/ +class Serializer { + /** + If the values you are serializing can contain circular references or + objects repetitions, you should set `USE_CACHE` to true to prevent + infinite loops. + + This may also reduce the size of serialization Strings at the expense of + performance. + + This value can be changed for individual instances of `Serializer` by + setting their `useCache` field. + **/ + public static var USE_CACHE = false; + + /** + Use constructor indexes for enums instead of names. + + This may reduce the size of serialization Strings, but makes them less + suited for long-term storage: If constructors are removed or added from + the enum, the indices may no longer match. + + This value can be changed for individual instances of `Serializer` by + setting their `useEnumIndex` field. + **/ + public static var USE_ENUM_INDEX = false; + + static var BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:"; + static var BASE64_CODES = null; + + var buf:StringBuf; + var cache:Array; + var shash:haxe.ds.StringMap; + var scount:Int; + + /** + The individual cache setting for `this` Serializer instance. + + See `USE_CACHE` for a complete description. + **/ + public var useCache:Bool; + + /** + The individual enum index setting for `this` Serializer instance. + + See `USE_ENUM_INDEX` for a complete description. + **/ + public var useEnumIndex:Bool; + + /** + Creates a new Serializer instance. + + Subsequent calls to `this.serialize` will append values to the + internal buffer of this String. Once complete, the contents can be + retrieved through a call to `this.toString`. + + Each `Serializer` instance maintains its own cache if `this.useCache` is + `true`. + **/ + public function new() { + buf = new StringBuf(); + cache = new Array(); + useCache = USE_CACHE; + useEnumIndex = USE_ENUM_INDEX; + shash = new haxe.ds.StringMap(); + scount = 0; + } + + /** + Return the String representation of `this` Serializer. + + The exact format specification can be found here: + https://haxe.org/manual/serialization/format + **/ + public function toString() { + return buf.toString(); + } + + /* prefixes : + a : array + b : hash + c : class + d : Float + e : reserved (float exp) + f : false + g : object end + h : array/list/hash end + i : Int + j : enum (by index) + k : NaN + l : list + m : -Inf + n : null + o : object + p : +Inf + q : haxe.ds.IntMap + r : reference + s : bytes (base64) + t : true + u : array nulls + v : date + w : enum + x : exception + y : urlencoded string + z : zero + A : Class + B : Enum + M : haxe.ds.ObjectMap + C : custom + */ + function serializeString(s:String) { + var x = shash.get(s); + if (x != null) { + buf.add("R"); + buf.add(x); + return; + } + shash.set(s, scount++); + #if old_serialize + // no more support for -D old_serialize due to 'j' reuse + #if error + #end + #end + buf.add("y"); + s = StringTools.urlEncode(s); + buf.add(s.length); + buf.add(":"); + buf.add(s); + } + + function serializeRef(v:Dynamic) { + #if js + var vt = js.Syntax.typeof(v); + #end + for (i in 0...cache.length) { + #if js + var ci = cache[i]; + if (js.Syntax.typeof(ci) == vt && ci == v) { + #else + if (cache[i] == v) { + #end + buf.add("r"); + buf.add(i); + return true; + } + } + cache.push(v); + return false; + } + + #if flash + // only the instance variables + + function serializeClassFields(v:Dynamic, c:Dynamic) { + var xml:flash.xml.XML = untyped __global__["flash.utils.describeType"](c); + var vars = xml.factory[0].child("variable"); + for (i in 0...vars.length()) { + var f = vars[i].attribute("name").toString(); + if (!v.hasOwnProperty(f)) + continue; + serializeString(f); + serialize(Reflect.field(v, f)); + } + buf.add("g"); + } + #end + + function serializeFields(v:{}) { + for (f in Reflect.fields(v)) { + serializeString(f); + serialize(Reflect.field(v, f)); + } + buf.add("g"); + } + + /** + Serializes `v`. + + All haxe-defined values and objects with the exception of functions can + be serialized. Serialization of external/native objects is not + guaranteed to work. + + The values of `this.useCache` and `this.useEnumIndex` may affect + serialization output. +**/ + public function serialize(v:Dynamic) { + switch (Type.typeof(v)) { + case TNull: + buf.add("n"); + case TInt: + var v:Int = v; + if (v == 0) { + buf.add("z"); + return; + } + buf.add("i"); + buf.add(v); + case TFloat: + var v:Float = v; + if (Math.isNaN(v)) + buf.add("k"); + else if (!Math.isFinite(v)) + buf.add(if (v < 0) "m" else "p"); + else { + buf.add("d"); + buf.add(v); + } + case TBool: + buf.add(if (v) "t" else "f"); + case TClass(c): + if (#if neko untyped c.__is_String #else c == String #end) { + serializeString(v); + return; + } + if (useCache && serializeRef(v)) + return; + switch (#if (neko || python) Type.getClassName(c) #else c #end) { + case #if (neko || python) "Array" #else cast Array #end: + var ucount = 0; + buf.add("a"); + #if (flash || python || hl) + var v:Array = v; + #end + var l = #if (neko || flash || php || java || python || hl || lua || eval) v.length #elseif cpp v.__length() #else __getField(v, + "length") #end; + for (i in 0...l) { + if (v[i] == null) + ucount++; + else { + if (ucount > 0) { + if (ucount == 1) + buf.add("n"); + else { + buf.add("u"); + buf.add(ucount); + } + ucount = 0; + } + serialize(v[i]); + } + } + if (ucount > 0) { + if (ucount == 1) + buf.add("n"); + else { + buf.add("u"); + buf.add(ucount); + } + } + buf.add("h"); + case #if (neko || python) "haxe.ds.List" #else cast List #end: + buf.add("l"); + var v:List = v; + for (i in v) + serialize(i); + buf.add("h"); + case #if (neko || python) "Date" #else cast Date #end: + var d:Date = v; + buf.add("v"); + buf.add(d.getTime()); + case #if (neko || python) "haxe.ds.StringMap" #else cast haxe.ds.StringMap #end: + buf.add("b"); + var v:haxe.ds.StringMap = v; + for (k in v.keys()) { + serializeString(k); + serialize(v.get(k)); + } + buf.add("h"); + case #if (neko || python) "haxe.ds.IntMap" #else cast haxe.ds.IntMap #end: + buf.add("q"); + var v:haxe.ds.IntMap = v; + for (k in v.keys()) { + buf.add(":"); + buf.add(k); + serialize(v.get(k)); + } + buf.add("h"); + case #if (neko || python) "haxe.ds.ObjectMap" #else cast haxe.ds.ObjectMap #end: + buf.add("M"); + var v:haxe.ds.ObjectMap = v; + for (k in v.keys()) { + #if (js || neko) + var id = Reflect.field(k, "__id__"); + Reflect.deleteField(k, "__id__"); + serialize(k); + Reflect.setField(k, "__id__", id); + #else + serialize(k); + #end + serialize(v.get(k)); + } + buf.add("h"); + case #if (neko || python) "haxe.io.Bytes" #else cast haxe.io.Bytes #end: + var v:haxe.io.Bytes = v; + #if neko + var chars = new String(base_encode(v.getData(), untyped BASE64.__s)); + buf.add("s"); + buf.add(chars.length); + buf.add(":"); + buf.add(chars); + #elseif php + var chars = new String(php.Global.base64_encode(v.getData())); + chars = php.Global.strtr(chars, '+/', '%:'); + buf.add("s"); + buf.add(chars.length); + buf.add(":"); + buf.add(chars); + #else + buf.add("s"); + buf.add(Math.ceil((v.length * 8) / 6)); + buf.add(":"); + + var i = 0; + var max = v.length - 2; + var b64 = BASE64_CODES; + if (b64 == null) { + b64 = new haxe.ds.Vector(BASE64.length); + for (i in 0...BASE64.length) + b64[i] = BASE64.charCodeAt(i); + BASE64_CODES = b64; + } + while (i < max) { + var b1 = v.get(i++); + var b2 = v.get(i++); + var b3 = v.get(i++); + + buf.addChar(b64[b1 >> 2]); + buf.addChar(b64[((b1 << 4) | (b2 >> 4)) & 63]); + buf.addChar(b64[((b2 << 2) | (b3 >> 6)) & 63]); + buf.addChar(b64[b3 & 63]); + } + if (i == max) { + var b1 = v.get(i++); + var b2 = v.get(i++); + buf.addChar(b64[b1 >> 2]); + buf.addChar(b64[((b1 << 4) | (b2 >> 4)) & 63]); + buf.addChar(b64[(b2 << 2) & 63]); + } else if (i == max + 1) { + var b1 = v.get(i++); + buf.addChar(b64[b1 >> 2]); + buf.addChar(b64[(b1 << 4) & 63]); + } + #end + default: + if (useCache) cache.pop(); + if (#if flash try + v.hxSerialize != null + catch (e:Dynamic) + false #elseif (java || python) Reflect.hasField(v, + "hxSerialize") #elseif php php.Global.method_exists(v, 'hxSerialize') #else v.hxSerialize != null #end) { + buf.add("C"); + serializeString(Type.getClassName(c)); + if (useCache) + cache.push(v); + v.hxSerialize(this); + buf.add("g"); + } else { + buf.add("c"); + serializeString(Type.getClassName(c)); + if (useCache) + cache.push(v); + #if flash + serializeClassFields(v, c); + #else + serializeFields(v); + #end + } + } + case TObject: + if (Std.isOfType(v, Class)) { + var className = Type.getClassName(v); + #if (flash || cpp) + // Currently, Enum and Class are the same for flash and cpp. + // use resolveEnum to test if it is actually an enum + if (Type.resolveEnum(className) != null) + buf.add("B") + else + #end + buf.add("A"); + serializeString(className); + } else if (Std.isOfType(v, Enum)) { + buf.add("B"); + serializeString(Type.getEnumName(v)); + } else { + if (useCache && serializeRef(v)) + return; + buf.add("o"); + serializeFields(v); + } + case TEnum(e): + if (useCache) { + if (serializeRef(v)) + return; + cache.pop(); + } + buf.add(useEnumIndex ? "j" : "w"); + serializeString(Type.getEnumName(e)); + #if neko + if (useEnumIndex) { + buf.add(":"); + buf.add(v.index); + } else + serializeString(new String(v.tag)); + buf.add(":"); + if (v.args == null) + buf.add(0); + else { + var l:Int = untyped __dollar__asize(v.args); + buf.add(l); + for (i in 0...l) + serialize(v.args[i]); + } + #elseif flash + if (useEnumIndex) { + buf.add(":"); + var i:Int = v.index; + buf.add(i); + } else + serializeString(v.tag); + buf.add(":"); + var pl:Array = v.params; + if (pl == null) + buf.add(0); + else { + buf.add(pl.length); + for (p in pl) + serialize(p); + } + #elseif cpp + var enumBase:cpp.EnumBase = v; + if (useEnumIndex) { + buf.add(":"); + buf.add(enumBase.getIndex()); + } else + serializeString(enumBase.getTag()); + buf.add(":"); + var len = enumBase.getParamCount(); + buf.add(len); + for (p in 0...len) + serialize(enumBase.getParamI(p)); + #elseif php + if (useEnumIndex) { + buf.add(":"); + buf.add(v.index); + } else + serializeString(v.tag); + buf.add(":"); + var l:Int = php.Syntax.code("count({0})", v.params); + if (l == 0 || v.params == null) + buf.add(0); + else { + buf.add(l); + for (i in 0...l) { + #if php + serialize(v.params[i]); + #end + } + } + #elseif (java || python || hl || eval) + if (useEnumIndex) { + buf.add(":"); + buf.add(Type.enumIndex(v)); + } else + serializeString(Type.enumConstructor(v)); + buf.add(":"); + var arr:Array = Type.enumParameters(v); + if (arr != null) { + buf.add(arr.length); + for (v in arr) + serialize(v); + } else { + buf.add("0"); + } + #elseif (js && !js_enums_as_arrays) + if (useEnumIndex) { + buf.add(":"); + buf.add(v._hx_index); + } else + serializeString(Type.enumConstructor(v)); + buf.add(":"); + var params = Type.enumParameters(v); + buf.add(params.length); + for (p in params) + serialize(p); + #else + if (useEnumIndex) { + buf.add(":"); + buf.add(v[1]); + } else + serializeString(v[0]); + buf.add(":"); + var l = __getField(v, "length"); + buf.add(l - 2); + for (i in 2...l) + serialize(v[i]); + #end + if (useCache) + cache.push(v); + case TFunction: + throw "Cannot serialize function"; + default: + #if neko + if (untyped (__i32__kind != null && __dollar__iskind(v, __i32__kind))) { + buf.add("i"); + buf.add(v); + return; + } + #end + throw "Cannot serialize " + Std.string(v); + } + } + + extern inline function __getField(o:Dynamic, f:String):Dynamic + return o[cast f]; + + public function serializeException(e:Dynamic) { + buf.add("x"); + #if flash + if (untyped __is__(e, __global__["Error"])) { + var e:flash.errors.Error = e; + var s = e.getStackTrace(); + if (s == null) + serialize(e.message); + else + serialize(s); + return; + } + #end + serialize(e); + } + + /** + Serializes `v` and returns the String representation. + + This is a convenience function for creating a new instance of + Serializer, serialize `v` into it and obtain the result through a call + to `toString()`. +**/ + public static function run(v:Dynamic) { + var s = new Serializer(); + s.serialize(v); + return s.toString(); + } + + #if neko + static var base_encode = neko.Lib.load("std", "base_encode", 2); + #end +} diff --git a/build/linux64_569e52e/std/haxe/SysTools.hx b/build/linux64_569e52e/std/haxe/SysTools.hx new file mode 100644 index 0000000..a99190f --- /dev/null +++ b/build/linux64_569e52e/std/haxe/SysTools.hx @@ -0,0 +1,106 @@ +package haxe; + +import haxe.ds.ReadOnlyArray; + +class SysTools { + /** + Character codes of the characters that will be escaped by `quoteWinArg(_, true)`. + **/ + public static final winMetaCharacters:ReadOnlyArray = [ + " ".code, "(".code, ")".code, "%".code, "!".code, "^".code, "\"".code, "<".code, ">".code, "&".code, "|".code, "\n".code, "\r".code, ",".code, ";".code + ]; + + /** + Returns a String that can be used as a single command line argument + on Unix. + The input will be quoted, or escaped if necessary. + **/ + public static function quoteUnixArg(argument:String):String { + // Based on cpython's shlex.quote(). + // https://hg.python.org/cpython/file/a3f076d4f54f/Lib/shlex.py#l278 + + if (argument == "") + return "''"; + + if (!~/[^a-zA-Z0-9_@%+=:,.\/-]/.match(argument)) + return argument; + + // use single quotes, and put single quotes into double quotes + // the string $'b is then quoted as '$'"'"'b' + return "'" + StringTools.replace(argument, "'", "'\"'\"'") + "'"; + } + + /** + Returns a String that can be used as a single command line argument + on Windows. + The input will be quoted, or escaped if necessary, such that the output + will be parsed as a single argument using the rule specified in + http://msdn.microsoft.com/en-us/library/ms880421 + + Examples: + ```haxe + quoteWinArg("abc") == "abc"; + quoteWinArg("ab c") == '"ab c"'; + ``` + **/ + public static function quoteWinArg(argument:String, escapeMetaCharacters:Bool):String { + // If there is no space, tab, back-slash, or double-quotes, and it is not an empty string. + if (!~/^(\/)?[^ \t\/\\"]+$/.match(argument)) { + // Based on cpython's subprocess.list2cmdline(). + // https://hg.python.org/cpython/file/50741316dd3a/Lib/subprocess.py#l620 + + var result = new StringBuf(); + var needquote = argument.indexOf(" ") != -1 || argument.indexOf("\t") != -1 || argument == "" || argument.indexOf("/") > 0; + + if (needquote) + result.add('"'); + + var bs_buf = new StringBuf(); + for (i in 0...argument.length) { + switch (argument.charCodeAt(i)) { + case "\\".code: + // Don't know if we need to double yet. + bs_buf.add("\\"); + case '"'.code: + // Double backslashes. + var bs = bs_buf.toString(); + result.add(bs); + result.add(bs); + bs_buf = new StringBuf(); + result.add('\\"'); + case var c: + // Normal char + if (bs_buf.length > 0) { + result.add(bs_buf.toString()); + bs_buf = new StringBuf(); + } + result.addChar(c); + } + } + + // Add remaining backslashes, if any. + result.add(bs_buf.toString()); + + if (needquote) { + result.add(bs_buf.toString()); + result.add('"'); + } + + argument = result.toString(); + } + + if (escapeMetaCharacters) { + var result = new StringBuf(); + for (i in 0...argument.length) { + var c = argument.charCodeAt(i); + if (winMetaCharacters.indexOf(c) >= 0) { + result.addChar("^".code); + } + result.addChar(c); + } + return result.toString(); + } else { + return argument; + } + } +} diff --git a/build/linux64_569e52e/std/haxe/Template.hx b/build/linux64_569e52e/std/haxe/Template.hx new file mode 100644 index 0000000..fbeda94 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/Template.hx @@ -0,0 +1,508 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +import haxe.ds.List; + +using StringTools; + +private enum TemplateExpr { + OpVar(v:String); + OpExpr(expr:Void->Dynamic); + OpIf(expr:Void->Dynamic, eif:TemplateExpr, eelse:TemplateExpr); + OpStr(str:String); + OpBlock(l:List); + OpForeach(expr:Void->Dynamic, loop:TemplateExpr); + OpMacro(name:String, params:List); +} + +private typedef Token = { + var s:Bool; + var p:String; + var l:Array; +} + +private typedef ExprToken = { + var s:Bool; + var p:String; +} + +/** + `Template` provides a basic templating mechanism to replace values in a source + String, and to have some basic logic. + + A complete documentation of the supported syntax is available at: + +**/ +class Template { + static var splitter = ~/(::[A-Za-z0-9_ ()&|!+=\/><*."-]+::|\$\$([A-Za-z0-9_-]+)\()/; + static var expr_splitter = ~/(\(|\)|[ \r\n\t]*"[^"]*"[ \r\n\t]*|[!+=\/><*.&|-]+)/; + static var expr_trim = ~/^[ ]*([^ ]+)[ ]*$/; + static var expr_int = ~/^[0-9]+$/; + static var expr_float = ~/^([+-]?)(?=\d|,\d)\d*(,\d*)?([Ee]([+-]?\d+))?$/; + + /** + Global replacements which are used across all `Template` instances. This + has lower priority than the context argument of `execute()`. + **/ + public static var globals:Dynamic = {}; + + // To avoid issues with DCE, keep the array iterator. + @:ifFeature("haxe.Template.run") static var hxKeepArrayIterator = [].iterator(); + + var expr:TemplateExpr; + var context:Dynamic; + var macros:Dynamic; + var stack:List; + var buf:StringBuf; + + /** + Creates a new `Template` instance from `str`. + + `str` is parsed into tokens, which are stored for internal use. This + means that multiple `execute()` operations on a single `Template` instance + are more efficient than one `execute()` operations on multiple `Template` + instances. + + If `str` is `null`, the result is unspecified. + **/ + public function new(str:String) { + var tokens = parseTokens(str); + expr = parseBlock(tokens); + if (!tokens.isEmpty()) + throw "Unexpected '" + tokens.first().s + "'"; + } + + /** + Executes `this` `Template`, taking into account `context` for + replacements and `macros` for callback functions. + + If `context` has a field `name`, its value replaces all occurrences of + `::name::` in the `Template`. Otherwise `Template.globals` is checked instead, + If `name` is not a field of that either, `::name::` is replaced with `null`. + + If `macros` has a field `name`, all occurrences of `$$name(args)` are + replaced with the result of calling that field. The first argument is + always the `resolve()` method, followed by the given arguments. + If `macros` has no such field, the result is unspecified. + + If `context` is `null`, the result is unspecified. If `macros` is `null`, + no macros are used. + **/ + public function execute(context:Dynamic, ?macros:Dynamic):String { + this.macros = if (macros == null) {} else macros; + this.context = context; + stack = new List(); + buf = new StringBuf(); + run(expr); + return buf.toString(); + } + + function resolve(v:String):Dynamic { + if (v == "__current__") + return context; + if (Reflect.isObject(context)) { + var value = Reflect.getProperty(context, v); + if (value != null || Reflect.hasField(context, v)) + return value; + } + for (ctx in stack) { + var value = Reflect.getProperty(ctx, v); + if (value != null || Reflect.hasField(ctx, v)) + return value; + } + return Reflect.field(globals, v); + } + + function parseTokens(data:String) { + var tokens = new List(); + while (splitter.match(data)) { + var p = splitter.matchedPos(); + if (p.pos > 0) + tokens.add({p: data.substr(0, p.pos), s: true, l: null}); + + // : ? + if (data.charCodeAt(p.pos) == 58) { + tokens.add({p: data.substr(p.pos + 2, p.len - 4), s: false, l: null}); + data = splitter.matchedRight(); + continue; + } + + // macro parse + var parp = p.pos + p.len; + var npar = 1; + var params = []; + var part = ""; + while (true) { + var c = data.charCodeAt(parp); + parp++; + if (c == 40) { + npar++; + } else if (c == 41) { + npar--; + if (npar <= 0) + break; + } else if (c == null) { + throw "Unclosed macro parenthesis"; + } + if (c == 44 && npar == 1) { + params.push(part); + part = ""; + } else { + part += String.fromCharCode(c); + } + } + params.push(part); + tokens.add({p: splitter.matched(2), s: false, l: params}); + data = data.substr(parp, data.length - parp); + } + if (data.length > 0) + tokens.add({p: data, s: true, l: null}); + return tokens; + } + + function parseBlock(tokens:List) { + var l = new List(); + while (true) { + var t = tokens.first(); + if (t == null) + break; + if (!t.s && (t.p == "end" || t.p == "else" || t.p.substr(0, 7) == "elseif ")) + break; + l.add(parse(tokens)); + } + if (l.length == 1) + return l.first(); + return OpBlock(l); + } + + function parse(tokens:List) { + var t = tokens.pop(); + var p = t.p; + if (t.s) + return OpStr(p); + // macro + if (t.l != null) { + var pe = new List(); + for (p in t.l) + pe.add(parseBlock(parseTokens(p))); + return OpMacro(p, pe); + } + function kwdEnd(kwd:String):Int { + var pos = -1; + var length = kwd.length; + if (p.substr(0, length) == kwd) { + pos = length; + for (c in p.substr(length)) { + switch c { + case ' '.code: pos++; + case _: break; + } + } + } + return pos; + } + // 'end' , 'else', 'elseif' can't be found here + var pos = kwdEnd("if"); + if (pos > 0) { + p = p.substr(pos, p.length - pos); + var e = parseExpr(p); + var eif = parseBlock(tokens); + var t = tokens.first(); + var eelse; + if (t == null) + throw "Unclosed 'if'"; + if (t.p == "end") { + tokens.pop(); + eelse = null; + } else if (t.p == "else") { + tokens.pop(); + eelse = parseBlock(tokens); + t = tokens.pop(); + if (t == null || t.p != "end") + throw "Unclosed 'else'"; + } else { // elseif + t.p = t.p.substr(4, t.p.length - 4); + eelse = parse(tokens); + } + return OpIf(e, eif, eelse); + } + var pos = kwdEnd("foreach"); + if (pos >= 0) { + p = p.substr(pos, p.length - pos); + var e = parseExpr(p); + var efor = parseBlock(tokens); + var t = tokens.pop(); + if (t == null || t.p != "end") + throw "Unclosed 'foreach'"; + return OpForeach(e, efor); + } + if (expr_splitter.match(p)) + return OpExpr(parseExpr(p)); + return OpVar(p); + } + + function parseExpr(data:String) { + var l = new List(); + var expr = data; + while (expr_splitter.match(data)) { + var p = expr_splitter.matchedPos(); + var k = p.pos + p.len; + if (p.pos != 0) + l.add({p: data.substr(0, p.pos), s: true}); + var p = expr_splitter.matched(0); + l.add({p: p, s: p.indexOf('"') >= 0}); + data = expr_splitter.matchedRight(); + } + if (data.length != 0) { + for (i => c in data) { + switch c { + case ' '.code: + case _: + l.add({p: data.substr(i), s: true}); + break; + } + } + } + var e:Void->Dynamic; + try { + e = makeExpr(l); + if (!l.isEmpty()) + throw l.first().p; + } catch (s:String) { + throw "Unexpected '" + s + "' in " + expr; + } + return function() { + try { + return e(); + } catch (exc:Dynamic) { + throw "Error : " + Std.string(exc) + " in " + expr; + } + } + } + + function makeConst(v:String):Void->Dynamic { + expr_trim.match(v); + v = expr_trim.matched(1); + if (v.charCodeAt(0) == 34) { + var str = v.substr(1, v.length - 2); + return function() return str; + } + if (expr_int.match(v)) { + var i = Std.parseInt(v); + return function() { + return i; + }; + } + if (expr_float.match(v)) { + var f = Std.parseFloat(v); + return function() { + return f; + }; + } + var me = this; + return function() { + return me.resolve(v); + }; + } + + function makePath(e:Void->Dynamic, l:List) { + var p = l.first(); + if (p == null || p.p != ".") + return e; + l.pop(); + var field = l.pop(); + if (field == null || !field.s) + throw field.p; + var f = field.p; + expr_trim.match(f); + f = expr_trim.matched(1); + return makePath(function() { + return Reflect.field(e(), f); + }, l); + } + + function makeExpr(l) { + return makePath(makeExpr2(l), l); + } + + function skipSpaces(l:List) { + var p = l.first(); + while (p != null) { + for (c in p.p) { + if (c != " ".code) { + return; + } + } + l.pop(); + p = l.first(); + } + } + + function makeExpr2(l:List):Void->Dynamic { + skipSpaces(l); + var p = l.pop(); + skipSpaces(l); + if (p == null) + throw ""; + if (p.s) + return makeConst(p.p); + switch (p.p) { + case "(": + skipSpaces(l); + var e1:Dynamic = makeExpr(l); + skipSpaces(l); + var p = l.pop(); + if (p == null || p.s) + throw p; + if (p.p == ")") + return e1; + skipSpaces(l); + var e2:Dynamic = makeExpr(l); + skipSpaces(l); + var p2 = l.pop(); + skipSpaces(l); + if (p2 == null || p2.p != ")") + throw p2; + return switch (p.p) { + case "+": function() { + return cast e1() + e2(); + }; + case "-": function() { + return cast e1() - e2(); + }; + case "*": function() { + return cast e1() * e2(); + }; + case "/": function() { + return cast e1() / e2(); + }; + case ">": function() { + return cast e1() > e2(); + }; + case "<": function() { + return cast e1() < e2(); + }; + case ">=": function() { + return cast e1() >= e2(); + }; + case "<=": function() { + return cast e1() <= e2(); + }; + case "==": function() { + return cast e1() == e2(); + }; + case "!=": function() { + return cast e1() != e2(); + }; + case "&&": function() { + return cast e1() && e2(); + }; + case "||": function() { + return cast e1() || e2(); + }; + default: throw "Unknown operation " + p.p; + } + case "!": + var e:Void->Dynamic = makeExpr(l); + return function() { + var v:Dynamic = e(); + return (v == null || v == false); + }; + case "-": + var e = makeExpr(l); + return function() { + return -e(); + }; + } + throw p.p; + } + + function run(e:TemplateExpr) { + switch (e) { + case OpVar(v): + buf.add(Std.string(resolve(v))); + case OpExpr(e): + buf.add(Std.string(e())); + case OpIf(e, eif, eelse): + var v:Dynamic = e(); + if (v == null || v == false) { + if (eelse != null) + run(eelse); + } else + run(eif); + case OpStr(str): + buf.add(str); + case OpBlock(l): + for (e in l) + run(e); + case OpForeach(e, loop): + var v:Dynamic = e(); + try { + var x:Dynamic = v.iterator(); + if (x.hasNext == null) + throw null; + v = x; + } catch (e:Dynamic) + try { + if (v.hasNext == null) + throw null; + } catch (e:Dynamic) { + throw "Cannot iter on " + v; + } + stack.push(context); + var v:Iterator = v; + for (ctx in v) { + context = ctx; + run(loop); + } + context = stack.pop(); + case OpMacro(m, params): + var v:Dynamic = Reflect.field(macros, m); + var pl = new Array(); + var old = buf; + pl.push(resolve); + for (p in params) { + switch (p) { + case OpVar(v): pl.push(resolve(v)); + default: + buf = new StringBuf(); + run(p); + pl.push(buf.toString()); + } + } + buf = old; + try { + buf.add(Std.string(Reflect.callMethod(macros, v, pl))); + } catch (e:Dynamic) { + var plstr = try pl.join(",") catch (e:Dynamic) "???"; + var msg = "Macro call " + m + "(" + plstr + ") failed (" + Std.string(e) + ")"; + #if neko + neko.Lib.rethrow(msg); + #else + throw msg; + #end + } + } + } +} diff --git a/build/linux64_569e52e/std/haxe/Timer.hx b/build/linux64_569e52e/std/haxe/Timer.hx new file mode 100644 index 0000000..754294f --- /dev/null +++ b/build/linux64_569e52e/std/haxe/Timer.hx @@ -0,0 +1,198 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +#if (target.threaded && !cppia) +import sys.thread.Thread; +import sys.thread.EventLoop; +#end + +/** + The `Timer` class allows you to create asynchronous timers on platforms that + support events. + + The intended usage is to create an instance of the `Timer` class with a given + interval, set its `run()` method to a custom function to be invoked and + eventually call `stop()` to stop the `Timer`. + + Note that a running `Timer` may or may not prevent the program to exit + automatically when `main()` returns. + + It is also possible to extend this class and override its `run()` method in + the child class. + + Notice for threaded targets: + `Timer` instances require threads they were created in to run with Haxe's event loops. + Main thread of a Haxe program always contains an event loop. For other cases use + `sys.thread.Thread.createWithEventLoop` and `sys.thread.Thread.runWithEventLoop` methods. +**/ +class Timer { + #if (flash || js) + private var id:Null; + #elseif (target.threaded && !cppia) + var thread:Thread; + var eventHandler:EventHandler; + #else + private var event:MainLoop.MainEvent; + #end + + /** + Creates a new timer that will run every `time_ms` milliseconds. + + After creating the Timer instance, it calls `this.run` repeatedly, + with delays of `time_ms` milliseconds, until `this.stop` is called. + + The first invocation occurs after `time_ms` milliseconds, not + immediately. + + The accuracy of this may be platform-dependent. + **/ + public function new(time_ms:Int) { + #if flash + var me = this; + id = untyped __global__["flash.utils.setInterval"](function() { + me.run(); + }, time_ms); + #elseif js + var me = this; + id = untyped setInterval(function() me.run(), time_ms); + #elseif (target.threaded && !cppia) + thread = Thread.current(); + eventHandler = thread.events.repeat(() -> this.run(), time_ms); + #else + var dt = time_ms / 1000; + event = MainLoop.add(function() { + @:privateAccess event.nextRun += dt; + run(); + }); + event.delay(dt); + #end + } + + /** + Stops `this` Timer. + + After calling this method, no additional invocations of `this.run` + will occur. + + It is not possible to restart `this` Timer once stopped. + **/ + public function stop() { + #if (flash || js) + if (id == null) + return; + #if flash + untyped __global__["flash.utils.clearInterval"](id); + #elseif js + untyped clearInterval(id); + #end + id = null; + #elseif (target.threaded && !cppia) + thread.events.cancel(eventHandler); + #else + if (event != null) { + event.stop(); + event = null; + } + #end + } + + /** + This method is invoked repeatedly on `this` Timer. + + It can be overridden in a subclass, or rebound directly to a custom + function: + + ```haxe + var timer = new haxe.Timer(1000); // 1000ms delay + timer.run = function() { ... } + ``` + + Once bound, it can still be rebound to different functions until `this` + Timer is stopped through a call to `this.stop`. + **/ + public dynamic function run() {} + + /** + Invokes `f` after `time_ms` milliseconds. + + This is a convenience function for creating a new Timer instance with + `time_ms` as argument, binding its `run()` method to `f` and then stopping + `this` Timer upon the first invocation. + + If `f` is `null`, the result is unspecified. + **/ + public static function delay(f:Void->Void, time_ms:Int) { + var t = new haxe.Timer(time_ms); + t.run = function() { + t.stop(); + f(); + }; + return t; + } + + /** + Measures the time it takes to execute `f`, in seconds with fractions. + + This is a convenience function for calculating the difference between + `Timer.stamp()` before and after the invocation of `f`. + + The difference is passed as argument to `Log.trace()`, with `"s"` appended + to denote the unit. The optional `pos` argument is passed through. + + If `f` is `null`, the result is unspecified. + **/ + public static function measure(f:Void->T, ?pos:PosInfos):T { + var t0 = stamp(); + var r = f(); + Log.trace((stamp() - t0) + "s", pos); + return r; + } + + /** + Returns a timestamp, in seconds with fractions. + + The value itself might differ depending on platforms, only differences + between two values make sense. + **/ + public static inline function stamp():Float { + #if flash + return flash.Lib.getTimer() / 1000; + #elseif js + #if nodejs + var hrtime = js.Syntax.code('process.hrtime()'); // [seconds, remaining nanoseconds] + return hrtime[0] + hrtime[1] / 1e9; + #else + return @:privateAccess HxOverrides.now() / 1000; + #end + #elseif cpp + return untyped __global__.__time_stamp(); + #elseif python + return Sys.cpuTime(); + #elseif sys + return Sys.time(); + #else + return 0; + #end + } +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/haxe/Ucs2.hx b/build/linux64_569e52e/std/haxe/Ucs2.hx new file mode 100644 index 0000000..0e3e6eb --- /dev/null +++ b/build/linux64_569e52e/std/haxe/Ucs2.hx @@ -0,0 +1,191 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +/** + Cross platform UCS2 string API. +**/ +abstract Ucs2(String) { + extern public var length(get, never):Int; + + extern inline function new(str:String):Void { + // this implementation only allows platforms which have native UCS2 String. + // other platforms should create a shadow class in their _std directory + #if !(flash || js) + throw "Ucs2 String not supported on this platform"; + #end + this = str; + } + + extern inline function get_length() { + return this.length; + } + + /** + Returns a Ucs2 where all characters of `this` Ucs2 are upper case. + + Affects the characters `a-z`. Other characters remain unchanged. + **/ + extern public inline function toUpperCase():Ucs2 { + return new Ucs2(this.toUpperCase()); + } + + /** + Returns a Ucs2 where all characters of `this` Ucs2 are lower case. + + Affects the characters `A-Z`. Other characters remain unchanged. + **/ + extern public inline function toLowerCase():Ucs2 { + return new Ucs2(this.toLowerCase()); + } + + /** + Returns the character at position `index` of `this` Ucs2. + + If `index` is negative or exceeds `this.length`, the empty Ucs2 "" + is returned. + **/ + extern public inline function charAt(index:Int):Ucs2 { + return new Ucs2(this.charAt(index)); + } + + /** + Returns the character code at position `index` of `this` Ucs2. + + If `index` is negative or exceeds `this.length`, `null` is returned. + + To obtain the character code of a single character, `"x".code` can be used + instead to extern public inline the character code at compile time. Note that this + only works on Ucs2 literals of length 1. + **/ + extern public inline function charCodeAt(index:Int):Null { + return this.charCodeAt(index); + } + + /** + Returns the position of the leftmost occurrence of `str` within `this` + Ucs2. + + If `startIndex` is given, the search is performed within the substring + of `this` Ucs2 starting from `startIndex`. Otherwise the search is + performed within `this` Ucs2. In either case, the returned position + is relative to the beginning of `this` Ucs2. + + If `str` cannot be found, -1 is returned. + **/ + extern public inline function indexOf(str:Ucs2, ?startIndex:Int):Int { + return this.indexOf(str.toNativeString(), startIndex); + } + + /** + Returns the position of the rightmost occurrence of `str` within `this` + Ucs2. + + If `startIndex` is given, the search is performed within the substring + of `this` Ucs2 from 0 to `startIndex`. Otherwise the search is + performed within `this` Ucs2. In either case, the returned position + is relative to the beginning of `this` Ucs2. + + If `str` cannot be found, -1 is returned. + **/ + extern public inline function lastIndexOf(str:Ucs2, ?startIndex:Int):Int { + return this.lastIndexOf(str.toNativeString(), startIndex); + } + + /** + Splits `this` Ucs2 at each occurrence of `delimiter`. + + If `this` Ucs2 is the empty Ucs2 "", the result is not consistent + across targets and may either be `[]` (on Js, Cpp) or `[""]`. + + If `delimiter` is the empty Ucs2 "", `this` Ucs2 is split into an + Array of `this.length` elements, where the elements correspond to the + characters of `this` Ucs2. + + If `delimiter` is not found within `this` Ucs2, the result is an Array + with one element, which equals `this` Ucs2. + + If `delimiter` is null, the result is unspecified. + + Otherwise, `this` Ucs2 is split into parts at each occurrence of + `delimiter`. If `this` Ucs2 starts (or ends) with `delimiter`, the + result Array contains a leading (or trailing) empty Ucs2 "" element. + Two subsequent delimiters also result in an empty Ucs2 "" element. + **/ + extern public inline function split(delimiter:Ucs2):Array { + return cast this.split(delimiter.toNativeString()); + } + + /** + Returns `len` characters of `this` Ucs2, starting at position `pos`. + + If `len` is omitted, all characters from position `pos` to the end of + `this` Ucs2 are included. + + If `pos` is negative, its value is calculated from the end of `this` + Ucs2 by `this.length + pos`. If this yields a negative value, 0 is + used instead. + + If the calculated position + `len` exceeds `this.length`, the characters + from that position to the end of `this` Ucs2 are returned. + + If `len` is negative, the result is unspecified. + **/ + extern public inline function substr(pos:Int, ?len:Int):Ucs2 { + return new Ucs2(this.substr(pos, len)); + } + + /** + Returns the part of `this` Ucs2 from `startIndex` to `endIndex`. + + If `startIndex` or `endIndex` are negative, 0 is used instead. + + If `startIndex` exceeds `endIndex`, they are swapped. + + If the (possibly swapped) `endIndex` is omitted or exceeds + `this.length`, `this.length` is used instead. + + If the (possibly swapped) `startIndex` exceeds `this.length`, the empty + Ucs2 "" is returned. + **/ + extern public inline function substring(startIndex:Int, ?endIndex:Int):Ucs2 { + return new Ucs2(this.substring(startIndex, endIndex)); + } + + /** + Returns the native underlying String. + **/ + extern public inline function toNativeString():String { + return this; + } + + /** + Returns the Ucs2 corresponding to the character code `code`. + + If `code` is negative or has another invalid value, the result is + unspecified. + **/ + extern public static inline function fromCharCode(code:Int):Ucs2 { + return new Ucs2(String.fromCharCode(code)); + } +} diff --git a/build/linux64_569e52e/std/haxe/Unserializer.hx b/build/linux64_569e52e/std/haxe/Unserializer.hx new file mode 100644 index 0000000..8dbfe7a --- /dev/null +++ b/build/linux64_569e52e/std/haxe/Unserializer.hx @@ -0,0 +1,537 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +using haxe.Unserializer; + +import haxe.ds.List; + +@:noDoc +typedef TypeResolver = { + function resolveClass(name:String):Class; + function resolveEnum(name:String):Enum; +} + +/** + The `Unserializer` class is the complement to the `Serializer` class. It parses + a serialization `String` and creates objects from the contained data. + + This class can be used in two ways: + + - create a `new Unserializer()` instance with a given serialization + String, then call its `unserialize()` method until all values are + extracted + - call `Unserializer.run()` to unserialize a single value from a given + String + + The specification of the serialization format can be found here: + +**/ +class Unserializer { + /** + This value can be set to use custom type resolvers. + + A type resolver finds a `Class` or `Enum` instance from a given `String`. + By default, the Haxe `Type` Api is used. + + A type resolver must provide two methods: + + 1. `resolveClass(name:String):Class` is called to determine a + `Class` from a class name + 2. `resolveEnum(name:String):Enum` is called to determine an + `Enum` from an enum name + + This value is applied when a new `Unserializer` instance is created. + Changing it afterwards has no effect on previously created instances. + **/ + public static var DEFAULT_RESOLVER:TypeResolver = new DefaultResolver(); + + static var BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:"; + + #if !neko + static var CODES = null; + + static function initCodes() { + var codes = #if flash new flash.utils.ByteArray(); #else new Array(); #end + for (i in 0...BASE64.length) + codes[StringTools.fastCodeAt(BASE64, i)] = i; + return codes; + } + #end + + var buf:String; + var pos:Int; + var length:Int; + var cache:Array; + var scache:Array; + var resolver:TypeResolver; + #if neko + var upos:Int; + #end + + /** + Creates a new Unserializer instance, with its internal buffer + initialized to `buf`. + + This does not parse `buf` immediately. It is parsed only when calls to + `this.unserialize` are made. + + Each Unserializer instance maintains its own cache. + **/ + public function new(buf:String) { + this.buf = buf; + length = this.buf.fastLength(); + pos = 0; + #if neko + upos = 0; + #end + scache = new Array(); + cache = new Array(); + var r = DEFAULT_RESOLVER; + if (r == null) { + r = new DefaultResolver(); + DEFAULT_RESOLVER = r; + } + resolver = r; + } + + /** + Sets the type resolver of `this` Unserializer instance to `r`. + + If `r` is `null`, a special resolver is used which returns `null` for all + input values. + + See `DEFAULT_RESOLVER` for more information on type resolvers. + **/ + public function setResolver(r) { + if (r == null) + resolver = NullResolver.instance; + else + resolver = r; + } + + /** + Gets the type resolver of `this` Unserializer instance. + + See `DEFAULT_RESOLVER` for more information on type resolvers. + **/ + public function getResolver() { + return resolver; + } + + inline function get(p:Int):Int { + #if php + return p >= length ? 0 : buf.fastCharCodeAt(p); + #else + return StringTools.fastCodeAt(buf, p); + #end + } + + function readDigits() { + var k = 0; + var s = false; + var fpos = pos; + while (true) { + var c = get(pos); + if (StringTools.isEof(c)) + break; + if (c == "-".code) { + if (pos != fpos) + break; + s = true; + pos++; + continue; + } + if (c < "0".code || c > "9".code) + break; + k = k * 10 + (c - "0".code); + pos++; + } + if (s) + k *= -1; + return k; + } + + function readFloat() { + var p1 = pos; + while (true) { + var c = get(pos); + if (StringTools.isEof(c)) + break; + // + - . , 0-9 + if ((c >= 43 && c < 58) || c == "e".code || c == "E".code) + pos++; + else + break; + } + return Std.parseFloat(buf.fastSubstr(p1, pos - p1)); + } + + function unserializeObject(o:{}) { + while (true) { + if (pos >= length) + throw "Invalid object"; + if (get(pos) == "g".code) + break; + var k:Dynamic = unserialize(); + if (!Std.isOfType(k, String)) + throw "Invalid object key"; + var v = unserialize(); + Reflect.setField(o, k, v); + } + pos++; + } + + function unserializeEnum(edecl:Enum, tag:String) { + if (get(pos++) != ":".code) + throw "Invalid enum format"; + var nargs = readDigits(); + if (nargs == 0) + return Type.createEnum(edecl, tag); + var args = new Array(); + while (nargs-- > 0) + args.push(unserialize()); + return Type.createEnum(edecl, tag, args); + } + + /** + Unserializes the next part of `this` Unserializer instance and returns + the according value. + + This function may call `this.resolver.resolveClass` to determine a + Class from a String, and `this.resolver.resolveEnum` to determine an + Enum from a String. + + If `this` Unserializer instance contains no more or invalid data, an + exception is thrown. + + This operation may fail on structurally valid data if a type cannot be + resolved or if a field cannot be set. This can happen when unserializing + Strings that were serialized on a different Haxe target, in which the + serialization side has to make sure not to include platform-specific + data. + + Classes are created from `Type.createEmptyInstance`, which means their + constructors are not called. + **/ + public function unserialize():Dynamic { + switch (get(pos++)) { + case "n".code: + return null; + case "t".code: + return true; + case "f".code: + return false; + case "z".code: + return 0; + case "i".code: + return readDigits(); + case "d".code: + return readFloat(); + case "y".code: + var len = readDigits(); + if (get(pos++) != ":".code || length - pos < len) + throw "Invalid string length"; + var s = buf.fastSubstr(pos, len); + pos += len; + s = StringTools.urlDecode(s); + scache.push(s); + return s; + case "k".code: + return Math.NaN; + case "m".code: + return Math.NEGATIVE_INFINITY; + case "p".code: + return Math.POSITIVE_INFINITY; + case "a".code: + var buf = buf; + var a = new Array(); + #if cpp + var cachePos = cache.length; + #end + cache.push(a); + while (true) { + var c = get(pos); + if (c == "h".code) { + pos++; + break; + } + if (c == "u".code) { + pos++; + var n = readDigits(); + a[a.length + n - 1] = null; + } else + a.push(unserialize()); + } + #if cpp + return cache[cachePos] = cpp.NativeArray.resolveVirtualArray(a); + #else + return a; + #end + case "o".code: + var o = {}; + cache.push(o); + unserializeObject(o); + return o; + case "r".code: + var n = readDigits(); + if (n < 0 || n >= cache.length) + throw "Invalid reference"; + return cache[n]; + case "R".code: + var n = readDigits(); + if (n < 0 || n >= scache.length) + throw "Invalid string reference"; + return scache[n]; + case "x".code: + throw unserialize(); + case "c".code: + var name = unserialize(); + var cl = resolver.resolveClass(name); + if (cl == null) + throw "Class not found " + name; + var o = Type.createEmptyInstance(cl); + cache.push(o); + unserializeObject(o); + return o; + case "w".code: + var name = unserialize(); + var edecl = resolver.resolveEnum(name); + if (edecl == null) + throw "Enum not found " + name; + var e = unserializeEnum(edecl, unserialize()); + cache.push(e); + return e; + case "j".code: + var name = unserialize(); + var edecl = resolver.resolveEnum(name); + if (edecl == null) + throw "Enum not found " + name; + pos++; /* skip ':' */ + var index = readDigits(); + var tag = Type.getEnumConstructs(edecl)[index]; + if (tag == null) + throw "Unknown enum index " + name + "@" + index; + var e = unserializeEnum(edecl, tag); + cache.push(e); + return e; + case "l".code: + var l = new List(); + cache.push(l); + var buf = buf; + while (get(pos) != "h".code) + l.add(unserialize()); + pos++; + return l; + case "b".code: + var h = new haxe.ds.StringMap(); + cache.push(h); + var buf = buf; + while (get(pos) != "h".code) { + var s = unserialize(); + h.set(s, unserialize()); + } + pos++; + return h; + case "q".code: + var h = new haxe.ds.IntMap(); + cache.push(h); + var buf = buf; + var c = get(pos++); + while (c == ":".code) { + var i = readDigits(); + h.set(i, unserialize()); + c = get(pos++); + } + if (c != "h".code) + throw "Invalid IntMap format"; + return h; + case "M".code: + var h = new haxe.ds.ObjectMap(); + cache.push(h); + var buf = buf; + while (get(pos) != "h".code) { + var s = unserialize(); + h.set(s, unserialize()); + } + pos++; + return h; + case "v".code: + var d; + if (get(pos) >= '0'.code && get(pos) <= '9'.code && get(pos + 1) >= '0'.code && get(pos + 1) <= '9'.code && get(pos + 2) >= '0'.code + && get(pos + 2) <= '9'.code && get(pos + 3) >= '0'.code && get(pos + 3) <= '9'.code && get(pos + 4) == '-'.code) { + // Included for backwards compatibility + d = Date.fromString(buf.fastSubstr(pos, 19)); + pos += 19; + } else + d = Date.fromTime(readFloat()); + cache.push(d); + return d; + case "s".code: + var len = readDigits(); + var buf = buf; + if (get(pos++) != ":".code || length - pos < len) + throw "Invalid bytes length"; + #if neko + var bytes = haxe.io.Bytes.ofData(base_decode(untyped buf.fastSubstr(pos, len).__s, untyped BASE64.__s)); + #elseif php + var phpEncoded = php.Global.strtr(buf.fastSubstr(pos, len), '%:', '+/'); + var bytes = haxe.io.Bytes.ofData(php.Global.base64_decode(phpEncoded)); + #else + var codes = CODES; + if (codes == null) { + codes = initCodes(); + CODES = codes; + } + var i = pos; + var rest = len & 3; + var size = (len >> 2) * 3 + ((rest >= 2) ? rest - 1 : 0); + var max = i + (len - rest); + var bytes = haxe.io.Bytes.alloc(size); + var bpos = 0; + while (i < max) { + var c1 = codes[StringTools.fastCodeAt(buf, i++)]; + var c2 = codes[StringTools.fastCodeAt(buf, i++)]; + bytes.set(bpos++, (c1 << 2) | (c2 >> 4)); + var c3 = codes[StringTools.fastCodeAt(buf, i++)]; + bytes.set(bpos++, (c2 << 4) | (c3 >> 2)); + var c4 = codes[StringTools.fastCodeAt(buf, i++)]; + bytes.set(bpos++, (c3 << 6) | c4); + } + if (rest >= 2) { + var c1 = codes[StringTools.fastCodeAt(buf, i++)]; + var c2 = codes[StringTools.fastCodeAt(buf, i++)]; + bytes.set(bpos++, (c1 << 2) | (c2 >> 4)); + if (rest == 3) { + var c3 = codes[StringTools.fastCodeAt(buf, i++)]; + bytes.set(bpos++, (c2 << 4) | (c3 >> 2)); + } + } + #end + pos += len; + cache.push(bytes); + return bytes; + case "C".code: + var name = unserialize(); + var cl = resolver.resolveClass(name); + if (cl == null) + throw "Class not found " + name; + var o:Dynamic = Type.createEmptyInstance(cl); + cache.push(o); + o.hxUnserialize(this); + if (get(pos++) != "g".code) + throw "Invalid custom data"; + return o; + case "A".code: + var name = unserialize(); + var cl = resolver.resolveClass(name); + if (cl == null) + throw "Class not found " + name; + return cl; + case "B".code: + var name = unserialize(); + var e = resolver.resolveEnum(name); + if (e == null) + throw "Enum not found " + name; + return e; + default: + } + pos--; + throw("Invalid char " + buf.fastCharAt(pos) + " at position " + pos); + } + + /** + Unserializes `v` and returns the according value. + + This is a convenience function for creating a new instance of + Unserializer with `v` as buffer and calling its `unserialize()` method + once. + **/ + public static function run(v:String):Dynamic { + return new Unserializer(v).unserialize(); + } + + #if neko + static var base_decode = neko.Lib.load("std", "base_decode", 2); + #end + + static inline function fastLength(s:String):Int { + #if php + return php.Global.strlen(s); + #else + return s.length; + #end + } + + static inline function fastCharCodeAt(s:String, pos:Int):Int { + #if php + return php.Global.ord((s:php.NativeString)[pos]); + #else + return s.charCodeAt(pos); + #end + } + + static inline function fastCharAt(s:String, pos:Int):String { + #if php + return (s:php.NativeString)[pos]; + #else + return s.charAt(pos); + #end + } + + static inline function fastSubstr(s:String, pos:Int, length:Int):String { + #if php + return php.Global.substr(s, pos, length); + #else + return s.substr(pos, length); + #end + } +} + +private class DefaultResolver { + public function new() {} + + public inline function resolveClass(name:String):Class + return Type.resolveClass(name); + + public inline function resolveEnum(name:String):Enum + return Type.resolveEnum(name); +} + +private class NullResolver { + function new() {} + + public inline function resolveClass(name:String):Class + return null; + + public inline function resolveEnum(name:String):Enum + return null; + + public static var instance(get, null):NullResolver; + + inline static function get_instance():NullResolver { + if (instance == null) + instance = new NullResolver(); + return instance; + } +} diff --git a/build/linux64_569e52e/std/haxe/Utf8.hx b/build/linux64_569e52e/std/haxe/Utf8.hx new file mode 100644 index 0000000..81db31b --- /dev/null +++ b/build/linux64_569e52e/std/haxe/Utf8.hx @@ -0,0 +1,114 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +/** + Since not all platforms guarantee that `String` always uses UTF-8 encoding, you + can use this cross-platform API to perform operations on such strings. +**/ +@:deprecated('haxe.Utf8 is deprecated. Use UnicodeString instead.') +class Utf8 { + var __b:String; + + /** + Allocate a new Utf8 buffer using an optional bytes size. + **/ + public function new(?size:Int) { + __b = ""; + } + + /** + Add the given UTF8 character code to the buffer. + **/ + public inline function addChar(c:Int):Void { + __b += String.fromCharCode(c); + } + + /** + Returns the buffer converted to a String. + **/ + public inline function toString():String { + return __b; + } + + /** + Call the `chars` function for each UTF8 char of the string. + **/ + public static function iter(s:String, chars:Int->Void) { + for (i in 0...s.length) + chars(s.charCodeAt(i)); + } + + /** + Encode the input ISO string into the corresponding UTF8 one. + **/ + public static function encode(s:String):String { + throw new haxe.exceptions.NotImplementedException(); + } + + /** + Decode an UTF8 string back to an ISO string. + Throw an exception if a given UTF8 character is not supported by the decoder. + **/ + public static function decode(s:String):String { + throw new haxe.exceptions.NotImplementedException(); + } + + /** + Similar to `String.charCodeAt` but uses the UTF8 character position. + **/ + public static inline function charCodeAt(s:String, index:Int):Int { + return s.charCodeAt(index); + } + + /** + Tells if the String is correctly encoded as UTF8. + **/ + public static inline function validate(s:String):Bool { + return true; + } + + /** + Returns the number of UTF8 chars of the String. + **/ + #if js + extern + #end + public static inline function length(s:String):Int { + return s.length; + } + + /** + Compare two UTF8 strings, character by character. + **/ + public static function compare(a:String, b:String):Int { + return a > b ? 1 : (a == b ? 0 : -1); + } + + /** + This is similar to `String.substr` but the `pos` and `len` parts are considering UTF8 characters. + **/ + public static inline function sub(s:String, pos:Int, len:Int):String { + return s.substr(pos, len); + } +} diff --git a/build/linux64_569e52e/std/haxe/ValueException.hx b/build/linux64_569e52e/std/haxe/ValueException.hx new file mode 100644 index 0000000..ec01892 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/ValueException.hx @@ -0,0 +1,38 @@ +package haxe; + +/** + An exception containing arbitrary value. + + This class is automatically used for throwing values, which don't extend `haxe.Exception` + or native exception type. + For example: + ```haxe + throw "Terrible error"; + ``` + will be compiled to + ```haxe + throw new ValueException("Terrible error"); + ``` +**/ +class ValueException extends Exception { + /** + Thrown value. + **/ + public var value(default, null):Any; + + public function new(value:Any, ?previous:Exception, ?native:Any):Void { + super(#if js js.Syntax.code('String({0})', value) #else Std.string(value) #end, previous, native); + this.value = value; + } + + /** + Extract an originally thrown value. + + This method must return the same value on subsequent calls. + Used internally for catching non-native exceptions. + Do _not_ override unless you know what you are doing. + **/ + override function unwrap():Any { + return value; + } +} diff --git a/build/linux64_569e52e/std/haxe/atomic/AtomicBool.hx b/build/linux64_569e52e/std/haxe/atomic/AtomicBool.hx new file mode 100644 index 0000000..2454985 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/atomic/AtomicBool.hx @@ -0,0 +1,55 @@ +package haxe.atomic; + +#if !(target.atomics || core_api) +#error "Atomic operations are not supported on this target!" +#end + +/** + Atomic boolean. + (js) The Atomics and SharedArrayBuffer objects need to be available. Errors will be thrown if this is not the case. +**/ +@:coreApi +abstract AtomicBool(AtomicInt) { + private inline function toInt(v:Bool):Int { + return v ? 1 : 0; + } + + private inline function toBool(v:Int):Bool { + return v == 1; + } + + public inline function new(value:Bool):Void { + this = new AtomicInt(toInt(value)); + } + + /** + Atomically compares the value of `a` with `expected` and replaces `a` with `replacement` if they are equal.. + Returns the original value of `a`. + **/ + public inline function compareExchange(expected:Bool, replacement:Bool):Bool { + return toBool(this.compareExchange(toInt(expected), toInt(replacement))); + } + + /** + Atomically exchanges `a` with `value`. + Returns the original value of `a`. + **/ + public inline function exchange(value:Bool):Bool { + return toBool(this.exchange(toInt(value))); + } + + /** + Atomically fetches the value of `a`. + **/ + public inline function load():Bool { + return toBool(this.load()); + } + + /** + Atomically stores `value` into `a`. + Returns the value that has been stored. + **/ + public inline function store(value:Bool):Bool { + return toBool(this.store(toInt(value))); + } +} diff --git a/build/linux64_569e52e/std/haxe/atomic/AtomicInt.hx b/build/linux64_569e52e/std/haxe/atomic/AtomicInt.hx new file mode 100644 index 0000000..2c49932 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/atomic/AtomicInt.hx @@ -0,0 +1,67 @@ +package haxe.atomic; + +#if !(target.atomics || core_api) +#error "This target does not support atomic operations." +#end + +/** + Atomic integer. + (js) The Atomics and SharedArrayBuffer objects need to be available. Errors will be thrown if this is not the case. +**/ +@:coreType +abstract AtomicInt { + public function new(value:Int):Void; + + /** + Atomically adds `b` to `a`. + Returns the original value of `a`. + **/ + public function add(b:Int):Int; + + /** + Atomically substracts `b` from `a`. + Returns the original value of `a`. + **/ + public function sub(b:Int):Int; + + /** + Atomically computes the bitwise and of `a` and `b` and stores it in `a`. + Returns the original value of `a`. + **/ + public function and(b:Int):Int; + + /** + Atomically computes the bitwise or of `a` and `b` and stores it in `a`. + Returns the original value of `a`. + **/ + public function or(b:Int):Int; + + /** + Atomically computes the bitwise xor of `a` and `b` and stores it in `a`. + Returns the original value of `a`. + **/ + public function xor(b:Int):Int; + + /** + Atomically compares the value of `a` with `expected` and replaces `a` with `replacement` if they are equal.. + Returns the original value of `a`. + **/ + public function compareExchange(expected:Int, replacement:Int):Int; + + /** + Atomically exchanges `a` with `value`. + Returns the original value of `a`. + **/ + public function exchange(value:Int):Int; + + /** + Atomically fetches the value of `a`. + **/ + public function load():Int; + + /** + Atomically stores `value` into `a`. + Returns the value that has been stored. + **/ + public function store(value:Int):Int; +} diff --git a/build/linux64_569e52e/std/haxe/atomic/AtomicObject.hx b/build/linux64_569e52e/std/haxe/atomic/AtomicObject.hx new file mode 100644 index 0000000..76cf260 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/atomic/AtomicObject.hx @@ -0,0 +1,44 @@ +package haxe.atomic; + +#if !(target.atomics || core_api) +#error "This target does not support atomic operations." +#end + +#if (js || hxcpp) +#error "JavaScript and Hxcpp do not support AtomicObject" +#end + +/** + Atomic object. Use with care, this does not magically make it thread-safe to mutate objects. + Not supported on JavaScript or C++. +**/ +@:coreType +abstract AtomicObject { + public function new(value:T):Void; + + /** + Atomically compares the value of `a` with `expected` and replaces `a` with `replacement` if they are equal.. + Returns the original value of `a`. + + Note that comparison is done by reference, and not by value. + While this is expected for most objects, this might give unexpected behaviour for strings. + **/ + public function compareExchange(expected:T, replacement:T):T; + + /** + Atomically exchanges `a` with `value`. + Returns the original value of `a`. + **/ + public function exchange(value:T):T; + + /** + Atomically fetches the value of `a`. + **/ + public function load():T; + + /** + Atomically stores `value` into `a`. + Returns the value that has been stored. + **/ + public function store(value:T):T; +} diff --git a/build/linux64_569e52e/std/haxe/crypto/Adler32.hx b/build/linux64_569e52e/std/haxe/crypto/Adler32.hx new file mode 100644 index 0000000..6bef9e1 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/crypto/Adler32.hx @@ -0,0 +1,76 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.crypto; + +/** + Calculates the Adler32 of the given Bytes. + */ +class Adler32 { + var a1:Int; + var a2:Int; + + public function new() { + a1 = 1; + a2 = 0; + } + + public function get() { + return (a2 << 16) | a1; + } + + public function update(b:haxe.io.Bytes, pos, len) { + var a1 = a1, a2 = a2; + for (p in pos...pos + len) { + var c = b.get(p); + a1 = (a1 + c) % 65521; + a2 = (a2 + a1) % 65521; + } + this.a1 = a1; + this.a2 = a2; + } + + public function equals(a:Adler32) { + return a.a1 == a1 && a.a2 == a2; + } + + public function toString() { + return StringTools.hex(a2, 8) + StringTools.hex(a1, 8); + } + + public static function read(i:haxe.io.Input) { + var a = new Adler32(); + var a2a = i.readByte(); + var a2b = i.readByte(); + var a1a = i.readByte(); + var a1b = i.readByte(); + a.a1 = (a1a << 8) | a1b; + a.a2 = (a2a << 8) | a2b; + return a; + } + + public static function make(b:haxe.io.Bytes) { + var a = new Adler32(); + a.update(b, 0, b.length); + return a.get(); + } +} diff --git a/build/linux64_569e52e/std/haxe/crypto/Base64.hx b/build/linux64_569e52e/std/haxe/crypto/Base64.hx new file mode 100644 index 0000000..aee6895 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/crypto/Base64.hx @@ -0,0 +1,74 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.crypto; + +/** + Allows one to encode/decode String and bytes using Base64 encoding. +**/ +class Base64 { + public static var CHARS(default, null) = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + public static var BYTES(default, null) = haxe.io.Bytes.ofString(CHARS); + + public static var URL_CHARS(default, null) = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; + public static var URL_BYTES(default, null) = haxe.io.Bytes.ofString(URL_CHARS); + + public static function encode(bytes:haxe.io.Bytes, complement = true):String { + var str = new BaseCode(BYTES).encodeBytes(bytes).toString(); + if (complement) + switch (bytes.length % 3) { + case 1: + str += "=="; + case 2: + str += "="; + default: + } + return str; + } + + public static function decode(str:String, complement = true):haxe.io.Bytes { + if (complement) + while (str.charCodeAt(str.length - 1) == "=".code) + str = str.substr(0, -1); + return new BaseCode(BYTES).decodeBytes(haxe.io.Bytes.ofString(str)); + } + + public static function urlEncode(bytes:haxe.io.Bytes, complement = false):String { + var str = new BaseCode(URL_BYTES).encodeBytes(bytes).toString(); + if (complement) + switch (bytes.length % 3) { + case 1: + str += "=="; + case 2: + str += "="; + default: + } + return str; + } + + public static function urlDecode(str:String, complement = false):haxe.io.Bytes { + if (complement) + while (str.charCodeAt(str.length - 1) == "=".code) + str = str.substr(0, -1); + return new BaseCode(URL_BYTES).decodeBytes(haxe.io.Bytes.ofString(str)); + } +} diff --git a/build/linux64_569e52e/std/haxe/crypto/BaseCode.hx b/build/linux64_569e52e/std/haxe/crypto/BaseCode.hx new file mode 100644 index 0000000..0bf636a --- /dev/null +++ b/build/linux64_569e52e/std/haxe/crypto/BaseCode.hx @@ -0,0 +1,142 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.crypto; + +/** + Allows one to encode/decode String and bytes using a power of two base dictionary. +**/ +class BaseCode { + var base:haxe.io.Bytes; + var nbits:Int; + var tbl:Array; + + public function new(base:haxe.io.Bytes) { + var len = base.length; + var nbits = 1; + while (len > 1 << nbits) + nbits++; + if (nbits > 8 || len != 1 << nbits) + throw "BaseCode : base length must be a power of two."; + this.base = base; + this.nbits = nbits; + } + + public function encodeBytes(b:haxe.io.Bytes):haxe.io.Bytes { + #if (neko && !interp) + return haxe.io.Bytes.ofData(base_encode(b.getData(), base.getData())); + #else + var nbits = this.nbits; + var base = this.base; + var size = Std.int(b.length * 8 / nbits); + var out = haxe.io.Bytes.alloc(size + (((b.length * 8) % nbits == 0) ? 0 : 1)); + var buf = 0; + var curbits = 0; + var mask = (1 << nbits) - 1; + var pin = 0; + var pout = 0; + while (pout < size) { + while (curbits < nbits) { + curbits += 8; + buf <<= 8; + buf |= b.get(pin++); + } + curbits -= nbits; + out.set(pout++, base.get((buf >> curbits) & mask)); + } + if (curbits > 0) + out.set(pout++, base.get((buf << (nbits - curbits)) & mask)); + return out; + #end + } + + function initTable() { + var tbl = new Array(); + for (i in 0...256) + tbl[i] = -1; + for (i in 0...base.length) + tbl[base.get(i)] = i; + this.tbl = tbl; + } + + public function decodeBytes(b:haxe.io.Bytes):haxe.io.Bytes { + #if (neko && !interp) + return haxe.io.Bytes.ofData(base_decode(b.getData(), base.getData())); + #else + var nbits = this.nbits; + var base = this.base; + if (this.tbl == null) + initTable(); + var tbl = this.tbl; + var size = (b.length * nbits) >> 3; + var out = haxe.io.Bytes.alloc(size); + var buf = 0; + var curbits = 0; + var pin = 0; + var pout = 0; + while (pout < size) { + while (curbits < 8) { + curbits += nbits; + buf <<= nbits; + var i = tbl[b.get(pin++)]; + if (i == -1) + throw "BaseCode : invalid encoded char"; + buf |= i; + } + curbits -= 8; + out.set(pout++, (buf >> curbits) & 0xFF); + } + return out; + #end + } + + public function encodeString(s:String) { + #if (neko && !interp) + return neko.NativeString.toString(base_encode(neko.NativeString.ofString(s), base.getData())); + #else + return encodeBytes(haxe.io.Bytes.ofString(s)).toString(); + #end + } + + public function decodeString(s:String) { + #if (neko && !interp) + return neko.NativeString.toString(base_decode(neko.NativeString.ofString(s), base.getData())); + #else + return decodeBytes(haxe.io.Bytes.ofString(s)).toString(); + #end + } + + public static function encode(s:String, base:String) { + var b = new BaseCode(haxe.io.Bytes.ofString(base)); + return b.encodeString(s); + } + + public static function decode(s:String, base:String) { + var b = new BaseCode(haxe.io.Bytes.ofString(base)); + return b.decodeString(s); + } + + #if neko + private static var base_encode = neko.Lib.load("std", "base_encode", 2); + private static var base_decode = neko.Lib.load("std", "base_decode", 2); + #end +} diff --git a/build/linux64_569e52e/std/haxe/crypto/Crc32.hx b/build/linux64_569e52e/std/haxe/crypto/Crc32.hx new file mode 100644 index 0000000..dc30a73 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/crypto/Crc32.hx @@ -0,0 +1,64 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.crypto; + +/** + Calculates the Crc32 of the given Bytes. + */ +class Crc32 { + var crc:Int; + + public inline function new() { + crc = 0xFFFFFFFF; + } + + public inline function byte(b:Int) { + var tmp = (crc ^ b) & 0xFF; + for (j in 0...8) + tmp = (tmp >>> 1) ^ (-(tmp & 1) & 0xEDB88320); + crc = (crc >>> 8) ^ tmp; + } + + public inline function update(b:haxe.io.Bytes, pos, len) { + var b = b.getData(); + for (i in pos...pos + len) { + var tmp = (crc ^ haxe.io.Bytes.fastGet(b, i)) & 0xFF; + for (j in 0...8) + tmp = (tmp >>> 1) ^ (-(tmp & 1) & 0xEDB88320); + crc = (crc >>> 8) ^ tmp; + } + } + + public inline function get() { + return crc ^ 0xFFFFFFFF; + } + + /** + Calculates the CRC32 of the given data bytes + **/ + public static function make(data:haxe.io.Bytes):Int { + var c = new Crc32(); + c.update(data, 0, data.length); + return c.get(); + } +} diff --git a/build/linux64_569e52e/std/haxe/crypto/Hmac.hx b/build/linux64_569e52e/std/haxe/crypto/Hmac.hx new file mode 100644 index 0000000..0137065 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/crypto/Hmac.hx @@ -0,0 +1,90 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.crypto; + +/** + Hash methods for Hmac calculation. +**/ +enum HashMethod { + MD5; + SHA1; + SHA256; +} + +/** + Calculates a Hmac of the given Bytes using a HashMethod. +**/ +class Hmac { + var method:HashMethod; + var blockSize:Int; + var length:Int; + + public function new(hashMethod:HashMethod) { + method = hashMethod; + blockSize = switch (hashMethod) { + case MD5, SHA1, SHA256: 64; + } + length = switch (hashMethod) { + case MD5: 16; + case SHA1: 20; + case SHA256: 32; + } + } + + inline function doHash(b:haxe.io.Bytes):haxe.io.Bytes { + return switch (method) { + case MD5: Md5.make(b); + case SHA1: Sha1.make(b); + case SHA256: Sha256.make(b); + } + } + + function nullPad(s:haxe.io.Bytes, chunkLen:Int):haxe.io.Bytes { + var r = chunkLen - (s.length % chunkLen); + if (r == chunkLen && s.length != 0) + return s; + var sb = new haxe.io.BytesBuffer(); + sb.add(s); + for (x in 0...r) + sb.addByte(0); + return sb.getBytes(); + } + + public function make(key:haxe.io.Bytes, msg:haxe.io.Bytes):haxe.io.Bytes { + if (key.length > blockSize) { + key = doHash(key); + } + key = nullPad(key, blockSize); + + var Ki = new haxe.io.BytesBuffer(); + var Ko = new haxe.io.BytesBuffer(); + for (i in 0...key.length) { + Ko.addByte(key.get(i) ^ 0x5c); + Ki.addByte(key.get(i) ^ 0x36); + } + // hash(Ko + hash(Ki + message)) + Ki.add(msg); + Ko.add(doHash(Ki.getBytes())); + return doHash(Ko.getBytes()); + } +} diff --git a/build/linux64_569e52e/std/haxe/crypto/Md5.hx b/build/linux64_569e52e/std/haxe/crypto/Md5.hx new file mode 100644 index 0000000..38194c3 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/crypto/Md5.hx @@ -0,0 +1,268 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.crypto; + +/** + Creates a MD5 of a String. +**/ +class Md5 { + public static function encode(s:String):String { + var m = new Md5(); + var h = m.doEncode(str2blks(s)); + return m.hex(h); + } + + public static function make(b:haxe.io.Bytes):haxe.io.Bytes { + var h = new Md5().doEncode(bytes2blks(b)); + var out = haxe.io.Bytes.alloc(16); + var p = 0; + for (i in 0...4) { + out.set(p++, h[i] & 0xFF); + out.set(p++, (h[i] >> 8) & 0xFF); + out.set(p++, (h[i] >> 16) & 0xFF); + out.set(p++, h[i] >>> 24); + } + return out; + } + + /* + * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message + * Digest Algorithm, as defined in RFC 1321. + * Copyright (C) Paul Johnston 1999 - 2000. + * Updated by Greg Holt 2000 - 2001. + * See http://pajhome.org.uk/site/legal.html for details. + */ + function new() {} + + function bitOR(a, b) { + var lsb = (a & 0x1) | (b & 0x1); + var msb31 = (a >>> 1) | (b >>> 1); + return (msb31 << 1) | lsb; + } + + function bitXOR(a, b) { + var lsb = (a & 0x1) ^ (b & 0x1); + var msb31 = (a >>> 1) ^ (b >>> 1); + return (msb31 << 1) | lsb; + } + + function bitAND(a, b) { + var lsb = (a & 0x1) & (b & 0x1); + var msb31 = (a >>> 1) & (b >>> 1); + return (msb31 << 1) | lsb; + } + + function addme(x, y) { + var lsw = (x & 0xFFFF) + (y & 0xFFFF); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xFFFF); + } + + function hex(a:Array) { + var str = ""; + var hex_chr = "0123456789abcdef"; + for (num in a) + for (j in 0...4) + str += hex_chr.charAt((num >> (j * 8 + 4)) & 0x0F) + hex_chr.charAt((num >> (j * 8)) & 0x0F); + return str; + } + + static function bytes2blks(b:haxe.io.Bytes) { + var nblk = ((b.length + 8) >> 6) + 1; + var blks = new Array(); + + // preallocate size + var blksSize = nblk * 16; + #if (neko || cpp || java || hl) + blks[blksSize - 1] = 0; + #end + + #if !(cpp || hl) // C++ will already initialize them with zeroes. + for (i in 0...blksSize) + blks[i] = 0; + #end + + var i = 0; + while (i < b.length) { + blks[i >> 2] |= b.get(i) << ((((b.length << 3) + i) & 3) << 3); + i++; + } + blks[i >> 2] |= 0x80 << (((b.length * 8 + i) % 4) * 8); + var l = b.length * 8; + var k = nblk * 16 - 2; + blks[k] = (l & 0xFF); + blks[k] |= ((l >>> 8) & 0xFF) << 8; + blks[k] |= ((l >>> 16) & 0xFF) << 16; + blks[k] |= ((l >>> 24) & 0xFF) << 24; + return blks; + } + + static function str2blks(str:String) { + #if target.unicode + var str = haxe.io.Bytes.ofString(str); + #end + var nblk = ((str.length + 8) >> 6) + 1; + var blks = new Array(); + + // preallocate size + var blksSize = nblk * 16; + #if (neko || eval || cpp || java || hl) + blks[blksSize - 1] = 0; + #end + + #if !(cpp || hl) // C++ will already initialize them with zeroes. + for (i in 0...blksSize) + blks[i] = 0; + #end + + var i = 0; + var max = str.length; + var l = max * 8; + while (i < max) { + blks[i >> 2] |= #if target.unicode str.get(i) #else StringTools.fastCodeAt(str, i) #end << (((l + i) % 4) * 8); + i++; + } + blks[i >> 2] |= 0x80 << (((l + i) % 4) * 8); + var k = nblk * 16 - 2; + blks[k] = (l & 0xFF); + blks[k] |= ((l >>> 8) & 0xFF) << 8; + blks[k] |= ((l >>> 16) & 0xFF) << 16; + blks[k] |= ((l >>> 24) & 0xFF) << 24; + return blks; + } + + function rol(num, cnt) { + return (num << cnt) | (num >>> (32 - cnt)); + } + + function cmn(q, a, b, x, s, t) { + return addme(rol((addme(addme(a, q), addme(x, t))), s), b); + } + + function ff(a, b, c, d, x, s, t) { + return cmn(bitOR(bitAND(b, c), bitAND((~b), d)), a, b, x, s, t); + } + + function gg(a, b, c, d, x, s, t) { + return cmn(bitOR(bitAND(b, d), bitAND(c, (~d))), a, b, x, s, t); + } + + function hh(a, b, c, d, x, s, t) { + return cmn(bitXOR(bitXOR(b, c), d), a, b, x, s, t); + } + + function ii(a, b, c, d, x, s, t) { + return cmn(bitXOR(c, bitOR(b, (~d))), a, b, x, s, t); + } + + function doEncode(x:Array):Array { + var a = 1732584193; + var b = -271733879; + var c = -1732584194; + var d = 271733878; + + var step; + + var i = 0; + while (i < x.length) { + var olda = a; + var oldb = b; + var oldc = c; + var oldd = d; + + step = 0; + a = ff(a, b, c, d, x[i + 0], 7, -680876936); + d = ff(d, a, b, c, x[i + 1], 12, -389564586); + c = ff(c, d, a, b, x[i + 2], 17, 606105819); + b = ff(b, c, d, a, x[i + 3], 22, -1044525330); + a = ff(a, b, c, d, x[i + 4], 7, -176418897); + d = ff(d, a, b, c, x[i + 5], 12, 1200080426); + c = ff(c, d, a, b, x[i + 6], 17, -1473231341); + b = ff(b, c, d, a, x[i + 7], 22, -45705983); + a = ff(a, b, c, d, x[i + 8], 7, 1770035416); + d = ff(d, a, b, c, x[i + 9], 12, -1958414417); + c = ff(c, d, a, b, x[i + 10], 17, -42063); + b = ff(b, c, d, a, x[i + 11], 22, -1990404162); + a = ff(a, b, c, d, x[i + 12], 7, 1804603682); + d = ff(d, a, b, c, x[i + 13], 12, -40341101); + c = ff(c, d, a, b, x[i + 14], 17, -1502002290); + b = ff(b, c, d, a, x[i + 15], 22, 1236535329); + a = gg(a, b, c, d, x[i + 1], 5, -165796510); + d = gg(d, a, b, c, x[i + 6], 9, -1069501632); + c = gg(c, d, a, b, x[i + 11], 14, 643717713); + b = gg(b, c, d, a, x[i + 0], 20, -373897302); + a = gg(a, b, c, d, x[i + 5], 5, -701558691); + d = gg(d, a, b, c, x[i + 10], 9, 38016083); + c = gg(c, d, a, b, x[i + 15], 14, -660478335); + b = gg(b, c, d, a, x[i + 4], 20, -405537848); + a = gg(a, b, c, d, x[i + 9], 5, 568446438); + d = gg(d, a, b, c, x[i + 14], 9, -1019803690); + c = gg(c, d, a, b, x[i + 3], 14, -187363961); + b = gg(b, c, d, a, x[i + 8], 20, 1163531501); + a = gg(a, b, c, d, x[i + 13], 5, -1444681467); + d = gg(d, a, b, c, x[i + 2], 9, -51403784); + c = gg(c, d, a, b, x[i + 7], 14, 1735328473); + b = gg(b, c, d, a, x[i + 12], 20, -1926607734); + a = hh(a, b, c, d, x[i + 5], 4, -378558); + d = hh(d, a, b, c, x[i + 8], 11, -2022574463); + c = hh(c, d, a, b, x[i + 11], 16, 1839030562); + b = hh(b, c, d, a, x[i + 14], 23, -35309556); + a = hh(a, b, c, d, x[i + 1], 4, -1530992060); + d = hh(d, a, b, c, x[i + 4], 11, 1272893353); + c = hh(c, d, a, b, x[i + 7], 16, -155497632); + b = hh(b, c, d, a, x[i + 10], 23, -1094730640); + a = hh(a, b, c, d, x[i + 13], 4, 681279174); + d = hh(d, a, b, c, x[i + 0], 11, -358537222); + c = hh(c, d, a, b, x[i + 3], 16, -722521979); + b = hh(b, c, d, a, x[i + 6], 23, 76029189); + a = hh(a, b, c, d, x[i + 9], 4, -640364487); + d = hh(d, a, b, c, x[i + 12], 11, -421815835); + c = hh(c, d, a, b, x[i + 15], 16, 530742520); + b = hh(b, c, d, a, x[i + 2], 23, -995338651); + a = ii(a, b, c, d, x[i + 0], 6, -198630844); + d = ii(d, a, b, c, x[i + 7], 10, 1126891415); + c = ii(c, d, a, b, x[i + 14], 15, -1416354905); + b = ii(b, c, d, a, x[i + 5], 21, -57434055); + a = ii(a, b, c, d, x[i + 12], 6, 1700485571); + d = ii(d, a, b, c, x[i + 3], 10, -1894986606); + c = ii(c, d, a, b, x[i + 10], 15, -1051523); + b = ii(b, c, d, a, x[i + 1], 21, -2054922799); + a = ii(a, b, c, d, x[i + 8], 6, 1873313359); + d = ii(d, a, b, c, x[i + 15], 10, -30611744); + c = ii(c, d, a, b, x[i + 6], 15, -1560198380); + b = ii(b, c, d, a, x[i + 13], 21, 1309151649); + a = ii(a, b, c, d, x[i + 4], 6, -145523070); + d = ii(d, a, b, c, x[i + 11], 10, -1120210379); + c = ii(c, d, a, b, x[i + 2], 15, 718787259); + b = ii(b, c, d, a, x[i + 9], 21, -343485551); + + a = addme(a, olda); + b = addme(b, oldb); + c = addme(c, oldc); + d = addme(d, oldd); + + i += 16; + } + return [a, b, c, d]; + } +} diff --git a/build/linux64_569e52e/std/haxe/crypto/Sha1.hx b/build/linux64_569e52e/std/haxe/crypto/Sha1.hx new file mode 100644 index 0000000..d1ca641 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/crypto/Sha1.hx @@ -0,0 +1,172 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.crypto; + +/** + Creates a Sha1 of a String. +**/ +class Sha1 { + public static function encode(s:String):String { + var sh = new Sha1(); + var h = sh.doEncode(str2blks(s)); + return sh.hex(h); + } + + public static function make(b:haxe.io.Bytes):haxe.io.Bytes { + var h = new Sha1().doEncode(bytes2blks(b)); + var out = haxe.io.Bytes.alloc(20); + var p = 0; + for (i in 0...5) { + out.set(p++, h[i] >>> 24); + out.set(p++, (h[i] >> 16) & 0xFF); + out.set(p++, (h[i] >> 8) & 0xFF); + out.set(p++, h[i] & 0xFF); + } + return out; + } + + function new() {} + + function doEncode(x:Array):Array { + var w = new Array(); + + var a = 0x67452301; + var b = 0xEFCDAB89; + var c = 0x98BADCFE; + var d = 0x10325476; + var e = 0xC3D2E1F0; + + var i = 0; + while (i < x.length) { + var olda = a; + var oldb = b; + var oldc = c; + var oldd = d; + var olde = e; + + var j = 0; + while (j < 80) { + if (j < 16) + w[j] = x[i + j]; + else + w[j] = rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1); + var t = rol(a, 5) + ft(j, b, c, d) + e + w[j] + kt(j); + e = d; + d = c; + c = rol(b, 30); + b = a; + a = t; + j++; + } + a += olda; + b += oldb; + c += oldc; + d += oldd; + e += olde; + i += 16; + } + return [a, b, c, d, e]; + } + + /** + Convert a string to a sequence of 16-word blocks, stored as an array. + Append padding bits and the length, as described in the SHA1 standard. + **/ + static function str2blks(s:String):Array { + #if target.unicode + var s = haxe.io.Bytes.ofString(s); + #end + var nblk = ((s.length + 8) >> 6) + 1; + var blks = new Array(); + + for (i in 0...nblk * 16) + blks[i] = 0; + for (i in 0...s.length) { + var p = i >> 2; + blks[p] |= #if target.unicode s.get(i) #else StringTools.fastCodeAt(s, i) #end << (24 - ((i & 3) << 3)); + } + var i = s.length; + var p = i >> 2; + blks[p] |= 0x80 << (24 - ((i & 3) << 3)); + blks[nblk * 16 - 1] = s.length * 8; + return blks; + } + + static function bytes2blks(b:haxe.io.Bytes):Array { + var nblk = ((b.length + 8) >> 6) + 1; + var blks = new Array(); + + for (i in 0...nblk * 16) + blks[i] = 0; + for (i in 0...b.length) { + var p = i >> 2; + blks[p] |= b.get(i) << (24 - ((i & 3) << 3)); + } + var i = b.length; + var p = i >> 2; + blks[p] |= 0x80 << (24 - ((i & 3) << 3)); + blks[nblk * 16 - 1] = b.length * 8; + return blks; + } + + /** + Bitwise rotate a 32-bit number to the left + **/ + inline function rol(num:Int, cnt:Int):Int { + return (num << cnt) | (num >>> (32 - cnt)); + } + + /** + Perform the appropriate triplet combination function for the current iteration + **/ + function ft(t:Int, b:Int, c:Int, d:Int):Int { + if (t < 20) + return (b & c) | ((~b) & d); + if (t < 40) + return b ^ c ^ d; + if (t < 60) + return (b & c) | (b & d) | (c & d); + return b ^ c ^ d; + } + + /** + Determine the appropriate additive constant for the current iteration + **/ + function kt(t:Int):Int { + if (t < 20) + return 0x5A827999; + if (t < 40) + return 0x6ED9EBA1; + if (t < 60) + return 0x8F1BBCDC; + return 0xCA62C1D6; + } + + function hex(a:Array) { + var str = ""; + for (num in a) { + str += StringTools.hex(num, 8); + } + return str.toLowerCase(); + } +} diff --git a/build/linux64_569e52e/std/haxe/crypto/Sha224.hx b/build/linux64_569e52e/std/haxe/crypto/Sha224.hx new file mode 100644 index 0000000..7623fc0 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/crypto/Sha224.hx @@ -0,0 +1,191 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of Charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERChANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.crypto; + +/** + Creates a Sha224 of a String. +**/ +class Sha224 { + public static function encode(s:String):String { + var sh = new Sha224(); + var h = sh.doEncode(s, s.length * 8); + return sh.hex(h); + } + + public static function make(b:haxe.io.Bytes):haxe.io.Bytes { + var h = new Sha224().doEncode(b.toString(), b.length * 8); + var out = haxe.io.Bytes.alloc(28); + var p = 0; + for (i in 0...8) { + out.set(p++, h[i] >>> 24); + out.set(p++, (h[i] >> 16) & 0xFF); + out.set(p++, (h[i] >> 8) & 0xFF); + out.set(p++, h[i] & 0xFF); + } + return out; + } + + public function new() {} + + function doEncode(str:String, strlen:Int):Array { + var K:Array = [ + 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, + 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, + 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, + 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, + 0xE49B69C1, 0xEFBE4786, 0xFC19DC6, 0x240CA1CC, + 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, + 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, + 0xC6E00BF3, 0xD5A79147, 0x6CA6351, 0x14292967, + 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, + 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, + 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, + 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, + 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, + 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, + 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, + 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2 + ]; + var HASH:Array = [ + 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, + 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 + ]; + var W = new Array(); + W[64] = 0; + + var a:Int, b:Int, c:Int, d:Int, e:Int, f:Int, g:Int, h:Int, i:Int, j:Int; + var T1, T2; + var i:Int = 0; + var blocks:Array = str2blks(str); + blocks[strlen >> 5] |= 0x80 << (24 - strlen % 32); + blocks[((strlen + 64 >> 9) << 4) + 15] = strlen; + + while (i < blocks.length) { + a = HASH[0]; + b = HASH[1]; + c = HASH[2]; + d = HASH[3]; + e = HASH[4]; + f = HASH[5]; + g = HASH[6]; + h = HASH[7]; + + for (j in 0...64) { + if (j < 16) { + W[j] = blocks[j + i]; + } else { + W[j] = safeAdd(safeAdd(safeAdd(Gamma1(W[j - 2]), W[j - 7]), Gamma0(W[j - 15])), W[j - 16]); + } + + T1 = safeAdd(safeAdd(safeAdd(safeAdd(h, Sigma1(e)), Ch(e, f, g)), K[j]), W[j]); + T2 = safeAdd(Sigma0(a), Maj(a, b, c)); + + h = g; + g = f; + f = e; + e = safeAdd(d, T1); + d = c; + c = b; + b = a; + a = safeAdd(T1, T2); + } + + HASH[0] = safeAdd(a, HASH[0]); + HASH[1] = safeAdd(b, HASH[1]); + HASH[2] = safeAdd(c, HASH[2]); + HASH[3] = safeAdd(d, HASH[3]); + HASH[4] = safeAdd(e, HASH[4]); + HASH[5] = safeAdd(f, HASH[5]); + HASH[6] = safeAdd(g, HASH[6]); + HASH[7] = safeAdd(h, HASH[7]); + i += 16; + } + return HASH; + } + + static function str2blks(s:String):Array { + var nblk = ((s.length + 8) >> 6) + 1; + var blks = new Array(); + for (i in 0...nblk * 16) + blks[i] = 0; + for (i in 0...s.length) { + var p = i >> 2; + blks[p] |= s.charCodeAt(i) << (24 - ((i & 3) << 3)); + } + var i = s.length; + var p = i >> 2; + blks[p] |= 0x80 << (24 - ((i & 3) << 3)); + blks[nblk * 16 - 1] = s.length * 8; + return blks; + } + + extern inline static function safeAdd(x, y) { + var lsw = (x & 0xFFFF) + (y & 0xFFFF); + var msw = (x >>> 16) + (y >>> 16) + (lsw >>> 16); + return ((msw & 0xFFFF) << 16) | (lsw & 0xFFFF); + } + + // ++ + extern inline function ROTR(X, n) { + return (X >>> n) | (X << (32 - n)); + } + + // ++ + extern inline function SHR(X, n) { + return (X >>> n); + } + + // ++ + extern inline function Ch(x, y, z) { + return ((x & y) ^ ((~x) & z)); + } + + // ++ + extern inline function Maj(x, y, z) { + return ((x & y) ^ (x & z) ^ (y & z)); + } + + extern inline function Sigma0(x) { + return ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22); + } + + extern inline function Sigma1(x) { + return ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25); + } + + extern inline function Gamma0(x) { + return ROTR(x, 7) ^ ROTR(x, 18) ^ SHR(x, 3); + } + + extern inline function Gamma1(x) { + return ROTR(x, 17) ^ ROTR(x, 19) ^ SHR(x, 10); + } + + function hex(a:Array) { + var str = ""; + for (num in a) { + str += StringTools.hex(num, 8); + } + return str.substring(0, 56).toLowerCase(); + } +} diff --git a/build/linux64_569e52e/std/haxe/crypto/Sha256.hx b/build/linux64_569e52e/std/haxe/crypto/Sha256.hx new file mode 100644 index 0000000..0fbf1a4 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/crypto/Sha256.hx @@ -0,0 +1,195 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.crypto; + +/** + Creates a Sha256 of a String. +**/ +class Sha256 { + public static function encode(s:String):String { + var sh = new Sha256(); + var h = sh.doEncode(str2blks(s), s.length * 8); + return sh.hex(h); + } + + public static function make(b:haxe.io.Bytes):haxe.io.Bytes { + var h = new Sha256().doEncode(bytes2blks(b), b.length * 8); + var out = haxe.io.Bytes.alloc(32); + var p = 0; + for (i in 0...8) { + out.set(p++, h[i] >>> 24); + out.set(p++, (h[i] >> 16) & 0xFF); + out.set(p++, (h[i] >> 8) & 0xFF); + out.set(p++, h[i] & 0xFF); + } + return out; + } + + function new() {} + + function doEncode(m:Array, l:Int):Array { + var K:Array = [ + 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, + 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, 0xE49B69C1, 0xEFBE4786, 0xFC19DC6, 0x240CA1CC, 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, + 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, 0xC6E00BF3, 0xD5A79147, 0x6CA6351, 0x14292967, 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, + 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, + 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, + 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2 + ]; + var HASH:Array = [ + 0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, + 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19 + ]; + + var W = new Array(); + W[64] = 0; + var a:Int, b:Int, c:Int, d:Int, e:Int, f:Int, g:Int, h:Int; + var T1, T2; + m[l >> 5] |= 0x80 << (24 - l % 32); + m[((l + 64 >> 9) << 4) + 15] = l; + var i:Int = 0; + while (i < m.length) { + a = HASH[0]; + b = HASH[1]; + c = HASH[2]; + d = HASH[3]; + e = HASH[4]; + f = HASH[5]; + g = HASH[6]; + h = HASH[7]; + for (j in 0...64) { + if (j < 16) + W[j] = m[j + i]; + else + W[j] = safeAdd(safeAdd(safeAdd(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]); + T1 = safeAdd(safeAdd(safeAdd(safeAdd(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]); + T2 = safeAdd(Sigma0256(a), Maj(a, b, c)); + h = g; + g = f; + f = e; + e = safeAdd(d, T1); + d = c; + c = b; + b = a; + a = safeAdd(T1, T2); + } + HASH[0] = safeAdd(a, HASH[0]); + HASH[1] = safeAdd(b, HASH[1]); + HASH[2] = safeAdd(c, HASH[2]); + HASH[3] = safeAdd(d, HASH[3]); + HASH[4] = safeAdd(e, HASH[4]); + HASH[5] = safeAdd(f, HASH[5]); + HASH[6] = safeAdd(g, HASH[6]); + HASH[7] = safeAdd(h, HASH[7]); + i += 16; + } + return HASH; + } + + /** + Convert a string to a sequence of 16-word blocks, stored as an array. + Append padding bits and the length, as described in the SHA1 standard. + **/ + static function str2blks(s:String):Array { + #if target.unicode + var s = haxe.io.Bytes.ofString(s); + #end + var nblk = ((s.length + 8) >> 6) + 1; + var blks = new Array(); + + for (i in 0...nblk * 16) + blks[i] = 0; + for (i in 0...s.length) { + var p = i >> 2; + blks[p] |= #if target.unicode s.get(i) #else s.charCodeAt(i) #end << (24 - ((i & 3) << 3)); + } + var i = s.length; + var p = i >> 2; + blks[p] |= 0x80 << (24 - ((i & 3) << 3)); + blks[nblk * 16 - 1] = s.length * 8; + return blks; + } + + static function bytes2blks(b:haxe.io.Bytes):Array { + var nblk = ((b.length + 8) >> 6) + 1; + var blks = new Array(); + + for (i in 0...nblk * 16) + blks[i] = 0; + for (i in 0...b.length) { + var p = i >> 2; + blks[p] |= b.get(i) << (24 - ((i & 3) << 3)); + } + var i = b.length; + var p = i >> 2; + blks[p] |= 0x80 << (24 - ((i & 3) << 3)); + blks[nblk * 16 - 1] = b.length * 8; + return blks; + } + + extern inline function S(X, n) { + return (X >>> n) | (X << (32 - n)); + } + + extern inline function R(X, n) { + return (X >>> n); + } + + extern inline function Ch(x, y, z) { + return ((x & y) ^ ((~x) & z)); + } + + extern inline function Maj(x, y, z) { + return ((x & y) ^ (x & z) ^ (y & z)); + } + + extern inline function Sigma0256(x) { + return (S(x, 2) ^ S(x, 13) ^ S(x, 22)); + } + + extern inline function Sigma1256(x) { + return (S(x, 6) ^ S(x, 11) ^ S(x, 25)); + } + + extern inline function Gamma0256(x) { + return (S(x, 7) ^ S(x, 18) ^ R(x, 3)); + } + + extern inline function Gamma1256(x) { + return (S(x, 17) ^ S(x, 19) ^ R(x, 10)); + } + + extern inline function safeAdd(x, y) { + var lsw = (x & 0xFFFF) + (y & 0xFFFF); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xFFFF); + } + + function hex(a:Array) { + var str = ""; + for (num in a) { + str += StringTools.hex(num, 8); + } + return str.toLowerCase(); + } +} diff --git a/build/linux64_569e52e/std/haxe/display/Diagnostic.hx b/build/linux64_569e52e/std/haxe/display/Diagnostic.hx new file mode 100644 index 0000000..461a8c1 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/display/Diagnostic.hx @@ -0,0 +1,86 @@ +// from vshaxe +package haxe.display; + +import haxe.display.Position.Location; +import haxe.display.Position.Range; +import haxe.display.JsonModuleTypes; + +enum abstract UnresolvedIdentifierSuggestion(Int) { + var UISImport; + var UISTypo; +} + +enum abstract MissingFieldCauseKind(String) { + final AbstractParent:MissingFieldCauseKind<{parent:JsonTypePathWithParams}>; + final ImplementedInterface:MissingFieldCauseKind<{parent:JsonTypePathWithParams}>; + final PropertyAccessor:MissingFieldCauseKind<{property:JsonClassField, isGetter:Bool}>; + final FieldAccess:MissingFieldCauseKind<{}>; + final FinalFields:MissingFieldCauseKind<{fields:Array}>; +} + +typedef MissingFieldCause = { + var kind:MissingFieldCauseKind; + var args:T; +} + +typedef MissingField = { + var field:JsonClassField; + var type:JsonType; + + /** + When implementing multiple interfaces, there can be field duplicates among them. This flag is only + true for the first such occurrence of a field, so that the "Implement all" code action doesn't end + up implementing the same field multiple times. + **/ + var unique:Bool; +} + +typedef MissingFieldDiagnostic = { + var fields:Array; + var cause:MissingFieldCause; +} + +typedef MissingFieldDiagnostics = { + var moduleType:JsonModuleType; + var moduleFile:String; + var entries:Array; +} + +typedef ReplacableCode = { + var description:String; + var range:Range; + var ?newCode:String; +} + +enum abstract DiagnosticKind(Int) from Int to Int { + final DKUnusedImport:DiagnosticKind; + final DKUnresolvedIdentifier:DiagnosticKind>; + final DKCompilerError:DiagnosticKind; + final ReplacableCode:DiagnosticKind; + final DKParserError:DiagnosticKind; + final DeprecationWarning:DiagnosticKind; + final InactiveBlock:DiagnosticKind; + final MissingFields:DiagnosticKind; +} + +enum abstract DiagnosticSeverity(Int) { + var Error = 1; + var Warning; + var Information; + var Hint; +} + +typedef Diagnostic = { + var kind:DiagnosticKind; + var range:Range; + var severity:DiagnosticSeverity; + var args:T; + var code:Null; + var relatedInformation:Array; +} + +typedef DiagnosticRelatedInformation = { + var location:Location; + var message:String; + var depth:Int; +} diff --git a/build/linux64_569e52e/std/haxe/display/Display.hx b/build/linux64_569e52e/std/haxe/display/Display.hx new file mode 100644 index 0000000..9c6c57f --- /dev/null +++ b/build/linux64_569e52e/std/haxe/display/Display.hx @@ -0,0 +1,593 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.display; + +import haxe.display.JsonModuleTypes; +import haxe.display.Position; +import haxe.display.Protocol; +import haxe.ds.ReadOnlyArray; + +/** + Methods of the JSON-RPC-based `--display` protocol in Haxe 4. + A lot of the methods are *inspired* by the Language Server Protocol, but there is **no** intention to be directly compatible with it. +**/ +@:publicFields +class DisplayMethods { + /** + TODO documentation + **/ + static inline var Diagnostics = new HaxeRequestMethod("display/diagnostics"); + + /** + The completion request is sent from the client to Haxe to request code completion. + Haxe automatically determines the type of completion to use based on the passed position, see `CompletionResultKind`. + **/ + static inline var Completion = new HaxeRequestMethod("display/completion"); + + /** + The request is sent from the client to Haxe to resolve additional information for a given completion item. + **/ + static inline var CompletionItemResolve = new HaxeRequestMethod("display/completionItem/resolve"); + + /** + The find references request is sent from the client to Haxe to find locations that reference the symbol at a given text document position. + **/ + static inline var FindReferences = new HaxeRequestMethod("display/references"); + + /** + The goto definition request is sent from the client to Haxe to resolve the definition location(s) of a symbol at a given text document position. + **/ + static inline var GotoDefinition = new HaxeRequestMethod("display/definition"); + + /** + The goto implementation request is sent from the client to Haxe to resolve the implementation location(s) of a symbol at a given text document position. + **/ + static inline var GotoImplementation = new HaxeRequestMethod("display/implementation"); + + /** + The goto type definition request is sent from the client to Haxe to resolve the type definition location(s) of a symbol at a given text document position. + **/ + static inline var GotoTypeDefinition = new HaxeRequestMethod("display/typeDefinition"); + + /** + The hover request is sent from the client to Haxe to request hover information at a given text document position. + **/ + static inline var Hover = new HaxeRequestMethod("display/hover"); + + /** + This request is sent from the client to Haxe to determine the package for a given file, based on class paths configuration. + **/ + static inline var DeterminePackage = new HaxeRequestMethod("display/package"); + + /** + The signature help request is sent from the client to Haxe to request signature information at a given cursor position. + **/ + static inline var SignatureHelp = new HaxeRequestMethod("display/signatureHelp"); + + /** + The metadata request is sent from the client to Haxe to get a list of all registered metadata and their documentation. + **/ + static inline var Metadata = new HaxeRequestMethod("display/metadata"); + + /** + The defines request is sent from the client to Haxe to get a list of all registered defines and their documentation. + **/ + static inline var Defines = new HaxeRequestMethod("display/defines"); + + /* + TODO: + + - finish completion + - codeLens + - workspaceSymbols ("project/symbol"?) + */ +} + +/** Completion **/ +typedef CompletionParams = PositionParams & { + var wasAutoTriggered:Bool; + + /** list of metas to include in responses **/ + var ?meta:Array; +} + +typedef FieldResolution = { + /** + Whether it's valid to use the unqualified name of the field or not. + This is `false` if the identifier is shadowed. + **/ + var isQualified:Bool; + + /** + The qualifier that has to be inserted to use the field if `!isQualified`. + Can either be `this` or `super` for instance fields for the type name for `static` fields. + **/ + var qualifier:String; +} + +typedef DisplayLocal = { + var id:Int; + var name:String; + var type:JsonType; + var origin:LocalOrigin; + var capture:Bool; + var ?extra:{ + var params:Array; + var expr:JsonExpr; + }; + var meta:JsonMetadata; + var pos:JsonPos; + var isInline:Bool; + var isFinal:Bool; +} + +enum abstract LocalOrigin(Int) { + var LocalVariable; + var Argument; + var ForVariable; + var PatternVariable; + var CatchVariable; + var LocalFunction; +} + +enum abstract ClassFieldOriginKind(Int) { + /** + The field is declared on the current type itself. + **/ + var Self:ClassFieldOriginKind>; + + /** + The field is a static field brought into context via a static import + (`import pack.Module.Type.field`). + **/ + var StaticImport:ClassFieldOriginKind>; + + /** + The field is declared on a parent type, such as: + - a super class field that is not overriden + - a forwarded abstract field + **/ + var Parent:ClassFieldOriginKind>; + + /** + The field is a static extension method brought + into context with the `using` keyword. + **/ + var StaticExtension:ClassFieldOriginKind>; + + /** + This field doesn't belong to any named type, just an anonymous structure. + **/ + var AnonymousStructure:ClassFieldOriginKind; + + /** + Special fields built into the compiler, such as: + - `code` on single-character Strings + - `bind()` on functions. + **/ + var BuiltIn:ClassFieldOriginKind; + + /** + The origin of this class field is unknown. + **/ + var Unknown:ClassFieldOriginKind; +} + +typedef ClassFieldOrigin = { + var kind:ClassFieldOriginKind; + var ?args:T; +} + +typedef ClassFieldOccurrence = { + var field:JsonClassField; + var resolution:FieldResolution; + var ?origin:ClassFieldOrigin; +} + +enum abstract EnumFieldOriginKind(Int) { + /** + The enum value is declared on the current type itself. + **/ + var Self:EnumFieldOriginKind>; + + /** + The enum value is brought into context via a static import + (`import pack.Module.Enum.Value`). + **/ + var StaticImport:EnumFieldOriginKind>; +} + +typedef EnumFieldOrigin = { + var kind:EnumFieldOriginKind; + var ?args:T; +} + +typedef EnumFieldOccurrence = { + var field:JsonEnumField; + var resolution:FieldResolution; + var ?origin:EnumFieldOrigin; +} + +enum abstract Literal(String) { + var Null = "null"; + var True = "true"; + var False = "false"; + var This = "this"; + var Trace = "trace"; +} + +enum abstract DisplayModuleTypeKind(Int) { + var Class; + var Interface; + var Enum; + var Abstract; + var EnumAbstract; + + /** A `typedef` that is just an alias for another type. **/ + var TypeAlias; + + /** A `typedef` that is an alias for an anonymous structure. **/ + var Struct; + + /** A type name introduced by `import as` / `import in` **/ + // var ImportAlias; +} + +typedef DisplayModuleType = { + var path:JsonTypePath; + var pos:JsonPos; + var isPrivate:Bool; + var params:Array; + var meta:JsonMetadata; + var doc:JsonDoc; + var isExtern:Bool; + var isFinal:Bool; + var isAbstract:Bool; + var kind:DisplayModuleTypeKind; +} + +typedef DisplayModuleTypeParameter = { + var name:String; + var meta:JsonMetadata; + var constraints:Array>; +} + +typedef DisplayLiteral = { + var name:String; +} + +enum abstract MetadataTarget(String) { + var Class = "TClass"; + var ClassField = "TClassField"; + var Abstract = "TAbstract"; + var AbstractField = "TAbstractField"; + var Enum = "TEnum"; + var Typedef = "TTypedef"; + var AnyField = "TAnyField"; + var Expr = "TExpr"; + var TypeParameter = "TTypeParameter"; +} + +enum abstract Platform(String) { + var Cross = "cross"; + var Js = "js"; + var Lua = "lua"; + var Neko = "neko"; + var Flash = "flash"; + var Php = "php"; + var Cpp = "cpp"; + var Java = "java"; + var Python = "python"; + var Hl = "hl"; + var Eval = "eval"; +} + +typedef Metadata = { + var name:String; + var doc:JsonDoc; + var parameters:Array; + var platforms:Array; + var targets:Array; + var internal:Bool; + var ?origin:String; + var ?links:Array; +} + +typedef Define = { + var name:String; + var value:Null; + var doc:JsonDoc; + var parameters:Array; + var platforms:Array; + var links:Array; + var ?origin:String; + var ?deprecated:String; +} + +typedef Keyword = { + var name:KeywordKind; +} + +enum abstract KeywordKind(String) to String { + var Implements = "implements"; + var Extends = "extends"; + var Function = "function"; + var Var = "var"; + var If = "if"; + var Else = "else"; + var While = "while"; + var Do = "do"; + var For = "for"; + var Break = "break"; + var Return = "return"; + var Continue = "continue"; + var Switch = "switch"; + var Case = "case"; + var Default = "default"; + var Try = "try"; + var Catch = "catch"; + var New = "new"; + var Throw = "throw"; + var Untyped = "untyped"; + var Cast = "cast"; + var Macro = "macro"; + var Package = "package"; + var Import = "import"; + var Using = "using"; + var Public = "public"; + var Private = "private"; + var Static = "static"; + var Extern = "extern"; + var Dynamic = "dynamic"; + var Override = "override"; + var Overload = "overload"; + var Class = "class"; + var Interface = "interface"; + var Enum = "enum"; + var Abstract = "abstract"; + var Typedef = "typedef"; + var Final = "final"; + var Inline = "inline"; +} + +/* enum abstract PackageContentKind(Int) { + var Module; + var Package; +}*/ +typedef Package = { + var path:JsonPackagePath; + // var ?contents:Array<{name:String, kind:PackageContentKind}>; +} + +typedef Module = { + var path:JsonModulePath; + // var ?contents:Array; +} + +enum abstract DisplayItemKind(String) { + var Local:DisplayItemKind>; + var ClassField:DisplayItemKind>; + var EnumField:DisplayItemKind>; + + /** Only for the enum values in enum abstracts, other fields use `ClassField`. **/ + var EnumAbstractField:DisplayItemKind>; + + var Type:DisplayItemKind; + var Package:DisplayItemKind; + var Module:DisplayItemKind; + var Literal:DisplayItemKind>; + var Metadata:DisplayItemKind; + var Keyword:DisplayItemKind; + var AnonymousStructure:DisplayItemKind; + var Expression:DisplayItemKind; + var TypeParameter:DisplayItemKind; + var Define:DisplayItemKind; +} + +typedef DisplayItem = { + var kind:DisplayItemKind; + var args:T; + var ?type:JsonType; + var ?index:Int; +} + +typedef DisplayItemOccurrence = { + var range:Range; + var item:DisplayItem; + var ?moduleType:JsonModuleType; + var ?moduleTypeFollowed:JsonModuleType; +} + +typedef FieldCompletionSubject = DisplayItemOccurrence & { + var ?iterator:{ + var type:JsonType; + }; + var ?keyValueIterator:{ + var key:JsonType; + var value:JsonType; + }; +} + +typedef ToplevelCompletion = { + var ?expectedType:JsonType; + var ?expectedTypeFollowed:JsonType; + var ?compatibleTypes:Array>; +} + +typedef StructExtensionCompletion = { + var isIntersectionType:Bool; +} + +typedef PatternCompletion = ToplevelCompletion & { + var isOutermostPattern:Bool; +} + +typedef DiagnosticsParams = { + var ?file:FsPath; + var ?contents:String; + var ?fileContents:Array<{file:FsPath, ?contents:String}>; +} + +typedef DiagnosticsResult = Response>; +}>> + +enum abstract CompletionModeKind(Int) { + var Field:CompletionModeKind>; + var StructureField; + var Toplevel:CompletionModeKind>; + var Metadata; + var TypeHint; + var Extends; + var Implements; + var StructExtension:CompletionModeKind; + var Import; + var Using; + var New; + var Pattern:CompletionModeKind>; + var Override; + var TypeRelation; + var TypeDeclaration; +} + +typedef CompletionMode = { + var kind:CompletionModeKind; + var ?args:T; +} + +typedef CompletionResponse = { + var items:Array>; + var mode:CompletionMode; + var ?replaceRange:Range; + var ?isIncomplete:Bool; + var ?filterString:String; +} + +typedef CompletionResult = Response>>; + +/** CompletionItem Resolve **/ +typedef CompletionItemResolveParams = { + var index:Int; +}; + +typedef CompletionItemResolveResult = Response<{ + var item:DisplayItem; +}>; + +/** FindReferences **/ +typedef FindReferencesParams = PositionParams & { + var ?kind:FindReferencesKind; +} + +enum abstract FindReferencesKind(String) to String { + /** + Find only direct references to the requested symbol. + Does not look for references to parent or overriding methods. + **/ + var Direct = "direct"; + + /** + Find references to the base field and all the overidding fields in the inheritance chain. + **/ + var WithBaseAndDescendants = "withBaseAndDescendants"; + + /** + Find references to the requested field and references to all + descendants of the requested field. + **/ + var WithDescendants = "withDescendants"; +} + +/** GotoDefinition **/ +typedef GotoDefinitionResult = Response>; + +/** GotoTypeDefinition **/ +typedef GotoTypeDefinitionResult = Response>; + +/** Hover **/ +typedef HoverResult = Response>>; + +typedef HoverDisplayItemOccurence = DisplayItemOccurrence & { + var ?expected:{ + var ?type:JsonType; + var ?name:{ + var name:String; + var kind:HoverExpectedNameKind; + var ?doc:String; + }; + }; +} + +enum abstract HoverExpectedNameKind(Int) { + var FunctionArgument; + var StructureField; +} + +/** DeterminePackage **/ +typedef DeterminePackageResult = Response>; + +/** SignatureHelp **/ +typedef SignatureHelpParams = PositionParams & { + var wasAutoTriggered:Bool; +} + +typedef SignatureInformation = JsonFunctionSignature & { + var ?documentation:String; +} + +enum abstract SignatureItemKind(Int) { + var Call; + var ArrayAccess; +} + +typedef SignatureItem = { + var signatures:Array; + var activeSignature:Int; + var activeParameter:Int; + var kind:SignatureItemKind; +} + +typedef SignatureHelpResult = Response>; + +typedef MetadataParams = { + var compiler:Bool; + var user:Bool; +} + +typedef MetadataResult = Response>; + +typedef DefinesParams = { + var compiler:Bool; + var user:Bool; +} + +typedef DefinesResult = Response>; + +/** General types **/ +typedef PositionParams = FileParams & { + /** Unicode character offset in the file. **/ + var offset:Int; + + var ?contents:String; +} diff --git a/build/linux64_569e52e/std/haxe/display/FsPath.hx b/build/linux64_569e52e/std/haxe/display/FsPath.hx new file mode 100644 index 0000000..f427b6f --- /dev/null +++ b/build/linux64_569e52e/std/haxe/display/FsPath.hx @@ -0,0 +1,33 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.display; + +abstract FsPath(String) { + public inline function new(path:String) { + this = path; + } + + public inline function toString():String { + return this; + } +} diff --git a/build/linux64_569e52e/std/haxe/display/JsonModuleTypes.hx b/build/linux64_569e52e/std/haxe/display/JsonModuleTypes.hx new file mode 100644 index 0000000..503e4b4 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/display/JsonModuleTypes.hx @@ -0,0 +1,376 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.display; + +typedef JsonTodo = Dynamic; + +typedef JsonPos = { + var file:String; + var min:Int; + var max:Int; +} + +typedef JsonDoc = Null; + +enum abstract ImportStatus(Int) { + /** + This type is already available with it's unqualified name for one of these reasons: + - it's a toplevel type + - it's imported with an `import` in the current module + - it's imported in an `import.hx` file + **/ + var Imported; + + /** + The type is currently not imported. It can be accessed either + with its fully qualified name or by inserting an import. + **/ + var Unimported; + + /** + A type with the same name is already imported in the module. + The fully qualified name has to be used to access it. + **/ + var Shadowed; +} + +/* Type instance */ +typedef JsonPackagePath = { + var pack:Array; +} + +typedef JsonModulePath = JsonPackagePath & { + var moduleName:String; + var ?importStatus:ImportStatus; +} + +typedef JsonTypePath = JsonModulePath & { + var typeName:String; +} + +typedef JsonStaticFieldPath = JsonTypePath & { + var fieldName:String; +} + +typedef JsonTypePathWithParams = { + var path:JsonTypePath; + var params:JsonTypes; +} + +typedef JsonFunctionArgument = { + var name:String; + var opt:Bool; + var t:JsonType; + var ?value:{ + var string:String; + }; +} + +typedef JsonFunctionSignature = { + var args:Array; + var ret:JsonType; +} + +enum abstract JsonAnonStatusKind(String) { + var AClosed; + var AOpened; + var AConst; + var AExtend:JsonAnonStatusKind; + var AClassStatics:JsonAnonStatusKind; + var AEnumStatics:JsonAnonStatusKind; + var AAbstractStatics:JsonAnonStatusKind; +} + +typedef JsonAnonStatus = { + var kind:JsonAnonStatusKind; + var args:T; +} + +typedef JsonAnon = { + var fields:JsonClassFields; + var status:JsonAnonStatus; +} + +enum abstract JsonTypeKind(String) { + var TMono; + var TInst:JsonTypeKind; + var TEnum:JsonTypeKind; + var TType:JsonTypeKind; + var TAbstract:JsonTypeKind; + var TFun:JsonTypeKind; + var TAnonymous:JsonTypeKind; + var TDynamic:JsonTypeKind>>; +} + +typedef JsonType = { + var kind:JsonTypeKind; + var args:T; +} + +typedef JsonTypes = Array>; + +/* Type parameters */ +typedef JsonTypeParameter = { + var name:String; + var constraints:JsonTypes; +} + +typedef JsonTypeParameters = Array; + +/* Expr */ +enum abstract JsonBinopKind(String) { + var OpAdd; + var OpMult; + var OpDiv; + var OpSub; + var OpAssign; + var OpEq; + var OpNotEq; + var OpGt; + var OpGte; + var OpLt; + var OpLte; + var OpAnd; + var OpOr; + var OpXor; + var OpBoolAnd; + var OpBoolOr; + var OpShl; + var OpShr; + var OpUShr; + var OpMod; + var OpAssignOp:JsonBinopKind>; + var OpInterval; + var OpArrow; + var OpIn; + var OpNullCoal; +} + +typedef JsonBinop = { + var kind:JsonBinopKind; + var args:T; +} + +enum abstract JsonUnop(String) { + var OpIncrement; + var OpDecrement; + var OpNot; + var OpNeg; + var OpNegBits; +} + +typedef JsonExpr = JsonTodo; + +typedef JsonMetadataEntry = { + var name:String; + var args:Array; + var pos:JsonPos; +} + +typedef JsonMetadata = Array; + +enum abstract JsonTConstantKind(String) { + var TInt:JsonTConstantKind; + var TFloat:JsonTConstantKind; + var TString:JsonTConstantKind; + var TBool:JsonTConstantKind; + var TNull; + var TThis; + var TSuper; +} + +typedef JsonTConstant = { + var kind:JsonTConstantKind; + var args:T; +} + +typedef JsonTExpr = JsonTodo; + +/* Fields */ +enum abstract JsonVarAccessKind(String) { + var AccNormal; + var AccNo; + var AccNever; + var AccResolve; + var AccCall; + var AccInline; + var AccRequire:JsonVarAccessKind<{require:String, message:Null}>; + var AccCtor; +} + +typedef JsonVarAccess = { + var kind:JsonVarAccessKind; + var args:T; +} + +enum abstract JsonMethodKind(String) { + var MethNormal; + var MethInline; + var MethDynamic; + var MethMacro; +} + +enum abstract JsonFieldKindKind(String) { + var FVar:JsonFieldKindKind<{read:JsonVarAccess, write:JsonVarAccess}>; + var FMethod:JsonFieldKindKind; +} + +typedef JsonFieldKind = { + var kind:JsonFieldKindKind; + var args:T; +} + +enum abstract JsonClassFieldScope(Int) { + var Static; + var Member; + var Constructor; +} + +typedef JsonClassField = { + var name:String; + var type:JsonType; + var isPublic:Bool; + var isFinal:Bool; + var isAbstract:Bool; + var params:JsonTypeParameters; + var meta:JsonMetadata; + var kind:JsonFieldKind; + var ?expr:{ + var string:String; + }; + var pos:JsonPos; + var doc:JsonDoc; + var overloads:JsonClassFields; + var scope:JsonClassFieldScope; +} + +typedef JsonClassFields = Array; +typedef JsonClassFieldReference = String; + +typedef JsonEnumField = { + var name:String; + var type:JsonType; + var pos:JsonPos; + var meta:JsonMetadata; + var index:Int; + var doc:JsonDoc; + var params:JsonTypeParameters; +} + +typedef JsonEnumFields = Array; + +/* Class */ +enum abstract JsonClassKindKind(String) { + var KNormal; + var KTypeParameter:JsonClassKindKind; + var KExtension:JsonClassKindKind; + var KExpr:JsonClassKindKind; + var KGeneric; + var KGenericInstance:JsonClassKindKind; + var KMacroType; + var KAbstractImpl:JsonClassKindKind; + var KGenericBuild; + var KModuleFields:JsonClassKindKind; +} + +typedef JsonClassKind = { + var kind:JsonClassKindKind; + var args:T; +} + +typedef JsonClass = { + var kind:JsonClassKind; + var isInterface:Bool; + var isExtern:Bool; + var isFinal:Bool; + var isAbstract:Bool; + var superClass:Null; + var interfaces:Array; + var fields:JsonClassFields; + var statics:JsonClassFields; + var constructor:Null; + var init:Null; + var overrides:Array; +} + +/* Enum */ +typedef JsonEnum = { + var constructors:JsonEnumFields; + var isExtern:Bool; +} + +/* Typedef */ +typedef JsonTypedef = { + var type:JsonType; +} + +/* Abstract */ +typedef JsonAbstractBinop = { + var op:JsonBinop; + var field:JsonClassFieldReference; +} + +typedef JsonAbstractUnop = { + var op:JsonUnop; + var postFix:Bool; + var field:JsonClassFieldReference; +} + +typedef JsonAbstractCast = { + var t:JsonType; + var field:JsonClassFieldReference; +} + +typedef JsonAbstract = { + var type:JsonType; + var impl:Null; + var binops:Array; + var unops:Array; + var from:Array; + var to:Array; + var array:JsonClassFields; + var resolve:Null; +} + +/* Module type */ +enum abstract JsonModuleTypeKind(String) { + var Class:JsonModuleTypeKind = "class"; + var Enum:JsonModuleTypeKind = "enum"; + var Typedef:JsonModuleTypeKind = "typedef"; + var Abstract:JsonModuleTypeKind = "abstract"; +} + +typedef JsonModuleType = { + var pack:Array; + var name:String; + var moduleName:String; + var pos:JsonPos; + var isPrivate:Bool; + var params:JsonTypeParameters; + var meta:JsonMetadata; + var doc:JsonDoc; + var kind:JsonModuleTypeKind; + var args:T; +} + +typedef JsonModuleTypes = Array>; diff --git a/build/linux64_569e52e/std/haxe/display/Position.hx b/build/linux64_569e52e/std/haxe/display/Position.hx new file mode 100644 index 0000000..31bae6f --- /dev/null +++ b/build/linux64_569e52e/std/haxe/display/Position.hx @@ -0,0 +1,61 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.display; + +/** + Position in a text document expressed as 1-based line and character offset. +**/ +typedef Position = { + /** + Line position in a document (1-based). + **/ + var line:Int; + + /** + Character offset on a line in a document (1-based). + **/ + var character:Int; +} + +/** + A range in a text document expressed as (1-based) start and end positions. +**/ +typedef Range = { + /** + The range's start position + **/ + var start:Position; + + /** + The range's end position + **/ + var end:Position; +} + +/** + Represents a location inside a resource, such as a line inside a text file. +**/ +typedef Location = { + var file:FsPath; + var range:Range; +} diff --git a/build/linux64_569e52e/std/haxe/display/Protocol.hx b/build/linux64_569e52e/std/haxe/display/Protocol.hx new file mode 100644 index 0000000..beb4fc5 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/display/Protocol.hx @@ -0,0 +1,119 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.display; + +import haxe.display.Position; + +@:publicFields +class Methods { + /** + The initialize request is sent from the client to Haxe to determine the capabilities. + **/ + static inline var Initialize = new HaxeRequestMethod("initialize"); + + static inline var ResetCache = new HaxeRequestMethod("server/resetCache"); +} + +typedef ResetCacheParams = {} + +typedef ResetCacheResult = { + final success:Bool; +} + +/* Initialize */ +typedef InitializeParams = { + final ?supportsResolve:Bool; + + /** dot paths to exclude from readClassPaths / toplevel completion **/ + final ?exclude:Array; + + /** The maximum number of completion items to return **/ + final ?maxCompletionItems:Int; +} + +/** + Represents a semantic version, see https://semver.org/. +**/ +typedef Version = { + final major:Int; + final minor:Int; + final patch:Int; + final ?pre:String; + final ?build:String; +} + +typedef InitializeResult = Response<{ + final protocolVersion:Version; + final haxeVersion:Version; + final methods:Array; +}>; + +/* general protocol types */ +typedef Timer = { + final name:String; + final time:Float; + final ?path:String; + final ?info:String; + final ?calls:Int; + final ?percentTotal:Float; + final ?percentParent:Float; + final ?children:Array; +} + +typedef Response = { + final ?result:T; + + /** UNIX timestamp at the moment the data was sent. **/ + final ?timestamp:Float; + + /** Only sent if `--times` is enabled. **/ + final ?timers:Timer; +} + +typedef FileParams = { + var file:FsPath; +} + +abstract HaxeRequestMethod(String) to String { + public inline function new(method:String) + this = method; +} + +abstract HaxeNotificationMethod(String) to String { + public inline function new(method:String) + this = method; +} + +typedef HaxeResponseErrorData = Array<{ + var severity:HaxeResponseErrorSeverity; + var ?location:Location; + var message:String; +}>; + +enum abstract HaxeResponseErrorSeverity(Int) { + var Error = 1; + var Warning; + var Hint; +} + +enum NoData {} diff --git a/build/linux64_569e52e/std/haxe/display/Server.hx b/build/linux64_569e52e/std/haxe/display/Server.hx new file mode 100644 index 0000000..0c20e60 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/display/Server.hx @@ -0,0 +1,178 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.display; + +import haxe.display.JsonModuleTypes; +import haxe.display.Position; +import haxe.display.Protocol; + +@:publicFields +class ServerMethods { + /** + This request is sent from the client to Haxe to explore the class paths. This effectively creates a cache for toplevel completion. + **/ + static inline var ReadClassPaths = new HaxeRequestMethod>("server/readClassPaths"); + + static inline var Configure = new HaxeRequestMethod>("server/configure"); + static inline var Invalidate = new HaxeRequestMethod>("server/invalidate"); + static inline var Contexts = new HaxeRequestMethod>>("server/contexts"); + static inline var Memory = new HaxeRequestMethod>("server/memory"); + static inline var ContextMemory = new HaxeRequestMethod>("server/memory/context"); + static inline var ModuleMemory = new HaxeRequestMethod>("server/memory/module"); + static inline var Modules = new HaxeRequestMethod>>("server/modules"); + static inline var Module = new HaxeRequestMethod>("server/module"); + static inline var Type = new HaxeRequestMethod>>("server/type"); + static inline var Files = new HaxeRequestMethod>>("server/files"); + static inline var ModuleCreated = new HaxeRequestMethod>("server/moduleCreated"); +} + +/* Configure */ +typedef ConfigurePrintParams = { + var ?addedDirectory:Bool; + var ?foundDirectories:Bool; + var ?changedDirectories:Bool; + var ?modulePathChanged:Bool; + var ?notCached:Bool; + var ?parsed:Bool; + var ?removedDirectory:Bool; + var ?reusing:Bool; + var ?skippingDep:Bool; + var ?unchangedContent:Bool; + var ?cachedModules:Bool; + var ?arguments:Bool; + var ?completion:Bool; + var ?defines:Bool; + var ?signature:Bool; + var ?displayPosition:Bool; + var ?stats:Bool; + var ?message:Bool; + var ?socketMessage:Bool; + var ?uncaughtError:Bool; + var ?newContext:Bool; +} + +typedef ConfigureParams = { + final ?noModuleChecks:Bool; + final ?populateCacheFromDisplay:Bool; + final ?legacyCompletion:Bool; + final ?print:ConfigurePrintParams; +} + +/* Contexts */ +typedef HaxeServerContext = { + final index:Int; + final desc:String; + final signature:String; + final platform:String; + final classPaths:Array; + final defines:Array<{key:String, value:String}>; +} + +typedef ModuleId = { + final path:String; + final sign:String; +} + +typedef JsonModule = { + final id:Int; + final path:JsonModulePath; + final types:Array; + final file:String; + final sign:String; + final cacheState:Null; + final dependencies:Array; + final dependents:Array; +} + +typedef JsonServerFile = { + final file:String; + final time:Float; + final pack:String; + final moduleName:Null; +} + +/* Memory */ +typedef HaxeMemoryResult = { + final contexts:Array<{ + final context:HaxeServerContext; + final size:Int; + }>; + final memory:{ + final totalCache:Int; + final contextCache:Int; + final haxelibCache:Int; + final directoryCache:Int; + final nativeLibCache:Int; + final ?additionalSizes:Array<{name:String, size:Int}>; + } +} + +typedef HaxeContextMemoryResult = { + final moduleCache:{ + final size:Int; + final list:Array<{ + final path:String; + final size:Int; + final hasTypes:Bool; + }>; + }; + final syntaxCache:{ + final size:Int; + }; + final binaryCache:{ + final size:Int; + }; + final ?leaks:Array<{ + final path:String; + final leaks:Array<{ + final path:String; + }>; + }>; +} + +typedef HaxeModuleMemoryResult = { + final moduleExtra:Int; + final types:Array<{ + final name:String; + final ?pos:Location; + final size:Int; + final fields:Array<{ + final name:String; + final ?pos:Location; + final size:Int; + }>; + }>; +} + +typedef ContextParams = { + final signature:String; +} + +typedef ModuleParams = ContextParams & { + final path:String; +} + +typedef TypeParams = ContextParams & { + final modulePath:String; + final typeName:String; +} diff --git a/build/linux64_569e52e/std/haxe/ds/ArraySort.hx b/build/linux64_569e52e/std/haxe/ds/ArraySort.hx new file mode 100644 index 0000000..7467fdd --- /dev/null +++ b/build/linux64_569e52e/std/haxe/ds/ArraySort.hx @@ -0,0 +1,162 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +/** + ArraySort provides a stable implementation of merge sort through its `sort` + method. It should be used instead of `Array.sort` in cases where the order + of equal elements has to be retained on all targets. +**/ +class ArraySort { + /** + Sorts Array `a` according to the comparison function `cmp`, where + `cmp(x,y)` returns 0 if `x == y`, a positive Int if `x > y` and a + negative Int if `x < y`. + + This operation modifies Array `a` in place. + + This operation is stable: The order of equal elements is preserved. + + If `a` or `cmp` are null, the result is unspecified. + **/ + static public function sort(a:Array, cmp:T->T->Int) { + rec(a, cmp, 0, a.length); + } + + static function rec(a:Array, cmp, from, to) { + var middle = (from + to) >> 1; + if (to - from < 12) { + if (to <= from) + return; + for (i in (from + 1)...to) { + var j = i; + while (j > from) { + if (compare(a, cmp, j, j - 1) < 0) + swap(a, j - 1, j); + else + break; + j--; + } + } + return; + } + rec(a, cmp, from, middle); + rec(a, cmp, middle, to); + doMerge(a, cmp, from, middle, to, middle - from, to - middle); + } + + static function doMerge(a:Array, cmp, from, pivot, to, len1, len2) { + var first_cut, second_cut, len11, len22, new_mid; + if (len1 == 0 || len2 == 0) + return; + if (len1 + len2 == 2) { + if (compare(a, cmp, pivot, from) < 0) + swap(a, pivot, from); + return; + } + if (len1 > len2) { + len11 = len1 >> 1; + first_cut = from + len11; + second_cut = lower(a, cmp, pivot, to, first_cut); + len22 = second_cut - pivot; + } else { + len22 = len2 >> 1; + second_cut = pivot + len22; + first_cut = upper(a, cmp, from, pivot, second_cut); + len11 = first_cut - from; + } + rotate(a, cmp, first_cut, pivot, second_cut); + new_mid = first_cut + len22; + doMerge(a, cmp, from, first_cut, new_mid, len11, len22); + doMerge(a, cmp, new_mid, second_cut, to, len1 - len11, len2 - len22); + } + + static function rotate(a:Array, cmp:T->T->Int, from, mid, to) { + var n; + if (from == mid || mid == to) + return; + n = gcd(to - from, mid - from); + while (n-- != 0) { + var val = a[from + n]; + var shift = mid - from; + var p1 = from + n, p2 = from + n + shift; + while (p2 != from + n) { + a[p1] = a[p2]; + p1 = p2; + if (to - p2 > shift) + p2 += shift; + else + p2 = from + (shift - (to - p2)); + } + a[p1] = val; + } + } + + static function gcd(m, n) { + while (n != 0) { + var t = m % n; + m = n; + n = t; + } + return m; + } + + static function upper(a:Array, cmp, from, to, val) { + var len = to - from, half, mid; + while (len > 0) { + half = len >> 1; + mid = from + half; + if (compare(a, cmp, val, mid) < 0) + len = half; + else { + from = mid + 1; + len = len - half - 1; + } + } + return from; + } + + static function lower(a:Array, cmp, from, to, val) { + var len = to - from, half, mid; + while (len > 0) { + half = len >> 1; + mid = from + half; + if (compare(a, cmp, mid, val) < 0) { + from = mid + 1; + len = len - half - 1; + } else + len = half; + } + return from; + } + + static function swap(a:Array, i, j) { + var tmp = a[i]; + a[i] = a[j]; + a[j] = tmp; + } + + static inline function compare(a:Array, cmp:T->T->Int, i, j) { + return cmp(a[i], a[j]); + } +} diff --git a/build/linux64_569e52e/std/haxe/ds/BalancedTree.hx b/build/linux64_569e52e/std/haxe/ds/BalancedTree.hx new file mode 100644 index 0000000..41d3abf --- /dev/null +++ b/build/linux64_569e52e/std/haxe/ds/BalancedTree.hx @@ -0,0 +1,269 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +/** + BalancedTree allows key-value mapping with arbitrary keys, as long as they + can be ordered. By default, `Reflect.compare` is used in the `compare` + method, which can be overridden in subclasses. + + Operations have a logarithmic average and worst-case cost. + + Iteration over keys and values, using `keys` and `iterator` respectively, + are in-order. +**/ +class BalancedTree implements haxe.Constraints.IMap { + var root:TreeNode; + + /** + Creates a new BalancedTree, which is initially empty. + **/ + public function new() {} + + /** + Binds `key` to `value`. + + If `key` is already bound to a value, that binding disappears. + + If `key` is null, the result is unspecified. + **/ + public function set(key:K, value:V) { + root = setLoop(key, value, root); + } + + /** + Returns the value `key` is bound to. + + If `key` is not bound to any value, `null` is returned. + + If `key` is null, the result is unspecified. + **/ + public function get(key:K):Null { + var node = root; + while (node != null) { + var c = compare(key, node.key); + if (c == 0) + return node.value; + if (c < 0) + node = node.left; + else + node = node.right; + } + return null; + } + + /** + Removes the current binding of `key`. + + If `key` has no binding, `this` BalancedTree is unchanged and false is + returned. + + Otherwise the binding of `key` is removed and true is returned. + + If `key` is null, the result is unspecified. + **/ + public function remove(key:K) { + try { + root = removeLoop(key, root); + return true; + } catch (e:String) { + return false; + } + } + + /** + Tells if `key` is bound to a value. + + This method returns true even if `key` is bound to null. + + If `key` is null, the result is unspecified. + **/ + public function exists(key:K) { + var node = root; + while (node != null) { + var c = compare(key, node.key); + if (c == 0) + return true; + else if (c < 0) + node = node.left; + else + node = node.right; + } + return false; + } + + /** + Iterates over the bound values of `this` BalancedTree. + + This operation is performed in-order. + **/ + public function iterator():Iterator { + var ret = []; + iteratorLoop(root, ret); + return ret.iterator(); + } + + /** + See `Map.keyValueIterator` + **/ + @:runtime public inline function keyValueIterator():KeyValueIterator { + return new haxe.iterators.MapKeyValueIterator(this); + } + + /** + Iterates over the keys of `this` BalancedTree. + + This operation is performed in-order. + **/ + public function keys():Iterator { + var ret = []; + keysLoop(root, ret); + return ret.iterator(); + } + + public function copy():BalancedTree { + var copied = new BalancedTree(); + copied.root = root; + return copied; + } + + function setLoop(k:K, v:V, node:TreeNode) { + if (node == null) + return new TreeNode(null, k, v, null); + var c = compare(k, node.key); + return if (c == 0) new TreeNode(node.left, k, v, node.right, node.get_height()); else if (c < 0) { + var nl = setLoop(k, v, node.left); + balance(nl, node.key, node.value, node.right); + } else { + var nr = setLoop(k, v, node.right); + balance(node.left, node.key, node.value, nr); + } + } + + function removeLoop(k:K, node:TreeNode) { + if (node == null) + throw "Not_found"; + var c = compare(k, node.key); + return if (c == 0) merge(node.left, + node.right); else if (c < 0) balance(removeLoop(k, node.left), node.key, node.value, + node.right); else balance(node.left, node.key, node.value, removeLoop(k, node.right)); + } + + static function iteratorLoop(node:TreeNode, acc:Array) { + if (node != null) { + iteratorLoop(node.left, acc); + acc.push(node.value); + iteratorLoop(node.right, acc); + } + } + + function keysLoop(node:TreeNode, acc:Array) { + if (node != null) { + keysLoop(node.left, acc); + acc.push(node.key); + keysLoop(node.right, acc); + } + } + + function merge(t1, t2) { + if (t1 == null) + return t2; + if (t2 == null) + return t1; + var t = minBinding(t2); + return balance(t1, t.key, t.value, removeMinBinding(t2)); + } + + function minBinding(t:TreeNode) { + return if (t == null) throw "Not_found"; else if (t.left == null) t; else minBinding(t.left); + } + + function removeMinBinding(t:TreeNode) { + return if (t.left == null) t.right; else balance(removeMinBinding(t.left), t.key, t.value, t.right); + } + + function balance(l:TreeNode, k:K, v:V, r:TreeNode):TreeNode { + var hl = l.get_height(); + var hr = r.get_height(); + return if (hl > hr + 2) { + if (l.left.get_height() >= l.right.get_height()) + new TreeNode(l.left, l.key, l.value, new TreeNode(l.right, k, v, r)); + else + new TreeNode(new TreeNode(l.left, l.key, l.value, l.right.left), l.right.key, l.right.value, + new TreeNode(l.right.right, k, v, r)); + } else if (hr > hl + 2) { + if (r.right.get_height() > r.left.get_height()) + new TreeNode(new TreeNode(l, k, v, r.left), r.key, r.value, r.right); + else + new TreeNode(new TreeNode(l, k, v, r.left.left), r.left.key, r.left.value, + new TreeNode(r.left.right, r.key, r.value, r.right)); + } else { + new TreeNode(l, k, v, r, (hl > hr ? hl : hr) + 1); + } + } + + function compare(k1:K, k2:K) { + return Reflect.compare(k1, k2); + } + + public function toString() { + return root == null ? "[]" : '[${root.toString()}]'; + } + + /** + Removes all keys from `this` BalancedTree. + **/ + public function clear():Void { + root = null; + } +} + +/** + A tree node of `haxe.ds.BalancedTree`. +**/ +class TreeNode { + public var left:TreeNode; + public var right:TreeNode; + public var key:K; + public var value:V; + + var _height:Int; + + public function new(l, k, v, r, h = -1) { + left = l; + key = k; + value = v; + right = r; + if (h == -1) + _height = (left.get_height() > right.get_height() ? left.get_height() : right.get_height()) + 1; + else + _height = h; + } + + extern public inline function get_height() + return this == null ? 0 : _height; + + public function toString() { + return (left == null ? "" : left.toString() + ", ") + '$key => $value' + (right == null ? "" : ", " + right.toString()); + } +} diff --git a/build/linux64_569e52e/std/haxe/ds/Either.hx b/build/linux64_569e52e/std/haxe/ds/Either.hx new file mode 100644 index 0000000..24bf6f1 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/ds/Either.hx @@ -0,0 +1,32 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +/** + Either represents values which are either of type `L` (Left) or type `R` + (Right). +**/ +enum Either { + Left(v:L); + Right(v:R); +} diff --git a/build/linux64_569e52e/std/haxe/ds/EnumValueMap.hx b/build/linux64_569e52e/std/haxe/ds/EnumValueMap.hx new file mode 100644 index 0000000..0bbed6d --- /dev/null +++ b/build/linux64_569e52e/std/haxe/ds/EnumValueMap.hx @@ -0,0 +1,84 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +/** + EnumValueMap allows mapping of enum value keys to arbitrary values. + + Keys are compared by value and recursively over their parameters. If any + parameter is not an enum value, `Reflect.compare` is used to compare them. +**/ +class EnumValueMap extends haxe.ds.BalancedTree implements haxe.Constraints.IMap { + override function compare(k1:EnumValue, k2:EnumValue):Int { + var d = k1.getIndex() - k2.getIndex(); + if (d != 0) + return d; + #if hl + var a1 = @:privateAccess Type._enumParameters(k1); + var a2 = @:privateAccess Type._enumParameters(k2); + var ld = a1.length - a2.length; + if (ld != 0) + return ld; + for (i in 0...a1.length) { + var d = compareArg(a1[i], a2[i]); + if (d != 0) + return d; + } + return 0; + #else + var p1 = k1.getParameters(); + var p2 = k2.getParameters(); + if (p1.length == 0 && p2.length == 0) + return 0; + return compareArgs(p1, p2); + #end + } + + function compareArgs(a1:Array, a2:Array):Int { + var ld = a1.length - a2.length; + if (ld != 0) + return ld; + for (i in 0...a1.length) { + var d = compareArg(a1[i], a2[i]); + if (d != 0) + return d; + } + return 0; + } + + function compareArg(v1:Dynamic, v2:Dynamic):Int { + return if (Reflect.isEnumValue(v1) && Reflect.isEnumValue(v2)) { + compare(v1, v2); + } else if (Std.isOfType(v1, Array) && Std.isOfType(v2, Array)) { + compareArgs(v1, v2); + } else { + Reflect.compare(v1, v2); + } + } + + override function copy():EnumValueMap { + var copied = new EnumValueMap(); + copied.root = root; + return copied; + } +} diff --git a/build/linux64_569e52e/std/haxe/ds/GenericStack.hx b/build/linux64_569e52e/std/haxe/ds/GenericStack.hx new file mode 100644 index 0000000..253b6f2 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/ds/GenericStack.hx @@ -0,0 +1,212 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +/** + A cell of `haxe.ds.GenericStack`. + + @see https://haxe.org/manual/std-GenericStack.html +**/ +#if (flash || cpp) +@:generic +#end +class GenericCell { + public var elt:T; + public var next:GenericCell; + + public function new(elt, next) { + this.elt = elt; + this.next = next; + } +} + +#if cpp +@:generic +#if cppia +private class GenericStackIterator { + public var current:GenericCell; + + public function hasNext():Bool { + return current != null; + } + + public function next():T { + var result = current.elt; + current = current.next; + return result; + } + + public function new(head) { + current = head; + } +} +#else +private class GenericStackIterator extends cpp.FastIterator { + public var current:GenericCell; + + override public function hasNext():Bool { + return current != null; + } + + override public function next():T { + var result = current.elt; + current = current.next; + return result; + } + + public function new(head) { + current = head; + } +} +#end +#end + +/** + A stack of elements. + + This class is generic, which means one type is generated for each type + parameter T on static targets. For example: + + - `new GenericStack()` generates `GenericStack_Int` + - `new GenericStack()` generates `GenericStack_String` + + The generated name is an implementation detail and should not be relied + upon. + + @see https://haxe.org/manual/std-GenericStack.html +**/ +#if (flash || cpp) +@:generic +#end +class GenericStack { + public var head:GenericCell; + + /** + Creates a new empty GenericStack. + **/ + public function new() {} + + /** + Pushes element `item` onto the stack. + **/ + public inline function add(item:T) { + head = new GenericCell(item, head); + } + + /** + Returns the topmost stack element without removing it. + + If the stack is empty, null is returned. + **/ + public inline function first():Null { + return if (head == null) null else head.elt; + } + + /** + Returns the topmost stack element and removes it. + + If the stack is empty, null is returned. + **/ + public inline function pop():Null { + var k = head; + if (k == null) + return null; + else { + head = k.next; + return k.elt; + } + } + + /** + Tells if the stack is empty. + **/ + public inline function isEmpty():Bool { + return (head == null); + } + + /** + Removes the first element which is equal to `v` according to the `==` + operator. + + This method traverses the stack until it finds a matching element and + unlinks it, returning true. + + If no matching element is found, false is returned. + **/ + public function remove(v:T):Bool { + var prev:GenericCell = null; + var l = head; + while (l != null) { + if (l.elt == v) { + if (prev == null) + head = l.next; + else + prev.next = l.next; + break; + } + prev = l; + l = l.next; + } + return (l != null); + } + + #if cpp + /** + Returns an iterator over the elements of `this` GenericStack. + **/ + public function iterator():Iterator { + return new GenericStackIterator(head); + } + #else + + /** + Returns an iterator over the elements of `this` GenericStack. + **/ + public function iterator():Iterator { + var l = head; + return { + hasNext: function() { + return l != null; + }, + next: function() { + var k = l; + l = k.next; + return k.elt; + } + }; + } + #end + + /** + Returns a String representation of `this` GenericStack. + **/ + public function toString() { + var a = new Array(); + var l = head; + while (l != null) { + a.push(l.elt); + l = l.next; + } + return "{" + a.join(",") + "}"; + } +} diff --git a/build/linux64_569e52e/std/haxe/ds/HashMap.hx b/build/linux64_569e52e/std/haxe/ds/HashMap.hx new file mode 100644 index 0000000..4ca5e6f --- /dev/null +++ b/build/linux64_569e52e/std/haxe/ds/HashMap.hx @@ -0,0 +1,120 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +import haxe.iterators.HashMapKeyValueIterator; + +/** + HashMap allows mapping of hashable objects to arbitrary values. + + See `Map` for documentation details. + + @see https://haxe.org/manual/std-Map.html +**/ +abstract HashMap(HashMapData) { + /** + Creates a new HashMap. + **/ + public inline function new() { + this = new HashMapData(); + } + + /** + See `Map.set` + **/ + @:arrayAccess public inline function set(k:K, v:V) { + this.keys.set(k.hashCode(), k); + this.values.set(k.hashCode(), v); + } + + /** + See `Map.get` + **/ + @:arrayAccess public inline function get(k:K) { + return this.values.get(k.hashCode()); + } + + /** + See `Map.exists` + **/ + public inline function exists(k:K) { + return this.values.exists(k.hashCode()); + } + + /** + See `Map.remove` + **/ + public inline function remove(k:K) { + this.values.remove(k.hashCode()); + return this.keys.remove(k.hashCode()); + } + + /** + See `Map.keys` + **/ + public inline function keys() { + return this.keys.iterator(); + } + + /** + See `Map.copy` + **/ + public function copy():HashMap { + var copied = new HashMapData(); + copied.keys = this.keys.copy(); + copied.values = this.values.copy(); + return cast copied; + } + + /** + See `Map.iterator` + **/ + public inline function iterator() { + return this.values.iterator(); + } + + /** + See `Map.keyValueIterator` + **/ + public inline function keyValueIterator():HashMapKeyValueIterator { + return new HashMapKeyValueIterator(cast this); + } + + /** + See `Map.clear` + **/ + public inline function clear():Void { + this.keys.clear(); + this.values.clear(); + } +} + +private class HashMapData { + public var keys:IntMap; + public var values:IntMap; + + public inline function new() { + keys = new IntMap(); + values = new IntMap(); + } +} diff --git a/build/linux64_569e52e/std/haxe/ds/IntMap.hx b/build/linux64_569e52e/std/haxe/ds/IntMap.hx new file mode 100644 index 0000000..d253a94 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/ds/IntMap.hx @@ -0,0 +1,99 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +/** + IntMap allows mapping of Int keys to arbitrary values. + + See `Map` for documentation details. + + @see https://haxe.org/manual/std-Map.html +**/ +extern class IntMap implements haxe.Constraints.IMap { + /** + Creates a new IntMap. + **/ + function new():Void; + + /** + See `Map.set` + **/ + function set(key:Int, value:T):Void; + + /** + See `Map.get` + **/ + function get(key:Int):Null; + + /** + See `Map.exists` + **/ + function exists(key:Int):Bool; + + /** + See `Map.remove` + **/ + function remove(key:Int):Bool; + + /** + See `Map.keys` + + (java) Implementation detail: Do not `set()` any new value while + iterating, as it may cause a resize, which will break iteration. + **/ + function keys():Iterator; + + /** + See `Map.iterator` + + (java) Implementation detail: Do not `set()` any new value while + iterating, as it may cause a resize, which will break iteration. + **/ + function iterator():Iterator; + + /** + See `Map.keyValueIterator` + **/ + #if eval + @:runtime inline function keyValueIterator():KeyValueIterator { + return new haxe.iterators.MapKeyValueIterator(this); + } + #else + function keyValueIterator():KeyValueIterator; + #end + + /** + See `Map.copy` + **/ + function copy():IntMap; + + /** + See `Map.toString` + **/ + function toString():String; + + /** + See `Map.clear` + **/ + function clear():Void; +} diff --git a/build/linux64_569e52e/std/haxe/ds/List.hx b/build/linux64_569e52e/std/haxe/ds/List.hx new file mode 100644 index 0000000..8920c93 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/ds/List.hx @@ -0,0 +1,313 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +/** + A linked-list of elements. The list is composed of element container objects + that are chained together. It is optimized so that adding or removing an + element does not imply copying the whole list content every time. + + @see https://haxe.org/manual/std-List.html +**/ +class List { + private var h:ListNode; + private var q:ListNode; + + /** + The length of `this` List. + **/ + public var length(default, null):Int; + + /** + Creates a new empty list. + **/ + public function new() { + length = 0; + } + + /** + Adds element `item` at the end of `this` List. + + `this.length` increases by 1. + **/ + public function add(item:T) { + var x = ListNode.create(item, null); + if (h == null) + h = x; + else + q.next = x; + q = x; + length++; + } + + /** + Adds element `item` at the beginning of `this` List. + + `this.length` increases by 1. + **/ + public function push(item:T) { + var x = ListNode.create(item, h); + h = x; + if (q == null) + q = x; + length++; + } + + /** + Returns the first element of `this` List, or null if no elements exist. + + This function does not modify `this` List. + **/ + public function first():Null { + return if (h == null) null else h.item; + } + + /** + Returns the last element of `this` List, or null if no elements exist. + + This function does not modify `this` List. + **/ + public function last():Null { + return if (q == null) null else q.item; + } + + /** + Returns the first element of `this` List, or null if no elements exist. + + The element is removed from `this` List. + **/ + public function pop():Null { + if (h == null) + return null; + var x = h.item; + h = h.next; + if (h == null) + q = null; + length--; + return x; + } + + /** + Tells if `this` List is empty. + **/ + public function isEmpty():Bool { + return (h == null); + } + + /** + Empties `this` List. + + This function does not traverse the elements, but simply sets the + internal references to null and `this.length` to 0. + **/ + public function clear():Void { + h = null; + q = null; + length = 0; + } + + /** + Removes the first occurrence of `v` in `this` List. + + If `v` is found by checking standard equality, it is removed from `this` + List and the function returns true. + + Otherwise, false is returned. + **/ + public function remove(v:T):Bool { + var prev:ListNode = null; + var l = h; + while (l != null) { + if (l.item == v) { + if (prev == null) + h = l.next; + else + prev.next = l.next; + if (q == l) + q = prev; + length--; + return true; + } + prev = l; + l = l.next; + } + return false; + } + + /** + Returns an iterator on the elements of the list. + **/ + public inline function iterator():ListIterator { + return new ListIterator(h); + } + + /** + Returns an iterator of the List indices and values. + **/ + @:pure @:runtime public inline function keyValueIterator():ListKeyValueIterator { + return new ListKeyValueIterator(h); + } + + /** + Returns a string representation of `this` List. + + The result is enclosed in { } with the individual elements being + separated by a comma. + **/ + public function toString() { + var s = new StringBuf(); + var first = true; + var l = h; + s.add("{"); + while (l != null) { + if (first) + first = false; + else + s.add(", "); + s.add(Std.string(l.item)); + l = l.next; + } + s.add("}"); + return s.toString(); + } + + /** + Returns a string representation of `this` List, with `sep` separating + each element. + **/ + public function join(sep:String) { + var s = new StringBuf(); + var first = true; + var l = h; + while (l != null) { + if (first) + first = false; + else + s.add(sep); + s.add(l.item); + l = l.next; + } + return s.toString(); + } + + /** + Returns a list filtered with `f`. The returned list will contain all + elements for which `f(x) == true`. + **/ + public function filter(f:T->Bool) { + var l2 = new List(); + var l = h; + while (l != null) { + var v = l.item; + l = l.next; + if (f(v)) + l2.add(v); + } + return l2; + } + + /** + Returns a new list where all elements have been converted by the + function `f`. + **/ + public function map(f:T->X):List { + var b = new List(); + var l = h; + while (l != null) { + var v = l.item; + l = l.next; + b.add(f(v)); + } + return b; + } +} + +#if neko +private extern class ListNode extends neko.NativeArray { + var item(get, set):T; + var next(get, set):ListNode; + private inline function get_item():T + return this[0]; + private inline function set_item(v:T):T + return this[0] = v; + private inline function get_next():ListNode + return this[1]; + private inline function set_next(v:ListNode):ListNode + return this[1] = v; + inline static function create(item:T, next:ListNode):ListNode { + return untyped __dollar__array(item, next); + } +} +#else +private class ListNode { + public var item:T; + public var next:ListNode; + + public function new(item:T, next:ListNode) { + this.item = item; + this.next = next; + } + + extern public inline static function create(item:T, next:ListNode):ListNode { + return new ListNode(item, next); + } +} +#end + +private class ListIterator { + var head:ListNode; + + public inline function new(head:ListNode) { + this.head = head; + } + + public inline function hasNext():Bool { + return head != null; + } + + public inline function next():T { + var val = head.item; + head = head.next; + return val; + } +} + +private class ListKeyValueIterator { + var idx:Int; + var head:ListNode; + + public inline function new(head:ListNode) { + this.head = head; + this.idx = 0; + } + + public inline function hasNext():Bool { + return head != null; + } + + public inline function next():{key:Int, value:T} { + var val = head.item; + head = head.next; + return {value: val, key: idx++}; + } +} diff --git a/build/linux64_569e52e/std/haxe/ds/ListSort.hx b/build/linux64_569e52e/std/haxe/ds/ListSort.hx new file mode 100644 index 0000000..82710c7 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/ds/ListSort.hx @@ -0,0 +1,149 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +/** + ListSort provides a stable implementation of merge sort through its `sort` + method. It has a O(N.log(N)) complexity and does not require additional memory allocation. +**/ +class ListSort { + // Note : we prefer [inline] over [@:generic] here since we want to inline the comparison function as well + + /** + Sorts List `lst` according to the comparison function `cmp`, where + `cmp(x,y)` returns 0 if `x == y`, a positive Int if `x > y` and a + negative Int if `x < y`. + + This operation modifies List `a` in place and returns its head once modified. + The `prev` of the head is set to the tail of the sorted list. + + If `list` or `cmp` are null, the result is unspecified. + **/ + public static inline function sort(list:T, cmp:T->T->Int):T { + // ported from http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html + if (list == null) + return null; + var insize = 1, nmerges, psize = 0, qsize = 0; + var p, q, e, tail:T = null; + while (true) { + p = list; + list = null; + tail = null; + nmerges = 0; + while (p != null) { + nmerges++; + q = p; + psize = 0; + for (i in 0...insize) { + psize++; + q = q.next; + if (q == null) + break; + } + qsize = insize; + while (psize > 0 || (qsize > 0 && q != null)) { + if (psize == 0) { + e = q; + q = q.next; + qsize--; + } else if (qsize == 0 || q == null || cmp(p, q) <= 0) { + e = p; + p = p.next; + psize--; + } else { + e = q; + q = q.next; + qsize--; + } + if (tail != null) + tail.next = e; + else + list = e; + e.prev = tail; + tail = e; + } + p = q; + } + tail.next = null; + if (nmerges <= 1) + break; + insize *= 2; + } + list.prev = tail; + return list; + } + + /** + Same as `sort` but on single linked list. + **/ + public static inline function sortSingleLinked(list:T, cmp:T->T->Int):T { + if (list == null) + return null; + var insize = 1, nmerges, psize = 0, qsize = 0; + var p, q, e, tail:T; + while (true) { + p = list; + list = null; + tail = null; + nmerges = 0; + while (p != null) { + nmerges++; + q = p; + psize = 0; + for (i in 0...insize) { + psize++; + q = q.next; + if (q == null) + break; + } + qsize = insize; + while (psize > 0 || (qsize > 0 && q != null)) { + if (psize == 0) { + e = q; + q = q.next; + qsize--; + } else if (qsize == 0 || q == null || cmp(p, q) <= 0) { + e = p; + p = p.next; + psize--; + } else { + e = q; + q = q.next; + qsize--; + } + if (tail != null) + tail.next = e; + else + list = e; + tail = e; + } + p = q; + } + tail.next = null; + if (nmerges <= 1) + break; + insize *= 2; + } + return list; + } +} diff --git a/build/linux64_569e52e/std/haxe/ds/Map.hx b/build/linux64_569e52e/std/haxe/ds/Map.hx new file mode 100644 index 0000000..59d9df3 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/ds/Map.hx @@ -0,0 +1,195 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +import haxe.ds.StringMap; +import haxe.ds.IntMap; +import haxe.ds.ObjectMap; +import haxe.ds.EnumValueMap; +import haxe.Constraints.IMap; + +/** + Map allows key to value mapping for arbitrary value types, and many key + types. + + This is a multi-type abstract, it is instantiated as one of its + specialization types depending on its type parameters. + + A Map can be instantiated without explicit type parameters. Type inference + will then determine the type parameters from the usage. + + Maps can also be created with `[key1 => value1, key2 => value2]` syntax. + + Map is an abstract type, it is not available at runtime. + + @see https://haxe.org/manual/std-Map.html +**/ +@:transitive +@:multiType(@:followWithAbstracts K) +abstract Map(IMap) { + /** + Creates a new Map. + + This becomes a constructor call to one of the specialization types in + the output. The rules for that are as follows: + + 1. if `K` is a `String`, `haxe.ds.StringMap` is used + 2. if `K` is an `Int`, `haxe.ds.IntMap` is used + 3. if `K` is an `EnumValue`, `haxe.ds.EnumValueMap` is used + 4. if `K` is any other class or structure, `haxe.ds.ObjectMap` is used + 5. if `K` is any other type, it causes a compile-time error + + (Cpp) Map does not use weak keys on `ObjectMap` by default. + **/ + public function new(); + + /** + Maps `key` to `value`. + + If `key` already has a mapping, the previous value disappears. + + If `key` is `null`, the result is unspecified. + **/ + public inline function set(key:K, value:V) + this.set(key, value); + + /** + Returns the current mapping of `key`. + + If no such mapping exists, `null` is returned. + + Note that a check like `map.get(key) == null` can hold for two reasons: + + 1. the map has no mapping for `key` + 2. the map has a mapping with a value of `null` + + If it is important to distinguish these cases, `exists()` should be + used. + + If `key` is `null`, the result is unspecified. + **/ + @:arrayAccess public inline function get(key:K) + return this.get(key); + + /** + Returns true if `key` has a mapping, false otherwise. + + If `key` is `null`, the result is unspecified. + **/ + public inline function exists(key:K) + return this.exists(key); + + /** + Removes the mapping of `key` and returns true if such a mapping existed, + false otherwise. + + If `key` is `null`, the result is unspecified. + **/ + public inline function remove(key:K) + return this.remove(key); + + /** + Returns an Iterator over the keys of `this` Map. + + The order of keys is undefined. + **/ + public inline function keys():Iterator { + return this.keys(); + } + + /** + Returns an Iterator over the values of `this` Map. + + The order of values is undefined. + **/ + public inline function iterator():Iterator { + return this.iterator(); + } + + /** + Returns an Iterator over the keys and values of `this` Map. + + The order of values is undefined. + **/ + public inline function keyValueIterator():KeyValueIterator { + return this.keyValueIterator(); + } + + /** + Returns a shallow copy of `this` map. + + The order of values is undefined. + **/ + public inline function copy():Map { + return cast this.copy(); + } + + /** + Returns a String representation of `this` Map. + + The exact representation depends on the platform and key-type. + **/ + public inline function toString():String { + return this.toString(); + } + + /** + Removes all keys from `this` Map. + **/ + public inline function clear():Void { + this.clear(); + } + + @:arrayAccess @:noCompletion public inline function arrayWrite(k:K, v:V):V { + this.set(k, v); + return v; + } + + @:to static inline function toStringMap(t:IMap):StringMap { + return new StringMap(); + } + + @:to static inline function toIntMap(t:IMap):IntMap { + return new IntMap(); + } + + @:to static inline function toEnumValueMapMap(t:IMap):EnumValueMap { + return new EnumValueMap(); + } + + @:to static inline function toObjectMap(t:IMap):ObjectMap { + return new ObjectMap(); + } + + @:from static inline function fromStringMap(map:StringMap):Map { + return cast map; + } + + @:from static inline function fromIntMap(map:IntMap):Map { + return cast map; + } + + @:from static inline function fromObjectMap(map:ObjectMap):Map { + return cast map; + } +} diff --git a/build/linux64_569e52e/std/haxe/ds/ObjectMap.hx b/build/linux64_569e52e/std/haxe/ds/ObjectMap.hx new file mode 100644 index 0000000..686d3e2 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/ds/ObjectMap.hx @@ -0,0 +1,102 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +/** + ObjectMap allows mapping of object keys to arbitrary values. + + On static targets, the keys are considered to be strong references. Refer + to `haxe.ds.WeakMap` for a weak reference version. + + See `Map` for documentation details. + + @see https://haxe.org/manual/std-Map.html +**/ +extern class ObjectMap implements haxe.Constraints.IMap { + /** + Creates a new ObjectMap. + **/ + function new():Void; + + /** + See `Map.set` + **/ + function set(key:K, value:V):Void; + + /** + See `Map.get` + **/ + function get(key:K):Null; + + /** + See `Map.exists` + **/ + function exists(key:K):Bool; + + /** + See `Map.remove` + **/ + function remove(key:K):Bool; + + /** + See `Map.keys` + + (java) Implementation detail: Do not `set()` any new value while + iterating, as it may cause a resize, which will break iteration. + **/ + function keys():Iterator; + + /** + See `Map.iterator` + + (java) Implementation detail: Do not `set()` any new value while + iterating, as it may cause a resize, which will break iteration. + **/ + function iterator():Iterator; + + /** + See `Map.keyValueIterator` + **/ + #if eval + @:runtime inline function keyValueIterator():KeyValueIterator { + return new haxe.iterators.MapKeyValueIterator(this); + } + #else + function keyValueIterator():KeyValueIterator; + #end + + /** + See `Map.copy` + **/ + function copy():ObjectMap; + + /** + See `Map.toString` + **/ + function toString():String; + + /** + See `Map.clear` + **/ + function clear():Void; +} diff --git a/build/linux64_569e52e/std/haxe/ds/Option.hx b/build/linux64_569e52e/std/haxe/ds/Option.hx new file mode 100644 index 0000000..060b5b6 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/ds/Option.hx @@ -0,0 +1,34 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +/** + An Option is a wrapper type which can either have a value (Some) or not a + value (None). + + @see https://haxe.org/manual/std-Option.html +**/ +enum Option { + Some(v:T); + None; +} diff --git a/build/linux64_569e52e/std/haxe/ds/ReadOnlyArray.hx b/build/linux64_569e52e/std/haxe/ds/ReadOnlyArray.hx new file mode 100644 index 0000000..c117165 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/ds/ReadOnlyArray.hx @@ -0,0 +1,62 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +/** + `ReadOnlyArray` is an abstract over an ordinary `Array` which only exposes + APIs that don't modify the instance, hence "read-only". + + Note that this doesn't necessarily mean that the instance is *immutable*. + Other code holding a reference to the underlying `Array` can still modify it, + and the reference can be obtained with a `cast`. +**/ +@:forward(copy, filter, indexOf, iterator, keyValueIterator, join, lastIndexOf, map, slice, contains, toString) +abstract ReadOnlyArray(Array) from Array to Iterable { + /** + The length of `this` Array. + **/ + public var length(get, never):Int; + + inline function get_length() + return this.length; + + @:arrayAccess inline function get(i:Int) + return this[i]; + + /** + Returns a new Array by appending the elements of `a` to the elements of + `this` Array. + + This operation does not modify `this` Array. + + If `a` is the empty Array `[]`, a copy of `this` Array is returned. + + The length of the returned Array is equal to the sum of `this.length` + and `a.length`. + + If `a` is `null`, the result is unspecified. + **/ + public inline function concat(a:ReadOnlyArray):Array { + return this.concat(cast a); + } +} diff --git a/build/linux64_569e52e/std/haxe/ds/StringMap.hx b/build/linux64_569e52e/std/haxe/ds/StringMap.hx new file mode 100644 index 0000000..811d343 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/ds/StringMap.hx @@ -0,0 +1,99 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +/** + StringMap allows mapping of String keys to arbitrary values. + + See `Map` for documentation details. + + @see https://haxe.org/manual/std-Map.html +**/ +extern class StringMap implements haxe.Constraints.IMap { + /** + Creates a new StringMap. + **/ + function new():Void; + + /** + See `Map.set` + **/ + function set(key:String, value:T):Void; + + /** + See `Map.get` + **/ + function get(key:String):Null; + + /** + See `Map.exists` + **/ + function exists(key:String):Bool; + + /** + See `Map.remove` + **/ + function remove(key:String):Bool; + + /** + See `Map.keys` + + (java) Implementation detail: Do not `set()` any new value while + iterating, as it may cause a resize, which will break iteration. + **/ + function keys():Iterator; + + /** + See `Map.iterator` + + (java) Implementation detail: Do not `set()` any new value while + iterating, as it may cause a resize, which will break iteration. + **/ + function iterator():Iterator; + + /** + See `Map.keyValueIterator` + **/ + #if eval + @:runtime inline function keyValueIterator():KeyValueIterator { + return new haxe.iterators.MapKeyValueIterator(this); + } + #else + function keyValueIterator():KeyValueIterator; + #end + + /** + See `Map.copy` + **/ + function copy():StringMap; + + /** + See `Map.toString` + **/ + function toString():String; + + /** + See `Map.clear` + **/ + function clear():Void; +} diff --git a/build/linux64_569e52e/std/haxe/ds/Vector.hx b/build/linux64_569e52e/std/haxe/ds/Vector.hx new file mode 100644 index 0000000..14b60b9 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/ds/Vector.hx @@ -0,0 +1,388 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +#if cpp +using cpp.NativeArray; +#end + +private typedef VectorData = + #if flash10 + flash.Vector + #elseif neko + neko.NativeArray + #elseif java + java.NativeArray + #elseif lua + lua.Table + #elseif eval + eval.Vector + #else + Array + #end; + +/** + A Vector is a storage of fixed size. It can be faster than Array on some + targets, and is never slower. + + @see https://haxe.org/manual/std-vector.html +**/ +abstract Vector(VectorData) { + /** + Creates a new Vector of length `length`. + + Initially `this` Vector contains `length` neutral elements: + + - always null on dynamic targets + - 0, 0.0 or false for Int, Float and Bool respectively on static targets + - null for other types on static targets + + If `length` is less than or equal to 0, the result is unspecified. + **/ + extern overload public inline function new(length:Int) { + #if flash10 + this = new flash.Vector(length, true); + #elseif neko + this = untyped __dollar__amake(length); + #elseif js + this = js.Syntax.construct(Array, length); + #elseif java + this = new java.NativeArray(length); + #elseif cpp + this = NativeArray.create(length); + #elseif python + this = python.Syntax.code("([{0}]*{1})", null, length); + #elseif lua + this = untyped __lua_table__({length: length}); + #elseif eval + this = new eval.Vector(length); + #else + this = []; + untyped this.length = length; + #end + } + + /** + Creates a new Vector of length `length` filled with `defaultValue` elements. + + Can be faster than `new Vector(length)` for iteration on some targets for non-nullable elements. + + If `length` is less than or equal to 0, the result is unspecified. + **/ + extern overload public inline function new(length:Int, defaultValue:T):Vector { + #if js + this = [for (_ in 0...length) defaultValue]; + #elseif python + this = python.Syntax.code("([{0}]*{1})", defaultValue, length); + #else + + #if flash10 + this = new flash.Vector(length, true); + #elseif neko + this = untyped __dollar__amake(length); + #elseif java + this = new java.NativeArray(length); + #elseif cpp + this = NativeArray.create(length); + #elseif lua + this = untyped __lua_table__({length: length}); + #elseif eval + this = new eval.Vector(length); + #else + this = []; + untyped this.length = length; + #end + fill(defaultValue); + + #end + } + + /** + Returns the value at index `index`. + + If `index` is negative or exceeds `this.length`, the result is + unspecified. + **/ + @:op([]) public inline function get(index:Int):T { + #if cpp + return this.unsafeGet(index); + #elseif python + return python.internal.ArrayImpl.unsafeGet(this, index); + #elseif eval + return this[index]; + #else + return this[index]; + #end + } + + /** + Sets the value at index `index` to `val`. + + If `index` is negative or exceeds `this.length`, the result is + unspecified. + **/ + @:op([]) public inline function set(index:Int, val:T):T { + #if cpp + return this.unsafeSet(index, val); + #elseif python + return python.internal.ArrayImpl.unsafeSet(this, index, val); + #elseif eval + return this[index] = val; + #else + return this[index] = val; + #end + } + + /** + Returns the length of `this` Vector. + **/ + public var length(get, never):Int; + + inline function get_length():Int { + #if neko + return untyped __dollar__asize(this); + #elseif java + return this.length; + #elseif python + return this.length; + #else + return untyped this.length; + #end + } + + /** + Sets all `length` elements of `this` Vector to `value`. + **/ + public inline function fill(value:T):Void + for (i in 0...length) this[i] = value; + + /** + Copies `length` of elements from `src` Vector, beginning at `srcPos` to + `dest` Vector, beginning at `destPos` + + The results are unspecified if `length` results in out-of-bounds access, + or if `src` or `dest` are null + **/ + public static #if (java || neko || cpp || eval) inline #end function blit(src:Vector, srcPos:Int, dest:Vector, destPos:Int, len:Int):Void { + #if neko + untyped __dollar__ablit(dest, destPos, src, srcPos, len); + #elseif java + java.lang.System.arraycopy(src, srcPos, dest, destPos, len); + #elseif cpp + dest.toData().blit(destPos, src.toData(), srcPos, len); + #elseif eval + src.toData().blit(srcPos, dest.toData(), destPos, len); + #else + if (src == dest) { + if (srcPos < destPos) { + var i = srcPos + len; + var j = destPos + len; + for (k in 0...len) { + i--; + j--; + src[j] = src[i]; + } + } else if (srcPos > destPos) { + var i = srcPos; + var j = destPos; + for (k in 0...len) { + src[j] = src[i]; + i++; + j++; + } + } + } else { + for (i in 0...len) { + dest[destPos + i] = src[srcPos + i]; + } + } + #end + } + + /** + Creates a new Array, copy the content from the Vector to it, and returns it. + **/ + public #if (flash || cpp || js || java || eval) inline #end function toArray():Array { + #if cpp + return this.copy(); + #elseif python + return this.copy(); + #elseif js + return this.slice(0); + #elseif eval + return this.toArray(); + #else + var a = new Array(); + var len = length; + #if (neko) + // prealloc good size + if (len > 0) + a[len - 1] = get(0); + #end + for (i in 0...len) + a[i] = get(i); + return a; + #end + } + + /** + Extracts the data of `this` Vector. + + This returns the internal representation type. + **/ + public inline function toData():VectorData + return cast this; + + /** + Initializes a new Vector from `data`. + + Since `data` is the internal representation of Vector, this is a no-op. + + If `data` is null, the corresponding Vector is also `null`. + **/ + static public inline function fromData(data:VectorData):Vector + return cast data; + + /** + Creates a new Vector by copying the elements of `array`. + + This always creates a copy, even on platforms where the internal + representation is Array. + + The elements are not copied and retain their identity, so + `a[i] == Vector.fromArrayCopy(a).get(i)` is true for any valid i. + + If `array` is null, the result is unspecified. + **/ + static public inline function fromArrayCopy(array:Array):Vector { + #if python + return cast array.copy(); + #elseif flash10 + return fromData(flash.Vector.ofArray(array)); + #elseif java + return fromData(java.Lib.nativeArray(array, false)); + #elseif cpp + return cast array.copy(); + #elseif js + return fromData(array.slice(0)); + #elseif eval + return fromData(eval.Vector.fromArrayCopy(array)); + #else + // TODO: Optimize this for others? + var vec = new Vector(array.length); + for (i in 0...array.length) + vec.set(i, array[i]); + return vec; + #end + } + + /** + Returns a shallow copy of `this` Vector. + + The elements are not copied and retain their identity, so + `a[i] == a.copy()[i]` is true for any valid `i`. However, + `a == a.copy()` is always false. + **/ + extern public inline function copy():Vector { + #if eval + return fromData(this.copy()); + #else + var r = new Vector(length); + Vector.blit(cast this, 0, r, 0, length); + return r; + #end + } + + /** + Returns a string representation of `this` Vector, with `sep` separating + each element. + + The result of this operation is equal to `Std.string(this[0]) + sep + + Std.string(this[1]) + sep + ... + sep + Std.string(this[this.length-1])` + + If `this` Vector has length 0, the result is the empty String `""`. + If `this` has exactly one element, the result is equal to a call to + `Std.string(this[0])`. + + If `sep` is null, the result is unspecified. + **/ + extern public inline function join(sep:String):String { + #if (flash10 || cpp || eval) + return this.join(sep); + #else + var b = new StringBuf(); + var len = length; + for (i in 0...len) { + b.add(Std.string(get(i))); + if (i < len - 1) { + b.add(sep); + } + } + return b.toString(); + #end + } + + /** + Creates a new Vector by applying function `f` to all elements of `this`. + + The order of elements is preserved. + + If `f` is null, the result is unspecified. + **/ + extern public inline function map(f:T->S):Vector { + #if eval + return fromData(this.map(f)); + #else + var length = length; + var r = new Vector(length); + var len = length; + for (i in 0...len) { + var v = f(get(i)); + r.set(i, v); + } + return r; + #end + } + + /** + Sorts `this` Vector according to the comparison function `f`, where + `f(x,y)` returns 0 if x == y, a positive Int if x > y and a + negative Int if x < y. + + This operation modifies `this` Vector in place. + + The sort operation is not guaranteed to be stable, which means that the + order of equal elements may not be retained. + + If `f` is null, the result is unspecified. + **/ + public inline function sort(f:T->T->Int):Void { + #if (neko || java || eval) + throw "not yet supported"; + #elseif lua + haxe.ds.ArraySort.sort(cast this, f); + #else + this.sort(f); + #end + } +} diff --git a/build/linux64_569e52e/std/haxe/ds/WeakMap.hx b/build/linux64_569e52e/std/haxe/ds/WeakMap.hx new file mode 100644 index 0000000..1d3bf7f --- /dev/null +++ b/build/linux64_569e52e/std/haxe/ds/WeakMap.hx @@ -0,0 +1,107 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +/** + WeakMap allows mapping of object keys to arbitrary values. + + The keys are considered to be weak references on static targets. + + See `Map` for documentation details. + + @see https://haxe.org/manual/std-Map.html +**/ +class WeakMap implements haxe.Constraints.IMap { + /** + Creates a new WeakMap. + **/ + public function new():Void { + throw new haxe.exceptions.NotImplementedException("Not implemented for this platform"); + } + + /** + See `Map.set` + **/ + public function set(key:K, value:V):Void {} + + /** + See `Map.get` + **/ + public function get(key:K):Null { + return null; + } + + /** + See `Map.exists` + **/ + public function exists(key:K):Bool { + return false; + } + + /** + See `Map.remove` + **/ + public function remove(key:K):Bool { + return false; + } + + /** + See `Map.keys` + **/ + public function keys():Iterator { + return null; + } + + /** + See `Map.iterator` + **/ + public function iterator():Iterator { + return null; + } + + /** + See `Map.keyValueIterator` + **/ + public inline function keyValueIterator():KeyValueIterator { + return null; + } + + /** + See `Map.copy` + **/ + public function copy():WeakMap { + return null; + } + + /** + See `Map.toString` + **/ + public function toString():String { + return null; + } + + /** + See `Map.clear` + **/ + public function clear():Void {} +} diff --git a/build/linux64_569e52e/std/haxe/exceptions/ArgumentException.hx b/build/linux64_569e52e/std/haxe/exceptions/ArgumentException.hx new file mode 100644 index 0000000..8bd0fc9 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/exceptions/ArgumentException.hx @@ -0,0 +1,16 @@ +package haxe.exceptions; + +/** + An exception that is thrown when an invalid value provided for an argument of a function. +**/ +class ArgumentException extends PosException { + /** + An argument name. + **/ + public final argument:String; + + public function new(argument:String, ?message:String, ?previous:Exception, ?pos:PosInfos):Void { + super(message == null ? 'Invalid argument "$argument"' : message, previous, pos); + this.argument = argument; + } +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/haxe/exceptions/NotImplementedException.hx b/build/linux64_569e52e/std/haxe/exceptions/NotImplementedException.hx new file mode 100644 index 0000000..22ad9d0 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/exceptions/NotImplementedException.hx @@ -0,0 +1,10 @@ +package haxe.exceptions; + +/** + An exception that is thrown when requested function or operation does not have an implementation. +**/ +class NotImplementedException extends PosException { + public function new(message:String = 'Not implemented', ?previous:Exception, ?pos:PosInfos):Void { + super(message, previous, pos); + } +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/haxe/exceptions/PosException.hx b/build/linux64_569e52e/std/haxe/exceptions/PosException.hx new file mode 100644 index 0000000..2b2af5a --- /dev/null +++ b/build/linux64_569e52e/std/haxe/exceptions/PosException.hx @@ -0,0 +1,27 @@ +package haxe.exceptions; + +/** + An exception that carry position information of a place where it was created. +**/ +class PosException extends Exception { + /** + Position where this exception was created. + **/ + public final posInfos:PosInfos; + + public function new(message:String, ?previous:Exception, ?pos:PosInfos):Void { + super(message, previous); + if (pos == null) { + posInfos = { fileName:'(unknown)', lineNumber:0, className:'(unknown)', methodName:'(unknown)' } + } else { + posInfos = pos; + } + } + + /** + Returns exception message. + **/ + override function toString():String { + return '${super.toString()} in ${posInfos.className}.${posInfos.methodName} at ${posInfos.fileName}:${posInfos.lineNumber}'; + } +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/haxe/extern/AsVar.hx b/build/linux64_569e52e/std/haxe/extern/AsVar.hx new file mode 100644 index 0000000..9c25419 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/extern/AsVar.hx @@ -0,0 +1,32 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.extern; + +/** + If this type is used as an argument type, the compiler ensures that + argument expressions are bound to a local variable. +**/ +@:forward +@:transitive +@:semantics(variable) +abstract AsVar(T) from T to T {} diff --git a/build/linux64_569e52e/std/haxe/extern/EitherType.hx b/build/linux64_569e52e/std/haxe/extern/EitherType.hx new file mode 100644 index 0000000..1e87e1c --- /dev/null +++ b/build/linux64_569e52e/std/haxe/extern/EitherType.hx @@ -0,0 +1,37 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.extern; + +/** + An abstract type allowing values to be either of `T1` or `T2` type. + Supports implicit casts from/to either types. + + It is useful for interfacing with external code on dynamic platforms + such as JavaScript or Python. + + Otherwise, use of this type is discouraged. + + @see +**/ +@:transitive +abstract EitherType(Dynamic) from T1 to T1 from T2 to T2 {} diff --git a/build/linux64_569e52e/std/haxe/extern/Rest.hx b/build/linux64_569e52e/std/haxe/extern/Rest.hx new file mode 100644 index 0000000..5ada533 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/extern/Rest.hx @@ -0,0 +1,34 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.extern; + +/** + DEPRECATED: use haxe.Rest instead. + + A special type that represents "rest" function argument. + Should be used as a type for the last argument of an extern method, + representing that arbitrary number of arguments of given type can be + passed to that method. + @see +**/ +typedef Rest = haxe.Rest diff --git a/build/linux64_569e52e/std/haxe/format/JsonParser.hx b/build/linux64_569e52e/std/haxe/format/JsonParser.hx new file mode 100644 index 0000000..188719a --- /dev/null +++ b/build/linux64_569e52e/std/haxe/format/JsonParser.hx @@ -0,0 +1,324 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.format; + +/** + An implementation of JSON parser in Haxe. + + This class is used by `haxe.Json` when native JSON implementation + is not available. + + @see https://haxe.org/manual/std-Json-parsing.html +**/ +class JsonParser { + /** + Parses given JSON-encoded `str` and returns the resulting object. + + JSON objects are parsed into anonymous structures and JSON arrays + are parsed into `Array`. + + If given `str` is not valid JSON, an exception will be thrown. + + If `str` is null, the result is unspecified. + **/ + static public inline function parse(str:String):Dynamic { + return new JsonParser(str).doParse(); + } + + var str:String; + var pos:Int; + + function new(str:String) { + this.str = str; + this.pos = 0; + } + + function doParse():Dynamic { + var result = parseRec(); + var c; + while (!StringTools.isEof(c = nextChar())) { + switch (c) { + case ' '.code, '\r'.code, '\n'.code, '\t'.code: + // allow trailing whitespace + default: + invalidChar(); + } + } + return result; + } + + function parseRec():Dynamic { + while (true) { + var c = nextChar(); + switch (c) { + case ' '.code, '\r'.code, '\n'.code, '\t'.code: + // loop + case '{'.code: + var obj = {}, field = null, comma:Null = null; + while (true) { + var c = nextChar(); + switch (c) { + case ' '.code, '\r'.code, '\n'.code, '\t'.code: + // loop + case '}'.code: + if (field != null || comma == false) + invalidChar(); + return obj; + case ':'.code: + if (field == null) + invalidChar(); + Reflect.setField(obj, field, parseRec()); + field = null; + comma = true; + case ','.code: + if (comma) comma = false else invalidChar(); + case '"'.code: + if (field != null || comma) invalidChar(); + field = parseString(); + default: + invalidChar(); + } + } + case '['.code: + var arr = [], comma:Null = null; + while (true) { + var c = nextChar(); + switch (c) { + case ' '.code, '\r'.code, '\n'.code, '\t'.code: + // loop + case ']'.code: + if (comma == false) invalidChar(); + return arr; + case ','.code: + if (comma) comma = false else invalidChar(); + default: + if (comma) invalidChar(); + pos--; + arr.push(parseRec()); + comma = true; + } + } + case 't'.code: + var save = pos; + if (nextChar() != 'r'.code || nextChar() != 'u'.code || nextChar() != 'e'.code) { + pos = save; + invalidChar(); + } + return true; + case 'f'.code: + var save = pos; + if (nextChar() != 'a'.code || nextChar() != 'l'.code || nextChar() != 's'.code || nextChar() != 'e'.code) { + pos = save; + invalidChar(); + } + return false; + case 'n'.code: + var save = pos; + if (nextChar() != 'u'.code || nextChar() != 'l'.code || nextChar() != 'l'.code) { + pos = save; + invalidChar(); + } + return null; + case '"'.code: + return parseString(); + case '0'.code, '1'.code, '2'.code, '3'.code, '4'.code, '5'.code, '6'.code, '7'.code, '8'.code, '9'.code, '-'.code: + return parseNumber(c); + default: + invalidChar(); + } + } + } + + function parseString() { + var start = pos; + var buf:StringBuf = null; + #if target.unicode + var prev = -1; + inline function cancelSurrogate() { + // invalid high surrogate (not followed by low surrogate) + buf.addChar(0xFFFD); + prev = -1; + } + #end + while (true) { + var c = nextChar(); + if (c == '"'.code) + break; + if (c == '\\'.code) { + if (buf == null) { + buf = new StringBuf(); + } + buf.addSub(str, start, pos - start - 1); + c = nextChar(); + #if target.unicode + if (c != "u".code && prev != -1) + cancelSurrogate(); + #end + switch (c) { + case "r".code: + buf.addChar("\r".code); + case "n".code: + buf.addChar("\n".code); + case "t".code: + buf.addChar("\t".code); + case "b".code: + buf.addChar(8); + case "f".code: + buf.addChar(12); + case "/".code, '\\'.code, '"'.code: + buf.addChar(c); + case 'u'.code: + var uc:Int = Std.parseInt("0x" + str.substr(pos, 4)); + pos += 4; + #if !target.unicode + if (uc <= 0x7F) + buf.addChar(uc); + else if (uc <= 0x7FF) { + buf.addChar(0xC0 | (uc >> 6)); + buf.addChar(0x80 | (uc & 63)); + } else if (uc <= 0xFFFF) { + buf.addChar(0xE0 | (uc >> 12)); + buf.addChar(0x80 | ((uc >> 6) & 63)); + buf.addChar(0x80 | (uc & 63)); + } else { + buf.addChar(0xF0 | (uc >> 18)); + buf.addChar(0x80 | ((uc >> 12) & 63)); + buf.addChar(0x80 | ((uc >> 6) & 63)); + buf.addChar(0x80 | (uc & 63)); + } + #else + if (prev != -1) { + if (uc < 0xDC00 || uc > 0xDFFF) + cancelSurrogate(); + else { + buf.addChar(((prev - 0xD800) << 10) + (uc - 0xDC00) + 0x10000); + prev = -1; + } + } else if (uc >= 0xD800 && uc <= 0xDBFF) + prev = uc; + else + buf.addChar(uc); + #end + default: + throw "Invalid escape sequence \\" + String.fromCharCode(c) + " at position " + (pos - 1); + } + start = pos; + } + #if !(target.unicode) + // ensure utf8 chars are not cut + else if (c >= 0x80) { + pos++; + if (c >= 0xFC) + pos += 4; + else if (c >= 0xF8) + pos += 3; + else if (c >= 0xF0) + pos += 2; + else if (c >= 0xE0) + pos++; + } + #end + else if (StringTools.isEof(c)) + throw "Unclosed string"; + } + #if target.unicode + if (prev != -1) + cancelSurrogate(); + #end + if (buf == null) { + return str.substr(start, pos - start - 1); + } else { + buf.addSub(str, start, pos - start - 1); + return buf.toString(); + } + } + + inline function parseNumber(c:Int):Dynamic { + var start = pos - 1; + var minus = c == '-'.code, digit = !minus, zero = c == '0'.code; + var point = false, e = false, pm = false, end = false; + while (true) { + c = nextChar(); + switch (c) { + case '0'.code: + if (zero && !point) + invalidNumber(start); + if (minus) { + minus = false; + zero = true; + } + digit = true; + case '1'.code, '2'.code, '3'.code, '4'.code, '5'.code, '6'.code, '7'.code, '8'.code, '9'.code: + if (zero && !point) + invalidNumber(start); + if (minus) + minus = false; + digit = true; + zero = false; + case '.'.code: + if (minus || point || e) + invalidNumber(start); + digit = false; + point = true; + case 'e'.code, 'E'.code: + if (minus || zero || e) + invalidNumber(start); + digit = false; + e = true; + case '+'.code, '-'.code: + if (!e || pm) + invalidNumber(start); + digit = false; + pm = true; + default: + if (!digit) + invalidNumber(start); + pos--; + end = true; + } + if (end) + break; + } + + var f = Std.parseFloat(str.substr(start, pos - start)); + if(point) { + return f; + } else { + var i = Std.int(f); + return if (i == f) i else f; + } + } + + inline function nextChar() { + return StringTools.fastCodeAt(str, pos++); + } + + function invalidChar() { + pos--; // rewind + throw "Invalid char " + StringTools.fastCodeAt(str, pos) + " at position " + pos; + } + + function invalidNumber(start:Int) { + throw "Invalid number at position " + start + ": " + str.substr(start, pos - start); + } +} diff --git a/build/linux64_569e52e/std/haxe/format/JsonPrinter.hx b/build/linux64_569e52e/std/haxe/format/JsonPrinter.hx new file mode 100644 index 0000000..20cd597 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/format/JsonPrinter.hx @@ -0,0 +1,290 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.format; + +/** + An implementation of JSON printer in Haxe. + + This class is used by `haxe.Json` when native JSON implementation + is not available. + + @see https://haxe.org/manual/std-Json-encoding.html +**/ +class JsonPrinter { + /** + Encodes `o`'s value and returns the resulting JSON string. + + If `replacer` is given and is not null, it is used to retrieve + actual object to be encoded. The `replacer` function takes two parameters, + the key and the value being encoded. Initial key value is an empty string. + + If `space` is given and is not null, the result will be pretty-printed. + Successive levels will be indented by this string. + **/ + static public function print(o:Dynamic, ?replacer:(key:Dynamic, value:Dynamic) -> Dynamic, ?space:String):String { + var printer = new JsonPrinter(replacer, space); + printer.write("", o); + return printer.buf.toString(); + } + + var buf:#if flash flash.utils.ByteArray #else StringBuf #end; + var replacer:(key:Dynamic, value:Dynamic) -> Dynamic; + var indent:String; + var pretty:Bool; + var nind:Int; + + function new(replacer:(key:Dynamic, value:Dynamic) -> Dynamic, space:String) { + this.replacer = replacer; + this.indent = space; + this.pretty = space != null; + this.nind = 0; + + #if flash + buf = new flash.utils.ByteArray(); + buf.endian = flash.utils.Endian.BIG_ENDIAN; + buf.position = 0; + #else + buf = new StringBuf(); + #end + } + + inline function ipad():Void { + if (pretty) + add(StringTools.lpad('', indent, nind * indent.length)); + } + + inline function newl():Void { + if (pretty) + addChar('\n'.code); + } + + function write(k:Dynamic, v:Dynamic) { + if (replacer != null) + v = replacer(k, v); + switch (Type.typeof(v)) { + case TUnknown: + add('"???"'); + case TObject: + objString(v); + case TInt: + add(#if (jvm || hl) Std.string(v) #else v #end); + case TFloat: + add(Math.isFinite(v) ? Std.string(v) : 'null'); + case TFunction: + add('""'); + case TClass(c): + if (c == String) + quote(v); + else if (c == Array) { + var v:Array = v; + addChar('['.code); + + var len = v.length; + var last = len - 1; + for (i in 0...len) { + if (i > 0) + addChar(','.code) + else + nind++; + newl(); + ipad(); + write(i, v[i]); + if (i == last) { + nind--; + newl(); + ipad(); + } + } + addChar(']'.code); + } else if (c == haxe.ds.StringMap) { + var v:haxe.ds.StringMap = v; + var o = {}; + for (k in v.keys()) + Reflect.setField(o, k, v.get(k)); + objString(o); + } else if (c == Date) { + var v:Date = v; + quote(v.toString()); + } else + classString(v); + case TEnum(_): + var i = Type.enumIndex(v); + add(Std.string(i)); + case TBool: + add(#if (php || jvm || hl) (v ? 'true' : 'false') #else v #end); + case TNull: + add('null'); + } + } + + extern inline function addChar(c:Int) { + #if flash + buf.writeByte(c); + #else + buf.addChar(c); + #end + } + + extern inline function add(v:String) { + #if flash + // argument is not always a string but will be automatically casted + buf.writeUTFBytes(v); + #else + buf.add(v); + #end + } + + function classString(v:Dynamic) { + fieldsString(v, Type.getInstanceFields(Type.getClass(v))); + } + + inline function objString(v:Dynamic) { + fieldsString(v, Reflect.fields(v)); + } + + function fieldsString(v:Dynamic, fields:Array) { + addChar('{'.code); + var len = fields.length; + var empty = true; + for (i in 0...len) { + var f = fields[i]; + var value = Reflect.field(v, f); + if (Reflect.isFunction(value)) + continue; + if (empty) { + nind++; + empty = false; + } else + addChar(','.code); + newl(); + ipad(); + quote(f); + addChar(':'.code); + if (pretty) + addChar(' '.code); + write(f, value); + } + if (!empty) { + nind--; + newl(); + ipad(); + } + addChar('}'.code); + } + + function quote(s:String) { + #if neko + if (s.length != neko.Utf8.length(s)) { + quoteUtf8(s); + return; + } + #end + addChar('"'.code); + var i = 0; + var length = s.length; + #if hl + var prev = -1; + #end + while (i < length) { + var c = StringTools.unsafeCodeAt(s, i++); + switch (c) { + case '"'.code: + add('\\"'); + case '\\'.code: + add('\\\\'); + case '\n'.code: + add('\\n'); + case '\r'.code: + add('\\r'); + case '\t'.code: + add('\\t'); + case 8: + add('\\b'); + case 12: + add('\\f'); + default: + #if flash + if (c >= 128) + add(String.fromCharCode(c)) + else + addChar(c); + #elseif hl + if (prev >= 0) { + if (c >= 0xD800 && c <= 0xDFFF) { + addChar((((prev - 0xD800) << 10) | (c - 0xDC00)) + 0x10000); + prev = -1; + } else { + addChar("□".code); + prev = c; + } + } else { + if (c >= 0xD800 && c <= 0xDFFF) + prev = c; + else + addChar(c); + } + #else + addChar(c); + #end + } + } + #if hl + if (prev >= 0) + addChar("□".code); + #end + addChar('"'.code); + } + + #if neko + function quoteUtf8(s:String) { + var u = new neko.Utf8(); + neko.Utf8.iter(s, function(c) { + switch (c) { + case '\\'.code, '"'.code: + u.addChar('\\'.code); + u.addChar(c); + case '\n'.code: + u.addChar('\\'.code); + u.addChar('n'.code); + case '\r'.code: + u.addChar('\\'.code); + u.addChar('r'.code); + case '\t'.code: + u.addChar('\\'.code); + u.addChar('t'.code); + case 8: + u.addChar('\\'.code); + u.addChar('b'.code); + case 12: + u.addChar('\\'.code); + u.addChar('f'.code); + default: + u.addChar(c); + } + }); + buf.add('"'); + buf.add(u.toString()); + buf.add('"'); + } + #end +} diff --git a/build/linux64_569e52e/std/haxe/http/HttpBase.hx b/build/linux64_569e52e/std/haxe/http/HttpBase.hx new file mode 100644 index 0000000..ac3bcda --- /dev/null +++ b/build/linux64_569e52e/std/haxe/http/HttpBase.hx @@ -0,0 +1,251 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.http; + +import haxe.io.Bytes; + +private typedef StringKeyValue = { + var name:String; + var value:String; +} + +/** + This class can be used to handle Http requests consistently across + platforms. There are two intended usages: + + - call `haxe.Http.requestUrl(url)` and receive the result as a `String` + (only available on `sys` targets) + - create a `new haxe.Http(url)`, register your callbacks for `onData`, + `onError` and `onStatus`, then call `request()`. +**/ +class HttpBase { + /** + The url of `this` request. It is used only by the `request()` method and + can be changed in order to send the same request to different target + Urls. + **/ + public var url:String; + + public var responseData(get,never):Null; + public var responseBytes(default,null):Null; + + var responseAsString:Null; + var postData:Null; + var postBytes:Null; + var headers:Array; + var params:Array; + + final emptyOnData:(String)->Void; + + /** + Creates a new Http instance with `url` as parameter. + + This does not do a request until `request()` is called. + + If `url` is null, the field url must be set to a value before making the + call to `request()`, or the result is unspecified. + + (Php) Https (SSL) connections are allowed only if the OpenSSL extension + is enabled. + **/ + public function new(url:String) { + this.url = url; + headers = []; + params = []; + emptyOnData = onData; + } + + /** + Sets the header identified as `name` to value `value`. + + If `name` or `value` are null, the result is unspecified. + + This method provides a fluent interface. + **/ + public function setHeader(name:String, value:String) { + for (i in 0...headers.length) { + if (headers[i].name == name) { + headers[i] = {name: name, value: value}; + return #if hx3compat this #end; + } + } + headers.push({name: name, value: value}); + #if hx3compat + return this; + #end + } + + public function addHeader(header:String, value:String) { + headers.push({name: header, value: value}); + #if hx3compat + return this; + #end + } + + /** + Sets the parameter identified as `name` to value `value`. + + If `name` or `value` are null, the result is unspecified. + + This method provides a fluent interface. + **/ + public function setParameter(name:String, value:String) { + for (i in 0...params.length) { + if (params[i].name == name) { + params[i] = {name: name, value: value}; + return #if hx3compat this #end; + } + } + params.push({name: name, value: value}); + #if hx3compat + return this; + #end + } + + public function addParameter(name:String, value:String) { + params.push({name: name, value: value}); + #if hx3compat + return this; + #end + } + + /** + Sets the post data of `this` Http request to `data` string. + + There can only be one post data per request. Subsequent calls to + this method or to `setPostBytes()` overwrite the previously set value. + + If `data` is null, the post data is considered to be absent. + + This method provides a fluent interface. + **/ + public function setPostData(data:Null) { + postData = data; + postBytes = null; + #if hx3compat + return this; + #end + } + + /** + Sets the post data of `this` Http request to `data` bytes. + + There can only be one post data per request. Subsequent calls to + this method or to `setPostData()` overwrite the previously set value. + + If `data` is null, the post data is considered to be absent. + + This method provides a fluent interface. + **/ + public function setPostBytes(data:Null) { + postBytes = data; + postData = null; + #if hx3compat + return this; + #end + } + + /** + Sends `this` Http request to the Url specified by `this.url`. + + If `post` is true, the request is sent as POST request, otherwise it is + sent as GET request. + + Depending on the outcome of the request, this method calls the + `onStatus()`, `onError()`, `onData()` or `onBytes()` callback functions. + + If `this.url` is null, the result is unspecified. + + If `this.url` is an invalid or inaccessible Url, the `onError()` callback + function is called. + + [js] If `this.async` is false, the callback functions are called before + this method returns. + **/ + public function request(?post:Bool):Void { + throw new haxe.exceptions.NotImplementedException(); + } + + /** + This method is called upon a successful request, with `data` containing + the result String. + + The intended usage is to bind it to a custom function: + `httpInstance.onData = function(data) { // handle result }` + **/ + public dynamic function onData(data:String) {} + + /** + This method is called upon a successful request, with `data` containing + the result String. + + The intended usage is to bind it to a custom function: + `httpInstance.onBytes = function(data) { // handle result }` + **/ + public dynamic function onBytes(data:Bytes) {} + + /** + This method is called upon a request error, with `msg` containing the + error description. + + The intended usage is to bind it to a custom function: + `httpInstance.onError = function(msg) { // handle error }` + **/ + public dynamic function onError(msg:String) {} + + /** + This method is called upon a Http status change, with `status` being the + new status. + + The intended usage is to bind it to a custom function: + `httpInstance.onStatus = function(status) { // handle status }` + **/ + public dynamic function onStatus(status:Int) {} + + /** + Override this if extending `haxe.Http` with overriding `onData` + **/ + function hasOnData():Bool { + return !Reflect.compareMethods(onData, emptyOnData); + } + + function success(data:Bytes) { + responseBytes = data; + responseAsString = null; + if (hasOnData()) { + onData(responseData); + } + onBytes(responseBytes); + } + + function get_responseData() { + if (responseAsString == null && responseBytes != null) { + #if neko + responseAsString = neko.Lib.stringReference(responseBytes); + #else + responseAsString = responseBytes.getString(0, responseBytes.length, UTF8); + #end + } + return responseAsString; + } +} diff --git a/build/linux64_569e52e/std/haxe/http/HttpJs.hx b/build/linux64_569e52e/std/haxe/http/HttpJs.hx new file mode 100644 index 0000000..5f5eb51 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/http/HttpJs.hx @@ -0,0 +1,177 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.http; + +#if js +import js.html.XMLHttpRequestResponseType; +import js.html.Blob; +import haxe.io.Bytes; + +class HttpJs extends haxe.http.HttpBase { + public var async:Bool; + public var withCredentials:Bool; + public var responseHeaders:Map; + + var req:js.html.XMLHttpRequest; + + public function new(url:String) { + async = true; + withCredentials = false; + super(url); + } + + /** + Cancels `this` Http request if `request` has been called and a response + has not yet been received. + **/ + public function cancel() { + if (req == null) + return; + req.abort(); + req = null; + } + + public override function request(?post:Bool) { + this.responseAsString = null; + this.responseBytes = null; + this.responseHeaders = null; + var r = req = js.Browser.createXMLHttpRequest(); + var onreadystatechange = function(_) { + if (r.readyState != 4) + return; + var s = try r.status catch (e:Dynamic) null; + if (s == 0 && js.Browser.supported && js.Browser.location != null) { + // If the request is local and we have data: assume a success (jQuery approach): + var protocol = js.Browser.location.protocol.toLowerCase(); + var rlocalProtocol = ~/^(?:about|app|app-storage|.+-extension|file|res|widget):$/; + var isLocal = rlocalProtocol.match(protocol); + if (isLocal) { + s = r.response != null ? 200 : 404; + } + } + if (s == js.Lib.undefined) + s = null; + if (s != null) + onStatus(s); + if (s != null && s >= 200 && s < 400) { + req = null; + + // split headers and remove the last \r\n\r\n + var headers = r.getAllResponseHeaders().split('\r\n'); + headers = headers.filter(h -> h != ''); + + // store response headers + responseHeaders = new haxe.ds.StringMap(); + for (hline in headers) { + var a = hline.split(": "); + var hname = a.shift(); + var hval = if (a.length == 1) a[0] else a.join(": "); + hval = StringTools.ltrim(StringTools.rtrim(hval)); + responseHeaders.set(hname, hval); + } + + success(Bytes.ofData(r.response)); + } else if (s == null || (s == 0 && r.response == null)) { + req = null; + onError("Failed to connect or resolve host"); + } else + switch (s) { + case 12029: + req = null; + onError("Failed to connect to host"); + case 12007: + req = null; + onError("Unknown host"); + default: + req = null; + responseBytes = r.response != null ? Bytes.ofData(r.response) : null; + onError("Http Error #" + r.status); + } + }; + if (async) + r.onreadystatechange = onreadystatechange; + var uri:Null = switch [postData, postBytes] { + case [null, null]: null; + case [str, null]: str; + case [null, bytes]: new Blob([bytes.getData()]); + case _: null; + } + if (uri != null) + post = true; + else + for (p in params) { + if (uri == null) + uri = ""; + else + uri = uri + "&"; + uri = uri + StringTools.urlEncode(p.name) + "=" + StringTools.urlEncode(p.value); + } + try { + if (post) + r.open("POST", url, async); + else if (uri != null) { + var question = url.split("?").length <= 1; + r.open("GET", url + (if (question) "?" else "&") + uri, async); + uri = null; + } else + r.open("GET", url, async); + r.responseType = ARRAYBUFFER; + } catch (e:Dynamic) { + req = null; + onError(e.toString()); + return; + } + r.withCredentials = withCredentials; + if (!Lambda.exists(headers, function(h) return h.name == "Content-Type") && post && postData == null) + r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); + + for (h in headers) + r.setRequestHeader(h.name, h.value); + r.send(uri); + if (!async) + onreadystatechange(null); + } + + /** + Makes a synchronous request to `url`. + + This creates a new Http instance and makes a GET request by calling its + `request(false)` method. + + If `url` is null, the result is unspecified. + **/ + public static function requestUrl(url:String):String { + var h = new Http(url); + h.async = false; + var r = null; + h.onData = function(d) { + r = d; + } + h.onError = function(e) { + throw e; + } + h.request(false); + return r; + } +} +#end diff --git a/build/linux64_569e52e/std/haxe/http/HttpMethod.hx b/build/linux64_569e52e/std/haxe/http/HttpMethod.hx new file mode 100644 index 0000000..d0f8fe2 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/http/HttpMethod.hx @@ -0,0 +1,84 @@ +package haxe.http; + +/** + HTTP defines methods (sometimes referred to as _verbs_) to indicate the desired action to be + performed on the identified resource. What this resource represents, whether pre-existing data + or data that is generated dynamically, depends on the implementation of the server. + + Often, the resource corresponds to a file or the output of an executable residing on the server. + The HTTP/1.0 specification defined the `GET`, `POST` and `HEAD` methods and the HTTP/1.1 + specification added 5 new methods: `OPTIONS`, `PUT`, `DELETE`, `TRACE` and `CONNECT`. + + By being specified in these documents their semantics are well known and can be depended upon. + Any client can use any method and the server can be configured to support any combination of methods. + If a method is unknown to an intermediate it will be treated as an unsafe and non-idempotent method. + There is no limit to the number of methods that can be defined and this allows for future methods to + be specified without breaking existing infrastructure. +**/ +enum abstract HttpMethod(String) from String to String { + /** + The `POST` method requests that the server accept the entity enclosed in the request as + a new subordinate of the web resource identified by the URI. + + The data `POST`ed might be, for example, an annotation for existing resources; + a message for a bulletin board, newsgroup, mailing list, or comment thread; + a block of data that is the result of submitting a web form to a data-handling process; + or an item to add to a database. + **/ + var Post = 'POST'; + + /** + The `GET` method requests a representation of the specified resource. + + Requests using `GET` should only retrieve data and should have no other effect. + (This is also true of some other HTTP methods.) The W3C has published guidance + principles on this distinction, saying, _"Web application design should be informed + by the above principles, but also by the relevant limitations."_ + + See safe methods below. + **/ + var Get = 'GET'; + + /** + The `HEAD` method asks for a response identical to that of a `GET` request, + but without the response body. This is useful for retrieving meta-information + written in response headers, without having to transport the entire content. + **/ + var Head = 'HEAD'; + + /** + The `PUT` method requests that the enclosed entity be stored under the supplied URI. + If the URI refers to an already existing resource, it is modified; if the URI does + not point to an existing resource, then the server can create the resource with that URI. + **/ + var Put = 'PUT'; + + /** + The `DELETE` method deletes the specified resource. + **/ + var Delete = 'DELETE'; + + /** + The `TRACE` method echoes the received request so that a client can see + what (if any) changes or additions have been made by intermediate servers. + **/ + var Trace = 'TRACE'; + + /** + The `OPTIONS` method returns the HTTP methods that the server supports for the + specified URL. This can be used to check the functionality of a web server by + requesting `*` instead of a specific resource. + **/ + var Options = 'OPTIONS'; + + /** + The `CONNECT` method converts the request connection to a transparent TCP/IP tunnel, + usually to facilitate SSL-encrypted communication (HTTPS) through an unencrypted HTTP proxy. + **/ + var Connect = 'CONNECT'; + + /** + The `PATCH` method applies partial modifications to a resource. + **/ + var Patch = 'PATCH'; +} diff --git a/build/linux64_569e52e/std/haxe/http/HttpNodeJs.hx b/build/linux64_569e52e/std/haxe/http/HttpNodeJs.hx new file mode 100644 index 0000000..d845d31 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/http/HttpNodeJs.hx @@ -0,0 +1,130 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.http; + +#if nodejs +import js.node.Buffer; +import haxe.io.Bytes; + +class HttpNodeJs extends haxe.http.HttpBase { + public var responseHeaders:Map; + + var req:js.node.http.ClientRequest; + + public function new(url:String) { + super(url); + } + + /** + Cancels `this` Http request if `request` has been called and a response + has not yet been received. + **/ + public function cancel() { + if (req == null) + return; + req.abort(); + req = null; + } + + public override function request(?post:Bool) { + responseAsString = null; + responseBytes = null; + responseHeaders = null; + var parsedUrl = new js.node.url.URL(url); + var secure = (parsedUrl.protocol == "https:"); + var host = parsedUrl.hostname; + var path = parsedUrl.pathname; + var port = if (parsedUrl.port != null) Std.parseInt(parsedUrl.port) else (secure ? 443 : 80); + var h:Dynamic = {}; + for (i in headers) { + var arr = Reflect.field(h, i.name); + if (arr == null) { + arr = new Array(); + Reflect.setField(h, i.name, arr); + } + + arr.push(i.value); + } + if (postData != null || postBytes != null) + post = true; + var uri = null; + for (p in params) { + if (uri == null) + uri = ""; + else + uri += "&"; + uri += StringTools.urlEncode(p.name) + "=" + StringTools.urlEncode(p.value); + } + var question = path.split("?").length <= 1; + if (uri != null) + path += (if (question) "?" else "&") + uri; + + var opts = { + protocol: parsedUrl.protocol, + hostname: host, + port: port, + method: post ? 'POST' : 'GET', + path: path, + headers: h + }; + function httpResponse(res) { + res.setEncoding('binary'); + var s = res.statusCode; + if (s != null) + onStatus(s); + var data = []; + res.on('data', function(chunk:String) { + data.push(Buffer.from(chunk, 'binary')); + }); + res.on('end', function(_) { + var buf = (data.length == 1 ? data[0] : Buffer.concat(data)); + responseBytes = Bytes.ofData(buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength)); + req = null; + + // store response headers + responseHeaders = new haxe.ds.StringMap(); + for (field in Reflect.fields(res.headers)) + { + responseHeaders.set(field, Reflect.field(res.headers, field)); + } + + if (s != null && s >= 200 && s < 400) { + success(responseBytes); + } else { + onError("Http Error #" + s); + } + }); + } + req = secure ? js.node.Https.request(untyped opts, httpResponse) : js.node.Http.request(untyped opts, httpResponse); + if (post) + if (postData != null) { + req.write(postData); + } else if(postBytes != null) { + req.setHeader("Content-Length", '${postBytes.length}'); + req.write(Buffer.from(postBytes.getData())); + } + + req.end(); + } +} +#end diff --git a/build/linux64_569e52e/std/haxe/http/HttpStatus.hx b/build/linux64_569e52e/std/haxe/http/HttpStatus.hx new file mode 100644 index 0000000..6500817 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/http/HttpStatus.hx @@ -0,0 +1,68 @@ +package haxe.http; + +/** + HTTP Request Status +**/ +enum abstract HttpStatus(Int) from Int to Int { + var Continue = 100; + var SwitchingProtocols = 101; + var Processing = 102; + var OK = 200; + var Created = 201; + var Accepted = 202; + var NonAuthoritativeInformation = 203; + var NoContent = 204; + var ResetContent = 205; + var PartialContent = 206; + var MultiStatus = 207; + var AlreadyReported = 208; + var IMUsed = 226; + var MultipleChoices = 300; + var MovedPermanently = 301; + var Found = 302; + var SeeOther = 303; + var NotModified = 304; + var UseProxy = 305; + var SwitchProxy = 306; + var TemporaryRedirect = 307; + var PermanentRedirect = 308; + var BadRequest = 400; + var Unauthorized = 401; + var PaymentRequired = 402; + var Forbidden = 403; + var NotFound = 404; + var MethodNotAllowed = 405; + var NotAcceptable = 406; + var ProxyAuthenticationRequired = 407; + var RequestTimeout = 408; + var Conflict = 409; + var Gone = 410; + var LengthRequired = 411; + var PreconditionFailed = 412; + var PayloadTooLarge = 413; + var URITooLong = 414; + var UnsupportedMediaType = 415; + var RangeNotSatisfiable = 416; + var ExpectationFailed = 417; + var ImATeapot = 418; + var MisdirectedRequest = 421; + var UnprocessableEntity = 422; + var Locked = 423; + var FailedDependency = 424; + var UpgradeRequired = 426; + var PreconditionRequired = 428; + var TooManyRequests = 429; + var RequestHeaderFieldsTooLarge = 431; + var UnavailableForLegalReasons = 451; + var InternalServerError = 500; + var NotImplemented = 501; + var BadGateway = 502; + var ServiceUnavailable = 503; + var GatewayTimeout = 504; + var HTTPVersionNotSupported = 505; + var VariantAlsoNegotiates = 506; + var InsufficientStorage = 507; + var LoopDetected = 508; + var NotExtended = 510; + var NetworkAuthenticationRequired = 511; +} diff --git a/build/linux64_569e52e/std/haxe/hxb/WriterConfig.hx b/build/linux64_569e52e/std/haxe/hxb/WriterConfig.hx new file mode 100644 index 0000000..7796dfd --- /dev/null +++ b/build/linux64_569e52e/std/haxe/hxb/WriterConfig.hx @@ -0,0 +1,51 @@ +package haxe.hxb; + +typedef WriterTargetConfig = { + /** + If `false`, this target is ignored by the writer. + **/ + var ?generate:Null; + + /** + Dot paths of modules or packages to be exluded from the archive. + **/ + var ?exclude:Null>; + + /** + Dot paths of modules or packages to be included in the archive. This takes priority + over exclude. By default, all modules that aren't explicitly excluded are + included. + **/ + var ?include:Null>; + + /** + The hxb version to target. By default, the version of the Haxe compiler itself + is targeted. See https://github.com/HaxeFoundation/haxe/issues/11505 + **/ + var ?hxbVersion:Null; + + /** + If false, no documentation + **/ + var ?generateDocumentation:Null; +} + +typedef WriterConfig = { + /** + The file path for the archive. Occurrences of `$target` are replaced + by the name of the current target (js, hl, etc.). + **/ + var archivePath:String; + + /** + The configuration for the current target context. If it is `null`, all data + for the target context is generated. + **/ + var ?targetConfig:Null; + + /** + The configuration for the macro context. If it is `null`, all data for the + macro context is generated. + **/ + var ?macroConfig:Null; +} diff --git a/build/linux64_569e52e/std/haxe/io/ArrayBufferView.hx b/build/linux64_569e52e/std/haxe/io/ArrayBufferView.hx new file mode 100644 index 0000000..b65a46b --- /dev/null +++ b/build/linux64_569e52e/std/haxe/io/ArrayBufferView.hx @@ -0,0 +1,96 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +typedef ArrayBufferViewData = ArrayBufferViewImpl; + +class ArrayBufferViewImpl { + public var bytes:haxe.io.Bytes; + public var byteOffset:Int; + public var byteLength:Int; + + public function new(bytes, pos, length) { + this.bytes = bytes; + this.byteOffset = pos; + this.byteLength = length; + } + + public function sub(begin:Int, ?length:Int) { + if (length == null) + length = byteLength - begin; + if (begin < 0 || length < 0 || begin + length > byteLength) + throw Error.OutsideBounds; + return new ArrayBufferViewImpl(bytes, byteOffset + begin, length); + } + + public function subarray(?begin:Int, ?end:Int) { + if (begin == null) + begin = 0; + if (end == null) + end = byteLength - begin; + return sub(begin, end - begin); + } +} + +abstract ArrayBufferView(ArrayBufferViewData) { + public var buffer(get, never):haxe.io.Bytes; + public var byteOffset(get, never):Int; + public var byteLength(get, never):Int; + + public inline function new(size:Int) { + this = new ArrayBufferViewData(haxe.io.Bytes.alloc(size), 0, size); + } + + inline function get_byteOffset():Int + return this.byteOffset; + + inline function get_byteLength():Int + return this.byteLength; + + inline function get_buffer():haxe.io.Bytes + return this.bytes; + + public inline function sub(begin:Int, ?length:Int):ArrayBufferView { + return fromData(this.sub(begin, length)); + } + + public inline function subarray(?begin:Int, ?end:Int):ArrayBufferView { + return fromData(this.subarray(begin, end)); + } + + public inline function getData():ArrayBufferViewData { + return this; + } + + public static inline function fromData(a:ArrayBufferViewData):ArrayBufferView { + return cast a; + } + + public static function fromBytes(bytes:haxe.io.Bytes, pos = 0, ?length:Int):ArrayBufferView { + if (length == null) + length = bytes.length - pos; + if (pos < 0 || length < 0 || pos + length > bytes.length) + throw Error.OutsideBounds; + return fromData(new ArrayBufferViewData(bytes, pos, length)); + } +} diff --git a/build/linux64_569e52e/std/haxe/io/BufferInput.hx b/build/linux64_569e52e/std/haxe/io/BufferInput.hx new file mode 100644 index 0000000..a60e08a --- /dev/null +++ b/build/linux64_569e52e/std/haxe/io/BufferInput.hx @@ -0,0 +1,64 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +class BufferInput extends haxe.io.Input { + public var i:haxe.io.Input; + public var buf:haxe.io.Bytes; + public var available:Int; + public var pos:Int; + + public function new(i, buf, ?pos = 0, ?available = 0) { + this.i = i; + this.buf = buf; + this.pos = pos; + this.available = available; + } + + public function refill() { + if (pos > 0) { + buf.blit(0, buf, pos, available); + pos = 0; + } + available += i.readBytes(buf, available, buf.length - available); + } + + override function readByte() { + if (available == 0) + refill(); + var c = buf.get(pos); + pos++; + available--; + return c; + } + + override function readBytes(buf:haxe.io.Bytes, pos:Int, len:Int) { + if (available == 0) + refill(); + var size = if (len > available) available else len; + buf.blit(pos, this.buf, this.pos, size); + this.pos += size; + this.available -= size; + return size; + } +} diff --git a/build/linux64_569e52e/std/haxe/io/Bytes.hx b/build/linux64_569e52e/std/haxe/io/Bytes.hx new file mode 100644 index 0000000..fdfdf42 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/io/Bytes.hx @@ -0,0 +1,677 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +#if cpp +using cpp.NativeArray; +#end + +class Bytes { + public var length(default, null):Int; + + var b:BytesData; + + function new(length, b) { + this.length = length; + this.b = b; + #if flash + b.endian = flash.utils.Endian.LITTLE_ENDIAN; + #end + } + + /** + Returns the byte at index `pos`. + **/ + public inline function get(pos:Int):Int { + #if neko + return untyped $sget(b, pos); + #elseif flash + return b[pos]; + #elseif cpp + return untyped b[pos]; + #elseif java + return untyped b[pos] & 0xFF; + #elseif python + return python.Syntax.arrayAccess(b, pos); + #else + return b[pos]; + #end + } + + /** + Stores the given byte `v` at the given position `pos`. + **/ + public inline function set(pos:Int, v:Int):Void { + #if neko + untyped $sset(b, pos, v); + #elseif flash + b[pos] = v; + #elseif cpp + untyped b[pos] = v; + #elseif java + b[pos] = cast v; + #elseif python + python.Syntax.arraySet(b, pos, v & 0xFF); + #else + b[pos] = v & 0xFF; + #end + } + + /** + Copies `len` bytes from `src` into this instance. + @param pos Zero-based location in `this` instance at which to start writing + bytes. + @param src Source `Bytes` instance from which to copy bytes. + @param srcpos Zero-based location at `src` from which bytes will be copied. + @param len Number of bytes to be copied. + **/ + public function blit(pos:Int, src:Bytes, srcpos:Int, len:Int):Void { + #if !neko + if (pos < 0 || srcpos < 0 || len < 0 || pos + len > length || srcpos + len > src.length) + throw Error.OutsideBounds; + #end + #if neko + try + untyped $sblit(b, pos, src.b, srcpos, len) + catch (e:Dynamic) + throw Error.OutsideBounds; + #elseif flash + b.position = pos; + if (len > 0) + b.writeBytes(src.b, srcpos, len); + #elseif java + java.lang.System.arraycopy(src.b, srcpos, b, pos, len); + #elseif python + python.Syntax.code("self.b[{0}:{0}+{1}] = src.b[srcpos:srcpos+{1}]", pos, len); + #elseif cpp + b.blit(pos, src.b, srcpos, len); + #else + var b1 = b; + var b2 = src.b; + if (b1 == b2 && pos > srcpos) { + var i = len; + while (i > 0) { + i--; + b1[i + pos] = b2[i + srcpos]; + } + return; + } + for (i in 0...len) + b1[i + pos] = b2[i + srcpos]; + #end + } + + /** + Sets `len` consecutive bytes starting from index `pos` of `this` instance + to `value`. + **/ + public function fill(pos:Int, len:Int, value:Int) { + #if flash + var v4 = value & 0xFF; + v4 |= v4 << 8; + v4 |= v4 << 16; + b.position = pos; + for (i in 0...len >> 2) + b.writeUnsignedInt(v4); + pos += len & ~3; + for (i in 0...len & 3) + set(pos++, value); + #elseif cpp + untyped __global__.__hxcpp_memory_memset(b, pos, len, value); + #else + for (i in 0...len) + set(pos++, value); + #end + } + + /** + Returns a new `Bytes` instance that contains a copy of `len` bytes of + `this` instance, starting at index `pos`. + **/ + public function sub(pos:Int, len:Int):Bytes { + #if !neko + if (pos < 0 || len < 0 || pos + len > length) + throw Error.OutsideBounds; + #end + #if neko + return try new Bytes(len, untyped __dollar__ssub(b, pos, len)) catch (e:Dynamic) throw Error.OutsideBounds; + #elseif flash + b.position = pos; + var b2 = new flash.utils.ByteArray(); + b.readBytes(b2, 0, len); + return new Bytes(len, b2); + #elseif java + var newarr = new java.NativeArray(len); + java.lang.System.arraycopy(b, pos, newarr, 0, len); + return new Bytes(len, newarr); + #elseif python + return new Bytes(len, python.Syntax.arrayAccess(b, pos, pos + len)); + #else + return new Bytes(len, b.slice(pos, pos + len)); + #end + } + + /** + Returns `0` if the bytes of `this` instance and the bytes of `other` are + identical. + + Returns a negative value if the `length` of `this` instance is less than + the `length` of `other`, or a positive value if the `length` of `this` + instance is greater than the `length` of `other`. + + In case of equal `length`s, returns a negative value if the first different + value in `other` is greater than the corresponding value in `this` + instance; otherwise returns a positive value. + **/ + public function compare(other:Bytes):Int { + #if neko + return untyped __dollar__compare(b, other.b); + #elseif flash + var len = (length < other.length) ? length : other.length; + var b1 = b; + var b2 = other.b; + b1.position = 0; + b2.position = 0; + b1.endian = flash.utils.Endian.BIG_ENDIAN; + b2.endian = flash.utils.Endian.BIG_ENDIAN; + for (i in 0...len >> 2) + if (b1.readUnsignedInt() != b2.readUnsignedInt()) { + b1.position -= 4; + b2.position -= 4; + var d = b1.readUnsignedInt() - b2.readUnsignedInt(); + b1.endian = flash.utils.Endian.LITTLE_ENDIAN; + b2.endian = flash.utils.Endian.LITTLE_ENDIAN; + return d; + } + for (i in 0...len & 3) + if (b1.readUnsignedByte() != b2.readUnsignedByte()) { + b1.endian = flash.utils.Endian.LITTLE_ENDIAN; + b2.endian = flash.utils.Endian.LITTLE_ENDIAN; + return b1[b1.position - 1] - b2[b2.position - 1]; + } + b1.endian = flash.utils.Endian.LITTLE_ENDIAN; + b2.endian = flash.utils.Endian.LITTLE_ENDIAN; + return length - other.length; + // TODO: memcmp if unsafe flag is on + #elseif cpp + return b.memcmp(other.b); + #else + var b1 = b; + var b2 = other.b; + var len = (length < other.length) ? length : other.length; + for (i in 0...len) + if (b1[i] != b2[i]) + return untyped b1[i] - b2[i]; + return length - other.length; + #end + } + + /** + Returns the IEEE double-precision value at the given position `pos` (in + little-endian encoding). Result is unspecified if `pos` is outside the + bounds. + **/ + #if (neko_v21 || (cpp && !cppia) || flash) + inline + #end + public function getDouble(pos:Int):Float { + #if neko_v21 + return untyped $sgetd(b, pos, false); + #elseif flash + b.position = pos; + return b.readDouble(); + #elseif cpp + if (pos < 0 || pos + 8 > length) + throw Error.OutsideBounds; + return untyped __global__.__hxcpp_memory_get_double(b, pos); + #else + return FPHelper.i64ToDouble(getInt32(pos), getInt32(pos + 4)); + #end + } + + /** + Returns the IEEE single-precision value at the given position `pos` (in + little-endian encoding). Result is unspecified if `pos` is outside the + bounds. + **/ + #if (neko_v21 || (cpp && !cppia) || flash) + inline + #end + public function getFloat(pos:Int):Float { + #if neko_v21 + return untyped $sgetf(b, pos, false); + #elseif flash + b.position = pos; + return b.readFloat(); + #elseif cpp + if (pos < 0 || pos + 4 > length) + throw Error.OutsideBounds; + return untyped __global__.__hxcpp_memory_get_float(b, pos); + #else + return FPHelper.i32ToFloat(getInt32(pos)); + #end + } + + /** + Stores the given IEEE double-precision value `v` at the given position + `pos` in little-endian encoding. Result is unspecified if writing outside + of bounds. + **/ + #if (neko_v21 || flash) + inline + #end + public function setDouble(pos:Int, v:Float):Void { + #if neko_v21 + untyped $ssetd(b, pos, v, false); + #elseif neko + untyped $sblit(b, pos, FPHelper._double_bytes(v, false), 0, 8); + #elseif flash + b.position = pos; + b.writeDouble(v); + #elseif cpp + if (pos < 0 || pos + 8 > length) + throw Error.OutsideBounds; + untyped __global__.__hxcpp_memory_set_double(b, pos, v); + #else + var i = FPHelper.doubleToI64(v); + setInt32(pos, i.low); + setInt32(pos + 4, i.high); + #end + } + + /** + Stores the given IEEE single-precision value `v` at the given position + `pos` in little-endian encoding. Result is unspecified if writing outside + of bounds. + **/ + #if (neko_v21 || flash) + inline + #end + public function setFloat(pos:Int, v:Float):Void { + #if neko_v21 + untyped $ssetf(b, pos, v, false); + #elseif neko + untyped $sblit(b, pos, FPHelper._float_bytes(v, false), 0, 4); + #elseif flash + b.position = pos; + b.writeFloat(v); + #elseif cpp + if (pos < 0 || pos + 4 > length) + throw Error.OutsideBounds; + untyped __global__.__hxcpp_memory_set_float(b, pos, v); + #else + setInt32(pos, FPHelper.floatToI32(v)); + #end + } + + /** + Returns the 16-bit unsigned integer at the given position `pos` (in + little-endian encoding). + **/ + public inline function getUInt16(pos:Int):Int { + #if neko_v21 + return untyped $sget16(b, pos, false); + #else + return get(pos) | (get(pos + 1) << 8); + #end + } + + /** + Stores the given 16-bit unsigned integer `v` at the given position `pos` + (in little-endian encoding). + **/ + public inline function setUInt16(pos:Int, v:Int):Void { + #if neko_v21 + untyped $sset16(b, pos, v, false); + #else + set(pos, v); + set(pos + 1, v >> 8); + #end + } + + /** + Returns the 32-bit integer at the given position `pos` (in little-endian + encoding). + **/ + public inline function getInt32(pos:Int):Int { + #if neko_v21 + return untyped $sget32(b, pos, false); + #elseif python + var v = get(pos) | (get(pos + 1) << 8) | (get(pos + 2) << 16) | (get(pos + 3) << 24); + return if (v & 0x80000000 != 0) v | 0x80000000 else v; + #elseif lua + var v = get(pos) | (get(pos + 1) << 8) | (get(pos + 2) << 16) | (get(pos + 3) << 24); + return lua.Boot.clampInt32(if (v & 0x80000000 != 0) v | 0x80000000 else v); + #else + return get(pos) | (get(pos + 1) << 8) | (get(pos + 2) << 16) | (get(pos + 3) << 24); + #end + } + + /** + Returns the 64-bit integer at the given position `pos` (in little-endian + encoding). + **/ + public inline function getInt64(pos:Int):haxe.Int64 { + return haxe.Int64.make(getInt32(pos + 4), getInt32(pos)); + } + + /** + Stores the given 32-bit integer `v` at the given position `pos` (in + little-endian encoding). + **/ + public inline function setInt32(pos:Int, v:Int):Void { + #if neko_v21 + untyped $sset32(b, pos, v, false); + #else + set(pos, v); + set(pos + 1, v >> 8); + set(pos + 2, v >> 16); + set(pos + 3, v >>> 24); + #end + } + + /** + Stores the given 64-bit integer `v` at the given position `pos` (in + little-endian encoding). + **/ + public inline function setInt64(pos:Int, v:haxe.Int64):Void { + setInt32(pos, v.low); + setInt32(pos + 4, v.high); + } + + /** + Returns the `len`-bytes long string stored at the given position `pos`, + interpreted with the given `encoding` (UTF-8 by default). + **/ + public function getString(pos:Int, len:Int, ?encoding:Encoding):String { + if (encoding == null) + encoding == UTF8; + #if !neko + if (pos < 0 || len < 0 || pos + len > length) + throw Error.OutsideBounds; + #end + #if neko + return try new String(untyped __dollar__ssub(b, pos, len)) catch (e:Dynamic) throw Error.OutsideBounds; + #elseif flash + b.position = pos; + return encoding == RawNative ? b.readMultiByte(len, "unicode") : b.readUTFBytes(len); + #elseif cpp + var result:String = ""; + untyped __global__.__hxcpp_string_of_bytes(b, result, pos, len); + return result; + #elseif java + try { + switch (encoding) { + case UTF8 | null: + return new String(b, pos, len, "UTF-8"); + case RawNative: + return new String(b, pos, len, "UTF-16LE"); + } + } catch (e:Dynamic) { + throw e; + } + #elseif python + return python.Syntax.code("self.b[{0}:{0}+{1}].decode('UTF-8','replace')", pos, len); + #elseif lua + if (b.length - pos <= lua.Boot.MAXSTACKSIZE) { + var end:Int = cast Math.min(b.length, pos + len) - 1; + return lua.NativeStringTools.char(lua.TableTools.unpack(untyped b, pos, end)); + } else { + var tbl:lua.Table = lua.Table.create(); + for (idx in pos...pos + len) { + lua.Table.insert(tbl, lua.NativeStringTools.char(b[idx])); + } + return lua.Table.concat(tbl, ''); + } + #else + var s = ""; + var b = b; + var fcc = String.fromCharCode; + var i = pos; + var max = pos + len; + // utf8-decode and utf16-encode + while (i < max) { + var c = b[i++]; + if (c < 0x80) { + if (c == 0) + break; + s += fcc(c); + } else if (c < 0xE0) + s += fcc(((c & 0x3F) << 6) | (b[i++] & 0x7F)); + else if (c < 0xF0) { + var c2 = b[i++]; + s += fcc(((c & 0x1F) << 12) | ((c2 & 0x7F) << 6) | (b[i++] & 0x7F)); + } else { + var c2 = b[i++]; + var c3 = b[i++]; + var u = ((c & 0x0F) << 18) | ((c2 & 0x7F) << 12) | ((c3 & 0x7F) << 6) | (b[i++] & 0x7F); + // surrogate pair + s += fcc((u >> 10) + 0xD7C0); + s += fcc((u & 0x3FF) | 0xDC00); + } + } + return s; + #end + } + + @:deprecated("readString is deprecated, use getString instead") + @:noCompletion + public inline function readString(pos:Int, len:Int):String { + return getString(pos, len); + } + + /** + Returns a `String` representation of the bytes interpreted as UTF-8. + **/ + public function toString():String { + #if neko + return new String(untyped __dollar__ssub(b, 0, length)); + #elseif flash + b.position = 0; + return b.toString(); + #elseif java + try { + return new String(b, 0, length, "UTF-8"); + } catch (e:Dynamic) + throw e; + #else + return getString(0, length); + #end + } + + /** + Returns a hexadecimal `String` representation of the bytes of `this` + instance. + **/ + public function toHex():String { + var s = new StringBuf(); + var chars = []; + var str = "0123456789abcdef"; + for (i in 0...str.length) + chars.push(str.charCodeAt(i)); + for (i in 0...length) { + var c = get(i); + s.addChar(chars[c >> 4]); + s.addChar(chars[c & 15]); + } + return s.toString(); + } + + /** + Returns the bytes of `this` instance as `BytesData`. + **/ + public inline function getData():BytesData { + return b; + } + + /** + Returns a new `Bytes` instance with the given `length`. The values of the + bytes are not initialized and may not be zero. + **/ + public static function alloc(length:Int):Bytes { + #if neko + return new Bytes(length, untyped __dollar__smake(length)); + #elseif flash + var b = new flash.utils.ByteArray(); + b.length = length; + return new Bytes(length, b); + #elseif cpp + var a = new BytesData(); + if (length > 0) + cpp.NativeArray.setSize(a, length); + return new Bytes(length, a); + #elseif java + return new Bytes(length, new java.NativeArray(length)); + #elseif python + return new Bytes(length, new python.Bytearray(length)); + #else + var a = new Array(); + for (i in 0...length) + a.push(0); + return new Bytes(length, a); + #end + } + + /** + Returns the `Bytes` representation of the given `String`, using the + specified encoding (UTF-8 by default). + **/ + @:pure + public static function ofString(s:String, ?encoding:Encoding):Bytes { + #if neko + return new Bytes(s.length, untyped __dollar__ssub(s.__s, 0, s.length)); + #elseif flash + var b = new flash.utils.ByteArray(); + if (encoding == RawNative) + b.writeMultiByte(s, "unicode") + else + b.writeUTFBytes(s); + return new Bytes(b.length, b); + #elseif cpp + var a = new BytesData(); + untyped __global__.__hxcpp_bytes_of_string(a, s); + return new Bytes(a.length, a); + #elseif java + try { + var b:BytesData = switch (encoding) { + case UTF8 | null: + @:privateAccess s.getBytes("UTF-8"); + case RawNative: + @:privateAccess s.getBytes("UTF-16LE"); + }; + return new Bytes(b.length, b); + } catch (e:Dynamic) { + throw e; + } + #elseif python + var b:BytesData = new python.Bytearray(s, "UTF-8"); + return new Bytes(b.length, b); + #elseif lua + var bytes = [ + for (i in 0...lua.NativeStringTools.len(s)) { + lua.NativeStringTools.byte(s, i + 1); + } + ]; + return new Bytes(bytes.length, bytes); + #else + var a = new Array(); + // utf16-decode and utf8-encode + var i = 0; + while (i < s.length) { + var c:Int = StringTools.fastCodeAt(s, i++); + // surrogate pair + if (0xD800 <= c && c <= 0xDBFF) + c = (c - 0xD7C0 << 10) | (StringTools.fastCodeAt(s, i++) & 0x3FF); + if (c <= 0x7F) + a.push(c); + else if (c <= 0x7FF) { + a.push(0xC0 | (c >> 6)); + a.push(0x80 | (c & 63)); + } else if (c <= 0xFFFF) { + a.push(0xE0 | (c >> 12)); + a.push(0x80 | ((c >> 6) & 63)); + a.push(0x80 | (c & 63)); + } else { + a.push(0xF0 | (c >> 18)); + a.push(0x80 | ((c >> 12) & 63)); + a.push(0x80 | ((c >> 6) & 63)); + a.push(0x80 | (c & 63)); + } + } + return new Bytes(a.length, a); + #end + } + + /** + Returns the `Bytes` representation of the given `BytesData`. + **/ + public static function ofData(b:BytesData) { + #if flash + return new Bytes(b.length, b); + #elseif neko + return new Bytes(untyped __dollar__ssize(b), b); + #else + return new Bytes(b.length, b); + #end + } + + /** + Converts the given hexadecimal `String` to `Bytes`. `s` must be a string of + even length consisting only of hexadecimal digits. For example: + `"0FDA14058916052309"`. + **/ + public static function ofHex(s:String):Bytes { + var len:Int = s.length; + if ((len & 1) != 0) + throw "Not a hex string (odd number of digits)"; + var ret:Bytes = Bytes.alloc(len >> 1); + for (i in 0...ret.length) { + var high = StringTools.fastCodeAt(s, i * 2); + var low = StringTools.fastCodeAt(s, i * 2 + 1); + high = (high & 0xF) + ((high & 0x40) >> 6) * 9; + low = (low & 0xF) + ((low & 0x40) >> 6) * 9; + ret.set(i, ((high << 4) | low) & 0xFF); + } + + return ret; + } + + /** + Reads the `pos`-th byte of the given `b` bytes, in the most efficient way + possible. Behavior when reading outside of the available data is + unspecified. + **/ + public inline static function fastGet(b:BytesData, pos:Int):Int { + #if neko + return untyped __dollar__sget(b, pos); + #elseif flash + return b[pos]; + #elseif cpp + return untyped b.unsafeGet(pos); + #elseif java + return untyped b[pos] & 0xFF; + #else + return b[pos]; + #end + } +} diff --git a/build/linux64_569e52e/std/haxe/io/BytesBuffer.hx b/build/linux64_569e52e/std/haxe/io/BytesBuffer.hx new file mode 100644 index 0000000..7a654e2 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/io/BytesBuffer.hx @@ -0,0 +1,212 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +class BytesBuffer { + #if neko + var b:Dynamic; // neko string buffer + #elseif flash + var b:flash.utils.ByteArray; + #elseif cpp + var b:BytesData; + #elseif java + var b:java.io.ByteArrayOutputStream; + #elseif python + var b:python.Bytearray; + #else + var b:Array; + #end + + /** The length of the buffer in bytes. **/ + public var length(get, never):Int; + + public function new() { + #if neko + b = untyped StringBuf.__make(); + #elseif flash + b = new flash.utils.ByteArray(); + b.endian = flash.utils.Endian.LITTLE_ENDIAN; + #elseif cpp + b = new BytesData(); + #elseif java + b = new java.io.ByteArrayOutputStream(); + #elseif python + b = new python.Bytearray(); + #else + b = new Array(); + #end + } + + inline function get_length():Int { + #if neko + if (@:privateAccess StringBuf.__get_length != null) + return untyped StringBuf.__get_length(b); + return untyped __dollar__ssize(StringBuf.__to_string(b)); + #elseif java + return b.size(); + #else + return b.length; + #end + } + + public inline function addByte(byte:Int) { + #if neko + untyped StringBuf.__add_char(b, byte); + #elseif flash + b.writeByte(byte); + #elseif cpp + b.push(untyped byte); + #elseif java + b.write(byte); + #elseif python + b.append(byte); + #else + b.push(byte); + #end + } + + public inline function add(src:Bytes) { + #if neko + untyped StringBuf.__add(b, src.getData()); + #elseif flash + b.writeBytes(src.getData()); + #elseif java + b.write(src.getData(), 0, src.length); + #elseif js + var b1 = b; + var b2 = @:privateAccess src.b; + for (i in 0...src.length) + b.push(b2[i]); + #elseif python + b.extend(src.getData()); + #else + var b1 = b; + var b2 = src.getData(); + for (i in 0...src.length) + b.push(b2[i]); + #end + } + + public inline function addString(v:String, ?encoding:Encoding) { + #if neko + untyped StringBuf.__add(b, v.__s); + #elseif flash + if (encoding == RawNative) + b.writeMultiByte(v, "unicode") + else + b.writeUTFBytes(v); + #elseif python + b.extend(new python.Bytearray(v, "UTF-8")); + #else + add(Bytes.ofString(v, encoding)); + #end + } + + public #if flash inline #end function addInt32(v:Int) { + #if flash + b.writeUnsignedInt(v); + #else + addByte(v & 0xFF); + addByte((v >> 8) & 0xFF); + addByte((v >> 16) & 0xFF); + addByte(v >>> 24); + #end + } + + public #if flash inline #end function addInt64(v:haxe.Int64) { + addInt32(v.low); + addInt32(v.high); + } + + public inline function addFloat(v:Float) { + #if flash + b.writeFloat(v); + #else + addInt32(FPHelper.floatToI32(v)); + #end + } + + public inline function addDouble(v:Float) { + #if flash + b.writeDouble(v); + #else + addInt64(FPHelper.doubleToI64(v)); + #end + } + + public inline function addBytes(src:Bytes, pos:Int, len:Int) { + #if !neko + if (pos < 0 || len < 0 || pos + len > src.length) + throw Error.OutsideBounds; + #end + #if neko + try + untyped StringBuf.__add_sub(b, src.getData(), pos, len) + catch (e:Dynamic) + throw Error.OutsideBounds; + #elseif flash + if (len > 0) + b.writeBytes(src.getData(), pos, len); + #elseif java + b.write(src.getData(), pos, len); + #elseif js + var b1 = b; + var b2 = @:privateAccess src.b; + for (i in pos...pos + len) + b.push(b2[i]); + #elseif python + b.extend(python.Syntax.code("{0}[{1}:{2}]", src.getData(), pos, pos + len)); + #else + var b1 = b; + var b2 = src.getData(); + for (i in pos...pos + len) + b.push(b2[i]); + #end + } + + /** + Returns either a copy or a reference of the current bytes. + Once called, the buffer should no longer be used. + **/ + public function getBytes():Bytes + untyped { + #if neko + var str = StringBuf.__to_string(b); + var bytes = new Bytes(__dollar__ssize(str), str); + #elseif flash + var bytes = new Bytes(b.length, b); + b.position = 0; + #elseif java + var buf = b.toByteArray(); + var bytes = new Bytes(buf.length, buf); + #elseif python + var bytes = new Bytes(b.length, b); + #elseif js + var bytes = new Bytes(new js.lib.Uint8Array(b).buffer); + #else + var bytes = new Bytes(b.length, b); + #end + b = null; + return bytes; + } +} diff --git a/build/linux64_569e52e/std/haxe/io/BytesData.hx b/build/linux64_569e52e/std/haxe/io/BytesData.hx new file mode 100644 index 0000000..49de7e2 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/io/BytesData.hx @@ -0,0 +1,68 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +#if neko +typedef BytesData = neko.NativeString; +#elseif flash +typedef BytesData = flash.utils.ByteArray; +#elseif cpp +typedef BytesData = Array; +#elseif java +typedef BytesData = java.NativeArray; +#elseif python +typedef BytesData = python.Bytearray; +#elseif js +typedef BytesData = js.lib.ArrayBuffer; +#elseif hl +class BytesDataImpl { + public var bytes:hl.Bytes; + public var length:Int; + + public function new(b, length) { + this.bytes = b; + this.length = length; + } +} + +@:forward(bytes, length) +abstract BytesDataAbstract(BytesDataImpl) { + public inline function new(b, length) { + this = new BytesDataImpl(b, length); + } + + @:arrayAccess inline function get(i:Int) + return this.bytes[i]; + + @:arrayAccess inline function set(i:Int, v:Int) + return this.bytes[i] = v; + + @:to inline function toBytes():hl.Bytes { + return this == null ? null : this.bytes; + } +} + +typedef BytesData = BytesDataAbstract; +#else +typedef BytesData = Array; +#end diff --git a/build/linux64_569e52e/std/haxe/io/BytesInput.hx b/build/linux64_569e52e/std/haxe/io/BytesInput.hx new file mode 100644 index 0000000..b8d24fb --- /dev/null +++ b/build/linux64_569e52e/std/haxe/io/BytesInput.hx @@ -0,0 +1,208 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +class BytesInput extends Input { + var b:#if js js.lib.Uint8Array #elseif hl hl.Bytes #else BytesData #end; + #if !flash + var pos:Int; + var len:Int; + var totlen:Int; + #end + + /** The current position in the stream in bytes. */ + public var position(get, set):Int; + + /** The length of the stream in bytes. */ + public var length(get, never):Int; + + public function new(b:Bytes, ?pos:Int, ?len:Int) { + if (pos == null) + pos = 0; + if (len == null) + len = b.length - pos; + if (pos < 0 || len < 0 || pos + len > b.length) + throw Error.OutsideBounds; + #if flash + var ba = b.getData(); + ba.position = pos; + if (len != ba.bytesAvailable) { + // truncate + this.b = new flash.utils.ByteArray(); + ba.readBytes(this.b, 0, len); + } else + this.b = ba; + this.b.endian = flash.utils.Endian.LITTLE_ENDIAN; + #else + this.b = #if (js || hl) @:privateAccess b.b #else b.getData() #end; + this.pos = pos; + this.len = len; + this.totlen = len; + #end + #if python + bigEndian = false; + #end + } + + inline function get_position():Int { + #if flash + return b.position; + #else + return pos; + #end + } + + inline function get_length():Int { + #if flash + return b.length; + #else + return totlen; + #end + } + + function set_position(p:Int):Int { + if (p < 0) + p = 0; + else if (p > length) + p = length; + #if flash + return b.position = p; + #else + len = totlen - p; + return pos = p; + #end + } + + public override function readByte():Int { + #if flash + return try b.readUnsignedByte() catch (e:Dynamic) throw new Eof(); + #else + if (this.len == 0) + throw new Eof(); + len--; + #if neko + return untyped __dollar__sget(b, pos++); + #elseif cpp + return untyped b[pos++]; + #elseif java + return untyped b[pos++] & 0xFF; + #elseif python // dodge https://github.com/HaxeFoundation/haxe/issues/5080 + var b = b[pos]; + pos++; + return b; + #else + return b[pos++]; + #end + #end + } + + public override function readBytes(buf:Bytes, pos:Int, len:Int):Int { + #if !neko + if (pos < 0 || len < 0 || pos + len > buf.length) + throw Error.OutsideBounds; + #end + #if flash + var avail:Int = b.bytesAvailable; + if (len > avail && avail > 0) + len = avail; + try + b.readBytes(buf.getData(), pos, len) + catch (e:Dynamic) + throw new Eof(); + #elseif java + var avail:Int = this.len; + if (len > avail) + len = avail; + if (len == 0) + throw new Eof(); + java.lang.System.arraycopy(this.b, this.pos, buf.getData(), pos, len); + this.pos += len; + this.len -= len; + #else + if (this.len == 0 && len > 0) + throw new Eof(); + if (this.len < len) + len = this.len; + #if neko + try + untyped __dollar__sblit(buf.getData(), pos, b, this.pos, len) + catch (e:Dynamic) + throw Error.OutsideBounds; + #elseif hl + @:privateAccess buf.b.blit(pos, b, this.pos, len); + #else + var b1 = b; + var b2 = #if js @:privateAccess buf.b #else buf.getData() #end; + for (i in 0...len) + b2[pos + i] = b1[this.pos + i]; + #end + this.pos += len; + this.len -= len; + #end + return len; + } + + #if flash + @:dox(hide) + override function set_bigEndian(e) { + bigEndian = e; + b.endian = e ? flash.utils.Endian.BIG_ENDIAN : flash.utils.Endian.LITTLE_ENDIAN; + return e; + } + + @:dox(hide) + override function readFloat() { + return try b.readFloat() catch (e:Dynamic) throw new Eof(); + } + + @:dox(hide) + override function readDouble() { + return try b.readDouble() catch (e:Dynamic) throw new Eof(); + } + + @:dox(hide) + override function readInt8() { + return try b.readByte() catch (e:Dynamic) throw new Eof(); + } + + @:dox(hide) + override function readInt16() { + return try b.readShort() catch (e:Dynamic) throw new Eof(); + } + + @:dox(hide) + override function readUInt16():Int { + return try b.readUnsignedShort() catch (e:Dynamic) throw new Eof(); + } + + @:dox(hide) + override function readInt32():Int { + return try b.readInt() catch (e:Dynamic) throw new Eof(); + } + + @:dox(hide) + override function readString(len:Int, ?encoding:Encoding) { + return try encoding == RawNative ? b.readMultiByte(len, "unicode") : b.readUTFBytes(len) catch (e:Dynamic) throw new Eof(); + } + #end +} diff --git a/build/linux64_569e52e/std/haxe/io/BytesOutput.hx b/build/linux64_569e52e/std/haxe/io/BytesOutput.hx new file mode 100644 index 0000000..f639161 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/io/BytesOutput.hx @@ -0,0 +1,146 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +class BytesOutput extends Output { + #if flash + var b:flash.utils.ByteArray; + #else + var b:BytesBuffer; + #end + + /** The length of the stream in bytes. **/ + public var length(get, never):Int; + + public function new() { + #if flash + b = new flash.utils.ByteArray(); + b.endian = flash.utils.Endian.LITTLE_ENDIAN; + #else + b = new BytesBuffer(); + #end + #if python + bigEndian = false; + #end + } + + inline function get_length():Int { + return b.length; + } + + override function writeByte(c) { + #if flash + b.writeByte(c); + #else + b.addByte(c); + #end + } + + override function writeBytes(buf:Bytes, pos, len):Int { + #if flash + if (pos < 0 || len < 0 || pos + len > buf.length) + throw Error.OutsideBounds; + b.writeBytes(buf.getData(), pos, len); + #else + b.addBytes(buf, pos, len); + #end + return len; + } + + #if flash + // optimized operations + + @:dox(hide) + override function set_bigEndian(e) { + bigEndian = e; + b.endian = e ? flash.utils.Endian.BIG_ENDIAN : flash.utils.Endian.LITTLE_ENDIAN; + return e; + } + + @:dox(hide) + override function writeFloat(f:Float) { + b.writeFloat(f); + } + + @:dox(hide) + override function writeDouble(f:Float) { + b.writeDouble(f); + } + + @:dox(hide) + override function writeInt8(x:Int) { + if (x < -0x80 || x >= 0x80) + throw Error.Overflow; + b.writeByte(x); + } + + @:dox(hide) + override function writeInt16(x:Int) { + if (x < -0x8000 || x >= 0x8000) + throw Error.Overflow; + b.writeShort(x); + } + + @:dox(hide) + override function writeUInt16(x:Int) { + if (x < 0 || x >= 0x10000) + throw Error.Overflow; + b.writeShort(x); + } + + @:dox(hide) + override function writeInt32(x:Int) { + b.writeInt(x); + } + + @:dox(hide) + override function prepare(size:Int) { + if (size > 0) + b[size - 1] = b[size - 1]; + } + + @:dox(hide) + override function writeString(s:String, ?encoding:Encoding) { + if (encoding == RawNative) + b.writeMultiByte(s, "unicode"); + else + b.writeUTFBytes(s); + } + #end + + /** + Returns the `Bytes` of this output. + + This function should not be called more than once on a given + `BytesOutput` instance. + **/ + public function getBytes():Bytes { + #if flash + var bytes = b; + b = null; + return untyped new Bytes(bytes.length, bytes); + #else + return b.getBytes(); + #end + } +} diff --git a/build/linux64_569e52e/std/haxe/io/Encoding.hx b/build/linux64_569e52e/std/haxe/io/Encoding.hx new file mode 100644 index 0000000..d51cdd6 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/io/Encoding.hx @@ -0,0 +1,35 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +/** + String binary encoding supported by Haxe I/O +**/ +enum Encoding { + UTF8; + + /** + Output the string the way the platform represent it in memory. This is the most efficient but is platform-specific + **/ + RawNative; +} diff --git a/build/linux64_569e52e/std/haxe/io/Eof.hx b/build/linux64_569e52e/std/haxe/io/Eof.hx new file mode 100644 index 0000000..75dea40 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/io/Eof.hx @@ -0,0 +1,35 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +/** + This exception is raised when reading while data is no longer available in the `haxe.io.Input`. +**/ +class Eof { + public function new() {} + + @:ifFeature("haxe.io.Eof.*") + function toString() { + return "Eof"; + } +} diff --git a/build/linux64_569e52e/std/haxe/io/Error.hx b/build/linux64_569e52e/std/haxe/io/Error.hx new file mode 100644 index 0000000..beb0099 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/io/Error.hx @@ -0,0 +1,43 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +/** + The possible IO errors that can occur +**/ +#if eval +@:keep +#end +enum Error { + /** The IO is set into nonblocking mode and some data cannot be read or written **/ + Blocked; + + /** An integer value is outside its allowed range **/ + Overflow; + + /** An operation on Bytes is outside of its valid range **/ + OutsideBounds; + + /** Other errors **/ + Custom(e:Dynamic); +} diff --git a/build/linux64_569e52e/std/haxe/io/FPHelper.hx b/build/linux64_569e52e/std/haxe/io/FPHelper.hx new file mode 100644 index 0000000..88d47e9 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/io/FPHelper.hx @@ -0,0 +1,294 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +/** + Helper that converts between floating point and binary representation. + Always works in low-endian encoding. +**/ +class FPHelper { + #if neko_v21 + // stored in helper + #elseif neko + static var i64tmp = new sys.thread.Tls(); + #elseif !(java || cpp) + static var i64tmp = Int64.ofInt(0); + + static inline var LN2 = 0.6931471805599453; // Math.log(2) + + static inline function _i32ToFloat(i:Int):Float { + var sign = 1 - ((i >>> 31) << 1); + var e = (i >> 23) & 0xff; + if (e == 255) + return i & 0x7fffff == 0 ? (sign > 0 ? Math.POSITIVE_INFINITY : Math.NEGATIVE_INFINITY) : Math.NaN; + var m = e == 0 ? (i & 0x7fffff) << 1 : (i & 0x7fffff) | 0x800000; + return sign * m * Math.pow(2, e - 150); + } + + static inline function _i64ToDouble(lo:Int, hi:Int):Float { + var sign = 1 - ((hi >>> 31) << 1); + var e = (hi >> 20) & 0x7ff; + if (e == 2047) + return lo == 0 && (hi & 0xFFFFF) == 0 ? (sign > 0 ? Math.POSITIVE_INFINITY : Math.NEGATIVE_INFINITY) : Math.NaN; + var m = 2.220446049250313e-16 * ((hi & 0xFFFFF) * 4294967296. + (lo >>> 31) * 2147483648. + (lo & 0x7FFFFFFF)); + m = e == 0 ? m * 2.0 : m + 1.0; + return sign * m * Math.pow(2, e - 1023); + } + + static inline function _floatToI32(f:Float):Int { + if (f == 0) + return 0; + var af = f < 0 ? -f : f; + var exp = Math.floor(Math.log(af) / LN2); + if (exp > 127) { + return 0x7F800000; + } else { + if (exp <= -127) { + exp = -127; + af *= 7.1362384635298e+44; // af * 0.5 * 0x800000 / Math.pow(2, -127) + } else { + af = (af / Math.pow(2, exp) - 1.0) * 0x800000; + } + return (f < 0 ? 0x80000000 : 0) | ((exp + 127) << 23) | Math.round(af); + } + } + + static inline function _doubleToI64(v:Float):Int64@:privateAccess { + var i64 = i64tmp; + if (v == 0) { + i64.set_low(0); + i64.set_high(0); + } else if (!Math.isFinite(v)) { + i64.set_low(0); + i64.set_high(v > 0 ? 0x7FF00000 : 0xFFF00000); + } else { + var av = v < 0 ? -v : v; + var exp = Math.floor(Math.log(av) / LN2); + if (exp > 1023) { + i64.set_low(0xFFFFFFFF); + i64.set_high(0x7FEFFFFF); + } else { + if (exp <= -1023) { + exp = -1023; + av = av / 2.2250738585072014e-308; + } else { + av = av / Math.pow(2, exp) - 1.0; + } + var sig = Math.fround(av * 4503599627370496.); // 2^52 + // Note: If "sig" is outside of the signed Int32 range, the result is unspecified in HL, Java and Neko. + var sig_l = Std.int(sig); + var sig_h = Std.int(sig / 4294967296.0); + i64.set_low(sig_l); + i64.set_high((v < 0 ? 0x80000000 : 0) | ((exp + 1023) << 20) | sig_h); + } + } + return i64; + } + #end + + #if neko + #if neko_v21 + static var helpers = new sys.thread.Tls>(); + #else + static var helperf = new sys.thread.Tls(); + static var helperd = new sys.thread.Tls(); + static var _float_of_bytes = neko.Lib.load("std", "float_of_bytes", 2); + static var _double_of_bytes = neko.Lib.load("std", "double_of_bytes", 2); + static var _float_bytes = neko.Lib.load("std", "float_bytes", 2); + static var _double_bytes = neko.Lib.load("std", "double_bytes", 2); + #end + #elseif flash + static var helper = { + var b = new flash.utils.ByteArray(); + b.endian = flash.utils.Endian.LITTLE_ENDIAN; + b; + } + #elseif js + static var helper = new js.lib.DataView(new js.lib.ArrayBuffer(8)); + #end + + #if neko_v21 + inline + #end + public static function i32ToFloat(i:Int):Float { + #if neko + #if neko_v21 + return untyped $itof(i, false); + #else + var helper = helperf.value; + if (helper == null) + helperf.value = helper = neko.NativeString.alloc(4); + untyped $sset(helper, 0, i & 0xFF); + untyped $sset(helper, 1, (i >> 8) & 0xFF); + untyped $sset(helper, 2, (i >> 16) & 0xFF); + untyped $sset(helper, 3, i >>> 24); + return _float_of_bytes(helper, false); + #end + #elseif cpp + return untyped __global__.__hxcpp_reinterpret_le_int32_as_float32(i); + #elseif java + return java.lang.Float.FloatClass.intBitsToFloat(i); + #elseif flash + var helper = helper; + helper.position = 0; + helper.writeUnsignedInt(i); + helper.position = 0; + return helper.readFloat(); + #elseif js + helper.setInt32(0, i, true); + return helper.getFloat32(0, true); + #else + return _i32ToFloat(i); + #end + } + + #if neko_v21 + inline + #end + public static function floatToI32(f:Float):Int { + #if neko + #if neko_v21 + return untyped $ftoi(f, false); + #else + var r = _float_bytes(f, false); + return untyped $sget(r, 0) | ($sget(r, 1) << 8) | ($sget(r, 2) << 16) | ($sget(r, 3) << 24); + #end + #elseif cpp + return untyped __global__.__hxcpp_reinterpret_float32_as_le_int32(f); + #elseif java + return java.lang.Float.FloatClass.floatToRawIntBits(f); + #elseif flash + var helper = helper; + helper.position = 0; + helper.writeFloat(f); + helper.position = 0; + return helper.readUnsignedInt(); + #elseif js + helper.setFloat32(0, f, true); + return helper.getInt32(0, true); + #else + return _floatToI32(f); + #end + } + + #if neko_v21 + inline + #end + public static function i64ToDouble(low:Int, high:Int):Float { + #if neko + #if neko_v21 + return untyped $itod(low, high, false); + #else + var helper = helperd.value; + if (helper == null) + helperd.value = helper = neko.NativeString.alloc(8); + untyped $sset(helper, 0, low & 0xFF); + untyped $sset(helper, 1, (low >> 8) & 0xFF); + untyped $sset(helper, 2, (low >> 16) & 0xFF); + untyped $sset(helper, 3, low >>> 24); + untyped $sset(helper, 4, high & 0xFF); + untyped $sset(helper, 5, (high >> 8) & 0xFF); + untyped $sset(helper, 6, (high >> 16) & 0xFF); + untyped $sset(helper, 7, high >>> 24); + return _double_of_bytes(helper, false); + #end + #elseif cpp + return untyped __global__.__hxcpp_reinterpret_le_int32s_as_float64(low, high); + #elseif java + return java.lang.Double.DoubleClass.longBitsToDouble(Int64.make(high, low)); + #elseif flash + var helper = helper; + helper.position = 0; + helper.writeUnsignedInt(low); + helper.writeUnsignedInt(high); + helper.position = 0; + return helper.readDouble(); + #elseif js + helper.setInt32(0, low, true); + helper.setInt32(4, high, true); + return helper.getFloat64(0, true); + #else + return _i64ToDouble(low, high); + #end + } + + /** + Returns an Int64 representing the bytes representation of the double precision IEEE float value. + WARNING : for performance reason, the same Int64 value might be reused every time. Copy its low/high values before calling again. + We still ensure that this is safe to use in a multithread environment + **/ + public static function doubleToI64(v:Float):Int64 { + #if neko + #if neko_v21 + var helper = helpers.value; + if (helper == null) { + helpers.value = helper = neko.NativeArray.alloc(2); + helper[0] = neko.NativeArray.alloc(2); + helper[1] = haxe.Int64.ofInt(0); + } + var i64:haxe.Int64 = helper[1], int2 = helper[0]; + untyped $dtoi(v, int2, false); + @:privateAccess { + i64.set_low(int2[0]); + i64.set_high(int2[1]); + } + return i64; + #else + var r = _double_bytes(v, false), i64 = i64tmp.value; + if (i64 == null) + i64 = i64tmp.value = haxe.Int64.ofInt(0); + @:privateAccess { + i64.set_low(untyped $sget(r, 0) | ($sget(r, 1) << 8) | ($sget(r, 2) << 16) | ($sget(r, 3) << 24)); + i64.set_high(untyped $sget(r, 4) | ($sget(r, 5) << 8) | ($sget(r, 6) << 16) | ($sget(r, 7) << 24)); + } + return i64; + #end + #elseif cpp + return Int64.make(untyped __global__.__hxcpp_reinterpret_float64_as_le_int32_high(v), + untyped __global__.__hxcpp_reinterpret_float64_as_le_int32_low(v)); + #elseif java + return java.lang.Double.DoubleClass.doubleToRawLongBits(v); + #elseif flash + var helper = helper; + helper.position = 0; + helper.writeDouble(v); + helper.position = 0; + var i64 = i64tmp; + @:privateAccess { + i64.set_low(cast helper.readUnsignedInt()); + i64.set_high(cast helper.readUnsignedInt()); + } + return i64; + #elseif js + var i64 = i64tmp; + helper.setFloat64(0, v, true); + @:privateAccess { + i64.set_low(helper.getInt32(0, true)); + i64.set_high(helper.getInt32(4, true)); + } + return i64; + #else + return _doubleToI64(v); + #end + } +} diff --git a/build/linux64_569e52e/std/haxe/io/Float32Array.hx b/build/linux64_569e52e/std/haxe/io/Float32Array.hx new file mode 100644 index 0000000..e7e086f --- /dev/null +++ b/build/linux64_569e52e/std/haxe/io/Float32Array.hx @@ -0,0 +1,87 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +typedef Float32ArrayData = ArrayBufferView.ArrayBufferViewData; + +abstract Float32Array(Float32ArrayData) { + public static inline var BYTES_PER_ELEMENT = 4; + + public var length(get, never):Int; + public var view(get, never):ArrayBufferView; + + public inline function new(elements:Int) { + this = new ArrayBufferView(elements * BYTES_PER_ELEMENT).getData(); + } + + inline function get_length() { + return this.byteLength >> 2; + } + + public inline function get_view():ArrayBufferView { + return ArrayBufferView.fromData(this); + } + + @:arrayAccess public inline function get(index:Int):Float { + return this.bytes.getFloat((index << 2) + this.byteOffset); + } + + @:arrayAccess public inline function set(index:Int, value:Float):Float { + if (index >= 0 && index < length) { + this.bytes.setFloat((index << 2) + this.byteOffset, value); + return value; + } + return 0; + } + + public inline function sub(begin:Int, ?length:Int):Float32Array { + return fromData(this.sub(begin << 2, length == null ? null : length << 2)); + } + + public inline function subarray(?begin:Int, ?end:Int):Float32Array { + return fromData(this.subarray(begin == null ? null : begin << 2, end == null ? null : end << 2)); + } + + public inline function getData():Float32ArrayData { + return this; + } + + public static function fromData(d:Float32ArrayData):Float32Array { + return cast d; + } + + public static function fromArray(a:Array, pos = 0, ?length:Int):Float32Array { + if (length == null) + length = a.length - pos; + if (pos < 0 || length < 0 || pos + length > a.length) + throw Error.OutsideBounds; + var i = new Float32Array(a.length); + for (idx in 0...length) + i[idx] = a[idx + pos]; + return i; + } + + public static function fromBytes(bytes:haxe.io.Bytes, bytePos = 0, ?length:Int):Float32Array { + return fromData(ArrayBufferView.fromBytes(bytes, bytePos, (length == null ? (bytes.length - bytePos) >> 2 : length) << 2).getData()); + } +} diff --git a/build/linux64_569e52e/std/haxe/io/Float64Array.hx b/build/linux64_569e52e/std/haxe/io/Float64Array.hx new file mode 100644 index 0000000..7ac9bba --- /dev/null +++ b/build/linux64_569e52e/std/haxe/io/Float64Array.hx @@ -0,0 +1,87 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +typedef Float64ArrayData = ArrayBufferView.ArrayBufferViewData; + +abstract Float64Array(Float64ArrayData) { + public static inline var BYTES_PER_ELEMENT = 8; + + public var length(get, never):Int; + public var view(get, never):ArrayBufferView; + + public inline function new(elements:Int) { + this = new ArrayBufferView(elements * BYTES_PER_ELEMENT).getData(); + } + + inline function get_length() { + return this.byteLength >> 3; + } + + public inline function get_view():ArrayBufferView { + return ArrayBufferView.fromData(this); + } + + @:arrayAccess public inline function get(index:Int):Float { + return this.bytes.getDouble((index << 3) + this.byteOffset); + } + + @:arrayAccess public inline function set(index:Int, value:Float):Float { + if (index >= 0 && index < length) { + this.bytes.setDouble((index << 3) + this.byteOffset, value); + return value; + } + return 0; + } + + public inline function sub(begin:Int, ?length:Int):Float64Array { + return fromData(this.sub(begin << 3, length == null ? null : length << 3)); + } + + public inline function subarray(?begin:Int, ?end:Int):Float64Array { + return fromData(this.subarray(begin == null ? null : begin << 3, end == null ? null : end << 3)); + } + + public inline function getData():Float64ArrayData { + return this; + } + + public static function fromData(d:Float64ArrayData):Float64Array { + return cast d; + } + + public static function fromArray(a:Array, pos = 0, ?length:Int):Float64Array { + if (length == null) + length = a.length - pos; + if (pos < 0 || length < 0 || pos + length > a.length) + throw Error.OutsideBounds; + var i = new Float64Array(a.length); + for (idx in 0...length) + i[idx] = a[idx + pos]; + return i; + } + + public static function fromBytes(bytes:haxe.io.Bytes, bytePos = 0, ?length:Int):Float64Array { + return fromData(ArrayBufferView.fromBytes(bytes, bytePos, (length == null ? (bytes.length - bytePos) >> 3 : length) << 3).getData()); + } +} diff --git a/build/linux64_569e52e/std/haxe/io/Input.hx b/build/linux64_569e52e/std/haxe/io/Input.hx new file mode 100644 index 0000000..ee90aa2 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/io/Input.hx @@ -0,0 +1,329 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +/** + An Input is an abstract reader. See other classes in the `haxe.io` package + for several possible implementations. + + All functions which read data throw `Eof` when the end of the stream + is reached. +**/ +class Input { + /** + Endianness (word byte order) used when reading numbers. + + If `true`, big-endian is used, otherwise `little-endian` is used. + **/ + public var bigEndian(default, set):Bool; + + #if java + private var helper:java.nio.ByteBuffer; + #end + + /** + Read and return one byte. + **/ + public function readByte():Int { + #if cpp + throw new haxe.exceptions.NotImplementedException(); + #else + return throw new haxe.exceptions.NotImplementedException(); + #end + } + + /** + Read `len` bytes and write them into `s` to the position specified by `pos`. + + Returns the actual length of read data that can be smaller than `len`. + + See `readFullBytes` that tries to read the exact amount of specified bytes. + **/ + public function readBytes(s:Bytes, pos:Int, len:Int):Int { + var k = len; + var b = #if (js || hl) @:privateAccess s.b #else s.getData() #end; + if (pos < 0 || len < 0 || pos + len > s.length) + throw Error.OutsideBounds; + try { + while (k > 0) { + #if neko + untyped __dollar__sset(b, pos, readByte()); + #elseif php + b.set(pos, readByte()); + #elseif cpp + b[pos] = untyped readByte(); + #else + b[pos] = cast readByte(); + #end + pos++; + k--; + } + } catch (eof:haxe.io.Eof) {} + return len - k; + } + + /** + Close the input source. + + Behaviour while reading after calling this method is unspecified. + **/ + public function close():Void {} + + function set_bigEndian(b:Bool):Bool { + bigEndian = b; + return b; + } + + /* ------------------ API ------------------ */ + /** + Read and return all available data. + + The `bufsize` optional argument specifies the size of chunks by + which data is read. Its default value is target-specific. + **/ + public function readAll(?bufsize:Int):Bytes { + if (bufsize == null) + #if php + bufsize = 8192; // default value for PHP and max under certain circumstances + #else + bufsize = (1 << 14); // 16 Ko + #end + + var buf = Bytes.alloc(bufsize); + var total = new haxe.io.BytesBuffer(); + try { + while (true) { + var len = readBytes(buf, 0, bufsize); + if (len == 0) + throw Error.Blocked; + total.addBytes(buf, 0, len); + } + } catch (e:Eof) {} + return total.getBytes(); + } + + /** + Read `len` bytes and write them into `s` to the position specified by `pos`. + + Unlike `readBytes`, this method tries to read the exact `len` amount of bytes. + **/ + public function readFullBytes(s:Bytes, pos:Int, len:Int):Void { + while (len > 0) { + var k = readBytes(s, pos, len); + if (k == 0) + throw Error.Blocked; + pos += k; + len -= k; + } + } + + /** + Read and return `nbytes` bytes. + **/ + public function read(nbytes:Int):Bytes { + var s = Bytes.alloc(nbytes); + var p = 0; + while (nbytes > 0) { + var k = readBytes(s, p, nbytes); + if (k == 0) + throw Error.Blocked; + p += k; + nbytes -= k; + } + return s; + } + + /** + Read a string until a character code specified by `end` is occurred. + + The final character is not included in the resulting string. + **/ + public function readUntil(end:Int):String { + var buf = new BytesBuffer(); + var last:Int; + while ((last = readByte()) != end) + buf.addByte(last); + return buf.getBytes().toString(); + } + + /** + Read a line of text separated by CR and/or LF bytes. + + The CR/LF characters are not included in the resulting string. + **/ + public function readLine():String { + var buf = new BytesBuffer(); + var last:Int; + var s; + try { + while ((last = readByte()) != 10) + buf.addByte(last); + s = buf.getBytes().toString(); + if (s.charCodeAt(s.length - 1) == 13) + s = s.substr(0, -1); + } catch (e:Eof) { + s = buf.getBytes().toString(); + if (s.length == 0) + #if neko neko.Lib.rethrow #else throw #end (e); + } + return s; + } + + /** + Read a 32-bit floating point number. + + Endianness is specified by the `bigEndian` property. + **/ + public function readFloat():Float { + return FPHelper.i32ToFloat(readInt32()); + } + + /** + Read a 64-bit double-precision floating point number. + + Endianness is specified by the `bigEndian` property. + **/ + public function readDouble():Float { + var i1 = readInt32(); + var i2 = readInt32(); + return bigEndian ? FPHelper.i64ToDouble(i2, i1) : FPHelper.i64ToDouble(i1, i2); + } + + /** + Read a 8-bit signed integer. + **/ + public function readInt8():Int { + var n = readByte(); + if (n >= 128) + return n - 256; + return n; + } + + /** + Read a 16-bit signed integer. + + Endianness is specified by the `bigEndian` property. + **/ + public function readInt16():Int { + var ch1 = readByte(); + var ch2 = readByte(); + var n = bigEndian ? ch2 | (ch1 << 8) : ch1 | (ch2 << 8); + if (n & 0x8000 != 0) + return n - 0x10000; + return n; + } + + /** + Read a 16-bit unsigned integer. + + Endianness is specified by the `bigEndian` property. + **/ + public function readUInt16():Int { + var ch1 = readByte(); + var ch2 = readByte(); + return bigEndian ? ch2 | (ch1 << 8) : ch1 | (ch2 << 8); + } + + /** + Read a 24-bit signed integer. + + Endianness is specified by the `bigEndian` property. + **/ + public function readInt24():Int { + var ch1 = readByte(); + var ch2 = readByte(); + var ch3 = readByte(); + var n = bigEndian ? ch3 | (ch2 << 8) | (ch1 << 16) : ch1 | (ch2 << 8) | (ch3 << 16); + if (n & 0x800000 != 0) + return n - 0x1000000; + return n; + } + + /** + Read a 24-bit unsigned integer. + + Endianness is specified by the `bigEndian` property. + **/ + public function readUInt24():Int { + var ch1 = readByte(); + var ch2 = readByte(); + var ch3 = readByte(); + return bigEndian ? ch3 | (ch2 << 8) | (ch1 << 16) : ch1 | (ch2 << 8) | (ch3 << 16); + } + + /** + Read a 32-bit signed integer. + + Endianness is specified by the `bigEndian` property. + **/ + public function readInt32():Int { + var ch1 = readByte(); + var ch2 = readByte(); + var ch3 = readByte(); + var ch4 = readByte(); + #if (php || python) + // php will overflow integers. Convert them back to signed 32-bit ints. + var n = bigEndian ? ch4 | (ch3 << 8) | (ch2 << 16) | (ch1 << 24) : ch1 | (ch2 << 8) | (ch3 << 16) | (ch4 << 24); + if (n & 0x80000000 != 0) + return (n | 0x80000000); + else + return n; + #elseif lua + var n = bigEndian ? ch4 | (ch3 << 8) | (ch2 << 16) | (ch1 << 24) : ch1 | (ch2 << 8) | (ch3 << 16) | (ch4 << 24); + return lua.Boot.clampInt32(n); + #else + return bigEndian ? ch4 | (ch3 << 8) | (ch2 << 16) | (ch1 << 24) : ch1 | (ch2 << 8) | (ch3 << 16) | (ch4 << 24); + #end + } + + /** + Read and `len` bytes as a string. + **/ + public function readString(len:Int, ?encoding:Encoding):String { + var b = Bytes.alloc(len); + readFullBytes(b, 0, len); + #if neko + return neko.Lib.stringReference(b); + #else + return b.getString(0, len, encoding); + #end + } + + #if neko + static var _float_of_bytes = neko.Lib.load("std", "float_of_bytes", 2); + static var _double_of_bytes = neko.Lib.load("std", "double_of_bytes", 2); + + static function __init__() + untyped { + Input.prototype.bigEndian = false; + } + #end + + #if (flash || js || python) + function getDoubleSig(bytes:Array) { + return (((bytes[1] & 0xF) << 16) | (bytes[2] << 8) | bytes[3]) * 4294967296. + + (bytes[4] >> 7) * 2147483648 + + (((bytes[4] & 0x7F) << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7]); + } + #end +} diff --git a/build/linux64_569e52e/std/haxe/io/Int32Array.hx b/build/linux64_569e52e/std/haxe/io/Int32Array.hx new file mode 100644 index 0000000..2654324 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/io/Int32Array.hx @@ -0,0 +1,87 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +typedef Int32ArrayData = ArrayBufferView.ArrayBufferViewData; + +abstract Int32Array(Int32ArrayData) { + public static inline var BYTES_PER_ELEMENT = 4; + + public var length(get, never):Int; + public var view(get, never):ArrayBufferView; + + public inline function new(elements:Int) { + this = new ArrayBufferView(elements * BYTES_PER_ELEMENT).getData(); + } + + inline function get_length() { + return this.byteLength >> 2; + } + + public inline function get_view():ArrayBufferView { + return ArrayBufferView.fromData(this); + } + + @:arrayAccess public inline function get(index:Int):Int { + return this.bytes.getInt32((index << 2) + this.byteOffset); + } + + @:arrayAccess public inline function set(index:Int, value:Int):Int { + if (index >= 0 && index < length) { + this.bytes.setInt32((index << 2) + this.byteOffset, value); + return value; + } + return 0; + } + + public inline function sub(begin:Int, ?length:Int):Int32Array { + return fromData(this.sub(begin << 2, length == null ? null : length << 2)); + } + + public inline function subarray(?begin:Int, ?end:Int):Int32Array { + return fromData(this.subarray(begin == null ? null : begin << 2, end == null ? null : end << 2)); + } + + public inline function getData():Int32ArrayData { + return this; + } + + public static function fromData(d:Int32ArrayData):Int32Array { + return cast d; + } + + public static function fromArray(a:Array, pos = 0, ?length:Int):Int32Array { + if (length == null) + length = a.length - pos; + if (pos < 0 || length < 0 || pos + length > a.length) + throw Error.OutsideBounds; + var i = new Int32Array(a.length); + for (idx in 0...length) + i[idx] = a[idx + pos]; + return i; + } + + public static function fromBytes(bytes:haxe.io.Bytes, bytePos = 0, ?length:Int):Int32Array { + return fromData(ArrayBufferView.fromBytes(bytes, bytePos, (length == null ? (bytes.length - bytePos) >> 2 : length) << 2).getData()); + } +} diff --git a/build/linux64_569e52e/std/haxe/io/Mime.hx b/build/linux64_569e52e/std/haxe/io/Mime.hx new file mode 100644 index 0000000..8aa7ec1 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/io/Mime.hx @@ -0,0 +1,322 @@ +package haxe.io; + +/** + HTML MimeType Enum + @see http://www.sitepoint.com/web-foundations/mime-types-complete-list/ +**/ +enum abstract Mime(String) from String to String { + var XWorldX3dmf = 'x-world/x-3dmf'; + var ApplicationOctetStream = 'application/octet-stream'; + var ApplicationXAuthorwareBin = 'application/x-authorware-bin'; + var ApplicationXAuthorwareMap = 'application/x-authorware-map'; + var ApplicationXAuthorwareSeg = 'application/x-authorware-seg'; + var TextVndAbc = 'text/vnd.abc'; + var TextHtml = 'text/html'; + var VideoAnimaflex = 'video/animaflex'; + var ApplicationPostscript = 'application/postscript'; + var AudioAiff = 'audio/aiff'; + var AudioXAiff = 'audio/x-aiff'; + var ApplicationXAim = 'application/x-aim'; + var TextXAudiosoftIntra = 'text/x-audiosoft-intra'; + var ApplicationXNaviAnimation = 'application/x-navi-animation'; + var ApplicationXNokia9000CommunicatorAddOnSoftware = 'application/x-nokia-9000-communicator-add-on-software'; + var ApplicationMime = 'application/mime'; + var ApplicationArj = 'application/arj'; + var ImageXJg = 'image/x-jg'; + var VideoXMsAsf = 'video/x-ms-asf'; + var TextXAsm = 'text/x-asm'; + var TextAsp = 'text/asp'; + var ApplicationXMplayer2 = 'application/x-mplayer2'; + var AudioBasic = 'audio/basic'; + var ApplicationXTroffMsvideo = 'application/x-troff-msvideo'; + var VideoAvi = 'video/avi'; + var VideoMsvideo = 'video/msvideo'; + var VideoXMsvideo = 'video/x-msvideo'; + var VideoAvsVideo = 'video/avs-video'; + var ApplicationXBcpio = 'application/x-bcpio'; + var ApplicationMacBinary = 'application/mac-binary'; + var ApplicationMacbinary = 'application/macbinary'; + var ApplicationXBinary = 'application/x-binary'; + var ApplicationXMacbinary = 'application/x-macbinary'; + var ImageBmp = 'image/bmp'; + var ImageXWindowsBmp = 'image/x-windows-bmp'; + var ApplicationBook = 'application/book'; + var ApplicationXBzip2 = 'application/x-bzip2'; + var ApplicationXBsh = 'application/x-bsh'; + var ApplicationXBzip = 'application/x-bzip'; + var TextPlain = 'text/plain'; + var TextXC = 'text/x-c'; + var ApplicationVndMsPkiSeccat = 'application/vnd.ms-pki.seccat'; + var ApplicationClariscad = 'application/clariscad'; + var ApplicationXCocoa = 'application/x-cocoa'; + var ApplicationCdf = 'application/cdf'; + var ApplicationXCdf = 'application/x-cdf'; + var ApplicationXNetcdf = 'application/x-netcdf'; + var ApplicationPkixCert = 'application/pkix-cert'; + var ApplicationXX509CaCert = 'application/x-x509-ca-cert'; + var ApplicationXChat = 'application/x-chat'; + var ApplicationJava = 'application/java'; + var ApplicationJavaByteCode = 'application/java-byte-code'; + var ApplicationXJavaClass = 'application/x-java-class'; + var ApplicationXCpio = 'application/x-cpio'; + var ApplicationMacCompactpro = 'application/mac-compactpro'; + var ApplicationPkcsCrl = 'application/pkcs-crl'; + var ApplicationXCsh = 'application/x-csh'; + var TextCss = 'text/css'; + var ApplicationXDirector = 'application/x-director'; + var ApplicationXDeepv = 'application/x-deepv'; + var VideoXDv = 'video/x-dv'; + var VideoDl = 'video/dl'; + var ApplicationMsword = 'application/msword'; + var ApplicationCommonground = 'application/commonground'; + var ApplicationDrafting = 'application/drafting'; + var ApplicationXDvi = 'application/x-dvi'; + var DrawingXDwf = 'drawing/x-dwf (old)'; + var ApplicationAcad = 'application/acad'; + var ApplicationDxf = 'application/dxf'; + var TextXScriptElisp = 'text/x-script.elisp'; + var ApplicationXBytecodeElisp = 'application/x-bytecode.elisp (compiled elisp)'; + var ApplicationXEnvoy = 'application/x-envoy'; + var ApplicationXEsrehber = 'application/x-esrehber'; + var TextXSetext = 'text/x-setext'; + var ApplicationEnvoy = 'application/envoy'; + var TextXFortran = 'text/x-fortran'; + var ApplicationVndFdf = 'application/vnd.fdf'; + var ImageFif = 'image/fif'; + var VideoFli = 'video/fli'; + var ImageFlorian = 'image/florian'; + var TextVndFmiFlexstor = 'text/vnd.fmi.flexstor'; + var VideoXAtomic3dFeature = 'video/x-atomic3d-feature'; + var ImageVndFpx = 'image/vnd.fpx'; + var ApplicationFreeloader = 'application/freeloader'; + var AudioMake = 'audio/make'; + var ImageG3fax = 'image/g3fax'; + var ImageGif = 'image/gif'; + var VideoGl = 'video/gl'; + var AudioXGsm = 'audio/x-gsm'; + var ApplicationXGsp = 'application/x-gsp'; + var ApplicationXGss = 'application/x-gss'; + var ApplicationXGtar = 'application/x-gtar'; + var ApplicationXCompressed = 'application/x-compressed'; + var ApplicationXGzip = 'application/x-gzip'; + var ApplicationXHdf = 'application/x-hdf'; + var ApplicationXHelpfile = 'application/x-helpfile'; + var TextXScript = 'text/x-script'; + var ApplicationHlp = 'application/hlp'; + var ApplicationVndHpHpgl = 'application/vnd.hp-hpgl'; + var ApplicationBinhex = 'application/binhex'; + var ApplicationHta = 'application/hta'; + var TextXComponent = 'text/x-component'; + var TextWebviewhtml = 'text/webviewhtml'; + var XConferenceXCooltalk = 'x-conference/x-cooltalk'; + var ImageXIcon = 'image/x-icon'; + var ImageIef = 'image/ief'; + var ApplicationIges = 'application/iges'; + var ApplicationXIma = 'application/x-ima'; + var ApplicationXHttpdImap = 'application/x-httpd-imap'; + var ApplicationInf = 'application/inf'; + var ApplicationXInternettSignup = 'application/x-internett-signup'; + var ApplicationXIp2 = 'application/x-ip2'; + var VideoXIsvideo = 'video/x-isvideo'; + var AudioIt = 'audio/it'; + var ApplicationXInventor = 'application/x-inventor'; + var IWorldIVrml = 'i-world/i-vrml'; + var ApplicationXLivescreen = 'application/x-livescreen'; + var AudioXJam = 'audio/x-jam'; + var ApplicationXJavaCommerce = 'application/x-java-commerce'; + var ImageJpeg = 'image/jpeg'; + var ImageXJps = 'image/x-jps'; + var TextJavascript = 'text/javascript'; + var ApplicationJson = 'application/json'; + var ApplicationJavascript = 'application/javascript'; + var ImageJutvision = 'image/jutvision'; + var AudioMidi = 'audio/midi'; + var ApplicationXKsh = 'application/x-ksh'; + var AudioNspaudio = 'audio/nspaudio'; + var AudioXLiveaudio = 'audio/x-liveaudio'; + var ApplicationXLatex = 'application/x-latex'; + var ApplicationXLisp = 'application/x-lisp'; + var TextXLaAsf = 'text/x-la-asf'; + var ApplicationLzx = 'application/lzx'; + var VideoMpeg = 'video/mpeg'; + var AudioMpeg = 'audio/mpeg'; + var AudioXMpequrl = 'audio/x-mpequrl'; + var ApplicationXTroffMan = 'application/x-troff-man'; + var ApplicationXNavimap = 'application/x-navimap'; + var ApplicationMbedlet = 'application/mbedlet'; + var ApplicationXMagicCapPackage10 = 'application/x-magic-cap-package-1.0'; + var ApplicationMcad = 'application/mcad'; + var ImageVasa = 'image/vasa'; + var ApplicationNetmc = 'application/netmc'; + var ApplicationXTroffMe = 'application/x-troff-me'; + var MessageRfc822 = 'message/rfc822'; + var ApplicationXMif = 'application/x-mif'; + var WwwMime = 'www/mime'; + var AudioXVndAudioexplosionMjuicemediafile = 'audio/x-vnd.audioexplosion.mjuicemediafile'; + var VideoXMotionJpeg = 'video/x-motion-jpeg'; + var ApplicationBase64 = 'application/base64'; + var AudioMod = 'audio/mod'; + var VideoQuicktime = 'video/quicktime'; + var VideoXSgiMovie = 'video/x-sgi-movie'; + var AudioMpeg3 = 'audio/mpeg3'; + var ApplicationXProject = 'application/x-project'; + var ApplicationVndMsProject = 'application/vnd.ms-project'; + var ApplicationMarc = 'application/marc'; + var ApplicationXTroffMs = 'application/x-troff-ms'; + var ApplicationXVndAudioexplosionMzz = 'application/x-vnd.audioexplosion.mzz'; + var ImageNaplps = 'image/naplps'; + var ApplicationVndNokiaConfigurationMessage = 'application/vnd.nokia.configuration-message'; + var ImageXNiff = 'image/x-niff'; + var ApplicationXMixTransfer = 'application/x-mix-transfer'; + var ApplicationXConference = 'application/x-conference'; + var ApplicationXNavidoc = 'application/x-navidoc'; + var ApplicationOda = 'application/oda'; + var ApplicationXOmc = 'application/x-omc'; + var ApplicationXOmcdatamaker = 'application/x-omcdatamaker'; + var ApplicationXOmcregerator = 'application/x-omcregerator'; + var TextXPascal = 'text/x-pascal'; + var ApplicationPkcs10 = 'application/pkcs10'; + var ApplicationPkcs12 = 'application/pkcs-12'; + var ApplicationXPkcs7Signature = 'application/x-pkcs7-signature'; + var ApplicationPkcs7Mime = 'application/pkcs7-mime'; + var ApplicationXPkcs7Certreqresp = 'application/x-pkcs7-certreqresp'; + var ApplicationPkcs7Signature = 'application/pkcs7-signature'; + var ApplicationPro_eng = 'application/pro_eng'; + var TextPascal = 'text/pascal'; + var ImageXPortableBitmap = 'image/x-portable-bitmap'; + var ApplicationVndHpPcl = 'application/vnd.hp-pcl'; + var ImageXPict = 'image/x-pict'; + var ImageXPcx = 'image/x-pcx'; + var ChemicalXPdb = 'chemical/x-pdb'; + var ApplicationPdf = 'application/pdf'; + var ImageXPortableGraymap = 'image/x-portable-graymap'; + var ImagePict = 'image/pict'; + var ApplicationXNewtonCompatiblePkg = 'application/x-newton-compatible-pkg'; + var ApplicationVndMsPkiPko = 'application/vnd.ms-pki.pko'; + var ApplicationXPixclscript = 'application/x-pixclscript'; + var ImageXXpixmap = 'image/x-xpixmap'; + var ApplicationXPagemaker = 'application/x-pagemaker'; + var ImagePng = 'image/png'; + var ApplicationXPortableAnymap = 'application/x-portable-anymap'; + var ApplicationMspowerpoint = 'application/mspowerpoint'; + var ModelXPov = 'model/x-pov'; + var ApplicationVndMsPowerpoint = 'application/vnd.ms-powerpoint'; + var ImageXPortablePixmap = 'image/x-portable-pixmap'; + var ApplicationXFreelance = 'application/x-freelance'; + var PaleovuXPv = 'paleovu/x-pv'; + var TextXScriptPhyton = 'text/x-script.phyton'; + var ApplicationXBytecodePython = 'application/x-bytecode.python'; + var AudioVndQcelp = 'audio/vnd.qcelp'; + var ImageXQuicktime = 'image/x-quicktime'; + var VideoXQtc = 'video/x-qtc'; + var AudioXPnRealaudio = 'audio/x-pn-realaudio'; + var ApplicationXCmuRaster = 'application/x-cmu-raster'; + var ImageCmuRaster = 'image/cmu-raster'; + var TextXScriptRexx = 'text/x-script.rexx'; + var ImageVndRnRealflash = 'image/vnd.rn-realflash'; + var ImageXRgb = 'image/x-rgb'; + var ApplicationVndRnRealmedia = 'application/vnd.rn-realmedia'; + var AudioMid = 'audio/mid'; + var ApplicationRingingTones = 'application/ringing-tones'; + var ApplicationVndRnRealplayer = 'application/vnd.rn-realplayer'; + var ApplicationXTroff = 'application/x-troff'; + var ImageVndRnRealpix = 'image/vnd.rn-realpix'; + var AudioXPnRealaudioPlugin = 'audio/x-pn-realaudio-plugin'; + var TextRichtext = 'text/richtext'; + var ApplicationRtf = 'application/rtf'; + var VideoVndRnRealvideo = 'video/vnd.rn-realvideo'; + var AudioS3m = 'audio/s3m'; + var ApplicationXTbook = 'application/x-tbook'; + var ApplicationXLotusscreencam = 'application/x-lotusscreencam'; + var ApplicationSdp = 'application/sdp'; + var ApplicationSounder = 'application/sounder'; + var ApplicationSea = 'application/sea'; + var ApplicationSet = 'application/set'; + var AudioXPsid = 'audio/x-psid'; + var ApplicationXSit = 'application/x-sit'; + var ApplicationXKoan = 'application/x-koan'; + var ApplicationXSeelogo = 'application/x-seelogo'; + var ApplicationSmil = 'application/smil'; + var ApplicationSolids = 'application/solids'; + var ApplicationXPkcs7Certificates = 'application/x-pkcs7-certificates'; + var ApplicationFuturesplash = 'application/futuresplash'; + var ApplicationXSprite = 'application/x-sprite'; + var ApplicationXWaisSource = 'application/x-wais-source'; + var TextXServerParsedHtml = 'text/x-server-parsed-html'; + var ApplicationStreamingmedia = 'application/streamingmedia'; + var ApplicationVndMsPkiCertstore = 'application/vnd.ms-pki.certstore'; + var ApplicationStep = 'application/step'; + var ApplicationSla = 'application/sla'; + var ApplicationXSv4cpio = 'application/x-sv4cpio'; + var ApplicationXSv4crc = 'application/x-sv4crc'; + var ImageVndDwg = 'image/vnd.dwg'; + var ApplicationXWorld = 'application/x-world'; + var ApplicationXShockwaveFlash = 'application/x-shockwave-flash'; + var TextXSpeech = 'text/x-speech'; + var ApplicationXTar = 'application/x-tar'; + var ApplicationToolbook = 'application/toolbook'; + var ApplicationXTcl = 'application/x-tcl'; + var TextXScriptTcsh = 'text/x-script.tcsh'; + var ApplicationXTex = 'application/x-tex'; + var ApplicationXTexinfo = 'application/x-texinfo'; + var ApplicationGnutar = 'application/gnutar'; + var ImageTiff = 'image/tiff'; + var AudioTspAudio = 'audio/tsp-audio'; + var ApplicationDsptype = 'application/dsptype'; + var TextTabSeparatedValues = 'text/tab-separated-values'; + var TextXUil = 'text/x-uil'; + var TextUriList = 'text/uri-list'; + var ApplicationIDeas = 'application/i-deas'; + var ApplicationXUstar = 'application/x-ustar'; + var TextXUuencode = 'text/x-uuencode'; + var ApplicationXCdlink = 'application/x-cdlink'; + var TextXVcalendar = 'text/x-vcalendar'; + var ApplicationVda = 'application/vda'; + var VideoVdo = 'video/vdo'; + var ApplicationGroupwise = 'application/groupwise'; + var VideoVivo = 'video/vivo'; + var ApplicationVocaltecMediaDesc = 'application/vocaltec-media-desc'; + var ApplicationVocaltecMediaFile = 'application/vocaltec-media-file'; + var AudioVoc = 'audio/voc'; + var VideoVosaic = 'video/vosaic'; + var AudioVoxware = 'audio/voxware'; + var AudioXTwinvqPlugin = 'audio/x-twinvq-plugin'; + var AudioXTwinvq = 'audio/x-twinvq'; + var ApplicationXVrml = 'application/x-vrml'; + var XWorldXVrt = 'x-world/x-vrt'; + var ApplicationXVisio = 'application/x-visio'; + var ApplicationWordperfect60 = 'application/wordperfect6.0'; + var ApplicationWordperfect61 = 'application/wordperfect6.1'; + var AudioWav = 'audio/wav'; + var ApplicationXQpro = 'application/x-qpro'; + var ImageVndWapWbmp = 'image/vnd.wap.wbmp'; + var ApplicationVndXara = 'application/vnd.xara'; + var ImageWebp = 'image/webp'; + var ApplicationX123 = 'application/x-123'; + var WindowsMetafile = 'windows/metafile'; + var TextVndWapWml = 'text/vnd.wap.wml'; + var ApplicationVndWapWmlc = 'application/vnd.wap.wmlc'; + var TextVndWapWmlscript = 'text/vnd.wap.wmlscript'; + var ApplicationVndWapWmlscriptc = 'application/vnd.wap.wmlscriptc'; + var ApplicationWordperfect = 'application/wordperfect'; + var ApplicationXLotus = 'application/x-lotus'; + var ApplicationMswrite = 'application/mswrite'; + var ModelVrml = 'model/vrml'; + var TextScriplet = 'text/scriplet'; + var ApplicationXWintalk = 'application/x-wintalk'; + var ImageXXbitmap = 'image/x-xbitmap'; + var VideoXAmtDemorun = 'video/x-amt-demorun'; + var XglDrawing = 'xgl/drawing'; + var ImageVndXiff = 'image/vnd.xiff'; + var ApplicationExcel = 'application/excel'; + var AudioXm = 'audio/xm'; + var ApplicationXml = 'application/xml'; + var XglMovie = 'xgl/movie'; + var ApplicationXVndLsXpix = 'application/x-vnd.ls-xpix'; + var VideoXAmtShowrun = 'video/x-amt-showrun'; + var ImageXXwd = 'image/x-xwd'; + var ApplicationXCompress = 'application/x-compress'; + var MultipartXZip = 'multipart/x-zip'; + var TextXScriptZsh = 'text/x-script.zsh'; + var ImageAvif = 'image/avif'; +} diff --git a/build/linux64_569e52e/std/haxe/io/Output.hx b/build/linux64_569e52e/std/haxe/io/Output.hx new file mode 100644 index 0000000..b8eb1e4 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/io/Output.hx @@ -0,0 +1,293 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +/** + An Output is an abstract write. A specific output implementation will only + have to override the `writeByte` and maybe the `write`, `flush` and `close` + methods. See `File.write` and `String.write` for two ways of creating an + Output. +**/ +class Output { + /** + Endianness (word byte order) used when writing numbers. + + If `true`, big-endian is used, otherwise `little-endian` is used. + **/ + public var bigEndian(default, set):Bool; + + #if java + private var helper:java.nio.ByteBuffer; + #end + + /** + Write one byte. + **/ + public function writeByte(c:Int):Void { + throw new haxe.exceptions.NotImplementedException(); + } + + /** + Write `len` bytes from `s` starting by position specified by `pos`. + + Returns the actual length of written data that can differ from `len`. + + See `writeFullBytes` that tries to write the exact amount of specified bytes. + **/ + public function writeBytes(s:Bytes, pos:Int, len:Int):Int { + #if !neko + if (pos < 0 || len < 0 || pos + len > s.length) + throw Error.OutsideBounds; + #end + var b = #if js @:privateAccess s.b #else s.getData() #end; + var k = len; + while (k > 0) { + #if neko + writeByte(untyped __dollar__sget(b, pos)); + #elseif php + writeByte(b.get(pos)); + #elseif cpp + writeByte(untyped b[pos]); + #elseif hl + writeByte(b[pos]); + #else + writeByte(untyped b[pos]); + #end + pos++; + k--; + } + return len; + } + + /** + Flush any buffered data. + **/ + public function flush() {} + + /** + Close the output. + + Behaviour while writing after calling this method is unspecified. + **/ + public function close() {} + + function set_bigEndian(b) { + bigEndian = b; + return b; + } + + /* ------------------ API ------------------ */ + /** + Write all bytes stored in `s`. + **/ + public function write(s:Bytes):Void { + var l = s.length; + var p = 0; + while (l > 0) { + var k = writeBytes(s, p, l); + if (k == 0) + throw Error.Blocked; + p += k; + l -= k; + } + } + + /** + Write `len` bytes from `s` starting by position specified by `pos`. + + Unlike `writeBytes`, this method tries to write the exact `len` amount of bytes. + **/ + public function writeFullBytes(s:Bytes, pos:Int, len:Int) { + while (len > 0) { + var k = writeBytes(s, pos, len); + pos += k; + len -= k; + } + } + + /** + Write `x` as 32-bit floating point number. + + Endianness is specified by the `bigEndian` property. + **/ + public function writeFloat(x:Float) { + writeInt32(FPHelper.floatToI32(x)); + } + + /** + Write `x` as 64-bit double-precision floating point number. + + Endianness is specified by the `bigEndian` property. + **/ + public function writeDouble(x:Float) { + var i64 = FPHelper.doubleToI64(x); + if (bigEndian) { + writeInt32(i64.high); + writeInt32(i64.low); + } else { + writeInt32(i64.low); + writeInt32(i64.high); + } + } + + /** + Write `x` as 8-bit signed integer. + **/ + public function writeInt8(x:Int) { + if (x < -0x80 || x >= 0x80) + throw Error.Overflow; + writeByte(x & 0xFF); + } + + /** + Write `x` as 16-bit signed integer. + + Endianness is specified by the `bigEndian` property. + **/ + public function writeInt16(x:Int) { + if (x < -0x8000 || x >= 0x8000) + throw Error.Overflow; + writeUInt16(x & 0xFFFF); + } + + /** + Write `x` as 16-bit unsigned integer. + + Endianness is specified by the `bigEndian` property. + **/ + public function writeUInt16(x:Int) { + if (x < 0 || x >= 0x10000) + throw Error.Overflow; + if (bigEndian) { + writeByte(x >> 8); + writeByte(x & 0xFF); + } else { + writeByte(x & 0xFF); + writeByte(x >> 8); + } + } + + /** + Write `x` as 24-bit signed integer. + + Endianness is specified by the `bigEndian` property. + **/ + public function writeInt24(x:Int) { + if (x < -0x800000 || x >= 0x800000) + throw Error.Overflow; + writeUInt24(x & 0xFFFFFF); + } + + /** + Write `x` as 24-bit unsigned integer. + + Endianness is specified by the `bigEndian` property. + **/ + public function writeUInt24(x:Int) { + if (x < 0 || x >= 0x1000000) + throw Error.Overflow; + if (bigEndian) { + writeByte(x >> 16); + writeByte((x >> 8) & 0xFF); + writeByte(x & 0xFF); + } else { + writeByte(x & 0xFF); + writeByte((x >> 8) & 0xFF); + writeByte(x >> 16); + } + } + + /** + Write `x` as 32-bit signed integer. + + Endianness is specified by the `bigEndian` property. + **/ + public function writeInt32(x:Int) { + if (bigEndian) { + writeByte(x >>> 24); + writeByte((x >> 16) & 0xFF); + writeByte((x >> 8) & 0xFF); + writeByte(x & 0xFF); + } else { + writeByte(x & 0xFF); + writeByte((x >> 8) & 0xFF); + writeByte((x >> 16) & 0xFF); + writeByte(x >>> 24); + } + } + + /** + Inform that we are about to write at least `nbytes` bytes. + + The underlying implementation can allocate proper working space depending + on this information, or simply ignore it. This is not a mandatory call + but a tip and is only used in some specific cases. + **/ + public function prepare(nbytes:Int) {} + + /** + Read all available data from `i` and write it. + + The `bufsize` optional argument specifies the size of chunks by + which data is read and written. Its default value is 4096. + **/ + public function writeInput(i:Input, ?bufsize:Int) { + if (bufsize == null) + bufsize = 4096; + var buf = Bytes.alloc(bufsize); + try { + while (true) { + var len = i.readBytes(buf, 0, bufsize); + if (len == 0) + throw Error.Blocked; + var p = 0; + while (len > 0) { + var k = writeBytes(buf, p, len); + if (k == 0) + throw Error.Blocked; + p += k; + len -= k; + } + } + } catch (e:Eof) {} + } + + /** + Write `s` string. + **/ + public function writeString(s:String, ?encoding:Encoding) { + #if neko + var b = untyped new Bytes(s.length, s.__s); + #else + var b = Bytes.ofString(s, encoding); + #end + writeFullBytes(b, 0, b.length); + } + + #if neko + static function __init__() + untyped { + Output.prototype.bigEndian = false; + } + #end +} diff --git a/build/linux64_569e52e/std/haxe/io/Path.hx b/build/linux64_569e52e/std/haxe/io/Path.hx new file mode 100644 index 0000000..1bf6725 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/io/Path.hx @@ -0,0 +1,333 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +/** + This class provides a convenient way of working with paths. It supports the + common path formats: + + - `directory1/directory2/filename.extension` + - `directory1\directory2\filename.extension` +**/ +class Path { + /** + The directory. + + This is the leading part of the path that is not part of the file name + and the extension. + + Does not end with a `/` or `\` separator. + + If the path has no directory, the value is `null`. + **/ + public var dir:Null; + + /** + The file name. + + This is the part of the part between the directory and the extension. + + If there is no file name, e.g. for `".htaccess"` or `"/dir/"`, the value + is the empty String `""`. + **/ + public var file:String; + + /** + The file extension. + + It is separated from the file name by a dot. This dot is not part of + the extension. + + If the path has no extension, the value is `null`. + **/ + public var ext:Null; + + /** + `true` if the last directory separator is a backslash, `false` otherwise. + **/ + public var backslash:Bool; + + /** + Creates a new `Path` instance by parsing `path`. + + Path information can be retrieved by accessing the `dir`, `file` and `ext` + properties. + **/ + public function new(path:String) { + switch (path) { + case "." | "..": + dir = path; + file = ""; + return; + } + var c1 = path.lastIndexOf("/"); + var c2 = path.lastIndexOf("\\"); + if (c1 < c2) { + dir = path.substr(0, c2); + path = path.substr(c2 + 1); + backslash = true; + } else if (c2 < c1) { + dir = path.substr(0, c1); + path = path.substr(c1 + 1); + } else + dir = null; + var cp = path.lastIndexOf("."); + if (cp != -1) { + ext = path.substr(cp + 1); + file = path.substr(0, cp); + } else { + ext = null; + file = path; + } + } + + /** + Returns a String representation of `this` path. + + If `this.backslash` is `true`, backslash is used as directory separator, + otherwise slash is used. This only affects the separator between + `this.dir` and `this.file`. + + If `this.directory` or `this.extension` is `null`, their representation + is the empty String `""`. + **/ + public function toString():String { + return (if (dir == null) "" else dir + if (backslash) "\\" else "/") + file + (if (ext == null) "" else "." + ext); + } + + /** + Returns the String representation of `path` without the file extension. + + If `path` is `null`, the result is unspecified. + **/ + public static function withoutExtension(path:String):String { + var s = new Path(path); + s.ext = null; + return s.toString(); + } + + /** + Returns the String representation of `path` without the directory. + + If `path` is `null`, the result is unspecified. + **/ + public static function withoutDirectory(path):String { + var s = new Path(path); + s.dir = null; + return s.toString(); + } + + /** + Returns the directory of `path`. + + If the directory is `null`, the empty String `""` is returned. + + If `path` is `null`, the result is unspecified. + **/ + public static function directory(path):String { + var s = new Path(path); + if (s.dir == null) + return ""; + return s.dir; + } + + /** + Returns the extension of `path`. + + If `path` has no extension, the empty String `""` is returned. + + If `path` is `null`, the result is unspecified. + **/ + public static function extension(path):String { + var s = new Path(path); + if (s.ext == null) + return ""; + return s.ext; + } + + /** + Returns a String representation of `path` where the extension is `ext`. + + If `path` has no extension, `ext` is added as extension. + + If `path` or `ext` are `null`, the result is unspecified. + **/ + public static function withExtension(path, ext):String { + var s = new Path(path); + s.ext = ext; + return s.toString(); + } + + /** + Joins all paths in `paths` together. + + If `paths` is empty, the empty String `""` is returned. Otherwise the + paths are joined with a slash between them. + + If `paths` is `null`, the result is unspecified. + **/ + public static function join(paths:Array):String { + var paths = paths.filter(function(s) return s != null && s != ""); + if (paths.length == 0) { + return ""; + } + var path = paths[0]; + for (i in 1...paths.length) { + path = addTrailingSlash(path); + path += paths[i]; + } + return normalize(path); + } + + /** + Normalize a given `path` (e.g. turn `'/usr/local/../lib'` into `'/usr/lib'`). + + Also replaces backslashes `\` with slashes `/` and afterwards turns + multiple slashes into a single one. + + If `path` is `null`, the result is unspecified. + **/ + public static function normalize(path:String):String { + var slash = "/"; + path = path.split("\\").join(slash); + if (path == slash) + return slash; + + var target = []; + + for (token in path.split(slash)) { + if (token == '..' && target.length > 0 && target[target.length - 1] != "..") { + target.pop(); + } else if (token == '') { + if (target.length > 0 || path.charCodeAt(0) == '/'.code) { + target.push(token); + } + } else if (token != '.') { + target.push(token); + } + } + + var tmp = target.join(slash); + var acc = new StringBuf(); + var colon = false; + var slashes = false; + #if utf16 + for (c in haxe.iterators.StringIteratorUnicode.unicodeIterator(tmp)) { + switch (c) { + #else + for (i in 0...tmp.length) { + switch (StringTools.fastCodeAt(tmp, i)) { + #end + case ":".code: + acc.add(":"); + colon = true; + case "/".code if (!colon): + slashes = true; + case var i: + colon = false; + if (slashes) { + acc.add("/"); + slashes = false; + } + acc.addChar(i); + } + } + + return acc.toString(); + } + + /** + Adds a trailing slash to `path`, if it does not have one already. + + If the last slash in `path` is a backslash, a backslash is appended to + `path`. + + If the last slash in `path` is a slash, or if no slash is found, a slash + is appended to `path`. In particular, this applies to the empty String + `""`. + + If `path` is `null`, the result is unspecified. + **/ + public static function addTrailingSlash(path:String):String { + if (path.length == 0) + return "/"; + var c1 = path.lastIndexOf("/"); + var c2 = path.lastIndexOf("\\"); + return if (c1 < c2) { + if (c2 != path.length - 1) + path + "\\"; + else + path; + } else { + if (c1 != path.length - 1) + path + "/"; + else + path; + } + } + + /** + Removes trailing slashes from `path`. + + If `path` does not end with a `/` or `\`, `path` is returned unchanged. + + Otherwise the substring of `path` excluding the trailing slashes or + backslashes is returned. + + If `path` is `null`, the result is unspecified. + **/ + public static function removeTrailingSlashes(path:String):String { + while (true) { + switch (path.charCodeAt(path.length - 1)) { + case '/'.code | '\\'.code: + path = path.substr(0, -1); + case _: + break; + } + } + return path; + } + + /** + Returns `true` if the path is an absolute path, and `false` otherwise. + **/ + public static function isAbsolute(path:String):Bool { + if (StringTools.startsWith(path, '/')) + return true; + if (path.charAt(1) == ':') + return true; + if (StringTools.startsWith(path, '\\\\')) + return true; + return false; + } + + private static function unescape(path:String):String { + var regex = ~/-x([0-9][0-9])/g; + return regex.map(path, function(regex) return String.fromCharCode(Std.parseInt(regex.matched(1)))); + } + + private static function escape(path:String, allowSlashes:Bool = false):String { + var regex = allowSlashes ? ~/[^A-Za-z0-9_\/\\\.]/g : ~/[^A-Za-z0-9_\.]/g; + return regex.map(path, function(v) return '-x' + v.matched(0).charCodeAt(0)); + } +} diff --git a/build/linux64_569e52e/std/haxe/io/Scheme.hx b/build/linux64_569e52e/std/haxe/io/Scheme.hx new file mode 100644 index 0000000..e5acdcf --- /dev/null +++ b/build/linux64_569e52e/std/haxe/io/Scheme.hx @@ -0,0 +1,18 @@ +package haxe.io; + +/** + A scheme consists of a sequence of characters beginning with a letter and followed + by any combination of letters, digits, plus (`+`, period (`.`), or hyphen (`-`). + + Although schemes are case-insensitive, the canonical form is lowercase + and documents that specify schemes must do so with lowercase letters. + It is followed by a colon (`:`). +**/ +enum abstract Scheme(String) from String to String { + var Http = 'http'; + var Https = 'https'; + var Ftp = 'ftp'; + var MailTo = 'mailto'; + var File = 'file'; + var Data = 'data'; +} diff --git a/build/linux64_569e52e/std/haxe/io/StringInput.hx b/build/linux64_569e52e/std/haxe/io/StringInput.hx new file mode 100644 index 0000000..c2beb56 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/io/StringInput.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +class StringInput extends BytesInput { + public function new(s:String) { + super(haxe.io.Bytes.ofString(s)); + } +} diff --git a/build/linux64_569e52e/std/haxe/io/UInt16Array.hx b/build/linux64_569e52e/std/haxe/io/UInt16Array.hx new file mode 100644 index 0000000..bad0aef --- /dev/null +++ b/build/linux64_569e52e/std/haxe/io/UInt16Array.hx @@ -0,0 +1,87 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +typedef UInt16ArrayData = ArrayBufferView.ArrayBufferViewData; + +abstract UInt16Array(UInt16ArrayData) { + public static inline var BYTES_PER_ELEMENT = 2; + + public var length(get, never):Int; + public var view(get, never):ArrayBufferView; + + public inline function new(elements:Int) { + this = new ArrayBufferView(elements * BYTES_PER_ELEMENT).getData(); + } + + inline function get_length() { + return this.byteLength >> 1; + } + + public inline function get_view():ArrayBufferView { + return ArrayBufferView.fromData(this); + } + + @:arrayAccess public inline function get(index:Int):Int { + return this.bytes.getUInt16((index << 1) + this.byteOffset); + } + + @:arrayAccess public inline function set(index:Int, value:Int):Int { + if (index >= 0 && index < length) { + this.bytes.setUInt16((index << 1) + this.byteOffset, value); + return value; + } + return 0; + } + + public inline function sub(begin:Int, ?length:Int):UInt16Array { + return fromData(this.sub(begin << 1, length == null ? null : length << 1)); + } + + public inline function subarray(?begin:Int, ?end:Int):UInt16Array { + return fromData(this.subarray(begin == null ? null : begin << 1, end == null ? null : end << 1)); + } + + public inline function getData():UInt16ArrayData { + return this; + } + + public static function fromData(d:UInt16ArrayData):UInt16Array { + return cast d; + } + + public static function fromArray(a:Array, pos = 0, ?length:Int):UInt16Array { + if (length == null) + length = a.length - pos; + if (pos < 0 || length < 0 || pos + length > a.length) + throw Error.OutsideBounds; + var i = new UInt16Array(a.length); + for (idx in 0...length) + i[idx] = a[idx + pos]; + return i; + } + + public static function fromBytes(bytes:haxe.io.Bytes, bytePos = 0, ?length:Int):UInt16Array { + return fromData(ArrayBufferView.fromBytes(bytes, bytePos, (length == null ? (bytes.length - bytePos) >> 1 : length) << 1).getData()); + } +} diff --git a/build/linux64_569e52e/std/haxe/io/UInt32Array.hx b/build/linux64_569e52e/std/haxe/io/UInt32Array.hx new file mode 100644 index 0000000..b433f44 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/io/UInt32Array.hx @@ -0,0 +1,87 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +typedef UInt32ArrayData = ArrayBufferView.ArrayBufferViewData; + +abstract UInt32Array(UInt32ArrayData) { + public static inline var BYTES_PER_ELEMENT = 4; + + public var length(get, never):Int; + public var view(get, never):ArrayBufferView; + + public inline function new(elements:Int) { + this = new ArrayBufferView(elements * BYTES_PER_ELEMENT).getData(); + } + + inline function get_length() { + return this.byteLength >> 2; + } + + public inline function get_view():ArrayBufferView { + return ArrayBufferView.fromData(this); + } + + @:arrayAccess public inline function get(index:Int):UInt { + return this.bytes.getInt32((index << 2) + this.byteOffset); + } + + @:arrayAccess public inline function set(index:Int, value:UInt):UInt { + if (index >= 0 && index < length) { + this.bytes.setInt32((index << 2) + this.byteOffset, value); + return value; + } + return 0; + } + + public inline function sub(begin:Int, ?length:Int):UInt32Array { + return fromData(this.sub(begin << 2, length == null ? null : length << 2)); + } + + public inline function subarray(?begin:Int, ?end:Int):UInt32Array { + return fromData(this.subarray(begin == null ? null : begin << 2, end == null ? null : end << 2)); + } + + public inline function getData():UInt32ArrayData { + return this; + } + + public static function fromData(d:UInt32ArrayData):UInt32Array { + return cast d; + } + + public static function fromArray(a:Array, pos = 0, ?length:Int):UInt32Array { + if (length == null) + length = a.length - pos; + if (pos < 0 || length < 0 || pos + length > a.length) + throw Error.OutsideBounds; + var i = new UInt32Array(a.length); + for (idx in 0...length) + i[idx] = a[idx + pos]; + return i; + } + + public static function fromBytes(bytes:haxe.io.Bytes, bytePos = 0, ?length:Int):UInt32Array { + return fromData(ArrayBufferView.fromBytes(bytes, bytePos, (length == null ? (bytes.length - bytePos) >> 2 : length) << 2).getData()); + } +} diff --git a/build/linux64_569e52e/std/haxe/io/UInt8Array.hx b/build/linux64_569e52e/std/haxe/io/UInt8Array.hx new file mode 100644 index 0000000..696808d --- /dev/null +++ b/build/linux64_569e52e/std/haxe/io/UInt8Array.hx @@ -0,0 +1,87 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +typedef UInt8ArrayData = ArrayBufferView.ArrayBufferViewData; + +abstract UInt8Array(UInt8ArrayData) { + public static inline var BYTES_PER_ELEMENT = 1; + + public var length(get, never):Int; + public var view(get, never):ArrayBufferView; + + public inline function new(elements:Int) { + this = new ArrayBufferView(elements * BYTES_PER_ELEMENT).getData(); + } + + inline function get_length() { + return this.byteLength; + } + + public inline function get_view():ArrayBufferView { + return ArrayBufferView.fromData(this); + } + + @:arrayAccess public inline function get(index:Int) { + return this.bytes.get(index + this.byteOffset); + } + + @:arrayAccess public inline function set(index:Int, value:Int):Int { + if (index >= 0 && index < length) { + this.bytes.set(index + this.byteOffset, value); + return value; + } + return 0; + } + + public inline function sub(begin:Int, ?length:Int):UInt8Array { + return fromData(this.sub(begin, length)); + } + + public inline function subarray(?begin:Int, ?end:Int):UInt8Array { + return fromData(this.subarray(begin, end)); + } + + public inline function getData():UInt8ArrayData { + return this; + } + + public static function fromData(d:UInt8ArrayData):UInt8Array { + return cast d; + } + + public static function fromArray(a:Array, pos = 0, ?length:Int):UInt8Array { + if (length == null) + length = a.length - pos; + if (pos < 0 || length < 0 || pos + length > a.length) + throw Error.OutsideBounds; + var i = new UInt8Array(a.length); + for (idx in 0...length) + i[idx] = a[idx + pos]; + return i; + } + + public static function fromBytes(bytes:haxe.io.Bytes, bytePos:Int = 0, ?length:Int):UInt8Array { + return fromData(ArrayBufferView.fromBytes(bytes, bytePos, length).getData()); + } +} diff --git a/build/linux64_569e52e/std/haxe/iterators/ArrayIterator.hx b/build/linux64_569e52e/std/haxe/iterators/ArrayIterator.hx new file mode 100644 index 0000000..a02059b --- /dev/null +++ b/build/linux64_569e52e/std/haxe/iterators/ArrayIterator.hx @@ -0,0 +1,55 @@ +/* + * Copyright (C)2005-2018 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.iterators; + +/** + This iterator is used only when `Array` is passed to `Iterable` +**/ +class ArrayIterator { + final array:Array; + var current:Int = 0; + + /** + Create a new `ArrayIterator`. + **/ + #if !hl inline #end + public function new(array:Array) { + this.array = array; + } + + /** + See `Iterator.hasNext` + **/ + #if !hl inline #end + public function hasNext() { + return current < array.length; + } + + /** + See `Iterator.next` + **/ + #if !hl inline #end + public function next() { + return array[current++]; + } +} diff --git a/build/linux64_569e52e/std/haxe/iterators/ArrayKeyValueIterator.hx b/build/linux64_569e52e/std/haxe/iterators/ArrayKeyValueIterator.hx new file mode 100644 index 0000000..ab382bb --- /dev/null +++ b/build/linux64_569e52e/std/haxe/iterators/ArrayKeyValueIterator.hx @@ -0,0 +1,41 @@ +/* + * Copyright (C)2005-2018 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.iterators; + +@:ifFeature("anon_read.keyValueIterator", "dynamic_read.keyValueIterator") +class ArrayKeyValueIterator { + var current:Int = 0; + var array:Array; + + public inline function new(array:Array) { + this.array = array; + } + + public inline function hasNext():Bool { + return current < array.length; + } + + public inline function next():{key:Int,value:T} { + return {value:array[current], key:current++}; + } +} diff --git a/build/linux64_569e52e/std/haxe/iterators/DynamicAccessIterator.hx b/build/linux64_569e52e/std/haxe/iterators/DynamicAccessIterator.hx new file mode 100644 index 0000000..abf0a6a --- /dev/null +++ b/build/linux64_569e52e/std/haxe/iterators/DynamicAccessIterator.hx @@ -0,0 +1,52 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.iterators; + +/** + This iterator can be used to iterate over the values of `haxe.DynamicAccess`. +**/ +class DynamicAccessIterator { + final access:DynamicAccess; + final keys:Array; + var index:Int; + + public inline function new(access:DynamicAccess) { + this.access = access; + this.keys = access.keys(); + index = 0; + } + + /** + See `Iterator.hasNext` + **/ + public inline function hasNext():Bool { + return index < keys.length; + } + + /** + See `Iterator.next` + **/ + public inline function next():T { + return access[keys[index++]]; + } +} diff --git a/build/linux64_569e52e/std/haxe/iterators/DynamicAccessKeyValueIterator.hx b/build/linux64_569e52e/std/haxe/iterators/DynamicAccessKeyValueIterator.hx new file mode 100644 index 0000000..5cfe14e --- /dev/null +++ b/build/linux64_569e52e/std/haxe/iterators/DynamicAccessKeyValueIterator.hx @@ -0,0 +1,53 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.iterators; + +/** + This Key/Value iterator can be used to iterate over `haxe.DynamicAccess`. +**/ +class DynamicAccessKeyValueIterator { + final access:DynamicAccess; + final keys:Array; + var index:Int; + + public inline function new(access:DynamicAccess) { + this.access = access; + this.keys = access.keys(); + index = 0; + } + + /** + See `Iterator.hasNext` + **/ + public inline function hasNext():Bool { + return index < keys.length; + } + + /** + See `Iterator.next` + **/ + public inline function next():{key:String, value:T} { + var key = keys[index++]; + return {value: (access[key] : T), key: key}; + } +} diff --git a/build/linux64_569e52e/std/haxe/iterators/HashMapKeyValueIterator.hx b/build/linux64_569e52e/std/haxe/iterators/HashMapKeyValueIterator.hx new file mode 100644 index 0000000..da6e706 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/iterators/HashMapKeyValueIterator.hx @@ -0,0 +1,28 @@ +package haxe.iterators; + +import haxe.ds.HashMap; + +class HashMapKeyValueIterator { + final map:HashMap; + final keys:Iterator; + + public inline function new(map:HashMap) { + this.map = map; + this.keys = map.keys(); + } + + /** + See `Iterator.hasNext` + **/ + public inline function hasNext():Bool { + return keys.hasNext(); + } + + /** + See `Iterator.next` + **/ + public inline function next():{key:K, value:V} { + var key = keys.next(); + return {value: map.get(key), key: key}; + } +} diff --git a/build/linux64_569e52e/std/haxe/iterators/MapKeyValueIterator.hx b/build/linux64_569e52e/std/haxe/iterators/MapKeyValueIterator.hx new file mode 100644 index 0000000..fa051cd --- /dev/null +++ b/build/linux64_569e52e/std/haxe/iterators/MapKeyValueIterator.hx @@ -0,0 +1,54 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.iterators; + +import haxe.ds.IntMap; + +/** + This Key/Value iterator can be used to iterate across maps. +**/ +@:ifFeature("anon_read.keyValueIterator", "dynamic_read.keyValueIterator") +class MapKeyValueIterator { + var map:haxe.Constraints.IMap; + var keys:Iterator; + + public inline function new(map:haxe.Constraints.IMap) { + this.map = map; + this.keys = map.keys(); + } + + /** + See `Iterator.hasNext` + **/ + public inline function hasNext():Bool { + return keys.hasNext(); + } + + /** + See `Iterator.next` + **/ + public inline function next():{key:K, value:V} { + var key = keys.next(); + return {value: @:nullSafety(Off) (map.get(key) : V), key: key}; + } +} diff --git a/build/linux64_569e52e/std/haxe/iterators/RestIterator.hx b/build/linux64_569e52e/std/haxe/iterators/RestIterator.hx new file mode 100644 index 0000000..eba87d7 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/iterators/RestIterator.hx @@ -0,0 +1,19 @@ +package haxe.iterators; + +class RestIterator { + final args:Rest; + var current:Int = 0; + + @:allow(haxe.Rest) + inline function new(args:Any) { + this.args = args; + } + + public inline function hasNext():Bool { + return current < args.length; + } + + public inline function next():T { + return args[current++]; + } +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/haxe/iterators/RestKeyValueIterator.hx b/build/linux64_569e52e/std/haxe/iterators/RestKeyValueIterator.hx new file mode 100644 index 0000000..ff287ee --- /dev/null +++ b/build/linux64_569e52e/std/haxe/iterators/RestKeyValueIterator.hx @@ -0,0 +1,19 @@ +package haxe.iterators; + +class RestKeyValueIterator { + final args:Rest; + var current:Int = 0; + + @:allow(haxe.Rest) + inline function new(args:Any) { + this.args = args; + } + + public inline function hasNext():Bool { + return current < args.length; + } + + public inline function next():{key:Int, value:T} { + return {key:current, value:args[current++]}; + } +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/haxe/iterators/StringIterator.hx b/build/linux64_569e52e/std/haxe/iterators/StringIterator.hx new file mode 100644 index 0000000..63b6929 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/iterators/StringIterator.hx @@ -0,0 +1,55 @@ +/* + * Copyright (C)2005-2018 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.iterators; + +/** + This iterator can be used to iterate over char codes in a string. + + Note that char codes may differ across platforms because of different + internal encoding of strings in different of runtimes. +**/ +class StringIterator { + var offset = 0; + var s:String; + + /** + Create a new `StringIterator` over String `s`. + **/ + public inline function new(s:String) { + this.s = s; + } + + /** + See `Iterator.hasNext` + **/ + public inline function hasNext() { + return offset < s.length; + } + + /** + See `Iterator.next` + **/ + public inline function next() { + return StringTools.unsafeCodeAt(s, offset++); + } +} diff --git a/build/linux64_569e52e/std/haxe/iterators/StringIteratorUnicode.hx b/build/linux64_569e52e/std/haxe/iterators/StringIteratorUnicode.hx new file mode 100644 index 0000000..4a73d83 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/iterators/StringIteratorUnicode.hx @@ -0,0 +1,73 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.iterators; + +/** + This iterator can be used to iterate across strings in a cross-platform + way. It handles surrogate pairs on platforms that require it. On each + iteration, it returns the next character code. + + Note that this has different semantics than a standard for-loop over the + String's length due to the fact that it deals with surrogate pairs. +**/ +class StringIteratorUnicode { + var offset = 0; + var s:String; + + /** + Create a new `StringIteratorUnicode` over String `s`. + **/ + public inline function new(s:String) { + this.s = s; + } + + /** + See `Iterator.hasNext` + **/ + public inline function hasNext() { + return offset < s.length; + } + + /** + See `Iterator.next` + **/ + @:access(StringTools) + public inline function next() { + #if utf16 + var c = StringTools.utf16CodePointAt(s, offset++); + if (c >= StringTools.MIN_SURROGATE_CODE_POINT) { + offset++; + } + return c; + #else + return StringTools.unsafeCodeAt(s, offset++); + #end + } + + /** + Convenience function which can be used as a static extension. + **/ + static public inline function unicodeIterator(s:String) { + return new StringIteratorUnicode(s); + } +} diff --git a/build/linux64_569e52e/std/haxe/iterators/StringKeyValueIterator.hx b/build/linux64_569e52e/std/haxe/iterators/StringKeyValueIterator.hx new file mode 100644 index 0000000..8a69078 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/iterators/StringKeyValueIterator.hx @@ -0,0 +1,55 @@ +/* + * Copyright (C)2005-2018 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.iterators; + +/** + This iterator can be used to iterate over char indexes and char codes in a string. + + Note that char codes may differ across platforms because of different + internal encoding of strings in different runtimes. +**/ +class StringKeyValueIterator { + var offset = 0; + var s:String; + + /** + Create a new `StringKeyValueIterator` over String `s`. + **/ + public inline function new(s:String) { + this.s = s; + } + + /** + See `KeyValueIterator.hasNext` + **/ + public inline function hasNext() { + return offset < s.length; + } + + /** + See `KeyValueIterator.next` + **/ + public inline function next() { + return {key: offset, value: StringTools.fastCodeAt(s, offset++)}; + } +} diff --git a/build/linux64_569e52e/std/haxe/iterators/StringKeyValueIteratorUnicode.hx b/build/linux64_569e52e/std/haxe/iterators/StringKeyValueIteratorUnicode.hx new file mode 100644 index 0000000..3647c6d --- /dev/null +++ b/build/linux64_569e52e/std/haxe/iterators/StringKeyValueIteratorUnicode.hx @@ -0,0 +1,76 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.iterators; + +/** + This iterator can be used to iterate across strings in a cross-platform + way. It handles surrogate pairs on platforms that require it. On each + iteration, it returns the next character offset as key and the next + character code as value. + + Note that in the general case, because of surrogate pairs, the key values + should not be used as offsets for various String API operations. For the + same reason, the last key value returned might be less than `s.length - 1`. +**/ +class StringKeyValueIteratorUnicode { + var byteOffset = 0; + var charOffset = 0; + var s:String; + + /** + Create a new `StringKeyValueIteratorUnicode` over String `s`. + **/ + public inline function new(s:String) { + this.s = s; + } + + /** + See `Iterator.hasNext` + **/ + public inline function hasNext() { + return byteOffset < s.length; + } + + /** + See `Iterator.next` + **/ + @:access(StringTools) + public inline function next() { + #if utf16 + var c = StringTools.utf16CodePointAt(s, byteOffset++); + if (c >= StringTools.MIN_SURROGATE_CODE_POINT) { + byteOffset++; + } + return {key: charOffset++, value: c}; + #else + return {key: charOffset++, value: StringTools.fastCodeAt(s, byteOffset++)}; + #end + } + + /** + Convenience function which can be used as a static extension. + **/ + static public inline function unicodeKeyValueIterator(s:String) { + return new StringKeyValueIteratorUnicode(s); + } +} diff --git a/build/linux64_569e52e/std/haxe/macro/CompilationServer.hx b/build/linux64_569e52e/std/haxe/macro/CompilationServer.hx new file mode 100644 index 0000000..921611c --- /dev/null +++ b/build/linux64_569e52e/std/haxe/macro/CompilationServer.hx @@ -0,0 +1,79 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.macro; + +import haxe.macro.Compiler; + +enum abstract ModuleCheckPolicy(Int) { + /** + Disables file modification checks, avoiding some filesystem operations. + **/ + var NoFileSystemCheck = 0; + + /** + Default behavior: check last modification time. + **/ + var CheckFileModificationTime = 1; + + /** + If a file is modified, also checks if its content changed. This check + is not free, but useful when .hx files are auto-generated. + **/ + var CheckFileContentModification = 2; +} + +/** + This class provides some methods which can be invoked from command line using + `--macro server.field(args)`. +**/ +class CompilationServer { + #if macro + /** + Sets the `ModuleCheckPolicy` of all files whose dot-path matches an + element of `pathFilters`. + + If `recursive` is true, a dot-path is considered matched if it starts + with the path filter. This automatically applies to path filters of + packages. Otherwise an exact match is required. + + If an element in `pathFilters` is the empty String `""` it matches + everything (if `recursive = true`) or only top-level types (if + `recursive = false`). + + If a call to this function is added to the compilation parameters, the + compilation server should be restarted to ensure it takes effect. + **/ + static public function setModuleCheckPolicy(pathFilters:Array, policy:Array, ?recursive = true) { + Context.onAfterInitMacros(() -> { + @:privateAccess Compiler.load("server_add_module_check_policy", 4)(pathFilters, policy, recursive); + }); + } + + /** + Invalidates all files given in `filePaths`, removing them from the cache. + **/ + static public function invalidateFiles(filePaths:Array) { + @:privateAccess Compiler.load("server_invalidate_files", 1)(filePaths); + } + #end +} diff --git a/build/linux64_569e52e/std/haxe/macro/Compiler.hx b/build/linux64_569e52e/std/haxe/macro/Compiler.hx new file mode 100644 index 0000000..cc3e5d1 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/macro/Compiler.hx @@ -0,0 +1,693 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.macro; + +import haxe.display.Display; +import haxe.macro.Expr; +import haxe.hxb.WriterConfig; + +/** + All these methods can be called for compiler configuration macros. +**/ +class Compiler { + /** + A conditional compilation flag can be set on the command line using + `-D key=value`. + + Returns the value of a compiler flag. + + If the compiler flag is defined but no value is set, + `Compiler.getDefine` returns `"1"` (e.g. `-D key`). + + If the compiler flag is not defined, `Compiler.getDefine` returns + `null`. + + Note: This is a macro and cannot be called from within other macros. Refer + to `haxe.macro.Context.definedValue` to obtain defined values in macro context. + + @see https://haxe.org/manual/lf-condition-compilation.html + **/ + macro /* <-- ! */ static public function getDefine(key:String) { + return macro $v{haxe.macro.Context.definedValue(key)}; + } + + #if (neko || (macro && hl) || (macro && eval)) + static var ident = ~/^[A-Za-z_][A-Za-z0-9_]*$/; + static var path = ~/^[A-Za-z_][A-Za-z0-9_.]*$/; + + public static function allowPackage(v:String) { + #if (neko || eval) + load("allow_package", 1)(v); + #end + } + + /** + Set a conditional compiler flag. + + Usage of this function outside of initialization macros is deprecated and may cause compilation server issues. + **/ + public static function define(flag:String, ?value:String) { + #if (neko || eval) + Context.assertInitMacro(); + load("define", 2)(flag, value); + #end + } + + #if (!neko && !eval) + private static function addGlobalMetadataImpl(pathFilter:String, meta:String, recursive:Bool, toTypes:Bool, toFields:Bool) {} + #end + + /** + Add a class path where ".hx" source files or packages (sub-directories) can be found. + + Usage of this function outside of initialization macros is deprecated and may cause compilation server issues. + **/ + public static function addClassPath(path:String) { + #if (neko || eval) + Context.assertInitMacro(); + load("add_class_path", 1)(path); + #end + } + + public static function getOutput():String { + #if (neko || eval) + return load("get_output", 0)(); + #else + return null; + #end + } + + public static function setOutput(fileOrDir:String) { + #if (neko || eval) + load("set_output", 1)(fileOrDir); + #end + } + + public static function getDisplayPos():Null<{file:String, pos:Int}> { + #if (neko || eval) + return load("get_display_pos", 0)(); + #else + return null; + #end + } + + /** + Returns all the configuration settings applied to the compiler. + + Usage of this function outside a macro context returns `null`. + **/ + public static function getConfiguration():Null { + #if (neko || eval) + return load("get_configuration", 0)(); + #else + return null; + #end + } + + /** + Sets the target configuration. + + Usage of this function outside a macro context does nothing. + **/ + public static function setPlatformConfiguration(config:PlatformConfig):Void { + #if (neko || eval) + load("set_platform_configuration", 1)(config); + #end + } + + /** + Adds a native library depending on the platform (e.g. `-swf-lib` for Flash). + + Usage of this function outside of initialization macros is deprecated and may cause compilation server issues. + **/ + public static function addNativeLib(name:String) { + #if (neko || eval) + Context.assertInitMacro(); + load("add_native_lib", 1)(name); + #end + } + + /** + Includes all modules in package `pack` in the compilation. + + In order to include single modules, their paths can be listed directly + on command line: `haxe ... ModuleName pack.ModuleName`. + + By default `Compiler.include` will search for modules in the directories defined with `-cp`. + If you want to specify a different set of paths to search for modules, you can use the optional + argument `classPath`. + + @param pack The package dot-path as String. Use `''` to include the root package. + @param rec If true, recursively adds all sub-packages. + @param ignore Array of module names to ignore for inclusion. + You can use `module*` with a * at the end for Wildcard matching + @param classPaths An alternative array of paths (directory names) to use to search for modules to include. + Note that if you pass this argument, only the specified paths will be used for inclusion. + @param strict If true and given package wasn't found in any of class paths, fail with an error. + **/ + public static function include(pack:String, ?rec = true, ?ignore:Array, ?classPaths:Array, strict = false) { + function include(pack:String, ?rec = true, ?ignore:Array, ?classPaths:Array, strict = false) { + var ignoreWildcard:Array = []; + var ignoreString:Array = []; + if (ignore != null) { + for (ignoreRule in ignore) { + if (StringTools.endsWith(ignoreRule, "*")) { + ignoreWildcard.push(ignoreRule.substr(0, ignoreRule.length - 1)); + } else { + ignoreString.push(ignoreRule); + } + } + } + var skip = if (ignore == null) { + function(c) return false; + } else { + function(c:String) { + if (Lambda.has(ignoreString, c)) + return true; + for (ignoreRule in ignoreWildcard) + if (StringTools.startsWith(c, ignoreRule)) + return true; + return false; + } + } + var displayValue = Context.definedValue("display"); + if (classPaths == null) { + classPaths = Context.getClassPath(); + // do not force inclusion when using completion + switch (displayValue) { + case null: + case "usage": + case _: + return; + } + // normalize class path + for (i in 0...classPaths.length) { + var cp = StringTools.replace(classPaths[i], "\\", "/"); + if (StringTools.endsWith(cp, "/")) + cp = cp.substr(0, -1); + if (cp == "") + cp = "."; + classPaths[i] = cp; + } + } + var prefix = pack == '' ? '' : pack + '.'; + var found = false; + for (cp in classPaths) { + var path = pack == '' ? cp : cp + "/" + pack.split(".").join("/"); + if (!sys.FileSystem.exists(path) || !sys.FileSystem.isDirectory(path)) + continue; + found = true; + for (file in sys.FileSystem.readDirectory(path)) { + if (StringTools.endsWith(file, ".hx") && file.substr(0, file.length - 3).indexOf(".") < 0) { + if (file == "import.hx") + continue; + var cl = prefix + file.substr(0, file.length - 3); + if (skip(cl)) + continue; + Context.getModule(cl); + } else if (rec && sys.FileSystem.isDirectory(path + "/" + file) && !skip(prefix + file)) + include(prefix + file, true, ignore, classPaths); + } + } + if (strict && !found) + Context.error('Package "$pack" was not found in any of class paths', Context.currentPos()); + } + + Context.onAfterInitMacros(() -> include(pack, rec, ignore, classPaths, strict)); + } + + /** + Exclude a class or an enum without changing it to `@:nativeGen`. + **/ + static function excludeBaseType(baseType:Type.BaseType):Void { + if (!baseType.isExtern) { + var meta = baseType.meta; + if (!meta.has(":nativeGen")) { + meta.add(":hxGen", [], baseType.pos); + } + baseType.exclude(); + } + } + + /** + Exclude a specific class, enum, or all classes and enums in a + package from being generated. Excluded types become `extern`. + + @param pack The package dot-path as String. Use `''` to exclude the root package. + @param rec If true, recursively excludes all sub-packages. + **/ + public static function exclude(pack:String, ?rec = true) { + Context.onGenerate(function(types) { + for (t in types) { + var b:Type.BaseType, name; + switch (t) { + case TInst(c, _): + name = c.toString(); + b = c.get(); + case TEnum(e, _): + name = e.toString(); + b = e.get(); + default: + continue; + } + var p = b.pack.join("."); + if ((p == pack || name == pack) || (rec && StringTools.startsWith(p, pack + "."))) + excludeBaseType(b); + } + }, false); + } + + /** + Exclude classes and enums listed in an extern file (one per line) from being generated. + **/ + public static function excludeFile(fileName:String) { + fileName = Context.resolvePath(fileName); + var f = sys.io.File.read(fileName, true); + var classes = new haxe.ds.StringMap(); + try { + while (true) { + var l = StringTools.trim(f.readLine()); + if (l == "" || !~/[A-Za-z0-9._]/.match(l)) + continue; + classes.set(l, true); + } + } catch (e:haxe.io.Eof) {} + Context.onGenerate(function(types) { + for (t in types) { + switch (t) { + case TInst(c, _): + if (classes.exists(c.toString())) + excludeBaseType(c.get()); + case TEnum(e, _): + if (classes.exists(e.toString())) + excludeBaseType(e.get()); + default: + } + } + }); + } + + /** + Marks types or packages to be kept by DCE. + + This also extends to the sub-types of resolved modules. + + In order to include module sub-types directly, their full dot path + including the containing module has to be used + (e.g. `msignal.Signal.Signal0`). + + This operation has no effect if the type has already been loaded, e.g. + through `Context.getType`. + + @param path A package, module or sub-type dot path to keep. + @param paths An Array of package, module or sub-type dot paths to keep. + @param recursive If true, recurses into sub-packages for package paths. + **/ + public static function keep(?path:String, ?paths:Array, ?recursive:Bool = true) { + if (null == paths) + paths = []; + if (null != path) + paths.push(path); + for (path in paths) { + addGlobalMetadata(path, "@:keep", recursive, true, true); + } + } + + /** + Enables null safety for a type or a package. + + @param path A package, module or sub-type dot path to enable null safety for. + @param recursive If true, recurses into sub-packages for package paths. + **/ + public static function nullSafety(path:String, mode:NullSafetyMode = Loose, recursive:Bool = true) { + addGlobalMetadata(path, '@:nullSafety($mode)', recursive); + } + + /** + Adds metadata `meta` to all types (if `toTypes = true`) or fields (if + `toFields = true`) whose dot-path matches `pathFilter`. + + If `recursive` is true a dot-path is considered matched if it starts + with `pathFilter`. This automatically applies to path filters of + packages. Otherwise an exact match is required. + + If `pathFilter` is the empty String `""` it matches everything (if + `recursive = true`) or only top-level types (if `recursive = false`). + + This operation has no effect if the type has already been loaded, e.g. + through `Context.getType`. + **/ + public static function addGlobalMetadata(pathFilter:String, meta:String, ?recursive:Bool = true, ?toTypes:Bool = true, ?toFields:Bool = false) { + #if (neko || eval) + load("add_global_metadata_impl", 5)(pathFilter, meta, recursive, toTypes, toFields); + #else + addGlobalMetadataImpl(pathFilter, meta, recursive, toTypes, toFields); + #end + } + + @:deprecated + public static function addMetadata(meta:String, className:String, ?field:String, ?isStatic:Bool) { + var pathFilter = field == null ? className : '$className.$field'; + addGlobalMetadata(pathFilter, meta, false, field == null, field != null); + } + + /** + Reference a json file describing user-defined metadata + See https://github.com/HaxeFoundation/haxe/blob/development/src-json/meta.json + **/ + public static function registerMetadataDescriptionFile(path:String, ?source:String):Void { + var f = sys.io.File.getContent(path); + var content:Array = haxe.Json.parse(f); + for (m in content) + registerCustomMetadata(m, source); + } + + /** + Reference a json file describing user-defined defines + See https://github.com/HaxeFoundation/haxe/blob/development/src-json/define.json + **/ + public static function registerDefinesDescriptionFile(path:String, ?source:String):Void { + var f = sys.io.File.getContent(path); + var content:Array = haxe.Json.parse(f); + for (d in content) + registerCustomDefine(d, source); + } + + /** + Register a custom medatada for documentation and completion purposes + **/ + public static function registerCustomMetadata(meta:MetadataDescription, ?source:String):Void { + #if (neko || eval) + load("register_metadata_impl", 2)(meta, source); + #end + } + + /** + Register a custom define for documentation purposes + **/ + public static function registerCustomDefine(define:DefineDescription, ?source:String):Void { + #if (neko || eval) + load("register_define_impl", 2)(define, source); + #end + } + + /** + Change the default JS output by using a custom generator callback + **/ + public static function setCustomJSGenerator(callb:JSGenApi->Void) { + #if (neko || eval) + load("set_custom_js_generator", 1)(callb); + #end + } + + #if (neko || eval) + static inline function load(f, nargs):Dynamic { + return @:privateAccess Context.load(f, nargs); + } + #end + + /** + Clears cached results of file lookups + **/ + public static function flushDiskCache() { + #if (neko || eval) + load("flush_disk_cache", 0)(); + #end + } + #end + + #if (js || lua || macro) + /** + Embed a JavaScript or Lua file at compile time (can be called by `--macro` or within an `__init__` method). + **/ + public static #if !macro macro #end function includeFile(file:String, position:IncludePosition = Top) { + return switch ((position : String).toLowerCase()) { + case Inline: + if (Context.getLocalModule() == "") + Context.error("Cannot use inline mode when includeFile is called by `--macro`", Context.currentPos()); + + var f = try sys.io.File.getContent(Context.resolvePath(file)) catch (e:Dynamic) Context.error(Std.string(e), Context.currentPos()); + var p = Context.currentPos(); + if (Context.defined("js")) { + macro @:pos(p) js.Syntax.plainCode($v{f}); + } else { + macro @:pos(p) untyped __lua__($v{f}); + } + case Top | Closure: + @:privateAccess Context.includeFile(file, position); + macro {}; + case _: + Context.error("unknown includeFile position: " + position, Context.currentPos()); + } + } + #end + + /** + Gets the current hxb writer configuration, if any. + **/ + static public function getHxbWriterConfiguration():Null { + #if macro + return load("get_hxb_writer_config", 0)(); + #else + return null; + #end + } + + /** + Sets the hxb writer configuration to `config`. If no hxb writer configuration + exists, it is created. + + The intended usage is + + ``` + var config = Compiler.getHxbWriterConfiguration(); + config.archivePath = "newPath.zip"; + // Other changes + Compiler.setHxbWriterConfiguration(config); + ``` + + If `config` is `null`, hxb writing is disabled. + + @see haxe.hxb.WriterConfig + **/ + static public function setHxbWriterConfiguration(config:Null) { + #if macro + load("set_hxb_writer_config", 1)(config); + #end + } +} + +enum abstract IncludePosition(String) from String to String { + /** + Prepend the file content to the output file. + **/ + var Top = "top"; + + /** + Prepend the file content to the body of the top-level closure. + + Since the closure is in strict-mode, there may be run-time error if the input is not strict-mode-compatible. + **/ + var Closure = "closure"; + + /** + Directly inject the file content at the call site. + **/ + var Inline = "inline"; +} + +enum abstract NullSafetyMode(String) to String { + /** + Disable null safety. + **/ + var Off; + + /** + Loose safety. + If an expression is checked `!= null`, then it's considered safe even if it could be modified after the check. + E.g. + ```haxe + function example(o:{field:Null}) { + if(o.field != null) { + mutate(o); + var notNullable:String = o.field; //no error + } + } + + function mutate(o:{field:Null}) { + o.field = null; + } + ``` + **/ + var Loose; + + /** + Full scale null safety. + If a field is checked `!= null` it stays safe until a call is made or any field of any object is reassigned, + because that could potentially alter an object of the checked field. + E.g. + ```haxe + function example(o:{field:Null}, b:{o:{field:Null}}) { + if(o.field != null) { + var notNullable:String = o.field; //no error + someCall(); + var notNullable:String = o.field; // Error! + } + if(o.field != null) { + var notNullable:String = o.field; //no error + b.o = {field:null}; + var notNullable:String = o.field; // Error! + } + } + ``` + **/ + var Strict; + + /** + Full scale null safety for a multi-threaded environment. + With this mode checking a field `!= null` does not make it safe, because it could be changed from another thread + at the same time or immediately after the check. + The only nullable thing could be safe are local variables. + **/ + var StrictThreaded; +} + +typedef MetadataDescription = { + final metadata:String; + final doc:String; + + /** + External resources for more information about this metadata. + **/ + @:optional final links:Array; + + /** + List (small description) of parameters that this metadata accepts. + **/ + @:optional final params:Array; + + /** + Haxe target(s) for which this metadata is used. + **/ + @:optional final platforms:Array; + + /** + Places where this metadata can be applied. + **/ + @:optional final targets:Array; +} + +typedef DefineDescription = { + final define:String; + final doc:String; + + /** + External resources for more information about this define. + **/ + @:optional final links:Array; + + /** + List (small description) of parameters that this define accepts. + **/ + @:optional final params:Array; + + /** + Haxe target(s) for which this define is used. + **/ + @:optional final platforms:Array; +} + +typedef CompilerConfiguration = { + /** + The version integer of the current Haxe compiler build. + **/ + final version:Int; + + /** + Returns an array of the arguments passed to the compiler from either the `.hxml` file or the command line. + **/ + final args:Array; + + /** + If `--debug` mode is enabled, this is `true`. + **/ + final debug:Bool; + + /** + If `--verbose` mode is enabled, this is `true`. + **/ + final verbose:Bool; + + /** + If `--no-opt` is enabled, this is `false`. + **/ + final foptimize:Bool; + + /** + The target platform. + **/ + final platform:Platform; + + /** + The compilation configuration for the target platform. + **/ + final platformConfig:PlatformConfig; + + /** + A list of paths being used for the standard library. + **/ + final stdPath:Array; + + /** + The path of the class passed using the `-main` argument. + **/ + final mainClass:TypePath; + + /** + Special access rules for packages depending on the compiler configuration. + + For example, the "java" package is "Forbidden" when the target platform is Python. + **/ + final packageRules:Map; +} + +enum Platform { + Cross; + Js; + Lua; + Neko; + Flash; + Php; + Cpp; + Jvm; + Python; + Hl; + Eval; + CustomTarget(name:String); +} + +enum PackageRule { + Forbidden; + Directory(path:String); + Remap(path:String); +} diff --git a/build/linux64_569e52e/std/haxe/macro/ComplexTypeTools.hx b/build/linux64_569e52e/std/haxe/macro/ComplexTypeTools.hx new file mode 100644 index 0000000..fd838f4 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/macro/ComplexTypeTools.hx @@ -0,0 +1,51 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.macro; + +import haxe.macro.Expr; + +/** + This class provides some utility methods to work with AST-level types. It is + best used through `using haxe.macro.ComplexTypeTools` syntax and then provides + additional methods on `haxe.macro.ComplexType` instances. +**/ +class ComplexTypeTools { + /** + Converts type `c` to a human-readable `String` representation. + + The result is guaranteed to be valid Haxe code, but there may be + differences from the original lexical syntax. + **/ + static public function toString(c:ComplexType):String + return new Printer().printComplexType(c); + + #if macro + /** + Returns a type corresponding to `c`. + + If `c` is null, the result is null. + **/ + static public function toType(c:ComplexType):Null + return c == null ? null : Context.resolveType(c, Context.currentPos()); + #end +} diff --git a/build/linux64_569e52e/std/haxe/macro/Context.hx b/build/linux64_569e52e/std/haxe/macro/Context.hx new file mode 100644 index 0000000..82889fe --- /dev/null +++ b/build/linux64_569e52e/std/haxe/macro/Context.hx @@ -0,0 +1,909 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.macro; + +import haxe.macro.Expr; +import haxe.macro.Type.TypedExpr; + +enum Message { + Info(msg:String, pos:Position); + Warning(msg:String, pos:Position); +} + +/** + Context provides an API for macro programming. + + It contains common functions that interact with the macro interpreter to + query or set information. Other API functions are available in the tools + classes: + + - `haxe.macro.ComplexTypeTools` + - `haxe.macro.ExprTools` + - `haxe.macro.TypeTools` +**/ +class Context { + #if (neko || eval || display) + /** + Displays a compilation error `msg` at the given `Position` `pos` + and aborts the current macro call. + **/ + public static function error(msg:String, pos:Position, ?depth:Int = 0):Dynamic { + return load("error", 2)(msg, pos, depth); + } + + /** + Displays a compilation error `msg` at the given `Position` `pos` + and aborts the compilation. + **/ + public static function fatalError(msg:String, pos:Position, ?depth:Int = 0):Dynamic { + return load("fatal_error", 2)(msg, pos, depth); + } + + /** + Displays a compilation error `msg` at the given `Position` `pos` + without aborting the current macro call. + **/ + public static function reportError(msg:String, pos:Position, ?depth:Int = 0):Void { + load("report_error", 2)(msg, pos, depth); + } + + /** + Displays a compilation warning `msg` at the given `Position` `pos`. + **/ + public static function warning(msg:String, pos:Position, ?depth:Int = 0) { + load("warning", 2)(msg, pos, depth); + } + + /** + Displays a compilation info `msg` at the given `Position` `pos`. + **/ + public static function info(msg:String, pos:Position, ?depth:Int = 0) { + load("info", 2)(msg, pos, depth); + } + + /** + Gets a list of all current compilation info/warning messages. + **/ + public static function getMessages():Array { + return load("get_messages", 0)(); + } + + /** + Filters all current info/warning messages. Filtered out messages will + not be displayed by the compiler. + **/ + public static function filterMessages(predicate:Message->Bool) { + load("filter_messages", 1)(predicate); + } + + /** + Check if compiler is past initializations macros or not. + When it is, configuration phase is over and parsing/typing can start. + **/ + public static function initMacrosDone():Bool { + return load("init_macros_done", 0)(); + } + + /** + Resolves a file name `file` based on the current class paths. + + The resolution follows the usual class path rules where the last + declared class path has priority. + + If a class path was declared relative, this method returns the relative + file path. Otherwise it returns the absolute file path. + + If no type can be found, an exception of type `String` is thrown. + **/ + public static function resolvePath(file:String):String { + return load("resolve_path", 1)(file); + } + + /** + Returns an `Array` of current class paths in the order of their + declaration. + + Modifying the returned array has no effect on the compiler. Class paths + can be added using `haxe.macro.Compiler.addClassPath`. + **/ + public static function getClassPath():Array { + return load("class_path", 0)(); + } + + /** + Check if current display position is within `pos`. + **/ + public static function containsDisplayPosition(pos:Position):Bool { + return load("contains_display_position", 1)(pos); + } + + public static function getDisplayMode():DisplayMode { + return load("get_display_mode", 0)(); + } + + /** + Returns the position at which the macro was called. + **/ + public static function currentPos():Position { + return load("current_pos", 0)(); + } + + /** + Get the call stack (excluding the call to `Context.getMacroStack()` + that led to current macro. + **/ + public static function getMacroStack():Array { + return load("get_macro_stack", 0)(); + } + + /** + Returns the type which is expected at the place the macro is called. + + This affects usages such as `var x:Int = macroCall()`, where the + expected type will be reported as `Int`. + + Might return `null` if no specific type is expected or if the calling + macro is not an expression-macro. + **/ + public static function getExpectedType():Null { + assertInitMacrosDone(false); + return load("get_expected_type", 0)(); + } + + /** + Returns the call arguments that lead to the invocation of the current + `@:genericBuild` macro, if available. + + Returns `null` if the current macro is not a `@:genericBuild` macro. + **/ + public static function getCallArguments():Null> { + assertInitMacrosDone(false); + return load("get_call_arguments", 0)(); + } + + /** + Returns the current class in which the macro was called. + + If no such class exists, `null` is returned. + **/ + public static function getLocalClass():Null> { + assertInitMacrosDone(false); + var l:Type = load("get_local_type", 0)(); + if (l == null) + return null; + return switch (l) { + case TInst(c, _): c; + default: null; + } + } + + /** + Returns the current module path in/on which the macro was called. + **/ + public static function getLocalModule():String { + assertInitMacrosDone(false); + return load("get_local_module", 0)(); + } + + /** + Returns the current type in/on which the macro was called. + + If no such type exists, `null` is returned. + **/ + public static function getLocalType():Null { + assertInitMacrosDone(false); + return load("get_local_type", 0)(); + } + + /** + Returns the name of the method from which the macro was called. + + If no such method exists, `null` is returned. + **/ + public static function getLocalMethod():Null { + assertInitMacrosDone(false); + return load("get_local_method", 0)(); + } + + /** + Returns an `Array` of classes which are available for `using` usage in + the context the macro was called. + + Modifying the returned array has no effect on the compiler. + **/ + public static function getLocalUsing():Array> { + assertInitMacrosDone(false); + return load("get_local_using", 0)(); + } + + /** + Returns an `Array` of all imports in the context the macro was called. + + Modifying the returned array has no effect on the compiler. + **/ + public static function getLocalImports():Array { + assertInitMacrosDone(false); + return load("get_local_imports", 0)(); + } + + /** + Returns a map of local variables accessible in the context the macro was + called. + + The keys of the returned map are the variable names, the values are + their types. + + Modifying the returned map has no effect on the compiler. + **/ + @:deprecated("Use Context.getLocalTVars() instead") + public static function getLocalVars():Map { + assertInitMacrosDone(false); + return load("local_vars", 1)(false); + } + + /** + Similar to `getLocalVars`, but returns elements of type `TVar` instead + of `Type`. + **/ + public static function getLocalTVars():Map { + assertInitMacrosDone(false); + return load("local_vars", 1)(true); + } + + /** + Tells if the conditional compilation flag `s` has been set. + + Compiler flags are set using the `-D` command line parameter, or + by calling `haxe.macro.Compiler.define`. + + @see https://haxe.org/manual/lf-condition-compilation.html + **/ + public static function defined(s:String):Bool { + return load("defined", 1)(s); + } + + /** + Returns the value defined for the conditional compilation flag `key`. + + If no value is defined for `key`, `null` is returned. + + Compiler flags values are set using the `-D key=value` command line + parameter, or by calling `haxe.macro.Compiler.define`. + + The default value is `"1"`. + + @see https://haxe.org/manual/lf-condition-compilation.html + **/ + public static function definedValue(key:String):Null { + return load("defined_value", 1)(key); + } + + /** + Returns a map of all conditional compilation flags that have been set. + + Compiler flags are set using the `-D` command line parameter, or + by calling `haxe.macro.Compiler.define`. + + Modifying the returned map has no effect on the compiler. + + @see https://haxe.org/manual/lf-condition-compilation.html + **/ + public static function getDefines():Map { + return load("get_defines", 0)(); + } + + /** + Resolves a type identified by `name`. + + The resolution follows the usual class path rules where the last + declared class path has priority. + + If no type can be found, an exception of type `String` is thrown. + + Usage of this function from initialization macros is deprecated and may + cause compilation server issues. Use `Context.onAfterInitMacros` to + run your code once typer is ready to be used. + **/ + public static function getType(name:String):Type { + assertInitMacrosDone(); + return load("get_type", 1)(name); + } + + /** + Resolves a module identified by `name` and returns an `Array` of all + its contained types. + + The resolution follows the usual class path rules where the last + declared class path has priority. + + If no module can be found, an exception of type `String` is thrown. + + Usage of this function from initialization macros is deprecated and may + cause compilation server issues. Use `Context.onAfterInitMacros` to + run your code once typer is ready to be used. + **/ + public static function getModule(name:String):Array { + assertInitMacrosDone(); + return load("get_module", 1)(name); + } + + /** + Returns the typed expression of the call to the main function. + + This function will only work in the generation phase. Any calls + made outside a function passed to `haxe.macro.Context.onGenerate` + or `haxe.macro.Context.onAfterGenerate` will return `null`. + **/ + public static function getMainExpr():Null { + return load("get_main_expr", 0)(); + } + + /** + Returns an array of module types to be generated in the output. + + This list may change depending on the phase of compilation and + should not be treated as conclusive until the generation phase. + + Modifying the returned array has no effect on the compilation. + + Usage of this function from initialization macros is deprecated and may + cause compilation server issues. Use `Context.onAfterInitMacros` to + run your code once typer is ready to be used. + **/ + public static function getAllModuleTypes():Array { + assertInitMacrosDone(); + return load("get_module_types", 0)(); + } + + /** + Parses `expr` as Haxe code, returning the corresponding AST. + + String interpolation of single quote strings within `expr` is not + supported. + + The provided `Position` `pos` is used for all generated inner AST nodes. + **/ + public static function parse(expr:String, pos:Position):Expr { + return load("do_parse", 3)(expr, pos, false); + } + + /** + Similar to `parse`, but error positions are reported within the provided + String `expr`. + **/ + public static function parseInlineString(expr:String, pos:Position):Expr { + return load("do_parse", 3)(expr, pos, true); + } + + /** + Builds an expression from `v`. + + This method generates AST nodes depending on the macro-runtime value of + `v`. As such, only basic types and enums are supported and the behavior + for other types is undefined. + + The provided `Position` `pos` is used for all generated inner AST nodes. + **/ + public static function makeExpr(v:Dynamic, pos:Position):Expr { + return load("make_expr", 2)(v, pos); + } + + /** + Returns a hashed MD5 signature of value `v`. + **/ + public static function signature(v:Dynamic):String { + assertInitMacrosDone(false); + return load("signature", 1)(v); + } + + /** + Adds a callback function `callback` which is invoked after the + compiler's typing phase, just before its generation phase. + + The callback receives an `Array` containing all types which are about + to be generated. Modifications are limited to metadata, it is mainly + intended to obtain information. + + By default, the callback is made before types are stored in the compilation + server, if active. This means that any effect persists for the next compilation. + If `persistent` is set to `false`, changes to types made by the callback only + affect the current compilation. If no compilation server is used, this flag has + no effect. + + *Note*: the callback is still invoked when generation is disabled with `--no-output`. + **/ + public static function onGenerate(callback:Array->Void, persistent:Bool = true) { + load("on_generate", 2)(callback, persistent); + } + + /** + Adds a callback function `callback` which is invoked after the compiler + generation phase. + + Compilation has completed at this point and cannot be influenced + anymore. However, contextual information is still available. + + *Note*: the callback is still invoked when generation is disabled with `--no-output`. + **/ + public static function onAfterGenerate(callback:Void->Void) { + load("on_after_generate", 1)(callback); + } + + /** + Adds a callback function `callback` which is invoked after the compiler + is done typing, but before optimization. The callback receives the types + which have been typed. + + It is possible to define new types in the callback, in which case it + will be called again with the new types as argument. + **/ + public static function onAfterTyping(callback:Array->Void) { + load("on_after_typing", 1)(callback); + } + + /** + Adds a callback function `callback` which is invoked after the compiler + is done running initialization macros, when typing begins. + + `onAfterInitMacros` should be used to delay typer-dependant code from + your initalization macros, to properly separate configuration phase and + actual typing. + **/ + public static function onAfterInitMacros(callback:Void->Void):Void { + if (Context.initMacrosDone()) { + callback(); + } else { + load("on_after_init_macros", 1)(callback); + } + } + + /** + Adds a callback function `callback` which is invoked when a type name + cannot be resolved. + + The callback may return a type definition, which is then used for the + expected type. If it returns `null`, the type is considered to still not + exist. + **/ + public static function onTypeNotFound(callback:String->TypeDefinition) { + load("on_type_not_found", 1)(callback); + } + + /** + Types expression `e` and returns its type. + + Typing the expression may result in a compiler error which can be + caught using `try ... catch`. + + Usage of this function from initialization macros is deprecated and may + cause compilation server issues. Use `Context.onAfterInitMacros` to + run your code once typer is ready to be used. + **/ + public static function typeof(e:Expr):Type { + assertInitMacrosDone(); + return load("typeof", 1)(e); + } + + /** + Types expression `e` and returns the corresponding `TypedExpr`. + + Typing the expression may result in a compiler error which can be + caught using `try ... catch`. Note that not all compiler errors can + be caught this way because the compiler might delay various checks + to a later stage, at which point the exception handler is no longer + active. + + Usage of this function from initialization macros is deprecated and may + cause compilation server issues. Use `Context.onAfterInitMacros` to + run your code once typer is ready to be used. + **/ + public static function typeExpr(e:Expr):TypedExpr { + assertInitMacrosDone(); + return load("type_expr", 1)(e); + } + + /** + Resolve type `t` and returns the corresponding `Type`. + + Resolving the type may result in a compiler error which can be + caught using `try ... catch`. + Resolution is performed based on the current context in which the macro is called. + + Usage of this function from initialization macros is deprecated and may + cause compilation server issues. Use `Context.onAfterInitMacros` to + run your code once typer is ready to be used. + **/ + public static function resolveType(t:ComplexType, p:Position):Type { + assertInitMacrosDone(); + return load("resolve_type", 2)(t, p); + } + + /** + Resolve type `t` and returns the corresponding `ComplexType`. + + Resolving the type may result in a compiler error which can be + caught using `try ... catch`. + Resolution is performed based on the current context in which the macro is called. + The difference with `resolveType` is that it only performs type resolution, it does not + build any type or trigger macros. + **/ + public static function resolveComplexType(t:ComplexType, p:Position):ComplexType { + assertInitMacrosDone(false); + return load("resolve_complex_type", 2)(t, p); + } + + /** + Returns the `ComplexType` corresponding to the given `Type` `t`. + + See `haxe.macro.TypeTools.toComplexType` for details. + **/ + public static function toComplexType(t:Type):Null { + return load("to_complex_type", 1)(t); + } + + /** + Tries to unify `t1` and `t2` and returns `true` if successful. + + Usage of this function from initialization macros is deprecated and may + cause compilation server issues. Use `Context.onAfterInitMacros` to + run your code once typer is ready to be used. + **/ + public static function unify(t1:Type, t2:Type):Bool { + assertInitMacrosDone(); + return load("unify", 2)(t1, t2); + } + + /** + Follows a type. + + See `haxe.macro.TypeTools.follow` for details. + + Usage of this function from initialization macros is deprecated and may + cause compilation server issues. Use `Context.onAfterInitMacros` to + run your code once typer is ready to be used. + **/ + public static function follow(t:Type, ?once:Bool):Type { + assertInitMacrosDone(); + return load("follow", 2)(t, once); + } + + /** + Follows a type, including abstracts' underlying implementation + + See `haxe.macro.TypeTools.followWithAbstracts` for details. + + Usage of this function from initialization macros is deprecated and may + cause compilation server issues. Use `Context.onAfterInitMacros` to + run your code once typer is ready to be used. + **/ + public static function followWithAbstracts(t:Type, once:Bool = false):Type { + assertInitMacrosDone(); + return load("follow_with_abstracts", 2)(t, once); + } + + /** + Returns the information stored in `Position` `p`. + **/ + public static function getPosInfos(p:Position):{min:Int, max:Int, file:String} { + return load("get_pos_infos", 1)(p); + } + + /** + Builds a `Position` from `inf`. + **/ + public static function makePosition(inf:{min:Int, max:Int, file:String}):Position { + return load("make_position", 3)(inf.min, inf.max, inf.file); + } + + /** + Returns a map of all registered resources for this compilation unit. + + Modifying the returned map has no effect on the compilation, use + `haxe.macro.Context.addResource` to add new resources to the compilation unit. + **/ + public static function getResources():Map { + return load("get_resources", 0)(); + } + + /** + Makes resource `data` available as `name`. + + The resource is then available using the `haxe.macro.Resource` API. + + If a previous resource was bound to `name`, it is overwritten. + + Compilation server : when using the compilation server, the resource is bound + to the Haxe module which calls the macro, so it will be included again if + that module is reused. If this resource concerns several modules, prefix its + name with a `$` sign, this will bind it to the macro module instead. + **/ + public static function addResource(name:String, data:haxe.io.Bytes) { + load("add_resource", 2)(name, data); + } + + /** + Returns an `Array` of fields of the class which is to be built. + + This is only defined for `@:build/@:autoBuild` macros. + **/ + public static function getBuildFields():Array { + assertInitMacrosDone(false); + return load("get_build_fields", 0)(); + } + + /** + Defines a new type from `TypeDefinition` `t`. + + If `moduleDependency` is given and is not `null`, it should contain + a module path that will be used as a dependency for the newly defined module + instead of the current module. + + Usage of this function from initialization macros is deprecated and may + cause compilation server issues. Use `Context.onAfterInitMacros` to + run your code once typer is ready to be used. + **/ + public static function defineType(t:TypeDefinition, ?moduleDependency:String):Void { + assertInitMacrosDone(); + load("define_type", 2)(t, moduleDependency); + } + + /** + Creates and returns a new instance of monomorph (`TMono`) type. + + Returned monomorph can be used with e.g. `Context.unify` to make the compiler + bind the monomorph to an actual type and let macro further process the resulting type. + + Usage of this function from initialization macros is deprecated and may + cause compilation server issues. Use `Context.onAfterInitMacros` to + run your code once typer is ready to be used. + **/ + public static function makeMonomorph():Type { + assertInitMacrosDone(); + return load("make_monomorph", 0)(); + } + + /** + Defines a new module as `modulePath` with several `TypeDefinition` + `types`. This is analogous to defining a .hx file. + + The individual `types` can reference each other and any identifier + respects the `imports` and `usings` as usual, expect that imports are + not allowed to have `.*` wildcards or `as s` shorthands. + + Usage of this function from initialization macros is deprecated and may + cause compilation server issues. Use `Context.onAfterInitMacros` to + run your code once typer is ready to be used. + **/ + public static function defineModule(modulePath:String, types:Array, ?imports:Array, ?usings:Array):Void { + if (imports == null) + imports = []; + if (usings == null) + usings = []; + assertInitMacrosDone(); + load("define_module", 4)(modulePath, types, imports, usings); + } + + /** + Returns a syntax-level expression corresponding to typed expression `t`. + + This process may lose some information. + + Usage of this function from initialization macros is deprecated and may + cause compilation server issues. Use `Context.onAfterInitMacros` to + run your code once typer is ready to be used. + **/ + public static function getTypedExpr(t:Type.TypedExpr):Expr { + assertInitMacrosDone(); + return load("get_typed_expr", 1)(t); + } + + /** + Store typed expression `t` internally and give a syntax-level expression + that can be returned from a macro and will be replaced by the stored + typed expression. + + If `t` is `null` or invalid, an exception is thrown. + + NOTE: the returned value references an internally stored typed expression + that is reset between compilations, so care should be taken when storing + the expression returned by this method in a static variable and using the + compilation server. + + Usage of this function from initialization macros is deprecated and may + cause compilation server issues. Use `Context.onAfterInitMacros` to + run your code once typer is ready to be used. + **/ + public static function storeTypedExpr(t:Type.TypedExpr):Expr { + assertInitMacrosDone(); + return load("store_typed_expr", 1)(t); + } + + /** + Types expression `e`, stores the resulting typed expression internally and + returns a syntax-level expression that can be returned from a macro and + will be replaced by the stored typed expression. + + If `e` is `null` or invalid, an exception is thrown. + + A call to `storeExpr(e)` is equivalent to `storeTypedExpr(typeExpr(e))` without + the overhead of encoding and decoding between regular and macro runtime. + + NOTE: the returned value references an internally stored typed expression + that is reset between compilations, so care should be taken when storing + the expression returned by this method in a static variable and using the + compilation server. + + Usage of this function from initialization macros is deprecated and may + cause compilation server issues. Use `Context.onAfterInitMacros` to + run your code once typer is ready to be used. + **/ + public static function storeExpr(e:Expr):Expr { + assertInitMacrosDone(); + return load("store_expr", 1)(e); + } + + /** + This function works like `storeExpr`, but also returns access to the expression's + type through the `type` field of the return value. + + Usage of this function from initialization macros is deprecated and may + cause compilation server issues. Use `Context.onAfterInitMacros` to + run your code once typer is ready to be used. + **/ + public static function typeAndStoreExpr(e:Expr):{final type:Type.Ref; final expr:Expr;} { + assertInitMacrosDone(); + return load("type_and_store_expr", 1)(e); + } + + /** + Manually adds a dependency between module `modulePath` and an external + file `externFile`. + + This affects the compilation cache, causing the module to be typed if + `externFile` has changed. + + Has no effect if the compilation cache is not used. + + Usage of this function from initialization macros is deprecated and may + cause compilation server issues. Use `Context.onAfterInitMacros` to + run your code once typer is ready to be used. + **/ + public static function registerModuleDependency(modulePath:String, externFile:String) { + onAfterInitMacros(() -> load("register_module_dependency", 2)(modulePath, externFile)); + } + + /** + Creates a timer which will be printed in the compilation report + if `--times` compilation argument is set. + + Note that a timer may be omitted from the report if the amount of time + measured is too small. + + This method immediately starts a timer and returns a function to stop it: + ``` + var stopTimer = haxe.macro.Context.timer("my heavy task"); + runTask(); + stopTimer(); + ``` + **/ + public static function timer(id:String):() -> Void { + return load("timer", 1)(id); + } + + /** + Executes `code` in a context that has `imports` and `usings` added. + + This is equivalent to temporarily having `import` and `using` statements in a file. These + are only active during the execution of `code` and do not affect anything afterwards. This + is true even if `code` throws an exception. + + If any argument is `null`, the result is unspecified. + + Usage of this function from initialization macros is deprecated and may + cause compilation server issues. Use `Context.onAfterInitMacros` to + run your code once typer is ready to be used. + **/ + public static function withImports(imports:Array, usings:Array, code:() -> X):X { + assertInitMacrosDone(); + return load("with_imports", 3)(imports, usings, code); + } + + + /** + Executes `code` in a context that has some compiler options set, restore the compiler to its + default behavior afterwards. + + `allowInlining`: enable or disable inlining during typing with `typeExpr`. + + `allowTransform`: when disabled, the code typed with `typeExpr` will be almost exactly the same + as the input code. This will disable some abstract types transformations. + + Usage of this function from initialization macros is deprecated and may + cause compilation server issues. Use `Context.onAfterInitMacros` to + run your code once typer is ready to be used. + **/ + public static function withOptions(options:{?allowInlining:Bool,?allowTransform:Bool}, code : () -> X) : X { + assertInitMacrosDone(); + return load("with_options", 2)(options, code); + } + + @:deprecated + public static function registerModuleReuseCall(modulePath:String, macroCall:String) { + throw "This method is no longer supported. See https://github.com/HaxeFoundation/haxe/issues/5746"; + } + + @:deprecated + public static function onMacroContextReused(callb:Void->Bool) { + throw "This method is no longer supported. See https://github.com/HaxeFoundation/haxe/issues/5746"; + } + + @:allow(haxe.macro.TypeTools) + @:allow(haxe.macro.MacroStringTools) + @:allow(haxe.macro.TypedExprTools) + @:allow(haxe.macro.PositionTools) + static function load(f:String, nargs:Int):Dynamic { + #if neko + return neko.Lib.load("macro", f, nargs); + #elseif eval + return eval.vm.Context.callMacroApi(f); + #else + return Reflect.makeVarArgs(function(_) return throw "Can't be called outside of macro"); + #end + } + + private static function includeFile(file:String, position:String) { + load("include_file", 2)(file, position); + } + + private static function sExpr(e:TypedExpr, pretty:Bool):String { + return load("s_expr", 2)(e, pretty); + } + + @:allow(haxe.macro.Compiler) + private static function assertInitMacro():Void { + if (initMacrosDone()) { + var stack = getMacroStack(); + + warning( + "This API should only be used from initialization macros.", + if (stack.length > 2) stack[2] else currentPos() + ); + } + } + + @:allow(haxe.macro.Compiler) + private static function assertInitMacrosDone(includeSuggestion = true):Void { + if (!initMacrosDone()) { + var stack = getMacroStack(); + var suggestion = includeSuggestion + ? "\nUse `Context.onAfterInitMacros` to register a callback to run when context is ready." + : ""; + + fatalError( + "Cannot use this API from initialization macros." + suggestion, + if (stack.length > 2) stack[2] else currentPos() + ); + } + } + #end +} diff --git a/build/linux64_569e52e/std/haxe/macro/DisplayMode.hx b/build/linux64_569e52e/std/haxe/macro/DisplayMode.hx new file mode 100644 index 0000000..a177f96 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/macro/DisplayMode.hx @@ -0,0 +1,15 @@ +package haxe.macro; + +enum DisplayMode { + None; + Default; + Definition; + TypeDefinition; + Implementation; + Package; + Hover; + References(withDefinition:Bool, findDescendants:Bool, findBase:Bool); + ModuleSymbols; + WorkspaceSymbols(filter:String); + Signature; +} diff --git a/build/linux64_569e52e/std/haxe/macro/ExampleJSGenerator.hx b/build/linux64_569e52e/std/haxe/macro/ExampleJSGenerator.hx new file mode 100644 index 0000000..9cf78bd --- /dev/null +++ b/build/linux64_569e52e/std/haxe/macro/ExampleJSGenerator.hx @@ -0,0 +1,264 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.macro; + +import haxe.macro.Type; +import haxe.macro.Expr; + +using Lambda; + +class ExampleJSGenerator { + var api:JSGenApi; + var buf:StringBuf; + var inits:List; + var statics:List<{c:ClassType, f:ClassField}>; + var packages:haxe.ds.StringMap; + var forbidden:haxe.ds.StringMap; + + public function new(api) { + this.api = api; + buf = new StringBuf(); + inits = new List(); + statics = new List(); + packages = new haxe.ds.StringMap(); + forbidden = new haxe.ds.StringMap(); + for (x in ["prototype", "__proto__", "constructor"]) + forbidden.set(x, true); + api.setTypeAccessor(getType); + } + + function getType(t:Type) { + return switch (t) { + case TInst(c, _): getPath(c.get()); + case TEnum(e, _): getPath(e.get()); + case TAbstract(a, _): getPath(a.get()); + default: throw "assert"; + }; + } + + inline function print(str:String) { + buf.add(str); + } + + inline function newline() { + buf.add(";\n"); + } + + inline function genExpr(e) { + print(api.generateValue(e)); + } + + function field(p) { + return api.isKeyword(p) ? '["' + p + '"]' : "." + p; + } + + function genPackage(p:Array) { + var full = null; + for (x in p) { + var prev = full; + if (full == null) + full = x + else + full += "." + x; + if (packages.exists(full)) + continue; + packages.set(full, true); + if (prev == null) + print('if(typeof $x==\'undefined\') $x = {}'); + else { + var p = prev + field(x); + print('if(!$p) $p = {}'); + } + newline(); + } + } + + function getPath(t:BaseType) { + return (t.pack.length == 0) ? t.name : t.pack.join(".") + "." + t.name; + } + + function checkFieldName(c:ClassType, f:ClassField) { + if (forbidden.exists(f.name)) + Context.error("The field " + f.name + " is not allowed in JS", c.pos); + } + + function genClassField(c:ClassType, p:String, f:ClassField) { + checkFieldName(c, f); + var field = field(f.name); + print('$p.prototype$field = '); + var e = f.expr(); + if (e == null) + print("null"); + else { + genExpr(e); + } + newline(); + } + + function genStaticField(c:ClassType, p:String, f:ClassField) { + checkFieldName(c, f); + var field = field(f.name); + var e = f.expr(); + if (e == null) { + print('$p$field = null'); + newline(); + } else + switch (f.kind) { + case FMethod(_): + print('$p$field = '); + genExpr(e); + newline(); + default: + statics.add({c: c, f: f}); + } + } + + function genClass(c:ClassType) { + genPackage(c.pack); + api.setCurrentClass(c); + var p = getPath(c); + print('$p = $$hxClasses[\'$p\'] = '); + if (c.constructor != null) + genExpr(c.constructor.get().expr()); + else + print("function() { }"); + newline(); + print('$p.__name__ = "$p"'); + newline(); + if (c.superClass != null) { + var psup = getPath(c.superClass.t.get()); + print('$p.__super__ = $psup'); + newline(); + print('for(var k in $psup.prototype ) $p.prototype[k] = $psup.prototype[k]'); + newline(); + } + for (f in c.statics.get()) + genStaticField(c, p, f); + for (f in c.fields.get()) { + switch (f.kind) { + case FVar(r, _): + if (r == AccResolve) + continue; + default: + } + genClassField(c, p, f); + } + print('$p.prototype.__class__ = $p'); + newline(); + if (c.interfaces.length > 0) { + var me = this; + var inter = c.interfaces.map(function(i) return me.getPath(i.t.get())).join(","); + print('$p.__interfaces__ = [$inter]'); + newline(); + } + } + + function genEnum(e:EnumType) { + genPackage(e.pack); + var p = getPath(e); + var constructs = e.names.map(api.quoteString).join(","); + print('$p = $$hxClasses[\'$p\'] = { __ename__ : \'$p\', __constructs__ : [$constructs] }'); + newline(); + for (c in e.constructs.keys()) { + var c = e.constructs.get(c); + var f = field(c.name); + print('$p$f = '); + switch (c.type) { + case TFun(args, _): + var sargs = args.map(function(a) return a.name).join(","); + print('function($sargs) { var $$x = ["${c.name}",${c.index},$sargs]; $$x.__enum__ = $p; $$x.toString = $$estr; return $$x; }'); + default: + print("[" + api.quoteString(c.name) + "," + c.index + "]"); + newline(); + print('$p$f.toString = $$estr'); + newline(); + print('$p$f.__enum__ = $p'); + } + newline(); + } + var meta = api.buildMetaData(e); + if (meta != null) { + print('$p.__meta__ = '); + genExpr(meta); + newline(); + } + } + + function genStaticValue(c:ClassType, cf:ClassField) { + var p = getPath(c); + var f = field(cf.name); + print('$p$f = '); + genExpr(cf.expr()); + newline(); + } + + function genType(t:Type) { + switch (t) { + case TInst(c, _): + var c = c.get(); + if (c.init != null) + inits.add(c.init); + if (!c.isExtern) + genClass(c); + case TEnum(r, _): + var e = r.get(); + if (!e.isExtern) + genEnum(e); + default: + } + } + + public function generate() { + print("var $_, $hxClasses = $hxClasses || {}, $estr = function() { return js.Boot.__string_rec(this,''); }"); + newline(); + print( + #if (js_es < 5) + "function $bind(o,m) { if( m == null ) return null; if( m.__id__ == null ) m.__id__ = $global.$haxeUID++; var f; if( o.hx__closures__ == null ) o.hx__closures__ = {}; else f = o.hx__closures__[m.__id__]; if( f == null ) { f = function(){ return f.method.apply(f.scope, arguments); }; f.scope = o; f.method = m; o.hx__closures__[m.__id__] = f; } return f; }" + #else + "function $bind(o,m) { if( m == null ) return null; if( m.__id__ == null ) m.__id__ = $global.$haxeUID++; var f; if( o.hx__closures__ == null ) o.hx__closures__ = {}; else f = o.hx__closures__[m.__id__]; if( f == null ) { f = m.bind(o); o.hx__closures__[m.__id__] = f; } return f; }" + #end + ); + newline(); + for (t in api.types) + genType(t); + for (e in inits) { + print(api.generateStatement(e)); + newline(); + } + for (s in statics) { + genStaticValue(s.c, s.f); + newline(); + } + if (api.main != null) { + genExpr(api.main); + newline(); + } + sys.io.File.saveContent(api.outputFile, buf.toString()); + } + + #if macro + public static function use() { + Compiler.setCustomJSGenerator(function(api) new ExampleJSGenerator(api).generate()); + } + #end +} diff --git a/build/linux64_569e52e/std/haxe/macro/Expr.hx b/build/linux64_569e52e/std/haxe/macro/Expr.hx new file mode 100644 index 0000000..30d7f00 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/macro/Expr.hx @@ -0,0 +1,1095 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.macro; + +#if (macro && !doc_gen) +@:coreType abstract Position {} +#else + +/** + Represents a position in a file. +**/ +typedef Position = { + /** + Reference to the filename. + **/ + var file:String; + + /** + Position of the first character. + **/ + var min:Int; + + /** + Position of the last character. + **/ + var max:Int; +} +#end + +enum StringLiteralKind { + DoubleQuotes; + SingleQuotes; +} + +/** + Represents a constant. + @see https://haxe.org/manual/expression-constants.html +**/ +enum Constant { + /** + Represents an integer literal. + **/ + CInt(v:String, ?s:String); + + /** + Represents a float literal. + **/ + CFloat(f:String, ?s:String); + + /** + Represents a string literal. + **/ + CString(s:String, ?kind:StringLiteralKind); + + /** + Represents an identifier. + **/ + CIdent(s:String); + + /** + Represents a regular expression literal. + + Example: `~/haxe/i` + + - The first argument `haxe` is a string with regular expression pattern. + - The second argument `i` is a string with regular expression flags. + + @see https://haxe.org/manual/std-regex.html + **/ + CRegexp(r:String, opt:String); +} + +/** + A binary operator. + @see https://haxe.org/manual/types-numeric-operators.html +**/ +enum Binop { + /** + `+` + **/ + OpAdd; + + /** + `*` + **/ + OpMult; + + /** + `/` + **/ + OpDiv; + + /** + `-` + **/ + OpSub; + + /** + `=` + **/ + OpAssign; + + /** + `==` + **/ + OpEq; + + /** + `!=` + **/ + OpNotEq; + + /** + `>` + **/ + OpGt; + + /** + `>=` + **/ + OpGte; + + /** + `<` + **/ + OpLt; + + /** + `<=` + **/ + OpLte; + + /** + `&` + **/ + OpAnd; + + /** + `|` + **/ + OpOr; + + /** + `^` + **/ + OpXor; + + /** + `&&` + **/ + OpBoolAnd; + + /** + `||` + **/ + OpBoolOr; + + /** + `<<` + **/ + OpShl; + + /** + `>>` + **/ + OpShr; + + /** + `>>>` + **/ + OpUShr; + + /** + `%` + **/ + OpMod; + + /** + `+=` `-=` `/=` `*=` `<<=` `>>=` `>>>=` `|=` `&=` `^=` `%=` + **/ + OpAssignOp(op:Binop); + + /** + `...` + **/ + OpInterval; + + /** + `=>` + **/ + OpArrow; + + /** + `in` + **/ + OpIn; + + /** + `??` + **/ + OpNullCoal; +} + +/** + A unary operator. + @see https://haxe.org/manual/types-numeric-operators.html +**/ +enum Unop { + /** + `++` + **/ + OpIncrement; + + /** + `--` + **/ + OpDecrement; + + /** + `!` + **/ + OpNot; + + /** + `-` + **/ + OpNeg; + + /** + `~` + **/ + OpNegBits; + + /** + `...` + **/ + OpSpread; +} + +enum EFieldKind { + Normal; + Safe; +} + +/** + Represents a node in the AST. + @see https://haxe.org/manual/macro-reification-expression.html +**/ +typedef Expr = { + /** + The expression kind. + **/ + var expr:ExprDef; + + /** + The position of the expression. + **/ + var pos:Position; +} + +/** + Represents a AST node identical to `Expr`, but it allows constraining the + type of accepted expressions. + @see https://haxe.org/manual/macro-ExprOf.html +**/ +typedef ExprOf = Expr; + +/** + Represents a switch case. + @see https://haxe.org/manual/expression-switch.html +**/ +typedef Case = { + /** + The value expressions of the case. + **/ + var values:Array; + + /** + The optional guard expressions of the case, if available. + **/ + var ?guard:Expr; + + /** + The expression of the case, if available. + **/ + var ?expr:Expr; +} + +/** + Represents a variable in the AST. + @see https://haxe.org/manual/expression-var.html +**/ +typedef Var = { + /** + The name of the variable. + **/ + var name:String; + + /** + The position of the variable name. + **/ + var ?namePos:Position; + + /** + The type-hint of the variable, if available. + **/ + var ?type:ComplexType; + + /** + The expression of the variable, if available. + **/ + var ?expr:Expr; + + /** + Whether or not the variable can be assigned to. + **/ + var ?isFinal:Bool; + + /** + Whether or not the variable is static. + **/ + var ?isStatic:Bool; + + /** + Metadata associatied with the variable, if available. + **/ + var ?meta:Metadata; +} + +/** + Represents a catch in the AST. + @see https://haxe.org/manual/expression-try-catch.html +**/ +typedef Catch = { + /** + The name of the catch variable. + **/ + var name:String; + + /** + The type of the catch. + **/ + var ?type:ComplexType; + + /** + The expression of the catch. + **/ + var expr:Expr; +} + +/** + Represents the way something is quoted. +**/ +enum QuoteStatus { + /** + No quotes + **/ + Unquoted; + + /** + Double quotes `"` + **/ + Quoted; +} + +/** + Represents the field of an object declaration. +**/ +typedef ObjectField = { + /** + The name of the field. + **/ + var field:String; + + /** + The field expression. + **/ + var expr:Expr; + + /** + How the field name is quoted. + **/ + var ?quotes:QuoteStatus; +} + +/** + Represents function kind in the AST +**/ +enum FunctionKind { + /** + Anonymous function + **/ + FAnonymous; + + /** + Named function + **/ + FNamed(name:String, ?inlined:Bool); + + /** + Arrow function + **/ + FArrow; +} + +/** + Represents the kind of a node in the AST. +**/ +enum ExprDef { + /** + A constant. + **/ + EConst(c:Constant); + + /** + Array access `e1[e2]`. + **/ + EArray(e1:Expr, e2:Expr); + + /** + Binary operator `e1 op e2`. + **/ + EBinop(op:Binop, e1:Expr, e2:Expr); + + /** + Field access on `e.field`. + + If `kind` is null, it is equal to Normal. + **/ + EField(e:Expr, field:String, ?kind:EFieldKind); + + /** + Parentheses `(e)`. + **/ + EParenthesis(e:Expr); + + /** + An object declaration. + **/ + EObjectDecl(fields:Array); + + /** + An array declaration `[el]`. + **/ + EArrayDecl(values:Array); + + /** + A call `e(params)`. + **/ + ECall(e:Expr, params:Array); + + /** + A constructor call `new t(params)`. + **/ + ENew(t:TypePath, params:Array); + + /** + An unary operator `op` on `e`: + + - `e++` (`op = OpIncrement, postFix = true`) + - `e--` (`op = OpDecrement, postFix = true`) + - `++e` (`op = OpIncrement, postFix = false`) + - `--e` (`op = OpDecrement, postFix = false`) + - `-e` (`op = OpNeg, postFix = false`) + - `!e` (`op = OpNot, postFix = false`) + - `~e` (`op = OpNegBits, postFix = false`) + **/ + EUnop(op:Unop, postFix:Bool, e:Expr); + + /** + Variable declarations. + **/ + EVars(vars:Array); + + /** + A function declaration. + **/ + EFunction(kind:Null, f:Function); + + /** + A block of expressions `{exprs}`. + **/ + EBlock(exprs:Array); + + /** + A `for` expression. + **/ + EFor(it:Expr, expr:Expr); + + /** + An `if (econd) eif` or `if (econd) eif else eelse` expression. + **/ + EIf(econd:Expr, eif:Expr, eelse:Null); + + /** + Represents a `while` expression. + + When `normalWhile` is `true` it is `while (...)`. + + When `normalWhile` is `false` it is `do {...} while (...)`. + **/ + EWhile(econd:Expr, e:Expr, normalWhile:Bool); + + /** + Represents a `switch` expression with related cases and an optional. + `default` case if `edef != null`. + **/ + ESwitch(e:Expr, cases:Array, edef:Null); + + /** + Represents a `try`-expression with related catches. + **/ + ETry(e:Expr, catches:Array); + + /** + A `return` or `return e` expression. + **/ + EReturn(?e:Expr); + + /** + A `break` expression. + **/ + EBreak; + + /** + A `continue` expression. + **/ + EContinue; + + /** + An `untyped e` source code. + **/ + EUntyped(e:Expr); + + /** + A `throw e` expression. + **/ + EThrow(e:Expr); + + /** + A `cast e` or `cast (e, m)` expression. + **/ + ECast(e:Expr, t:Null); + + /** + Used internally to provide completion. + **/ + EDisplay(e:Expr, displayKind:DisplayKind); + + /** + A `(econd) ? eif : eelse` expression. + **/ + ETernary(econd:Expr, eif:Expr, eelse:Expr); + + /** + A `(e:t)` expression. + **/ + ECheckType(e:Expr, t:ComplexType); + + /** + A `@m e` expression. + **/ + EMeta(s:MetadataEntry, e:Expr); + + /** + An `expr is Type` expression. + **/ + EIs(e:Expr, t:ComplexType); +} + +enum DisplayKind { + DKCall; + DKDot; + DKStructure; + DKMarked; + DKPattern(outermost:Bool); +} + +/** + Represents a type syntax in the AST. +**/ +enum ComplexType { + /** + Represents the type path. + **/ + TPath(p:TypePath); + + /** + Represents a function type. + @see https://haxe.org/manual/types-function.html + **/ + TFunction(args:Array, ret:ComplexType); + + /** + Represents an anonymous structure type. + @see https://haxe.org/manual/types-anonymous-structure.html + **/ + TAnonymous(fields:Array); + + /** + Represents parentheses around a type, e.g. the `(Int -> Void)` part in + `(Int -> Void) -> String`. + **/ + TParent(t:ComplexType); + + /** + Represents typedef extensions `> Iterable`. + The array `p` holds the type paths to the given types. + @see https://haxe.org/manual/type-system-extensions.html + **/ + TExtend(p:Array, fields:Array); + + /** + Represents an optional type. + **/ + TOptional(t:ComplexType); + + /** + Represents a type with a name. + **/ + TNamed(n:String, t:ComplexType); + + /** + Represents an intersection type `T1 & T2 & ... & TN`. + **/ + TIntersection(tl:Array); +} + +/** + Represents a type path in the AST. +**/ +typedef TypePath = { + /** + Represents the package of the type path. + **/ + var pack:Array; + + /** + The name of the type path. + **/ + var name:String; + + /** + Optional parameters of the type path. + **/ + var ?params:Array; + + /** + Sub is set on module sub-type access: + `pack.Module.Type` has `name = "Module"`, `sub = "Type"`, if available. + **/ + var ?sub:String; +} + +/** + Represents a concrete type parameter in the AST. + + Haxe allows expressions in concrete type parameters, e.g. + `new YourType<["hello", "world"]>`. In that case the value is `TPExpr` while + in the normal case it's `TPType`. +**/ +enum TypeParam { + TPType(t:ComplexType); + TPExpr(e:Expr); +} + +/** + Represents a type parameter declaration in the AST. +**/ +typedef TypeParamDecl = { + /** + The name of the type parameter. + **/ + var name:String; + + /** + The optional constraints of the type parameter. + **/ + var ?constraints:Array; + + /** + The optional default type of the type parameter. + **/ + var ?defaultType:Null; + + /** + The optional parameters of the type parameter. + **/ + var ?params:Array; + + /** + The metadata of the type parameter. + **/ + var ?meta:Metadata; +} + +/** + Represents a function in the AST. +**/ +typedef Function = { + /** + A list of function arguments. + **/ + var args:Array; + + /** + The return type-hint of the function, if available. + **/ + var ?ret:ComplexType; + + /** + The expression of the function body, if available. + **/ + var ?expr:Expr; + + /** + An optional list of function parameter type declarations. + **/ + var ?params:Array; +} + +/** + Represents a function argument in the AST. +**/ +typedef FunctionArg = { + /** + The name of the function argument. + **/ + var name:String; + + /** + Whether or not the function argument is optional. + **/ + var ?opt:Bool; + + /** + The type-hint of the function argument, if available. + **/ + var ?type:ComplexType; + + /** + The optional value of the function argument, if available. + **/ + var ?value:Expr; + + /** + The metadata of the function argument. + **/ + var ?meta:Metadata; +} + +/** + Represents a metadata entry in the AST. +**/ +typedef MetadataEntry = { + /** + The name of the metadata entry. + **/ + var name:String; + + /** + The optional parameters of the metadata entry. + **/ + var ?params:Array; + + /** + The position of the metadata entry. + **/ + var pos:Position; +} + +/** + Represents metadata in the AST. +**/ +typedef Metadata = Array; + +/** + Represents a field in the AST. +**/ +typedef Field = { + /** + The name of the field. + **/ + var name:String; + + /** + The documentation of the field, if available. If the field has no + documentation, the value is `null`. + **/ + var ?doc:String; + + /** + The access modifiers of the field. By default fields have private access. + @see https://haxe.org/manual/class-field-access-modifier.html + **/ + var ?access:Array; + + /** + The kind of the field. + **/ + var kind:FieldType; + + /** + The position of the field. + **/ + var pos:Position; + + /** + The optional metadata of the field. + **/ + var ?meta:Metadata; +} + +/** + Represents an access modifier. + @see https://haxe.org/manual/class-field-access-modifier.html +**/ +enum Access { + /** + Public access modifier, grants access from anywhere. + @see https://haxe.org/manual/class-field-visibility.html + **/ + APublic; + + /** + Private access modifier, grants access to class and its sub-classes + only. + @see https://haxe.org/manual/class-field-visibility.html + **/ + APrivate; + + /** + Static access modifier. + **/ + AStatic; + + /** + Override access modifier. + @see https://haxe.org/manual/class-field-override.html + **/ + AOverride; + + /** + Dynamic (re-)bindable access modifier. + @see https://haxe.org/manual/class-field-dynamic.html + **/ + ADynamic; + + /** + Inline access modifier. Allows expressions to be directly inserted in + place of calls to them. + @see https://haxe.org/manual/class-field-inline.html + **/ + AInline; + + /** + Macro access modifier. Allows expression macro functions. These are + normal functions which are executed as soon as they are typed. + **/ + AMacro; + + /** + Final access modifier. For functions, they can not be overridden. For + variables, it means they can be assigned to only once. + **/ + AFinal; + + /** + Extern access modifier. + **/ + AExtern; + + /** + Abstract access modifier. + **/ + AAbstract; + + /** + Overload access modifier. + **/ + AOverload; + + /** + Enum access modifier. + **/ + AEnum; +} + +/** + Represents the field type in the AST. +**/ +enum FieldType { + /** + Represents a variable field type. + **/ + FVar(t:Null, ?e:Expr); + + /** + Represents a function field type. + **/ + FFun(f:Function); + + /** + Represents a property with getter and setter field type. + **/ + FProp(get:String, set:String, ?t:ComplexType, ?e:Expr); +} + +/** + Represents a type definition. +**/ +typedef TypeDefinition = { + /** + The package of the type definition. + **/ + var pack:Array; + + /** + The name of the type definition. + **/ + var name:String; + + /** + The documentation of the type, if available. If the type has no + documentation, the value is `null`. + **/ + var ?doc:String; + + /** + The position to the type definition. + **/ + var pos:Position; + + /** + The optional metadata of the type definition. + **/ + var ?meta:Metadata; + + /** + The parameter type declarations of the type definition. + **/ + var ?params:Array; + + /** + Whether or not the type is extern. + **/ + var ?isExtern:Bool; + + /** + The kind of the type definition. + **/ + var kind:TypeDefKind; + + /** + The fields of the type definition. + **/ + var fields:Array; +} + +/** + Represents a type definition kind. +**/ +enum TypeDefKind { + /** + Represents an enum kind. + **/ + TDEnum; + + /** + Represents a structure kind. + **/ + TDStructure; + + /** + Represents a class kind. + **/ + TDClass(?superClass:TypePath, ?interfaces:Array, ?isInterface:Bool, ?isFinal:Bool, ?isAbstract:Bool); + + /** + Represents an alias/typedef kind. + **/ + TDAlias(t:ComplexType); // ignore TypeDefinition.fields + + /** + Represents an abstract kind. + **/ + TDAbstract(tthis:Null, ?flags:Array, ?from:Array, ?to:Array); + + /** + Represents a module-level field. + **/ + TDField(kind:FieldType, ?access:Array); // ignore TypeDefinition.fields + +} + +/** + Represents an abstract flag. +**/ +enum AbstractFlag { + /** + Indicates that this abstract is an `enum abstract` + **/ + AbEnum; + + /** + Indicates that this abstract can be assigned from `ct`. + This flag can be added several times to add multiple "from" types. + **/ + AbFrom(ct:ComplexType); + + /** + Indicates that this abstract can be assigned to `ct`. + This flag can be added several times to add multiple "to" types. + **/ + AbTo(ct:ComplexType); +} + +/** + This error can be used to handle or produce compilation errors in macros. +**/ +class Error extends Exception { + /** + The position of the error. + **/ + public var pos:Position; + + /** + Child error messages, if any. + **/ + private var childErrors:Array; + + /** + Instantiates an error with given message and position. + **/ + public function new(message:String, pos:Position, ?previous:Exception) { + super(message, previous); + this.pos = pos; + } +} + +/** + Represents the import mode. + @see https://haxe.org/manual/type-system-import.html +**/ +enum ImportMode { + /** + Represents a default import `import c`. + **/ + INormal; + + /** + Represents the alias import `import c as alias`. + **/ + IAsName(alias:String); + + /** + Represents the wildcard import `import *`. + **/ + IAll; +} + +/** + Represents the import expression. +**/ +typedef ImportExpr = { + /** + The path to the import expression. + **/ + var path:Array<{pos:Position, name:String}>; + + /** + The mode of the import expression. + **/ + var mode:ImportMode; +} diff --git a/build/linux64_569e52e/std/haxe/macro/ExprTools.hx b/build/linux64_569e52e/std/haxe/macro/ExprTools.hx new file mode 100644 index 0000000..4eac236 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/macro/ExprTools.hx @@ -0,0 +1,314 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.macro; + +import haxe.macro.Expr; + +using Lambda; + +/** + This class provides some utility methods to work with expressions. It is + best used through 'using haxe.macro.ExprTools' syntax and then provides + additional methods on haxe.macro.Expr instances. + + While mainly intended to be used in macros, it works in non-macro code as + well. +**/ +class ExprTools { + /** + Converts expression `e` to a human-readable String representation. + + The result is guaranteed to be valid Haxe code, but there may be + differences from the original lexical syntax. + **/ + static public function toString(e:Expr):String + return new Printer().printExpr(e); + + /** + Calls function `f` on each sub-expression of `e`. + + If `e` has no sub-expressions, this operation has no effect. + + Otherwise `f` is called once per sub-expression of `e`, with the + sub-expression as argument. These calls are done in order of the + sub-expression declarations. + + This method does not call itself recursively. It should instead be used + in a recursive function which handles the expression nodes of interest. + + Usage example: + ```haxe + function findStrings(e:Expr) { + switch(e.expr) { + case EConst(CString(s)): + // handle s + case _: + ExprTools.iter(e, findStrings); + } + } + ``` + **/ + static public function iter(e:Expr, f:Expr->Void):Void { + switch (e.expr) { + case EConst(_), EContinue, EBreak: + case EField(e, _), EParenthesis(e), EUntyped(e), EThrow(e), EDisplay(e, _), ECheckType(e, _), EUnop(_, _, e), ECast(e, _), EIs(e, _) | EMeta(_, e): + f(e); + case EArray(e1, e2), EWhile(e1, e2, _), EBinop(_, e1, e2), EFor(e1, e2): + f(e1); + f(e2); + case EVars(vl): + for (v in vl) + opt2(v.expr, f); + case ETry(e, cl): + f(e); + for (c in cl) + f(c.expr); + case ETernary(e1, e2, e3) | EIf(e1, e2, e3): + f(e1); + f(e2); + opt2(e3, f); + case EArrayDecl(el), ENew(_, el), EBlock(el): + ExprArrayTools.iter(el, f); + case EObjectDecl(fl): + for (fd in fl) + f(fd.expr); + case ECall(e, el): + f(e); + ExprArrayTools.iter(el, f); + case EReturn(e): + opt2(e, f); + case EFunction(_, func): + for (arg in func.args) + opt2(arg.value, f); + opt2(func.expr, f); + case ESwitch(e, cl, edef): + f(e); + for (c in cl) { + ExprArrayTools.iter(c.values, f); + opt2(c.guard, f); + opt2(c.expr, f); + } + if (edef != null && edef.expr != null) + f(edef); + } + } + + /** + Transforms the sub-expressions of `e` by calling `f` on each of them. + + If `e` has no sub-expressions, this operation returns `e` unchanged. + + Otherwise `f` is called once per sub-expression of `e`, with the + sub-expression as argument. These calls are done in order of the + sub-expression declarations. + + This method does not call itself recursively. It should instead be used + in a recursive function which handles the expression nodes of interest. + + Usage example: + ```haxe + function capitalizeStrings(e:Expr) { + return switch(e.expr) { + case EConst(CString(s)): + { expr: EConst(CString(s.toUpperCase())), pos: e.pos }; + case _: + ExprTools.map(e, capitalizeStrings); + } + } + ``` + **/ + static public function map(e:Expr, f:Expr->Expr):Expr { + return { + pos: e.pos, + expr: switch (e.expr) { + case EConst(_): e.expr; + case EArray(e1, e2): EArray(f(e1), f(e2)); + case EBinop(op, e1, e2): EBinop(op, f(e1), f(e2)); + case EField(e, field, kind): EField(f(e), field, kind); + case EParenthesis(e): EParenthesis(f(e)); + case EObjectDecl(fields): + var ret = []; + for (field in fields) + ret.push({field: field.field, expr: f(field.expr), quotes: field.quotes}); + EObjectDecl(ret); + case EArrayDecl(el): EArrayDecl(ExprArrayTools.map(el, f)); + case ECall(e, params): ECall(f(e), ExprArrayTools.map(params, f)); + case ENew(tp, params): ENew(tp, ExprArrayTools.map(params, f)); + case EUnop(op, postFix, e): EUnop(op, postFix, f(e)); + case EVars(vars): + var ret = []; + for (v in vars) { + var v2:Var = {name: v.name, type: v.type, expr: opt(v.expr, f)}; + if (v.isFinal != null) + v2.isFinal = v.isFinal; + ret.push(v2); + } + EVars(ret); + case EBlock(el): EBlock(ExprArrayTools.map(el, f)); + case EFor(it, expr): EFor(f(it), f(expr)); + case EIf(econd, eif, eelse): EIf(f(econd), f(eif), opt(eelse, f)); + case EWhile(econd, e, normalWhile): EWhile(f(econd), f(e), normalWhile); + case EReturn(e): EReturn(opt(e, f)); + case EUntyped(e): EUntyped(f(e)); + case EThrow(e): EThrow(f(e)); + case ECast(e, t): ECast(f(e), t); + case EIs(e, t): EIs(f(e), t); + case EDisplay(e, dk): EDisplay(f(e), dk); + case ETernary(econd, eif, eelse): ETernary(f(econd), f(eif), f(eelse)); + case ECheckType(e, t): ECheckType(f(e), t); + case EContinue, EBreak: + e.expr; + case ETry(e, catches): + var ret = []; + for (c in catches) + ret.push({name: c.name, type: c.type, expr: f(c.expr)}); + ETry(f(e), ret); + case ESwitch(e, cases, edef): + var ret = []; + for (c in cases) + ret.push({expr: opt(c.expr, f), guard: opt(c.guard, f), values: ExprArrayTools.map(c.values, f)}); + ESwitch(f(e), ret, edef == null || edef.expr == null ? edef : f(edef)); + case EFunction(kind, func): + var ret = []; + for (arg in func.args) + ret.push({ + name: arg.name, + opt: arg.opt, + type: arg.type, + value: opt(arg.value, f) + }); + EFunction(kind, { + args: ret, + ret: func.ret, + params: func.params, + expr: f(func.expr) + }); + case EMeta(m, e): EMeta(m, f(e)); + } + }; + } + + /** + Returns the value `e` represents. + + Supported expressions are: + + - `Int`, `Float` and `String` literals + - identifiers `true`, `false` and `null` + - structure declarations if all their fields are values + - array declarations if all their elements are values + - unary operators `-`, `!` and `~` if the operand is a value + - binary operators except `=>`, `...` and assignments + + Parentheses, metadata and the `untyped` keyword are ignored. + + If any non-value is encountered, an exception of type `String` is + thrown. + + If `e` is null, the result is unspecified. + **/ + static public function getValue(e:Expr):Dynamic { + return switch (e.expr) { + case EConst(CInt(v)): Std.parseInt(v); + case EConst(CFloat(v)): Std.parseFloat(v); + case EConst(CString(s)): s; + case EConst(CIdent("true")): true; + case EConst(CIdent("false")): false; + case EConst(CIdent("null")): null; + case EParenthesis(e1) | EUntyped(e1) | EMeta(_, e1): getValue(e1); + case EObjectDecl(fields): + var obj = {}; + for (field in fields) { + Reflect.setField(obj, field.field, getValue(field.expr)); + } + obj; + case EArrayDecl(el): el.map(getValue); + case EIf(econd, eif, eelse) | ETernary(econd, eif, eelse): + if (eelse == null) { + throw "If statements only have a value if the else clause is defined"; + } else { + var econd:Dynamic = getValue(econd); + econd ? getValue(eif) : getValue(eelse); + } + case EUnop(op, false, e1): + var e1:Dynamic = getValue(e1); + switch (op) { + case OpNot: !e1; + case OpNeg: -e1; + case OpNegBits: ~e1; + case _: throw 'Unsupported expression: $e'; + } + case EBinop(op, e1, e2): + var e1:Dynamic = getValue(e1); + var e2:Dynamic = getValue(e2); + switch (op) { + case OpAdd: e1 + e2; + case OpSub: e1 - e2; + case OpMult: e1 * e2; + case OpDiv: e1 / e2; + case OpMod: e1 % e2; + case OpEq: e1 == e2; + case OpNotEq: e1 != e2; + case OpLt: e1 < e2; + case OpLte: e1 <= e2; + case OpGt: e1 > e2; + case OpGte: e1 >= e2; + case OpOr: e1 | e2; + case OpAnd: e1 & e2; + case OpXor: e1 ^ e2; + case OpBoolAnd: e1 && e2; + case OpBoolOr: e1 || e2; + case OpShl: e1 << e2; + case OpShr: e1 >> e2; + case OpUShr: e1 >>> e2; + case _: throw 'Unsupported expression: $e'; + } + case _: throw 'Unsupported expression: $e'; + } + } + + static inline function opt(e:Null, f:Expr->Expr):Expr + return e == null ? null : f(e); + + static inline function opt2(e:Null, f:Expr->Void):Void + if (e != null) + f(e); +} + +/** + This class provides functions on expression arrays for convenience. For a + detailed reference on each method, see the documentation of ExprTools. +**/ +class ExprArrayTools { + static public function map(el:Array, f:Expr->Expr):Array { + var ret = []; + for (e in el) + ret.push(f(e)); + return ret; + } + + static public function iter(el:Array, f:Expr->Void):Void { + for (e in el) + f(e); + } +} diff --git a/build/linux64_569e52e/std/haxe/macro/Format.hx b/build/linux64_569e52e/std/haxe/macro/Format.hx new file mode 100644 index 0000000..b556a90 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/macro/Format.hx @@ -0,0 +1,119 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.macro; + +import haxe.macro.Expr; +import haxe.macro.Context; + +/** + The actual macro implemented for Std.format +**/ +class Format { + #if macro + public static function format(estr:Expr) { + var str = switch (estr.expr) { + case EConst(c): switch (c) { + case CString(s): s; + default: null; + } + default: null; + }; + if (str == null) + Context.error("Constant string required", estr.pos); + var pos = Context.getPosInfos(estr.pos); + var min = pos.min; + pos.min++; + var expr = null; + function make(size) { + pos.max = pos.min + size; + var p = Context.makePosition(pos); + pos.min += size; + return p; + } + function add(e) { + if (expr == null) + expr = e; + else + expr = {expr: EBinop(OpAdd, expr, e), pos: Context.makePosition({min: min, max: pos.min, file: pos.file})}; + } + var i = 0, start = 0; + var max = str.length; + while (i < max) { + if (StringTools.fastCodeAt(str, i++) != '$'.code) + continue; + var len = i - start - 1; + if (len > 0 || expr == null) + add({expr: EConst(CString(str.substr(start, len))), pos: make(len)}); + pos.min++; + start = i; + var c = StringTools.fastCodeAt(str, i); + if (c == '{'.code) { + var count = 1; + i++; + while (i < max) { + var c = StringTools.fastCodeAt(str, i++); + if (c == "}".code) { + if (--count == 0) + break; + } else if (c == "{".code) + count++; + } + if (count > 0) + Context.error("Closing brace not found", make(1)); + pos.min++; + start++; + var len = i - start - 1; + var expr = str.substr(start, len); + add(Context.parseInlineString(expr, make(len))); + pos.min++; + start++; + } else if ((c >= 'a'.code && c <= 'z'.code) || (c >= 'A'.code && c <= 'Z'.code) || c == '_'.code) { + i++; + while (true) { + var c = StringTools.fastCodeAt(str, i); + if ((c >= 'a'.code && c <= 'z'.code) || (c >= 'A'.code && c <= 'Z'.code) || (c >= '0'.code && c <= '9'.code) || c == '_'.code) + i++; + else + break; + } + var len = i - start; + var ident = str.substr(start, len); + add({expr: EConst(CIdent(ident)), pos: make(len)}); + } else if (c == '$'.code) { + start = i++; + continue; + } else { + start = i - 1; + continue; + } + start = i; + } + var len = i - start; + if (len > 0) + add({expr: EConst(CString(str.substr(start, len))), pos: make(len)}); + if (expr == null) + expr = {expr: EConst(CString("")), pos: make(0)}; + return {expr: ECheckType(expr, TPath({pack: [], name: "String", params: []})), pos: expr.pos}; + } + #end +} diff --git a/build/linux64_569e52e/std/haxe/macro/JSGenApi.hx b/build/linux64_569e52e/std/haxe/macro/JSGenApi.hx new file mode 100644 index 0000000..9f1fa17 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/macro/JSGenApi.hx @@ -0,0 +1,66 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.macro; + +import haxe.macro.Type; + +/** + This is the api that is passed to the custom JS generator. +**/ +typedef JSGenApi = { + /** the file in which the JS code can be generated **/ + var outputFile:String; + + /** all the types that were compiled by Haxe **/ + var types:Array; + + /** the main call expression, if a -main class is defined **/ + var main:Null; + + /** generate the JS code for any given typed expression **/ + function generateStatement(e:TypedExpr):String; + + /** generate the JS code for a given typed expression-value **/ + function generateValue(e:TypedExpr):String; + + /** define the JS code that gets generated when a class or enum is accessed in a typed expression **/ + function setTypeAccessor(callb:Type->String):Void; + + /** tells if the given identifier is a JS keyword **/ + function isKeyword(ident:String):Bool; + + /** add a feature **/ + function addFeature(f:String):Bool; + + /** check if a feature is used **/ + function hasFeature(f:String):Bool; + + /** quote and escape the given string constant **/ + function quoteString(s:String):String; + + /** create the metadata expression for the given type **/ + function buildMetaData(t:BaseType):Null; + + /** select the current classe **/ + function setCurrentClass(c:ClassType):Void; +} diff --git a/build/linux64_569e52e/std/haxe/macro/MacroStringTools.hx b/build/linux64_569e52e/std/haxe/macro/MacroStringTools.hx new file mode 100644 index 0000000..4922a6f --- /dev/null +++ b/build/linux64_569e52e/std/haxe/macro/MacroStringTools.hx @@ -0,0 +1,100 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.macro; + +import haxe.macro.Expr; + +/** + This class provides some utility methods to work with strings in macro + context. +**/ +class MacroStringTools { + #if macro + /** + Formats `String` `s` using the usual interpolation rules. + + The returned expression is a concatenation of string parts and escaped + elements. + **/ + static public function formatString(s:String, pos:Position):Expr { + #if (neko || eval) + return Context.load("format_string", 2)(s, pos); + #end + } + + /** + Tells if `e` is a format string, i.e. uses single quotes `'` as + delimiters. + **/ + static public function isFormatExpr(e:ExprOf):Bool { + return e.expr.match(EConst(CString(_, SingleQuotes))); + } + #end + + /** + Converts an array of Strings `sl` to a field expression. + + If `sl` has no elements, the result is null. + + If `sl` has one element, the result is `EConst(CIdent(sl[0])`. + + Otherwise the result is a chain of `EField` nodes. + + If `sl` is null, the result is unspecified. + **/ + static public function toFieldExpr(sl:Array, ?pos):Expr { + if (pos == null) + return Lambda.fold(sl, function(s, e) return e == null ? (macro $i{s}) : (macro $e.$s), null); + var e = null; + for (v in sl) + if (e == null) + e = {expr: EConst(CIdent(v)), pos: pos}; + else + e = {expr: EField(e, v), pos: pos}; + return e; + } + + /** + Converts a path given by package `pack` and name `name` to a `String` + separated by dots. + + If `pack` has no elements, the result is `name`. + + If `pack` is null, the result is unspecified. + + Otherwise the elements of `pack` are joined with a separating dot, with + an appended dot separating the result from `name`. + **/ + static public function toDotPath(pack:Array, name:String):String { + return if (pack.length == 0) name else pack.join(".") + "." + name; + } + + static public function toComplex(path:String):ComplexType { + var pack = path.split("."); + if(pack.length >= 2 && ~/^[A-Z]/.match(pack[pack.length - 2])) { + return TPath({pack: pack, sub: pack.pop(), name: pack.pop(), params: []}); + } else { + return TPath({pack: pack, name: pack.pop(), params: []}); + } + } +} diff --git a/build/linux64_569e52e/std/haxe/macro/MacroType.hx b/build/linux64_569e52e/std/haxe/macro/MacroType.hx new file mode 100644 index 0000000..c9340e5 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/macro/MacroType.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.macro; + +/** + This type is meant to be used to generate custom types using a macro. + For instance by doing MacroType<[my.Class.myMacro(55)]> +**/ +extern class MacroType {} diff --git a/build/linux64_569e52e/std/haxe/macro/PlatformConfig.hx b/build/linux64_569e52e/std/haxe/macro/PlatformConfig.hx new file mode 100644 index 0000000..787e880 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/macro/PlatformConfig.hx @@ -0,0 +1,201 @@ +package haxe.macro; + +import haxe.macro.Expr; + +/** + Represents the internal structure generated with options assigned based on + the target platform. + + Warning: `PlatformConfig` and the typedefs unique to its fields correspond to + compiler-internal data structures and might change in minor Haxe releases in + order to adapt to internal changes. +**/ +typedef PlatformConfig = { + /** + Has a static type system, with not-nullable basic types (Int/Float/Bool) + **/ + final staticTypeSystem:Bool; + + /** + Has access to the "sys" package + **/ + final sys:Bool; + + /** + Captured variables handling (see before) + **/ + final capturePolicy:CapturePolicy; + + /** + When calling a method with optional args, do we replace the missing args with "null" constants + **/ + final padNulls:Bool; + + /** + Add a final return to methods not having one already - prevent some compiler warnings + **/ + final addFinalReturn:Bool; + + /** + Does the platform natively support overloaded functions + **/ + final overloadFunctions:Bool; + + /** + Type paths that are reserved on the platform + **/ + final reservedTypePaths:Array; + + /** + Supports function == function + **/ + final supportsFunctionEquality:Bool; + + /** + Uses utf16 encoding with ucs2 api + **/ + final usesUtf16:Bool; + + /** + Target supports accessing `this` before calling `super(...)` + **/ + final thisBeforeSuper:Bool; + + /** + Target supports threads + **/ + final supportsThreads:Bool; + + /** + Target supports Unicode + **/ + final supportsUnicode:Bool; + + /** + Target supports rest arguments + **/ + final supportsRestArgs:Bool; + + /** + Exceptions handling config + **/ + final exceptions:ExceptionsConfig; + + /** + The scoping of local variables + **/ + final scoping:VarScopingConfig; + + /** + Target supports atomic operations via haxe.Atomic + **/ + final supportsAtomics:Bool; + +} + +enum CapturePolicy { + /** + Do nothing, let the platform handle it + **/ + None; + + /** + Wrap all captured variables into a single-element array to allow modifications + **/ + WrapRef; + + /** + Similar to wrap ref, but will only apply to the locals that are declared in loops + **/ + LoopVars; +} + +typedef VarScopingConfig = { + final scope:VarScope; + final flags:Array; +} + +enum VarScope { + FunctionScope; + BlockScope; +} + +enum VarScopingFlags { + /** + Variables are hoisted in their scope + **/ + VarHoisting; + + /** + It's not allowed to shadow existing variables in a scope. + **/ + NoShadowing; + + /** + It's not allowed to shadow a `catch` variable. + **/ + NoCatchVarShadowing; + + /** + Local vars cannot have the same name as the current top-level package or + (if in the root package) current class name + **/ + ReserveCurrentTopLevelSymbol; + + /** + Local vars cannot have a name used for any top-level symbol + (packages and classes in the root package) + **/ + ReserveAllTopLevelSymbols; + + /** + Reserve all type-paths converted to "flat path" with `Path.flat_path` + **/ + ReserveAllTypesFlat; + + /** + List of names cannot be taken by local vars + **/ + ReserveNames(names:Array); + + /** + Cases in a `switch` won't have blocks, but will share the same outer scope. + **/ + SwitchCasesNoBlocks; +} + +typedef ExceptionsConfig = { + /** + Base types which may be thrown from Haxe code without wrapping. + **/ + final nativeThrows:Array; + + /** + Base types which may be caught from Haxe code without wrapping. + **/ + final nativeCatches:Array; + + /** + Hint exceptions filter to avoid wrapping for targets, which can throw/catch any type + Ignored on targets with a specific native base type for exceptions. + **/ + final avoidWrapping:Bool; + + /** + Path of a native class or interface, which can be used for wildcard catches. + **/ + final wildcardCatch:TypePath; + + /** + Path of a native base class or interface, which can be thrown. + This type is used to cast `haxe.Exception.thrown(v)` calls to. + For example `throw 123` is compiled to `throw (cast Exception.thrown(123):ec_base_throw)` + **/ + final baseThrow:TypePath; + + /** + Checks if throwing this expression is a special case for current target + and should not be modified. + **/ + // final specialThrow:(TypedExpr)->Bool; +} diff --git a/build/linux64_569e52e/std/haxe/macro/PositionTools.hx b/build/linux64_569e52e/std/haxe/macro/PositionTools.hx new file mode 100644 index 0000000..f29300f --- /dev/null +++ b/build/linux64_569e52e/std/haxe/macro/PositionTools.hx @@ -0,0 +1,74 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.macro; + +import haxe.display.Position.Location; +import haxe.macro.Expr; + +class PositionTools { + /** + Returns the `Position` where the caller of `here` is. + **/ + macro public static function here():ExprOf { + var positionExpr = Context.makeExpr(Context.getPosInfos(Context.currentPos()), Context.currentPos()); + if (Context.defined("macro")) { + return macro haxe.macro.Context.makePosition($positionExpr); + } else { + return positionExpr; + } + } + + /** + Like `Context.getPosInfos`, except this method is available on all platforms. + **/ + public static function getInfos(p:Position):{min:Int, max:Int, file:String} { + #if macro + return Context.getPosInfos(p); + #else + return p; + #end + } + + /** + Like `Context.makePosition`, except this method is available on all platforms. + **/ + public static function make(inf:{min:Int, max:Int, file:String}):Position { + #if macro + return Context.makePosition(inf); + #else + return inf; + #end + } + + #if macro + /** + Converts a `haxe.macro.Position` to a `haxe.display.Position.Location`. + + This operation requires the source file the be known to the Haxe lexer in order + to determine line breaks. It is thus only available in macro context. + **/ + public static function toLocation(p:Position):Location { + return Context.load("position_to_range", 1)(p); + } + #end +} diff --git a/build/linux64_569e52e/std/haxe/macro/Printer.hx b/build/linux64_569e52e/std/haxe/macro/Printer.hx new file mode 100644 index 0000000..bce266f --- /dev/null +++ b/build/linux64_569e52e/std/haxe/macro/Printer.hx @@ -0,0 +1,592 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.macro; + +import haxe.macro.Expr; + +using Lambda; +using StringTools; + +/** + This class provides some utility methods to convert elements from the + macro context to a human-readable String representation. + */ +class Printer { + var tabs:String; + var tabString:String; + + public function new(?tabString = "\t") { + tabs = ""; + this.tabString = tabString; + } + + public function printUnop(op:Unop) + return switch (op) { + case OpIncrement: "++"; + case OpDecrement: "--"; + case OpNot: "!"; + case OpNeg: "-"; + case OpNegBits: "~"; + case OpSpread: "..."; + } + + public function printBinop(op:Binop) + return switch (op) { + case OpAdd: "+"; + case OpMult: "*"; + case OpDiv: "/"; + case OpSub: "-"; + case OpAssign: "="; + case OpEq: "=="; + case OpNotEq: "!="; + case OpGt: ">"; + case OpGte: ">="; + case OpLt: "<"; + case OpLte: "<="; + case OpAnd: "&"; + case OpOr: "|"; + case OpXor: "^"; + case OpBoolAnd: "&&"; + case OpBoolOr: "||"; + case OpShl: "<<"; + case OpShr: ">>"; + case OpUShr: ">>>"; + case OpMod: "%"; + case OpInterval: "..."; + case OpArrow: "=>"; + case OpIn: "in"; + case OpNullCoal: "??"; + case OpAssignOp(op): + printBinop(op) + "="; + } + + function escapeString(s:String, delim:String) { + return delim + + s.replace('\\', '\\\\') + .replace("\n", "\\n") + .replace("\t", "\\t") + .replace("\r", "\\r") + .replace("'", "\\'") + .replace('"', "\\\"") #if sys .replace("\x00", "\\x00") #end + delim; + } + + public function printFormatString(s:String) { + return escapeString(s, "'"); + } + + public function printString(s:String) { + return escapeString(s, '"'); + } + + public function printConstant(c:Constant) + return switch (c) { + case CString(s, SingleQuotes): printFormatString(s); + case CString(s, _): printString(s); + case CIdent(s), CInt(s, null), CFloat(s, null): + s; + case CInt(s, suffix), CFloat(s, suffix): + s + suffix; + case CRegexp(s, opt): '~/$s/$opt'; + } + + public function printTypeParam(param:TypeParam) + return switch (param) { + case TPType(ct): printComplexType(ct); + case TPExpr(e): printExpr(e); + } + + public function printTypePath(tp:TypePath) + return (tp.pack.length > 0 ? tp.pack.join(".") + "." : "") + + tp.name + + (tp.sub != null ? '.${tp.sub}' : "") + + (tp.params == null ? "" : tp.params.length > 0 ? "<" + tp.params.map(printTypeParam).join(", ") + ">" : ""); + + // TODO: check if this can cause loops + public function printComplexType(ct:ComplexType) + return switch (ct) { + case TPath(tp): printTypePath(tp); + case TFunction(args, ret): + var wrapArgumentsInParentheses = switch args { + // type `:(a:X) -> Y` has args as [TParent(TNamed(...))], i.e `a:X` gets wrapped in `TParent()`. We don't add parentheses to avoid printing `:((a:X)) -> Y` + case [TParent(t)]: false; + // this case catches a single argument that's a type-path, so that `X -> Y` prints `X -> Y` not `(X) -> Y` + case [TPath(_) | TOptional(TPath(_))]: false; + default: true; + } + var argStr = args.map(printComplexType).join(", "); + (wrapArgumentsInParentheses ? '($argStr)' : argStr) + " -> " + (switch ret { + // wrap return type in parentheses if it's also a function + case TFunction(_): '(${printComplexType(ret)})'; + default: (printComplexType(ret) : String); + }); + case TAnonymous(fields): "{ " + [for (f in fields) printField(f) + "; "].join("") + "}"; + case TParent(ct): "(" + printComplexType(ct) + ")"; + case TOptional(ct): "?" + printComplexType(ct); + case TNamed(n, ct): n + ":" + printComplexType(ct); + case TExtend(tpl, fields): + var types = [for (t in tpl) "> " + printTypePath(t) + ", "].join(""); + var fields = [for (f in fields) printField(f) + "; "].join(""); + '{${types}${fields}}'; + case TIntersection(tl): tl.map(printComplexType).join(" & "); + } + + public function printMetadata(meta:MetadataEntry) + return '@${meta.name}' + ((meta.params != null && meta.params.length > 0) ? '(${printExprs(meta.params, ", ")})' : ""); + + public function printAccess(access:Access) + return switch (access) { + case AStatic: "static"; + case APublic: "public"; + case APrivate: "private"; + case AOverride: "override"; + case AInline: "inline"; + case ADynamic: "dynamic"; + case AMacro: "macro"; + case AFinal: "final"; + case AExtern: "extern"; + case AAbstract: "abstract"; + case AOverload: "overload"; + case AEnum: "enum"; + } + + public function printField(field:Field) { + inline function orderAccess(access:Array) { + // final should always be printed last + // (does not modify input array) + return access.has(AFinal) ? access.filter(a -> !a.match(AFinal)).concat([AFinal]) : access; + } + return (field.doc != null + && field.doc != "" ? "/**\n" + + tabs + + tabString + + StringTools.replace(field.doc, "\n", "\n" + tabs + tabString) + + "\n" + + tabs + + "**/\n" + + tabs : "") + + (field.meta != null && field.meta.length > 0 ? field.meta.map(printMetadata).join('\n$tabs') + '\n$tabs' : "") + + (field.access != null && field.access.length > 0 ? orderAccess(field.access).map(printAccess).join(" ") + " " : "") + + switch (field.kind) { + case FVar(t, + eo): ((field.access != null && field.access.has(AFinal)) ? '' : 'var ') + + '${field.name}' + + opt(t, printComplexType, " : ") + + opt(eo, printExpr, " = "); + case FProp(get, set, t, eo): 'var ${field.name}($get, $set)' + opt(t, printComplexType, " : ") + opt(eo, printExpr, " = "); + case FFun(func): 'function ${field.name}' + printFunction(func); + }} + + public function printTypeParamDecl(tpd:TypeParamDecl) + return (tpd.meta != null && tpd.meta.length > 0 ? tpd.meta.map(printMetadata).join(" ") + " " : "") + + tpd.name + + (tpd.params != null && tpd.params.length > 0 ? "<" + tpd.params.map(printTypeParamDecl).join(", ") + ">" : "") + + (tpd.constraints != null && tpd.constraints.length > 0 ? ":(" + tpd.constraints.map(printComplexType).join(" & ") + ")" : "") + + (tpd.defaultType != null ? "=" + printComplexType(tpd.defaultType) : ""); + + public function printFunctionArg(arg:FunctionArg) + return (arg.opt ? "?" : "") + arg.name + opt(arg.type, printComplexType, ":") + opt(arg.value, printExpr, " = "); + + public function printFunction(func:Function, ?kind:FunctionKind) { + var skipParentheses = switch func.args { + case [{type: null}]: kind == FArrow; + case _: false; + } + return (func.params == null ? "" : func.params.length > 0 ? "<" + func.params.map(printTypeParamDecl).join(", ") + ">" : "") + + (skipParentheses ? "" : "(") + + func.args.map(printFunctionArg).join(", ") + + (skipParentheses ? "" : ")") + + (kind == FArrow ? " ->" : "") + + opt(func.ret, printComplexType, ":") + + opt(func.expr, printExpr, " "); + } + + public function printVar(v:Var) { + var s = v.name + opt(v.type, printComplexType, ":") + opt(v.expr, printExpr, " = "); + return switch v.meta { + case null | []: s; + case meta: meta.map(printMetadata).join(" ") + " " + s; + } + } + + public function printObjectFieldKey(of:ObjectField) { + return switch (of.quotes) { + case null | Unquoted: of.field; + case Quoted: '"${of.field}"'; // TODO: Have to escape that? + } + } + + public function printObjectField(of:ObjectField) { + return '${printObjectFieldKey(of)} : ${printExpr(of.expr)}'; + } + + public function printExpr(e:Expr) + return e == null ? "#NULL" : switch (e.expr) { + case EConst(c): printConstant(c); + case EArray(e1, e2): '${printExpr(e1)}[${printExpr(e2)}]'; + case EBinop(op, e1, e2): '${printExpr(e1)} ${printBinop(op)} ${printExpr(e2)}'; + case EField(e1, n, kind): kind == Safe ? '${printExpr(e1)}?.$n' : '${printExpr(e1)}.$n'; + case EParenthesis(e1): '(${printExpr(e1)})'; + case EObjectDecl(fl): + "{ " + fl.map(function(fld) return printObjectField(fld)).join(", ") + " }"; + case EArrayDecl(el): '[${printExprs(el, ", ")}]'; + case ECall(e1, el): '${printExpr(e1)}(${printExprs(el, ", ")})'; + case ENew(tp, el): 'new ${printTypePath(tp)}(${printExprs(el, ", ")})'; + case EUnop(op, true, e1): printExpr(e1) + printUnop(op); + case EUnop(op, false, e1): printUnop(op) + printExpr(e1); + case EFunction(FNamed(no, inlined), func): (inlined ? 'inline ' : '') + 'function $no' + printFunction(func); + case EFunction(kind, func): (kind != FArrow ? "function" : "") + printFunction(func, kind); + case EVars([]): "var "; + case EVars(vl): ((vl[0].isStatic) ? "static " : "") + ((vl[0].isFinal) ? "final " : "var ") + vl.map(printVar).join(", "); + case EBlock([]): '{ }'; + case EBlock(el): + var old = tabs; + tabs += tabString; + var s = '{\n$tabs' + printExprs(el, ';\n$tabs'); + tabs = old; + s + ';\n$tabs}'; + case EFor(e1, e2): 'for (${printExpr(e1)}) ${printExpr(e2)}'; + case EIf(econd, eif, null): 'if (${printExpr(econd)}) ${printExpr(eif)}'; + case EIf(econd, eif, eelse): 'if (${printExpr(econd)}) ${printExpr(eif)} else ${printExpr(eelse)}'; + case EWhile(econd, e1, true): 'while (${printExpr(econd)}) ${printExpr(e1)}'; + case EWhile(econd, e1, false): 'do ${printExpr(e1)} while (${printExpr(econd)})'; + case ESwitch(e1, cl, edef): + var old = tabs; + tabs += tabString; + var s = 'switch ${printExpr(e1)} {\n$tabs' + + cl.map(function(c) return 'case ${printExprs(c.values, ", ")}' + (c.guard != null ? ' if (${printExpr(c.guard)}):' : ":") + + (c.expr != null ? (opt(c.expr, printExpr)) + ";" : "")) + .join('\n$tabs'); + if (edef != null) + s += '\n${tabs}default:' + (edef.expr == null ? "" : printExpr(edef) + ";"); + tabs = old; + s + '\n$tabs}'; + case ETry(e1, cl): + 'try ${printExpr(e1)}' + cl.map(function(c) return + ' catch(${c.name}${c.type == null ? '' : (':' + printComplexType(c.type))}) ${printExpr(c.expr)}') + .join(""); + case EReturn(eo): "return" + opt(eo, printExpr, " "); + case EBreak: "break"; + case EContinue: "continue"; + case EUntyped(e1): "untyped " + printExpr(e1); + case EThrow(e1): "throw " + printExpr(e1); + case ECast(e1, cto) if (cto != null): 'cast(${printExpr(e1)}, ${printComplexType(cto)})'; + case ECast(e1, _): "cast " + printExpr(e1); + case EIs(e1, ct): '${printExpr(e1)} is ${printComplexType(ct)}'; + case EDisplay(e1, _): '#DISPLAY(${printExpr(e1)})'; + case ETernary(econd, eif, eelse): '${printExpr(econd)} ? ${printExpr(eif)} : ${printExpr(eelse)}'; + case ECheckType(e1, ct): '(${printExpr(e1)} : ${printComplexType(ct)})'; + case EMeta({name: ":implicitReturn"}, {expr: EReturn(e1)}): printExpr(e1); + case EMeta(meta, e1): printMetadata(meta) + " " + printExpr(e1); + } + + public function printExprs(el:Array, sep:String) { + return el.map(printExpr).join(sep); + } + + function printExtension(tpl:Array, fields:Array) { + return '{\n$tabs>' + + tpl.map(printTypePath).join(',\n$tabs>') + + "," + + (fields.length > 0 ? ('\n$tabs' + fields.map(printField).join(';\n$tabs') + ";\n}") : ("\n}")); + } + + function printStructure(fields:Array) { + return fields.length == 0 ? "{ }" : '{\n$tabs' + fields.map(printField).join(';\n$tabs') + ";\n}"; + } + + public function printTypeDefinition(t:TypeDefinition, printPackage = true):String { + var old = tabs; + tabs = tabString; + + var str = t == null ? "#NULL" : (printPackage && t.pack.length > 0 && t.pack[0] != "" ? "package " + t.pack.join(".") + ";\n" : "") + + (t.doc != null && t.doc != "" ? "/**\n" + tabString + StringTools.replace(t.doc, "\n", "\n" + tabString) + "\n**/\n" : "") + + (t.meta != null && t.meta.length > 0 ? t.meta.map(printMetadata).join(" ") + " " : "") + + (t.isExtern ? "extern " : "") + + switch (t.kind) { + case TDEnum: + "enum " + + t.name + + ((t.params != null && t.params.length > 0) ? "<" + t.params.map(printTypeParamDecl).join(", ") + ">" : "") + + " {\n" + + [ + for (field in t.fields) + tabs + + (field.doc != null + && field.doc != "" ? "/**\n" + + tabs + + tabString + + StringTools.replace(field.doc, "\n", "\n" + tabs + tabString) + + "\n" + + tabs + + "**/\n" + + tabs : "") + + (field.meta != null && field.meta.length > 0 ? field.meta.map(printMetadata).join(" ") + " " : "") + + (switch (field.kind) { + case FVar(t, _): field.name + opt(t, printComplexType, ":"); + case FProp(_, _, _, _): throw "FProp is invalid for TDEnum."; + case FFun(func): field.name + printFunction(func); + }) + + ";"].join("\n") + "\n}"; + case TDStructure: + "typedef " + + t.name + + ((t.params != null && t.params.length > 0) ? "<" + t.params.map(printTypeParamDecl).join(", ") + ">" : "") + + " = {\n" + + [ + for (f in t.fields) { + tabs + printField(f) + ";"; + } + ].join("\n") + "\n}"; + case TDClass(superClass, interfaces, isInterface, isFinal, isAbstract): + (isFinal ? "final " : "") + + (isAbstract ? "abstract " : "") + + (isInterface ? "interface " : "class ") + + t.name + + (t.params != null && t.params.length > 0 ? "<" + t.params.map(printTypeParamDecl).join(", ") + ">" : "") + + (superClass != null ? " extends " + printTypePath(superClass) : "") + + (interfaces != null ? (isInterface ? [for (tp in interfaces) " extends " + printTypePath(tp)] : [ + for (tp in interfaces) + " implements " + printTypePath(tp) + ]).join("") : "") + + " {\n" + + [ + for (f in t.fields) { + tabs + printFieldWithDelimiter(f); + } + ].join("\n") + "\n}"; + case TDAlias(ct): + "typedef " + + t.name + + ((t.params != null && t.params.length > 0) ? "<" + t.params.map(printTypeParamDecl).join(", ") + ">" : "") + + " = " + + (switch (ct) { + case TExtend(tpl, fields): printExtension(tpl, fields); + case TAnonymous(fields): printStructure(fields); + case _: printComplexType(ct); + }) + + ";"; + case TDAbstract(tthis, tflags, from, to): + var from = from == null ? [] : from.copy(); + var to = to == null ? [] : to.copy(); + var isEnum = false; + + if (tflags != null) { + for (flag in tflags) { + switch (flag) { + case AbEnum: isEnum = true; + case AbFrom(ct): from.push(ct); + case AbTo(ct): to.push(ct); + } + } + } + + (isEnum ? "enum " : "") + + "abstract " + + t.name + + ((t.params != null && t.params.length > 0) ? "<" + t.params.map(printTypeParamDecl).join(", ") + ">" : "") + + (tthis == null ? "" : "(" + printComplexType(tthis) + ")") + + [for (f in from) " from " + printComplexType(f)].join("") + + [for (f in to) " to " + printComplexType(f)].join("") + + " {\n" + + [ + for (f in t.fields) { + tabs + printFieldWithDelimiter(f); + } + ].join("\n") + "\n}"; + case TDField(kind, access): + tabs = old; + (access != null && access.length > 0 ? access.map(printAccess).join(" ") + " " : "") + switch (kind) { + case FVar(type, + eo): ((access != null && access.has(AFinal)) ? '' : 'var ') + '${t.name}' + opt(type, printComplexType, " : ") + + opt(eo, printExpr, " = ") + ";"; + case FProp(get, set, type, eo): 'var ${t.name}($get, $set)' + + opt(type, printComplexType, " : ") + + opt(eo, printExpr, " = ") + + ";"; + case FFun(func): 'function ${t.name}' + printFunction(func) + switch func.expr { + case {expr: EBlock(_)}: ""; + case _: ";"; + }; + } + } tabs = old; + + return str; + } + + function printFieldWithDelimiter(f:Field):String { + return printField(f) + switch (f.kind) { + case FVar(_, _), FProp(_, _, _, _): ";"; + case FFun({expr: null}): ";"; + case FFun({expr: {expr: EBlock(_)}}): ""; + case FFun(_): ";"; + case _: ""; + }; + } + + function opt(v:T, f:T->String, prefix = "") + return v == null ? "" : (prefix + f(v)); + + public function printExprWithPositions(e:Expr) { + var buffer = new StringBuf(); + function format4(i:Int) { + return StringTools.lpad(Std.string(i), " ", 4); + } + function loop(tabs:String, e:Expr) { + function add(s:String, ?p = null) { + if (p == null) { + p = e.pos; + } + var p = #if macro haxe.macro.Context.getPosInfos(p) #else e.pos #end; + buffer.add('${format4(p.min)}-${format4(p.max)} $tabs$s\n'); + } + function loopI(e:Expr) + loop(tabs + tabString, e); + switch (e.expr) { + case EConst(c): + add(printConstant(c)); + case EArray(e1, e2): + add("EArray"); + loopI(e1); + loopI(e2); + case EBinop(op, e1, e2): + add("EBinop " + printBinop(op)); + loopI(e1); + loopI(e2); + case EField(e, field, kind): + if (kind == null) kind = Normal; + add('EField $field (${kind.getName()})'); + loopI(e); + case EParenthesis(e): + add("EParenthesis"); + loopI(e); + case EObjectDecl(fields): + add("EObjectDecl"); + for (field in fields) { + add(field.field); // TODO: we don't have the field pos? + loopI(field.expr); + } + case EArrayDecl(values): + add("EArrayDecl"); + values.iter(loopI); + case ECall(e, params): + add("ECall"); + loopI(e); + params.iter(loopI); + case ENew(tp, params): + add("ENew " + printTypePath(tp)); + params.iter(loopI); + case EUnop(op, postFix, e): + add("EUnop " + printUnop(op)); + loopI(e); + case EVars(vars): + add("EVars"); + for (v in vars) { + if (v.expr != null) { + add(v.name); + loopI(v.expr); + } + } + case EFunction(_, f): + add("EFunction"); + if (f.expr != null) { + loopI(f.expr); + } + case EBlock(exprs): + add("EBlock"); + exprs.iter(loopI); + case EFor(it, expr): + add("EFor"); + loopI(it); + loopI(expr); + case EIf(econd, eif, eelse): + add("EIf"); + loopI(econd); + loopI(eif); + if (eelse != null) { + loopI(eelse); + } + case EWhile(econd, e, normalWhile): + add("EWhile"); + loopI(econd); + loopI(e); + case ESwitch(e, cases, edef): + add("ESwitch"); + loopI(e); + for (c in cases) { + for (pat in c.values) { + loop(tabs + tabString + tabString, pat); + } + if (c.expr != null) { + loop(tabs + tabString + tabString + tabString, c.expr); + } + } + if (edef != null) { + loop(tabs + tabString + tabString + tabString, edef); + } + case ETry(e, catches): + add("ETry"); + loopI(e); + for (c in catches) { + loop(tabs + tabString + tabString, c.expr); + } + case EReturn(e): + add("EReturn"); + if (e != null) { + loopI(e); + } + case EBreak: + add("EBreak"); + case EContinue: + add("EContinue"); + case EUntyped(e): + add("EUntyped"); + loopI(e); + case EThrow(e): + add("EThrow"); + loopI(e); + case ECast(e, t): + add("ECast"); + loopI(e); + case EIs(e, t): + add("EIs"); + loopI(e); + case EDisplay(e, displayKind): + add("EDisplay"); + loopI(e); + case ETernary(econd, eif, eelse): + add("ETernary"); + loopI(econd); + loopI(eif); + loopI(eelse); + case ECheckType(e, t): + add("ECheckType"); + loopI(e); + case EMeta(s, e): + add("EMeta " + printMetadata(s)); + loopI(e); + } + } + loop("", e); + return buffer.toString(); + } +} diff --git a/build/linux64_569e52e/std/haxe/macro/Tools.hx b/build/linux64_569e52e/std/haxe/macro/Tools.hx new file mode 100644 index 0000000..89f8beb --- /dev/null +++ b/build/linux64_569e52e/std/haxe/macro/Tools.hx @@ -0,0 +1,54 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.macro; + +/** + This class can be added via `using haxe.macro.Tools` in order to enable + `using` functionality on these macro tool classes: + + - `haxe.macro.ExprTools` + - `haxe.macro.ComplexTypeTools` + - `haxe.macro.TypeTools` + - `haxe.macro.MacroStringTools` + - `haxe.macro.TypedExprTools` + - `haxe.macro.PositionTools` + + @see +**/ +@:dox(hide) +typedef TExprTools = ExprTools; + +@:dox(hide) +typedef TComplexTypeTools = ComplexTypeTools; + +@:dox(hide) +typedef TTypeTools = TypeTools; + +@:dox(hide) +typedef TMacroStringTools = MacroStringTools; + +@:dox(hide) +typedef TTypedExprTools = TypedExprTools; + +@:dox(hide) +typedef TPositionTools = PositionTools; diff --git a/build/linux64_569e52e/std/haxe/macro/Type.hx b/build/linux64_569e52e/std/haxe/macro/Type.hx new file mode 100644 index 0000000..4ee0afe --- /dev/null +++ b/build/linux64_569e52e/std/haxe/macro/Type.hx @@ -0,0 +1,1038 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.macro; + +/* + Warning: Some of these types correspond to compiler-internal data structures + and might change in minor Haxe releases in order to adapt to internal changes. + */ +/** + Represents a reference to internal compiler structure. It exists to avoid + expensive encoding if it is not required and to ensure that physical + equality remains intact. + + A structure is only encoded when user requests it through `ref.get()`. + */ +typedef Ref = { + public function get():T; + public function toString():String; +} + +/** + Represents a type. + */ +enum Type { + /** + Represents a monomorph. + + @see https://haxe.org/manual/types-monomorph.html + **/ + TMono(t:Ref>); + + /** + Represents an enum instance. + + @see https://haxe.org/manual/types-enum-instance.html + **/ + TEnum(t:Ref, params:Array); + + /** + Represents a class instance. + + @see https://haxe.org/manual/types-class-instance.html + **/ + TInst(t:Ref, params:Array); + + /** + Represents a typedef. + + @see https://haxe.org/manual/type-system-typedef.html + **/ + TType(t:Ref, params:Array); + + /** + Represents a function type. + + @see https://haxe.org/manual/types-function.html + **/ + TFun(args:Array<{name:String, opt:Bool, t:Type}>, ret:Type); + + /** + Represents an anonymous structure type. + + @see https://haxe.org/manual/types-anonymous-structure.html + **/ + TAnonymous(a:Ref); + + /** + Represents Dynamic. + + @see https://haxe.org/manual/types-dynamic.html + **/ + TDynamic(t:Null); + + /** + Used internally by the compiler to delay some typing. + **/ + TLazy(f:Void->Type); + + /** + Represents an abstract type. + + @see https://haxe.org/manual/types-abstract.html + **/ + TAbstract(t:Ref, params:Array); +} + +/** + Represents information for anonymous structure types. + */ +typedef AnonType = { + /** + The class fields of the structure. + **/ + var fields:Array; + + /** + The status/kind of the structure. + **/ + var status:AnonStatus; +} + +/** + Represents the kind of the anonymous structure type. +**/ +enum AnonStatus { + /** + A closed structure is considered complete. That is, no further fields + can be added to it. + **/ + AClosed; + + /** + An open structure allows having additional fields added to it, which is + used during type inference. It is closed upon unification. + **/ + AOpened; + + /** + A const structure is one that appears directly in syntax. It cannot be + assigned to a smaller structure type (that is, it does not allow + structural sub-typing). + **/ + AConst; + + /** + Represents a structure which extends one or multiple structures defined + in `tl`. + + @see https://haxe.org/manual/type-system-extensions.html + **/ + AExtend(tl:Ref>); + + /** + A structure that represents the static fields of a class. + **/ + AClassStatics(t:Ref); + + /** + A structure that represents the constructors of an enum. + **/ + AEnumStatics(t:Ref); + + /** + A structure that represents the static fields of an abstract. + **/ + AAbstractStatics(t:Ref); +} + +/** + Represents the declaration of type parameters. + */ +typedef TypeParameter = { + /** + The name of the type parameter. + **/ + var name:String; + + /** + The type of the type parameter. It is guaranteed to be a `TInst` with a + `KTypeParameter` kind. + **/ + var t:Type; + + /** + The default type for this type parameter. + **/ + var ?defaultType:Null; +} + +/** + Represents a class field. + */ +typedef ClassField = { + /** + The name of the class field. + **/ + var name:String; + + /** + The type of the class field. + **/ + var type:Type; + + /** + Whether or not the class field is public. + **/ + var isPublic:Bool; + + /** + Whether or not the class field is extern. + **/ + var isExtern:Bool; + + /** + Whether or not the class field is final. + **/ + var isFinal:Bool; + + /** + Whether or not the class field is abstract. + **/ + var isAbstract:Bool; + + /** + The type parameters of the class field. + **/ + var params:Array; + + /** + The metadata of the class field. + **/ + var meta:MetaAccess; + + /** + The class field kind. + **/ + var kind:FieldKind; + + /** + Returns the typed expression of the class field. + **/ + function expr():Null; + + /** + The position of the class field. + **/ + var pos:Expr.Position; + + /** + The associated documentation of the class field. + **/ + var doc:Null; + + /** + The overload fields of the class field. + **/ + var overloads:Ref>; +} + +/** + Represents an enum constructor. + */ +typedef EnumField = { + /** + The name of the enum constructor. + **/ + var name:String; + + /** + The type of the enum constructor. + **/ + var type:Type; + + /** + The position of the enum constructor. + **/ + var pos:Expr.Position; + + /** + The metadata of the enum constructor. + **/ + var meta:MetaAccess; + + /** + The index of the enum constructor, i.e. in which position it appears + in the syntax. + **/ + var index:Int; + + /** + The associated documentation of the enum constructor. + **/ + var doc:Null; + + /** + The type parameters of the enum constructor. + **/ + var params:Array; +} + +/** + Represents the kind of a class. + */ +enum ClassKind { + /** + A normal class. + **/ + KNormal; + + /** + A type parameter class with a set of constraints. + **/ + KTypeParameter(constraints:Array); + + /** + A class containing module fields. + **/ + KModuleFields(module:String); + + /** + A special kind of class to encode expressions into type parameters. + **/ + KExpr(expr:Expr); + + /** + A `@:generic` base class. + **/ + KGeneric; + + /** + A concrete `@:generic` instance, referencing the original class and the + applied type parameters. + **/ + KGenericInstance(cl:Ref, params:Array); + + /** + A special class for `haxe.macro.MacroType`. + + @deprecated + **/ + KMacroType; + + /** + An implementation class of an abstract, i.e. where all its run-time code + is. + **/ + KAbstractImpl(a:Ref); + + /** + A `@:genericBuild` class + **/ + KGenericBuild; +} + +/** + The information that all types (`ClassType`, `EnumType`, `DefType`, + `AbstractType`) have in common. +**/ +typedef BaseType = { + /** + The package of the type. + **/ + var pack:Array; + + /** + The name of the type. + **/ + var name:String; + + /** + The module name of the type, which might be different. + **/ + var module:String; + + /** + The position of the type. + **/ + var pos:Expr.Position; + + /** + Whether or not the type is private. + **/ + var isPrivate:Bool; + + /** + Whether or not the type is extern. + **/ + var isExtern:Bool; + + /** + The type parameters of the type. + **/ + var params:Array; + + /** + The metadata of the type. + **/ + var meta:MetaAccess; + + /** + The associated documentation of the class field. + **/ + var doc:Null; + + /** + Allows excluding the type from compilation. + **/ + function exclude():Void; +} + +/** + Represents a class type. + */ +typedef ClassType = BaseType & { + /** + The kind of the class. + **/ + var kind:ClassKind; + + /** + If true the type is an interface, otherwise it is a class. + **/ + var isInterface:Bool; + + /** + If true the class is final and cannot be extended. + **/ + var isFinal:Bool; + + /** + If true the class is abstract and cannot be instantiated directly. + **/ + var isAbstract:Bool; + + /** + The parent class and its type parameters, if available. + **/ + var superClass:Null<{t:Ref, params:Array}>; + + /** + The implemented interfaces and their type parameters. + **/ + var interfaces:Array<{t:Ref, params:Array}>; + + /** + The member fields of the class. + **/ + var fields:Ref>; + + /** + The static fields of the class. + **/ + var statics:Ref>; + + // var dynamic : Null; + // var arrayAccess : Null; + + /** + The constructor of the class, if available. + **/ + var constructor:Null>; + + /** + The `__init__` expression of the class, if available. + **/ + var init:Null; + + /** + The list of fields that have override status. + **/ + var overrides:Array>; +} + +/** + Represents an enum type. + */ +typedef EnumType = BaseType & { + /** + The available enum constructors. + **/ + var constructs:Map; + + /** + An ordered list of enum constructor names. + **/ + var names:Array; +} + +/** + Represents a typedef. + */ +typedef DefType = BaseType & { + /** + The target type of the typedef. + **/ + var type:Type; +} + +/** + Represents an abstract type. + */ +typedef AbstractType = BaseType & { + /** + The underlying type of the abstract. + **/ + var type:Type; + + /** + The implementation class of the abstract, if available. + **/ + var impl:Null>; + + /** + The defined binary operators of the abstract. + **/ + var binops:Array<{op:Expr.Binop, field:ClassField}>; + + /** + The defined unary operators of the abstract. + **/ + var unops:Array<{op:Expr.Unop, postFix:Bool, field:ClassField}>; + + /** + The available implicit from-casts of the abstract. + + @see https://haxe.org/manual/types-abstract-implicit-casts.html + **/ + var from:Array<{t:Type, field:Null}>; + + /** + The available implicit to-casts of the abstract. + + @see https://haxe.org/manual/types-abstract-implicit-casts.html + **/ + var to:Array<{t:Type, field:Null}>; + + /** + The defined array-access fields of the abstract. + **/ + var array:Array; + + /** + The method used for resolving unknown field access, if available. + **/ + var resolve:Null; + + /** + The method used for resolving unknown field access, if available. + **/ + var resolveWrite:Null; +} + +/** + MetaAccess is a wrapper for the `Metadata` array. It can be used to add + metadata to and remove metadata from its origin. +**/ +typedef MetaAccess = { + /** + Return the wrapped `Metadata` array. + + Modifying this array has no effect on the origin of `this` MetaAccess. + The `add` and `remove` methods can be used for that. + **/ + function get():Expr.Metadata; + + /** + Extract metadata entries by given `name`. + + If there's no metadata with such name, empty array `[]` is returned. + + If `name` is null, compilation fails with an error. + **/ + function extract(name:String):Array; + + /** + Adds the metadata specified by `name`, `params` and `pos` to the origin + of `this` MetaAccess. + + Metadata names are not unique during compilation, so this method never + overwrites a previous metadata. + + If a `Metadata` array is obtained through a call to `get`, a subsequent + call to `add` has no effect on that array. + + If any argument is null, compilation fails with an error. + **/ + function add(name:String, params:Array, pos:Expr.Position):Void; + + /** + Removes all `name` metadata entries from the origin of `this` + MetaAccess. + + This method might clear several metadata entries of the same name. + + If a `Metadata` array is obtained through a call to `get`, a subsequent + call to `remove` has no effect on that array. + + If `name` is null, compilation fails with an error. + **/ + function remove(name:String):Void; + + /** + Tells if the origin of `this` MetaAccess has a `name` metadata entry. + + If `name` is null, compilation fails with an error. + **/ + function has(name:String):Bool; +} + +/** + Represents a field kind. + */ +enum FieldKind { + /** + A variable of property, depending on the `read` and `write` values. + **/ + FVar(read:VarAccess, write:VarAccess); + + /** + A method + **/ + FMethod(k:MethodKind); +} + +/** + Represents the variable accessor. + */ +enum VarAccess { + /** + Normal access (`default`). + **/ + AccNormal; + + /** + Private access (`null`). + **/ + AccNo; + + /** + No access (`never`). + **/ + AccNever; + + /** + Unused. + **/ + AccResolve; + + /** + Access through accessor function (`get`, `set`, `dynamic`). + **/ + AccCall; + + /** + Inline access (`inline`). + **/ + AccInline; + + /** + Failed access due to a `@:require` metadata. + **/ + AccRequire(r:String, ?msg:String); + + /** + Access is only allowed from the constructor. + **/ + AccCtor; +} + +/** + Represents the method kind. + */ +enum MethodKind { + /** + A normal method. + **/ + MethNormal; + + /** + An inline method. + + @see https://haxe.org/manual/class-field-inline.html + **/ + MethInline; + + /** + A dynamic, rebindable method. + + @see https://haxe.org/manual/class-field-dynamic.html + **/ + MethDynamic; + + /** + A macro method. + **/ + MethMacro; +} + +/** + Represents typed constant. + */ +enum TConstant { + /** + An `Int` literal. + **/ + TInt(i:Int); + + /** + A `Float` literal, represented as String to avoid precision loss. + **/ + TFloat(s:String); + + /** + A `String` literal. + **/ + TString(s:String); + + /** + A `Bool` literal. + **/ + TBool(b:Bool); + + /** + The constant `null`. + **/ + TNull; + + /** + The constant `this`. + **/ + TThis; + + /** + The constant `super`. + **/ + TSuper; +} + +/** + Represents a module type. These are the types that can be declared in a Haxe + module and which are passed to the generators (except `TTypeDecl`). + */ +enum ModuleType { + /** + A class. + **/ + TClassDecl(c:Ref); + + /** + An enum. + **/ + TEnumDecl(e:Ref); + + /** + A typedef. + **/ + TTypeDecl(t:Ref); + + /** + An abstract. + **/ + TAbstract(a:Ref); +} + +/** + Represents a function in the typed AST. + */ +typedef TFunc = { + /** + A list of function arguments identified by an argument variable `v` and + an optional initialization `value`. + **/ + var args:Array<{v:TVar, value:Null}>; + + /** + The return type of the function. + **/ + var t:Type; + + /** + The expression of the function body. + **/ + var expr:TypedExpr; +} + +/** + Represents the kind of field access in the typed AST. + */ +enum FieldAccess { + /** + Access of field `cf` on a class instance `c` with type parameters + `params`. + **/ + FInstance(c:Ref, params:Array, cf:Ref); + + /** + Static access of a field `cf` on a class `c`. + **/ + FStatic(c:Ref, cf:Ref); + + /** + Access of field `cf` on an anonymous structure. + **/ + FAnon(cf:Ref); + + /** + Dynamic field access of a field named `s`. + **/ + FDynamic(s:String); + + /** + Closure field access of field `cf` on a class instance `c` with type + parameters `params`. + **/ + FClosure(c:Null<{c:Ref, params:Array}>, cf:Ref); + + /** + Field access to an enum constructor `ef` of enum `e`. + **/ + FEnum(e:Ref, ef:EnumField); +} + +/** + Represents kind of a node in the typed AST. + */ +enum TypedExprDef { + /** + A constant. + **/ + TConst(c:TConstant); + + /** + Reference to a local variable `v`. + **/ + TLocal(v:TVar); + + /** + Array access `e1[e2]`. + **/ + TArray(e1:TypedExpr, e2:TypedExpr); + + /** + Binary operator `e1 op e2`. + **/ + TBinop(op:Expr.Binop, e1:TypedExpr, e2:TypedExpr); + + /** + Field access on `e` according to `fa`. + **/ + TField(e:TypedExpr, fa:FieldAccess); + + /** + Reference to a module type `m`. + **/ + TTypeExpr(m:ModuleType); + + /** + Parentheses `(e)`. + **/ + TParenthesis(e:TypedExpr); + + /** + An object declaration. + **/ + TObjectDecl(fields:Array<{name:String, expr:TypedExpr}>); + + /** + An array declaration `[el]`. + **/ + TArrayDecl(el:Array); + + /** + A call `e(el)`. + **/ + TCall(e:TypedExpr, el:Array); + + /** + A constructor call `new c(el)`. + **/ + TNew(c:Ref, params:Array, el:Array); + + /** + An unary operator `op` on `e`: + + * e++ (op = OpIncrement, postFix = true) + * e-- (op = OpDecrement, postFix = true) + * ++e (op = OpIncrement, postFix = false) + * --e (op = OpDecrement, postFix = false) + * -e (op = OpNeg, postFix = false) + * !e (op = OpNot, postFix = false) + * ~e (op = OpNegBits, postFix = false) + **/ + TUnop(op:Expr.Unop, postFix:Bool, e:TypedExpr); + + /** + A function declaration. + **/ + TFunction(tfunc:TFunc); + + /** + A variable declaration `var v` or `var v = expr`. + **/ + TVar(v:TVar, expr:Null); + + /** + A block declaration `{el}`. + **/ + TBlock(el:Array); + + /** + A `for` expression. + **/ + TFor(v:TVar, e1:TypedExpr, e2:TypedExpr); + + /** + An `if(econd) eif` or `if(econd) eif else eelse` expression. + **/ + TIf(econd:TypedExpr, eif:TypedExpr, eelse:Null); + + /** + Represents a `while` expression. + When `normalWhile` is `true` it is `while (...)`. + When `normalWhile` is `false` it is `do {...} while (...)`. + **/ + TWhile(econd:TypedExpr, e:TypedExpr, normalWhile:Bool); + + /** + Represents a `switch` expression with related cases and an optional + `default` case if edef != null. + **/ + TSwitch(e:TypedExpr, cases:Array<{values:Array, expr:TypedExpr}>, edef:Null); + + /** + Represents a `try`-expression with related catches. + **/ + TTry(e:TypedExpr, catches:Array<{v:TVar, expr:TypedExpr}>); + + /** + A `return` or `return e` expression. + **/ + TReturn(e:Null); + + /** + A `break` expression. + **/ + TBreak; + + /** + A `continue` expression. + **/ + TContinue; + + /** + A `throw e` expression. + **/ + TThrow(e:TypedExpr); + + /** + A `cast e` or `cast (e, m)` expression. + **/ + TCast(e:TypedExpr, m:Null); + + /** + A `@m e1` expression. + **/ + TMeta(m:Expr.MetadataEntry, e1:TypedExpr); + + /** + Access to an enum parameter (generated by the pattern matcher). + **/ + TEnumParameter(e1:TypedExpr, ef:EnumField, index:Int); + + /** + Access to an enum index (generated by the pattern matcher). + **/ + TEnumIndex(e1:TypedExpr); + + /** + An unknown identifier. + **/ + TIdent(s:String); +} + +/** + Represents a variable in the typed AST. + */ +typedef TVar = { + /** + The unique ID of the variable. + **/ + public var id(default, never):Int; + + /** + The name of the variable. + **/ + public var name(default, never):String; + + /** + The type of the variable. + **/ + public var t(default, never):Type; + + /** + Whether or not the variable has been captured by a closure. + **/ + public var capture(default, never):Bool; + + /** + Special information which is internally used to keep track of closure. + information + **/ + public var extra(default, never):Null<{params:Array, expr:Null}>; + + /** + The metadata of the variable. + **/ + public var meta(default, never):Null; +} + +/** + Represents a typed AST node. + */ +typedef TypedExpr = { + /** + The expression kind. + **/ + var expr:TypedExprDef; + + /** + The position of the expression. + **/ + var pos:Expr.Position; + + /** + The type of the expression. + **/ + var t:Type; +} diff --git a/build/linux64_569e52e/std/haxe/macro/TypeTools.hx b/build/linux64_569e52e/std/haxe/macro/TypeTools.hx new file mode 100644 index 0000000..38949bf --- /dev/null +++ b/build/linux64_569e52e/std/haxe/macro/TypeTools.hx @@ -0,0 +1,482 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.macro; + +import haxe.macro.Context; +import haxe.macro.Expr; +import haxe.macro.Type; + +using Lambda; + +/** + This class provides some utility methods to work with types. It is + best used through 'using haxe.macro.TypeTools' syntax and then provides + additional methods on haxe.macro.Type instances. +**/ +class TypeTools { + static function nullable(complexType:ComplexType):ComplexType + return macro:Null<$complexType>; + + static function toField(cf:ClassField):Field + return { + function varAccessToString(va:VarAccess, getOrSet:String):String + return { + switch (va) { + case AccNormal | AccCtor: "default"; + case AccNo: "null"; + case AccNever: "never"; + case AccResolve: throw "Invalid TAnonymous"; + case AccCall: getOrSet; + case AccInline: "default"; + case AccRequire(_, _): "default"; + } + } + var access = cf.isPublic ? [APublic] : [APrivate]; + if (cf.meta.has(":final")) { + access.push(AFinal); + } + if (cf.params.length == 0) + { + name: cf.name, + doc: cf.doc, + access: access, + kind: switch ([cf.kind, cf.type]) { + case [FVar(read, write), ret]: + FProp(varAccessToString(read, "get"), varAccessToString(write, "set"), toComplexType(ret), null); + case [FMethod(_), TFun(args, ret)]: + FFun({ + args: [ + for (a in args) + { + name: a.name, + opt: a.opt, + type: toComplexType(a.t), + } + ], + ret: toComplexType(ret), + expr: null, + }); + default: + throw "Invalid TAnonymous"; + }, + pos: cf.pos, + meta: cf.meta.get(), + } else { + throw "Invalid TAnonymous"; + } + } + + /** + Returns a syntax-level type corresponding to Type `t`. + + This function is mostly inverse to `ComplexTypeTools.toType`, but may + lose some information on types that do not have a corresponding syntax + version, such as monomorphs. In these cases, the result is null. + + If `t` is null, an internal exception is thrown. + **/ + public static function toComplexType(type:Null):Null + return { + #if macro + Context.toComplexType(type); + #else + switch (type) { + case null: + null; + case TMono(_.get() => t): + t == null ? null : toComplexType(t); + case TEnum(_.get() => baseType, params): + TPath(toTypePath(baseType, params)); + case TInst(_.get() => classType, params): + switch (classType.kind) { + case KTypeParameter(_): + TPath({ + name: classType.name, + pack: [], + }); + default: + TPath(toTypePath(classType, params)); + } + case TType(_.get() => baseType, params): + TPath(toTypePath(baseType, params)); + case TFun(args, ret): + TFunction([for (a in args) a.opt ? nullable(toComplexType(a.t)) : toComplexType(a.t)], toComplexType(ret)); + case TAnonymous(_.get() => {fields: fields}): + TAnonymous([for (cf in fields) toField(cf)]); + case TDynamic(t): + if (t == null) { + macro:Dynamic; + } else { + var ct = toComplexType(t); + macro:Dynamic<$ct>; + } + case TLazy(f): + toComplexType(f()); + case TAbstract(_.get() => baseType, params): + TPath(toTypePath(baseType, params)); + default: + throw "Invalid type"; + } + #end + } + + static function toTypeParam(type:Type):TypeParam + return { + switch (type) { + case TInst(_.get() => {kind: KExpr(e)}, _): TPExpr(e); + case _: TPType(toComplexType(type)); + } + } + + static function toTypePath(baseType:BaseType, params:Array):TypePath + return { + var module = baseType.module; + { + pack: baseType.pack, + name: module.substring(module.lastIndexOf(".") + 1), + sub: baseType.name, + params: [for (t in params) toTypeParam(t)], + } + } + + #if macro + /** + Follows all typedefs of `t` to reach the actual type. + + If `once` is true, this function does not call itself recursively, + otherwise it does. This can be useful in cases where intermediate + typedefs might be of interest. + + Affected types are monomorphs `TMono` and typedefs `TType(t,pl)`. + + If `t` is null, an internal exception is thrown. + + Usage example with monomorphs: + var t = Context.typeof(macro null); // TMono() + var ts = Context.typeof(macro "foo"); //TInst(String,[]) + Context.unify(t, ts); + trace(t); // TMono() + trace(t.follow()); //TInst(String,[]) + + Usage example with typedefs: + var t = Context.typeof(macro ("foo" :MyString)); // typedef MyString = String + trace(t); // TType(MyString,[]) + trace(t.follow()); //TInst(String,[]) + **/ + static public inline function follow(t:Type, ?once:Bool):Type + return Context.follow(t, once); + + /** + Like `follow`, follows all typedefs of `t` to reach the actual type. + + Will however follow also abstracts to their underlying implementation, + if they are not a @:coreType abstract + + If `t` is null, an internal exception is thrown. + + Usage example: + var t = Context.typeof(macro new Map()); + trace(t); // TAbstract(Map,[TInst(String,[]),TInst(String,[])]) + trace(t.followWithAbstracts()); // TInst(haxe.ds.StringMap, [TInst(String,[])]) + **/ + static public inline function followWithAbstracts(t:Type, once:Bool = false):Type + return Context.followWithAbstracts(t, once); + + /** + Returns true if `t1` and `t2` unify, false otherwise. + **/ + static public inline function unify(t1:Type, t2:Type):Bool + return Context.unify(t1, t2); + + /** + Tries to extract the class instance stored inside `t`. + + If `t` is a class instance `TInst(c,pl)`, c is returned. + + If `t` is of a different type, an exception of type String is thrown. + + If `t` is null, the result is null. + **/ + static public function getClass(t:Type) + return t == null ? null : switch (follow(t)) { + case TInst(c, _): c.get(); + case _: throw "Class instance expected"; + } + + /** + Tries to extract the enum instance stored inside `t`. + + If `t` is an enum instance `TEnum(e,pl)`, e is returned. + + If `t` is of a different type, an exception of type String is thrown. + + If `t` is null, the result is null. + **/ + static public function getEnum(t:Type) + return t == null ? null : switch (follow(t)) { + case TEnum(e, _): e.get(); + case _: throw "Enum instance expected"; + } + + /** + Applies the type parameters `typeParameters` to type `t` with the given + types `concreteTypes`. + + This function replaces occurrences of type parameters in `t` if they are + part of `typeParameters`. The array index of such a type parameter is + then used to lookup the concrete type in `concreteTypes`. + + If `typeParameters.length` is not equal to `concreteTypes.length`, an + exception of type `String` is thrown. + + If `typeParameters.length` is 0, `t` is returned unchanged. + + If either argument is `null`, the result is unspecified. + **/ + static public function applyTypeParameters(t:Type, typeParameters:Array, concreteTypes:Array):Type { + if (typeParameters.length != concreteTypes.length) + throw 'Incompatible arguments: ${typeParameters.length} type parameters and ${concreteTypes.length} concrete types'; + else if (typeParameters.length == 0) + return t; + #if (neko || eval) + return Context.load("apply_params", 3)(typeParameters, concreteTypes, t); + #else + return applyParams(typeParameters, concreteTypes, t); + #end + } + + #if !neko + private static function applyParams(typeParameters:Array, concreteTypes:Array, t:Type):Type { + return null; + } + #end + + /** + Transforms `t` by calling `f` on each of its subtypes. + + If `t` is a compound type, `f` is called on each of its components. + + Otherwise `t` is returned unchanged. + + The following types are considered compound: + - TInst, TEnum, TType and TAbstract with type parameters + - TFun + - TAnonymous + + If `t` or `f` are null, the result is unspecified. + **/ + static public function map(t:Type, f:Type->Type):Type { + return switch (t) { + case TMono(tm): + switch (tm.get()) { + case null: t; + case var t: f(t); + } + case TEnum(_, []) | TInst(_, []) | TType(_, []): + t; + case TEnum(en, tl): + TEnum(en, tl.map(f)); + case TInst(cl, tl): + TInst(cl, tl.map(f)); + case TType(t2, tl): + TType(t2, tl.map(f)); + case TAbstract(a, tl): + TAbstract(a, tl.map(f)); + case TFun(args, ret): + TFun(args.map(function(arg) return { + name: arg.name, + opt: arg.opt, + t: f(arg.t) + }), f(ret)); + case TAnonymous(an): + TAnonymous(Context.load("map_anon_ref", 2)(an, f)); + case TDynamic(t2): + t == t2 ? t : TDynamic(f(t2)); + case TLazy(ft): + var ft = ft(); + var ft2 = f(ft); + ft == ft2 ? t : ft2; + } + } + + /** + Calls function `f` on each component of type `t`. + + If `t` is not a compound type, this operation has no effect. + + The following types are considered compound: + - TInst, TEnum, TType and TAbstract with type parameters + - TFun + - TAnonymous + + If `t` or `f` are null, the result is unspecified. + **/ + static public function iter(t:Type, f:Type->Void):Void { + switch (t) { + case TMono(tm): + var t = tm.get(); + if (t != null) + f(t); + case TEnum(_, tl) | TInst(_, tl) | TType(_, tl) | TAbstract(_, tl): + for (t in tl) + f(t); + case TDynamic(t2): + if (t != t2) + f(t2); + case TLazy(ft): + f(ft()); + case TAnonymous(an): + for (field in an.get().fields) + f(field.type); + case TFun(args, ret): + for (arg in args) + f(arg.t); + f(ret); + } + } + + /** + Converts type `t` to a human-readable String representation. + **/ + static public function toString(t:Type):String { + #if (neko || eval) + return Context.load("s_type", 1)(t); + #else + return null; + #end + } + + /** + Changes the name of the variable in the typed expression. + **/ + static public function setVarName(t:TVar, name:String) { + Context.load("set_var_name", 2)(t, name); + } + + /** + Converts type `t` to `haxe.macro.Type.ModuleType`. + **/ + static public function toModuleType(t:Type):ModuleType { + #if (neko || eval) + return Context.load("type_to_module_type", 1)(t); + #else + return null; + #end + } + + /** + Creates a type from the `haxe.macro.Type.ModuleType` argument. + **/ + static public function fromModuleType(mt:ModuleType):Type { + #if (neko || eval) + return Context.load("module_type_to_type", 1)(mt); + #else + return null; + #end + } + + /** + Converts type `t` to `haxe.macro.Type.BaseType`. + **/ + static public function toBaseType(t:Type):BaseType { + return switch toModuleType(t) { + case TClassDecl(_.get() => c): c; + case TEnumDecl(_.get() => e): e; + case TTypeDecl(_.get() => t): t; + case TAbstract(_.get() => a): a; + }; + } + + /** + Calls `f` for each missing `TypeParameter` within Type `type`. + The `Type` returned from `f` fills the vacant parameter in a + copy returned by the function. + + If `type` does not use type parameters, or all of the type + parameters are defined, `type` is returned unchanged. + + Excessive type parameters are truncated. + + If `recursive` is true, all subtypes are resolved. + + The parameters provided to `f` are: + - The `TypeParameter` being resolved. + - The `Type` missing a type parameter. + - The `Int` index of type parameter being resolved. + + Missing type parameters may cause fatal compiler errors. + Therefore, this function should be called on user generated + `Type`s prior to passing to macro API functions such as + `Context.follow` or `Context.unify`. + **/ + public static function resolveTypeParameters(type:Type, recursive:Bool, f:(TypeParameter,Type,Int)->Type):Type { + function fillParams(typeParams:Array, concreteTypes:Array): Array + return if (concreteTypes.length > typeParams.length) { + concreteTypes.slice(0, typeParams.length); + } else { + [ + for (i in 0...typeParams.length) + if (i < concreteTypes.length) + concreteTypes[i]; + else + f(typeParams[i], type, i) + ]; + } + + final result = switch (type) { + case TInst(t, params): + TInst(t, fillParams(t.get().params, params)); + case TEnum(t, params): + TEnum(t, fillParams(t.get().params, params)); + case TType(t, params): + TType(t, fillParams(t.get().params, params)); + case TAbstract(t, params): + TAbstract(t, fillParams(t.get().params, params)); + case _: + type; + } + + return if(recursive) + map(result, (t) -> resolveTypeParameters(t, recursive, f)); + else + result; + } + #end + + /** + Resolves the field named `name` on class `c`. + + If `isStatic` is true, the classes' static fields are checked. Otherwise + the classes' member fields are checked. + + If the field is found, it is returned. Otherwise if `c` has a super + class, `findField` recursively checks that super class. Otherwise null + is returned. + + If any argument is null, the result is unspecified. + **/ + static public function findField(c:ClassType, name:String, isStatic:Bool = false):Null { + var field = (isStatic ? c.statics : c.fields).get().find(function(field) return field.name == name); + return if (field != null) field; else if (c.superClass != null) findField(c.superClass.t.get(), name, isStatic); else null; + } +} diff --git a/build/linux64_569e52e/std/haxe/macro/TypedExprTools.hx b/build/linux64_569e52e/std/haxe/macro/TypedExprTools.hx new file mode 100644 index 0000000..9334e28 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/macro/TypedExprTools.hx @@ -0,0 +1,175 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.macro; + +import haxe.macro.Type; + +/** + This class provides some utility methods to work with typed expressions. + It is best used through 'using haxe.macro.TypedExprTools' syntax and then + provides additional methods on `haxe.macro.TypedExpr` instances. +**/ +class TypedExprTools { + static function with(e:TypedExpr, ?edef:TypedExprDef, ?t:Type) { + return { + expr: edef == null ? e.expr : edef, + pos: e.pos, + t: t == null ? e.t : t + } + } + + /** + Transforms the sub-expressions of `e` by calling `f` on each of them. + + See `haxe.macro.ExprTools.map` for details on expression mapping in + general. This function works the same way, but with a different data + structure. + **/ + static public function map(e:TypedExpr, f:TypedExpr->TypedExpr):TypedExpr { + return switch (e.expr) { + case TConst(_) | TLocal(_) | TBreak | TContinue | TTypeExpr(_) | TIdent(_): e; + case TArray(e1, e2): with(e, TArray(f(e1), f(e2))); + case TBinop(op, e1, e2): with(e, TBinop(op, f(e1), f(e2))); + case TFor(v, e1, e2): with(e, TFor(v, f(e1), f(e2))); + case TWhile(e1, e2, flag): with(e, TWhile(f(e1), f(e2), flag)); + case TThrow(e1): with(e, TThrow(f(e1))); + case TEnumParameter(e1, ef, i): with(e, TEnumParameter(f(e1), ef, i)); + case TEnumIndex(e1): with(e, TEnumIndex(f(e1))); + case TField(e1, fa): with(e, TField(f(e1), fa)); + case TParenthesis(e1): with(e, TParenthesis(f(e1))); + case TUnop(op, pre, e1): with(e, TUnop(op, pre, f(e1))); + case TArrayDecl(el): with(e, TArrayDecl(el.map(f))); + case TNew(t, pl, el): with(e, TNew(t, pl, el.map(f))); + case TBlock(el): with(e, TBlock(el.map(f))); + case TObjectDecl(fl): with(e, TObjectDecl(fl.map(function(field) return {name: field.name, expr: f(field.expr)}))); + case TCall(e1, el): with(e, TCall(f(e1), el.map(f))); + case TVar(v, eo): with(e, TVar(v, eo == null ? null : f(eo))); + case TFunction(fu): with(e, TFunction({t: fu.t, args: fu.args, expr: f(fu.expr)})); + case TIf(e1, e2, e3): with(e, TIf(f(e1), f(e2), e3 == null ? null : f(e3))); + case TSwitch(e1, cases, + e2): with(e, TSwitch(f(e1), cases.map(function(c) return {values: c.values.map(f), expr: f(c.expr)}), e2 == null ? null : f(e2))); + case TTry(e1, catches): with(e, TTry(f(e1), catches.map(function(c) return {v: c.v, expr: f(c.expr)}))); + case TReturn(e1): with(e, TReturn(e1 == null ? null : f(e1))); + case TCast(e1, mt): with(e, TCast(f(e1), mt)); + case TMeta(m, e1): with(e, TMeta(m, f(e1))); + } + } + + /** + Calls function `f` on each sub-expression of `e`. + + See `haxe.macro.ExprTools.iter` for details on iterating expressions in + general. This function works the same way, but with a different data + structure. + **/ + static public function iter(e:TypedExpr, f:TypedExpr->Void):Void { + switch (e.expr) { + case TConst(_) | TLocal(_) | TBreak | TContinue | TTypeExpr(_) | TIdent(_): + case TArray(e1, e2) | TBinop(_, e1, e2) | TFor(_, e1, e2) | TWhile(e1, e2, _): + f(e1); + f(e2); + case TThrow(e1) | TEnumParameter(e1, _, _) | TEnumIndex(e1) | TField(e1, _) | TParenthesis(e1) | TUnop(_, _, e1) | TCast(e1, _) | TMeta(_, e1): + f(e1); + case TArrayDecl(el) | TNew(_, _, el) | TBlock(el): + for (e in el) + f(e); + case TObjectDecl(fl): + for (field in fl) + f(field.expr); + case TCall(e1, el): + f(e1); + for (e in el) + f(e); + case TVar(_, e1) | TReturn(e1): + if (e1 != null) + f(e1); + case TFunction(fu): + f(fu.expr); + case TIf(e1, e2, e3): + f(e1); + f(e2); + if (e3 != null) + f(e3); + case TSwitch(e1, cases, e2): + f(e1); + for (c in cases) { + for (v in c.values) + f(v); + f(c.expr); + } + if (e2 != null) + f(e2); + case TTry(e1, catches): + f(e1); + for (c in catches) + f(c.expr); + } + } + + /** + Transforms the sub-expressions of `e` by calling `f` on each of them. + Additionally, types are mapped using `ft` and variables are mapped using + `fv`. + + See `haxe.macro.ExprTools.map` for details on expression mapping in + general. This function works the same way, but with a different data + structure. + **/ + static public function mapWithType(e:TypedExpr, f:TypedExpr->TypedExpr, ft:Type->Type, fv:TVar->TVar):TypedExpr { + return switch (e.expr) { + case TConst(_) | TBreak | TContinue | TTypeExpr(_) | TIdent(_): with(e, ft(e.t)); + case TLocal(v): with(e, TLocal(fv(v)), ft(e.t)); + case TArray(e1, e2): with(e, TArray(f(e1), f(e2)), ft(e.t)); + case TBinop(op, e1, e2): with(e, TBinop(op, f(e1), f(e2)), ft(e.t)); + case TFor(v, e1, e2): with(e, TFor(fv(v), f(e1), f(e2)), ft(e.t)); + case TWhile(e1, e2, flag): with(e, TWhile(f(e1), f(e2), flag), ft(e.t)); + case TThrow(e1): with(e, TThrow(f(e1)), ft(e.t)); + case TEnumParameter(e1, ef, i): with(e, TEnumParameter(f(e1), ef, i), ft(e.t)); + case TEnumIndex(e1): with(e, TEnumIndex(f(e1)), ft(e.t)); + case TField(e1, fa): with(e, TField(f(e1), fa), ft(e.t)); + case TParenthesis(e1): with(e, TParenthesis(e1), ft(e.t)); + case TUnop(op, pre, e1): with(e, TUnop(op, pre, f(e1)), ft(e.t)); + case TArrayDecl(el): with(e, TArrayDecl(el.map(f)), ft(e.t)); + case TNew(t, pl, el): with(e, TNew(t, pl, el.map(f)), ft(e.t)); + case TBlock(el): with(e, TBlock(el.map(f)), ft(e.t)); + case TObjectDecl(fl): with(e, TObjectDecl(fl.map(function(field) return {name: field.name, expr: f(field.expr)})), ft(e.t)); + case TCall(e1, el): with(e, TCall(f(e1), el.map(f)), ft(e.t)); + case TVar(v, eo): with(e, TVar(fv(v), eo == null ? null : f(eo)), ft(e.t)); + case TFunction(fu): with(e, TFunction({t: ft(fu.t), args: fu.args.map(function(arg) return {v: fv(arg.v), value: arg.value}), expr: f(fu.expr)}), + ft(e.t)); + case TIf(e1, e2, e3): with(e, TIf(f(e1), f(e2), e3 == null ? null : f(e3)), ft(e.t)); + case TSwitch(e1, cases, + e2): with(e, TSwitch(f(e1), cases.map(function(c) return {values: c.values.map(f), expr: f(c.expr)}), e2 == null ? null : f(e2)), ft(e.t)); + case TTry(e1, catches): with(e, TTry(f(e1), catches.map(function(c) return {v: fv(c.v), expr: f(c.expr)})), ft(e.t)); + case TReturn(e1): with(e, TReturn(e1 == null ? null : f(e1)), ft(e.t)); + case TCast(e1, mt): with(e, TCast(f(e1), mt), ft(e.t)); + case TMeta(m, e1): with(e, TMeta(m, f(e1)), ft(e.t)); + } + } + + #if macro + static public function toString(t:TypedExpr, ?pretty = false):String { + return @:privateAccess haxe.macro.Context.sExpr(t, pretty); + } + #end +} diff --git a/build/linux64_569e52e/std/haxe/rtti/CType.hx b/build/linux64_569e52e/std/haxe/rtti/CType.hx new file mode 100644 index 0000000..9ff975b --- /dev/null +++ b/build/linux64_569e52e/std/haxe/rtti/CType.hx @@ -0,0 +1,595 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.rtti; + +/** + The (dot-)path of the runtime type. +**/ +typedef Path = String; + +/** + A list of strings representing the targets where the type is available. +**/ +typedef Platforms = Array; + +/** + The function argument runtime type information. +**/ +typedef FunctionArgument = {name:String, opt:Bool, t:CType, ?value:String}; + +/** + The runtime member types. +**/ +enum CType { + CUnknown; + CEnum(name:Path, params:Array); + CClass(name:Path, params:Array); + CTypedef(name:Path, params:Array); + CFunction(args:Array, ret:CType); + CAnonymous(fields:Array); + CDynamic(?t:CType); + CAbstract(name:Path, params:Array); +} + +/** + The type parameters in the runtime type information. +**/ +typedef PathParams = { + /** + The path of the type. + **/ + var path:Path; + + /** + The array of parameters types. + **/ + var params:Array; +}; + +/** + An array of strings representing the names of the type parameters the type + has. As of Haxe 3.2.0, this does not include the constraints. +**/ +typedef TypeParams = Array; // no constraints + +/** + Represents the runtime rights of a type. +**/ +enum Rights { + RNormal; + RNo; + RCall(m:String); + RMethod; + RDynamic; + RInline; +} + +/** + The list of runtime metadata. +**/ +typedef MetaData = Array<{name:String, params:Array}>; + +/** + The runtime class field information. + + @see +**/ +typedef ClassField = { + /** + The name of the field. + **/ + var name:String; + + /** + The type of the field. + **/ + var type:CType; + + /** + Whether or not the field is `public`. + **/ + var isPublic:Bool; + + /** + Whether or not the field is `final`. + **/ + var isFinal:Bool; + + /** + Whether or not the field overrides another field. + **/ + var isOverride:Bool; + + /** + The documentation of the field. This information is only available + if the compiler flag `-D use_rtti_doc` was in place. Otherwise, or + if the field has no documentation, the value is `null`. + **/ + var doc:Null; + + /** + The [read access](https://haxe.org/manual/class-field-property.html#define-read-access) + behavior of the field. + **/ + var get:Rights; + + /** + The [write access](https://haxe.org/manual/class-field-property.html#define-write-access) + behavior of the field. + **/ + var set:Rights; + + /** + An array of strings representing the names of the type parameters + the field has. + **/ + var params:TypeParams; + + /** + A list of strings representing the targets where the field is available. + **/ + var platforms:Platforms; + + /** + The meta data the field was annotated with. + **/ + var meta:MetaData; + + /** + The line number where the field is defined. This information is only + available if the field has an expression. + Otherwise the value is `null`. + **/ + var line:Null; + + /** + The list of available overloads for the fields or `null` if no overloads + exists. + **/ + var overloads:Null>; + + /** + The actual expression of the field or `null` if there is no expression. + **/ + var expr:Null; +}; + +/** + The general runtime type information. +**/ +typedef TypeInfos = { + /** + The type path of the type. + **/ + var path:Path; + + /** + The type path of the module containing the type. + **/ + var module:Path; + + /** + The full slash path of the .hx file containing the type. + This might be `null` in case there is no such file, e.g. if the + type is defined through a macro. + **/ + var file:Null; + + /** + An array of strings representing the names of the type parameters the + type has. + **/ + var params:TypeParams; + + /** + The documentation of the type. This information is only available + if the compiler flag `-D use_rtti_doc` was in place. Otherwise, or if + the constructor has no documentation, the value is `null`. + **/ + var doc:Null; + + /** + Whether or not the type is [`private`](https://haxe.org/manual/type-system-module-sub-types.html#define-private-type). + **/ + var isPrivate:Bool; + + /** + A list of strings representing the targets where the type is available. + **/ + var platforms:Platforms; + + /** + The [metadata](https://haxe.org/manual/lf-metadata.html) the type was + annotated with. + **/ + var meta:MetaData; +}; + +/** + The runtime class definition information. +**/ +typedef Classdef = TypeInfos & { + /** + Whether or not the class is [extern](https://haxe.org/manual/lf-externs.html). + **/ + var isExtern:Bool; + + /** + Whether or not the class is `final`. + **/ + var isFinal:Bool; + + /** + Whether or not the class is actually an [interface](https://haxe.org/manual/types-interfaces.html). + **/ + var isInterface:Bool; + + /** + The class' parent class defined by its type path and list of type + parameters. + **/ + var superClass:Null; + + /** + The list of interfaces defined by their type path and list of type + parameters. + **/ + var interfaces:Array; + + /** + The list of member [class fields](https://haxe.org/manual/class-field.html). + **/ + var fields:Array; + + /** + The list of static class fields. + **/ + var statics:Array; + + /** + The type which is dynamically implemented by the class or `null` if no + such type exists. + **/ + var tdynamic:Null; +}; + +/** + The runtime enum constructor information. + + @see +**/ +typedef EnumField = { + /** + The name of the constructor. + **/ + var name:String; + + /** + The list of arguments the constructor has or `null` if no arguments are + available. + **/ + var args:Null>; + + /** + The documentation of the constructor. This information is only available + if the compiler flag `-D use_rtti_doc` was in place. Otherwise, or if + the constructor has no documentation, the value is `null`. + **/ + var doc:String; + + /** + A list of strings representing the targets where the constructor is + available. + **/ + var platforms:Platforms; + + /** + The meta data the constructor was annotated with. + **/ + var meta:MetaData; +}; + +/** + The enum runtime type information. + + @see +**/ +typedef Enumdef = TypeInfos & { + /** + Whether or not the enum is [extern](https://haxe.org/manual/lf-externs.html). + **/ + var isExtern:Bool; + + /** + The list of enum constructors. + **/ + var constructors:Array; +}; + +/** + The typedef runtime information. +**/ +typedef Typedef = TypeInfos & { + /** + The type of the typedef. + **/ + var type:CType; + + /** + The types of the typedef, by platform. + **/ + var types:Map; // by platform + +}; + +/** + The abstract type runtime information. + + @see +**/ +typedef Abstractdef = TypeInfos & { + var to:Array<{t:CType, field:Null}>; + var from:Array<{t:CType, field:Null}>; + var impl:Classdef; + var athis:CType; +}; + +/** + The tree types of the runtime type. +**/ +enum TypeTree { + TPackage(name:String, full:String, subs:Array); + TClassdecl(c:Classdef); + TEnumdecl(e:Enumdef); + TTypedecl(t:Typedef); + TAbstractdecl(a:Abstractdef); +} + +/** + Array of `TypeTree`. +**/ +typedef TypeRoot = Array; + +/** + Contains type and equality checks functionalities for RTTI. +**/ +class TypeApi { + public static function typeInfos(t:TypeTree):TypeInfos { + var inf:TypeInfos; + switch (t) { + case TClassdecl(c): + inf = c; + case TEnumdecl(e): + inf = e; + case TTypedecl(t): + inf = t; + case TAbstractdecl(a): + inf = a; + case TPackage(_, _, _): + throw "Unexpected Package"; + } + return inf; + } + + /** + Returns `true` if the given `CType` is a variable or `false` if it is a + function. + **/ + public static function isVar(t:CType) { + return switch (t) { + case CFunction(_, _): false; + default: true; + } + } + + static function leq(f:T->T->Bool, l1:Array, l2:Array) { + var it = l2.iterator(); + for (e1 in l1) { + if (!it.hasNext()) + return false; + var e2 = it.next(); + if (!f(e1, e2)) + return false; + } + if (it.hasNext()) + return false; + return true; + } + + /** + Unlike `r1 == r2`, this function performs a deep equality check on + the given `Rights` instances. + + If `r1` or `r2` are `null`, the result is unspecified. + **/ + public static function rightsEq(r1:Rights, r2:Rights) { + if (r1 == r2) + return true; + switch (r1) { + case RCall(m1): + switch (r2) { + case RCall(m2): + return m1 == m2; + default: + } + default: + } + return false; + } + + /** + Unlike `t1 == t2`, this function performs a deep equality check on + the given `CType` instances. + + If `t1` or `t2` are `null`, the result is unspecified. + **/ + public static function typeEq(t1:CType, t2:CType) { + switch (t1) { + case CUnknown: + return t2 == CUnknown; + case CEnum(name, params): + switch (t2) { + case CEnum(name2, params2): + return name == name2 && leq(typeEq, params, params2); + default: + } + case CClass(name, params): + switch (t2) { + case CClass(name2, params2): + return name == name2 && leq(typeEq, params, params2); + default: + } + case CAbstract(name, params): + switch (t2) { + case CAbstract(name2, params2): + return name == name2 && leq(typeEq, params, params2); + default: + } + case CTypedef(name, params): + switch (t2) { + case CTypedef(name2, params2): + return name == name2 && leq(typeEq, params, params2); + default: + } + case CFunction(args, ret): + switch (t2) { + case CFunction(args2, ret2): + return leq(function(a:FunctionArgument, b:FunctionArgument) { + return a.name == b.name && a.opt == b.opt && typeEq(a.t, b.t); + }, args, args2) && typeEq(ret, ret2); + default: + } + case CAnonymous(fields): + switch (t2) { + case CAnonymous(fields2): + return leq(function(a, b) return fieldEq(a, b), fields, fields2); + default: + } + case CDynamic(t): + switch (t2) { + case CDynamic(t2): + if ((t == null) != (t2 == null)) + return false; + return t == null || typeEq(t, t2); + default: + } + } + return false; + } + + /** + Unlike `f1 == f2`, this function performs a deep equality check on + the given `ClassField` instances. + + If `f1` or `f2` are `null`, the result is unspecified. + **/ + public static function fieldEq(f1:ClassField, f2:ClassField) { + if (f1.name != f2.name) + return false; + if (!typeEq(f1.type, f2.type)) + return false; + if (f1.isPublic != f2.isPublic) + return false; + if (f1.doc != f2.doc) + return false; + if (!rightsEq(f1.get, f2.get)) + return false; + if (!rightsEq(f1.set, f2.set)) + return false; + if ((f1.params == null) != (f2.params == null)) + return false; + if (f1.params != null && f1.params.join(":") != f2.params.join(":")) + return false; + return true; + } + + /** + Unlike `c1 == c2`, this function performs a deep equality check on + the arguments of the enum constructors, if exists. + + If `c1` or `c2` are `null`, the result is unspecified. + **/ + public static function constructorEq(c1:EnumField, c2:EnumField) { + if (c1.name != c2.name) + return false; + if (c1.doc != c2.doc) + return false; + if ((c1.args == null) != (c2.args == null)) + return false; + if (c1.args != null && !leq(function(a, b) { + return a.name == b.name && a.opt == b.opt && typeEq(a.t, b.t); + }, c1.args, c2.args)) + return false; + return true; + } +} + +/** + The `CTypeTools` class contains some extra functionalities for handling + `CType` instances. +**/ +class CTypeTools { + /** + Get the string representation of `CType`. + **/ + static public function toString(t:CType):String { + return switch (t) { + case CUnknown: + "unknown"; + case CClass(name, params), CEnum(name, params), CTypedef(name, params), CAbstract(name, params): + nameWithParams(name, params); + case CFunction(args, ret): + if (args.length == 0) { + "Void -> " + toString(ret); + } else { + args.map(functionArgumentName).join(" -> ") + " -> " + toString(ret); + } + case CDynamic(d): + if (d == null) { + "Dynamic"; + } else { + "Dynamic<" + toString(d) + ">"; + } + case CAnonymous(fields): + "{ " + fields.map(classField).join(", ") + "}"; + } + } + + static function nameWithParams(name:String, params:Array) { + if (params.length == 0) { + return name; + } + return name + "<" + params.map(toString).join(", ") + ">"; + } + + static function functionArgumentName(arg:FunctionArgument) { + return (arg.opt ? "?" : "") + + (arg.name == "" ? "" : arg.name + ":") + + toString(arg.t) + + (arg.value == null ? "" : " = " + arg.value); + } + + static function classField(cf:ClassField) { + return cf.name + ":" + toString(cf.type); + } +} diff --git a/build/linux64_569e52e/std/haxe/rtti/Meta.hx b/build/linux64_569e52e/std/haxe/rtti/Meta.hx new file mode 100644 index 0000000..7292e40 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/rtti/Meta.hx @@ -0,0 +1,91 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.rtti; + +private typedef MetaObject = { + ?fields:Dynamic>>>, + ?statics:Dynamic>>>, + ?obj:Dynamic>> +}; + +/** + An API to access classes and enums metadata at runtime. + + @see +**/ +class Meta { + /** + Returns the metadata that were declared for the given type (class or enum) + **/ + public static function getType(t:Dynamic):Dynamic> { + var meta = getMeta(t); + return (meta == null || meta.obj == null) ? {} : meta.obj; + } + + // Could move this to Type.hx? + private static function isInterface(t:Dynamic):Bool { + #if java + return java.Lib.toNativeType(t).isInterface(); + #else + throw "Something went wrong"; + #end + } + + private static function getMeta(t:Dynamic):MetaObject { + #if php + return php.Boot.getMeta(t.phpClassName); + #elseif java + var ret = Reflect.field(t, "__meta__"); + if (ret == null && Std.isOfType(t, Class)) { + if (isInterface(t)) { + var name = Type.getClassName(t), + cls = Type.resolveClass(name + '_HxMeta'); + if (cls != null) + return Reflect.field(cls, "__meta__"); + } + } + return ret; + #elseif hl + var t:hl.BaseType = t; + return t.__meta__; + #else + return untyped t.__meta__; + #end + } + + /** + Returns the metadata that were declared for the given class static fields + **/ + public static function getStatics(t:Dynamic):Dynamic>> { + var meta = getMeta(t); + return (meta == null || meta.statics == null) ? {} : meta.statics; + } + + /** + Returns the metadata that were declared for the given class fields or enum constructors + **/ + public static function getFields(t:Dynamic):Dynamic>> { + var meta = getMeta(t); + return (meta == null || meta.fields == null) ? {} : meta.fields; + } +} diff --git a/build/linux64_569e52e/std/haxe/rtti/Rtti.hx b/build/linux64_569e52e/std/haxe/rtti/Rtti.hx new file mode 100644 index 0000000..958e28c --- /dev/null +++ b/build/linux64_569e52e/std/haxe/rtti/Rtti.hx @@ -0,0 +1,64 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.rtti; + +import haxe.rtti.CType; + +/** + Rtti is a helper class which supplements the `@:rtti` metadata. + + @see +**/ +class Rtti { + /** + Returns the `haxe.rtti.CType.Classdef` corresponding to class `c`. + + If `c` has no runtime type information, e.g. because no `@:rtti` was + added, an exception of type `String` is thrown. + + If `c` is `null`, the result is unspecified. + **/ + static public function getRtti(c:Class):Classdef { + var rtti = Reflect.field(c, "__rtti"); + if (rtti == null) { + throw 'Class ${Type.getClassName(c)} has no RTTI information, consider adding @:rtti'; + } + var x = Xml.parse(rtti).firstElement(); + var infos = new haxe.rtti.XmlParser().processElement(x); + switch (infos) { + case TClassdecl(c): + return c; + case var t: + throw 'Enum mismatch: expected TClassDecl but found $t'; + } + } + + /** + Tells if `c` has runtime type information. + + If `c` is `null`, the result is unspecified. + **/ + static public function hasRtti(c:Class):Bool { + return Lambda.has(Type.getClassFields(c), "__rtti"); + } +} diff --git a/build/linux64_569e52e/std/haxe/rtti/XmlParser.hx b/build/linux64_569e52e/std/haxe/rtti/XmlParser.hx new file mode 100644 index 0000000..8f7ac5a --- /dev/null +++ b/build/linux64_569e52e/std/haxe/rtti/XmlParser.hx @@ -0,0 +1,637 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.rtti; + +import haxe.rtti.CType; +import haxe.xml.Access; + +/** + XmlParser processes the runtime type information (RTTI) which + is stored as a XML string in a static field `__rtti`. + + @see +**/ +class XmlParser { + public var root:TypeRoot; + + var curplatform:String; + + public function new() { + root = new Array(); + } + + public function sort(?l:TypeRoot) { + if (l == null) + l = root; + l.sort(function(e1, e2) { + var n1 = switch e1 { + case TPackage(p, _, _): " " + p; + default: TypeApi.typeInfos(e1).path; + }; + var n2 = switch e2 { + case TPackage(p, _, _): " " + p; + default: TypeApi.typeInfos(e2).path; + }; + if (n1 > n2) + return 1; + return -1; + }); + for (x in l) + switch (x) { + case TPackage(_, _, l): + sort(l); + case TClassdecl(c): + sortFields(c.fields); + sortFields(c.statics); + case TEnumdecl(_): + case TAbstractdecl(_): + case TTypedecl(_): + } + } + + function sortFields(a:Array) { + a.sort(function(f1:ClassField, f2:ClassField) { + var v1 = TypeApi.isVar(f1.type); + var v2 = TypeApi.isVar(f2.type); + if (v1 && !v2) + return -1; + if (v2 && !v1) + return 1; + if (f1.name == "new") + return -1; + if (f2.name == "new") + return 1; + if (f1.name > f2.name) + return 1; + return -1; + }); + } + + public function process(x:Xml, platform:String) { + curplatform = platform; + xroot(new Access(x)); + } + + // merge inline and not inline + function mergeRights(f1:ClassField, f2:ClassField) { + if (f1.get == RInline && f1.set == RNo && f2.get == RNormal && f2.set == RMethod) { + f1.get = RNormal; + f1.set = RMethod; + return true; + } + return Type.enumEq(f1.get, f2.get) && Type.enumEq(f1.set, f2.set); + } + + function mergeDoc(f1:ClassField, f2:ClassField) { + if (f1.doc == null) + f1.doc = f2.doc; + else if (f2.doc == null) + f2.doc = f1.doc; + return true; + } + + function mergeFields(f:ClassField, f2:ClassField) { + return TypeApi.fieldEq(f, f2) + || (f.name == f2.name && (mergeRights(f, f2) || mergeRights(f2, f)) && mergeDoc(f, f2) && TypeApi.fieldEq(f, f2)); + } + + public dynamic function newField(c:Classdef, f:ClassField) {} + + function mergeClasses(c:Classdef, c2:Classdef) { + // todo : compare supers & interfaces + if (c.isInterface != c2.isInterface) + return false; + if (curplatform != null) + c.platforms.push(curplatform); + if (c.isExtern != c2.isExtern) + c.isExtern = false; + + for (f2 in c2.fields) { + var found = null; + for (f in c.fields) + if (mergeFields(f, f2)) { + found = f; + break; + } + if (found == null) { + newField(c, f2); + c.fields.push(f2); + } else if (curplatform != null) + found.platforms.push(curplatform); + } + for (f2 in c2.statics) { + var found = null; + for (f in c.statics) + if (mergeFields(f, f2)) { + found = f; + break; + } + if (found == null) { + newField(c, f2); + c.statics.push(f2); + } else if (curplatform != null) + found.platforms.push(curplatform); + } + return true; + } + + function mergeEnums(e:Enumdef, e2:Enumdef) { + if (e.isExtern != e2.isExtern) + return false; + if (curplatform != null) + e.platforms.push(curplatform); + for (c2 in e2.constructors) { + var found = null; + for (c in e.constructors) + if (TypeApi.constructorEq(c, c2)) { + found = c; + break; + } + if (found == null) + e.constructors.push(c2); + else if (curplatform != null) + found.platforms.push(curplatform); + } + return true; + } + + function mergeTypedefs(t:Typedef, t2:Typedef) { + if (curplatform == null) + return false; + t.platforms.push(curplatform); + t.types.set(curplatform, t2.type); + return true; + } + + function mergeAbstracts(a:Abstractdef, a2:Abstractdef) { + if (curplatform == null) + return false; + if (a.to.length != a2.to.length || a.from.length != a2.from.length) + return false; + for (i in 0...a.to.length) + if (!TypeApi.typeEq(a.to[i].t, a2.to[i].t)) + return false; + for (i in 0...a.from.length) + if (!TypeApi.typeEq(a.from[i].t, a2.from[i].t)) + return false; + if (a2.impl != null) + mergeClasses(a.impl, a2.impl); + a.platforms.push(curplatform); + return true; + } + + function merge(t:TypeTree) { + var inf = TypeApi.typeInfos(t); + var pack = inf.path.split("."); + var cur = root; + var curpack = new Array(); + pack.pop(); + for (p in pack) { + var found = false; + for (pk in cur) + switch (pk) { + case TPackage(pname, _, subs): + if (pname == p) { + found = true; + cur = subs; + break; + } + default: + } + curpack.push(p); + if (!found) { + var pk = new Array(); + cur.push(TPackage(p, curpack.join("."), pk)); + cur = pk; + } + } + for (ct in cur) { + if (ct.match(TPackage(_))) + continue; + var tinf = TypeApi.typeInfos(ct); + + // compare params ? + if (tinf.path == inf.path) { + var sameType = true; + if ((tinf.doc == null) != (inf.doc == null)) { + if (inf.doc == null) + inf.doc = tinf.doc; + else + tinf.doc = inf.doc; + } + if (tinf.path == "haxe._Int64.NativeInt64") + continue; + if (tinf.module == inf.module && tinf.doc == inf.doc && tinf.isPrivate == inf.isPrivate) + switch (ct) { + case TClassdecl(c): + switch (t) { + case TClassdecl(c2): + if (mergeClasses(c, c2)) + return; + default: + sameType = false; + } + case TEnumdecl(e): + switch (t) { + case TEnumdecl(e2): + if (mergeEnums(e, e2)) + return; + default: + sameType = false; + } + case TTypedecl(td): + switch (t) { + case TTypedecl(td2): + if (mergeTypedefs(td, td2)) + return; + default: + } + case TAbstractdecl(a): + switch (t) { + case TAbstractdecl(a2): + if (mergeAbstracts(a, a2)) + return; + default: + sameType = false; + } + case TPackage(_, _, _): + sameType = false; + } + // we already have a mapping, but which is incompatible + var msg = if (tinf.module != inf.module) "module " + inf.module + " should be " + tinf.module; else if (tinf.doc != inf.doc) + "documentation is different"; + else if (tinf.isPrivate != inf.isPrivate) + "private flag is different"; + else if (!sameType) + "type kind is different"; + else + "could not merge definition"; + throw "Incompatibilities between " + tinf.path + " in " + tinf.platforms.join(",") + " and " + curplatform + " (" + msg + ")"; + } + } + cur.push(t); + } + + function mkPath(p:String):Path { + return p; + } + + function mkTypeParams(p:String):TypeParams { + var pl = p.split(":"); + if (pl[0] == "") + return new Array(); + return pl; + } + + function mkRights(r:String):Rights { + return switch (r) { + case "null": RNo; + case "method": RMethod; + case "dynamic": RDynamic; + case "inline": RInline; + default: RCall(r); + } + } + + function xerror(c:Access):Dynamic { + return throw "Invalid " + c.name; + } + + function xroot(x:Access) { + for (c in x.x.elements()) + merge(processElement(c)); + } + + public function processElement(x:Xml) { + var c = new haxe.xml.Access(x); + return switch (c.name) { + case "class": TClassdecl(xclass(c)); + case "enum": TEnumdecl(xenum(c)); + case "typedef": TTypedecl(xtypedef(c)); + case "abstract": TAbstractdecl(xabstract(c)); + default: xerror(c); + } + } + + function xmeta(x:Access):MetaData { + var ml = []; + for (m in x.nodes.m) { + var pl = []; + for (p in m.nodes.e) + pl.push(p.innerHTML); + ml.push({name: m.att.n, params: pl}); + } + return ml; + } + + function xoverloads(x:Access):Array { + var l = new Array(); + for (m in x.elements) { + l.push(xclassfield(m)); + } + return l; + } + + function xpath(x:Access):PathParams { + var path = mkPath(x.att.path); + var params = new Array(); + for (c in x.elements) + params.push(xtype(c)); + return { + path: path, + params: params, + }; + } + + function xclass(x:Access):Classdef { + var csuper = null; + var doc = null; + var tdynamic = null; + var interfaces = new Array(); + var fields = new Array(); + var statics = new Array(); + var meta = []; + var isInterface = x.x.exists("interface"); + for (c in x.elements) + switch (c.name) { + case "haxe_doc": + doc = c.innerData; + case "extends": + if (isInterface) { + interfaces.push(xpath(c)); + } else { + csuper = xpath(c); + } + case "implements": + interfaces.push(xpath(c)); + case "haxe_dynamic": + tdynamic = xtype(new Access(c.x.firstElement())); + case "meta": + meta = xmeta(c); + default: + if (c.x.exists("static")) + statics.push(xclassfield(c)); + else + fields.push(xclassfield(c)); + } + return { + file: if (x.has.file) x.att.file else null, + path: mkPath(x.att.path), + module: if (x.has.module) mkPath(x.att.module) else null, + doc: doc, + isPrivate: x.x.exists("private"), + isExtern: x.x.exists("extern"), + isFinal: x.x.exists("final"), + isInterface: isInterface, + params: mkTypeParams(x.att.params), + superClass: csuper, + interfaces: interfaces, + fields: fields, + statics: statics, + tdynamic: tdynamic, + platforms: defplat(), + meta: meta, + }; + } + + function xclassfield(x:Access, ?defPublic = false):ClassField { + var e = x.elements; + var t = xtype(e.next()); + var doc = null; + var meta = []; + var overloads = null; + for (c in e) + switch (c.name) { + case "haxe_doc": + doc = c.innerData; + case "meta": + meta = xmeta(c); + case "overloads": + overloads = xoverloads(c); + default: + xerror(c); + } + return { + name:x.name, type:t, isPublic:x.x.exists("public") || defPublic, isFinal:x.x.exists("final"), isOverride:x.x.exists("override"), + line:if (x.has.line) Std.parseInt(x.att.line) else null, doc:doc, get:if (x.has.get) mkRights(x.att.get) else RNormal, set:if (x.has.set) + mkRights(x.att.set) + else + RNormal, params:if (x.has.params) mkTypeParams(x.att.params) else [], platforms:defplat(), meta:meta, overloads:overloads, expr:if (x.has.expr) + x.att.expr + else + null + }; + } + + function xenum(x:Access):Enumdef { + var cl = new Array(); + var doc = null; + var meta = []; + for (c in x.elements) + if (c.name == "haxe_doc") + doc = c.innerData; + else if (c.name == "meta") + meta = xmeta(c); + else + cl.push(xenumfield(c)); + return { + file: if (x.has.file) x.att.file else null, + path: mkPath(x.att.path), + module: if (x.has.module) mkPath(x.att.module) else null, + doc: doc, + isPrivate: x.x.exists("private"), + isExtern: x.x.exists("extern"), + params: mkTypeParams(x.att.params), + constructors: cl, + platforms: defplat(), + meta: meta, + }; + } + + function xenumfield(x:Access):EnumField { + var args = null; + var docElements = x.x.elementsNamed("haxe_doc"); + var xdoc = if (docElements.hasNext()) docElements.next() else null; + var meta = if (x.hasNode.meta) xmeta(x.node.meta) else []; + if (x.has.a) { + var names = x.att.a.split(":"); + var elts = x.elements; + args = new Array(); + for (c in names) { + var opt = false; + if (c.charAt(0) == "?") { + opt = true; + c = c.substr(1); + } + args.push({ + name: c, + opt: opt, + t: xtype(elts.next()), + }); + } + } + return { + name: x.name, + args: args, + doc: if (xdoc == null) null else new Access(xdoc).innerData, + meta: meta, + platforms: defplat(), + }; + } + + function xabstract(x:Access):Abstractdef { + var doc = null, impl = null, athis = null; + var meta = [], to = [], from = []; + for (c in x.elements) + switch (c.name) { + case "haxe_doc": + doc = c.innerData; + case "meta": + meta = xmeta(c); + case "to": + for (t in c.elements) + to.push({t: xtype(new Access(t.x.firstElement())), field: t.has.field ? t.att.field : null}); + case "from": + for (t in c.elements) + from.push({t: xtype(new Access(t.x.firstElement())), field: t.has.field ? t.att.field : null}); + case "impl": + impl = xclass(c.node.resolve("class")); + case "this": + athis = xtype(new Access(c.x.firstElement())); + default: + xerror(c); + } + return { + file: if (x.has.file) x.att.file else null, + path: mkPath(x.att.path), + module: if (x.has.module) mkPath(x.att.module) else null, + doc: doc, + isPrivate: x.x.exists("private"), + params: mkTypeParams(x.att.params), + platforms: defplat(), + meta: meta, + athis: athis, + to: to, + from: from, + impl: impl + }; + } + + function xtypedef(x:Access):Typedef { + var doc = null; + var t = null; + var meta = []; + for (c in x.elements) + if (c.name == "haxe_doc") + doc = c.innerData; + else if (c.name == "meta") + meta = xmeta(c); + else + t = xtype(c); + var types = new haxe.ds.StringMap(); + if (curplatform != null) + types.set(curplatform, t); + return { + file: if (x.has.file) x.att.file else null, + path: mkPath(x.att.path), + module: if (x.has.module) mkPath(x.att.module) else null, + doc: doc, + isPrivate: x.x.exists("private"), + params: mkTypeParams(x.att.params), + type: t, + types: types, + platforms: defplat(), + meta: meta, + }; + } + + function xtype(x:Access):CType { + return switch (x.name) { + case "unknown": + CUnknown; + case "e": + CEnum(mkPath(x.att.path), xtypeparams(x)); + case "c": + CClass(mkPath(x.att.path), xtypeparams(x)); + case "t": + CTypedef(mkPath(x.att.path), xtypeparams(x)); + case "x": + CAbstract(mkPath(x.att.path), xtypeparams(x)); + case "f": + var args = new Array(); + var aname = x.att.a.split(":"); + var eargs = aname.iterator(); + var evalues = x.has.v ? x.att.v.split(":").iterator() : null; + for (e in x.elements) { + var opt = false; + var a = eargs.hasNext() ? eargs.next() : null; + if (a == null) + a = ""; + if (a.charAt(0) == "?") { + opt = true; + a = a.substr(1); + } + var v = evalues == null || !evalues.hasNext() ? null : evalues.next(); + args.push({ + name: a, + opt: opt, + t: xtype(e), + value: v == "" ? null : v + }); + } + var ret = args[args.length - 1]; + args.remove(ret); + CFunction(args, ret.t); + case "a": + var fields = new Array(); + for (f in x.elements) { + var f = xclassfield(f, true); + f.platforms = new Array(); // platforms selection are on the type itself, not on fields + fields.push(f); + } + CAnonymous(fields); + case "d": + var t = null; + var tx = x.x.firstElement(); + if (tx != null) + t = xtype(new Access(tx)); + CDynamic(t); + default: + xerror(x); + } + } + + function xtypeparams(x:Access):Array { + var p = new Array(); + for (c in x.elements) + p.push(xtype(c)); + return p; + } + + function defplat() { + var l = new Array(); + if (curplatform != null) + l.push(curplatform); + return l; + } +} diff --git a/build/linux64_569e52e/std/haxe/xml/Access.hx b/build/linux64_569e52e/std/haxe/xml/Access.hx new file mode 100644 index 0000000..b97b7f6 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/xml/Access.hx @@ -0,0 +1,243 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.xml; + +private abstract NodeAccess(Xml) from Xml { + @:op(a.b) + public function resolve(name:String):Access { + var x = this.elementsNamed(name).next(); + if (x == null) { + var xname = if (this.nodeType == Xml.Document) "Document" else this.nodeName; + throw xname + " is missing element " + name; + } + return new Access(x); + } +} + +private abstract AttribAccess(Xml) from Xml { + @:op(a.b) + public function resolve(name:String):String { + if (this.nodeType == Xml.Document) + throw "Cannot access document attribute " + name; + var v = this.get(name); + if (v == null) + throw this.nodeName + " is missing attribute " + name; + return v; + } + + @:op(a.b) + function _hx_set(name:String, value:String):String { + if (this.nodeType == Xml.Document) + throw "Cannot access document attribute " + name; + this.set(name, value); + return value; + } +} + +private abstract HasAttribAccess(Xml) from Xml { + @:op(a.b) + public function resolve(name:String):Bool { + if (this.nodeType == Xml.Document) + throw "Cannot access document attribute " + name; + return this.exists(name); + } +} + +private abstract HasNodeAccess(Xml) from Xml { + @:op(a.b) + public function resolve(name:String):Bool { + return this.elementsNamed(name).hasNext(); + } +} + +private abstract NodeListAccess(Xml) from Xml { + @:op(a.b) + public function resolve(name:String):Array { + var l = []; + for (x in this.elementsNamed(name)) + l.push(new Access(x)); + return l; + } +} + +/** + The `haxe.xml.Access` API helps providing a fast dot-syntax access to the + most common `Xml` methods. +**/ +abstract Access(Xml) { + public var x(get, never):Xml; + + public inline function get_x() + return this; + + /** + The name of the current element. This is the same as `Xml.nodeName`. + **/ + public var name(get, never):String; + + inline function get_name() { + return if (this.nodeType == Xml.Document) "Document" else this.nodeName; + } + + /** + The inner PCDATA or CDATA of the node. + + An exception is thrown if there is no data or if there not only data + but also other nodes. + **/ + public var innerData(get, never):String; + + /** + The XML string built with all the sub nodes, excluding the current one. + **/ + public var innerHTML(get, never):String; + + /** + Access to the first sub element with the given name. + + An exception is thrown if the element doesn't exists. + Use `hasNode` to check the existence of a node. + + ```haxe + var access = new haxe.xml.Access(Xml.parse("John")); + var user = access.node.user; + var name = user.node.name; + trace(name.innerData); // John + + // Uncaught Error: Document is missing element password + var password = user.node.password; + ``` + **/ + public var node(get, never):NodeAccess; + + inline function get_node():NodeAccess + return x; + + /** + Access to the List of elements with the given name. + ```haxe + var fast = new haxe.xml.Access(Xml.parse(" + + + + + " + )); + + var users = fast.node.users; + for (user in users.nodes.user) { + trace(user.att.name); + } + ``` + **/ + public var nodes(get, never):NodeListAccess; + + inline function get_nodes():NodeListAccess + return this; + + /** + Access to a given attribute. + + An exception is thrown if the attribute doesn't exists. + Use `has` to check the existence of an attribute. + + ```haxe + var f = new haxe.xml.Access(Xml.parse("")); + var user = f.node.user; + if (user.has.name) { + trace(user.att.name); // Mark + } + ``` + **/ + public var att(get, never):AttribAccess; + + inline function get_att():AttribAccess + return this; + + /** + Check the existence of an attribute with the given name. + **/ + public var has(get, never):HasAttribAccess; + + inline function get_has():HasAttribAccess + return this; + + /** + Check the existence of a sub node with the given name. + + ```haxe + var f = new haxe.xml.Access(Xml.parse("31")); + var user = f.node.user; + if (user.hasNode.age) { + trace(user.node.age.innerData); // 31 + } + ``` + **/ + public var hasNode(get, never):HasNodeAccess; + + inline function get_hasNode():HasNodeAccess + return x; + + /** + The list of all sub-elements which are the nodes with type `Xml.Element`. + **/ + public var elements(get, never):Iterator; + + inline function get_elements():Iterator + return cast this.elements(); + + public inline function new(x:Xml) { + if (x.nodeType != Xml.Document && x.nodeType != Xml.Element) + throw "Invalid nodeType " + x.nodeType; + this = x; + } + + function get_innerData() { + var it = this.iterator(); + if (!it.hasNext()) + throw name + " does not have data"; + var v = it.next(); + if (it.hasNext()) { + var n = it.next(); + // handle CDATA + if (v.nodeType == Xml.PCData && n.nodeType == Xml.CData && StringTools.trim(v.nodeValue) == "") { + if (!it.hasNext()) + return n.nodeValue; + var n2 = it.next(); + if (n2.nodeType == Xml.PCData && StringTools.trim(n2.nodeValue) == "" && !it.hasNext()) + return n.nodeValue; + } + throw name + " does not only have data"; + } + if (v.nodeType != Xml.PCData && v.nodeType != Xml.CData) + throw name + " does not have data"; + return v.nodeValue; + } + + function get_innerHTML() { + var s = new StringBuf(); + for (x in this) + s.add(x.toString()); + return s.toString(); + } +} diff --git a/build/linux64_569e52e/std/haxe/xml/Check.hx b/build/linux64_569e52e/std/haxe/xml/Check.hx new file mode 100644 index 0000000..94c5e75 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/xml/Check.hx @@ -0,0 +1,329 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.xml; + +enum Filter { + FInt; + FBool; + FEnum(values:Array); + FReg(matcher:EReg); +} + +enum Attrib { + Att(name:String, ?filter:Filter, ?defvalue:String); +} + +enum Rule { + RNode(name:String, ?attribs:Array, ?childs:Rule); + RData(?filter:Filter); + RMulti(rule:Rule, ?atLeastOne:Bool); + RList(rules:Array, ?ordered:Bool); + RChoice(choices:Array); + ROptional(rule:Rule); +} + +private enum CheckResult { + CMatch; + CMissing(r:Rule); + CExtra(x:Xml); + CElementExpected(name:String, x:Xml); + CDataExpected(x:Xml); + CExtraAttrib(att:String, x:Xml); + CMissingAttrib(att:String, x:Xml); + CInvalidAttrib(att:String, x:Xml, f:Filter); + CInvalidData(x:Xml, f:Filter); + CInElement(x:Xml, r:CheckResult); +} + +class Check { + static var blanks = ~/^[ \r\n\t]*$/; + + static function isBlank(x:Xml) { + return (x.nodeType == Xml.PCData && blanks.match(x.nodeValue)) || x.nodeType == Xml.Comment; + } + + static function filterMatch(s:String, f:Filter) { + switch (f) { + case FInt: + return filterMatch(s, FReg(~/[0-9]+/)); + case FBool: + return filterMatch(s, FEnum(["true", "false", "0", "1"])); + case FEnum(values): + for (v in values) + if (s == v) + return true; + return false; + case FReg(r): + return r.match(s); + } + } + + static function isNullable(r:Rule) { + switch (r) { + case RMulti(r, one): + return (one != true || isNullable(r)); + case RList(rl, _): + for (r in rl) + if (!isNullable(r)) + return false; + return true; + case RChoice(rl): + for (r in rl) + if (isNullable(r)) + return true; + return false; + case RData(_): + return false; + case RNode(_, _, _): + return false; + case ROptional(_): + return true; + } + } + + static function check(x:Xml, r:Rule) { + switch (r) { + // check the node validity + case RNode(name, attribs, childs): + if (x.nodeType != Xml.Element || x.nodeName != name) + return CElementExpected(name, x); + var attribs = if (attribs == null) new Array() else attribs.copy(); + // check defined attributes + for (xatt in x.attributes()) { + var found = false; + for (att in attribs) + switch (att) { + case Att(name, filter, _): + if (xatt != name) + continue; + if (filter != null && !filterMatch(x.get(xatt), filter)) + return CInvalidAttrib(name, x, filter); + attribs.remove(att); + found = true; + } + if (!found) + return CExtraAttrib(xatt, x); + } + // check remaining unchecked attributes + for (att in attribs) + switch (att) { + case Att(name, _, defvalue): + if (defvalue == null) + return CMissingAttrib(name, x); + } + // check childs + if (childs == null) + childs = RList([]); + var m = checkList(x.iterator(), childs); + if (m != CMatch) + return CInElement(x, m); + // set default attribs values + for (att in attribs) + switch (att) { + case Att(name, _, defvalue): + x.set(name, defvalue); + } + return CMatch; + // check the data validity + case RData(filter): + if (x.nodeType != Xml.PCData && x.nodeType != Xml.CData) + return CDataExpected(x); + if (filter != null && !filterMatch(x.nodeValue, filter)) + return CInvalidData(x, filter); + return CMatch; + // several choices + case RChoice(choices): + if (choices.length == 0) + throw "No choice possible"; + for (c in choices) + if (check(x, c) == CMatch) + return CMatch; + return check(x, choices[0]); + case ROptional(r): + return check(x, r); + default: + throw "Unexpected " + Std.string(r); + } + } + + static function checkList(it:Iterator, r:Rule) { + switch (r) { + case RList(rules, ordered): + var rules = rules.copy(); + for (x in it) { + if (isBlank(x)) + continue; + var found = false; + for (r in rules) { + var m = checkList([x].iterator(), r); + if (m == CMatch) { + found = true; + switch (r) { + case RMulti(rsub, one): + if (one) { + var i; + for (i in 0...rules.length) + if (rules[i] == r) + rules[i] = RMulti(rsub); + } + default: + rules.remove(r); + } + break; + } else if (ordered && !isNullable(r)) + return m; + } + if (!found) + return CExtra(x); + } + for (r in rules) + if (!isNullable(r)) + return CMissing(r); + return CMatch; + case RMulti(r, one): + var found = false; + for (x in it) { + if (isBlank(x)) + continue; + var m = checkList([x].iterator(), r); + if (m != CMatch) + return m; + found = true; + } + if (one && !found) + return CMissing(r); + return CMatch; + default: + var found = false; + for (x in it) { + if (isBlank(x)) + continue; + var m = check(x, r); + if (m != CMatch) + return m; + found = true; + break; + } + if (!found) { + switch (r) { + case ROptional(_): + default: return CMissing(r); + } + } + for (x in it) { + if (isBlank(x)) + continue; + return CExtra(x); + } + return CMatch; + } + } + + static function makeWhere(path:Array) { + if (path.length == 0) + return ""; + var s = "In "; + var first = true; + for (x in path) { + if (first) + first = false; + else + s += "."; + s += x.nodeName; + } + return s + ": "; + } + + static function makeString(x:Xml) { + if (x.nodeType == Xml.Element) + return "element " + x.nodeName; + var s = x.nodeValue.split("\r").join("\\r").split("\n").join("\\n").split("\t").join("\\t"); + if (s.length > 20) + return s.substr(0, 17) + "..."; + return s; + } + + static function makeRule(r:Rule) { + switch (r) { + case RNode(name, _, _): + return "element " + name; + case RData(_): + return "data"; + case RMulti(r, _): + return makeRule(r); + case RList(rules, _): + return makeRule(rules[0]); + case RChoice(choices): + return makeRule(choices[0]); + case ROptional(r): + return makeRule(r); + } + } + + static function makeError(m, ?path) { + if (path == null) + path = new Array(); + switch (m) { + case CMatch: + throw "assert"; + case CMissing(r): + return makeWhere(path) + "Missing " + makeRule(r); + case CExtra(x): + return makeWhere(path) + "Unexpected " + makeString(x); + case CElementExpected(name, x): + return makeWhere(path) + makeString(x) + " while expected element " + name; + case CDataExpected(x): + return makeWhere(path) + makeString(x) + " while data expected"; + case CExtraAttrib(att, x): + path.push(x); + return makeWhere(path) + "unexpected attribute " + att; + case CMissingAttrib(att, x): + path.push(x); + return makeWhere(path) + "missing required attribute " + att; + case CInvalidAttrib(att, x, _): + path.push(x); + return makeWhere(path) + "invalid attribute value for " + att; + case CInvalidData(x, _): + return makeWhere(path) + "invalid data format for " + makeString(x); + case CInElement(x, m): + path.push(x); + return makeError(m, path); + } + } + + public static function checkNode(x:Xml, r:Rule) { + var m = checkList([x].iterator(), r); + if (m == CMatch) + return; + throw makeError(m); + } + + public static function checkDocument(x:Xml, r:Rule) { + if (x.nodeType != Xml.Document) + throw "Document expected"; + var m = checkList(x.iterator(), r); + if (m == CMatch) + return; + throw makeError(m); + } +} diff --git a/build/linux64_569e52e/std/haxe/xml/Fast.hx b/build/linux64_569e52e/std/haxe/xml/Fast.hx new file mode 100644 index 0000000..97a7006 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/xml/Fast.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.xml; + +@:deprecated typedef Fast = haxe.xml.Access; diff --git a/build/linux64_569e52e/std/haxe/xml/Parser.hx b/build/linux64_569e52e/std/haxe/xml/Parser.hx new file mode 100644 index 0000000..c5e5d01 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/xml/Parser.hx @@ -0,0 +1,419 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.xml; + +using StringTools; + +private enum abstract S(Int) { + var IGNORE_SPACES; + var BEGIN; + var BEGIN_NODE; + var TAG_NAME; + var BODY; + var ATTRIB_NAME; + var EQUALS; + var ATTVAL_BEGIN; + var ATTRIB_VAL; + var CHILDS; + var CLOSE; + var WAIT_END; + var WAIT_END_RET; + var PCDATA; + var HEADER; + var COMMENT; + var DOCTYPE; + var CDATA; + var ESCAPE; +} + +class XmlParserException { + /** + the XML parsing error message + **/ + public var message:String; + + /** + the line number at which the XML parsing error occurred + **/ + public var lineNumber:Int; + + /** + the character position in the reported line at which the parsing error occurred + **/ + public var positionAtLine:Int; + + /** + the character position in the XML string at which the parsing error occurred + **/ + public var position:Int; + + /** + the invalid XML string + **/ + public var xml:String; + + public function new(message:String, xml:String, position:Int) { + this.xml = xml; + this.message = message; + this.position = position; + lineNumber = 1; + positionAtLine = 0; + + for (i in 0...position) { + var c = xml.fastCodeAt(i); + if (c == '\n'.code) { + lineNumber++; + positionAtLine = 0; + } else { + if (c != '\r'.code) + positionAtLine++; + } + } + } + + public function toString():String { + return Type.getClassName(Type.getClass(this)) + ": " + message + " at line " + lineNumber + " char " + positionAtLine; + } +} + +class Parser { + static var escapes = { + var h = new haxe.ds.StringMap(); + h.set("lt", "<"); + h.set("gt", ">"); + h.set("amp", "&"); + h.set("quot", '"'); + h.set("apos", "'"); + h; + } + + /** + Parses the String into an XML Document. Set strict parsing to true in order to enable a strict check of XML attributes and entities. + + @throws haxe.xml.XmlParserException + **/ + static public function parse(str:String, strict = false) { + var doc = Xml.createDocument(); + doParse(str, strict, 0, doc); + return doc; + } + + static function doParse(str:String, strict:Bool, p:Int = 0, ?parent:Xml):Int { + var xml:Xml = null; + var state = S.BEGIN; + var next = S.BEGIN; + var aname = null; + var start = 0; + var nsubs = 0; + var nbrackets = 0; + var buf = new StringBuf(); + // need extra state because next is in use + var escapeNext = S.BEGIN; + var attrValQuote = -1; + inline function addChild(xml:Xml) { + parent.addChild(xml); + nsubs++; + } + while (p < str.length) { + var c = str.unsafeCodeAt(p); + switch (state) { + case S.IGNORE_SPACES: + switch (c) { + case '\n'.code, '\r'.code, '\t'.code, ' '.code: + default: + state = next; + continue; + } + case S.BEGIN: + switch (c) { + case '<'.code: + state = S.IGNORE_SPACES; + next = S.BEGIN_NODE; + default: + start = p; + state = S.PCDATA; + continue; + } + case S.PCDATA: + if (c == '<'.code) { + buf.addSub(str, start, p - start); + var child = Xml.createPCData(buf.toString()); + buf = new StringBuf(); + addChild(child); + state = S.IGNORE_SPACES; + next = S.BEGIN_NODE; + } else if (c == '&'.code) { + buf.addSub(str, start, p - start); + state = S.ESCAPE; + escapeNext = S.PCDATA; + start = p + 1; + } + case S.CDATA: + if (c == ']'.code && str.fastCodeAt(p + 1) == ']'.code && str.fastCodeAt(p + 2) == '>'.code) { + var child = Xml.createCData(str.substr(start, p - start)); + addChild(child); + p += 2; + state = S.BEGIN; + } + case S.BEGIN_NODE: + switch (c) { + case '!'.code: + if (str.fastCodeAt(p + 1) == '['.code) { + p += 2; + if (str.substr(p, 6).toUpperCase() != "CDATA[") + throw new XmlParserException("Expected '.code: + state = S.CHILDS; + default: + state = S.ATTRIB_NAME; + start = p; + continue; + } + case S.ATTRIB_NAME: + if (!isValidChar(c)) { + var tmp; + if (start == p) + throw new XmlParserException("Expected attribute name", str, p); + tmp = str.substr(start, p - start); + aname = tmp; + if (xml.exists(aname)) + throw new XmlParserException("Duplicate attribute [" + aname + "]", str, p); + state = S.IGNORE_SPACES; + next = S.EQUALS; + continue; + } + case S.EQUALS: + switch (c) { + case '='.code: + state = S.IGNORE_SPACES; + next = S.ATTVAL_BEGIN; + default: + throw new XmlParserException("Expected =", str, p); + } + case S.ATTVAL_BEGIN: + switch (c) { + case '"'.code | '\''.code: + buf = new StringBuf(); + state = S.ATTRIB_VAL; + start = p + 1; + attrValQuote = c; + default: + throw new XmlParserException("Expected \"", str, p); + } + case S.ATTRIB_VAL: + switch (c) { + case '&'.code: + buf.addSub(str, start, p - start); + state = S.ESCAPE; + escapeNext = S.ATTRIB_VAL; + start = p + 1; + case '>'.code | '<'.code if (strict): + // HTML allows these in attributes values + throw new XmlParserException("Invalid unescaped " + String.fromCharCode(c) + " in attribute value", str, p); + case _ if (c == attrValQuote): + buf.addSub(str, start, p - start); + var val = buf.toString(); + buf = new StringBuf(); + xml.set(aname, val); + state = S.IGNORE_SPACES; + next = S.BODY; + } + case S.CHILDS: + p = doParse(str, strict, p, xml); + start = p; + state = S.BEGIN; + case S.WAIT_END: + switch (c) { + case '>'.code: + state = S.BEGIN; + default: + throw new XmlParserException("Expected >", str, p); + } + case S.WAIT_END_RET: + switch (c) { + case '>'.code: + if (nsubs == 0) + parent.addChild(Xml.createPCData("")); + return p; + default: + throw new XmlParserException("Expected >", str, p); + } + case S.CLOSE: + if (!isValidChar(c)) { + if (start == p) + throw new XmlParserException("Expected node name", str, p); + + var v = str.substr(start, p - start); + if (parent == null || parent.nodeType != Element) { + throw new XmlParserException('Unexpected , tag is not open', str, p); + } + if (v != parent.nodeName) + throw new XmlParserException("Expected ", str, p); + + state = S.IGNORE_SPACES; + next = S.WAIT_END_RET; + continue; + } + case S.COMMENT: + if (c == '-'.code && str.fastCodeAt(p + 1) == '-'.code && str.fastCodeAt(p + 2) == '>'.code) { + addChild(Xml.createComment(str.substr(start, p - start))); + p += 2; + state = S.BEGIN; + } + case S.DOCTYPE: + if (c == '['.code) + nbrackets++; + else if (c == ']'.code) + nbrackets--; + else if (c == '>'.code && nbrackets == 0) { + addChild(Xml.createDocType(str.substr(start, p - start))); + state = S.BEGIN; + } + case S.HEADER: + if (c == '?'.code && str.fastCodeAt(p + 1) == '>'.code) { + p++; + var str = str.substr(start + 1, p - start - 2); + addChild(Xml.createProcessingInstruction(str)); + state = S.BEGIN; + } + case S.ESCAPE: + if (c == ';'.code) { + var s = str.substr(start, p - start); + if (s.fastCodeAt(0) == '#'.code) { + var c = s.fastCodeAt(1) == 'x'.code ? Std.parseInt("0" + s.substr(1, s.length - 1)) : Std.parseInt(s.substr(1, s.length - 1)); + #if !(target.unicode) + if (c >= 128) { + // UTF8-encode it + if (c <= 0x7FF) { + buf.addChar(0xC0 | (c >> 6)); + buf.addChar(0x80 | (c & 63)); + } else if (c <= 0xFFFF) { + buf.addChar(0xE0 | (c >> 12)); + buf.addChar(0x80 | ((c >> 6) & 63)); + buf.addChar(0x80 | (c & 63)); + } else if (c <= 0x10FFFF) { + buf.addChar(0xF0 | (c >> 18)); + buf.addChar(0x80 | ((c >> 12) & 63)); + buf.addChar(0x80 | ((c >> 6) & 63)); + buf.addChar(0x80 | (c & 63)); + } else + throw new XmlParserException("Cannot encode UTF8-char " + c, str, p); + } else + #end + buf.addChar(c); + } else if (!escapes.exists(s)) { + if (strict) + throw new XmlParserException("Undefined entity: " + s, str, p); + buf.add('&$s;'); + } else { + buf.add(escapes.get(s)); + } + start = p + 1; + state = escapeNext; + } else if (!isValidChar(c) && c != "#".code) { + if (strict) + throw new XmlParserException("Invalid character in entity: " + String.fromCharCode(c), str, p); + buf.addChar("&".code); + buf.addSub(str, start, p - start); + p--; + start = p + 1; + state = escapeNext; + } + } + ++p; + } + + if (state == S.BEGIN) { + start = p; + state = S.PCDATA; + } + + if (state == S.PCDATA) { + if (parent.nodeType == Element) { + throw new XmlParserException("Unclosed node <" + parent.nodeName + ">", str, p); + } + if (p != start || nsubs == 0) { + buf.addSub(str, start, p - start); + addChild(Xml.createPCData(buf.toString())); + } + return p; + } + + if (!strict && state == S.ESCAPE && escapeNext == S.PCDATA) { + buf.addChar("&".code); + buf.addSub(str, start, p - start); + addChild(Xml.createPCData(buf.toString())); + return p; + } + + throw new XmlParserException("Unexpected end", str, p); + } + + static inline function isValidChar(c) { + return (c >= 'a'.code && c <= 'z'.code) || (c >= 'A'.code && c <= 'Z'.code) || (c >= '0'.code && c <= '9'.code) || c == ':'.code || c == '.'.code + || c == '_'.code || c == '-'.code; + } +} diff --git a/build/linux64_569e52e/std/haxe/xml/Printer.hx b/build/linux64_569e52e/std/haxe/xml/Printer.hx new file mode 100644 index 0000000..d646618 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/xml/Printer.hx @@ -0,0 +1,128 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.xml; + +/** + This class provides utility methods to convert Xml instances to + String representation. +**/ +class Printer { + /** + Convert `Xml` to string representation. + + Set `pretty` to `true` to prettify the result. + **/ + static public function print(xml:Xml, ?pretty = false) { + var printer = new Printer(pretty); + printer.writeNode(xml, ""); + return printer.output.toString(); + } + + var output:StringBuf; + var pretty:Bool; + + function new(pretty) { + output = new StringBuf(); + this.pretty = pretty; + } + + function writeNode(value:Xml, tabs:String) { + switch (value.nodeType) { + case CData: + write(tabs + ""); + newline(); + case Comment: + var commentContent:String = value.nodeValue; + commentContent = ~/[\n\r\t]+/g.replace(commentContent, ""); + commentContent = ""; + write(tabs); + write(StringTools.trim(commentContent)); + newline(); + case Document: + for (child in value) { + writeNode(child, tabs); + } + case Element: + write(tabs + "<"); + write(value.nodeName); + for (attribute in value.attributes()) { + write(" " + attribute + "=\""); + write(StringTools.htmlEscape(value.get(attribute), true)); + write("\""); + } + if (hasChildren(value)) { + write(">"); + newline(); + for (child in value) { + writeNode(child, pretty ? tabs + "\t" : tabs); + } + write(tabs + ""); + newline(); + } else { + write("/>"); + newline(); + } + case PCData: + var nodeValue:String = value.nodeValue; + if (nodeValue.length != 0) { + write(tabs + StringTools.htmlEscape(nodeValue)); + newline(); + } + case ProcessingInstruction: + write(""); + newline(); + case DocType: + write(""); + newline(); + } + } + + inline function write(input:String) { + output.add(input); + } + + inline function newline() { + if (pretty) { + output.add("\n"); + } + } + + function hasChildren(value:Xml):Bool { + for (child in value) { + switch (child.nodeType) { + case Element, PCData: + return true; + case CData, Comment: + if (StringTools.ltrim(child.nodeValue).length != 0) { + return true; + } + case _: + } + } + return false; + } +} diff --git a/build/linux64_569e52e/std/haxe/zip/Compress.hx b/build/linux64_569e52e/std/haxe/zip/Compress.hx new file mode 100644 index 0000000..120aed8 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/zip/Compress.hx @@ -0,0 +1,42 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.zip; + +class Compress { + public function new(level:Int) { + throw new haxe.exceptions.NotImplementedException("Not implemented for this platform"); + } + + public function execute(src:haxe.io.Bytes, srcPos:Int, dst:haxe.io.Bytes, dstPos:Int):{done:Bool, read:Int, write:Int} { + return null; + } + + public function setFlushMode(f:FlushMode) {} + + public function close() {} + + public static function run(s:haxe.io.Bytes, level:Int):haxe.io.Bytes { + throw new haxe.exceptions.NotImplementedException("Not implemented for this platform"); + return null; + } +} diff --git a/build/linux64_569e52e/std/haxe/zip/Entry.hx b/build/linux64_569e52e/std/haxe/zip/Entry.hx new file mode 100644 index 0000000..a6c7490 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/zip/Entry.hx @@ -0,0 +1,42 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.zip; + +import haxe.ds.List; + +enum ExtraField { + FUnknown(tag:Int, bytes:haxe.io.Bytes); + FInfoZipUnicodePath(name:String, crc:Int); + FUtf8; +} + +typedef Entry = { + var fileName:String; + var fileSize:Int; + var fileTime:Date; + var compressed:Bool; + var dataSize:Int; + var data:Null; + var crc32:Null; + var ?extraFields:List; +} diff --git a/build/linux64_569e52e/std/haxe/zip/FlushMode.hx b/build/linux64_569e52e/std/haxe/zip/FlushMode.hx new file mode 100644 index 0000000..8e47a69 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/zip/FlushMode.hx @@ -0,0 +1,31 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.zip; + +enum FlushMode { + NO; + SYNC; + FULL; + FINISH; + BLOCK; +} diff --git a/build/linux64_569e52e/std/haxe/zip/Huffman.hx b/build/linux64_569e52e/std/haxe/zip/Huffman.hx new file mode 100644 index 0000000..e278d18 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/zip/Huffman.hx @@ -0,0 +1,120 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.zip; + +enum Huffman { + Found(i:Int); + NeedBit(left:Huffman, right:Huffman); + NeedBits(n:Int, table:Array); +} + +class HuffTools { + public function new() {} + + function treeDepth(t) { + return switch (t) { + case Found(_): 0; + case NeedBits(_, _): throw "assert"; + case NeedBit(a, b): + var da = treeDepth(a); + var db = treeDepth(b); + 1 + ((da < db) ? da : db); + } + } + + function treeCompress(t) { + var d = treeDepth(t); + if (d == 0) + return t; + if (d == 1) + return switch (t) { + case NeedBit(a, b): NeedBit(treeCompress(a), treeCompress(b)); + default: throw "assert"; + } + var size = 1 << d; + var table = new Array(); + for (i in 0...size) + table.push(Found(-1)); + treeWalk(table, 0, 0, d, t); + return NeedBits(d, table); + } + + function treeWalk(table, p, cd, d, t) { + switch (t) { + case NeedBit(a, b): + if (d > 0) { + treeWalk(table, p, cd + 1, d - 1, a); + treeWalk(table, p | (1 << cd), cd + 1, d - 1, b); + } else + table[p] = treeCompress(t); + default: + table[p] = treeCompress(t); + } + } + + function treeMake(bits:haxe.ds.IntMap, maxbits:Int, v:Int, len:Int) { + if (len > maxbits) + throw "Invalid huffman"; + var idx = (v << 5) | len; + if (bits.exists(idx)) + return Found(bits.get(idx)); + v <<= 1; + len += 1; + return NeedBit(treeMake(bits, maxbits, v, len), treeMake(bits, maxbits, v | 1, len)); + } + + public function make(lengths, pos, nlengths, maxbits) { + if (nlengths == 1) { + return NeedBit(Found(0), Found(0)); + } + var counts = new Array(); + var tmp = new Array(); + if (maxbits > 32) + throw "Invalid huffman"; + for (i in 0...maxbits) { + counts.push(0); + tmp.push(0); + } + for (i in 0...nlengths) { + var p = lengths[i + pos]; + if (p >= maxbits) + throw "Invalid huffman"; + counts[p]++; + } + var code = 0; + for (i in 1...maxbits - 1) { + code = (code + counts[i]) << 1; + tmp[i] = code; + } + var bits = new haxe.ds.IntMap(); + for (i in 0...nlengths) { + var l = lengths[i + pos]; + if (l != 0) { + var n = tmp[l - 1]; + tmp[l - 1] = n + 1; + bits.set((n << 5) | l, i); + } + } + return treeCompress(NeedBit(treeMake(bits, maxbits, 0, 1), treeMake(bits, maxbits, 1, 1))); + } +} diff --git a/build/linux64_569e52e/std/haxe/zip/InflateImpl.hx b/build/linux64_569e52e/std/haxe/zip/InflateImpl.hx new file mode 100644 index 0000000..8cf9992 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/zip/InflateImpl.hx @@ -0,0 +1,400 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.zip; + +import haxe.zip.Huffman; +import haxe.crypto.Adler32; + +private class Window { + public static inline var SIZE = 1 << 15; + public static inline var BUFSIZE = 1 << 16; + + public var buffer:haxe.io.Bytes; + public var pos:Int; + + var crc:Adler32; + + public function new(hasCrc) { + buffer = haxe.io.Bytes.alloc(BUFSIZE); + pos = 0; + if (hasCrc) + crc = new Adler32(); + } + + public function slide() { + if (crc != null) + crc.update(buffer, 0, SIZE); + var b = haxe.io.Bytes.alloc(BUFSIZE); + pos -= SIZE; + b.blit(0, buffer, SIZE, pos); + buffer = b; + } + + public function addBytes(b, p, len) { + if (pos + len > BUFSIZE) + slide(); + buffer.blit(pos, b, p, len); + pos += len; + } + + public function addByte(c) { + if (pos == BUFSIZE) + slide(); + buffer.set(pos, c); + pos++; + } + + public function getLastChar() { + return buffer.get(pos - 1); + } + + public function available() { + return pos; + } + + public function checksum() { + if (crc != null) + crc.update(buffer, 0, pos); + return crc; + } +} + +private enum State { + Head; + Block; + CData; + Flat; + Crc; + Dist; + DistOne; + Done; +} + +/** + A pure Haxe implementation of the ZLIB Inflate algorithm which allows reading compressed data without any platform-specific support. +**/ +class InflateImpl { + static var LEN_EXTRA_BITS_TBL = [ + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, -1, -1 + ]; + static var LEN_BASE_VAL_TBL = [ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258 + ]; + static var DIST_EXTRA_BITS_TBL = [ + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, -1, -1 + ]; + static var DIST_BASE_VAL_TBL = [ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577 + ]; + static var CODE_LENGTHS_POS = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; + + var nbits:Int; + var bits:Int; + var state:State; + var isFinal:Bool; + var huffman:Huffman; + var huffdist:Null; + var htools:HuffTools; + var len:Int; + var dist:Int; + var needed:Int; + var output:haxe.io.Bytes; + var outpos:Int; + var input:haxe.io.Input; + var lengths:Array; + var window:Window; + + static var FIXED_HUFFMAN = null; + + public function new(i, ?header = true, ?crc = true) { + isFinal = false; + htools = new HuffTools(); + huffman = buildFixedHuffman(); + huffdist = null; + len = 0; + dist = 0; + state = header ? Head : Block; + input = i; + bits = 0; + nbits = 0; + needed = 0; + output = null; + outpos = 0; + lengths = new Array(); + for (i in 0...19) + lengths.push(-1); + window = new Window(crc); + } + + function buildFixedHuffman() { + if (FIXED_HUFFMAN != null) + return FIXED_HUFFMAN; + var a = new Array(); + for (n in 0...288) + a.push(if (n <= 143) 8 else if (n <= 255) 9 else if (n <= 279) 7 else 8); + FIXED_HUFFMAN = htools.make(a, 0, 288, 10); + return FIXED_HUFFMAN; + } + + public function readBytes(b, pos, len) { + needed = len; + outpos = pos; + output = b; + if (len > 0) + while (inflateLoop()) {} + return len - needed; + } + + function getBits(n) { + while (nbits < n) { + bits |= input.readByte() << nbits; + nbits += 8; + } + var b = bits & ((1 << n) - 1); + nbits -= n; + bits >>= n; + return b; + } + + function getBit() { + if (nbits == 0) { + nbits = 8; + bits = input.readByte(); + } + var b = bits & 1 == 1; + nbits--; + bits >>= 1; + return b; + } + + function getRevBits(n) { + return if (n == 0) + 0 + else if (getBit()) + (1 << (n - 1)) | getRevBits(n - 1) + else + getRevBits(n - 1); + } + + function resetBits() { + bits = 0; + nbits = 0; + } + + function addBytes(b, p, len) { + window.addBytes(b, p, len); + output.blit(outpos, b, p, len); + needed -= len; + outpos += len; + } + + function addByte(b) { + window.addByte(b); + output.set(outpos, b); + needed--; + outpos++; + } + + function addDistOne(n) { + var c = window.getLastChar(); + for (i in 0...n) + addByte(c); + } + + function addDist(d, len) { + addBytes(window.buffer, window.pos - d, len); + } + + function applyHuffman(h) { + return switch (h) { + case Found(n): n; + case NeedBit(a, b): applyHuffman(getBit() ? b : a); + case NeedBits(n, tbl): applyHuffman(tbl[getBits(n)]); + } + } + + function inflateLengths(a, max) { + var i = 0; + var prev = 0; + while (i < max) { + var n = applyHuffman(huffman); + switch (n) { + case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15: + prev = n; + a[i] = n; + i++; + case 16: + var end = i + 3 + getBits(2); + if (end > max) + throw "Invalid data"; + while (i < end) { + a[i] = prev; + i++; + } + case 17: + i += 3 + getBits(3); + if (i > max) + throw "Invalid data"; + case 18: + i += 11 + getBits(7); + if (i > max) + throw "Invalid data"; + default: + throw "Invalid data"; + } + } + } + + function inflateLoop() { + switch (state) { + case Head: + var cmf = input.readByte(); + var cm = cmf & 15; + var cinfo = cmf >> 4; + if (cm != 8) + throw "Invalid data"; + var flg = input.readByte(); + // var fcheck = flg & 31; + var fdict = flg & 32 != 0; + // var flevel = flg >> 6; + if (((cmf << 8) + flg) % 31 != 0) + throw "Invalid data"; + if (fdict) + throw "Unsupported dictionary"; + state = Block; + return true; + case Crc: + var calc = window.checksum(); + if (calc == null) { + state = Done; + return true; + } + var crc = Adler32.read(input); + if (!calc.equals(crc)) + throw "Invalid CRC"; + state = Done; + return true; + case Done: + // nothing + return false; + case Block: + isFinal = getBit(); + switch (getBits(2)) { + case 0: // no compression + len = input.readUInt16(); + var nlen = input.readUInt16(); + if (nlen != 0xFFFF - len) throw "Invalid data"; + state = Flat; + var r = inflateLoop(); + resetBits(); + return r; + case 1: // fixed Huffman + huffman = buildFixedHuffman(); + huffdist = null; + state = CData; + return true; + case 2: // dynamic Huffman + var hlit = getBits(5) + 257; + var hdist = getBits(5) + 1; + var hclen = getBits(4) + 4; + for (i in 0...hclen) + lengths[CODE_LENGTHS_POS[i]] = getBits(3); + for (i in hclen...19) + lengths[CODE_LENGTHS_POS[i]] = 0; + huffman = htools.make(lengths, 0, 19, 8); + var lengths = new Array(); + for (i in 0...hlit + hdist) + lengths.push(0); + inflateLengths(lengths, hlit + hdist); + huffdist = htools.make(lengths, hlit, hdist, 16); + huffman = htools.make(lengths, 0, hlit, 16); + state = CData; + return true; + default: + throw "Invalid data"; + } + case Flat: + var rlen = (len < needed) ? len : needed; + var bytes = input.read(rlen); + len -= rlen; + addBytes(bytes, 0, rlen); + if (len == 0) + state = isFinal ? Crc : Block; + return needed > 0; + case DistOne: + var rlen = (len < needed) ? len : needed; + addDistOne(rlen); + len -= rlen; + if (len == 0) + state = CData; + return needed > 0; + case Dist: + while (len > 0 && needed > 0) { + var rdist = (len < dist) ? len : dist; + var rlen = (needed < rdist) ? needed : rdist; + addDist(dist, rlen); + len -= rlen; + } + if (len == 0) + state = CData; + return needed > 0; + case CData: + var n = applyHuffman(huffman); + if (n < 256) { + addByte(n); + return needed > 0; + } else if (n == 256) { + state = isFinal ? Crc : Block; + return true; + } else { + n -= 257; + var extra_bits = LEN_EXTRA_BITS_TBL[n]; + if (extra_bits == -1) + throw "Invalid data"; + len = LEN_BASE_VAL_TBL[n] + getBits(extra_bits); + var dist_code = if (huffdist == null) getRevBits(5) else applyHuffman(huffdist); + extra_bits = DIST_EXTRA_BITS_TBL[dist_code]; + if (extra_bits == -1) + throw "Invalid data"; + dist = DIST_BASE_VAL_TBL[dist_code] + getBits(extra_bits); + if (dist > window.available()) + throw "Invalid data"; + state = (dist == 1) ? DistOne : Dist; + return true; + } + } + } + + public static function run(i:haxe.io.Input, ?bufsize = 65536) { + var buf = haxe.io.Bytes.alloc(bufsize); + var output = new haxe.io.BytesBuffer(); + var inflate = new InflateImpl(i); + while (true) { + var len = inflate.readBytes(buf, 0, bufsize); + output.addBytes(buf, 0, len); + if (len < bufsize) + break; + } + return output.getBytes(); + } +} diff --git a/build/linux64_569e52e/std/haxe/zip/Reader.hx b/build/linux64_569e52e/std/haxe/zip/Reader.hx new file mode 100644 index 0000000..cdb6115 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/zip/Reader.hx @@ -0,0 +1,213 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.zip; + +import haxe.zip.Entry; +import haxe.ds.List; + +// see http://www.pkware.com/documents/casestudies/APPNOTE.TXT +class Reader { + var i:haxe.io.Input; + + public function new(i) { + this.i = i; + } + + function readZipDate() { + var t = i.readUInt16(); + var hour = (t >> 11) & 31; + var min = (t >> 5) & 63; + var sec = t & 31; + var d = i.readUInt16(); + var year = d >> 9; + var month = (d >> 5) & 15; + var day = d & 31; + return new Date(year + 1980, month - 1, day, hour, min, sec << 1); + } + + function readExtraFields(length) { + var fields = new List(); + while (length > 0) { + if (length < 4) + throw "Invalid extra fields data"; + var tag = i.readUInt16(); + var len = i.readUInt16(); + if (length < len) + throw "Invalid extra fields data"; + switch (tag) { + case 0x7075: + var version = i.readByte(); + if (version != 1) { + var data = new haxe.io.BytesBuffer(); + data.addByte(version); + data.add(i.read(len - 1)); + fields.add(FUnknown(tag, data.getBytes())); + } else { + var crc = i.readInt32(); + var name = i.read(len - 5).toString(); + fields.add(FInfoZipUnicodePath(name, crc)); + } + default: + fields.add(FUnknown(tag, i.read(len))); + } + length -= 4 + len; + } + return fields; + } + + public function readEntryHeader():Entry { + var i = this.i; + var h = i.readInt32(); + if (h == 0x02014B50 || h == 0x06054B50) + return null; + if (h != 0x04034B50) + throw "Invalid Zip Data"; + var version = i.readUInt16(); + var flags = i.readUInt16(); + var utf8 = flags & 0x800 != 0; + if ((flags & 0xF7F1) != 0) + throw "Unsupported flags " + flags; + var compression = i.readUInt16(); + var compressed = (compression != 0); + if (compressed && compression != 8) + throw "Unsupported compression " + compression; + var mtime = readZipDate(); + var crc32:Null = i.readInt32(); + var csize = i.readInt32(); + var usize = i.readInt32(); + var fnamelen = i.readInt16(); + var elen = i.readInt16(); + var fname = i.readString(fnamelen); + var fields = readExtraFields(elen); + if (utf8) + fields.push(FUtf8); + var data = null; + // we have a data descriptor that store the real crc/sizes + // after the compressed data, let's wait for it + if ((flags & 8) != 0) + crc32 = null; + return { + fileName: fname, + fileSize: usize, + fileTime: mtime, + compressed: compressed, + dataSize: csize, + data: data, + crc32: crc32, + extraFields: fields, + }; + } + + public function read():List { + var l = new List(); + var buf = null; + var tmp = null; + while (true) { + var e = readEntryHeader(); + if (e == null) + break; + // do we have a data descriptor? (see readEntryHeader) + if (e.crc32 == null) { + if (e.compressed) { + #if neko + // enter progressive mode : we use a different input which has + // a temporary buffer, this is necessary since we have to uncompress + // progressively, and after that we might have pending read data + // that needs to be processed + var bufSize = 65536; + if (buf == null) { + buf = new haxe.io.BufferInput(i, haxe.io.Bytes.alloc(bufSize)); + tmp = haxe.io.Bytes.alloc(bufSize); + i = buf; + } + var out = new haxe.io.BytesBuffer(); + var z = new neko.zip.Uncompress(-15); + z.setFlushMode(neko.zip.Flush.SYNC); + while (true) { + if (buf.available == 0) + buf.refill(); + var p = bufSize - buf.available; + if (p != buf.pos) { + // because of lack of "srcLen" in zip api, we need to always be stuck to the buffer end + buf.buf.blit(p, buf.buf, buf.pos, buf.available); + buf.pos = p; + } + var r = z.execute(buf.buf, buf.pos, tmp, 0); + out.addBytes(tmp, 0, r.write); + buf.pos += r.read; + buf.available -= r.read; + if (r.done) + break; + } + e.data = out.getBytes(); + #else + var bufSize = 65536; + if (tmp == null) + tmp = haxe.io.Bytes.alloc(bufSize); + var out = new haxe.io.BytesBuffer(); + var z = new InflateImpl(i, false, false); + while (true) { + var n = z.readBytes(tmp, 0, bufSize); + out.addBytes(tmp, 0, n); + if (n < bufSize) + break; + } + e.data = out.getBytes(); + #end + } else + e.data = i.read(e.dataSize); + e.crc32 = i.readInt32(); + if (e.crc32 == 0x08074b50) + e.crc32 = i.readInt32(); + e.dataSize = i.readInt32(); + e.fileSize = i.readInt32(); + // set data to uncompressed + e.dataSize = e.fileSize; + e.compressed = false; + } else + e.data = i.read(e.dataSize); + l.add(e); + } + return l; + } + + public static function readZip(i:haxe.io.Input) { + var r = new Reader(i); + return r.read(); + } + + public static function unzip(f:Entry) { + if (!f.compressed) + return f.data; + var c = new haxe.zip.Uncompress(-15); + var s = haxe.io.Bytes.alloc(f.fileSize); + var r = c.execute(f.data, 0, s, 0); + c.close(); + if (!r.done || r.read != f.data.length || r.write != f.fileSize) + throw "Invalid compressed data for " + f.fileName; + f.compressed = false; + f.dataSize = f.fileSize; + f.data = s; + return f.data; + } +} diff --git a/build/linux64_569e52e/std/haxe/zip/Tools.hx b/build/linux64_569e52e/std/haxe/zip/Tools.hx new file mode 100644 index 0000000..bf68606 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/zip/Tools.hx @@ -0,0 +1,52 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.zip; + +class Tools { + public static function compress(f:Entry, level:Int) { + if (f.compressed) + return; + // this should be optimized with a temp buffer + // that would discard the first two bytes + // (in order to prevent 2x mem usage for large files) + var data = haxe.zip.Compress.run(f.data, level); + f.compressed = true; + f.data = data.sub(2, data.length - 6); + f.dataSize = f.data.length; + } + + public static function uncompress(f:Entry) { + if( !f.compressed ) + return; + + var c = new Uncompress(-15); + var s = haxe.io.Bytes.alloc(f.fileSize); + var r = c.execute(f.data,0,s,0); + c.close(); + if( !r.done || r.read != f.data.length || r.write != f.fileSize ) + throw "Invalid compressed data for "+f.fileName; + f.compressed = false; + f.dataSize = f.fileSize; + f.data = s; + } +} diff --git a/build/linux64_569e52e/std/haxe/zip/Uncompress.hx b/build/linux64_569e52e/std/haxe/zip/Uncompress.hx new file mode 100644 index 0000000..7dc2fb6 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/zip/Uncompress.hx @@ -0,0 +1,41 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.zip; + +class Uncompress { + public function new(?windowBits:Int) { + throw new haxe.exceptions.NotImplementedException("Not implemented for this platform"); + } + + public function execute(src:haxe.io.Bytes, srcPos:Int, dst:haxe.io.Bytes, dstPos:Int):{done:Bool, read:Int, write:Int} { + return null; + } + + public function setFlushMode(f:FlushMode) {} + + public function close() {} + + public static function run(src:haxe.io.Bytes, ?bufsize:Int):haxe.io.Bytes { + return InflateImpl.run(new haxe.io.BytesInput(src), bufsize); + } +} diff --git a/build/linux64_569e52e/std/haxe/zip/Writer.hx b/build/linux64_569e52e/std/haxe/zip/Writer.hx new file mode 100644 index 0000000..c340a45 --- /dev/null +++ b/build/linux64_569e52e/std/haxe/zip/Writer.hx @@ -0,0 +1,193 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.zip; + +import haxe.ds.List; + +class Writer { + /** + The next constant is required for computing the Central + Directory Record(CDR) size. CDR consists of some fields + of constant size and a filename. Constant represents + total length of all fields with constant size for each + file in archive + **/ + inline static var CENTRAL_DIRECTORY_RECORD_FIELDS_SIZE = 46; + + /** + The following constant is the total size of all fields + of Local File Header. It's required for calculating + offset of start of central directory record + **/ + inline static var LOCAL_FILE_HEADER_FIELDS_SIZE = 30; + + var o:haxe.io.Output; + var files:List<{ + name:String, + compressed:Bool, + clen:Int, + size:Int, + crc:Int, + date:Date, + fields:haxe.io.Bytes + }>; + + public function new(o:haxe.io.Output) { + this.o = o; + files = new List(); + } + + function writeZipDate(date:Date) { + var hour = date.getHours(); + var min = date.getMinutes(); + var sec = date.getSeconds() >> 1; + o.writeUInt16((hour << 11) | (min << 5) | sec); + var year = date.getFullYear() - 1980; + var month = date.getMonth() + 1; + var day = date.getDate(); + o.writeUInt16((year << 9) | (month << 5) | day); + } + + public function writeEntryHeader(f:Entry) { + var o = this.o; + var flags = 0; + if (f.extraFields != null) { + for (e in f.extraFields) + switch (e) { + case FUtf8: + flags |= 0x800; + default: + } + } + o.writeInt32(0x04034B50); + o.writeUInt16(0x0014); // version + o.writeUInt16(flags); // flags + if (f.data == null) { + f.fileSize = 0; + f.dataSize = 0; + f.crc32 = 0; + f.compressed = false; + f.data = haxe.io.Bytes.alloc(0); + } else { + if (f.crc32 == null) { + if (f.compressed) + throw "CRC32 must be processed before compression"; + f.crc32 = haxe.crypto.Crc32.make(f.data); + } + if (!f.compressed) + f.fileSize = f.data.length; + f.dataSize = f.data.length; + } + o.writeUInt16(f.compressed ? 8 : 0); + writeZipDate(f.fileTime); + o.writeInt32(f.crc32); + o.writeInt32(f.dataSize); + o.writeInt32(f.fileSize); + o.writeUInt16(f.fileName.length); + var e = new haxe.io.BytesOutput(); + if (f.extraFields != null) { + for (f in f.extraFields) + switch (f) { + case FInfoZipUnicodePath(name, crc): + var namebytes = haxe.io.Bytes.ofString(name); + e.writeUInt16(0x7075); + e.writeUInt16(namebytes.length + 5); + e.writeByte(1); // version + e.writeInt32(crc); + e.write(namebytes); + case FUnknown(tag, bytes): + e.writeUInt16(tag); + e.writeUInt16(bytes.length); + e.write(bytes); + case FUtf8: + // nothing + } + } + var ebytes = e.getBytes(); + o.writeUInt16(ebytes.length); + o.writeString(f.fileName); + o.write(ebytes); + files.add({ + name: f.fileName, + compressed: f.compressed, + clen: f.data.length, + size: f.fileSize, + crc: f.crc32, + date: f.fileTime, + fields: ebytes + }); + } + + public function write(files:List) { + for (f in files) { + writeEntryHeader(f); + o.writeFullBytes(f.data, 0, f.data.length); + } + writeCDR(); + } + + public function writeCDR() { + var cdr_size = 0; + var cdr_offset = 0; + for (f in files) { + var namelen = f.name.length; + var extraFieldsLength = f.fields.length; + o.writeInt32(0x02014B50); // header + o.writeUInt16(0x0014); // version made-by + o.writeUInt16(0x0014); // version + o.writeUInt16(0); // flags + o.writeUInt16(f.compressed ? 8 : 0); + writeZipDate(f.date); + o.writeInt32(f.crc); + o.writeInt32(f.clen); + o.writeInt32(f.size); + o.writeUInt16(namelen); + o.writeUInt16(extraFieldsLength); + o.writeUInt16(0); // comment length always 0 + o.writeUInt16(0); // disk number start + o.writeUInt16(0); // internal file attributes + o.writeInt32(0); // external file attributes + o.writeInt32(cdr_offset); // relative offset of local header + o.writeString(f.name); + o.write(f.fields); + cdr_size += CENTRAL_DIRECTORY_RECORD_FIELDS_SIZE + namelen + extraFieldsLength; + cdr_offset += LOCAL_FILE_HEADER_FIELDS_SIZE + namelen + extraFieldsLength + f.clen; + } + // end of central dir signature + o.writeInt32(0x06054B50); + // number of this disk + o.writeUInt16(0); + // number of the disk with the start of the central directory + o.writeUInt16(0); + // total number of entries in the central directory on this disk + o.writeUInt16(files.length); + // total number of entries in the central directory + o.writeUInt16(files.length); + // size of the central directory record + o.writeInt32(cdr_size); + // offset of start of central directory with respect to the starting disk number + o.writeInt32(cdr_offset); + // .ZIP file comment length + o.writeUInt16(0); + } +} diff --git a/build/linux64_569e52e/std/hl/Abstract.hx b/build/linux64_569e52e/std/hl/Abstract.hx new file mode 100644 index 0000000..c02f0c5 --- /dev/null +++ b/build/linux64_569e52e/std/hl/Abstract.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl; + +extern class Abstract {} diff --git a/build/linux64_569e52e/std/hl/Api.hx b/build/linux64_569e52e/std/hl/Api.hx new file mode 100644 index 0000000..0913fab --- /dev/null +++ b/build/linux64_569e52e/std/hl/Api.hx @@ -0,0 +1,55 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl; + +extern class Api { + static inline function rethrow(v:Dynamic):Void { + untyped $rethrow(v); + } + static inline function unsafeCast(v:From):To { + return untyped $unsafecast(v); + } + @:hlNative("std", "obj_get_field") static function getField(obj:Dynamic, hash:Int):Dynamic; + @:hlNative("std", "obj_set_field") static function setField(obj:Dynamic, hash:Int, value:Dynamic):Void; + @:hlNative("std", "obj_has_field") static function hasField(obj:Dynamic, hash:Int):Bool; + @:hlNative("std", "obj_delete_field") static function deleteField(obj:Dynamic, hash:Int):Bool; + @:hlNative("std", "call_method") static function callMethod(f:haxe.Constraints.Function, args:NativeArray):Dynamic; + @:hlNative("std", "get_closure_value") static function getClosureValue(f:haxe.Constraints.Function):Dynamic; + @:hlNative("std", "make_closure") static function makeClosure(f:haxe.Constraints.Function, v:Dynamic):Dynamic; + @:hlNative("std", "no_closure") static function noClosure(f:haxe.Constraints.Function):haxe.Constraints.Function; + @:hlNative("std", "value_cast") static function safeCast(v:Dynamic, t:Type):Dynamic; + @:hlNative("std", "make_var_args") static function makeVarArgs(v:NativeArray->Dynamic):haxe.Constraints.Function; + @:hlNative("std", "get_virtual_value") static function getVirtualValue(v:Dynamic):Dynamic; + @:hlNative("std", "set_error_handler") static function setErrorHandler(v:Dynamic->Void):Void; + @:hlNative("std", "breakpoint") static function breakPoint():Void; + @:hlNative("std", "sys_is64") static function is64():Bool; + @:hlNative("std", "ptr_compare") static function comparePointer(a:Dynamic, b:Dynamic):Int; + #if (hl_ver >= version("1.12.0")) + @:hlNative("std", "is_prim_loaded") static function isPrimLoaded(f:haxe.Constraints.Function):Bool; + @:hlNative("?std", "mem_compact") static function compact( v : T, exclude : hl.NativeArray, flags : Int, outCount : hl.Ref ) : T; + @:hlNative("?std", "sys_check_reload") static function checkReload( ?debugFile : hl.Bytes ) : Bool; + #end + #if (hl_ver >= version("1.13.0")) + @:hlNative("?std", "sys_has_debugger") static function hasDebugger() : Bool; + #end +} diff --git a/build/linux64_569e52e/std/hl/Atomics.hx b/build/linux64_569e52e/std/hl/Atomics.hx new file mode 100644 index 0000000..f811da0 --- /dev/null +++ b/build/linux64_569e52e/std/hl/Atomics.hx @@ -0,0 +1,19 @@ +package hl; + +@:hlNative("std", "atomic_") +extern class Atomics { + static function add32(r:hl.Ref, a:Int):Int; + static function sub32(r:hl.Ref, a:Int):Int; + static function and32(r:hl.Ref, a:Int):Int; + static function or32(r:hl.Ref, a:Int):Int; + static function xor32(r:hl.Ref, a:Int):Int; + static function compareExchange32(r:hl.Ref, a:Int, b:Int):Int; + static function exchange32(r:hl.Ref, val:Int):Int; + static function load32(r:hl.Ref):Int; + static function store32(r:hl.Ref, val:Int):Int; + + static function compareExchangePtr(r:hl.Ref, a:Dynamic, b:Dynamic):Dynamic; + static function exchangePtr(r:hl.Ref, val:Dynamic):Dynamic; + static function loadPtr(r:hl.Ref):Dynamic; + static function storePtr(r:hl.Ref, val:Dynamic):Dynamic; +} diff --git a/build/linux64_569e52e/std/hl/BaseType.hx b/build/linux64_569e52e/std/hl/BaseType.hx new file mode 100644 index 0000000..80ead1c --- /dev/null +++ b/build/linux64_569e52e/std/hl/BaseType.hx @@ -0,0 +1,68 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl; + +@:keep +class BaseType { + public var __type__:Type; + public var __meta__:Dynamic; + public var __implementedBy__:NativeArray; + + public function check(v:Dynamic) { + var t = Type.getDynamic(v); + if (t.kind == HVirtual) { + var v2 = hl.Api.getVirtualValue(v); + if (v2 != null) + t = Type.getDynamic(v2); + } + if (__implementedBy__ == null) { + if (t.safeCast(__type__)) + return true; + return false; + } + for (i in __implementedBy__) + if (t.safeCast(i)) + return true; + return false; + } +} + +@:keep +class Class extends BaseType { + public var __name__:String; + public var __constructor__:Dynamic; +} + +@:keep +class Enum extends BaseType { + public var __ename__:String; + public var __emap__:hl.types.BytesMap; + public var __constructs__:Array; + public var __evalues__:NativeArray; +} + +@:keep +class CoreType extends Class {} + +@:keep +class CoreEnum extends Enum {} diff --git a/build/linux64_569e52e/std/hl/Boot.hx b/build/linux64_569e52e/std/hl/Boot.hx new file mode 100644 index 0000000..ca16c51 --- /dev/null +++ b/build/linux64_569e52e/std/hl/Boot.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl; + +import hl.types.ArrayDyn; +import hl.BaseType; + +@:dox(hide) +extern class Boot {} diff --git a/build/linux64_569e52e/std/hl/Bytes.hx b/build/linux64_569e52e/std/hl/Bytes.hx new file mode 100644 index 0000000..cfd8530 --- /dev/null +++ b/build/linux64_569e52e/std/hl/Bytes.hx @@ -0,0 +1,222 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl; + +@:coreType abstract Bytes { + extern public inline function new(v:Int) { + this = alloc(v); + } + + @:hlNative("std", "bytes_blit") public function blit(pos:Int, src:Bytes, srcPos:Int, len:Int):Void {} + + @:arrayAccess extern public inline function getUI8(pos:Int):Int { + return untyped $bgetui8(this, pos); + } + + @:arrayAccess extern public inline function setUI8(pos:Int, value:Int):Int { + untyped $bsetui8(this, pos, value); + return value; + } + + extern public inline function getI32(pos:Int):Int { + return untyped $bgeti32(this, pos); + } + + public inline function getUI16(pos:Int):Int { + return untyped $bgetui16(this, pos); + } + + public inline function setUI16(pos:Int, v:Int) { + untyped $bsetui16(this, pos, v); + } + + extern public inline function getF32(pos:Int):F32 { + return untyped $bgetf32(this, pos); + } + + extern public inline function getF64(pos:Int):Float { + return untyped $bgetf64(this, pos); + } + + extern public inline function setI32(pos:Int, value:Int):Void { + untyped $bseti32(this, pos, value); + } + + extern public inline function setF32(pos:Int, value:F32):Void { + untyped $bsetf32(this, pos, value); + } + + extern public inline function setF64(pos:Int, value:Float):Void { + untyped $bsetf64(this, pos, value); + } + + @:hlNative("std", "alloc_bytes") + static function alloc(size:Int):Bytes { + return null; + } + + @:hlNative("std", "parse_int") + public function parseInt(pos:Int, size:Int):Null { + return null; + } + + @:hlNative("std", "parse_float") + public function parseFloat(pos:Int, size:Int):Float { + return 0.; + } + + @:hlNative("std", "bytes_compare") + public function compare(pos:Int, bytes:Bytes, bytesPos:Int, size:Int):Int { + return 0; + } + + #if (hl_ver >= version("1.10.0")) + @:hlNative("std", "bytes_compare16") + public function compare16(bytes:Bytes, size:Int):Int { + return 0; + } + #end + + @:hlNative("std", "bytes_find") + public function find(pos:Int, size:Int, bytes:Bytes, bytesPos:Int, bytesSize:Int):Int { + return 0; + } + + @:hlNative("std", "bytes_fill") + public function fill(pos:Int, size:Int, v:Int):Void {} + + @:hlNative("std", "bsort_i32") + public function sortI32(pos:Int, length:Int, f:Int->Int->Int):Void {} + + @:hlNative("std", "bsort_f64") + public function sortF64(pos:Int, length:Int, f:Float->Float->Int):Void {} + + /** + Please note that you need to retain the original unoffset'ed Bytes so it does not get garbage collected, unless the pointer was not GC allocated. + **/ + @:hlNative("std", "bytes_offset") + public function offset(delta:Int):Bytes { + return null; + } + + /** + Returns an offset between the two pointers. This might overflow in 64 bits if the addresses of the two pointers differs by more than 4GB + **/ + @:hlNative("std", "bytes_subtract") + public function subtract(other:Bytes):Int { + return 0; + } + + @:hlNative("std", "bytes_address") + static function get_address(b:Bytes, high:Ref):Int { + return 0; + } + + @:hlNative("std", "bytes_from_address") + static function from_address(low:Int, high:Int):Bytes { + return null; + } + + /** + Creates an pointer at a given memory address (highly unsafe) + **/ + public static inline function fromAddress(h:haxe.Int64):Bytes { + return from_address(h.low, h.high); + } + + /** + Returns the address value of the bytes. On 32 bit system the upper 32 bits will always be 0 + **/ + public function address():haxe.Int64 { + var high = 0; + var low = get_address(this, high); + return haxe.Int64.make(high, low); + } + + public function sub(pos:Int, size:Int) { + var b = new Bytes(size); + b.blit(0, this, pos, size); + return b; + } + + @:hlNative("std", "ucs2length") + public function ucs2Length(bytePos:Int):Int { + return 0; + } + + @:hlNative("std", "hash") + function hash():Int { + return 0; + } + + @:hlNative("std", "utf8_to_utf16") + public function utf8ToUtf16(bytePos:Int, outSize:Ref):Bytes { + return null; + } + + @:hlNative("std","utf16_to_utf8") + public function utf16ToUtf8(len:Int, outSize:Ref) : Bytes { + return null; + } + + @:hlNative("std", "ucs2_upper") + function ucs2Upper(bytePos:Int, size:Int):Bytes { + return null; + } + + @:hlNative("std", "ucs2_lower") + function ucs2Lower(bytePos:Int, size:Int):Bytes { + return null; + } + + @:hlNative("std", "url_encode") + function urlEncode(outSize:Ref):Bytes { + return null; + } + + @:hlNative("std", "url_decode") + function urlDecode(outSize:Ref):Bytes { + return null; + } + + @:hlNative("std", "value_to_string") + public static function fromValue(v:Dynamic, length:Ref):Bytes { + return null; + } + + /** + Get the bytes reference from an array of basic types (no copy occurs) + **/ + extern public static inline function getArray(a:Array):Bytes { + return untyped $abytes(a); + } + + @:from + public static inline function fromBytes(bytes:haxe.io.Bytes) { + return @:privateAccess bytes.b; + } + + public inline function toBytes(len:Int) { + return @:privateAccess new haxe.io.Bytes(this, len); + } +} diff --git a/build/linux64_569e52e/std/hl/BytesAccess.hx b/build/linux64_569e52e/std/hl/BytesAccess.hx new file mode 100644 index 0000000..980d8b1 --- /dev/null +++ b/build/linux64_569e52e/std/hl/BytesAccess.hx @@ -0,0 +1,49 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl; + +@:coreType abstract BytesAccess from Bytes to Bytes { + public var sizeBits(get, never):Int; + public var nullValue(get, never):T; + + extern inline function get_sizeBits():Int { + return untyped $bytes_sizebits(this); + } + + extern inline function get_nullValue():T { + return untyped $bytes_nullvalue(this); + } + + extern public inline function blit(pos:Int, src:BytesAccess, srcPos:Int, len:Int):Void { + (this : Bytes).blit(pos << sizeBits, src, srcPos << sizeBits, len << sizeBits); + } + + @:arrayAccess extern public inline function get(pos:Int):T { + return untyped $bget(this, pos); + } + + @:arrayAccess extern public inline function set(pos:Int, value:T):T { + untyped $bset(this, pos, value); + return value; + } +} diff --git a/build/linux64_569e52e/std/hl/CArray.hx b/build/linux64_569e52e/std/hl/CArray.hx new file mode 100644 index 0000000..e2e9e50 --- /dev/null +++ b/build/linux64_569e52e/std/hl/CArray.hx @@ -0,0 +1,24 @@ +package hl; + +#if (hl_ver >= version("1.14.0")) +/** + CArray is a compact array where all objects are memory aligned and stored as a single GC block. + You must hold a reference to the CArray while any of the objects it contains is still referenced somewhere. + **/ +abstract CArray(Abstract<"hl_carray">) { + + @:arrayAccess inline function get( index : Int ) : T return untyped this[index]; + + public inline function unsafeSet( index : Int, v : T ) return untyped this[index] = v; + + public static inline function alloc( cl : Class, size : Int ) : CArray { + return cast alloc_carray( (cast cl:BaseType).__type__ , size ); + } + + @:hlNative("?std","alloc_carray") + static function alloc_carray( t : hl.Type, size : Int ) : CArray { + return null; + } + +} +#end \ No newline at end of file diff --git a/build/linux64_569e52e/std/hl/F32.hx b/build/linux64_569e52e/std/hl/F32.hx new file mode 100644 index 0000000..78cb04d --- /dev/null +++ b/build/linux64_569e52e/std/hl/F32.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl; + +typedef F32 = Single; diff --git a/build/linux64_569e52e/std/hl/F64.hx b/build/linux64_569e52e/std/hl/F64.hx new file mode 100644 index 0000000..ea633bc --- /dev/null +++ b/build/linux64_569e52e/std/hl/F64.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl; + +typedef F64 = Float; diff --git a/build/linux64_569e52e/std/hl/Format.hx b/build/linux64_569e52e/std/hl/Format.hx new file mode 100644 index 0000000..6090898 --- /dev/null +++ b/build/linux64_569e52e/std/hl/Format.hx @@ -0,0 +1,109 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl; + +enum abstract PixelFormat(Int) { + var RGB = 0; + var BGR = 1; + var RGBX = 2; + var BGRX = 3; + var XBGR = 4; + var XRGB = 5; + var GRAY = 6; + var RGBA = 7; + var BGRA = 8; + var ABGR = 9; + var ARGB = 10; + var CMYK = 11; +} + +/** + These are the bindings for the HL `fmt.hdll` library, which contains various low level formats handling. +**/ +class Format { + /** + Decode JPG data into the target buffer. + **/ + @:hlNative("fmt", "jpg_decode") + public static function decodeJPG(src:hl.Bytes, srcLen:Int, dst:hl.Bytes, width:Int, height:Int, stride:Int, format:PixelFormat, flags:Int):Bool { + return false; + } + + /** + Decode PNG data into the target buffer. + **/ + @:hlNative("fmt", "png_decode") + public static function decodePNG(src:hl.Bytes, srcLen:Int, dst:hl.Bytes, width:Int, height:Int, stride:Int, format:PixelFormat, flags:Int):Bool { + return false; + } + + /** + Decode any image data into ARGB pixels + **/ + #if (hl_ver >= version("1.10.0")) + @:hlNative("fmt", "dxt_decode") + public static function decodeDXT(src:hl.Bytes, dst:hl.Bytes, width:Int, height:Int, dxtFormat:Int):Bool { + return false; + } + #end + + /** + Upscale/downscale an image. + Currently supported flag bits: 1 = bilinear filtering + **/ + @:hlNative("fmt", "img_scale") + public static function scaleImage(out:hl.Bytes, outPos:Int, outStride:Int, outWidth:Int, outHeight:Int, _in:hl.Bytes, inPos:Int, inStride:Int, + inWidth:Int, inHeight:Int, flags:Int) {} + + /** + Performs a cryptographic digest of some bytes. + 0 = Md5 , 1 = Sha1 , 2 = Crc32, 3 = Adler32 + Set 256 flag to tell the src are String bytes. + **/ + @:hlNative("fmt", "digest") + public static function digest(out:hl.Bytes, src:hl.Bytes, srcLen:Int, algorithm:Int) {} +} + +class Mikktspace { + public var buffer:hl.BytesAccess; + public var stride:Int; + public var xPos:Int; + public var normalPos:Int; + public var uvPos:Int; + public var tangents:hl.BytesAccess; + public var tangentStride:Int; + public var tangentPos:Int; + public var indexes:hl.BytesAccess; + public var indices:Int; + + public function new() {} + + public function compute(threshold = 180.) { + if (!_compute(this, threshold)) + throw "assert"; + } + + @:hlNative("fmt", "compute_mikkt_tangents") static function _compute(m:Dynamic, threshold:Float):Bool { + return false; + } +} diff --git a/build/linux64_569e52e/std/hl/Gc.hx b/build/linux64_569e52e/std/hl/Gc.hx new file mode 100644 index 0000000..9fa76c0 --- /dev/null +++ b/build/linux64_569e52e/std/hl/Gc.hx @@ -0,0 +1,114 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl; + +enum GcFlag { + /** + Activate profiling: regularly print on stdout gc allocation stats + **/ + Profile; + + /** + Allows one to dump a hlmemory.dump file when HL runs out of memory to be examined with hl memory inspector tool. + **/ + DumpMem; + + /** + Disable GC locking for multithreads + **/ + NoThreads; + + /** + Force major GC on each allocation + **/ + ForceMajor; +} + +class Gc { + public static var flags(get, set):haxe.EnumFlags; + + public static function stats() { + var tot = 0., count = 0., mem = 0.; + _stats(tot, count, mem); + return {totalAllocated: tot, allocationCount: count, currentMemory: mem}; + } + + /** + Dump whole memory into target filename for analysis. + **/ + public static function dumpMemory(?fileName:String = "hlmemory.dump") { + _dump(@:privateAccess fileName.toUtf8()); + } + + static function get_flags():haxe.EnumFlags { + return haxe.EnumFlags.ofInt(_get_flags()); + } + + static function set_flags(v:haxe.EnumFlags) { + _set_flags(v.toInt()); + return v; + } + + #if (hl_ver >= version("1.15.0")) + /** + Count live objects of class `cl`, and get at most `maxCount` elements in an array. + **/ + public static function getLiveObjects(cl:Class, maxCount:Int = 0) { + var arr = new hl.NativeArray(maxCount); + var count = _getLiveObjects(cast(cl,hl.BaseType).__type__, arr); + var objs = new Array(); + for (i in 0...maxCount) { + if (arr[i] == null) break; + objs.push(arr[i]); + } + return {count: count, objs: objs}; + } + #end + + /** + Enter/leave a blocking section: when in a blocking section the thread cannot + allocate any memory but other threads will not wait for it for collecting memory. + **/ + @:hlNative("std", "blocking") + public static function blocking(b:Bool) {} + + @:hlNative("std", "gc_dump_memory") static function _dump(b:hl.Bytes):Void {} + + @:hlNative("std", "gc_enable") public static function enable(b:Bool):Void {} + + @:hlNative("std", "gc_major") public static function major():Void {} + + @:hlNative("std", "gc_stats") static function _stats(totalAllocated:hl.Ref, allocationCount:hl.Ref, currentMemory:hl.Ref):Void {} + + @:hlNative("std", "gc_get_flags") static function _get_flags():Int { + return 0; + } + + @:hlNative("std", "gc_set_flags") static function _set_flags(v:Int) {} + + #if (hl_ver >= version("1.15.0")) + @:hlNative("std", "gc_get_live_objects") static function _getLiveObjects(type:hl.Type, arr:hl.NativeArray):Int { + return 0; + } + #end +} diff --git a/build/linux64_569e52e/std/hl/I64.hx b/build/linux64_569e52e/std/hl/I64.hx new file mode 100644 index 0000000..a410213 --- /dev/null +++ b/build/linux64_569e52e/std/hl/I64.hx @@ -0,0 +1,67 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl; + +@:coreType @:notNull @:runtimeValue abstract I64 from Int { + + /** + Destructively cast to Int + **/ + public inline function toInt():Int { + return cast this; + } + + @:to + @:deprecated("Implicit cast from I64 to Int (32 bits) is deprecated. Use .toInt() or explicitly cast instead.") + inline function implicitToInt(): Int { + return toInt(); + } + + #if (hl_ver >= version("1.12.0") && !hl_legacy32) + @:op(a+b) function add(v:I64) : I64; + @:op(a-b) function sub(v:I64) : I64; + @:op(a*b) function mul(v:I64) : I64; + @:op(a/b) function div(v:I64) : I64; + @:op(a%b) function mod(v:I64) : I64; + @:op(a<>b) function shr(v:Int) : I64; + @:op(a>>>b) function ushr(v:Int) : I64; + @:op(a|b) function or(v:I64) : I64; + @:op(a&b) function and(v:I64) : I64; + @:op(a^b) function xor(v:I64) : I64; + + @:op(-a) function neg() : I64; + @:op(~a) inline function compl() : I64 { return (-1:I64) - this; } + @:op(++a) function incr() : I64; + @:op(--a) function decr() : I64; + @:op(a++) function pincr() : I64; + @:op(a--) function pdecr() : I64; + + @:op(a==b) function eq(v:I64) : Bool; + @:op(a>=b) function gte(v:I64) : Bool; + @:op(a<=b) function lte(v:I64) : Bool; + @:op(a>b) function gt(v:I64) : Bool; + @:op(a { + var arr:NativeArray; + var pos:Int; + var length:Int; + + public inline function new(arr:NativeArray) { + this.arr = arr; + pos = 0; + length = arr.length; + } + + public inline function hasNext() { + return pos < length; + } + + public inline function next() { + return arr[pos++]; + } +} + +@:generic class NativeArrayKeyValueIterator { + var arr : NativeArray; + var pos : Int; + var length : Int; + public inline function new(arr:NativeArray) { + this.arr = arr; + pos = 0; + length = arr.length; + } + public inline function hasNext() { + return pos < length; + } + public inline function next() { + var v = arr[pos]; + return {key:pos++, value:v}; + } +} + +@:coreType abstract NativeArray { + public var length(get, never):Int; + + extern public inline function new(length:Int) { + this = untyped $aalloc(length); + } + + extern inline function get_length():Int { + return untyped $asize(this); + } + + @:arrayAccess extern inline function get(pos:Int):T { + return untyped ($aget(this, pos) : T); + } + + @:arrayAccess extern inline function set(pos:Int, value:T):T { + untyped $aset(this, pos, value); + return value; + } + + extern public inline function sub(pos:Int, len:Int) { + var n = new NativeArray(len); + n.blit(0, this, pos, len); + return n; + } + + @:to extern public inline function getRef():Ref { + return untyped $refdata(this); + } + + @:hlNative("std", "array_type") public function getType():Type { + return null; + } + + @:hlNative("std", "array_blit") public function blit(pos:Int, src:NativeArray, srcPos:Int, srcLen:Int):Void {} +} diff --git a/build/linux64_569e52e/std/hl/Profile.hx b/build/linux64_569e52e/std/hl/Profile.hx new file mode 100644 index 0000000..13becb3 --- /dev/null +++ b/build/linux64_569e52e/std/hl/Profile.hx @@ -0,0 +1,231 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl; + +typedef Symbol = hl.Abstract<"hl_symbol">; + +enum TrackKind { + Alloc; + Cast; + DynField; + DynCall; +} + +class Result { + public var t:hl.Type; + public var kind:TrackKind; + public var count:Int; + public var info:Int; + public var stack:Array; + + public function new(t, count, info) { + this.t = t; + this.count = count; + this.info = info; + } + + @:keep public function toString() { + return t + "(" + count + ")"; + } +} + +@:hlNative("std") +class Profile { + public static var threadBits(get, set):haxe.EnumFlags; + public static var globalBits(get, set):haxe.EnumFlags; + + static var KINDS = null; + + public static function getData(sortBySize = false, reset = true) { + var old = globalBits; + globalBits = new haxe.EnumFlags(); + if (buf == null) + buf = new hl.Bytes(BUFSIZE * 2); + track_lock(true); + var maxDepth = 0; + var count = track_count(maxDepth); + var arr = new hl.NativeArray(maxDepth); + var out = []; + if (KINDS == null) + KINDS = TrackKind.createAll(); + for (i in 0...count) { + var t:hl.Type = null, count = 0, info = 0; + var k = track_entry(i, t, count, info, arr); + if (count == 0) + continue; + var a = new Result(t, count, info); + a.kind = KINDS[k]; + a.stack = [for (a in arr) resolveSymbol(a)]; + out.push(a); + } + out.sort(function(a1, a2) { + if (a1.kind != a2.kind) + return a1.kind.getIndex() - a2.kind.getIndex(); + if (sortBySize && a1.kind == Alloc) + return a2.info - a1.info; + return a2.count - a1.count; + }); + track_lock(false); + if (reset) + Profile.reset(); + globalBits = old; + return out; + } + + public static function dump(fileName = "track.dump", sortBySize = false, reset = true) { + var old = globalBits; + globalBits = new haxe.EnumFlags(); + var f = sys.io.File.write(fileName); + var data = getData(sortBySize, reset); + var allocCount = 0, allocSize = 0, castCount = 0, dynCount = 0; + for (o in data) { + switch (o.kind) { + case Alloc: + allocCount += o.count; + allocSize += o.info; + case Cast: + castCount += o.count; + case DynCall, DynField: + dynCount += o.count; + } + } + if (data.length == 0) + f.writeString("Nothing\n"); + if (allocCount > 0) + f.writeString(allocCount + " total allocs (" + allocSize + " bytes)\n"); + if (castCount > 0) + f.writeString(castCount + " total casts\n"); + if (dynCount > 0) + f.writeString(dynCount + " total dynamic accesses/calls\n"); + for (o in data) { + var pcount = StringTools.lpad("" + o.count, " ", 5); + switch (o.kind) { + case Alloc: + f.writeString("alloc " + pcount + " " + o.t + " (" + o.info + " bytes)\n"); + case Cast: + f.writeString("cast " + pcount + " " + o.t + "\n"); + case DynCall: + f.writeString("dyncall " + pcount + " " + o.t + "." + getFieldName(o.info) + "()\n"); + case DynField: + f.writeString("dynfield " + pcount + " " + o.t + "." + getFieldName(o.info) + "\n"); + } + for (s in o.stack) + f.writeString("\t\t\t\t" + s + "\n"); + } + f.close(); + globalBits = old; + } + + /** + Reset accumulated tracked data. + **/ + @:hlNative("std", "track_reset") public static function reset() {} + + /** + Restart tracking after being stopped. + **/ + @:hlNative("std", "track_init") public static function restart() {} + + /** + Stop tracking for all threads. + **/ + public static function stop() { + globalBits = new haxe.EnumFlags(); + } + + /** + Set maximum stack depth for reports (default = 10) + **/ + @:hlNative("std", "track_set_depth") public static function setMaxDepth(v:Int) {} + + static function get_threadBits() + return new haxe.EnumFlags(track_get_bits(true)); + + static function set_threadBits(v:haxe.EnumFlags) { + track_set_bits(v.toInt(), true); + return v; + } + + static function get_globalBits() + return new haxe.EnumFlags(track_get_bits(false)); + + static function set_globalBits(v:haxe.EnumFlags) { + track_set_bits(v.toInt(), false); + return v; + } + + static var BUFSIZE = 512; + static var buf:hl.Bytes; + + static function resolveSymbol(s:Symbol) { + var size = BUFSIZE; + if (buf == null) + buf = new hl.Bytes(BUFSIZE * 2); + var bytes = resolve_symbol(s, buf, size); + if (bytes == null) + return ""; + return @:privateAccess String.fromUCS2(bytes.sub(0, (size + 1) * 2)); + } + + static function resolve_symbol(s:Symbol, buf:hl.Bytes, bufSize:hl.Ref):hl.Bytes { + return null; + } + + static function track_count(maxDepth:hl.Ref):Int { + return 0; + } + + static function track_entry(id:Int, type:hl.Ref, count:hl.Ref, info:hl.Ref, stack:NativeArray):Int { + return 0; + } + + static function track_init():Void {} + + static function track_lock(b:Bool):Void {} + + static function track_get_bits(thread:Bool):Int { + return 0; + } + + static function track_set_bits(bits:Int, thread:Bool):Void {} + + static function __init__() + track_init(); + + // todo : move later to hl.Bytes + + @:hlNative("std", "field_name") + public static function getFieldName(hash:Int):Bytes { + return null; + } + + @:hlNative(1.11) + static function sys_profile_event( code : Int, data : hl.Bytes, dataLen : Int ) : Void {} + public static function event( code : Int, ?data : String ) @:privateAccess { + sys_profile_event(code,data == null ? null : data.bytes, data == null ? 0 : (data.length<<1)); + } + public static function eventBytes( code : Int, data : haxe.io.Bytes ) @:privateAccess { + sys_profile_event(code,data == null ? null : data, data == null ? 0 : data.length); + } + +} diff --git a/build/linux64_569e52e/std/hl/Ref.hx b/build/linux64_569e52e/std/hl/Ref.hx new file mode 100644 index 0000000..1d08f23 --- /dev/null +++ b/build/linux64_569e52e/std/hl/Ref.hx @@ -0,0 +1,46 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl; + +@:semantics(reference) +@:coreType abstract Ref { + @:from extern public static inline function make(v:T) { + return new Ref(v); + } + + extern public inline function new(v:T) { + this = untyped $ref(v); + } + + extern public inline function get():T { + return untyped $unref(this); + } + + extern public inline function set(v:T):Void { + return untyped $setref(this, v); + } + + extern public inline function offset(v:Int):Ref { + return untyped $refoffset(this, v); + } +} diff --git a/build/linux64_569e52e/std/hl/Type.hx b/build/linux64_569e52e/std/hl/Type.hx new file mode 100644 index 0000000..c3f1ac3 --- /dev/null +++ b/build/linux64_569e52e/std/hl/Type.hx @@ -0,0 +1,117 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl; + +enum abstract TypeKind(Int) { + public var HVoid = 0; + public var HUI8 = 1; + public var HUI16 = 2; + public var HI32 = 3; + public var HI64 = 4; + public var HF32 = 5; + public var HF64 = 6; + public var HBool = 7; + public var HBytes = 8; + public var HDyn = 9; + public var HFun = 10; + public var HObj = 11; + public var HArray = 12; + public var HType = 13; + public var HRef = 14; + public var HVirtual = 15; + public var HDynObj = 16; + public var HAbstract = 17; + public var HEnum = 18; + public var HNull = 19; +} + +@:coreType abstract Type { + public var kind(get, never):TypeKind; + + extern inline function get_kind():TypeKind { + return untyped $tkind(this); + } + + @:hlNative("std", "type_name") function getNameBytes():Bytes { + return null; + } + + extern public static inline function getDynamic(v:Dynamic):Type { + return untyped $tdyntype(v); + } + + extern public static inline function get(v:T):Type { + return untyped $ttype(v); + } + + extern public static inline function void():Type { + return untyped $ttype((null:Void)); + } + + extern public inline function getTypeName():String { + var s = getNameBytes(); + if (s == null) + return null; + return @:privateAccess String.fromUCS2(s); + } + + @:hlNative("std", "type_safe_cast") public function safeCast(t:Type):Bool { + return false; + } + + @:hlNative("std", "type_instance_fields") public function getInstanceFields():NativeArray { + return null; + } + + @:hlNative("std", "type_get_global") public function getGlobal():Dynamic { + return null; + } + + @:hlNative("std", "type_set_global") public function setGlobal(v:Dynamic):Bool { + return false; + } + + @:hlNative("std", "type_args_count") public function getArgsCount():Int { + return 0; + } + + @:hlNative("std", "type_super") public function getSuper():Type { + return null; + } + + @:hlNative("std", "type_enum_fields") public function getEnumFields():NativeArray { + return null; + } + + @:hlNative("std", "type_enum_values") public function getEnumValues():NativeArray { + return null; + } + + @:hlNative("std", "alloc_obj") public function allocObject():Dynamic { + return null; + } + + @:hlNative("std", "alloc_enum_dyn") public function allocEnum(index:Int, args:NativeArray, nargs:Int):Dynamic { + return null; + } +} diff --git a/build/linux64_569e52e/std/hl/UI.hx b/build/linux64_569e52e/std/hl/UI.hx new file mode 100644 index 0000000..847d746 --- /dev/null +++ b/build/linux64_569e52e/std/hl/UI.hx @@ -0,0 +1,250 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl; + +typedef SentinelHandle = hl.Abstract<"ui_sentinel">; + +abstract Sentinel(SentinelHandle) { + public var pause(get, set):Bool; + + public function new(timeout, callback) { + this = create_sentinel(timeout, callback); + } + + function get_pause() { + return is_paused(this); + } + + function set_pause(p:Bool) { + _pause(this, p); + return p; + } + + public function tick() { + _tick(this); + } + + @:hlNative("ui", "ui_start_sentinel") static function create_sentinel(timeout:Float, callb:Void->Void):SentinelHandle { + return null; + } + + @:hlNative("ui", "ui_sentinel_tick") static function _tick(h:SentinelHandle):Void {} + + @:hlNative("ui", "ui_sentinel_pause") static function _pause(h:SentinelHandle, b:Bool):Void {} + + @:hlNative("ui", "ui_sentinel_is_paused") static function is_paused(h:SentinelHandle):Bool { + return false; + } +} + +typedef WinHandle = hl.Abstract<"ui_window">; + +class Window { + var h:WinHandle; + + public function setText(text:String) { + win_set_text(h, @:privateAccess text.bytes); + } + + public function setEnable(b:Bool) { + win_set_enable(h, b); + } + + public function destroy() { + win_destroy(h); + } + + @:hlNative("ui", "ui_win_destroy") + static function win_destroy(win:WinHandle):Void {} + + @:hlNative("ui", "ui_win_set_text") + static function win_set_text(win:WinHandle, text:hl.Bytes):Void {} + + @:hlNative("ui", "ui_win_set_enable") + static function win_set_enable(win:WinHandle, enable:Bool):Void {} +} + +class Button extends Window { + public function new(parent:Window, text:String) { + h = button_new(parent.h, @:privateAccess text.bytes, function() this.onClick()); + } + + public dynamic function onClick() {} + + @:hlNative("ui", "ui_button_new") + static function button_new(parent:WinHandle, text:hl.Bytes, onClick:Void->Void):WinHandle { + return null; + } +} + +class WinLog extends Window { + public function new(title:String, width, height) { + h = winlog_new(@:privateAccess title.bytes, width, height); + } + + public function setTextContent(text:String, autoScroll = false) { + winlog_set_text(h, @:privateAccess text.bytes, autoScroll); + } + + @:hlNative("ui", "ui_winlog_new") + static function winlog_new(text:hl.Bytes, width:Int, height:Int):WinHandle { + return null; + } + + @:hlNative("ui", "ui_winlog_set_text") + static function winlog_set_text(win:WinHandle, text:hl.Bytes, autoScroll:Bool):Void {} +} + +enum DialogFlags { + YesNo; + IsError; +} + +enum abstract LoopResult(Int) { + var NoMessage = 0; + var HandledMessage = 1; + var Quit = 2; +} + +typedef FileOptions = { + var ?window:Window; + var ?filters:Array<{name:String, exts:Array}>; + var ?filterIndex:Int; + var ?fileName:String; + var ?title:String; +} + +/** + These are the bindings for the HL `ui.hdll` library, which contains some low level system access. +**/ +class UI { + @:hlNative("ui", "ui_init") static function init() {} + + static function __init__() { + init(); + } + + @:hlNative("ui", "ui_dialog") + static function _dialog(title:hl.Bytes, text:hl.Bytes, flags:Int):Int { + return 0; + } + + public static function dialog(title:String, text:String, flags:haxe.EnumFlags) { + return @:privateAccess _dialog(title.bytes, text.bytes, flags.toInt()) != 0; + } + + @:hlNative("ui", "ui_loop") + public static function loop(blocking:Bool):LoopResult { + return Quit; + } + + @:hlNative("ui", "ui_stop_loop") + public static function stopLoop():Void {} + + @:hlNative("ui", "ui_close_console") + public static function closeConsole():Void {} + + public static function loadFile(opts:FileOptions) { + return chooseFile(false, opts); + } + + public static function saveFile(opts:FileOptions) { + return chooseFile(true, opts); + } + + static function chooseFile(save:Bool, opts:FileOptions) @:privateAccess { + var out:Dynamic = {}; + if (opts.fileName != null) { + var file = sys.FileSystem.absolutePath(opts.fileName); + if (Sys.systemName() == "Windows") + file = file.split("/").join("\\"); + var dir = null; + if (sys.FileSystem.isDirectory(file)) { + dir = file; + file = null; + } else { + var path = new haxe.io.Path(file); + dir = path.dir; + file = path.file + (path.ext == null ? "" : "." + path.ext); + } + if (file != null) + out.fileName = file.bytes; + if (dir != null) + out.directory = dir.bytes; + } + if (opts.title != null) + out.title = opts.title.bytes; + if (opts.filters != null) { + var filters = new hl.NativeArray(opts.filters.length * 2); + var i = 0; + for (f in opts.filters) { + filters[i++] = f.name.bytes; + filters[i++] = [for (e in f.exts) "*." + e].join(";").bytes; + } + out.filters = filters; + out.filterIndex = opts.filterIndex; + } + if (opts.window != null) + out.window = opts.window.h; + var str = _chooseFile(save, out); + return str == null ? null : String.fromUCS2(str); + } + + @:hlNative("ui", "ui_choose_file") + static function _chooseFile(forSave:Bool, obj:Dynamic):hl.Bytes { + return null; + } + + #if (hl_ver >= version("1.12.0")) + public static function setClipboardText(text:String):Bool { + if(text == null) + return false; + return @:privateAccess _setClipboardText(text.toUtf8()); + } + + @:hlNative("?ui", "ui_set_clipboard_text") + static function _setClipboardText(text:hl.Bytes):Bool { + return false; + } + + public static function getClipboardText():String { + var t = _getClipboardText(); + if( t == null ) + return null; + return @:privateAccess String.fromUTF8(t); + } + + @:hlNative("?ui", "ui_get_clipboard_text") + static function _getClipboardText():hl.Bytes { + return null; + } + #else + public static function setClipboardText(text:String):Bool { + return false; + } + public static function getClipboardText():String { + return null; + } + #end + +} diff --git a/build/linux64_569e52e/std/hl/UI16.hx b/build/linux64_569e52e/std/hl/UI16.hx new file mode 100644 index 0000000..23f4e97 --- /dev/null +++ b/build/linux64_569e52e/std/hl/UI16.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl; + +@:coreType @:notNull @:runtimeValue abstract UI16 to Int from Int {} diff --git a/build/linux64_569e52e/std/hl/UI8.hx b/build/linux64_569e52e/std/hl/UI8.hx new file mode 100644 index 0000000..d53c915 --- /dev/null +++ b/build/linux64_569e52e/std/hl/UI8.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl; + +@:coreType @:notNull @:runtimeValue abstract UI8 to Int from Int {} diff --git a/build/linux64_569e52e/std/hl/_std/Date.hx b/build/linux64_569e52e/std/hl/_std/Date.hx new file mode 100644 index 0000000..e0a52c5 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/Date.hx @@ -0,0 +1,196 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +import hl.Ref; + +@:coreApi final class Date { + private var t:Int; + + public function new(year:Int, month:Int, day:Int, hour:Int, min:Int, sec:Int):Void { + t = date_new(year, month, day, hour, min, sec); + } + + public function getTime():Float { + return date_get_time(t); + } + + public function getFullYear():Int { + var v = 0; + date_get_inf(t, v, null, null, null, null, null, null); + return v; + } + + public function getMonth():Int { + var v = 0; + date_get_inf(t, null, v, null, null, null, null, null); + return v; + } + + public function getDate():Int { + var v = 0; + date_get_inf(t, null, null, v, null, null, null, null); + return v; + } + + public function getHours():Int { + var v = 0; + date_get_inf(t, null, null, null, v, null, null, null); + return v; + } + + public function getMinutes():Int { + var v = 0; + date_get_inf(t, null, null, null, null, v, null, null); + return v; + } + + public function getSeconds():Int { + var v = 0; + date_get_inf(t, null, null, null, null, null, v, null); + return v; + } + + public function getDay():Int { + var v = 0; + date_get_inf(t, null, null, null, null, null, null, v); + return v; + } + + public function getUTCFullYear():Int { + var v = 0; + date_get_utc_inf(t, v, null, null, null, null, null, null); + return v; + } + + public function getUTCMonth():Int { + var v = 0; + date_get_utc_inf(t, null, v, null, null, null, null, null); + return v; + } + + public function getUTCDate():Int { + var v = 0; + date_get_utc_inf(t, null, null, v, null, null, null, null); + return v; + } + + public function getUTCHours():Int { + var v = 0; + date_get_utc_inf(t, null, null, null, v, null, null, null); + return v; + } + + public function getUTCMinutes():Int { + var v = 0; + date_get_utc_inf(t, null, null, null, null, v, null, null); + return v; + } + + public function getUTCSeconds():Int { + var v = 0; + date_get_utc_inf(t, null, null, null, null, null, v, null); + return v; + } + + public function getUTCDay():Int { + var v = 0; + date_get_utc_inf(t, null, null, null, null, null, null, v); + return v; + } + + public function getTimezoneOffset():Int { + var y = 0; + var mo = 0; + var d = 0; + var h = 0; + var m = 0; + var s = 0; + date_get_utc_inf(t, y, mo, d, h, m, s, null); + return Std.int((date_new(y, mo, d, h, m, s) - t) / 60); + } + + @:keep public function toString():String { + var outLen = 0; + var bytes = date_to_string(t, outLen); + return @:privateAccess String.__alloc__(bytes, outLen); + } + + public static function now():Date { + var d:Date = untyped $new(Date); + d.t = date_now(); + return d; + } + + static function fromInt(t:Int):Date { + var d:Date = untyped $new(Date); + d.t = t; + return d; + } + + public static function fromTime(t:Float):Date { + var d:Date = untyped $new(Date); + d.t = date_from_time(t); + return d; + } + + public static function fromString(s:String):Date { + var d:Date = untyped $new(Date); + d.t = date_from_string(@:privateAccess s.bytes, s.length << 1); + return d; + } + + @:hlNative + static function date_new(year:Int, month:Int, day:Int, hours:Int, minutes:Int, seconds:Int):Int { + return 0; + } + + @:hlNative + static function date_now():Int { + return 0; + } + + @:hlNative + static function date_from_time(t:Float):Int { + return 0; + } + + @:hlNative + static function date_from_string(b:hl.Bytes, len:Int):Int { + return 0; + } + + @:hlNative + static function date_get_time(t:Int):Float { + return 0.; + } + + @:hlNative + static function date_get_inf(t:Int, year:Ref, month:Ref, day:Ref, hours:Ref, minutes:Ref, seconds:Ref, wday:Ref):Void {} + + @:hlNative(1.11) + static function date_get_utc_inf(t:Int, year:Ref, month:Ref, day:Ref, hours:Ref, minutes:Ref, seconds:Ref, wday:Ref):Void {} + + @:hlNative + static function date_to_string(t:Int, outLen:Ref):hl.Bytes { + return null; + } +} diff --git a/build/linux64_569e52e/std/hl/_std/EReg.hx b/build/linux64_569e52e/std/hl/_std/EReg.hx new file mode 100644 index 0000000..c066161 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/EReg.hx @@ -0,0 +1,202 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +private typedef ERegValue = hl.Abstract<"ereg">; + +@:access(String) +@:coreApi final class EReg { + var r:ERegValue; + var last:String; + var global:Bool; + + public function new(r:String, opt:String):Void { + var a = opt.split("g"); + global = a.length > 1; + if (global) + opt = a.join(""); + this.r = regexp_new_options(r.bytes, opt.bytes); + } + + public function match(s:String):Bool { + var p = regexp_match(r, s.bytes, 0, s.length); + if (p) + last = s; + else + last = null; + return p; + } + + public function matched(n:Int):String { + var len = 0; + var m = regexp_matched_pos(r, n, len); + return m < 0 ? null : last.substr(m, len); + } + + public function matchedLeft():String { + var p = regexp_matched_pos(r, 0, null); + return last.substr(0, p); + } + + public function matchedRight():String { + var len = 0; + var p = regexp_matched_pos(r, 0, len); + return last.substr(p + len); + } + + public function matchedPos():{pos:Int, len:Int} { + var len = 0; + var p = regexp_matched_pos(r, 0, len); + if (p < 0) + return null; + return {pos: p, len: len}; + } + + public function matchSub(s:String, pos:Int, len:Int = -1):Bool { + var p = regexp_match(r, s.bytes, pos, len < 0 ? s.length - pos : len); + if (p) + last = s; + else + last = null; + return p; + } + + public function split(s:String):Array { + var pos = 0; + var len = s.length; + var a = new Array(); + var first = true; + do { + if (!regexp_match(r, s.bytes, pos, len)) + break; + var plen = 0; + var p = regexp_matched_pos(r, 0, plen); + if (plen == 0 && !first) { + if (p == s.length) + break; + p++; + } + a.push(s.substr(pos, p - pos)); + var tot = p + plen - pos; + pos += tot; + len -= tot; + first = false; + } while (global); + a.push(s.substr(pos, len)); + return a; + } + + public function replace(s:String, by:String):String { + var b = new StringBuf(); + var pos = 0; + var len = s.length; + var a = by.split("$"); + var first = true; + do { + if (!regexp_match(r, s.bytes, pos, len)) + break; + var plen = 0; + var p = regexp_matched_pos(r, 0, plen); + if (plen == 0 && !first) { + if (p == s.length) + break; + p++; + } + b.addSub(s, pos, p - pos); + if (a.length > 0) + b.add(a[0]); + var i = 1; + while (i < a.length) { + var k = a[i]; + var c = StringTools.fastCodeAt(k, 0); + // 1...9 + if (c >= 49 && c <= 57) { + var plen = 0; + var p = try regexp_matched_pos(r, Std.int(c) - 48, plen) catch (e:String) -1; + if (p < 0) { + b.add("$"); + b.add(k); + } else { + if (p >= 0) + b.addSub(s, p, plen); + b.addSub(k, 1, k.length - 1); + } + } else if (c == 0) { + b.add("$"); + i++; + var k2 = a[i]; + if (k2 != null && k2.length > 0) + b.add(k2); + } else + b.add("$" + k); + i++; + } + var tot = p + plen - pos; + pos += tot; + len -= tot; + first = false; + } while (global); + b.addSub(s, pos, len); + return b.toString(); + } + + public function map(s:String, f:EReg->String):String { + var offset = 0; + var buf = new StringBuf(); + do { + if (offset >= s.length) + break; + else if (!matchSub(s, offset)) { + buf.add(s.substr(offset)); + break; + } + var plen = 0; + var p = regexp_matched_pos(r, 0, plen); + buf.add(s.substr(offset, p - offset)); + buf.add(f(this)); + if (plen == 0) { + buf.add(s.substr(p, 1)); + offset = p + 1; + } else + offset = p + plen; + } while (global); + if (!global && offset > 0 && offset < s.length) + buf.add(s.substr(offset)); + return buf.toString(); + } + + public static function escape(s:String):String { + return escapeRegExpRe.map(s, function(r) return "\\" + r.matched(0)); + } + + static var escapeRegExpRe = ~/[\[\]{}()*+?.\\\^$|]/g; + + @:hlNative("std", "regexp_new_options") static function regexp_new_options(bytes:hl.Bytes, options:hl.Bytes):ERegValue { + return null; + } + + @:hlNative("std", "regexp_match") static function regexp_match(r:ERegValue, str:hl.Bytes, pos:Int, size:Int):Bool { + return false; + } + + @:hlNative("std", "regexp_matched_pos") static function regexp_matched_pos(r:ERegValue, n:Int, size:hl.Ref):Int { + return 0; + } +} diff --git a/build/linux64_569e52e/std/hl/_std/Math.hx b/build/linux64_569e52e/std/hl/_std/Math.hx new file mode 100644 index 0000000..2c76ba8 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/Math.hx @@ -0,0 +1,104 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +@:coreApi +class Math { + @:hlNative("std", "math_sqrt") public static function sqrt(v:Float):Float + return 0.; + + @:hlNative("std", "math_abs") public static function abs(v:Float):Float + return 0.; + + @:hlNative("std", "math_floor") public static function floor(v:Float):Int + return 0; + + @:hlNative("std", "math_round") public static function round(v:Float):Int + return 0; + + @:hlNative("std", "math_ceil") public static function ceil(v:Float):Int + return 0; + + @:hlNative("std", "math_isfinite") public static function isFinite(f:Float):Bool + return true; + + @:hlNative("std", "math_isnan") public static function isNaN(f:Float):Bool + return false; + + @:hlNative("std", "math_ffloor") public static function ffloor(v:Float):Float + return 0.; + + @:hlNative("std", "math_fround") public static function fround(v:Float):Float + return 0.; + + @:hlNative("std", "math_fceil") public static function fceil(v:Float):Float + return 0.; + + @:hlNative("std", "math_cos") public static function cos(v:Float):Float + return 0.; + + @:hlNative("std", "math_sin") public static function sin(v:Float):Float + return 0.; + + @:hlNative("std", "math_exp") public static function exp(v:Float):Float + return 0.; + + @:hlNative("std", "math_log") public static function log(v:Float):Float + return 0.; + + @:hlNative("std", "math_tan") public static function tan(v:Float):Float + return 0.; + + @:hlNative("std", "math_atan") public static function atan(v:Float):Float + return 0.; + + @:hlNative("std", "math_acos") public static function acos(v:Float):Float + return 0.; + + @:hlNative("std", "math_asin") public static function asin(v:Float):Float + return 0.; + + @:hlNative("std", "math_pow") public static function pow(v:Float, exp:Float):Float + return 0.; + + @:hlNative("std", "math_atan2") public static function atan2(y:Float, x:Float):Float + return 0.; + + public static function random():Float + return @:privateAccess Std.rnd_float(Std.rnd); + + public static function min(a:Float, b:Float):Float + return a < b || isNaN(a) ? a : b; + + public static function max(a:Float, b:Float):Float + return a < b || isNaN(b) ? b : a; + + public static var PI(default, null):Float; + public static var NaN(default, null):Float; + public static var POSITIVE_INFINITY(default, null):Float; + public static var NEGATIVE_INFINITY(default, null):Float; + + static function __init__():Void { + PI = 3.1415926535897932384626433832795; + NaN = 0. / 0.; + POSITIVE_INFINITY = 1. / 0.; + NEGATIVE_INFINITY = -1. / 0.; + } +} diff --git a/build/linux64_569e52e/std/hl/_std/Reflect.hx b/build/linux64_569e52e/std/hl/_std/Reflect.hx new file mode 100644 index 0000000..3865b53 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/Reflect.hx @@ -0,0 +1,142 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +@:coreApi +class Reflect { + public static function hasField(o:Dynamic, field:String):Bool { + if (field == null) + return false; + var hash = @:privateAccess field.bytes.hash(); + return hl.Api.hasField(o, hash); + } + + public static function field(o:Dynamic, field:String):Dynamic { + if (field == null) + return null; + var hash = @:privateAccess field.bytes.hash(); + return hl.Api.getField(o, hash); + } + + public static function setField(o:Dynamic, field:String, value:Dynamic):Void { + var hash = @:privateAccess field.bytes.hash(); + hl.Api.setField(o, hash, value); + } + + public static function getProperty(o:Dynamic, field:String):Dynamic { + var f:Dynamic = Reflect.field(o, "get_" + field); + if (f != null) + return f(); + return Reflect.field(o, field); + } + + public static function setProperty(o:Dynamic, field:String, value:Dynamic):Void { + var f:Dynamic = Reflect.field(o, "set_" + field); + if (f != null) + f(value); + else + setField(o, field, value); + } + + public static function callMethod(o:Dynamic, func:haxe.Constraints.Function, args:Array):Dynamic { + var args:hl.types.ArrayDyn = cast args; + + var ft = hl.Type.getDynamic(func); + if (ft.kind != HFun) + throw "Invalid function " + func; + + var count = args.length; + var need = ft.getArgsCount(); + var nargs = count < need ? need : count; + var cval:Dynamic = hl.Api.getClosureValue(func); + if (cval != null) { + func = hl.Api.noClosure(func); + nargs++; + } + + var a = new hl.NativeArray(nargs); + if (cval == null) { + for (i in 0...count) + a[i] = args.getDyn(i); + } else { + a[0] = cval; + for (i in 0...count) + a[i + 1] = args.getDyn(i); + } + return hl.Api.callMethod(func, a); + } + + @:hlNative("std", "obj_fields") static function getObjectFields(v:Dynamic):hl.NativeArray { + return null; + } + + public static function fields(o:Dynamic):Array { + var fields = getObjectFields(o); + if (fields == null) + return []; + return [for (f in fields) @:privateAccess String.fromUCS2(f)]; + } + + public static inline function isFunction(f:Dynamic):Bool { + return hl.Type.getDynamic(f).kind == HFun; + } + + @:hlNative("std", "dyn_compare") + public static function compare(a:T, b:T):Int { + return 0; + } + + @:hlNative("std", "fun_compare") + public static function compareMethods(f1:Dynamic, f2:Dynamic):Bool { + return false; + } + + public static function isObject(v:Dynamic):Bool { + var t = hl.Type.getDynamic(v); + return switch (t.kind) { + case HObj, HDynObj, HVirtual: true; + default: false; + } + } + + public static function isEnumValue(v:Dynamic):Bool { + var t = hl.Type.getDynamic(v); + return t.kind == HEnum; + } + + public static function deleteField(o:Dynamic, field:String):Bool { + return hl.Api.deleteField(o, @:privateAccess field.bytes.hash()); + } + + @:hlNative("std", "obj_copy") + public static function copy(o:Null):Null { + return null; + } + + @:overload(function(f:Array->Void):Dynamic {}) + extern public static function makeVarArgs(f:Array->Dynamic):Dynamic; + + @:ifFeature("Reflect.makeVarArgs") static function _makeVarArgs(f:Array->Dynamic):Dynamic { + return hl.Api.makeVarArgs(function(args:hl.NativeArray) { + var arr = hl.types.ArrayDyn.alloc(hl.types.ArrayObj.alloc(args), true); + return f(cast arr); + }); + } +} diff --git a/build/linux64_569e52e/std/hl/_std/Std.hx b/build/linux64_569e52e/std/hl/_std/Std.hx new file mode 100644 index 0000000..5d8441b --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/Std.hx @@ -0,0 +1,146 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +import hl.Boot; + +private typedef Rand = hl.Abstract<"hl_random">; + +@:coreApi +class Std { + static var rnd:Rand; + static var toStringDepth:Int = 0; + + static function __init__():Void { + rnd = rnd_sys(); + } + + @:hlNative("std", "rnd_init_system") static function rnd_sys():Rand { + return null; + } + + @:hlNative("std", "rnd_int") static function rnd_int(r:Rand):Int { + return 0; + } + + @:hlNative("std", "rnd_float") static function rnd_float(r:Rand):Float { + return 0.; + } + + public static function random(x:Int):Int { + return x <= 0 ? 0 : (rnd_int(rnd) & 0x3FFFFFFF) % x; + } + + @:deprecated('Std.is is deprecated. Use Std.isOfType instead.') + public static inline function is(v:Dynamic, t:Dynamic):Bool { + return isOfType(v, t); + } + + public static function isOfType(v:Dynamic, t:Dynamic):Bool { + var t:hl.BaseType = t; + if (t == null) + return false; + switch (t.__type__.kind) { + case HDyn: + return v != null; + case HF64: + switch (hl.Type.getDynamic(v).kind) { + case HUI8, HUI16, HI32: + return true; + default: + } + case HI32: + switch (hl.Type.getDynamic(v).kind) { + case HF32, HF64: + var v:Float = v; + return Std.int(v) == v; + default: + } + default: + } + return t.check(v); + } + + extern public static function downcast(value:T, c:Class):S; + + @:deprecated('Std.instance() is deprecated. Use Std.downcast() instead.') + public static inline function instance(value:T, c:Class):S { + return downcast(value, c); + } + + extern public static inline function int(x:Float):Int { + return untyped $int(x); + } + + @:keep public static function string(s:Dynamic):String { + var len = 0; + var bytes = hl.Bytes.fromValue(s, new hl.Ref(len)); + return @:privateAccess String.__alloc__(bytes, len); + } + + public static function parseInt(x:String):Null { + if (x == null) + return null; + return @:privateAccess x.bytes.parseInt(0, x.length << 1); + } + + public static function parseFloat(x:String):Float { + if (x == null) + return Math.NaN; + return @:privateAccess x.bytes.parseFloat(0, x.length << 1); + } + + @:keep static function __add__(a:Dynamic, b:Dynamic):Dynamic { + var ta = hl.Type.getDynamic(a); + var tb = hl.Type.getDynamic(b); + if (ta == hl.Type.get("")) + return (a : String) + b; + if (tb == hl.Type.get("")) + return a + (b : String); + switch (ta.kind) { + case HUI8, HUI16, HI32: + var a:Int = a; + switch (tb.kind) { + case HUI8, HUI16, HI32: return a + (b : Int); + case HF32, HF64: return a + (b : Float); + case HVoid: return a; + default: + } + case HF32, HF64: + var a:Float = a; + switch (tb.kind) { + case HUI8, HUI16, HI32: return a + (b : Int); + case HF32, HF64: return a + (b : Float); + case HVoid: return a; + default: + } + case HVoid: + switch (tb.kind) { + case HUI8, HUI16, HI32, HF32, HF64: return b; + case HVoid: return 0.; + default: + } + default: + } + throw "Can't add " + a + "(" + ta + ") and " + b + "(" + tb + ")"; + return null; + } +} diff --git a/build/linux64_569e52e/std/hl/_std/String.hx b/build/linux64_569e52e/std/hl/_std/String.hx new file mode 100644 index 0000000..5d3163c --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/String.hx @@ -0,0 +1,256 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +@:coreApi +class String { + var bytes:hl.Bytes; + + public var length(default, null):Int; + + public function new(string:String):Void { + bytes = string.bytes; + length = string.length; + } + + public function toUpperCase():String { + return __alloc__(@:privateAccess bytes.ucs2Upper(0, length), length); + } + + public function toLowerCase():String { + return __alloc__(@:privateAccess bytes.ucs2Lower(0, length), length); + } + + public function charAt(index:Int):String { + if ((index : UInt) >= (length : UInt)) + return ""; + var b = new hl.Bytes(4); + b.setUI16(0, bytes.getUI16(index << 1)); + b.setUI16(2, 0); + return __alloc__(b, 1); + } + + public function charCodeAt(index:Int):Null { + var idx:UInt = index; + if (idx >= (length : UInt)) + return null; + return bytes.getUI16(index << 1); + } + + inline function findChar(start:Int, len:Int, src:hl.Bytes, srcLen:Int):Int { + var p = 0; + while (true) { + p = bytes.find(start, len - start, src, 0, srcLen); + if (p < 0 || p & 1 == 0) + break; + start = p + 1; + } + return p; + } + + public function indexOf(str:String, ?startIndex:Int):Int { + var startByte = 0; + if (startIndex != null && startIndex > 0) { + if (startIndex >= length) + return str == '' ? length : -1; + startByte = startIndex << 1; + } + var p = findChar(startByte, length << 1, str.bytes, str.length << 1); + if (p > 0) + p >>= 1; + return p; + } + + public function lastIndexOf(str:String, ?startIndex:Int):Int { + var max = this.length; + if (startIndex != null) { + max = startIndex + str.length; + if (max < 0) + max = 0; + if (max > this.length) + max = this.length; + } + var pos = max - str.length; + var slen = str.length << 1; + while (pos >= 0) { + if (bytes.compare(pos << 1, str.bytes, 0, slen) == 0) + return pos; + pos--; + } + return -1; + } + + public function split(delimiter:String):Array { + var out = []; + if (length == 0) { + out.push(""); + return out; + } + if (delimiter.length == 0) { + for (i in 0...length) + out.push(substr(i, 1)); + return out; + } + var pos = 0; + var dlen = delimiter.length; + while (true) { + var p = findChar(pos << 1, length << 1, delimiter.bytes, dlen << 1); + if (p < 0) { + out.push(substr(pos, length - pos)); + break; + } + p >>= 1; + out.push(substr(pos, p - pos)); + pos = p + dlen; + } + return out; + } + + public function substr(pos:Int, ?len:Int):String@:privateAccess { + var sl = length; + var len:Int = if (len == null) sl else len; + if (len == 0) + return ""; + if (pos != 0 && len < 0) + return ""; + if (pos < 0) { + pos = sl + pos; + if (pos < 0) + pos = 0; + } else if (len < 0) { + len = sl + len - pos; + if (len < 0) + return ""; + } + if (((pos + len) : UInt) > (sl : UInt)) + len = sl - pos; + if (pos < 0 || len <= 0) + return ""; + + var b = new hl.Bytes((len + 1) << 1); + b.blit(0, bytes, pos << 1, len << 1); + b.setUI16(len << 1, 0); + return __alloc__(b, len); + } + + public function substring(startIndex:Int, ?endIndex:Int):String { + var end:Int; + if (endIndex == null) + end = length; + else { + end = endIndex; + if (end < 0) + end = 0; + else if (end > length) + end = length; + } + if (startIndex < 0) + startIndex = 0; + else if (startIndex > length) + startIndex = length; + if (startIndex > end) { + var tmp = startIndex; + startIndex = end; + end = tmp; + } + return substr(startIndex, end - startIndex); + } + + public function toString():String { + return this; + } + + public static function fromCharCode(code:Int):String { + if (code >= 0 && code < 0x10000) { + if (code >= 0xD800 && code <= 0xDFFF) + throw "Invalid unicode char " + code; + var b = new hl.Bytes(4); + b.setUI16(0, code); + b.setUI16(2, 0); + return __alloc__(b, 1); + } else if (code < 0x110000) { + var b = new hl.Bytes(6); + code -= 0x10000; + b.setUI16(0, (code >> 10) + 0xD800); + b.setUI16(2, (code & 1023) + 0xDC00); + b.setUI16(4, 0); + return __alloc__(b, 2); // UTF16 encoding but UCS2 API (same as JS) + } else + throw "Invalid unicode char " + code; + } + + function toUtf8():hl.Bytes { + return bytes.utf16ToUtf8(0, null); + } + + @:keep function __string():hl.Bytes { + return bytes; + } + + @:keep function __compare(v:Dynamic):Int { + var s = Std.downcast(v, String); + if (s == null) + return hl.Api.comparePointer(this, v); + #if (hl_ver >= version("1.10.0")) + var v = bytes.compare16(s.bytes, length < s.length ? length : s.length); + #else + var v = bytes.compare(0, s.bytes, 0, (length < s.length ? length : s.length) << 1); + #end + return v == 0 ? length - s.length : v; + } + + @:keep static inline function __alloc__(b:hl.Bytes, length:Int):String { + var s:String = untyped $new(String); + s.bytes = b; + s.length = length; + return s; + } + + @:keep static function call_toString(v:Dynamic):hl.Bytes { + var s:String = v.toString(); + return s.bytes; + } + + inline static function fromUCS2(b:hl.Bytes):String { + var s:String = untyped $new(String); + s.bytes = b; + s.length = @:privateAccess b.ucs2Length(0); + return s; + } + + @:keep static function fromUTF8(b:hl.Bytes):String { + var outLen = 0; + var b2 = @:privateAccess b.utf8ToUtf16(0, outLen); + return __alloc__(b2, outLen >> 1); + } + + @:keep static function __add__(a:String, b:String):String { + if (a == null) + a = "null"; + if (b == null) + b = "null"; + var asize = a.length << 1, bsize = b.length << 1, tot = asize + bsize; + var bytes = new hl.Bytes(tot + 2); + bytes.blit(0, a.bytes, 0, asize); + bytes.blit(asize, b.bytes, 0, bsize); + bytes.setUI16(tot, 0); + return __alloc__(bytes, tot >> 1); + } +} diff --git a/build/linux64_569e52e/std/hl/_std/StringBuf.hx b/build/linux64_569e52e/std/hl/_std/StringBuf.hx new file mode 100644 index 0000000..ab5dcdb --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/StringBuf.hx @@ -0,0 +1,110 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +@:coreApi class StringBuf { + var b:hl.Bytes; + var size:Int; + var pos:Int; + + public var length(get, never):Int; + + public function new():Void { + pos = 0; + size = 8; // ensure 4 bytes expand for addChar() + b = new hl.Bytes(size); + } + + inline function get_length():Int { + return pos >> 1; + } + + inline function __expand(need:Int):Void { + var nsize = (size * 3) >> 1; + if (need > nsize) + nsize = need; + var b2 = new hl.Bytes(nsize); + b2.blit(0, b, 0, pos); + b = b2; + size = nsize; + } + + inline function __add(bytes:hl.Bytes, spos:Int, ssize:Int):Void { + if (pos + ssize > size) + __expand(pos + ssize); + b.blit(pos, bytes, spos, ssize); + pos += ssize; + } + + public function add(x:T):Void { + var slen = 0; + var str = Std.downcast((x:Dynamic),String); + if( str != null ) { + __add(@:privateAccess str.bytes, 0, str.length<<1); + return; + } + var sbytes = hl.Bytes.fromValue(x, new hl.Ref(slen)); + __add(sbytes, 0, slen << 1); + } + + public function addSub(s:String, pos:Int, ?len:Int):Void@:privateAccess { + if (pos < 0) + pos = 0; + if (pos >= s.length) + return; + var slen:Int; + if (len == null) + slen = s.length - pos + else { + slen = len; + if (pos + slen > s.length) + slen = s.length - pos; + if (slen <= 0) + return; + } + __add(s.bytes, pos << 1, slen << 1); + } + + public function addChar(c:Int):Void { + if (c >= 0 && c < 0x10000) { + if (c >= 0xD800 && c <= 0xDFFF) + throw "Invalid unicode char " + c; + if (pos + 2 > size) + __expand(0); + b.setUI16(pos, c); + pos += 2; + } else if (c < 0x110000) { + if (pos + 4 > size) + __expand(0); + c -= 0x10000; + b.setUI16(pos, (c >> 10) + 0xD800); + b.setUI16(pos + 2, (c & 1023) + 0xDC00); + pos += 4; + } else + throw "Invalid unicode char " + c; + } + + public function toString():String { + if (pos + 2 > size) + __expand(0); + b.setUI16(pos, 0); + return @:privateAccess String.__alloc__(b, pos >> 1); + } +} diff --git a/build/linux64_569e52e/std/hl/_std/Sys.hx b/build/linux64_569e52e/std/hl/_std/Sys.hx new file mode 100644 index 0000000..29d5e09 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/Sys.hx @@ -0,0 +1,235 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +import haxe.SysTools; + +class SysError { + public var msg:String; + + public function new(msg) { + this.msg = msg; + } + + @:keep public function toString() { + return "SysError(" + msg + ")"; + } +} + +@:coreApi +@:keepInit +@:access(String) +class Sys { + static var utf8Path:Bool; + + static function __init__():Void { + utf8Path = sys_utf8_path(); + } + + static function getPath(s:String):hl.Bytes { + return utf8Path ? s.bytes.utf16ToUtf8(0, null) : s.bytes; + } + + static function makePath(b:hl.Bytes):String { + if (b == null) + return null; + return utf8Path ? String.fromUTF8(b) : String.fromUCS2(b); + } + + public static function print(v:Dynamic):Void { + sys_print(Std.string(v).bytes); + } + + public static function println(v:Dynamic):Void { + sys_print(Std.string(v).bytes); + sys_print("\n".bytes); + } + + public static function args():Array { + return [for (a in sys_args()) makePath(a)]; + } + + public static function stdin():haxe.io.Input { + return @:privateAccess new sys.io.FileInput(file_stdin()); + } + + public static function stdout():haxe.io.Output { + return @:privateAccess new sys.io.FileOutput(file_stdout()); + } + + public static function stderr():haxe.io.Output { + return @:privateAccess new sys.io.FileOutput(file_stderr()); + } + + public static function getEnv(s:String):String { + var v = get_env(getPath(s)); + if (v == null) + return null; + return makePath(v); + } + + public static function putEnv(s:String, v:Null):Void { + if (!put_env(getPath(s), if (v == null) null else getPath(v))) + throw "putEnv() failure"; + } + + public static function environment():Map { + var env = sys_env(); + var h = new haxe.ds.StringMap(); + for (i in 0...env.length >> 1) { + var p = i << 1; + h.set(makePath(env[p]), makePath(env[p + 1])); + } + return h; + } + + @:hlNative("std", "sys_sleep") + public static function sleep(seconds:Float):Void {} + + public static function setTimeLocale(loc:String):Bool { + return set_time_locale(loc.bytes.utf16ToUtf8(0, null)); + } + + public static function getCwd():String { + return makePath(get_cwd()); + } + + public static function setCwd(s:String):Void { + if (!set_cwd(getPath(s))) + throw new SysError("Failed to set path to " + s); + } + + public static function systemName():String { + return String.fromUCS2(sys_string()); + } + + public static function command(cmd:String, ?args:Array):Int { + var code = 0; + if (args == null) { + code = sys_command(getPath(cmd)); + } else { + switch (systemName()) { + case "Windows": + cmd = [ + for (a in [StringTools.replace(cmd, "/", "\\")].concat(args)) + SysTools.quoteWinArg(a, true) + ].join(" "); + code = sys_command(getPath(cmd)); + case _: + cmd = [cmd].concat(args).map(SysTools.quoteUnixArg).join(" "); + code = sys_command(getPath(cmd)); + } + } + return code; + } + + @:deprecated("Use programPath instead") public static function executablePath():String { + return makePath(sys_exe_path()); + } + + public static function programPath():String { + return sys_program_path; + } + + private static var sys_program_path = { + var hlFile = sys_hl_file(); + if (hlFile == null) + makePath(sys_exe_path()); + else + sys.FileSystem.fullPath(makePath(hlFile)); + } + + @:hlNative("std", "sys_utf8_path") static function sys_utf8_path():Bool { + return false; + } + + @:hlNative("std", "sys_time") public static function time():Float { + return 0.; + }; + + @:hlNative("std", "sys_exit") public static function exit(code:Int):Void {}; + + @:hlNative("std", "sys_cpu_time") public static function cpuTime():Float { + return 0.; + }; + + @:hlNative("std", "sys_get_char") public static function getChar(echo:Bool):Int { + return 0; + } + + @:hlNative("std", "sys_print") static function sys_print(v:hl.Bytes):Void {}; + + @:hlNative("std", "file_stdin") static function file_stdin():sys.io.File.FileHandle { + return null; + } + + @:hlNative("std", "file_stdout") static function file_stdout():sys.io.File.FileHandle { + return null; + } + + @:hlNative("std", "file_stderr") static function file_stderr():sys.io.File.FileHandle { + return null; + } + + @:hlNative("std", "sys_args") static function sys_args():hl.NativeArray { + return null; + } + + @:hlNative("std", "sys_get_env") static function get_env(key:hl.Bytes):hl.Bytes { + return null; + } + + @:hlNative("std", "sys_put_env") static function put_env(key:hl.Bytes, val:hl.Bytes):Bool { + return false; + } + + @:hlNative("std", "sys_env") static function sys_env():hl.NativeArray { + return null; + } + + @:hlNative("std", "sys_set_time_locale") static function set_time_locale(loc:hl.Bytes):Bool { + return true; + } + + @:hlNative("std", "sys_get_cwd") static function get_cwd():hl.Bytes { + return null; + } + + @:hlNative("std", "sys_set_cwd") static function set_cwd(path:hl.Bytes):Bool { + return true; + } + + @:hlNative("std", "sys_command") static function sys_command(cmd:hl.Bytes):Int { + return 0; + } + + @:hlNative("std", "sys_exe_path") static function sys_exe_path():hl.Bytes { + return null; + } + + @:hlNative("std", "sys_hl_file") static function sys_hl_file():hl.Bytes { + return null; + } + + @:hlNative("std", "sys_string") static function sys_string():hl.Bytes { + return null; + } +} diff --git a/build/linux64_569e52e/std/hl/_std/Type.hx b/build/linux64_569e52e/std/hl/_std/Type.hx new file mode 100644 index 0000000..1096f00 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/Type.hx @@ -0,0 +1,277 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +enum ValueType { + TNull; + TInt; + TFloat; + TBool; + TObject; + TFunction; + TClass(c:Class); + TEnum(e:Enum); + TUnknown; +} + +@:coreApi +class Type { + static var allTypes(get, never):hl.types.BytesMap; + + static inline function get_allTypes():hl.types.BytesMap + return untyped $allTypes(); + + @:keep static function init():Bool { + if( allTypes != null ) + return false; + untyped $allTypes(new hl.types.BytesMap()); + return true; + } + + @:keep static function initClass(ct:hl.Type, t:hl.Type, name:hl.Bytes):hl.BaseType.Class@:privateAccess { + var c:hl.BaseType.Class = cast t.getGlobal(); + if( c != null ) + return c; + c = ct.allocObject(); + t.setGlobal(c); + c.__type__ = t; + c.__name__ = String.fromUCS2(name); + register(name, c); + return c; + } + + @:keep static function initEnum(et:hl.Type, t:hl.Type):hl.BaseType.Enum@:privateAccess { + var e:hl.BaseType.Enum = cast t.getGlobal(); + if( e != null ) + return e; + e = et.allocObject(); + e.__type__ = t; + e.__evalues__ = t.getEnumValues(); + e.__ename__ = t.getTypeName(); + e.__emap__ = new hl.types.BytesMap(); + e.__constructs__ = new Array(); + var cl = t.getEnumFields(); + for (i in 0...cl.length) { + var name = cl[i]; + e.__emap__.set(name, i); + e.__constructs__.push(String.fromUCS2(name)); + } + register(e.__ename__.bytes, e); + t.setGlobal(e); + return e; + } + + @:keep static function register(b:hl.Bytes, t:hl.BaseType):Void { + allTypes.set(b, t); + } + + public static function getClass(o:T):Null> { + var t = hl.Type.getDynamic(o); + if (t.kind == HVirtual) { + o = hl.Api.getVirtualValue(o); + t = hl.Type.getDynamic(o); + } + if (t.kind == HObj) + return t.getGlobal(); + return null; + } + + public static function getEnum(o:EnumValue):Enum { + var t = hl.Type.getDynamic(o); + if (t.kind == HEnum) + return t.getGlobal(); + return null; + } + + public static function getSuperClass(c:Class):Class@:privateAccess { + var c:hl.BaseType.Class = cast c; + var t = c.__type__.getSuper(); + return t == hl.Type.void() ? null : t.getGlobal(); + } + + public static function getClassName(c:Class):String { + var c:hl.BaseType.Class = cast c; + return c.__name__; + } + + public static function getEnumName(e:Enum):String { + var e:hl.BaseType.Enum = cast e; + return e.__ename__; + } + + public static function resolveClass(name:String):Class { + var t:hl.BaseType = allTypes.get(@:privateAccess name.bytes); + if (t == null || !Std.isOfType(t, hl.BaseType.Class)) + return null; + return cast t; + } + + public static function resolveEnum(name:String):Enum { + var t:hl.BaseType = allTypes.get(@:privateAccess name.bytes); + if (t == null || !Std.isOfType(t, hl.BaseType.Enum)) + return null; + return cast t; + } + + public static function createInstance(cl:Class, args:Array):T { + var c:hl.BaseType.Class = cast cl; + var t = c.__type__; + if (t == hl.Type.get((null : hl.types.ArrayBase.ArrayAccess))) + return cast new Array(); + var o = t.allocObject(); + if (c.__constructor__ != null) { + var v:Dynamic = hl.Api.noClosure(c.__constructor__); + var args = args.copy(); + args.unshift(o); + Reflect.callMethod(null, v, args); + } + return o; + } + + public static function createEmptyInstance(cl:Class):T { + var c:hl.BaseType.Class = cast cl; + return c.__type__.allocObject(); + } + + public static function createEnum(e:Enum, constr:String, ?params:Array):T { + var en:hl.BaseType.Enum = cast e; + var idx:Null = en.__emap__.get(@:privateAccess constr.bytes); + if (idx == null) + throw "Unknown enum constructor " + en.__ename__ + "." + constr; + return createEnumIndex(e, idx, params); + } + + public static function createEnumIndex(e:Enum, index:Int, ?params:Array):T { + var e:hl.BaseType.Enum = cast e; + if (index < 0 || index >= e.__constructs__.length) + throw "Invalid enum index " + e.__ename__ + "." + index; + if (params == null || params.length == 0) { + var v = index >= e.__evalues__.length ? null : e.__evalues__[index]; + if (v == null) + throw "Constructor " + e.__ename__ + "." + e.__constructs__[index] + " takes parameters"; + return v; + } + var a:hl.types.ArrayDyn = cast params; + var narr; + if (@:privateAccess !a.array.isArrayObj()) { + narr = new hl.NativeArray(a.length); + for (i in 0...a.length) + narr[i] = @:privateAccess a.array.getDyn(i); + } else { + var aobj:hl.types.ArrayObj = cast @:privateAccess a.array; + narr = @:privateAccess aobj.array; + } + var v = @:privateAccess e.__type__.allocEnum(index, narr, a.length); + if (v == null) + throw "Constructor " + e.__ename__ + "." + e.__constructs__[index] + " does not takes " + narr.length + " parameters"; + return v; + } + + public static function getInstanceFields(c:Class):Array@:privateAccess { + var c:hl.BaseType.Class = cast c; + var fields = c.__type__.getInstanceFields(); + return [for (f in fields) String.fromUCS2(f)]; + } + + public static function getClassFields(c:Class):Array { + var c:hl.BaseType.Class = cast c; + var fields = @:privateAccess Reflect.getObjectFields(c); + var fields = [for (f in fields) @:privateAccess String.fromUCS2(f)]; + fields.remove("__constructor__"); + fields.remove("__meta__"); + fields.remove("__name__"); + fields.remove("__type__"); + fields.remove("__implementedBy__"); + return fields; + } + + public static function getEnumConstructs(e:Enum):Array { + var e:hl.BaseType.Enum = cast e; + return e.__constructs__.copy(); + } + + public static function typeof(v:Dynamic):ValueType { + var t = hl.Type.getDynamic(v); + switch (t.kind) { + case HVoid: + return TNull; + case HUI8, HUI16, HI32: + return TInt; + case HF32, HF64: + return (v : Int) == (v:Float) ? TInt : TFloat; + case HBool: + return TBool; + case HDynObj: + return TObject; + case HObj: + var c:Dynamic = Type.getClass(v); + if (c == Class || c == null) + return TObject; + return TClass(c); + case HEnum: + return TEnum(Type.getEnum(v)); + case HFun: + return TFunction; + case HVirtual: + var v = hl.Api.getVirtualValue(v); + if (v == null) + return TObject; + return typeof(v); + default: + return TUnknown; + } + } + + @:hlNative("std", "type_enum_eq") + public static function enumEq(a:T, b:T):Bool { + return false; + } + + public static function enumConstructor(e:EnumValue):String { + var en:hl.BaseType.Enum = cast getEnum(e); + return en.__constructs__[Type.enumIndex(e)]; + } + + @:hlNative("std", "enum_parameters") + static function _enumParameters(e:EnumValue):hl.NativeArray { + return null; + } + + public static function enumParameters(e:EnumValue):Array { + if( e == null ) (e:Dynamic)(); // trigger null access + var arr = _enumParameters(e); + return cast hl.types.ArrayObj.alloc(arr); + } + + public static function enumIndex(e:EnumValue):Int { + return untyped $enumIndex(e); + } + + public static function allEnums(e:Enum):Array { + var en:hl.BaseType.Enum = cast e; + var out = []; + for (i in 0...en.__evalues__.length) { + var v = en.__evalues__[i]; + if (v != null) + out.push(v); + } + return out; + } +} diff --git a/build/linux64_569e52e/std/hl/_std/UInt.hx b/build/linux64_569e52e/std/hl/_std/UInt.hx new file mode 100644 index 0000000..b757e90 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/UInt.hx @@ -0,0 +1,179 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +@:coreApi +@:transitive +abstract UInt(Int) from Int to Int { + @:op(A + B) private static inline function add(a:UInt, b:UInt):UInt { + return a.toInt() + b.toInt(); + } + + @:op(A / B) private static inline function div(a:UInt, b:UInt):Float { + return a.toFloat() / b.toFloat(); + } + + @:op(A * B) private static inline function mul(a:UInt, b:UInt):UInt { + return a.toInt() * b.toInt(); + } + + @:op(A - B) private static inline function sub(a:UInt, b:UInt):UInt { + return a.toInt() - b.toInt(); + } + + @:op(A > B) private static function gt(a:UInt, b:UInt):Bool; + + @:op(A >= B) private static function gte(a:UInt, b:UInt):Bool; + + @:op(A < B) private static function lt(a:UInt, b:UInt):Bool; + + @:op(A <= B) private static function lte(a:UInt, b:UInt):Bool; + + @:op(A & B) private static inline function and(a:UInt, b:UInt):UInt { + return a.toInt() & b.toInt(); + } + + @:op(A | B) private static inline function or(a:UInt, b:UInt):UInt { + return a.toInt() | b.toInt(); + } + + @:op(A ^ B) private static inline function xor(a:UInt, b:UInt):UInt { + return a.toInt() ^ b.toInt(); + } + + @:op(A << B) private static inline function shl(a:UInt, b:Int):UInt { + return a.toInt() << b; + } + + @:op(A >> B) private static inline function shr(a:UInt, b:Int):UInt { + return a.toInt() >>> b; + } + + @:op(A >>> B) private static inline function ushr(a:UInt, b:Int):UInt { + return a.toInt() >>> b; + } + + @:op(A % B) private static function mod(a:UInt, b:UInt):UInt; + + @:commutative @:op(A + B) private static inline function addWithFloat(a:UInt, b:Float):Float { + return a.toFloat() + b; + } + + @:commutative @:op(A * B) private static inline function mulWithFloat(a:UInt, b:Float):Float { + return a.toFloat() * b; + } + + @:op(A / B) private static inline function divFloat(a:UInt, b:Float):Float { + return a.toFloat() / b; + } + + @:op(A / B) private static inline function floatDiv(a:Float, b:UInt):Float { + return a / b.toFloat(); + } + + @:op(A - B) private static inline function subFloat(a:UInt, b:Float):Float { + return a.toFloat() - b; + } + + @:op(A - B) private static inline function floatSub(a:Float, b:UInt):Float { + return a - b.toFloat(); + } + + @:op(A > B) private static inline function gtFloat(a:UInt, b:Float):Bool { + return a.toFloat() > b; + } + + @:commutative @:op(A == B) private static function equalsInt(a:UInt, b:T):Bool; + + @:commutative @:op(A != B) private static function notEqualsInt(a:UInt, b:T):Bool; + + @:commutative @:op(A == B) private static function equalsFloat(a:UInt, b:T):Bool; + + @:commutative @:op(A != B) private static function notEqualsFloat(a:UInt, b:T):Bool; + + @:op(A >= B) private static inline function gteFloat(a:UInt, b:Float):Bool { + return a.toFloat() >= b; + } + + @:op(A > B) private static inline function floatGt(a:Float, b:UInt):Bool { + return a > b.toFloat(); + } + + @:op(A >= B) private static inline function floatGte(a:Float, b:UInt):Bool { + return a >= b.toFloat(); + } + + @:op(A < B) private static inline function ltFloat(a:UInt, b:Float):Bool { + return a.toFloat() < b; + } + + @:op(A <= B) private static inline function lteFloat(a:UInt, b:Float):Bool { + return a.toFloat() <= b; + } + + @:op(A < B) private static inline function floatLt(a:Float, b:UInt):Bool { + return a < b.toFloat(); + } + + @:op(A <= B) private static inline function floatLte(a:Float, b:UInt):Bool { + return a <= b.toFloat(); + } + + @:op(A % B) private static inline function modFloat(a:UInt, b:Float):Float { + return a.toFloat() % b; + } + + @:op(A % B) private static inline function floatMod(a:Float, b:UInt):Float { + return a % b.toFloat(); + } + + @:op(~A) private inline function negBits():UInt { + return ~this; + } + + @:op(++A) private inline function prefixIncrement():UInt { + return ++this; + } + + @:op(A++) private inline function postfixIncrement():UInt { + return this++; + } + + @:op(--A) private inline function prefixDecrement():UInt { + return --this; + } + + @:op(A--) private inline function postfixDecrement():UInt { + return this--; + } + + // TODO: radix is just defined to deal with doc_gen issues + private inline function toString(?radix:Int):String { + return Std.string(toFloat()); + } + + private inline function toInt():Int { + return this; + } + + @:to private inline function toFloat():Float { + return cast(this : UInt); + } +} diff --git a/build/linux64_569e52e/std/hl/_std/haxe/Exception.hx b/build/linux64_569e52e/std/hl/_std/haxe/Exception.hx new file mode 100644 index 0000000..68734c4 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/haxe/Exception.hx @@ -0,0 +1,92 @@ +package haxe; + +@:coreApi +class Exception { + public var message(get,never):String; + public var stack(get,never):CallStack; + public var previous(get,never):Null; + public var native(get,never):Any; + + @:noCompletion var __exceptionMessage:String; + @:noCompletion var __exceptionStack:Null; + @:noCompletion var __nativeStack:hl.NativeArray<#if (hl_ver >= "1.12.0") haxe.NativeStackTrace.Symbol #else hl.Bytes #end>; + @:noCompletion @:ifFeature("haxe.Exception.get_stack") var __skipStack:Int = 0; + @:noCompletion var __nativeException:Any; + @:noCompletion var __previousException:Null; + + static function caught(value:Any):Exception { + if(Std.isOfType(value, Exception)) { + return value; + } else { + var e = new ValueException(value, null, value); + // Undo automatic __shiftStack() + e.__unshiftStack(); + return e; + } + } + + static function thrown(value:Any):Any { + if(Std.isOfType(value, Exception)) { + return (value:Exception).native; + } else { + var e = new ValueException(value); + e.__shiftStack(); + return e; + } + } + + public function new(message:String, ?previous:Exception, ?native:Any) { + __exceptionMessage = message; + __previousException = previous; + if(native != null) { + __nativeStack = NativeStackTrace.exceptionStack(); + __nativeException = native; + } else { + __nativeStack = NativeStackTrace.callStack(); + __nativeException = this; + } + } + + function unwrap():Any { + return __nativeException; + } + + public function toString():String { + return message; + } + + public function details():String { + return inline CallStack.exceptionToString(this); + } + + @:noCompletion + @:ifFeature("haxe.Exception.get_stack") + inline function __shiftStack():Void { + __skipStack++; + } + + @:noCompletion + @:ifFeature("haxe.Exception.get_stack") + inline function __unshiftStack():Void { + __skipStack--; + } + + function get_message():String { + return __exceptionMessage; + } + + function get_previous():Null { + return __previousException; + } + + final function get_native():Any { + return __nativeException; + } + + function get_stack():CallStack { + return switch __exceptionStack { + case null: __exceptionStack = NativeStackTrace.toHaxe(__nativeStack, __skipStack); + case s: s; + } + } +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/hl/_std/haxe/Int64.hx b/build/linux64_569e52e/std/hl/_std/haxe/Int64.hx new file mode 100644 index 0000000..ee84259 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/haxe/Int64.hx @@ -0,0 +1,608 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +using haxe.Int64; + +#if (hl_ver >= version("1.12.0") && !hl_legacy32) + +import haxe.Int64Helper; + +private typedef __Int64 = hl.I64; + +@:coreApi +@:transitive +abstract Int64(__Int64) from __Int64 to __Int64 { + + static var MASK : hl.I64 = { + var v : hl.I64 = 0xFFFF; + v | (v << 16); + } + + public static inline function make(high:Int32, low:Int32):Int64 { + var h : hl.I64 = high; + var l : hl.I64 = low; + return cast ((h << 32) | (l&MASK)); + } + + private inline function new(x:__Int64) + this = x; + + private var val(get, set):__Int64; + + inline function get_val():__Int64 + return this; + + inline function set_val(x:__Int64):__Int64 + return this = x; + + public var high(get, never):Int32; + + inline function get_high():Int32 + return cast(this >> 32); + + public var low(get, never):Int32; + + inline function get_low():Int32 + return cast this; + + public inline function copy():Int64 + return new Int64(this); + + @:from public static inline function ofInt(x:Int):Int64 + return cast x; + + @:deprecated('haxe.Int64.is() is deprecated. Use haxe.Int64.isInt64() instead') + inline public static function is(val:Dynamic):Bool + return isInt64(val); + + inline public static function isInt64(val:Dynamic):Bool + return hl.Type.getDynamic(val).kind == HI64; + + public static inline function toInt(x:Int64):Int { + if (x.val < 0x80000000 || x.val > 0x7FFFFFFF) + throw "Overflow"; + return cast x.val; + } + + public static inline function getHigh(x:Int64):Int32 + return cast(x.val >> 32); + + public static inline function getLow(x:Int64):Int32 + return cast(x.val); + + public static inline function isNeg(x:Int64):Bool + return x.val < 0; + + public static inline function isZero(x:Int64):Bool + return x.val == 0; + + public static inline function compare(a:Int64, b:Int64):Int { + if (a.val < b.val) + return -1; + if (a.val > b.val) + return 1; + return 0; + } + + public static inline function ucompare(a:Int64, b:Int64):Int { + if (a.val < 0) + return (b.val < 0) ? compare(a, b) : 1; + return (b.val < 0) ? -1 : compare(a, b); + } + + public static inline function toStr(x:Int64):String + return '${x.val}'; + + public static inline function divMod(dividend:Int64, divisor:Int64):{quotient:Int64, modulus:Int64} + return {quotient: dividend / divisor, modulus: dividend % divisor}; + + private inline function toString():String + return '$this'; + + public static function parseString(sParam:String):Int64 { + // can this be done?: return new Int64( java.lang.Long.LongClass.parseLong( sParam ) ); + return Int64Helper.parseString(sParam); + } + + public static function fromFloat(f:Float):Int64 { + return Int64Helper.fromFloat(f); + } + + @:op(-A) public static function neg(x:Int64):Int64 + return -x.val; + + @:op(++A) private inline function preIncrement():Int64 + return ++this; + + @:op(A++) private inline function postIncrement():Int64 + return this++; + + @:op(--A) private inline function preDecrement():Int64 + return --this; + + @:op(A--) private inline function postDecrement():Int64 + return this--; + + @:op(A + B) public static inline function add(a:Int64, b:Int64):Int64 + return a.val + b.val; + + @:op(A + B) @:commutative private static inline function addInt(a:Int64, b:Int):Int64 + return a.val + b; + + @:op(A - B) public static inline function sub(a:Int64, b:Int64):Int64 + return a.val - b.val; + + @:op(A - B) private static inline function subInt(a:Int64, b:Int):Int64 + return a.val - b; + + @:op(A - B) private static inline function intSub(a:Int, b:Int64):Int64 + return (a:hl.I64) - b.val; + + @:op(A * B) public static inline function mul(a:Int64, b:Int64):Int64 + return a.val * b.val; + + @:op(A * B) @:commutative private static inline function mulInt(a:Int64, b:Int):Int64 + return a.val * b; + + @:op(A / B) public static inline function div(a:Int64, b:Int64):Int64 + return a.val / b.val; + + @:op(A / B) private static inline function divInt(a:Int64, b:Int):Int64 + return a.val / b; + + @:op(A / B) private static inline function intDiv(a:Int, b:Int64):Int64 + return (a:hl.I64) / b.val; + + @:op(A % B) public static inline function mod(a:Int64, b:Int64):Int64 + return a.val % b.val; + + @:op(A % B) private static inline function modInt(a:Int64, b:Int):Int64 + return a.val % b; + + @:op(A % B) private static inline function intMod(a:Int, b:Int64):Int64 + return (a:hl.I64) % b.val; + + @:op(A == B) public static inline function eq(a:Int64, b:Int64):Bool + return a.val == b.val; + + @:op(A == B) @:commutative private static inline function eqInt(a:Int64, b:Int):Bool + return a.val == b; + + @:op(A != B) public static inline function neq(a:Int64, b:Int64):Bool + return a.val != b.val; + + @:op(A != B) @:commutative private static inline function neqInt(a:Int64, b:Int):Bool + return a.val != (b:hl.I64); + + @:op(A < B) private static inline function lt(a:Int64, b:Int64):Bool + return a.val < b.val; + + @:op(A < B) private static inline function ltInt(a:Int64, b:Int):Bool + return a.val < b; + + @:op(A < B) private static inline function intLt(a:Int, b:Int64):Bool + return (a:hl.I64) < b.val; + + @:op(A <= B) private static inline function lte(a:Int64, b:Int64):Bool + return a.val <= b.val; + + @:op(A <= B) private static inline function lteInt(a:Int64, b:Int):Bool + return a.val <= b; + + @:op(A <= B) private static inline function intLte(a:Int, b:Int64):Bool + return (a:hl.I64) <= b.val; + + @:op(A > B) private static inline function gt(a:Int64, b:Int64):Bool + return a.val > b.val; + + @:op(A > B) private static inline function gtInt(a:Int64, b:Int):Bool + return a.val > b; + + @:op(A > B) private static inline function intGt(a:Int, b:Int64):Bool + return (a:hl.I64) > b.val; + + @:op(A >= B) private static inline function gte(a:Int64, b:Int64):Bool + return a.val >= b.val; + + @:op(A >= B) private static inline function gteInt(a:Int64, b:Int):Bool + return a.val >= b; + + @:op(A >= B) private static inline function intGte(a:Int, b:Int64):Bool + return (a:hl.I64) >= b.val; + + @:op(~A) private static inline function complement(x:Int64):Int64 + return ~x.val; + + @:op(A & B) public static inline function and(a:Int64, b:Int64):Int64 + return a.val & b.val; + + @:op(A | B) public static inline function or(a:Int64, b:Int64):Int64 + return a.val | b.val; + + @:op(A ^ B) public static inline function xor(a:Int64, b:Int64):Int64 + return a.val ^ b.val; + + @:op(A << B) public static inline function shl(a:Int64, b:Int):Int64 + return a.val << b; + + @:op(A >> B) public static inline function shr(a:Int64, b:Int):Int64 + return a.val >> b; + + @:op(A >>> B) public static inline function ushr(a:Int64, b:Int):Int64 + return a.val >>> b; +} + +#else + +@:transitive +abstract Int64(__Int64) from __Int64 to __Int64 { + private inline function new(x:__Int64) + this = x; + + public inline function copy():Int64 + return make(high, low); + + public static inline function make(high:Int32, low:Int32):Int64 + return new Int64(new __Int64(high, low)); + + @:from public static inline function ofInt(x:Int):Int64 + return make(x >> 31, x); + + public static inline function toInt(x:Int64):Int { + if (x.high != x.low >> 31) + throw "Overflow"; + + return x.low; + } + + @:deprecated('haxe.Int64.is() is deprecated. Use haxe.Int64.isInt64() instead') + inline public static function is(val:Dynamic):Bool { + return isInt64(val); + } + + inline public static function isInt64(val:Dynamic):Bool + return Std.isOfType(val, __Int64); + + @:deprecated("Use high instead") + public static inline function getHigh(x:Int64):Int32 + return x.high; + + @:deprecated("Use low instead") + public static inline function getLow(x:Int64):Int32 + return x.low; + + public static inline function isNeg(x:Int64):Bool + return x.high < 0; + + public static inline function isZero(x:Int64):Bool + return x == 0; + + public static inline function compare(a:Int64, b:Int64):Int { + var v = a.high - b.high; + v = if (v != 0) v else Int32.ucompare(a.low, b.low); + return a.high < 0 ? (b.high < 0 ? v : -1) : (b.high >= 0 ? v : 1); + } + + public static inline function ucompare(a:Int64, b:Int64):Int { + var v = Int32.ucompare(a.high, b.high); + return if (v != 0) v else Int32.ucompare(a.low, b.low); + } + + public static inline function toStr(x:Int64):String + return x.toString(); + + function toString():String { + var i:Int64 = cast this; + if (i == 0) + return "0"; + var str = ""; + var neg = false; + if (i.isNeg()) { + neg = true; + // i = -i; cannot negate here as --9223372036854775808 = -9223372036854775808 + } + var ten:Int64 = 10; + while (i != 0) { + var r = i.divMod(ten); + if (r.modulus.isNeg()) { + str = Int64.neg(r.modulus).low + str; + i = Int64.neg(r.quotient); + } else { + str = r.modulus.low + str; + i = r.quotient; + } + } + if (neg) + str = "-" + str; + return str; + } + + public static inline function parseString(sParam:String):Int64 { + return Int64Helper.parseString(sParam); + } + + public static inline function fromFloat(f:Float):Int64 { + return Int64Helper.fromFloat(f); + } + + public static function divMod(dividend:Int64, divisor:Int64):{quotient:Int64, modulus:Int64} { + // Handle special cases of 0 and 1 + if (divisor.high == 0) { + switch (divisor.low) { + case 0: + throw "divide by zero"; + case 1: + return {quotient: dividend.copy(), modulus: 0}; + } + } + + var divSign = dividend.isNeg() != divisor.isNeg(); + + var modulus = dividend.isNeg() ? -dividend : dividend.copy(); + divisor = divisor.isNeg() ? -divisor : divisor; + + var quotient:Int64 = 0; + var mask:Int64 = 1; + + while (!divisor.isNeg()) { + var cmp = ucompare(divisor, modulus); + divisor <<= 1; + mask <<= 1; + if (cmp >= 0) + break; + } + + while (mask != 0) { + if (ucompare(modulus, divisor) >= 0) { + quotient |= mask; + modulus -= divisor; + } + mask >>>= 1; + divisor >>>= 1; + } + + if (divSign) + quotient = -quotient; + if (dividend.isNeg()) + modulus = -modulus; + + return { + quotient: quotient, + modulus: modulus + }; + } + + @:op(-A) public static inline function neg(x:Int64):Int64 { + var high = ~x.high; + var low = -x.low; + if (low == 0) + high++; + return make(high, low); + } + + @:op(++A) private inline function preIncrement():Int64 { + this = copy(); + this.low++; + if (this.low == 0) + this.high++; + return cast this; + } + + @:op(A++) private inline function postIncrement():Int64 { + var ret = this; + preIncrement(); + return ret; + } + + @:op(--A) private inline function preDecrement():Int64 { + this = copy(); + if (this.low == 0) + this.high--; + this.low--; + return cast this; + } + + @:op(A--) private inline function postDecrement():Int64 { + var ret = this; + preDecrement(); + return ret; + } + + @:op(A + B) public static inline function add(a:Int64, b:Int64):Int64 { + var high = a.high + b.high; + var low = a.low + b.low; + if (Int32.ucompare(low, a.low) < 0) + high++; + return make(high, low); + } + + @:op(A + B) @:commutative private static inline function addInt(a:Int64, b:Int):Int64 + return add(a, b); + + @:op(A - B) public static inline function sub(a:Int64, b:Int64):Int64 { + var high = a.high - b.high; + var low = a.low - b.low; + if (Int32.ucompare(a.low, b.low) < 0) + high--; + return make(high, low); + } + + @:op(A - B) private static inline function subInt(a:Int64, b:Int):Int64 + return sub(a, b); + + @:op(A - B) private static inline function intSub(a:Int, b:Int64):Int64 + return sub(a, b); + + @:op(A * B) + public static #if !lua inline #end function mul(a:Int64, b:Int64):Int64 { + var mask = 0xFFFF; + var al = a.low & mask, ah = a.low >>> 16; + var bl = b.low & mask, bh = b.low >>> 16; + var p00 = al * bl; + var p10 = ah * bl; + var p01 = al * bh; + var p11 = ah * bh; + var low = p00; + var high = p11 + (p01 >>> 16) + (p10 >>> 16); + p01 <<= 16; + low += p01; + if (Int32.ucompare(low, p01) < 0) + high++; + p10 <<= 16; + low += p10; + if (Int32.ucompare(low, p10) < 0) + high++; + high += a.low * b.high + a.high * b.low; + return make(high, low); + } + + @:op(A * B) @:commutative private static inline function mulInt(a:Int64, b:Int):Int64 + return mul(a, b); + + @:op(A / B) public static inline function div(a:Int64, b:Int64):Int64 + return divMod(a, b).quotient; + + @:op(A / B) private static inline function divInt(a:Int64, b:Int):Int64 + return div(a, b); + + @:op(A / B) private static inline function intDiv(a:Int, b:Int64):Int64 + return div(a, b).toInt(); + + @:op(A % B) public static inline function mod(a:Int64, b:Int64):Int64 + return divMod(a, b).modulus; + + @:op(A % B) private static inline function modInt(a:Int64, b:Int):Int64 + return mod(a, b).toInt(); + + @:op(A % B) private static inline function intMod(a:Int, b:Int64):Int64 + return mod(a, b).toInt(); + + @:op(A == B) public static inline function eq(a:Int64, b:Int64):Bool + return a.high == b.high && a.low == b.low; + + @:op(A == B) @:commutative private static inline function eqInt(a:Int64, b:Int):Bool + return eq(a, b); + + @:op(A != B) public static inline function neq(a:Int64, b:Int64):Bool + return a.high != b.high || a.low != b.low; + + @:op(A != B) @:commutative private static inline function neqInt(a:Int64, b:Int):Bool + return neq(a, b); + + @:op(A < B) private static inline function lt(a:Int64, b:Int64):Bool + return compare(a, b) < 0; + + @:op(A < B) private static inline function ltInt(a:Int64, b:Int):Bool + return lt(a, b); + + @:op(A < B) private static inline function intLt(a:Int, b:Int64):Bool + return lt(a, b); + + @:op(A <= B) private static inline function lte(a:Int64, b:Int64):Bool + return compare(a, b) <= 0; + + @:op(A <= B) private static inline function lteInt(a:Int64, b:Int):Bool + return lte(a, b); + + @:op(A <= B) private static inline function intLte(a:Int, b:Int64):Bool + return lte(a, b); + + @:op(A > B) private static inline function gt(a:Int64, b:Int64):Bool + return compare(a, b) > 0; + + @:op(A > B) private static inline function gtInt(a:Int64, b:Int):Bool + return gt(a, b); + + @:op(A > B) private static inline function intGt(a:Int, b:Int64):Bool + return gt(a, b); + + @:op(A >= B) private static inline function gte(a:Int64, b:Int64):Bool + return compare(a, b) >= 0; + + @:op(A >= B) private static inline function gteInt(a:Int64, b:Int):Bool + return gte(a, b); + + @:op(A >= B) private static inline function intGte(a:Int, b:Int64):Bool + return gte(a, b); + + @:op(~A) private static inline function complement(a:Int64):Int64 + return make(~a.high, ~a.low); + + @:op(A & B) public static inline function and(a:Int64, b:Int64):Int64 + return make(a.high & b.high, a.low & b.low); + + @:op(A | B) public static inline function or(a:Int64, b:Int64):Int64 + return make(a.high | b.high, a.low | b.low); + + @:op(A ^ B) public static inline function xor(a:Int64, b:Int64):Int64 + return make(a.high ^ b.high, a.low ^ b.low); + + @:op(A << B) public static inline function shl(a:Int64, b:Int):Int64 { + b &= 63; + return if (b == 0) a.copy() else if (b < 32) make((a.high << b) | (a.low >>> (32 - b)), a.low << b) else make(a.low << (b - 32), 0); + } + + @:op(A >> B) public static inline function shr(a:Int64, b:Int):Int64 { + b &= 63; + return if (b == 0) a.copy() else if (b < 32) make(a.high >> b, (a.high << (32 - b)) | (a.low >>> b)); else make(a.high >> 31, a.high >> (b - 32)); + } + + @:op(A >>> B) public static inline function ushr(a:Int64, b:Int):Int64 { + b &= 63; + return if (b == 0) a.copy() else if (b < 32) make(a.high >>> b, (a.high << (32 - b)) | (a.low >>> b)); else make(0, a.high >>> (b - 32)); + } + + public var high(get, never):Int32; + + private inline function get_high() + return this.high; + + private inline function set_high(x) + return this.high = x; + + public var low(get, never):Int32; + + private inline function get_low() + return this.low; + + private inline function set_low(x) + return this.low = x; +} + +private typedef __Int64 = ___Int64; + +private class ___Int64 { + public var high:Int32; + public var low:Int32; + + public inline function new(high, low) { + this.high = high; + this.low = low; + } + + public function toString():String + return Int64.toStr(cast this); +} + +#end diff --git a/build/linux64_569e52e/std/hl/_std/haxe/NativeStackTrace.hx b/build/linux64_569e52e/std/hl/_std/haxe/NativeStackTrace.hx new file mode 100644 index 0000000..cb78b66 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/haxe/NativeStackTrace.hx @@ -0,0 +1,107 @@ +package haxe; + +import hl.NativeArray; +import hl.Bytes; +import haxe.CallStack.StackItem; + +typedef Symbol = #if (hl_ver >= version("1.12.0")) hl.Abstract<"hl_symbol"> #else hl.Bytes #end + +/** + Do not use manually. +**/ +@:dox(hide) +@:noCompletion +class NativeStackTrace { + @:ifFeature('haxe.NativeStackTrace.exceptionStack') + static public inline function saveStack(exception:Any):Void { + } + + #if (hl_ver >= version("1.12.0") ) + + static public function exceptionStack():NativeArray { + var count = exceptionStackRaw(null); + var arr = new NativeArray(count); + exceptionStackRaw(arr); + return arr; + } + + static public inline function callStack():NativeArray { + var count = callStackRaw(null); + var arr = new NativeArray(count); + callStackRaw(arr); + // This will avoid errors when compiling hl/c on unix + // See https://github.com/HaxeFoundation/haxe/pull/11382 for long term fix + if (arr.length == 0) return arr; + return arr.sub(1, arr.length - 1); + } + + @:hlNative("std", "exception_stack_raw") + static function exceptionStackRaw( arr : NativeArray ) : Int { + return 0; + } + + @:hlNative("std", "call_stack_raw") + static function callStackRaw( arr : NativeArray ) : Int { + return 0; + } + + @:hlNative("std","resolve_symbol") + static function resolveSymbol( sym : Symbol, buf : hl.Bytes, bufLen : hl.Ref ) : hl.Bytes { + return null; + } + + #else + + @:hlNative("std", "exception_stack") + static public function exceptionStack():NativeArray { + return null; + } + + //TODO: implement in hashlink like `exceptionStack` + static public function callStack():NativeArray { + var stack:NativeArray = try { + throw new Exception('', null, 'stack'); + } catch (e:Exception) { + exceptionStack(); + } + var skip = 1; + for(i in 0...stack.length - 1) { + var s = @:privateAccess String.fromUCS2(stack[i]); + if(s.indexOf('NativeStackTrace.callStack') < 0) { + break; + } + skip++; + } + return skip < stack.length ? stack.sub(skip, stack.length - skip) : stack; + } + + #end + + static public function toHaxe(native:NativeArray, skip:Int=0 ):Array { + var stack = []; + var r = ~/^([A-Za-z0-9.$_]+)\.([~A-Za-z0-9_]+(\.[0-9]+)?)\((.+):([0-9]+)\)$/; + var r_fun = ~/^fun\$([0-9]+)\((.+):([0-9]+)\)$/; + #if (hl_ver >= version("1.12.0")) + var maxLen = 1024; + var tmpBuf = @:privateAccess hl.Bytes.alloc(maxLen); + #end + for (i in 0...native.length-1) { + if( i < skip ) continue; + #if (hl_ver >= version("1.12.0")) + var len = maxLen; + var bytes = resolveSymbol(native[i],tmpBuf,len); + if( bytes == null ) continue; + #else + var bytes = native[i]; + #end + var str = @:privateAccess String.fromUCS2(bytes); + if (r.match(str)) + stack.push(FilePos(Method(r.matched(1), r.matched(2)), r.matched(4), Std.parseInt(r.matched(5)))); + else if (r_fun.match(str)) + stack.push(FilePos(LocalFunction(Std.parseInt(r_fun.matched(1))), r_fun.matched(2), Std.parseInt(r_fun.matched(3)))); + else + stack.push(Module(str)); + } + return stack; + } +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/hl/_std/haxe/Resource.hx b/build/linux64_569e52e/std/hl/_std/haxe/Resource.hx new file mode 100644 index 0000000..1601578 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/haxe/Resource.hx @@ -0,0 +1,56 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +private class ResourceContent { + public var name:hl.Bytes; + public var data:hl.Bytes; + public var dataLen:Int; +} + +@:coreApi +class Resource { + static var content:hl.NativeArray; + + public static function listNames():Array { + return [for (x in content) @:privateAccess String.fromUCS2(x.name)]; + } + + public static function getString(name:String):String { + for (x in content) + if (x.name.compare(0, @:privateAccess name.bytes, 0, (name.length + 1) << 1) == 0) + return @:privateAccess String.fromUTF8(x.data); + return null; + } + + public static function getBytes(name:String):haxe.io.Bytes { + for (x in content) + if (x.name.compare(0, @:privateAccess name.bytes, 0, (name.length + 1) << 1) == 0) + return @:privateAccess new haxe.io.Bytes(x.data, x.dataLen); + return null; + } + + static function __init__():Void { + content = untyped $resources(); + } +} diff --git a/build/linux64_569e52e/std/hl/_std/haxe/atomic/AtomicInt.hx b/build/linux64_569e52e/std/hl/_std/haxe/atomic/AtomicInt.hx new file mode 100644 index 0000000..f1efde1 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/haxe/atomic/AtomicInt.hx @@ -0,0 +1,49 @@ +package haxe.atomic; + +#if (hl_ver < version("1.13.0") && !doc_gen) +#error "Atomic operations require HL 1.13+" +#end +import hl.Atomics; + +abstract AtomicInt(hl.NativeArray) { + public inline function new(value:Int):Void { + this = new hl.NativeArray(1); + this[0] = value; + } + + public inline function add(b:Int):Int { + return Atomics.add32(this.getRef(), b); + } + + public inline function sub(b:Int):Int { + return Atomics.sub32(this.getRef(), b); + } + + public inline function and(b:Int):Int { + return Atomics.and32(this.getRef(), b); + } + + public inline function or(b:Int):Int { + return Atomics.or32(this.getRef(), b); + } + + public inline function xor(b:Int):Int { + return Atomics.xor32(this.getRef(), b); + } + + public inline function compareExchange(expected:Int, replacement:Int):Int { + return Atomics.compareExchange32(this.getRef(), expected, replacement); + } + + public inline function exchange(value:Int):Int { + return Atomics.exchange32(this.getRef(), value); + } + + public inline function load():Int { + return Atomics.load32(this.getRef()); + } + + public inline function store(value:Int):Int { + return Atomics.store32(this.getRef(), value); + } +} diff --git a/build/linux64_569e52e/std/hl/_std/haxe/atomic/AtomicObject.hx b/build/linux64_569e52e/std/hl/_std/haxe/atomic/AtomicObject.hx new file mode 100644 index 0000000..e0a03af --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/haxe/atomic/AtomicObject.hx @@ -0,0 +1,31 @@ +package haxe.atomic; + +#if (hl_ver < version("1.13.0") && !doc_gen) +#error "Atomic operations require HL 1.13+" +#end +import hl.Atomics; + +// use hl.NativeArray instead of hl.NativeArray +// so that the compiler doesn't get confused and emit hl.Ref.make(this.getRef()) +abstract AtomicObject(hl.NativeArray) { + public inline function new(value:T):Void { + this = new hl.NativeArray(1); + this[0] = value; + } + + public inline function compareExchange(expected:T, replacement:T):T { + return Atomics.compareExchangePtr(this.getRef(), expected, replacement); + } + + public inline function exchange(value:T):T { + return Atomics.exchangePtr(this.getRef(), value); + } + + public inline function load():T { + return Atomics.loadPtr(this.getRef()); + } + + public inline function store(value:T):T { + return Atomics.storePtr(this.getRef(), value); + } +} diff --git a/build/linux64_569e52e/std/hl/_std/haxe/crypto/Md5.hx b/build/linux64_569e52e/std/hl/_std/haxe/crypto/Md5.hx new file mode 100644 index 0000000..b30278b --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/haxe/crypto/Md5.hx @@ -0,0 +1,37 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.crypto; + +class Md5 { + public static function encode(s:String):String { + var out = haxe.io.Bytes.alloc(16); + @:privateAccess hl.Format.digest(out.b, s.bytes, s.length, 256); + return out.toHex(); + } + + public static function make(b:haxe.io.Bytes):haxe.io.Bytes { + var out = haxe.io.Bytes.alloc(16); + @:privateAccess hl.Format.digest(out.b, b.b, b.length, 0); + return out; + } +} diff --git a/build/linux64_569e52e/std/hl/_std/haxe/crypto/Sha1.hx b/build/linux64_569e52e/std/hl/_std/haxe/crypto/Sha1.hx new file mode 100644 index 0000000..d614993 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/haxe/crypto/Sha1.hx @@ -0,0 +1,37 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.crypto; + +class Sha1 { + public static function encode(s:String):String { + var out = haxe.io.Bytes.alloc(20); + @:privateAccess hl.Format.digest(out.b, s.bytes, s.length, 256 | 1); + return out.toHex(); + } + + public static function make(b:haxe.io.Bytes):haxe.io.Bytes { + var out = haxe.io.Bytes.alloc(20); + @:privateAccess hl.Format.digest(out.b, b.b, b.length, 1); + return out; + } +} diff --git a/build/linux64_569e52e/std/hl/_std/haxe/ds/IntMap.hx b/build/linux64_569e52e/std/hl/_std/haxe/ds/IntMap.hx new file mode 100644 index 0000000..6588484 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/haxe/ds/IntMap.hx @@ -0,0 +1,91 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +@:coreApi +class IntMap implements haxe.Constraints.IMap { + var h:hl.types.IntMap; + + public function new():Void { + h = new hl.types.IntMap(); + } + + public function set(key:Int, value:T):Void { + @:privateAccess h.set(key, value); + } + + public function get(key:Int):Null { + return @:privateAccess h.get(key); + } + + public function exists(key:Int):Bool { + return @:privateAccess h.exists(key); + } + + public function remove(key:Int):Bool { + return @:privateAccess h.remove(key); + } + + public function keys():Iterator { + return new hl.NativeArray.NativeArrayIterator(h.keysArray()); + } + + public function iterator():Iterator { + return h.iterator(); + } + + @:runtime public inline function keyValueIterator():KeyValueIterator { + return new haxe.iterators.MapKeyValueIterator(this); + } + + public function copy():IntMap { + var copied = new IntMap(); + for (key in keys()) + copied.set(key, get(key)); + return copied; + } + + public function toString():String { + var s = new StringBuf(); + var keys = h.keysArray(); + var values = h.valuesArray(); + s.addChar("[".code); + for (i in 0...keys.length) { + if (i > 0) + s.add(", "); + s.add(keys[i]); + s.add(" => "); + s.add(values[i]); + } + s.addChar("]".code); + return s.toString(); + } + + public function clear():Void { + #if (hl_ver >= version("1.11.0")) + @:privateAccess h.clear(); + #else + h = new hl.types.IntMap(); + #end + } +} diff --git a/build/linux64_569e52e/std/hl/_std/haxe/ds/ObjectMap.hx b/build/linux64_569e52e/std/hl/_std/haxe/ds/ObjectMap.hx new file mode 100644 index 0000000..93392e9 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/haxe/ds/ObjectMap.hx @@ -0,0 +1,91 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +@:coreApi +class ObjectMap implements haxe.Constraints.IMap { + var h:hl.types.ObjectMap; + + public function new():Void { + h = new hl.types.ObjectMap(); + } + + public function set(key:K, value:T):Void { + @:privateAccess h.set(key, value); + } + + public function get(key:K):Null { + return @:privateAccess h.get(key); + } + + public function exists(key:K):Bool { + return @:privateAccess h.exists(key); + } + + public function remove(key:K):Bool { + return @:privateAccess h.remove(key); + } + + public function keys():Iterator { + return new hl.NativeArray.NativeArrayIterator(cast h.keysArray()); + } + + public function iterator():Iterator { + return h.iterator(); + } + + @:runtime public inline function keyValueIterator():KeyValueIterator { + return new haxe.iterators.MapKeyValueIterator(this); + } + + public function copy():ObjectMap { + var copied = new ObjectMap(); + for (key in keys()) + copied.set(key, get(key)); + return copied; + } + + public function toString():String { + var s = new StringBuf(); + var keys = h.keysArray(); + var values = h.valuesArray(); + s.addChar("[".code); + for (i in 0...keys.length) { + if (i > 0) + s.add(", "); + s.add(keys[i]); + s.add(" => "); + s.add(values[i]); + } + s.addChar("]".code); + return s.toString(); + } + + public function clear():Void { + #if (hl_ver >= version("1.11.0")) + @:privateAccess h.clear(); + #else + h = new hl.types.ObjectMap(); + #end + } +} diff --git a/build/linux64_569e52e/std/hl/_std/haxe/ds/StringMap.hx b/build/linux64_569e52e/std/hl/_std/haxe/ds/StringMap.hx new file mode 100644 index 0000000..0c5b319 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/haxe/ds/StringMap.hx @@ -0,0 +1,119 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +private class StringMapKeysIterator { + var arr:hl.NativeArray; + var pos:Int; + var length:Int; + + public inline function new(h:hl.types.BytesMap) { + this.arr = h.keysArray(); + pos = 0; + length = arr.length; + } + + public inline function hasNext() { + return pos < length; + } + + public inline function next() @:privateAccess { + var b = arr[pos++]; + return String.fromUCS2(b); + } +} + +@:coreApi +class StringMap implements haxe.Constraints.IMap { + var h:hl.types.BytesMap; + + public function new():Void { + h = new hl.types.BytesMap(); + } + + public function set(key:String, value:T):Void { + @:privateAccess h.set(key.bytes, value); + } + + public function get(key:String):Null { + if (key == null) + return null; + return @:privateAccess h.get(key.bytes); + } + + public function exists(key:String):Bool { + if (key == null) + return false; + return @:privateAccess h.exists(key.bytes); + } + + public function remove(key:String):Bool { + if (key == null) + return false; + return @:privateAccess h.remove(key.bytes); + } + + public function keys():Iterator { + return new StringMapKeysIterator(h); + } + + public function iterator():Iterator { + return h.iterator(); + } + + @:runtime public inline function keyValueIterator():KeyValueIterator { + return new haxe.iterators.MapKeyValueIterator(this); + } + + public function copy():StringMap { + var copied = new StringMap(); + for (key in keys()) + copied.set(key, get(key)); + return copied; + } + + public function toString():String { + var s = new StringBuf(); + var keys = h.keysArray(); + var values = h.valuesArray(); + s.addChar("[".code); + for (i in 0...keys.length) { + if (i > 0) + s.add(", "); + var k = keys[i]; + @:privateAccess s.__add(k, 0, (@:privateAccess k.ucs2Length(0)) << 1); + s.add(" => "); + s.add(values[i]); + } + s.addChar("]".code); + return s.toString(); + } + + public function clear():Void { + #if (hl_ver >= version("1.11.0")) + @:privateAccess h.clear(); + #else + h = new hl.types.BytesMap(); + #end + } +} diff --git a/build/linux64_569e52e/std/hl/_std/haxe/ds/Vector.hx b/build/linux64_569e52e/std/hl/_std/haxe/ds/Vector.hx new file mode 100644 index 0000000..49c4319 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/haxe/ds/Vector.hx @@ -0,0 +1,99 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +private typedef VectorData = Array + +@:coreApi +abstract Vector(VectorData) { + extern overload public inline function new(length:Int) { + this = []; + if (length > 0) + this[length - 1] = @:nullSafety(Off) cast null; + } + + extern overload public inline function new(length:Int, defaultValue:T):Vector { + this = [ + for (i in 0...length) defaultValue + ]; + } + + @:op([]) public inline function get(index:Int):T { + return this[index]; + } + + @:op([]) public inline function set(index:Int, val:T):T { + return this[index] = val; + } + + public var length(get, never):Int; + + inline function get_length():Int { + return this.length; + } + + public inline function fill(value:T):Void + for (i in 0...length) this[i] = value; + + public static inline function blit(src:Vector, srcPos:Int, dest:Vector, destPos:Int, len:Int):Void { + (cast dest : hl.types.ArrayBase.ArrayAccess).blit(destPos, (cast src : hl.types.ArrayBase.ArrayAccess), srcPos, len); + } + + public inline function toArray():Array { + return this.copy(); + } + + public inline function toData():VectorData + return this; + + static public inline function fromData(data:VectorData):Vector + return cast data; + + static public inline function fromArrayCopy(array:Array):Vector { + return cast array.copy(); + } + + public inline function copy():Vector { + return cast this.copy(); + } + + public inline function join(sep:String):String { + return this.join(sep); + } + + public inline function sort(f:T->T->Int):Void { + this.sort(f); + } + + public inline function map(f:T->S):Vector { + var length = length; + var r = new Vector(length); + var i = 0; + var len = length; + for (i in 0...len) { + var v = f(get(i)); + r.set(i, v); + } + return r; + } +} diff --git a/build/linux64_569e52e/std/hl/_std/haxe/io/Bytes.hx b/build/linux64_569e52e/std/hl/_std/haxe/io/Bytes.hx new file mode 100644 index 0000000..33a6003 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/haxe/io/Bytes.hx @@ -0,0 +1,253 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +@:coreApi +class Bytes { + public var length(default, null):Int; + + var b:hl.Bytes; + + function new(b:hl.Bytes, length:Int):Void { + this.b = b; + this.length = length; + } + + inline function out(pos:Int):Bool { + return (pos : UInt) >= (length : UInt); + } + + inline function outRange(pos:Int, len:Int):Bool { + return pos < 0 || len < 0 || ((pos + len) : UInt) > (length : UInt); + } + + public function get(pos:Int):Int { + return if (out(pos)) 0 else b[pos]; + } + + public function set(pos:Int, v:Int):Void { + if (out(pos)) + throw Error.OutsideBounds; + b[pos] = v; + } + + public function blit(pos:Int, src:Bytes, srcpos:Int, len:Int):Void { + if (outRange(pos, len) || src.outRange(srcpos, len)) + throw Error.OutsideBounds; + b.blit(pos, src.b, srcpos, len); + } + + public function fill(pos:Int, len:Int, value:Int):Void { + if (outRange(pos, len)) + throw Error.OutsideBounds; + b.fill(pos, len, value); + } + + public function sub(pos:Int, len:Int):Bytes { + if (outRange(pos, len)) + throw Error.OutsideBounds; + return new Bytes(b.sub(pos, len), len); + } + + public function compare(other:Bytes):Int { + var len = length < other.length ? length : other.length; + var r = b.compare(0, other.b, 0, len); + if (r == 0) + r = length - other.length; + return r; + } + + #if hl_check_align + static var alignBuffer:hl.Bytes = new hl.Bytes(8); + #end + + public function getDouble(pos:Int):Float { + if (out(pos + 7)) + return 0.; + #if hl_check_align + return if (pos & 3 == 0) b.getF64(pos) else { + alignBuffer.blit(0, b, pos, 8); + alignBuffer.getF64(0); + } + #else + return b.getF64(pos); + #end + } + + public function getFloat(pos:Int):Float { + if (out(pos + 3)) + return 0.; + #if hl_check_align + return if (pos & 3 == 0) b.getF32(pos) else { + alignBuffer.blit(0, b, pos, 4); + alignBuffer.getF32(0); + } + #else + return b.getF32(pos); + #end + } + + public function setDouble(pos:Int, v:Float):Void { + if (out(pos + 7)) + throw Error.OutsideBounds; + #if hl_check_align + if (pos & 7 == 0) + b.setF64(pos, v); + else { + alignBuffer.setF64(0, v); + b.blit(pos, alignBuffer, 0, 8); + } + #else + b.setF64(pos, v); + #end + } + + public function setFloat(pos:Int, v:Float):Void { + if (out(pos + 3)) + throw Error.OutsideBounds; + #if hl_check_align + if (pos & 3 == 0) + b.setF32(pos, v); + else { + alignBuffer.setF32(0, v); + b.blit(pos, alignBuffer, 0, 4); + } + #else + b.setF32(pos, v); + #end + } + + public inline function getUInt16(pos:Int):Int { + return if (out(pos + 1)) 0 else b.getUI16(pos); + } + + public inline function setUInt16(pos:Int, v:Int):Void { + if (out(pos + 1)) + throw Error.OutsideBounds; + b.setUI16(pos, v); + } + + public function getInt32(pos:Int):Int { + return if (out(pos + 3)) 0 else b.getI32(pos); + } + + public function getInt64(pos:Int):haxe.Int64 { + if (out(pos + 7)) + return haxe.Int64.ofInt(0); + return haxe.Int64.make(b.getI32(pos + 4), b.getI32(pos)); + } + + public function setInt32(pos:Int, v:Int):Void { + if (out(pos + 3)) + throw Error.OutsideBounds; + b.setI32(pos, v); + } + + public inline function setInt64(pos:Int, v:haxe.Int64):Void { + setInt32(pos + 4, v.high); + setInt32(pos, v.low); + } + + public function getString(pos:Int, len:Int, ?encoding:Encoding):String { + if (outRange(pos, len)) + throw Error.OutsideBounds; + + var b = new hl.Bytes(len + 2); + b.blit(0, this.b, pos, len); + b[len] = 0; + b[len + 1] = 0; + return @:privateAccess (encoding == RawNative ? String.fromUCS2(b) : String.fromUTF8(b)); + } + + @:deprecated("readString is deprecated, use getString instead") + @:noCompletion + public inline function readString(pos:Int, len:Int):String { + return getString(pos, len); + } + + public function toString():String { + return getString(0, length); + } + + public function toHex():String { + var s = new StringBuf(); + var chars = []; + var str = "0123456789abcdef"; + for (i in 0...str.length) + chars.push(str.charCodeAt(i)); + for (i in 0...length) { + var c = get(i); + s.addChar(chars[c >> 4]); + s.addChar(chars[c & 15]); + } + return s.toString(); + } + + public inline function getData():BytesData { + return new haxe.io.BytesData(b, length); + } + + public static function alloc(length:Int):Bytes { + var b = new hl.Bytes(length); + b.fill(0, length, 0); + return new Bytes(b, length); + } + + public static function ofString(s:String, ?encoding:Encoding):Bytes@:privateAccess { + if (encoding == null) + encoding = UTF8; + return switch (encoding) { + case RawNative: + return new Bytes(s.bytes.sub(0, s.length << 1), s.length << 1); + case UTF8: + var size = 0; + var b = s.bytes.utf16ToUtf8(s.length, size); + return new Bytes(b, size); + } + } + + public static function ofData(b:BytesData):Bytes { + return new Bytes(b.bytes, b.length); + } + + public static function ofHex(s:String):Bytes { + var len = s.length; + if ((len & 1) != 0) + throw "Not a hex string (odd number of digits)"; + var l = len >> 1; + var b = new hl.Bytes(l); + for (i in 0...l) { + var high = s.charCodeAt(i * 2); + var low = s.charCodeAt(i * 2 + 1); + high = (high & 0xf) + ((high & 0x40) >> 6) * 9; + low = (low & 0xf) + ((low & 0x40) >> 6) * 9; + b.setUI8(i, ((high << 4) | low) & 0xff); + } + + return new Bytes(b, l); + } + + public inline static function fastGet(b:BytesData, pos:Int):Int { + return b[pos]; + } +} diff --git a/build/linux64_569e52e/std/hl/_std/haxe/io/BytesBuffer.hx b/build/linux64_569e52e/std/hl/_std/haxe/io/BytesBuffer.hx new file mode 100644 index 0000000..12893ee --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/haxe/io/BytesBuffer.hx @@ -0,0 +1,131 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +@:coreApi +class BytesBuffer { + var b:hl.Bytes; + var pos:Int; + var size:Int; + + public var length(get, never):Int; + + public function new() { + pos = 0; + size = 16; // ensure increment of 8 + b = new hl.Bytes(size); + } + + inline function get_length():Int { + return pos; + } + + public inline function addByte(byte:Int):Void { + if (pos == size) + __expand(0); + b[pos++] = byte; + } + + function __expand(req:Int):Void { + var nsize = (size * 3) >> 1; + if (nsize < req) + nsize = req; + var b2 = new hl.Bytes(nsize); + b2.blit(0, b, 0, pos); + b = b2; + size = nsize; + } + + function __add(b:hl.Bytes, bpos:Int, blen:Int):Void { + if (pos + blen > size) + __expand(pos + blen); + this.b.blit(pos, b, bpos, blen); + pos += blen; + } + + public inline function add(src:Bytes):Void { + __add(@:privateAccess src.b, 0, src.length); + } + + public inline function addString(v:String, ?encoding:Encoding):Void { + var len = 0; + @:privateAccess (encoding == RawNative ? __add(v.bytes, 0, v.length << 1) : __add(v.bytes.utf16ToUtf8(0, len), 0, len)); + } + + public inline function addInt32(v:Int):Void { + if (pos + 4 > size) + __expand(0); + b.setI32(pos, v); + pos += 4; + } + + public inline function addInt64(v:haxe.Int64):Void { + if (pos + 8 > size) + __expand(0); + b.setI32(pos, v.low); + b.setI32(pos + 4, v.high); + pos += 8; + } + + public inline function addFloat(v:Float):Void { + if (pos + 4 > size) + __expand(0); + #if hl_check_align + if (pos & 3 == 0) + b.setF32(pos, v); + else @:privateAccess { + haxe.io.Bytes.alignBuffer.setF32(0, v); + b.blit(pos, haxe.io.Bytes.alignBuffer, 0, 4); + } + #else + b.setF32(pos, v); + #end + pos += 4; + } + + public inline function addDouble(v:Float):Void { + if (pos + 8 > size) + __expand(0); + #if hl_check_align + if (pos & 7 == 0) + b.setF64(pos, v); + else @:privateAccess { + haxe.io.Bytes.alignBuffer.setF64(0, v); + b.blit(pos, haxe.io.Bytes.alignBuffer, 0, 8); + } + #else + b.setF64(pos, v); + #end + pos += 8; + } + + public inline function addBytes(src:Bytes, pos:Int, len:Int):Void { + if (pos < 0 || len < 0 || pos + len > src.length) + throw Error.OutsideBounds; + __add(@:privateAccess src.b, pos, len); + } + + public function getBytes():Bytes { + return @:privateAccess new haxe.io.Bytes(b, pos); + } +} diff --git a/build/linux64_569e52e/std/hl/_std/haxe/io/FPHelper.hx b/build/linux64_569e52e/std/hl/_std/haxe/io/FPHelper.hx new file mode 100644 index 0000000..b170f80 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/haxe/io/FPHelper.hx @@ -0,0 +1,59 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +class FPHelper { + // note : this is not thread safe, use TLS when available + static var i64tmp = Int64.ofInt(0); + static var helper = new hl.Bytes(8); + + public static function i32ToFloat(i:Int):Single { + helper.setI32(0, i); + return helper.getF32(0); + } + + public static function floatToI32(f:Single):Int { + helper.setF32(0, f); + return helper.getI32(0); + } + + public static function i64ToDouble(low:Int, high:Int):Float { + helper.setI32(0, low); + helper.setI32(4, high); + return helper.getF64(0); + } + + public static function doubleToI64(v:Float):Int64 { + helper.setF64(0, v); + #if (hl_ver >= version("1.12.0") && !hl_legacy32) + return Int64.make(helper.getI32(4),helper.getI32(0)); + #else + var i64 = i64tmp; + @:privateAccess { + i64.set_low(helper.getI32(0)); + i64.set_high(helper.getI32(4)); + } + return i64; + #end + } +} diff --git a/build/linux64_569e52e/std/hl/_std/haxe/zip/Compress.hx b/build/linux64_569e52e/std/hl/_std/haxe/zip/Compress.hx new file mode 100644 index 0000000..416b0ab --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/haxe/zip/Compress.hx @@ -0,0 +1,75 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.zip; + +private typedef Deflater = hl.Abstract<"fmt_zip">; + +@:coreApi @:hlNative("fmt") +class Compress { + var s:Deflater; + + public function new(level:Int):Void { + s = deflate_init(level); + } + + public function execute(src:haxe.io.Bytes, srcPos:Int, dst:haxe.io.Bytes, dstPos:Int):{done:Bool, read:Int, write:Int} { + var read = 0, write = 0; + var done = deflate_buffer(s, src.getData(), srcPos, src.length, dst.getData(), dstPos, dst.length, read, write); + return {done: done, read: read, write: write}; + } + + public function setFlushMode(f:FlushMode):Void { + @:privateAccess Uncompress.zip_flush_mode(cast s, f.getIndex()); + } + + public function close():Void { + @:privateAccess Uncompress.zip_end(cast s); + } + + public static function run(s:haxe.io.Bytes, level:Int):haxe.io.Bytes { + var c = new Compress(level); + c.setFlushMode(FlushMode.FINISH); + var out = haxe.io.Bytes.alloc(deflate_bound(c.s, s.length)); + var r = c.execute(s, 0, out, 0); + c.close(); + if (!r.done || r.read != s.length) + throw "Compression failed"; + if (r.write < out.length * 0.66) + return out.sub(0, r.write); + @:privateAccess out.length = r.write; + return out; + } + + static function deflate_init(level:Int):Deflater { + return null; + } + + static function deflate_buffer(i:Deflater, bytes:hl.Bytes, bytesPos:Int, bytesLen:Int, dst:hl.Bytes, dstPos:Int, dstLen:Int, read:hl.Ref, + write:hl.Ref):Bool { + return false; + } + + static function deflate_bound(i:Deflater, length:Int):Int { + return 0; + } +} diff --git a/build/linux64_569e52e/std/hl/_std/haxe/zip/Uncompress.hx b/build/linux64_569e52e/std/hl/_std/haxe/zip/Uncompress.hx new file mode 100644 index 0000000..1d13565 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/haxe/zip/Uncompress.hx @@ -0,0 +1,80 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.zip; + +private typedef Inflater = hl.Abstract<"fmt_zip">; + +@:coreApi @:hlNative("fmt") +class Uncompress { + var s:Inflater; + + public function new(?windowBits:Int):Void { + s = inflate_init(windowBits); + } + + public function execute(src:haxe.io.Bytes, srcPos:Int, dst:haxe.io.Bytes, dstPos:Int):{done:Bool, read:Int, write:Int} { + var read = 0, write = 0; + var done = inflate_buffer(s, src.getData(), srcPos, src.length, dst.getData(), dstPos, dst.length, read, write); + return {done: done, read: read, write: write}; + } + + public function setFlushMode(f:FlushMode):Void { + zip_flush_mode(s, f.getIndex()); + } + + public function close():Void { + zip_end(s); + } + + public static function run(src:haxe.io.Bytes, ?bufsize:Int):haxe.io.Bytes { + var u = new Uncompress(null); + if (bufsize == null) + bufsize = 1 << 16; // 64K + var tmp = haxe.io.Bytes.alloc(bufsize); + var b = new haxe.io.BytesBuffer(); + var pos = 0; + u.setFlushMode(FlushMode.SYNC); + while (true) { + var r = u.execute(src, pos, tmp, 0); + b.addBytes(tmp, 0, r.write); + pos += r.read; + if (r.done) + break; + } + u.close(); + return b.getBytes(); + } + + static function inflate_init(bits:Int):Inflater { + return null; + } + + static function inflate_buffer(i:Inflater, bytes:hl.Bytes, bytesPos:Int, bytesLen:Int, dst:hl.Bytes, dstPos:Int, dstLen:Int, read:hl.Ref, + write:hl.Ref):Bool { + return false; + } + + static function zip_end(i:Inflater):Void {} + + static function zip_flush_mode(i:Inflater, flush:Int):Void {} +} diff --git a/build/linux64_569e52e/std/hl/_std/sys/FileSystem.hx b/build/linux64_569e52e/std/hl/_std/sys/FileSystem.hx new file mode 100644 index 0000000..f325e30 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/sys/FileSystem.hx @@ -0,0 +1,147 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys; + +@:coreApi +@:access(Sys) +class FileSystem { + public static function exists(path:String):Bool { + return sys_exists(Sys.getPath(makeCompatiblePath(path))); + } + + public static function rename(path:String, newPath:String):Void { + if (!sys_rename(Sys.getPath(path), Sys.getPath(newPath))) + throw new Sys.SysError("Failed to rename " + path + " to " + newPath); + } + + public static function stat(path:String):FileStat { + var values = sys_stat(Sys.getPath(makeCompatiblePath(path))); + if (values == null) + throw new Sys.SysError("Failed to stat " + path); + return { + gid: values[0], + uid: values[1], + atime: @:privateAccess Date.fromInt(values[2]), + mtime: @:privateAccess Date.fromInt(values[3]), + ctime: @:privateAccess Date.fromInt(values[4]), + size: values[5], + dev: values[6], + ino: values[7], + nlink: values[8], + rdev: values[9], + mode: values[10], + }; + } + + public static function fullPath(relPath:String):String { + return Sys.makePath(sys_full_path(Sys.getPath(relPath))); + } + + public static function absolutePath(relPath:String):String { + if (haxe.io.Path.isAbsolute(relPath)) + return relPath; + return haxe.io.Path.join([Sys.getCwd(), relPath]); + } + + public static function isDirectory(path:String):Bool { + return sys_is_dir(Sys.getPath(makeCompatiblePath(path))); + } + + public static function createDirectory(path:String):Void { + var path = haxe.io.Path.addTrailingSlash(path); + var _p = null; + var parts = []; + while (path != (_p = haxe.io.Path.directory(path))) { + parts.unshift(path); + path = _p; + } + for (part in parts) { + if (part.charCodeAt(part.length - 1) != ":".code && !exists(part)) + if (!sys_create_dir(Sys.getPath(part), 493)) + throw new Sys.SysError("Failed to create directory " + part); + } + } + + public static function deleteFile(path:String):Void { + if (!sys_delete(Sys.getPath(path))) + throw new Sys.SysError("Can't delete file " + path); + } + + public static function deleteDirectory(path:String):Void { + if (!sys_remove_dir(Sys.getPath(path))) + throw new Sys.SysError("Can't delete directory " + path); + } + + public static function readDirectory(path:String):Array { + var content = sys_read_dir(Sys.getPath(path)); + if (content == null) + throw new Sys.SysError("Failed to read directory " + path); + return [for (c in content) Sys.makePath(c)]; + } + + private static inline function makeCompatiblePath(path:String):String { + return if (path.charCodeAt(1) == ":".code && path.length <= 3) { + haxe.io.Path.addTrailingSlash(path); + } else if (path == "/") { + "/"; + } else { + haxe.io.Path.removeTrailingSlashes(path); + } + } + + @:hlNative("std", "sys_read_dir") static function sys_read_dir(path:hl.Bytes):hl.NativeArray { + return null; + } + + @:hlNative("std", "sys_create_dir") static function sys_create_dir(path:hl.Bytes, rights:Int):Bool { + return false; + } + + @:hlNative("std", "sys_is_dir") static function sys_is_dir(path:hl.Bytes):Bool { + return false; + } + + @:hlNative("std", "sys_stat") static function sys_stat(path:hl.Bytes):hl.NativeArray { + return null; + } + + @:hlNative("std", "sys_rename") static function sys_rename(path:hl.Bytes, to:hl.Bytes):Bool { + return true; + } + + @:hlNative("std", "sys_delete") static function sys_delete(path:hl.Bytes):Bool { + return true; + }; + + @:hlNative("std", "sys_full_path") static function sys_full_path(path:hl.Bytes):hl.Bytes { + return null; + } + + @:hlNative("std", "sys_remove_dir") static function sys_remove_dir(path:hl.Bytes):Bool { + return true; + } + + @:hlNative("std", "sys_exists") static function sys_exists(path:hl.Bytes):Bool { + return true; + } +} diff --git a/build/linux64_569e52e/std/hl/_std/sys/io/File.hx b/build/linux64_569e52e/std/hl/_std/sys/io/File.hx new file mode 100644 index 0000000..1a5c7a1 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/sys/io/File.hx @@ -0,0 +1,106 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.io; + +#if doc_gen +enum FileHandle {} +#else +typedef FileHandle = hl.Abstract<"hl_fdesc">; +#end + +@:access(Sys) +@:coreApi class File { + public static function getContent(path:String):String { + var bytes = file_contents(Sys.getPath(path), null); + if (bytes == null) + throw new Sys.SysError("Can't read " + path); + return @:privateAccess String.fromUTF8(bytes); + } + + public static function getBytes(path:String):haxe.io.Bytes { + var size = 0; + var bytes = file_contents(Sys.getPath(path), size); + if (bytes == null) + throw new Sys.SysError("Can't read " + path); + return @:privateAccess new haxe.io.Bytes(bytes, size); + } + + public static function saveContent(path:String, content:String):Void { + var f = write(path); + f.writeString(content); + f.close(); + } + + public static function saveBytes(path:String, bytes:haxe.io.Bytes):Void { + var f = write(path); + f.write(bytes); + f.close(); + } + + public static function read(path:String, binary:Bool = true):FileInput { + var f = file_open(Sys.getPath(path), 0, binary); + if (f == null) + throw new Sys.SysError("Can't open " + path); + return @:privateAccess new FileInput(f); + } + + public static function write(path:String, binary:Bool = true):FileOutput { + var f = file_open(Sys.getPath(path), 1, binary); + if (f == null) + throw new Sys.SysError("Can't open " + path + " for writing"); + return @:privateAccess new FileOutput(f); + } + + public static function append(path:String, binary:Bool = true):FileOutput { + var f = file_open(Sys.getPath(path), 2, binary); + if (f == null) + throw new Sys.SysError("Can't open " + path + " for append"); + return @:privateAccess new FileOutput(f); + } + + public static function update(path:String, binary:Bool = true):FileOutput { + if (!FileSystem.exists(path)) { + write(path).close(); + } + var f = file_open(Sys.getPath(path), 3, binary); + if (f == null) + throw new Sys.SysError("Can't open " + path + " for update"); + return @:privateAccess new FileOutput(f); + } + + public static function copy(srcPath:String, dstPath:String):Void { + var s = read(srcPath, true); + var d = write(dstPath, true); + d.writeInput(s); + s.close(); + d.close(); + } + + @:hlNative("std", "file_open") static function file_open(path:hl.Bytes, mode:Int, binary:Bool):FileHandle { + return null; + } + + @:hlNative("std", "file_contents") static function file_contents(path:hl.Bytes, size:hl.Ref):hl.Bytes { + return null; + } +} diff --git a/build/linux64_569e52e/std/hl/_std/sys/io/FileInput.hx b/build/linux64_569e52e/std/hl/_std/sys/io/FileInput.hx new file mode 100644 index 0000000..a766697 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/sys/io/FileInput.hx @@ -0,0 +1,97 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.io; + +import sys.io.File; + +@:coreApi class FileInput extends haxe.io.Input { + private var __f:FileHandle; + + function new(f:FileHandle):Void { + __f = f; + } + + public override function readByte():Int { + var c = file_read_char(__f); + if (c < 0) + throw new haxe.io.Eof(); + return c; + } + + public override function readBytes(s:haxe.io.Bytes, p:Int, l:Int):Int { + if (p < 0 || l < 0 || p + l > s.length) + throw haxe.io.Error.OutsideBounds; + var v = file_read(__f, s.getData(), p, l); + if (v <= 0) + throw new haxe.io.Eof(); + return v; + } + + public override function close():Void { + super.close(); + file_close(__f); + __f = null; + } + + public function seek(p:Int, pos:FileSeek):Void { + if (!file_seek(__f, p, switch (pos) { + case SeekBegin: 0; + case SeekCur: 1; + case SeekEnd: 2; + })) + throw haxe.io.Error.Custom("seek() failure"); + } + + public function tell():Int { + var p = file_tell(__f); + if (p < 0) + throw haxe.io.Error.Custom("tell() failure"); + return p; + } + + public function eof():Bool { + return file_eof(__f); + } + + @:hlNative("std", "file_eof") static function file_eof(f:FileHandle):Bool { + return false; + } + + @:hlNative("std", "file_read") static function file_read(f:FileHandle, bytes:hl.Bytes, pos:Int, len:Int):Int { + return 0; + } + + @:hlNative("std", "file_read_char") static function file_read_char(f:FileHandle):Int { + return 0; + } + + @:hlNative("std", "file_close") static function file_close(f:FileHandle):Void {} + + @:hlNative("std", "file_seek") static function file_seek(f:FileHandle, pos:Int, from:Int):Bool { + return true; + } + + @:hlNative("std", "file_tell") static function file_tell(f:FileHandle):Int { + return 0; + } +} diff --git a/build/linux64_569e52e/std/hl/_std/sys/io/FileOutput.hx b/build/linux64_569e52e/std/hl/_std/sys/io/FileOutput.hx new file mode 100644 index 0000000..34a8ff5 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/sys/io/FileOutput.hx @@ -0,0 +1,86 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.io; + +import sys.io.File; + +@:coreApi class FileOutput extends haxe.io.Output { + private var __f:FileHandle; + + function new(f:FileHandle):Void { + __f = f; + } + + public override function writeByte(c:Int):Void { + if (!file_write_char(__f, c)) + throw new haxe.io.Eof(); + } + + public override function writeBytes(s:haxe.io.Bytes, p:Int, l:Int):Int { + if (p < 0 || l < 0 || p + l > s.length) + throw haxe.io.Error.OutsideBounds; + var v = file_write(__f, s.getData(), p, l); + if (v <= 0) + throw new haxe.io.Eof(); + return v; + } + + public override function flush():Void { + if (!file_flush(__f)) + throw haxe.io.Error.Custom("flush() failure"); + } + + public override function close():Void { + super.close(); + @:privateAccess FileInput.file_close(__f); + __f = null; + } + + public function seek(p:Int, pos:FileSeek):Void { + if (@:privateAccess !FileInput.file_seek(__f, p, switch (pos) { + case SeekBegin: 0; + case SeekCur: 1; + case SeekEnd: 2; + })) + throw haxe.io.Error.Custom("seek() failure"); + } + + public function tell():Int { + var p = @:privateAccess FileInput.file_tell(__f); + if (p < 0) + throw haxe.io.Error.Custom("tell() failure"); + return p; + } + + @:hlNative("std", "file_flush") static function file_flush(f:FileHandle):Bool { + return true; + } + + @:hlNative("std", "file_write") static function file_write(f:FileHandle, bytes:hl.Bytes, pos:Int, len:Int):Int { + return 0; + } + + @:hlNative("std", "file_write_char") static function file_write_char(f:FileHandle, v:Int):Bool { + return true; + } +} diff --git a/build/linux64_569e52e/std/hl/_std/sys/io/Process.hx b/build/linux64_569e52e/std/hl/_std/sys/io/Process.hx new file mode 100644 index 0000000..0cbbc4d --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/sys/io/Process.hx @@ -0,0 +1,201 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.io; + +private typedef ProcessHandle = hl.Abstract<"hl_process">; + +private class Stdin extends haxe.io.Output { + var p:Dynamic; + var buf:haxe.io.Bytes; + + public function new(p) { + this.p = p; + buf = haxe.io.Bytes.alloc(1); + } + + public override function close() { + super.close(); + _stdin_close(p); + } + + public override function writeByte(c) { + buf.set(0, c); + writeBytes(buf, 0, 1); + } + + public override function writeBytes(buf:haxe.io.Bytes, pos:Int, len:Int):Int { + var v = _stdin_write(p, buf.getData().bytes, pos, len); + if (v < 0) + throw new haxe.io.Eof(); + return v; + } + + @:hlNative("std", "process_stdin_write") static function _stdin_write(p:ProcessHandle, bytes:hl.Bytes, pos:Int, len:Int):Int { + return 0; + } + + @:hlNative("std", "process_stdin_close") static function _stdin_close(p:ProcessHandle):Bool { + return false; + } +} + +private class Stdout extends haxe.io.Input { + var p:ProcessHandle; + var out:Bool; + var buf:haxe.io.Bytes; + + public function new(p, out) { + this.p = p; + this.out = out; + buf = haxe.io.Bytes.alloc(1); + } + + public override function readByte() { + if (readBytes(buf, 0, 1) == 0) + throw haxe.io.Error.Blocked; + return buf.get(0); + } + + public override function readBytes(str:haxe.io.Bytes, pos:Int, len:Int):Int { + var v = out ? _stdout_read(p, str.getData().bytes, pos, len) : _stderr_read(p, str.getData().bytes, pos, len); + if (v < 0) + throw new haxe.io.Eof(); + return v; + } + + @:hlNative("std", "process_stdout_read") static function _stdout_read(p:ProcessHandle, bytes:hl.Bytes, pos:Int, len:Int):Int { + return 0; + } + + @:hlNative("std", "process_stderr_read") static function _stderr_read(p:ProcessHandle, bytes:hl.Bytes, pos:Int, len:Int):Int { + return 0; + } +} + +@:access(Sys) +@:coreApi class Process { + var p:ProcessHandle; + + public var stdout(default, null):haxe.io.Input; + public var stderr(default, null):haxe.io.Input; + public var stdin(default, null):haxe.io.Output; + + static var isWin = Sys.systemName() == "Windows"; + + public function new(cmd:String, ?args:Array, ?detached:Bool):Void { + var runCmd = cmd; + if (isWin) { + var b = new StringBuf(); + if (args == null) { + var exe = Sys.getEnv("COMSPEC"); + if (exe == null) + exe = "cmd.exe"; + b.add("\""); + b.add(exe); + b.add("\" /C \""); + b.add(cmd); + b.addChar('"'.code); + } else { + b.addChar('"'.code); + b.add(cmd); + b.addChar('"'.code); + for (a in args) { + b.add(" \""); + var bsCount = 0; + for (i in 0...a.length) { + switch (StringTools.fastCodeAt(a, i)) { + case '"'.code: + for (i in 0...bsCount * 2) + b.addChar('\\'.code); + bsCount = 0; + b.add("\\\""); + case '\\'.code: + bsCount++; + case c: + for (i in 0...bsCount) + b.addChar('\\'.code); + bsCount = 0; + b.addChar(c); + } + } + // Add remaining backslashes, if any. + for (i in 0...bsCount * 2) + b.addChar('\\'.code); + b.addChar('"'.code); + } + args = null; + } + runCmd = b.toString(); + } + @:privateAccess { + var aargs = null; + if (args != null) { + aargs = new hl.NativeArray(args.length); + for (i in 0...args.length) + aargs[i] = Sys.getPath(args[i]); + } + p = _run(Sys.getPath(runCmd), aargs, detached); + } + if (p == null) + throw new Sys.SysError("Process creation failure : " + cmd); + stdin = new Stdin(p); + stdout = new Stdout(p, true); + stderr = new Stdout(p, false); + } + + public function getPid():Int { + return _pid(p); + } + + public function exitCode(block:Bool = true):Null { + var running = false; + var code = _exit(p, block == false ? new hl.Ref(running) : null); + if (block == false) + return running ? null : code; + return code; + } + + public function close():Void { + _close(p); + } + + public function kill():Void { + _kill(p); + } + + @:hlNative("std", "process_run") static function _run(cmd:hl.Bytes, args:hl.NativeArray, detached:Bool):ProcessHandle { + return null; + } + + @:hlNative("std", "process_exit") static function _exit(p:ProcessHandle, running:hl.Ref):Int { + return 0; + } + + @:hlNative("std", "process_pid") static function _pid(p:ProcessHandle):Int { + return 0; + } + + @:hlNative("std", "process_close") static function _close(p:ProcessHandle):Void {} + + @:hlNative("std", "process_kill") static function _kill(p:ProcessHandle):Void {} +} diff --git a/build/linux64_569e52e/std/hl/_std/sys/net/Host.hx b/build/linux64_569e52e/std/hl/_std/sys/net/Host.hx new file mode 100644 index 0000000..ed737c0 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/sys/net/Host.hx @@ -0,0 +1,65 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.net; + +@:coreApi +class Host { + public var host(default, null):String; + + public var ip(default, null):Int; + + public function new(name:String):Void { + host = name; + ip = host_resolve(@:privateAccess name.bytes.utf16ToUtf8(0, null)); + if (ip == -1) + throw new Sys.SysError("Unresolved host " + name); + } + + public function toString():String { + return @:privateAccess String.fromUTF8(host_to_string(ip)); + } + + public function reverse():String { + return @:privateAccess String.fromUTF8(host_reverse(ip)); + } + + public static function localhost():String { + return @:privateAccess String.fromUTF8(host_local()); + } + + @:hlNative("std", "host_resolve") static function host_resolve(name:hl.Bytes):Int { + return 0; + } + + @:hlNative("std", "host_reverse") static function host_reverse(host:Int):hl.Bytes { + return null; + } + + @:hlNative("std", "host_to_string") static function host_to_string(host:Int):hl.Bytes { + return null; + } + + @:hlNative("std", "host_local") static function host_local():hl.Bytes { + return null; + } +} diff --git a/build/linux64_569e52e/std/hl/_std/sys/net/Socket.hx b/build/linux64_569e52e/std/hl/_std/sys/net/Socket.hx new file mode 100644 index 0000000..0cd7113 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/sys/net/Socket.hx @@ -0,0 +1,334 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.net; + +import haxe.io.Error; + +#if doc_gen +@:noDoc enum SocketHandle {} +#else +@:noDoc typedef SocketHandle = hl.Abstract<"hl_socket">; +#end + +private class SocketOutput extends haxe.io.Output { + var sock:Socket; + + public function new(s) { + this.sock = s; + } + + public override function writeByte(c:Int) { + var k = socket_send_char(@:privateAccess sock.__s, c); + if (k < 0) { + if (k == -1) + throw Blocked; + throw new haxe.io.Eof(); + } + } + + public override function writeBytes(buf:haxe.io.Bytes, pos:Int, len:Int):Int { + if (pos < 0 || len < 0 || pos + len > buf.length) + throw haxe.io.Error.OutsideBounds; + var n = socket_send(@:privateAccess sock.__s, buf.getData().bytes, pos, len); + if (n < 0) { + if (n == -1) + throw Blocked; + throw new haxe.io.Eof(); + } + return n; + } + + public override function close() { + sock.close(); + } + + @:hlNative("std", "socket_send_char") static function socket_send_char(s:SocketHandle, c:Int):Int { + return 0; + } + + @:hlNative("std", "socket_send") static function socket_send(s:SocketHandle, bytes:hl.Bytes, pos:Int, len:Int):Int { + return 0; + } +} + +private class SocketInput extends haxe.io.Input { + var sock:Socket; + + public function new(s) { + sock = s; + } + + public override function readByte():Int { + var c = socket_recv_char(@:privateAccess sock.__s); + if (c < 0) { + if (c == -1) + throw Blocked; + throw new haxe.io.Eof(); + } + return c; + } + + public override function readBytes(buf:haxe.io.Bytes, pos:Int, len:Int):Int { + if (pos < 0 || len < 0 || pos + len > buf.length) + throw haxe.io.Error.OutsideBounds; + var r = socket_recv(@:privateAccess sock.__s, buf.getData().bytes, pos, len); + if (r <= 0) { + if (r == -1) + throw Blocked; + throw new haxe.io.Eof(); + } + return r; + } + + public override function close() { + sock.close(); + } + + @:hlNative("std", "socket_recv") static function socket_recv(s:SocketHandle, bytes:hl.Bytes, pos:Int, len:Int):Int { + return 0; + } + + @:hlNative("std", "socket_recv_char") static function socket_recv_char(s:SocketHandle):Int { + return 0; + } +} + +@:coreApi +@:keepInit +class Socket { + private var __s:SocketHandle; + + public var input(default, null):haxe.io.Input; + public var output(default, null):haxe.io.Output; + public var custom:Dynamic; + + static function __init__():Void { + socket_init(); + } + + public function new():Void { + init(); + } + + function init():Void { + if (__s == null) + __s = socket_new(false); + input = new SocketInput(this); + output = new SocketOutput(this); + } + + public function close():Void { + if (__s != null) { + socket_close(__s); + __s = null; + } + } + + public function read():String { + return input.readAll().toString(); + } + + public function write(content:String):Void { + output.writeString(content); + } + + public function connect(host:Host, port:Int):Void { + if (!socket_connect(__s, host.ip, port)) + throw new Sys.SysError("Failed to connect on " + host.toString() + ":" + port); + } + + public function listen(connections:Int):Void { + if (!socket_listen(__s, connections)) + throw new Sys.SysError("listen() failure"); + } + + public function shutdown(read:Bool, write:Bool):Void { + if (!socket_shutdown(__s, read, write)) + throw new Sys.SysError("shutdown() failure"); + } + + public function bind(host:Host, port:Int):Void { + if (!socket_bind(__s, host.ip, port)) + throw new Sys.SysError("Cannot bind socket on " + host + ":" + port); + } + + public function accept():Socket { + var c = socket_accept(__s); + if (c == null) + return null; + var s:Socket = untyped $new(Socket); + s.__s = c; + s.input = new SocketInput(s); + s.output = new SocketOutput(s); + return s; + } + + public function peer():{host:Host, port:Int} { + var ip = 0, port = 0; + if (!socket_peer(__s, ip, port)) + return null; + var h:Host = untyped $new(Host); + @:privateAccess h.ip = ip; + return {host: h, port: port}; + } + + public function host():{host:Host, port:Int} { + var ip = 0, port = 0; + if (!socket_host(__s, ip, port)) + return null; + var h:Host = untyped $new(Host); + @:privateAccess h.ip = ip; + return {host: h, port: port}; + } + + public function setTimeout(timeout:Float):Void { + if (!socket_set_timeout(__s, timeout)) + throw new Sys.SysError("setTimeout() failure"); + } + + public function waitForRead():Void { + select([this], null, null, null); + } + + public function setBlocking(b:Bool):Void { + if (!socket_set_blocking(__s, b)) + throw new Sys.SysError("setBlocking() failure"); + } + + public function setFastSend(b:Bool):Void { + if (!socket_set_fast_send(__s, b)) + throw new Sys.SysError("setFastSend() failure"); + } + + // TODO : use TLS when multithread added + static var tmp:hl.Bytes = null; + static var curTmpSize = 0; + + static function makeArray(a:Array):hl.NativeArray { + if (a == null) + return null; + var arr = new hl.NativeArray(a.length); + for (i in 0...a.length) + arr[i] = a[i].__s; + return arr; + } + + static function outArray(a:hl.NativeArray, original:Array):Array { + var out = []; + if (a == null) + return out; + var i = 0, p = 0; + var max = original.length; + while (i < max) { + var sh = a[i++]; + if (sh == null) + break; + while (original[p].__s != sh) + p++; + out.push(original[p++]); + } + return out; + } + + public static function select(read:Array, write:Array, others:Array, + ?timeout:Float):{read:Array, write:Array, others:Array} { + var sread = makeArray(read); + var swrite = makeArray(write); + var sothers = makeArray(others); + var tmpSize = 0; + if (sread != null) + tmpSize += socket_fd_size(sread.length); + if (swrite != null) + tmpSize += socket_fd_size(swrite.length); + if (sothers != null) + tmpSize += socket_fd_size(sothers.length); + if (tmpSize > curTmpSize) { + tmp = new hl.Bytes(tmpSize); + curTmpSize = tmpSize; + } + if (!socket_select(sread, swrite, sothers, tmp, curTmpSize, timeout == null ? -1 : timeout)) + throw "Error while waiting on socket"; + return { + read: outArray(sread, read), + write: outArray(swrite, write), + others: outArray(sothers, others), + }; + } + + @:hlNative("std", "socket_init") static function socket_init():Void {} + + @:hlNative("std", "socket_new") static function socket_new(udp:Bool):SocketHandle { + return null; + } + + @:hlNative("std", "socket_close") static function socket_close(s:SocketHandle):Void {} + + @:hlNative("std", "socket_connect") static function socket_connect(s:SocketHandle, host:Int, port:Int):Bool { + return true; + } + + @:hlNative("std", "socket_listen") static function socket_listen(s:SocketHandle, count:Int):Bool { + return true; + } + + @:hlNative("std", "socket_bind") static function socket_bind(s:SocketHandle, host:Int, port:Int):Bool { + return true; + } + + @:hlNative("std", "socket_accept") static function socket_accept(s:SocketHandle):SocketHandle { + return null; + } + + @:hlNative("std", "socket_peer") static function socket_peer(s:SocketHandle, host:hl.Ref, port:hl.Ref):Bool { + return true; + } + + @:hlNative("std", "socket_host") static function socket_host(s:SocketHandle, host:hl.Ref, port:hl.Ref):Bool { + return true; + } + + @:hlNative("std", "socket_set_timeout") static function socket_set_timeout(s:SocketHandle, timeout:Float):Bool { + return true; + } + + @:hlNative("std", "socket_shutdown") static function socket_shutdown(s:SocketHandle, read:Bool, write:Bool):Bool { + return true; + } + + @:hlNative("std", "socket_set_blocking") static function socket_set_blocking(s:SocketHandle, b:Bool):Bool { + return true; + } + + @:hlNative("std", "socket_set_fast_send") static function socket_set_fast_send(s:SocketHandle, b:Bool):Bool { + return true; + } + + @:hlNative("std", "socket_fd_size") static function socket_fd_size(count:Int):Int { + return 0; + } + + @:hlNative("std", "socket_select") static function socket_select(read:hl.NativeArray, write:hl.NativeArray, + other:hl.NativeArray, tmpData:hl.Bytes, tmpSize:Int, timeout:Float):Bool { + return false; + } +} diff --git a/build/linux64_569e52e/std/hl/_std/sys/net/UdpSocket.hx b/build/linux64_569e52e/std/hl/_std/sys/net/UdpSocket.hx new file mode 100644 index 0000000..d29f326 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/sys/net/UdpSocket.hx @@ -0,0 +1,81 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.net; + +import sys.net.Socket; +import haxe.io.Error; + +class UdpSocket extends Socket { + public function new() { + super(); + } + + override function init():Void { + __s = Socket.socket_new(true); + super.init(); + } + + public function sendTo(buf:haxe.io.Bytes, pos:Int, len:Int, addr:Address):Int { + if (pos < 0 || len < 0 || pos + len > buf.length) + throw OutsideBounds; + var ret = socket_send_to(__s, (buf : hl.Bytes).offset(pos), len, addr.host, addr.port); + if (ret < 0) { + if (ret == -1) + throw Blocked; + throw new haxe.io.Eof(); + } + return ret; + } + + public function readFrom(buf:haxe.io.Bytes, pos:Int, len:Int, addr:Address):Int { + var host = 0, port = 0; + if (pos < 0 || len < 0 || pos + len > buf.length) + throw OutsideBounds; + var ret = socket_recv_from(__s, (buf : hl.Bytes).offset(pos), len, host, port); + if (ret <= 0) { + if (ret == -1) + throw Blocked; + throw new haxe.io.Eof(); + } + addr.host = host; + addr.port = port; + return ret; + } + + public function setBroadcast(b:Bool):Void { + if (!socket_set_broadcast(__s, b)) + throw new Sys.SysError("setBroadcast() failure"); + } + + @:hlNative("std", "socket_send_to") static function socket_send_to(s:SocketHandle, bytes:hl.Bytes, len:Int, host:Int, port:Int):Int { + return 0; + } + + @:hlNative("std", "socket_set_broadcast") static function socket_set_broadcast(s:SocketHandle, b:Bool):Bool { + return true; + } + + @:hlNative("std", "socket_recv_from") static function socket_recv_from(s:SocketHandle, bytes:hl.Bytes, len:Int, host:hl.Ref, port:hl.Ref):Int { + return 0; + } +} diff --git a/build/linux64_569e52e/std/hl/_std/sys/ssl/Certificate.hx b/build/linux64_569e52e/std/hl/_std/sys/ssl/Certificate.hx new file mode 100644 index 0000000..6c4f081 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/sys/ssl/Certificate.hx @@ -0,0 +1,182 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.ssl; + +import sys.ssl.Lib; + +@:noDoc +typedef CertificatePtr = hl.Abstract<"hl_ssl_cert">; + +@:coreApi +class Certificate { + var __h:Null; + var __x:CertificatePtr; + + @:allow(sys.ssl.Socket) + function new(x:CertificatePtr, ?h:Certificate) { + __x = x; + __h = h; + } + + public static function loadFile(file:String):Certificate { + return new Certificate(cert_load_file(@:privateAccess file.toUtf8())); + } + + public static function loadPath(path:String):Certificate { + return new Certificate(cert_load_path(@:privateAccess path.toUtf8())); + } + + public static function fromString(str:String):Certificate { + return new Certificate(cert_add_pem(null, @:privateAccess str.toUtf8())); + } + + public static function loadDefaults():Certificate { + var x = cert_load_defaults(); + if (x != null) + return new Certificate(x); + + var defPaths = null; + switch (Sys.systemName()) { + case "Linux": + defPaths = [ + "/etc/ssl/certs/ca-certificates.crt", // Debian/Ubuntu/Gentoo etc. + "/etc/pki/tls/certs/ca-bundle.crt", // Fedora/RHEL + "/etc/ssl/ca-bundle.pem", // OpenSUSE + "/etc/pki/tls/cacert.pem", // OpenELEC + "/etc/ssl/certs", // SLES10/SLES11 + "/system/etc/security/cacerts" // Android + ]; + case "BSD": + defPaths = [ + "/usr/local/share/certs/ca-root-nss.crt", // FreeBSD/DragonFly + "/etc/ssl/cert.pem", // OpenBSD + "/etc/openssl/certs/ca-certificates.crt", // NetBSD + ]; + case "Android": + defPaths = ["/system/etc/security/cacerts"]; + default: + } + if (defPaths != null) { + for (path in defPaths) { + if (sys.FileSystem.exists(path)) { + if (sys.FileSystem.isDirectory(path)) + return loadPath(path); + else + return loadFile(path); + } + } + } + return null; + } + + public var commonName(get, null):Null; + public var altNames(get, null):Array; + public var notBefore(get, null):Date; + public var notAfter(get, null):Date; + + function get_commonName():Null { + return subject("CN"); + } + + function get_altNames():Array { + var a = cert_get_altnames(__x); + return [for (e in a) @:privateAccess String.fromUCS2(e)]; + } + + public function subject(field:String):Null { + var s = cert_get_subject(__x, @:privateAccess field.toUtf8()); + return s == null ? null : @:privateAccess String.fromUCS2(cast s); + } + + public function issuer(field:String):Null { + var s = cert_get_issuer(__x, @:privateAccess field.toUtf8()); + return s == null ? null : @:privateAccess String.fromUCS2(cast s); + } + + function get_notBefore():Date { + var a = cert_get_notbefore(__x); + return new Date(a[0], a[1] - 1, a[2], a[3], a[4], a[5]); + } + + function get_notAfter():Date { + var a = cert_get_notafter(__x); + return new Date(a[0], a[1] - 1, a[2], a[3], a[4], a[5]); + } + + public function next():Null { + var n = cert_get_next(__x); + return n == null ? null : new Certificate(n, __h == null ? this : __h); + } + + public function add(pem:String):Void { + cert_add_pem(__x, @:privateAccess pem.toUtf8()); + } + + public function addDER(der:haxe.io.Bytes):Void { + cert_add_der(__x, @:privateAccess der.b, @:privateAccess der.length); + } + + @:hlNative("ssl", "cert_load_defaults") static function cert_load_defaults():CertificatePtr { + return null; + } + + @:hlNative("ssl", "cert_load_file") static function cert_load_file(file:hl.Bytes):CertificatePtr { + return null; + } + + @:hlNative("ssl", "cert_load_path") static function cert_load_path(path:hl.Bytes):CertificatePtr { + return null; + } + + @:hlNative("ssl", "cert_get_subject") static function cert_get_subject(cert:CertificatePtr, obj:hl.Bytes):hl.Bytes { + return null; + } + + @:hlNative("ssl", "cert_get_issuer") static function cert_get_issuer(cert:CertificatePtr, obj:hl.Bytes):hl.Bytes { + return null; + } + + @:hlNative("ssl", "cert_get_altnames") static function cert_get_altnames(cert:CertificatePtr):hl.NativeArray { + return null; + } + + @:hlNative("ssl", "cert_get_notbefore") static function cert_get_notbefore(cert:CertificatePtr):hl.NativeArray { + return null; + } + + @:hlNative("ssl", "cert_get_notafter") static function cert_get_notafter(cert:CertificatePtr):hl.NativeArray { + return null; + } + + @:hlNative("ssl", "cert_get_next") static function cert_get_next(cert:CertificatePtr):Null { + return null; + } + + @:hlNative("ssl", "cert_add_pem") static function cert_add_pem(cert:Null, data:hl.Bytes):CertificatePtr { + return null; + } + + @:hlNative("ssl", "cert_add_der") static function cert_add_der(cert:Null, data:hl.Bytes, len:Int):CertificatePtr { + return null; + } +} diff --git a/build/linux64_569e52e/std/hl/_std/sys/ssl/Context.hx b/build/linux64_569e52e/std/hl/_std/sys/ssl/Context.hx new file mode 100644 index 0000000..0109e71 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/sys/ssl/Context.hx @@ -0,0 +1,98 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.ssl; + +private typedef ConfigPtr = hl.Abstract<"mbedtls_ssl_config">; +private typedef ContextPtr = hl.Abstract<"mbedtls_ssl_context">; + +@:keep class SNICbResult { + public var cert:Certificate.CertificatePtr; + public var key:Key.KeyPtr; + + public function new(cert:Certificate, key:Key) { + this.cert = @:privateAccess cert.__x; + this.key = @:privateAccess key.__k; + } +} + +@:hlNative("ssl", "ssl_") +abstract Context(ContextPtr) { + public function new(config) { + this = ssl_new(config); + } + + public function close():Void {} + + public function handshake():Int { + return 0; + } + + public function recvChar():Int { + return 0; + } + + public function sendChar(c:Int):Int { + return 0; + } + + public function getPeerCertificate():Certificate.CertificatePtr { + return null; + } + + public function recv(bytes:hl.Bytes, pos:Int, len:Int):Int { + return 0; + } + + public function send(bytes:hl.Bytes, pos:Int, len:Int):Int { + return 0; + } + + public function setSocket(socket:sys.net.Socket.SocketHandle):Void {} + + public function setHostname(name:hl.Bytes):Void {} + + @:hlNative("ssl", "ssl_new") static function ssl_new(conf:Config):ContextPtr { + return null; + } +} + +@:hlNative("ssl", "conf_") +abstract Config(ConfigPtr) { + public function new(server:Bool) { + this = conf_new(server); + } + + public function setCert(cert:Certificate.CertificatePtr, pkey:Key.KeyPtr):Void {} + + public function setCa(ca:Certificate.CertificatePtr):Void {} + + public function close():Void {} + + public function setVerify(mode:Int):Void {} + + public function setServernameCallback(cb:hl.Bytes->SNICbResult):Void {} + + @:hlNative("ssl", "conf_new") static function conf_new(server:Bool):ConfigPtr { + return null; + } +} diff --git a/build/linux64_569e52e/std/hl/_std/sys/ssl/Digest.hx b/build/linux64_569e52e/std/hl/_std/sys/ssl/Digest.hx new file mode 100644 index 0000000..4578cae --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/sys/ssl/Digest.hx @@ -0,0 +1,56 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.ssl; + +import sys.ssl.Lib; + +@:coreApi +class Digest { + public static function make(data:haxe.io.Bytes, alg:DigestAlgorithm):haxe.io.Bytes { + var size = 0; + var b = @:privateAccess dgst_make(data.b, data.length, (alg : String).toUtf8(), size); + return @:privateAccess new haxe.io.Bytes(b, size); + } + + public static function sign(data:haxe.io.Bytes, privKey:Key, alg:DigestAlgorithm):haxe.io.Bytes { + var size = 0; + var b = @:privateAccess dgst_sign(data.b, data.length, privKey.__k, (alg : String).toUtf8(), size); + return @:privateAccess new haxe.io.Bytes(b, size); + } + + public static function verify(data:haxe.io.Bytes, signature:haxe.io.Bytes, pubKey:Key, alg:DigestAlgorithm):Bool { + return @:privateAccess dgst_verify(data.b, data.length, signature.b, signature.length, pubKey.__k, (alg : String).toUtf8()); + } + + @:hlNative("ssl", "dgst_make") static function dgst_make(data:hl.Bytes, len:Int, alg:hl.Bytes, size:hl.Ref):hl.Bytes { + return null; + } + + @:hlNative("ssl", "dgst_sign") static function dgst_sign(data:hl.Bytes, len:Int, key:sys.ssl.Key.KeyPtr, alg:hl.Bytes, size:hl.Ref):hl.Bytes { + return null; + } + + @:hlNative("ssl", "dgst_verify") static function dgst_verify(data:hl.Bytes, dlen:Int, sign:hl.Bytes, slen:Int, key:sys.ssl.Key.KeyPtr, alg:hl.Bytes):Bool { + return false; + } +} diff --git a/build/linux64_569e52e/std/hl/_std/sys/ssl/Key.hx b/build/linux64_569e52e/std/hl/_std/sys/ssl/Key.hx new file mode 100644 index 0000000..240d82d --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/sys/ssl/Key.hx @@ -0,0 +1,62 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.ssl; + +import sys.ssl.Lib; + +@:noDoc +typedef KeyPtr = hl.Abstract<"hl_ssl_pkey">; + +@:coreApi +class Key { + private var __k:KeyPtr; + + private function new(k:KeyPtr) { + __k = k; + } + + public static function loadFile(file:String, ?isPublic:Bool, ?pass:String):Key { + var data = sys.io.File.getBytes(file); + var start = data.getString(0, 11); + if (start == "-----BEGIN ") + return readPEM(data.toString(), isPublic == true, pass); + else + return readDER(data, isPublic == true); + } + + public static function readPEM(data:String, isPublic:Bool, ?pass:String):Key { + return new Key(key_from_pem(@:privateAccess data.toUtf8(), isPublic, pass == null ? null : @:privateAccess pass.toUtf8())); + } + + public static function readDER(data:haxe.io.Bytes, isPublic:Bool):Key { + return new Key(key_from_der(@:privateAccess data.b, @:privateAccess data.length, isPublic)); + } + + @:hlNative("ssl", "key_from_pem") static function key_from_pem(data:hl.Bytes, pub:Bool, pass:Null):KeyPtr { + return null; + } + + @:hlNative("ssl", "key_from_der") static function key_from_der(data:hl.Bytes, len:Int, pub:Bool):KeyPtr { + return null; + } +} diff --git a/build/linux64_569e52e/std/hl/_std/sys/ssl/Lib.hx b/build/linux64_569e52e/std/hl/_std/sys/ssl/Lib.hx new file mode 100644 index 0000000..5e6fc05 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/sys/ssl/Lib.hx @@ -0,0 +1,32 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.ssl; + +@:noDoc @:keep +class Lib { + static function __init__():Void { + ssl_init(); + } + + @:hlNative("ssl", "ssl_init") static function ssl_init() {}; +} diff --git a/build/linux64_569e52e/std/hl/_std/sys/ssl/Socket.hx b/build/linux64_569e52e/std/hl/_std/sys/ssl/Socket.hx new file mode 100644 index 0000000..f16818b --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/sys/ssl/Socket.hx @@ -0,0 +1,255 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.ssl; + +import sys.ssl.Lib; +import sys.ssl.Key.KeyPtr; +import sys.ssl.Certificate.CertificatePtr; +import sys.net.Socket.SocketHandle; + +private class SocketInput extends haxe.io.Input { + @:allow(sys.ssl.Socket) private var __s:Socket; + + public function new(s:Socket) { + this.__s = s; + } + + public override function readByte() { + __s.handshake(); + var r = @:privateAccess __s.ssl.recvChar(); + if (r == -1) + throw haxe.io.Error.Blocked; + else if (r < 0) + throw new haxe.io.Eof(); + return r; + } + + public override function readBytes(buf:haxe.io.Bytes, pos:Int, len:Int):Int { + if (pos < 0 || len < 0 || ((pos + len) : UInt) > (buf.length : UInt)) + throw haxe.io.Error.OutsideBounds; + __s.handshake(); + var r = @:privateAccess __s.ssl.recv(buf, pos, len); + if (r == -1) + throw haxe.io.Error.Blocked; + else if (r <= 0) + throw new haxe.io.Eof(); + return r; + } + + public override function close() { + super.close(); + if (__s != null) + __s.close(); + } +} + +private class SocketOutput extends haxe.io.Output { + @:allow(sys.ssl.Socket) private var __s:Socket; + + public function new(s:Socket) { + this.__s = s; + } + + public override function writeByte(c:Int) { + __s.handshake(); + var r = @:privateAccess __s.ssl.sendChar(c); + if (r == -1) + throw haxe.io.Error.Blocked; + else if (r < 0) + throw new haxe.io.Eof(); + } + + public override function writeBytes(buf:haxe.io.Bytes, pos:Int, len:Int):Int { + if (pos < 0 || len < 0 || ((pos + len) : UInt) > (buf.length : UInt)) + throw haxe.io.Error.OutsideBounds; + __s.handshake(); + var r = @:privateAccess __s.ssl.send(buf, pos, len); + if (r == -1) + throw haxe.io.Error.Blocked; + else if (r < 0) + throw new haxe.io.Eof(); + return r; + } + + public override function close() { + super.close(); + if (__s != null) + __s.close(); + } +} + +@:coreApi @:access(sys.net.Socket) +class Socket extends sys.net.Socket { + public static var DEFAULT_VERIFY_CERT:Null = true; + + public static var DEFAULT_CA:Null; + + private var conf:Context.Config; + private var ssl:Context; + + public var verifyCert:Null; + + private var caCert:Null; + private var hostname:String; + + private var ownCert:Null; + private var ownKey:Null; + private var altSNIContexts:NullBool, key:Key, cert:Certificate}>>; + private var sniCallback:hl.Bytes->Context.SNICbResult; + private var handshakeDone:Bool; + private var isBlocking:Bool = true; + + private override function init():Void { + __s = sys.net.Socket.socket_new(false); + input = new SocketInput(this); + output = new SocketOutput(this); + if (DEFAULT_VERIFY_CERT && DEFAULT_CA == null) { + try { + DEFAULT_CA = Certificate.loadDefaults(); + } catch (e:Dynamic) {} + } + verifyCert = DEFAULT_VERIFY_CERT; + caCert = DEFAULT_CA; + } + + public override function connect(host:sys.net.Host, port:Int):Void { + conf = buildConfig(false); + ssl = new Context(conf); + ssl.setSocket(__s); + handshakeDone = false; + if (hostname == null) + hostname = host.host; + if (hostname != null) + ssl.setHostname(@:privateAccess hostname.toUtf8()); + if (!sys.net.Socket.socket_connect(__s, host.ip, port)) + throw new Sys.SysError("Failed to connect on " + host.toString() + ":" + port); + if (isBlocking) + handshake(); + } + + public function handshake():Void { + if (!handshakeDone) { + var r = ssl.handshake(); + if (r == 0) + handshakeDone = true; + else if (r == -1) + throw haxe.io.Error.Blocked; + else + throw new haxe.io.Eof(); + } + } + + override function setBlocking(b:Bool):Void { + super.setBlocking(b); + isBlocking = b; + } + + public function setCA(cert:Certificate):Void { + caCert = cert; + } + + public function setHostname(name:String):Void { + hostname = name; + } + + public function setCertificate(cert:Certificate, key:Key):Void { + ownCert = cert; + ownKey = key; + } + + public override function close():Void { + if (ssl != null) + ssl.close(); + if (conf != null) + conf.close(); + if (altSNIContexts != null) + sniCallback = null; + sys.net.Socket.socket_close(__s); + var input:SocketInput = cast input; + var output:SocketOutput = cast output; + @:privateAccess input.__s = output.__s = null; + input.close(); + output.close(); + } + + public function addSNICertificate(cbServernameMatch:String->Bool, cert:Certificate, key:Key):Void { + if (altSNIContexts == null) + altSNIContexts = []; + altSNIContexts.push({match: cbServernameMatch, cert: cert, key: key}); + } + + public override function bind(host:sys.net.Host, port:Int):Void { + conf = buildConfig(true); + + sys.net.Socket.socket_bind(__s, host.ip, port); + } + + public override function accept():Socket { + var c = sys.net.Socket.socket_accept(__s); + if(c == null) + throw "Blocking"; + var cssl = new Context(conf); + cssl.setSocket(c); + + var s = Type.createEmptyInstance(sys.ssl.Socket); + s.__s = c; + s.ssl = cssl; + s.input = new SocketInput(s); + s.output = new SocketOutput(s); + s.handshakeDone = false; + + return s; + } + + public function peerCertificate():sys.ssl.Certificate { + var x = ssl.getPeerCertificate(); + return x == null ? null : new sys.ssl.Certificate(x); + } + + private function buildConfig(server:Bool):Context.Config { + var conf = new Context.Config(server); + + if (ownCert != null && ownKey != null) + conf.setCert(@:privateAccess ownCert.__x, @:privateAccess ownKey.__k); + + if (altSNIContexts != null) { + sniCallback = function(servername:hl.Bytes):Context.SNICbResult { + var servername = @:privateAccess String.fromUTF8(servername); + for (c in altSNIContexts) { + if (c.match(servername)) + return new Context.SNICbResult(c.cert, c.key); + } + if (ownKey != null && ownCert != null) + return new Context.SNICbResult(ownCert, ownKey); + return null; + } + conf.setServernameCallback(sniCallback); + } + + if (caCert != null) + conf.setCa(caCert == null ? null : @:privateAccess caCert.__x); + conf.setVerify(if (verifyCert) 1 else if (verifyCert == null) 2 else 0); + + return conf; + } +} diff --git a/build/linux64_569e52e/std/hl/_std/sys/thread/Condition.hx b/build/linux64_569e52e/std/hl/_std/sys/thread/Condition.hx new file mode 100644 index 0000000..d8fdfb6 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/sys/thread/Condition.hx @@ -0,0 +1,50 @@ +package sys.thread; + +#if doc_gen +@:coreApi extern class Condition { + function new():Void; + + public function acquire():Void; + + public function tryAcquire():Bool; + + public function release():Void; + + public function wait():Void; + + public function signal():Void; + + public function broadcast():Void; +} +#else +abstract Condition(hl.Abstract<"hl_condition">) { + public function new():Void { + this = alloc(); + } + + @:hlNative("std", "condition_acquire") + public function acquire():Void {} + + @:hlNative("std", "condition_try_acquire") + public function tryAcquire():Bool { + return false; + } + + @:hlNative("std", "condition_release") + public function release():Void {} + + @:hlNative("std", "condition_wait") + public function wait():Void {} + + @:hlNative("std", "condition_signal") + public function signal():Void {} + + @:hlNative("std", "condition_broadcast") + public function broadcast():Void {} + + @:hlNative("std", "condition_alloc") + static function alloc():hl.Abstract<"hl_condition"> { + return null; + } +} +#end diff --git a/build/linux64_569e52e/std/hl/_std/sys/thread/Deque.hx b/build/linux64_569e52e/std/hl/_std/sys/thread/Deque.hx new file mode 100644 index 0000000..11d2bb7 --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/sys/thread/Deque.hx @@ -0,0 +1,52 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.thread; + +#if doc_gen +@:coreApi extern class Deque { + function new():Void; + function add(i:T):Void; + function push(i:T):Void; + function pop(block:Bool):Null; +} +#else + +@:hlNative("std", "deque_") +abstract Deque(hl.Abstract<"hl_deque">) { + public function new() { + this = alloc(); + } + + public function add(i:T) {} + + public function push(i:T) {} + + public function pop(block:Bool):Null { + return null; + } + + static function alloc() { + return null; + } +} +#end diff --git a/build/linux64_569e52e/std/hl/_std/sys/thread/Lock.hx b/build/linux64_569e52e/std/hl/_std/sys/thread/Lock.hx new file mode 100644 index 0000000..7d5ecfb --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/sys/thread/Lock.hx @@ -0,0 +1,87 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.thread; + + +#if (hl_ver >= version("1.11.0")) + +typedef LockHandle = hl.Abstract<"hl_lock">; + +@:coreApi +@:hlNative("std") +class Lock { + var handle : LockHandle; + + public function new() { + handle = lock_create(); + } + + public function wait( ?timeout : Float ) : Bool { + return lock_wait(handle, timeout); + } + + public function release( ) : Void { + lock_release(handle); + } + + static function lock_wait( handle : LockHandle, ?timeout : Float ) : Bool { + return false; + } + + static function lock_release( handle : LockHandle ) : Void { } + + static function lock_create( ) : LockHandle { + return null; + } +} + +#else + +@:coreApi +class Lock { + var deque:sys.thread.Deque; + + public function new():Void { + deque = new Deque>(); + } + + public function wait(?timeout:Float):Bool { + if (timeout == null) { + deque.pop(true); + return true; + } + var targetTime = haxe.Timer.stamp() + timeout; + do { + if (deque.pop(false) != null) { + return true; + } + } while (haxe.Timer.stamp() < targetTime); + return false; + } + + public function release():Void { + deque.push(true); + } +} + +#end \ No newline at end of file diff --git a/build/linux64_569e52e/std/hl/_std/sys/thread/Mutex.hx b/build/linux64_569e52e/std/hl/_std/sys/thread/Mutex.hx new file mode 100644 index 0000000..fc3aa6f --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/sys/thread/Mutex.hx @@ -0,0 +1,52 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.thread; + +#if doc_gen +@:coreApi +extern class Mutex { + function new():Void; + function acquire():Void; + function tryAcquire():Bool; + function release():Void; +} +#else + +abstract Mutex(hl.Abstract<"hl_mutex">) { + public function new() { + this = alloc(true); + } + + @:hlNative("std", "mutex_acquire") public function acquire() {} + + @:hlNative("std", "mutex_try_acquire") public function tryAcquire():Bool { + return false; + } + + @:hlNative("std", "mutex_release") public function release() {} + + @:hlNative("std", "mutex_alloc") public static function alloc(b:Bool) { + return null; + } +} +#end diff --git a/build/linux64_569e52e/std/hl/_std/sys/thread/Semaphore.hx b/build/linux64_569e52e/std/hl/_std/sys/thread/Semaphore.hx new file mode 100644 index 0000000..e45391c --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/sys/thread/Semaphore.hx @@ -0,0 +1,32 @@ +package sys.thread; + +#if doc_gen +@:coreApi extern class Semaphore { + function new(value:Int):Void; + function acquire():Void; + function tryAcquire(?timeout:Float):Bool; + function release():Void; +} +#else +abstract Semaphore(hl.Abstract<"hl_semaphore">) { + public function new(value:Int):Void { + this = alloc(value); + } + + @:hlNative("std", "semaphore_acquire") + public function acquire():Void {} + + @:hlNative("std", "semaphore_release") + public function release():Void {} + + @:hlNative("std", "semaphore_try_acquire") + public function tryAcquire(?timeout:Float):Bool { + return false; + } + + @:hlNative("std", "semaphore_alloc") + static function alloc(value:Int):hl.Abstract<"hl_semaphore"> { + return null; + } +} +#end diff --git a/build/linux64_569e52e/std/hl/_std/sys/thread/Thread.hx b/build/linux64_569e52e/std/hl/_std/sys/thread/Thread.hx new file mode 100644 index 0000000..eae451b --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/sys/thread/Thread.hx @@ -0,0 +1,204 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.thread; + +private typedef ThreadImpl = HaxeThread; + +abstract Thread(ThreadImpl) from ThreadImpl { + public var events(get,never):EventLoop; + + public inline function sendMessage(msg:Dynamic) { + this.sendMessage(msg); + } + + public static inline function readMessage(block = true):Dynamic { + return HaxeThread.current().readMessage(block); + } + + public static inline function create(job:()->Void):Thread { + return HaxeThread.create(job, false); + } + + public static inline function runWithEventLoop(job:()->Void):Void { + HaxeThread.runWithEventLoop(job); + } + + public static inline function createWithEventLoop(job:()->Void):Thread { + return HaxeThread.create(job, true); + } + + public static function current():Thread { + return HaxeThread.current(); + } + + + public function setName( name : String ) { + #if (hl_ver >= version("1.13.0")) + set_name(@:privateAccess this.handle, @:privateAccess name.toUtf8()); + #end + } + + public function getName() : Null { + #if (hl_ver >= version("1.13.0")) + var name = get_name(@:privateAccess this.handle); + return name == null ? null : @:privateAccess String.fromUTF8(name); + #else + return null; + #end + } + + #if (hl_ver >= version("1.13.0")) + @:hlNative("?std", "thread_set_name") static function set_name( t : ThreadHandle, name : hl.Bytes ) {} + @:hlNative("?std", "thread_get_name") static function get_name( t : ThreadHandle ) : hl.Bytes { return null; } + #end + + function get_events():EventLoop { + if(this.events == null) + throw new NoEventLoopException(); + return this.events; + } + + @:keep + static public function processEvents() { + HaxeThread.current().events.loop(); + } +} + +private typedef ThreadHandle = hl.Abstract<"hl_thread">; + +private class HaxeThread { + + static var mainThread:HaxeThread; + static var threads:Array; + static var threadsMutex:Mutex; + static var UID = 0; + + static function __init__() { + threadsMutex = new Mutex(); + threads = []; + mainThread = new HaxeThread(currentHandle()); + mainThread.events = new EventLoop(); + } + + var id = UID++; + public var events(default,null):Null; + var handle : ThreadHandle; + final messages = new Deque(); + + @:hlNative("std", "thread_create") + static function createHandle(callb:Void->Void):ThreadHandle { + return null; + } + + @:hlNative("std", "thread_current") + static function currentHandle():ThreadHandle { + return null; + } + + static public function current():HaxeThread { + var handle = currentHandle(); + if(handle == mainThread.handle) { + return mainThread; + } + threadsMutex.acquire(); + var thread = null; + for(item in threads) { + if(item.handle == handle) { + thread = item; + break; + } + } + if(thread == null) { + thread = new HaxeThread(handle); + threads.push(thread); + } + threadsMutex.release(); + return thread; + } + + public static function create(callb:()->Void, withEventLoop:Bool):Thread { + var item = new HaxeThread(null); + threadsMutex.acquire(); + threads.push(item); + threadsMutex.release(); + if(withEventLoop) + item.events = new EventLoop(); + item.handle = createHandle(() -> { + if(item.handle == null) { + item.handle = currentHandle(); + } + try { + hl.Api.setErrorHandler(function(_){}); + callb(); + if(withEventLoop) + item.events.loop(); + } catch(e) { + hl.Api.setErrorHandler(null); + dropThread(item); + hl.Api.rethrow(e); + } + dropThread(item); + }); + return item; + } + + public static function runWithEventLoop(job:()->Void):Void { + var thread = current(); + if(thread.events == null) { + thread.events = new EventLoop(); + try { + job(); + thread.events.loop(); + thread.events = null; + } catch(e) { + thread.events = null; + throw e; + } + } else { + job(); + } + } + + static function dropThread(deleteItem) { + threadsMutex.acquire(); + for(i => item in threads) { + if(item == deleteItem) { + threads.splice(i, 1); + break; + } + } + threadsMutex.release(); + } + + public function readMessage(block:Bool):Dynamic { + return messages.pop(block); + } + + public function new(h) { + handle = h; + } + + public function sendMessage(msg:Dynamic) { + messages.add(msg); + } +} diff --git a/build/linux64_569e52e/std/hl/_std/sys/thread/Tls.hx b/build/linux64_569e52e/std/hl/_std/sys/thread/Tls.hx new file mode 100644 index 0000000..472bdef --- /dev/null +++ b/build/linux64_569e52e/std/hl/_std/sys/thread/Tls.hx @@ -0,0 +1,58 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.thread; + +#if doc_gen +@:coreApi +extern class Tls { + var value(get, set):T; + function new():Void; +} +#else + +@:hlNative("std") +abstract Tls(hl.Abstract<"hl_tls">) { + public var value(get, set):T; + + public function new() { + this = tls_alloc(true); + } + + function get_value():T { + return tls_get(this); + } + + function set_value(v:T) { + tls_set(this, v); + return v; + } + + static function tls_alloc(gcValue:Bool) + return null; + + static function tls_get(t):Dynamic + return null; + + static function tls_set(t, v:Dynamic) {} +} +#end diff --git a/build/linux64_569e52e/std/hl/hl_version b/build/linux64_569e52e/std/hl/hl_version new file mode 100644 index 0000000..32bd932 --- /dev/null +++ b/build/linux64_569e52e/std/hl/hl_version @@ -0,0 +1 @@ +1.12.0 \ No newline at end of file diff --git a/build/linux64_569e52e/std/hl/types/ArrayBase.hx b/build/linux64_569e52e/std/hl/types/ArrayBase.hx new file mode 100644 index 0000000..a8d5a9a --- /dev/null +++ b/build/linux64_569e52e/std/hl/types/ArrayBase.hx @@ -0,0 +1,151 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl.types; + +@:keep +class ArrayAccess { + public function getDyn(pos:Int):Dynamic { + throw new haxe.exceptions.NotImplementedException(); + return 0; + } + + public function setDyn(pos:Int, v:Dynamic) { + throw new haxe.exceptions.NotImplementedException(); + } + + public function blit(pos:Int, src:ArrayAccess, srcpos:Int, len:Int):Void { + throw new haxe.exceptions.NotImplementedException(); + } +} + +@:keep +class ArrayBase extends ArrayAccess { + public var length(default, null):Int; + + public function pushDyn(v:Dynamic):Int { + throw new haxe.exceptions.NotImplementedException(); + return 0; + } + + public function popDyn():Null { + throw new haxe.exceptions.NotImplementedException(); + return null; + } + + public function shiftDyn():Null { + throw new haxe.exceptions.NotImplementedException(); + return null; + } + + public function unshiftDyn(v:Dynamic):Void { + throw new haxe.exceptions.NotImplementedException(); + } + + public function insertDyn(pos:Int, v:Dynamic):Void { + throw new haxe.exceptions.NotImplementedException(); + } + + public function containsDyn(v:Dynamic):Bool { + throw new haxe.exceptions.NotImplementedException(); + return false; + } + + public function removeDyn(v:Dynamic):Bool { + throw new haxe.exceptions.NotImplementedException(); + return false; + } + + public function sortDyn(f:Dynamic->Dynamic->Int):Void { + throw new haxe.exceptions.NotImplementedException(); + } + + public function slice(pos:Int, ?end:Int):ArrayBase { + throw new haxe.exceptions.NotImplementedException(); + return null; + } + + public function splice(pos:Int, len:Int):ArrayBase { + throw new haxe.exceptions.NotImplementedException(); + return null; + } + + public function join(sep:String):String { + throw new haxe.exceptions.NotImplementedException(); + return null; + } + + public function reverse() { + throw new haxe.exceptions.NotImplementedException(); + } + + public function resize(len:Int) { + throw new haxe.exceptions.NotImplementedException(); + } + + public function toString():String { + throw new haxe.exceptions.NotImplementedException(); + return null; + } + + function __cast(t:Type):Dynamic { + if (t == Type.get((null : ArrayDyn))) + return ArrayDyn.alloc(this, false); + return null; + } + + function isArrayObj() { + return false; + } + + public static function allocI32(bytes:BytesAccess, length:Int) @:privateAccess { + var a:ArrayBytes.ArrayI32 = untyped $new(ArrayBytes.ArrayI32); + a.length = length; + a.bytes = bytes; + a.size = length; + return a; + } + + public static function allocUI16(bytes:BytesAccess, length:Int) @:privateAccess { + var a:ArrayBytes.ArrayUI16 = untyped $new(ArrayBytes.ArrayUI16); + a.length = length; + a.bytes = bytes; + a.size = length; + return a; + } + + public static function allocF32(bytes:BytesAccess, length:Int) @:privateAccess { + var a:ArrayBytes.ArrayF32 = untyped $new(ArrayBytes.ArrayF32); + a.length = length; + a.bytes = bytes; + a.size = length; + return a; + } + + public static function allocF64(bytes:BytesAccess, length:Int) @:privateAccess { + var a:ArrayBytes.ArrayF64 = untyped $new(ArrayBytes.ArrayF64); + a.length = length; + a.bytes = bytes; + a.size = length; + return a; + } +} diff --git a/build/linux64_569e52e/std/hl/types/ArrayBytes.hx b/build/linux64_569e52e/std/hl/types/ArrayBytes.hx new file mode 100644 index 0000000..7037f6c --- /dev/null +++ b/build/linux64_569e52e/std/hl/types/ArrayBytes.hx @@ -0,0 +1,364 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl.types; + +import haxe.iterators.ArrayIterator; +import haxe.iterators.ArrayKeyValueIterator; + +@:keep +@:generic +class BytesIterator extends ArrayIterator { + var a:ArrayBytes; + + public function new(a) { + super((null:Dynamic)); + this.a = a; + } + + override public function hasNext() { + return current < a.length; + } + + override public function next():T { + return @:privateAccess a.bytes.get(current++); + } +} + +@:keep +@:generic class ArrayBytes extends ArrayBase { + var bytes:hl.BytesAccess; + var size:Int; + + public function new() { + size = length = 0; + bytes = null; + } + + public function concat(a:ArrayBytes):ArrayBytes { + var ac = new ArrayBytes(); + ac.length = ac.size = length + a.length; + ac.bytes = new Bytes(ac.length << bytes.sizeBits); + var offset = length << bytes.sizeBits; + (ac.bytes : Bytes).blit(0, this.bytes, 0, offset); + (ac.bytes : Bytes).blit(offset, a.bytes, 0, a.length << bytes.sizeBits); + return ac; + } + + override function join(sep:String):String { + var s = new StringBuf(); + for (i in 0...length) { + if (i > 0) + s.add(sep); + s.add(bytes[i]); + } + return s.toString(); + } + + public function pop():Null { + if (length == 0) + return null; + length--; + var v = bytes[length]; + bytes[length] = cast 0; + return v; + } + + public function push(x:T):Int { + var len = length; + if (size == len) + __expand(len); + else + length++; + bytes[len] = x; + return length; + } + + override function reverse():Void { + for (i in 0...length >> 1) { + var k = length - 1 - i; + var tmp = bytes[i]; + bytes[i] = bytes[k]; + bytes[k] = tmp; + } + } + + public function shift():Null { + if (length == 0) + return null; + var v = bytes[0]; + length--; + (bytes : Bytes).blit(0, bytes, 1 << bytes.sizeBits, length << bytes.sizeBits); + bytes[length] = cast 0; + return v; + } + + override function blit(pos:Int, src:ArrayBase.ArrayAccess, srcpos:Int, len:Int):Void { + var src = (cast src : ArrayBytes); + if (pos < 0 || srcpos < 0 || len < 0 || pos + len > length || srcpos + len > src.length) + throw haxe.io.Error.OutsideBounds; + (bytes : Bytes).blit(pos << bytes.sizeBits, src.bytes, srcpos << bytes.sizeBits, len << bytes.sizeBits); + } + + override function slice(pos:Int, ?end:Int):ArrayBytes { + if (pos < 0) { + pos = this.length + pos; + if (pos < 0) + pos = 0; + } + var pend:Int; + if (end == null) + pend = this.length; + else { + pend = end; + if (pend < 0) + pend += this.length; + if (pend > this.length) + pend = this.length; + } + var len = pend - pos; + if (len < 0) + return new ArrayBytes(); + var a = new ArrayBytes(); + a.length = a.size = len; + a.bytes = (bytes : Bytes).sub(pos << bytes.sizeBits, len << bytes.sizeBits); + return a; + } + + public function sort(f:T->T->Int):Void { + if (Type.get((cast null : T)) == Type.get(0)) + (bytes : Bytes).sortI32(0, length, cast f); + else + (bytes : Bytes).sortF64(0, length, cast f); + } + + override function splice(pos:Int, len:Int):ArrayBytes { + if (len < 0) + return new ArrayBytes(); + if (pos < 0) { + pos = this.length + pos; + if (pos < 0) + pos = 0; + } + if (pos > this.length) { + pos = 0; + len = 0; + } else if (pos + len > this.length) { + len = this.length - pos; + if (len < 0) + len = 0; + } + if (len == 0) + return new ArrayBytes(); + var ret = new ArrayBytes(); + ret.bytes = (bytes : Bytes).sub(pos << bytes.sizeBits, len << bytes.sizeBits); + ret.size = ret.length = len; + var end = pos + len; + (bytes : Bytes).blit(pos << bytes.sizeBits, bytes, end << bytes.sizeBits, (length - end) << bytes.sizeBits); + (bytes : Bytes).fill((length - len) << bytes.sizeBits, (len) << bytes.sizeBits, 0); + length -= len; + return ret; + } + + override function toString():String { + var b = new StringBuf(); + b.addChar("[".code); + for (i in 0...length) { + if (i > 0) + b.addChar(",".code); + b.add(bytes[i]); + } + b.addChar("]".code); + return b.toString(); + } + + public function unshift(x:T):Void { + if (length == size) + __expand(length) + else + length++; + (bytes : Bytes).blit(1 << bytes.sizeBits, bytes, 0, (length - 1) << bytes.sizeBits); + bytes[0] = x; + } + + public function insert(pos:Int, x:T):Void { + if (pos < 0) { + pos = length + pos; + if (pos < 0) + pos = 0; + } else if (pos > length) + pos = length; + if (length == size) + __expand(length) + else + length++; + (bytes : Bytes).blit((pos + 1) << bytes.sizeBits, bytes, pos << bytes.sizeBits, (length - pos - 1) << bytes.sizeBits); + bytes[pos] = x; + } + + public function contains(x:T):Bool { + return indexOf(x) != -1; + } + + public function remove(x:T):Bool { + var idx = indexOf(x); + if (idx < 0) + return false; + length--; + (bytes : hl.Bytes).blit(idx << bytes.sizeBits, bytes, (idx + 1) << bytes.sizeBits, (length - idx) << bytes.sizeBits); + return true; + } + + public function indexOf(x:T, ?fromIndex:Int):Int { + var idx:Int = fromIndex == null ? 0 : fromIndex; + if (idx < 0) { + idx += length; + if (idx < 0) + idx = 0; + } + for (i in idx...length) + if (bytes[i] == x) + return i; + return -1; + } + + public function lastIndexOf(x:T, ?fromIndex:Int):Int { + var len = length; + var i:Int = fromIndex != null ? fromIndex : len - 1; + if (i >= len) + i = len - 1; + else if (i < 0) + i += len; + while (i >= 0) { + if (bytes[i] == x) + return i; + i--; + } + return -1; + } + + public function copy():ArrayBytes { + var a = new ArrayBytes(); + a.length = a.size = length; + a.bytes = new Bytes(length << bytes.sizeBits); + (a.bytes : Bytes).blit(0, bytes, 0, length << bytes.sizeBits); + return a; + } + + public function iterator():ArrayIterator { + return new BytesIterator(this); + } + + public function keyValueIterator() : ArrayKeyValueIterator { + return new ArrayKeyValueIterator(cast this); + } + + public function map(f:T->S):ArrayDyn@:privateAccess { + var a = new ArrayObj(); + if (length > 0) + a.__expand(length - 1); + for (i in 0...length) + a.array[i] = f(bytes[i]); + return ArrayDyn.alloc(a, true); + } + + public function filter(f:T->Bool):ArrayBytes { + var a = new ArrayBytes(); + for (i in 0...length) { + var v = bytes[i]; + if (f(v)) + a.push(v); + } + return a; + } + + override public function resize(len:Int):Void { + if (length < len) { + __expand(len - 1); + } else if (length > len) { + (bytes : Bytes).fill(len << bytes.sizeBits, (length - len) << bytes.sizeBits, 0); + this.length = len; + } + } + + override function getDyn(pos:Int):Dynamic { + var pos:UInt = pos; + if (pos >= length) + return bytes.nullValue; + return bytes[pos]; + } + + override function setDyn(pos:Int, v:Dynamic) { + var pos:UInt = pos; + if (pos >= length) + __expand(pos); + bytes[pos] = v; + } + + override function pushDyn(v:Dynamic) + return push(v); + + override function popDyn():Null + return pop(); + + override function shiftDyn():Null + return shift(); + + override function unshiftDyn(v:Dynamic) + unshift(v); + + override function insertDyn(pos:Int, v:Dynamic) + insert(pos, v); + + override function containsDyn(v:Dynamic) + return contains(v); + + override function removeDyn(v:Dynamic) + return remove(v); + + override function sortDyn(f:Dynamic->Dynamic->Int) + sort(f); + + // called by compiler when accessing the array outside of its bounds, might trigger resize + function __expand(index:Int) { + if (index < 0) + throw "Invalid array index " + index; + var newlen = index + 1; + if (newlen > size) { + var next = (size * 3) >> 1; + if (next < newlen) + next = newlen; + var bytes2 = new hl.Bytes(next << bytes.sizeBits); + var bsize = length << bytes.sizeBits; + bytes2.blit(0, bytes, 0, bsize); + bytes2.fill(bsize, (next << bytes.sizeBits) - bsize, 0); + bytes = bytes2; + size = next; + } + length = newlen; + } +} + +typedef ArrayI32 = ArrayBytes; +typedef ArrayUI16 = ArrayBytes; +typedef ArrayF32 = ArrayBytes; +typedef ArrayF64 = ArrayBytes; diff --git a/build/linux64_569e52e/std/hl/types/ArrayDyn.hx b/build/linux64_569e52e/std/hl/types/ArrayDyn.hx new file mode 100644 index 0000000..e044d84 --- /dev/null +++ b/build/linux64_569e52e/std/hl/types/ArrayDyn.hx @@ -0,0 +1,244 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl.types; + +import hl.types.ArrayBase; +import haxe.iterators.ArrayIterator; +import haxe.iterators.ArrayKeyValueIterator; + +class ArrayDynIterator extends ArrayIterator { + var a:ArrayBase; + + public function new(a) { + super((null:Dynamic)); + this.a = a; + } + + override public function hasNext() { + return current < a.length; + } + + override public function next() { + return a.getDyn(current++); + } +} + +@:keep +class ArrayDyn extends ArrayAccess { + public var length(get, never):Int; + + var array:ArrayBase; + var allowReinterpret:Bool; + + public function new() { + array = new ArrayObj(); + allowReinterpret = true; + } + + inline function get_length() + return array.length; + + override function getDyn(i) { + return array.getDyn(i); + } + + override function setDyn(pos:Int, value:Dynamic) { + array.setDyn(pos, value); + } + + override function blit(pos:Int, src:ArrayAccess, srcpos:Int, len:Int):Void { + array.blit(pos, src, srcpos, len); + } + + public function concat(a:ArrayDyn):ArrayDyn { + var a1 = array; + var a2 = a.array; + var alen = a1.length; + var anew = new NativeArray(alen + a2.length); + for (i in 0...alen) + anew[i] = a1.getDyn(i); + for (i in 0...a2.length) + anew[i + alen] = a2.getDyn(i); + return alloc(ArrayObj.alloc(anew), true); + } + + public function join(sep:String):String { + return array.join(sep); + } + + public function pop():Null { + return array.popDyn(); + } + + public function push(x:Dynamic):Int { + return array.pushDyn(x); + } + + public function reverse():Void { + array.reverse(); + } + + public function resize(len:Int) { + array.resize(len); + } + + public function shift():Null { + return array.shiftDyn(); + } + + public function slice(pos:Int, ?end:Int):ArrayDyn { + return alloc(array.slice(pos, end), true); + } + + public function sort(f:Dynamic->Dynamic->Int):Void { + array.sortDyn(f); + } + + public function splice(pos:Int, len:Int):ArrayDyn { + return alloc(array.splice(pos, len), true); + } + + public function toString():String { + return array.toString(); + } + + public function unshift(x:Dynamic):Void { + array.unshiftDyn(x); + } + + public function insert(pos:Int, x:Dynamic):Void { + array.insertDyn(pos, x); + } + + public function contains(x:Dynamic):Bool { + return array.containsDyn(x); + } + + public function remove(x:Dynamic):Bool { + return array.removeDyn(x); + } + + public function indexOf(x:Dynamic, ?fromIndex:Int):Int { + var i:Int = fromIndex; + var length = length; + var array = array; + while (i < length) { + if (array.getDyn(i) == x) + return i; + i++; + } + return -1; + } + + public function lastIndexOf(x:Dynamic, ?fromIndex:Int):Int { + var len = length; + var i:Int = fromIndex != null ? fromIndex : len - 1; + if (i >= len) + i = len - 1; + else if (i < 0) + i += len; + while (i >= 0) { + if (array.getDyn(i) == x) + return i; + i--; + } + return -1; + } + + public function copy():ArrayDyn { + var a = new NativeArray(length); + for (i in 0...length) + a[i] = array.getDyn(i); + return alloc(ArrayObj.alloc(a), true); + } + + public function iterator():ArrayIterator { + return new ArrayDynIterator(array); + } + + public function keyValueIterator() : ArrayKeyValueIterator { + return new ArrayKeyValueIterator(cast array); + } + + public function map(f:Dynamic->Dynamic):ArrayDyn { + var a = new NativeArray(length); + for (i in 0...length) + a[i] = f(array.getDyn(i)); + return alloc(ArrayObj.alloc(a), true); + } + + public function filter(f:Dynamic->Bool):ArrayDyn { + var a = new ArrayObj(); + for (i in 0...length) { + var v = array.getDyn(i); + if (f(v)) + a.push(v); + } + return alloc(a, true); + } + + function __get_field(fid:Int):Dynamic { + if (fid == untyped $hash("length")) + return length; + return null; + } + + function __cast(t:Type):Dynamic { + if (t == Type.getDynamic(array)) + return array; + if (!allowReinterpret) + return null; + if (t == Type.get((null : ArrayBytes.ArrayI32))) { + var a:BytesAccess = null; + a = new Bytes(array.length << a.sizeBits); + for (i in 0...array.length) + a[i] = array.getDyn(i); + var arr = ArrayBase.allocI32(a, array.length); + array = arr; + allowReinterpret = false; + return arr; + } + if (t == Type.get((null : ArrayBytes.ArrayF64))) { + var a:BytesAccess = null; + a = new Bytes(array.length << a.sizeBits); + for (i in 0...array.length) + a[i] = array.getDyn(i); + var arr = ArrayBase.allocF64(a, array.length); + array = arr; + allowReinterpret = false; + return arr; + } + return null; + } + + @:keep function __compare(a:Dynamic):Int { + return a == array ? 0 : hl.Api.comparePointer(this, a); + } + + public static function alloc(a:ArrayBase, allowReinterpret = false):ArrayDyn { + var arr:ArrayDyn = untyped $new(ArrayDyn); + arr.array = a; + arr.allowReinterpret = allowReinterpret; + return arr; + } +} diff --git a/build/linux64_569e52e/std/hl/types/ArrayObj.hx b/build/linux64_569e52e/std/hl/types/ArrayObj.hx new file mode 100644 index 0000000..decffe8 --- /dev/null +++ b/build/linux64_569e52e/std/hl/types/ArrayObj.hx @@ -0,0 +1,370 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl.types; + +import haxe.iterators.ArrayIterator; +import haxe.iterators.ArrayKeyValueIterator; + +class ArrayObjIterator extends ArrayIterator { + var arr:ArrayObj; + + public inline function new(arr:ArrayObj) { + super((null:Dynamic)); + this.arr = arr; + } + + override public function hasNext():Bool { + return current < arr.length; + } + + override public function next():T { + return @:privateAccess arr.array[current++]; + } +} + +@:keep +class ArrayObj extends ArrayBase { + var array:hl.NativeArray; + + public function new() { + length = 0; + array = new NativeArray(0); + } + + public function concat(a:ArrayObj):ArrayObj { + var arr = new hl.NativeArray(length + a.length); + arr.blit(0, array, 0, length); + arr.blit(length, a.array, 0, a.length); + return alloc(cast arr); + } + + override function join(sep:String):String { + var b = new StringBuf(); + for (i in 0...length) { + if (i > 0) + b.add(sep); + b.add(array[i]); + } + return b.toString(); + } + + override function isArrayObj() { + return true; + } + + public function pop():Null { + if (length == 0) + return null; + length--; + var v = array[length]; + array[length] = null; + return v; + } + + public function push(x:T):Int { + var len = length; + if (array.length == len) + __expand(len); + else + length++; + array[len] = x; + return length; + } + + override function reverse():Void { + for (i in 0...length >> 1) { + var k = length - 1 - i; + var tmp = array[i]; + array[i] = array[k]; + array[k] = tmp; + } + } + + public function shift():Null { + if (length == 0) + return null; + length--; + var v = array[0]; + array.blit(0, array, 1, length); + array[length] = null; + return v; + } + + override function slice(pos:Int, ?end:Int):ArrayObj { + if (pos < 0) { + pos = this.length + pos; + if (pos < 0) + pos = 0; + } + var pend:Int; + if (end == null) + pend = this.length; + else { + pend = end; + if (pend < 0) + pend += this.length; + if (pend > this.length) + pend = this.length; + } + var len = pend - pos; + if (len < 0) + return new ArrayObj(); + return alloc(array.sub(pos, len)); + } + + public function sort(f:T->T->Int):Void { + // TODO : use native call ? + haxe.ds.ArraySort.sort(cast this, f); + } + + override function splice(pos:Int, len:Int):ArrayObj { + if (len < 0) + return new ArrayObj(); + if (pos < 0) { + pos = this.length + pos; + if (pos < 0) + pos = 0; + } + if (pos > this.length) { + pos = 0; + len = 0; + } else if (pos + len > this.length) { + len = this.length - pos; + if (len < 0) + len = 0; + } + var a = this.array; + var ret:ArrayObj = alloc(cast a.sub(pos, len)); + var end = pos + len; + a.blit(pos, a, end, this.length - end); + this.length -= len; + while (--len >= 0) + a[this.length + len] = null; + return ret; + } + + @:access(Std.toStringDepth) + override function toString():String { + if (Std.toStringDepth >= 5) + return "..."; + Std.toStringDepth++; + var b = new StringBuf(); + b.addChar("[".code); + try { + for (i in 0...length) { + if (i > 0) + b.addChar(",".code); + b.add(array[i]); + } + } catch (e:Dynamic) { + Std.toStringDepth--; + hl.Api.rethrow(e); + } + b.addChar("]".code); + Std.toStringDepth--; + return b.toString(); + } + + public function unshift(x:T):Void { + if (length == array.length) + __expand(length) + else + length++; + array.blit(1, array, 0, length - 1); + array[0] = x; + } + + public function insert(pos:Int, x:T):Void { + if (pos < 0) { + pos = length + pos; + if (pos < 0) + pos = 0; + } else if (pos > length) + pos = length; + if (length == array.length) + __expand(length) + else + length++; + array.blit(pos + 1, array, pos, length - pos - 1); + array[pos] = x; + } + + public function contains(x:T):Bool { + return indexOf(x) != -1; + } + + public function remove(x:T):Bool { + var i = indexOf(x); + if (i < 0) + return false; + length--; + array.blit(i, array, i + 1, length - i); + array[length] = null; + return true; + } + + public function indexOf(x:T, ?fromIndex:Int):Int { + var i:Int = fromIndex; + if (i < 0) { + i += length; + if (i < 0) + i = 0; + } + var length = length; + var array = array; + while (i < length) { + if (array[i] == x) + return i; + i++; + } + return -1; + } + + override function blit(pos:Int, src:ArrayBase.ArrayAccess, srcpos:Int, len:Int):Void { + var src = (cast src : ArrayObj); + if (pos < 0 || srcpos < 0 || len < 0 || pos + len > length || srcpos + len > src.length) + throw haxe.io.Error.OutsideBounds; + array.blit(pos, src.array, srcpos, len); + } + + public function lastIndexOf(x:T, ?fromIndex:Int):Int { + var len = length; + var i:Int = fromIndex != null ? fromIndex : len - 1; + if (i >= len) + i = len - 1; + else if (i < 0) + i += len; + while (i >= 0) { + if (array[i] == x) + return i; + i--; + } + return -1; + } + + public function copy():ArrayObj { + var n = new NativeArray(length); + n.blit(0, array, 0, length); + return alloc(n); + } + + public function iterator():ArrayIterator { + return new ArrayObjIterator(this); + } + + public function keyValueIterator():ArrayKeyValueIterator { + return new ArrayKeyValueIterator(cast this); + } + + public function map(f:T->S):ArrayDyn { + var a = new ArrayObj(); + if (length > 0) + a.__expand(length - 1); + for (i in 0...length) + a.array[i] = f(array[i]); + return ArrayDyn.alloc(a, true); + } + + public function filter(f:T->Bool):ArrayObj { + var a = new ArrayObj(); + for (i in 0...length) { + var v = array[i]; + if (f(v)) + a.push(v); + } + return a; + } + + override public function resize(len:Int):Void { + if (length < len) { + __expand(len - 1); + } else if (length > len) { + for (i in len...length) { + array[i] = null; + } + this.length = len; + } + } + + // called by compiler when accessing the array outside of its bounds, might trigger resize + function __expand(index:Int) { + if (index < 0) + throw "Invalid array index " + index; + var newlen = index + 1; + var size:Int = array.length; + if (newlen > size) { + var next = (size * 3) >> 1; + if (next < newlen) + next = newlen; + var arr2 = new hl.NativeArray(next); + arr2.blit(0, array, 0, length); + array = arr2; + } + length = newlen; + } + + override function getDyn(pos:Int):Dynamic { + var pos:UInt = pos; + if (pos >= length) + return null; + return array[pos]; + } + + override function setDyn(pos:Int, v:Dynamic) { + var pos:UInt = pos; + if (pos >= length) + __expand(pos); + array[pos] = Api.safeCast(v, array.getType()); + } + + override function pushDyn(v:Dynamic) + return push(v); + + override function popDyn():Null + return pop(); + + override function shiftDyn():Null + return shift(); + + override function unshiftDyn(v:Dynamic) + unshift(v); + + override function insertDyn(pos:Int, v:Dynamic) + insert(pos, v); + + override function containsDyn(v:Dynamic) + return contains(v); + + override function removeDyn(v:Dynamic) + return remove(v); + + override function sortDyn(f:Dynamic->Dynamic->Int) + sort(f); + + public static function alloc(a:hl.NativeArray):ArrayObj { + var arr:ArrayObj = untyped $new(ArrayObj); + arr.array = a; + arr.length = a.length; + return arr; + } +} diff --git a/build/linux64_569e52e/std/hl/types/BytesMap.hx b/build/linux64_569e52e/std/hl/types/BytesMap.hx new file mode 100644 index 0000000..4aceff7 --- /dev/null +++ b/build/linux64_569e52e/std/hl/types/BytesMap.hx @@ -0,0 +1,72 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl.types; + +typedef BytesMapData = Abstract<"hl_bytes_map">; + +abstract BytesMap(BytesMapData) { + extern public inline function new() { + this = alloc(); + } + + @:hlNative("std", "hballoc") static function alloc():BytesMapData { + return null; + } + + @:hlNative("std", "hbset") + public function set(key:Bytes, value:Dynamic) {} + + @:hlNative("std", "hbexists") + public function exists(key:Bytes):Bool { + return false; + } + + @:hlNative("std", "hbget") + public function get(key:Bytes):Dynamic { + return null; + } + + @:hlNative("std", "hbremove") + public function remove(key:Bytes):Bool { + return false; + } + + @:hlNative("std", "hbkeys") + public function keysArray():NativeArray { + return null; + } + + @:hlNative("std", "hbvalues") + public function valuesArray():NativeArray { + return null; + } + + #if (hl_ver >= version("1.11.0")) + @:hlNative("std", "hbclear") + public function clear():Void {} + #end + + extern public inline function iterator() { + return new NativeArray.NativeArrayIterator(valuesArray()); + } +} diff --git a/build/linux64_569e52e/std/hl/types/Int64Map.hx b/build/linux64_569e52e/std/hl/types/Int64Map.hx new file mode 100644 index 0000000..fcf711b --- /dev/null +++ b/build/linux64_569e52e/std/hl/types/Int64Map.hx @@ -0,0 +1,74 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl.types; + +#if (hl_ver >= version("1.13.0") && !hl_legacy32) + +typedef Int64MapData = Abstract<"hl_int64_map">; + +abstract Int64Map(Int64MapData) { + extern public inline function new() { + this = alloc(); + } + + @:hlNative("std", "hi64alloc") static function alloc():Int64MapData { + return null; + } + + @:hlNative("std", "hi64set") + public function set(key:haxe.Int64, value:Dynamic) {} + + @:hlNative("std", "hi64exists") + public function exists(key:haxe.Int64):Bool { + return false; + } + + @:hlNative("std", "hi64get") + public function get(key:haxe.Int64):Dynamic { + return null; + } + + @:hlNative("std", "hi64remove") + public function remove(key:haxe.Int64):Bool { + return false; + } + + @:hlNative("std", "hi64keys") + public function keysArray():NativeArray { + return null; + } + + @:hlNative("std", "hi64values") + public function valuesArray():NativeArray { + return null; + } + + @:hlNative("std", "hi64clear") + public function clear():Void {} + + extern public inline function iterator() { + return new NativeArray.NativeArrayIterator(valuesArray()); + } +} + +#end diff --git a/build/linux64_569e52e/std/hl/types/IntMap.hx b/build/linux64_569e52e/std/hl/types/IntMap.hx new file mode 100644 index 0000000..e60fd4b --- /dev/null +++ b/build/linux64_569e52e/std/hl/types/IntMap.hx @@ -0,0 +1,72 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl.types; + +typedef IntMapData = Abstract<"hl_int_map">; + +abstract IntMap(IntMapData) { + extern public inline function new() { + this = alloc(); + } + + @:hlNative("std", "hialloc") static function alloc():IntMapData { + return null; + } + + @:hlNative("std", "hiset") + public function set(key:Int, value:Dynamic) {} + + @:hlNative("std", "hiexists") + public function exists(key:Int):Bool { + return false; + } + + @:hlNative("std", "higet") + public function get(key:Int):Dynamic { + return null; + } + + @:hlNative("std", "hiremove") + public function remove(key:Int):Bool { + return false; + } + + @:hlNative("std", "hikeys") + public function keysArray():NativeArray { + return null; + } + + @:hlNative("std", "hivalues") + public function valuesArray():NativeArray { + return null; + } + + #if (hl_ver >= version("1.11.0")) + @:hlNative("std", "hiclear") + public function clear():Void {} + #end + + extern public inline function iterator() { + return new NativeArray.NativeArrayIterator(valuesArray()); + } +} diff --git a/build/linux64_569e52e/std/hl/types/ObjectMap.hx b/build/linux64_569e52e/std/hl/types/ObjectMap.hx new file mode 100644 index 0000000..038ea08 --- /dev/null +++ b/build/linux64_569e52e/std/hl/types/ObjectMap.hx @@ -0,0 +1,72 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl.types; + +typedef ObjectMapData = Abstract<"hl_obj_map">; + +abstract ObjectMap(ObjectMapData) { + extern public inline function new() { + this = alloc(); + } + + @:hlNative("std", "hoalloc") static function alloc():ObjectMapData { + return null; + } + + @:hlNative("std", "hoset") + public function set(key:Dynamic, value:Dynamic) {} + + @:hlNative("std", "hoexists") + public function exists(key:Dynamic):Bool { + return false; + } + + @:hlNative("std", "hoget") + public function get(key:Dynamic):Dynamic { + return null; + } + + @:hlNative("std", "horemove") + public function remove(key:Dynamic):Bool { + return false; + } + + @:hlNative("std", "hokeys") + public function keysArray():NativeArray { + return null; + } + + @:hlNative("std", "hovalues") + public function valuesArray():NativeArray { + return null; + } + + #if (hl_ver >= version("1.11.0")) + @:hlNative("std", "hoclear") + public function clear():Void {} + #end + + extern public inline function iterator() { + return new NativeArray.NativeArrayIterator(valuesArray()); + } +} diff --git a/build/linux64_569e52e/std/hl/uv/Fs.hx b/build/linux64_569e52e/std/hl/uv/Fs.hx new file mode 100644 index 0000000..991da05 --- /dev/null +++ b/build/linux64_569e52e/std/hl/uv/Fs.hx @@ -0,0 +1,51 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + + package hl.uv; + + enum abstract Event(Int) { + var Rename = 1; + var Change = 2; +} + +@:hlNative("uv") +class Fs extends Handle { + public function new(?loop : Loop, path : String, onContentChanged : Event -> Void) { + if(loop == null) + loop = Loop.getDefault(); + super(fs_start_wrap(loop, (e) -> onContentChanged(cast(e, Event)), @:privateAccess path.toUtf8())); + } + + public function stop() { + if(handle == null) + return; + fs_stop_wrap(handle); + } + + static function fs_start_wrap(loop:Loop, cb : Int -> Void, path : hl.Bytes) : HandleData { + return null; + } + + static function fs_stop_wrap(handle:HandleData) : Bool { + return false; + } +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/hl/uv/Handle.hx b/build/linux64_569e52e/std/hl/uv/Handle.hx new file mode 100644 index 0000000..0d1d307 --- /dev/null +++ b/build/linux64_569e52e/std/hl/uv/Handle.hx @@ -0,0 +1,40 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl.uv; + +@:hlNative("uv") +class Handle { + public var handle:HandleData; + + function new(h) { + handle = h; + } + + public function close(?callb) { + if (handle != null) + close_handle(handle, callb); + handle = null; + } + + static function close_handle(h:HandleData, callb:Void->Void):Void {} +} diff --git a/build/linux64_569e52e/std/hl/uv/HandleData.hx b/build/linux64_569e52e/std/hl/uv/HandleData.hx new file mode 100644 index 0000000..020970f --- /dev/null +++ b/build/linux64_569e52e/std/hl/uv/HandleData.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl.uv; + +typedef HandleData = hl.Abstract<"uv_handle">; diff --git a/build/linux64_569e52e/std/hl/uv/Loop.hx b/build/linux64_569e52e/std/hl/uv/Loop.hx new file mode 100644 index 0000000..4276c33 --- /dev/null +++ b/build/linux64_569e52e/std/hl/uv/Loop.hx @@ -0,0 +1,64 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl.uv; + +enum abstract LoopRunMode(Int) { + var Default = 0; + var Once = 1; + var NoWait = 2; +} + +abstract Loop(hl.Abstract<"uv_loop">) { + @:hlNative("uv", "loop_close") public function close():Int { + return 0; + } + + @:hlNative("uv", "run") public function run(mode:LoopRunMode):Int { + return 0; + } + + @:hlNative("uv", "loop_alive") public function alive():Int { + return 0; + } + + @:hlNative("uv", "stop") public function stop():Void {} + + public static function getDefault():Loop { + var def = default_loop(); + if (loopEvent == null) + loopEvent = haxe.MainLoop.add(function() { + // if no more things to process, stop + if (def.run(NoWait) == 0) { + loopEvent.stop(); + loopEvent = null; + } + }); + return def; + } + + @:hlNative("uv", "default_loop") static function default_loop():Loop { + return null; + } + + static var loopEvent:haxe.MainLoop.MainEvent; +} diff --git a/build/linux64_569e52e/std/hl/uv/Stream.hx b/build/linux64_569e52e/std/hl/uv/Stream.hx new file mode 100644 index 0000000..5a96fd0 --- /dev/null +++ b/build/linux64_569e52e/std/hl/uv/Stream.hx @@ -0,0 +1,70 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl.uv; + +@:hlNative("uv") +class Stream extends Handle { + public function write(bytes:haxe.io.Bytes, ?onWrite:Bool->Void, pos = 0, len = -1) { + if (len < 0) + len = bytes.length - pos; + if (pos < 0 || len < 0 || pos + len > bytes.length) + throw haxe.io.Error.OutsideBounds; + if (handle == null || !stream_write(handle, (bytes : hl.Bytes).offset(pos), len, onWrite)) + throw new haxe.io.Eof(); + } + + public function readStartRaw(onData:hl.Bytes->Int->Void) { + if (handle == null || !stream_read_start(handle, onData)) + throw new haxe.io.Eof(); + } + + public function readStart(onData:haxe.io.Bytes->Void) { + readStartRaw(function(b, len) onData(if (len < 0) null else b.toBytes(len))); + } + + public function readStop() { + if (handle != null) + stream_read_stop(handle); + } + + public function listen(n:Int, onConnect:Void->Void) { + if (handle == null || !stream_listen(handle, n, onConnect)) + throw new haxe.io.Eof(); + } + + // -- + + static function stream_write(handle:HandleData, bytes:hl.Bytes, len:Int, callb:Bool->Void):Bool { + return false; + } + + static function stream_read_start(handle:HandleData, callb:hl.Bytes->Int->Void) { + return false; + } + + static function stream_read_stop(handle:HandleData) {} + + static function stream_listen(handle:HandleData, n:Int, callb:Void->Void) { + return false; + } +} diff --git a/build/linux64_569e52e/std/hl/uv/Tcp.hx b/build/linux64_569e52e/std/hl/uv/Tcp.hx new file mode 100644 index 0000000..34ba038 --- /dev/null +++ b/build/linux64_569e52e/std/hl/uv/Tcp.hx @@ -0,0 +1,72 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package hl.uv; + +@:hlNative("uv") +class Tcp extends Stream { + public function new(?loop:Loop) { + if (loop == null) + loop = Loop.getDefault(); + super(tcp_init_wrap(loop)); + } + + public function connect(host:sys.net.Host, port:Int, onConnected:Bool->Void) { + var h = tcp_connect_wrap(handle, host.ip, port, onConnected); + if (h == null) + throw haxe.io.Error.Custom("Failed to connect to " + host + ":" + port); + } + + public function bind(host:sys.net.Host, port:Int) { + if (!tcp_bind_wrap(handle, host.ip, port)) + throw haxe.io.Error.Custom("Failed to bind socket to " + host + ":" + port); + } + + public function accept() { + var client = handle == null ? null : tcp_accept_wrap(handle); + if (client == null) + throw new haxe.io.Eof(); + return new Stream(client); + } + + public function noDelay(b:Bool) { + tcp_nodelay_wrap(handle, b); + } + + static function tcp_init_wrap(loop:Loop):HandleData { + return null; + } + + static function tcp_connect_wrap(h:HandleData, host:Int, port:Int, onConnected:Bool->Void):HandleData { + return null; + } + + static function tcp_bind_wrap(h:HandleData, host:Int, port:Int):Bool { + return false; + } + + static function tcp_accept_wrap(h:HandleData):HandleData { + return null; + } + + static function tcp_nodelay_wrap(h:HandleData, b:Bool):Void {} +} diff --git a/build/linux64_569e52e/std/java/Boot.hx b/build/linux64_569e52e/std/java/Boot.hx new file mode 100644 index 0000000..72e64d0 --- /dev/null +++ b/build/linux64_569e52e/std/java/Boot.hx @@ -0,0 +1,44 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java; + +import java.Lib; +import java.Init; +import java.StdTypes; +import Reflect; +import Map; +import haxe.ds.StringMap; +import java.lang.Boolean; +import java.lang.Character; +import java.lang.Class; +import java.lang.Number; +import java.lang.Byte; +import java.lang.Double; +import java.lang.Float; +import java.lang.Integer; +import java.lang.Long; +import java.lang.Short; +import java.lang.Throwable; + +@:dox(hide) +extern class Boot {} diff --git a/build/linux64_569e52e/std/java/Init.hx b/build/linux64_569e52e/std/java/Init.hx new file mode 100644 index 0000000..f54f49a --- /dev/null +++ b/build/linux64_569e52e/std/java/Init.hx @@ -0,0 +1,33 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +package java; + +@:native("haxe.java.Init") @:keep class Init { + public static function init():Void { + #if std_encoding_utf8 + try { + java.lang.System.setOut(new java.io.PrintStream(java.lang.System.out, true, "utf-8")); + java.lang.System.setErr(new java.io.PrintStream(java.lang.System.err, true, "utf-8")); + } catch (e:java.io.UnsupportedEncodingException) {} + #end + } +} diff --git a/build/linux64_569e52e/std/java/Lib.hx b/build/linux64_569e52e/std/java/Lib.hx new file mode 100644 index 0000000..88e7e2b --- /dev/null +++ b/build/linux64_569e52e/std/java/Lib.hx @@ -0,0 +1,163 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java; + +/** + Platform-specific Java Library. Provides some platform-specific functions for the Java target, + such as conversion from Haxe types to native types and vice-versa. +**/ +// we cannot use the java package for custom classes, so we're redefining it as "haxe.java.Lib" +@:native('haxe.java.Lib') class Lib { + /** + Print the specified value on the default output. + **/ + inline public static function print(v:Dynamic):Void { + Sys.print(v); + } + + /** + Print the specified value on the default output followed by a newline character. + **/ + inline public static function println(v:Dynamic):Void { + Sys.println(v); + } + + /** + Returns a native array from the supplied Array. This native array is unsafe to be written on, + as it may or may not be linked to the actual Array implementation. + + If `equalLengthRequired` is true, the result might be a copy of an array with the correct size. + **/ + inline public static function nativeArray(arr:Array, equalLengthRequired:Bool):NativeArray { + var ret = new NativeArray(arr.length); + for (i in 0...arr.length) { + ret[i] = arr[i]; + } + return ret; + } + + /** + Gets the native `java.lang.Class` from the supplied object. Will throw an exception in case of null being passed. + [deprecated] - use `getNativeType` instead + **/ + @:deprecated('The function `nativeType` is deprecated and will be removed in later versions. Please use `getNativeType` instead') + inline public static function nativeType(obj:T):java.lang.Class { + return untyped obj.getClass(); + } + + /** + Gets the native `java.lang.Class` from the supplied object. Will throw an exception in case of null being passed. + **/ + inline public static function getNativeType(obj:T):java.lang.Class { + return untyped obj.getClass(); + } + + /** + Returns a Class<> equivalent to the native java.lang.Class type. + **/ + public static inline function fromNativeType(t:java.lang.Class):Class { + return untyped t; + } + + /** + Returns a java.lang.Class equivalent to the Haxe Class<> type. + **/ + public static inline function toNativeType(cl:Class):java.lang.Class { + return untyped cl; + } + + /** + Returns a java.lang.Class equivalent to the Haxe Enum<> type. + **/ + public static inline function toNativeEnum(cl:Enum):java.lang.Class { + return untyped cl; + } + + /** + Returns a Haxe Array of a native Array. + Unless `copy` is true, it won't copy the contents of the native array, + so unless any operation triggers an array resize, all changes made to the Haxe array will affect the native array argument. + **/ + @:generic public static function array(native:java.NativeArray):Array { + return untyped Array.ofNative(native); + } + + extern inline private static function doArray(native:java.NativeArray):Array { + var ret:NativeArray = new NativeArray(native.length); + for (i in 0...native.length) { + ret[i] = native[i]; + } + return untyped Array.ofNative(ret); + } + + public static function array_Int(native:java.NativeArray):Array { + return doArray(native); + } + + public static function array_Float(native:java.NativeArray):Array { + return doArray(native); + } + + public static function array_Bool(native:java.NativeArray):Array { + return doArray(native); + } + + public static function array_java_Int8(native:java.NativeArray):Array { + return doArray(native); + } + + public static function array_java_Int16(native:java.NativeArray):Array { + return doArray(native); + } + + public static function array_java_Char16(native:java.NativeArray):Array { + return doArray(native); + } + + public static function array_Single(native:java.NativeArray):Array { + return doArray(native); + } + + public static function array_haxe_Int64(native:java.NativeArray):Array { + return doArray(native); + } + + /** + Allocates a new Haxe Array with a predetermined size + **/ + public static function arrayAlloc(size:Int):Array { + return untyped Array.alloc(size); + } + + /** + Ensures that one thread does not enter a critical section of code while another thread + is in the critical section. If another thread attempts to enter a locked code, it + will wait, block, until the object is released. + This is the equivalent to "synchronized" in java code. + + This method only exists at compile-time, so it can't be called via reflection. + **/ + extern public static inline function lock(obj:Dynamic, block:T):Void { + untyped __lock__(obj, block); + } +} diff --git a/build/linux64_569e52e/std/java/NativeArray.hx b/build/linux64_569e52e/std/java/NativeArray.hx new file mode 100644 index 0000000..685da74 --- /dev/null +++ b/build/linux64_569e52e/std/java/NativeArray.hx @@ -0,0 +1,50 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java; + +import haxe.extern.Rest; + +/** + Represents a java fixed-size Array (`T[]`) +**/ +@:nativeGen extern class NativeArray implements ArrayAccess { + /** + Creates a new array with the specified elements. + + Usage: + ```haxe + var elements = NativeArray.make(1,2,3,4,5,6); + ``` + **/ + static function make(elements:Rest):NativeArray; + + /** + The length of the array + **/ + var length(default, null):Int; + + /** + Allocates a new array with size `len` + **/ + function new(len:Int):Void; +} diff --git a/build/linux64_569e52e/std/java/NativeString.hx b/build/linux64_569e52e/std/java/NativeString.hx new file mode 100644 index 0000000..3cf50a5 --- /dev/null +++ b/build/linux64_569e52e/std/java/NativeString.hx @@ -0,0 +1,99 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java; + +import haxe.Int64; +import haxe.extern.Rest; +import java.StdTypes.Int8; +import java.StdTypes.Char16; +import java.lang.CharSequence; +import java.util.Locale; + +@:native("java.lang.String") +extern class NativeString { + function charAt(index:Int):Char16; + function codePointAt(index:Int):Int; + function codePointBefore(index:Int):Int; + function codePointCount(beginIndex:Int, endIndex:Int):Int; + function compareTo(anotherString:String):Int; + function compareToIgnoreCase(str:String):Int; + function concat(str:String):String; + function contains(s:CharSequence):Bool; + @:overload function contentEquals(cs:CharSequence):Bool; + @:overload function contentEquals(sb:java.lang.StringBuffer):Bool; + @:overload static function copyValueOf(data:NativeArray):String; + @:overload static function copyValueOf(data:NativeArray, offset:Int, count:Int):String; + function endsWith(suffix:String):Bool; + function equals(anObject:Dynamic):Bool; + function equalsIgnoreCase(anotherString:String):Bool; + @:overload static function format(l:Locale, format:String, args:Rest):String; + @:overload static function format(format:String, args:Rest):String; + @:overload function getBytes():NativeArray; + @:overload function getBytes(charset:java.nio.charset.Charset):NativeArray; + @:deprecated @:overload function getBytes(srcBegin:Int, srcEnd:Int, dst:NativeArray, dstBegin:Int):Void; + @:overload function getBytes(charsetName:String):NativeArray; + function getChars(srcBegin:Int, srcEnd:Int, dst:NativeArray, dstBegin:Int):Void; + function hashCode():Int; + @:overload function indexOf(ch:Int):Int; + @:overload function indexOf(ch:Int, fromIndex:Int):Int; + @:overload function indexOf(str:String):Int; + @:overload function indexOf(str:String, fromIndex:Int):Int; + function intern():String; + function isEmpty():Bool; + @:overload function lastIndexOf(ch:Int):Int; + @:overload function lastIndexOf(ch:Int, fromIndex:Int):Int; + @:overload function lastIndexOf(str:String):Int; + @:overload function lastIndexOf(str:String, fromIndex:Int):Int; + function length():Int; + function matches(regex:String):Bool; + function offsetByCodePoints(index:Int, codePointOffset:Int):Int; + @:overload function regionMatches(ignoreCase:Bool, toffset:Int, other:String, ooffset:Int, len:Int):Bool; + @:overload function regionMatches(toffset:Int, other:String, ooffset:Int, len:Int):Bool; + @:overload function replace(oldChar:Char16, newChar:Char16):String; + @:overload function replace(target:CharSequence, replacement:CharSequence):String; + function replaceAll(regex:String, replacement:String):String; + function replaceFirst(regex:String, replacement:String):String; + @:overload function split(regex:String):NativeArray; + @:overload function split(regex:String, limit:Int):NativeArray; + @:overload function startsWith(prefix:String):Bool; + @:overload function startsWith(prefix:String, toffset:Int):Bool; + function subSequence(beginIndex:Int, endIndex:Int):CharSequence; + @:overload function substring(beginIndex:Int):String; + @:overload function substring(beginIndex:Int, endIndex:Int):String; + function toCharArray():NativeArray; + @:overload function toLowerCase():String; + @:overload function toLowerCase(locale:Locale):String; + function toString():String; + @:overload function toUpperCase():String; + @:overload function toUpperCase(locale:Locale):String; + function trim():String; + @:overload static function valueOf(b:Bool):String; + @:overload static function valueOf(c:Char16):String; + @:overload static function valueOf(data:NativeArray):String; + @:overload static function valueOf(data:NativeArray, offset:Int, count:Int):String; + @:overload static function valueOf(d:Float):String; + @:overload static function valueOf(f:String):String; + @:overload static function valueOf(i:Int):String; + @:overload static function valueOf(l:haxe.Int64):String; + @:overload static function valueOf(obj:java.lang.Object):String; +} diff --git a/build/linux64_569e52e/std/java/StdTypes.hx b/build/linux64_569e52e/std/java/StdTypes.hx new file mode 100644 index 0000000..060571b --- /dev/null +++ b/build/linux64_569e52e/std/java/StdTypes.hx @@ -0,0 +1,93 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java; + +@:notNull @:runtimeValue @:coreType extern abstract Int8 from Int {} +@:notNull @:runtimeValue @:coreType extern abstract Int16 from Int {} +@:notNull @:runtimeValue @:coreType extern abstract Char16 from Int {} + +@:notNull @:runtimeValue @:coreType extern abstract Int64 from Int from Float { + @:op(A + B) public static function addI(lhs:Int64, rhs:Int):Int64; + + @:op(A + B) public static function add(lhs:Int64, rhs:Int64):Int64; + + @:op(A * B) public static function mulI(lhs:Int64, rhs:Int):Int64; + + @:op(A * B) public static function mul(lhs:Int64, rhs:Int64):Int64; + + @:op(A % B) public static function modI(lhs:Int64, rhs:Int):Int64; + + @:op(A % B) public static function mod(lhs:Int64, rhs:Int64):Int64; + + @:op(A - B) public static function subI(lhs:Int64, rhs:Int):Int64; + + @:op(A - B) public static function sub(lhs:Int64, rhs:Int64):Int64; + + @:op(A / B) public static function divI(lhs:Int64, rhs:Int):Int64; + + @:op(A / B) public static function div(lhs:Int64, rhs:Int64):Int64; + + @:op(A | B) public static function orI(lhs:Int64, rhs:Int):Int64; + + @:op(A | B) public static function or(lhs:Int64, rhs:Int64):Int64; + + @:op(A ^ B) public static function xorI(lhs:Int64, rhs:Int):Int64; + + @:op(A ^ B) public static function xor(lhs:Int64, rhs:Int64):Int64; + + @:op(A & B) public static function andI(lhs:Int64, rhs:Int):Int64; + + @:op(A & B) public static function and(lhs:Int64, rhs:Int64):Int64; + + @:op(A << B) public static function shlI(lhs:Int64, rhs:Int):Int64; + + @:op(A << B) public static function shl(lhs:Int64, rhs:Int64):Int64; + + @:op(A >> B) public static function shrI(lhs:Int64, rhs:Int):Int64; + + @:op(A >> B) public static function shr(lhs:Int64, rhs:Int64):Int64; + + @:op(A >>> B) public static function ushrI(lhs:Int64, rhs:Int):Int64; + + @:op(A >>> B) public static function ushr(lhs:Int64, rhs:Int64):Int64; + + @:op(A > B) public static function gt(lhs:Int64, rhs:Int64):Bool; + + @:op(A >= B) public static function gte(lhs:Int64, rhs:Int64):Bool; + + @:op(A < B) public static function lt(lhs:Int64, rhs:Int64):Bool; + + @:op(A <= B) public static function lte(lhs:Int64, rhs:Int64):Bool; + + @:op(~A) public static function bneg(t:Int64):Int64; + + @:op(-A) public static function neg(t:Int64):Int64; + + @:op(++A) public static function preIncrement(t:Int64):Int64; + + @:op(A++) public static function postIncrement(t:Int64):Int64; + + @:op(--A) public static function preDecrement(t:Int64):Int64; + + @:op(A--) public static function postDecrement(t:Int64):Int64; +} diff --git a/build/linux64_569e52e/std/java/_std/Array.hx b/build/linux64_569e52e/std/java/_std/Array.hx new file mode 100644 index 0000000..463d55d --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/Array.hx @@ -0,0 +1,502 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +import java.lang.System; +import java.NativeArray; +import haxe.iterators.ArrayKeyValueIterator; + +@:classCode(' + public Array(T[] _native) + { + this.__a = _native; + this.length = _native.length; + } +') +@:coreApi final class Array implements ArrayAccess { + public var length(default, null):Int; + + private var __a:NativeArray; + + @:skipReflection static var __hx_toString_depth = 0; + @:skipReflection static inline final __hx_defaultCapacity = 4; + + @:functionCode(' + return new Array(_native); + ') + private static function ofNative(native:NativeArray):Array { + var a = new Array(); + a.length = native.length; + a.__a = native; + return a; + } + + @:functionCode(' + return new Array((Y[]) ((java.lang.Object)new java.lang.Object[size])); + ') + private static function alloc(size:Int):Array { + var a = new Array(); + a.length = size; + a.__a = new java.NativeArray(size); + return a; + } + + #if jvm + function getNative():NativeArray { + var a = new NativeArray(length); + System.arraycopy(__a, 0, a, 0, length); + return a; + } + #end + + public function new():Void { + this.length = 0; + this.__a = new NativeArray(0); + } + + public function concat(a:Array):Array { + var length = length; + var len = length + a.length; + var retarr = new NativeArray(len); + System.arraycopy(__a, 0, retarr, 0, length); + System.arraycopy(a.__a, 0, retarr, length, a.length); + + return ofNative(retarr); + } + + private function concatNative(a:NativeArray):Void { + var __a = __a; + var length = length; + var len = length + a.length; + if (__a.length >= len) { + System.arraycopy(a, 0, __a, length, length); + } else { + var newarr = new NativeArray(len); + System.arraycopy(__a, 0, newarr, 0, length); + System.arraycopy(a, 0, newarr, length, a.length); + + this.__a = newarr; + } + + this.length = len; + } + + public function join(sep:String):String { + var buf = new StringBuf(); + var i = -1; + + var first = true; + var length = length; + while (++i < length) { + if (first) + first = false; + else + buf.add(sep); + buf.add(__a[i]); + } + + return buf.toString(); + } + + public function pop():Null { + var __a = __a; + var length = length; + if (length > 0) { + var val = __a[--length]; + __a[length] = null; + this.length = length; + + return val; + } else { + return null; + } + } + + public function push(x:T):Int { + var length = length; + if (length >= __a.length) { + var newLen = length == 0 ? __hx_defaultCapacity : (length << 1); + var newarr = new NativeArray(newLen); + System.arraycopy(__a, 0, newarr, 0, __a.length); + + this.__a = newarr; + } + + __a[length] = x; + return ++this.length; + } + + public function reverse():Void { + var i = 0; + var l = this.length; + var a = this.__a; + var half = l >> 1; + l -= 1; + while (i < half) { + var tmp = a[i]; + a[i] = a[l - i]; + a[l - i] = tmp; + i += 1; + } + } + + public function shift():Null { + var l = this.length; + if (l == 0) + return null; + + var a = this.__a; + var x = a[0]; + l -= 1; + System.arraycopy(a, 1, a, 0, length - 1); + a[l] = null; + this.length = l; + + return x; + } + + public function slice(pos:Int, ?end:Int):Array { + if (pos < 0) { + pos = this.length + pos; + if (pos < 0) + pos = 0; + } + if (end == null) + end = this.length; + else if (end < 0) + end = this.length + end; + if (end > this.length) + end = this.length; + var len = end - pos; + if (len < 0) + return new Array(); + + var newarr = new NativeArray(len); + System.arraycopy(__a, pos, newarr, 0, len); + + return ofNative(newarr); + } + + public function sort(f:T->T->Int):Void { + if (length == 0) + return; + quicksort(0, length - 1, f); + } + + private function quicksort(lo:Int, hi:Int, f:T->T->Int):Void { + var buf = __a; + var i = lo, j = hi; + var p = buf[(i + j) >> 1]; + while (i <= j) { + while (i < hi && f(buf[i], p) < 0) + i++; + while (j > lo && f(buf[j], p) > 0) + j--; + if (i <= j) { + var t = buf[i]; + buf[i++] = buf[j]; + buf[j--] = t; + } + } + + if (lo < j) + quicksort(lo, j, f); + if (i < hi) + quicksort(i, hi, f); + } + + public function splice(pos:Int, len:Int):Array { + if (len < 0) + return new Array(); + if (pos < 0) { + pos = this.length + pos; + if (pos < 0) + pos = 0; + } + if (pos > this.length) { + pos = 0; + len = 0; + } else if (pos + len > this.length) { + len = this.length - pos; + if (len < 0) + len = 0; + } + var a = this.__a; + + var ret = new NativeArray(len); + System.arraycopy(a, pos, ret, 0, len); + var ret = ofNative(ret); + + var end = pos + len; + System.arraycopy(a, end, a, pos, this.length - end); + this.length -= len; + while (--len >= 0) + a[this.length + len] = null; + return ret; + } + + private function spliceVoid(pos:Int, len:Int):Void { + if (len < 0) + return; + if (pos < 0) { + pos = this.length + pos; + if (pos < 0) + pos = 0; + } + if (pos > this.length) { + pos = 0; + len = 0; + } else if (pos + len > this.length) { + len = this.length - pos; + if (len < 0) + len = 0; + } + var a = this.__a; + + var end = pos + len; + System.arraycopy(a, end, a, pos, this.length - end); + this.length -= len; + while (--len >= 0) + a[this.length + len] = null; + } + + public function toString():String { + if (__hx_toString_depth >= 5) { + return "..."; + } + ++__hx_toString_depth; + try { + var s = __hx_toString(); + --__hx_toString_depth; + return s; + } catch (e:Dynamic) { + --__hx_toString_depth; + throw(e); + } + } + + function __hx_toString():String { + var ret = new StringBuf(); + var a = __a; + ret.add("["); + var first = true; + for (i in 0...length) { + if (first) + first = false; + else + ret.add(","); + ret.add(a[i]); + } + + ret.add("]"); + return ret.toString(); + } + + public function unshift(x:T):Void { + var __a = __a; + var length = length; + if (length >= __a.length) { + var newLen = (length << 1) + 1; + var newarr = new NativeArray(newLen); + System.arraycopy(__a, 0, newarr, 1, length); + + this.__a = newarr; + } else { + System.arraycopy(__a, 0, __a, 1, length); + } + + this.__a[0] = x; + ++this.length; + } + + public function insert(pos:Int, x:T):Void { + var l = this.length; + if (pos < 0) { + pos = l + pos; + if (pos < 0) + pos = 0; + } + if (pos >= l) { + this.push(x); + return; + } else if (pos == 0) { + this.unshift(x); + return; + } + + if (l >= __a.length) { + var newLen = (length << 1) + 1; + var newarr = new NativeArray(newLen); + System.arraycopy(__a, 0, newarr, 0, pos); + newarr[pos] = x; + System.arraycopy(__a, pos, newarr, pos + 1, l - pos); + + this.__a = newarr; + ++this.length; + } else { + var __a = __a; + System.arraycopy(__a, pos, __a, pos + 1, l - pos); + System.arraycopy(__a, 0, __a, 0, pos); + __a[pos] = x; + ++this.length; + } + } + + public function remove(x:T):Bool { + var __a = __a; + var i = -1; + var length = length; + while (++i < length) { + if (__a[i] == x) { + System.arraycopy(__a, i + 1, __a, i, length - i - 1); + __a[--this.length] = null; + + return true; + } + } + + return false; + } + + public function contains(x:T):Bool { + var __a = __a; + var i = -1; + var length = length; + while (++i < length) { + if (__a[i] == x) + return true; + } + return false; + } + + public function indexOf(x:T, ?fromIndex:Int):Int { + var len = length, a = __a, i:Int = (fromIndex == null) ? 0 : fromIndex; + if (i < 0) { + i += len; + if (i < 0) + i = 0; + } + while (i < len) { + if (a[i] == x) + return i; + i++; + } + return -1; + } + + public function lastIndexOf(x:T, ?fromIndex:Int):Int { + var len = length, + a = __a, + i:Int = (fromIndex == null) ? len - 1 : fromIndex; + if (i >= len) + i = len - 1; + else if (i < 0) + i += len; + while (i >= 0) { + if (a[i] == x) + return i; + i--; + } + return -1; + } + + public function copy():Array { + var len = length; + var __a = __a; + var newarr = new NativeArray(len); + System.arraycopy(__a, 0, newarr, 0, len); + return ofNative(newarr); + } + + public inline function iterator():haxe.iterators.ArrayIterator { + return new haxe.iterators.ArrayIterator(this); + } + + public inline function keyValueIterator() : ArrayKeyValueIterator { + return new ArrayKeyValueIterator(this); + } + + public function resize(len:Int):Void { + if (length < len) { + if (__a.length < len) { + var newArr = new NativeArray(len); + if (length > 0) + System.arraycopy(__a, 0, newArr, 0, length); + this.__a = __a = newArr; + } + this.length = len; + } else if (length > len) { + spliceVoid(len, length - len); + } + } + + public inline function map(f:T->S):Array { + var ret = alloc(length); + for (i in 0...length) + ret.__set(i, f(__get(i))); + return ret; + } + + public inline function filter(f:T->Bool):Array { + var ret = []; + for (i in 0...length) { + var elt = __get(i); + if (f(elt)) + ret.push(elt); + } + return ret; + } + + private function __get(idx:Int):T { + var __a = __a; + if (idx >= __a.length || idx < 0) + return null; + + return __a[idx]; + } + + private function __set(idx:Int, v:T):#if jvm Void #else T #end + { + var __a = __a; + if (idx >= __a.length) { + var newl = idx + 1; + if (idx == __a.length) + newl = (idx << 1) + 1; + var newArr = new NativeArray(newl); + if (length > 0) + System.arraycopy(__a, 0, newArr, 0, length); + this.__a = __a = newArr; + } + + if (idx >= length) + this.length = idx + 1; + + #if !jvm return #end __a[idx] = v; + } + + private inline function __unsafe_get(idx:Int):T { + return __a[idx]; + } + + private inline function __unsafe_set(idx:Int, val:T):T { + return __a[idx] = val; + } +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/java/_std/Date.hx b/build/linux64_569e52e/std/java/_std/Date.hx new file mode 100644 index 0000000..a1a42cc --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/Date.hx @@ -0,0 +1,147 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package; + +import haxe.Int64; +import java.util.Calendar; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +@:coreApi class Date { + private var date:Calendar; + private var dateUTC:Calendar; + + public function new(year:Int, month:Int, day:Int, hour:Int, min:Int, sec:Int):Void { + date = new GregorianCalendar(year, month, day, hour, min, sec); + dateUTC = new GregorianCalendar(TimeZone.getTimeZone("UTC")); + dateUTC.setTimeInMillis(date.getTimeInMillis()); + } + + public inline function getTime():Float { + return cast date.getTimeInMillis(); + } + + public inline function getHours():Int { + return date.get(Calendar.HOUR_OF_DAY); + } + + public inline function getMinutes():Int { + return date.get(Calendar.MINUTE); + } + + public inline function getSeconds():Int { + return date.get(Calendar.SECOND); + } + + public inline function getFullYear():Int { + return date.get(Calendar.YEAR); + } + + public inline function getMonth():Int { + return date.get(Calendar.MONTH); + } + + public inline function getDate():Int { + return date.get(Calendar.DAY_OF_MONTH); + } + + public inline function getDay():Int { + // SUNDAY in Java == 1, MONDAY == 2, ... + return cast date.get(Calendar.DAY_OF_WEEK) - 1; + } + + public inline function getUTCHours():Int { + return dateUTC.get(Calendar.HOUR_OF_DAY); + } + + public inline function getUTCMinutes():Int { + return dateUTC.get(Calendar.MINUTE); + } + + public inline function getUTCSeconds():Int { + return dateUTC.get(Calendar.SECOND); + } + + public inline function getUTCFullYear():Int { + return dateUTC.get(Calendar.YEAR); + } + + public inline function getUTCMonth():Int { + return dateUTC.get(Calendar.MONTH); + } + + public inline function getUTCDate():Int { + return dateUTC.get(Calendar.DAY_OF_MONTH); + } + + public inline function getUTCDay():Int { + // SUNDAY in Java == 1, MONDAY == 2, ... + return cast dateUTC.get(Calendar.DAY_OF_WEEK) - 1; + } + + public inline function getTimezoneOffset():Int { + return -Std.int(date.get(Calendar.ZONE_OFFSET) / 60000); + } + + public function toString():String { + var m = getMonth() + 1; + var d = getDate(); + var h = getHours(); + var mi = getMinutes(); + var s = getSeconds(); + return getFullYear() + "-" + (if (m < 10) "0" + m else "" + m) + "-" + (if (d < 10) "0" + d else "" + d) + " " + + (if (h < 10) "0" + h else "" + h) + ":" + (if (mi < 10) "0" + mi else "" + mi) + ":" + (if (s < 10) "0" + s else "" + s); + } + + static public function now():Date { + var d = new Date(0, 0, 0, 0, 0, 0); + d.date = Calendar.getInstance(); + d.dateUTC.setTimeInMillis(d.date.getTimeInMillis()); + return d; + } + + static public function fromTime(t:Float):Date { + var d = new Date(0, 0, 0, 0, 0, 0); + d.date.setTimeInMillis(cast t); + d.dateUTC.setTimeInMillis(cast t); + return d; + } + + static public function fromString(s:String):Date { + switch (s.length) { + case 8: // hh:mm:ss + var k = s.split(":"); + return Date.fromTime(Std.parseInt(k[0]) * 3600000. + Std.parseInt(k[1]) * 60000. + Std.parseInt(k[2]) * 1000.); + case 10: // YYYY-MM-DD + var k = s.split("-"); + return new Date(Std.parseInt(k[0]), Std.parseInt(k[1]) - 1, Std.parseInt(k[2]), 0, 0, 0); + case 19: // YYYY-MM-DD hh:mm:ss + var k = s.split(" "); + var y = k[0].split("-"); + var t = k[1].split(":"); + return new Date(Std.parseInt(y[0]), Std.parseInt(y[1]) - 1, Std.parseInt(y[2]), Std.parseInt(t[0]), Std.parseInt(t[1]), Std.parseInt(t[2])); + default: + throw "Invalid date format : " + s; + } + } +} diff --git a/build/linux64_569e52e/std/java/_std/Math.hx b/build/linux64_569e52e/std/java/_std/Math.hx new file mode 100644 index 0000000..4e66627 --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/Math.hx @@ -0,0 +1,55 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +@:coreApi +@:native("java.lang.Math") extern class Math { + static var PI(default, null):Float; + static var NaN(default, null):Float; + static var NEGATIVE_INFINITY(default, null):Float; + static var POSITIVE_INFINITY(default, null):Float; + + static function abs(v:Float):Float; + static function min(a:Float, b:Float):Float; + static function max(a:Float, b:Float):Float; + static function sin(v:Float):Float; + static function cos(v:Float):Float; + static function atan2(y:Float, x:Float):Float; + static function tan(v:Float):Float; + static function exp(v:Float):Float; + static function log(v:Float):Float; + static function sqrt(v:Float):Float; + static function round(v:Float):Int; + static function floor(v:Float):Int; + static function ceil(v:Float):Int; + static function atan(v:Float):Float; + inline static function fround(v:Float):Float { + return ffloor(v + 0.5); + } + static function ffloor(v:Float):Float; + static function fceil(v:Float):Float; + static function asin(v:Float):Float; + static function acos(v:Float):Float; + static function pow(v:Float, exp:Float):Float; + static function random():Float; + + static function isFinite(f:Float):Bool; + static function isNaN(f:Float):Bool; +} diff --git a/build/linux64_569e52e/std/java/_std/Sys.hx b/build/linux64_569e52e/std/java/_std/Sys.hx new file mode 100644 index 0000000..d4f0bb5 --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/Sys.hx @@ -0,0 +1,166 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +import java.lang.System; +import java.net.URI; +import java.nio.file.Paths; +import sys.io.Process; + +using haxe.Int64; + +@:coreApi class Sys { + private static var _args:java.NativeArray; + private static var _env:haxe.ds.StringMap; + private static var _sysName:String; + + public static inline function print(v:Dynamic):Void { + java.lang.System.out.print(v); + } + + public static inline function println(v:Dynamic):Void { + java.lang.System.out.println(v); + } + + public static function args():Array { + if (_args == null) + return []; + return java.Lib.array(_args); + } + + public static function getEnv(s:String):String { + return java.lang.System.getenv(s); + } + + public static function putEnv(s:String, v:Null):Void { + // java offers no support for it (!) + throw new haxe.exceptions.NotImplementedException("Not implemented in this platform"); + } + + public static function environment():Map { + if (_env == null) { + _env = new haxe.ds.StringMap(); + for (mv in java.lang.System.getenv().entrySet()) + _env.set(mv.getKey(), mv.getValue()); + } + + return _env.copy(); + } + + public static function sleep(seconds:Float):Void { + try + java.lang.Thread.sleep(cast seconds * 1000) + catch (e:Dynamic) + throw e; + } + + public static function setTimeLocale(loc:String):Bool { + return false; + } + + public static function getCwd():String { + return new java.io.File(".").getAbsolutePath().substr(0, -1); + } + + public static function setCwd(s:String):Void { + // java offers no support for it (!) + throw new haxe.exceptions.NotImplementedException(); + } + + public static function systemName():String { + if (_sysName != null) + return _sysName; + var sname = System.getProperty("os.name").toLowerCase(); + if (sname.indexOf("win") >= 0) + return _sysName = "Windows"; + if (sname.indexOf("mac") >= 0) + return _sysName = "Mac"; + if (sname.indexOf("nux") >= 0) + return _sysName = "Linux"; + if (sname.indexOf("nix") >= 0) + return _sysName = "BSD"; + + return _sysName = System.getProperty("os.name"); + } + + public static function command(cmd:String, ?args:Array):Int { + var pb = Process.createProcessBuilder(cmd, args); + #if java6 + pb.redirectErrorStream(true); + #else + pb.redirectOutput(java.lang.ProcessBuilder.ProcessBuilder_Redirect.INHERIT); + pb.redirectError(java.lang.ProcessBuilder.ProcessBuilder_Redirect.INHERIT); + #end + var proc = pb.start(); + #if java6 + var reader = new java.io.NativeInput(proc.getInputStream()); + try { + while (true) { + var ln = reader.readLine(); + Sys.println(ln); + } + } catch (e:haxe.io.Eof) {} + #end + proc.waitFor(); + var exitCode = proc.exitValue(); + proc.destroy(); + return exitCode; + } + + public static function exit(code:Int):Void { + System.exit(code); + } + + public static function time():Float { + return cast(System.currentTimeMillis(), Float) / 1000; + } + + public static function cpuTime():Float { + return cast(System.nanoTime(), Float) / 1000000000; + } + + @:deprecated("Use programPath instead") public static function executablePath():String { + return getCwd(); + } + + public static function programPath():String { + final uri:URI = java.Lib.toNativeType(Sys).getProtectionDomain().getCodeSource().getLocation().toURI(); + return Std.string(Paths.get(uri)); + } + + public static function getChar(echo:Bool):Int { + // TODO + return throw new haxe.exceptions.NotImplementedException(); + } + + public static function stdin():haxe.io.Input { + var _in:java.io.InputStream = Reflect.field(System, "in"); + return new java.io.NativeInput(_in); + } + + public static function stdout():haxe.io.Output { + return new java.io.NativeOutput(System.out); + } + + public static function stderr():haxe.io.Output { + return new java.io.NativeOutput(System.err); + } +} diff --git a/build/linux64_569e52e/std/java/_std/haxe/Exception.hx b/build/linux64_569e52e/std/java/_std/haxe/Exception.hx new file mode 100644 index 0000000..d29a25a --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/haxe/Exception.hx @@ -0,0 +1,112 @@ +package haxe; + +import java.NativeArray; +import java.lang.Throwable; +import java.lang.RuntimeException; +import java.lang.StackTraceElement; +import java.io.PrintStream; +import java.io.PrintWriter; + +@:coreApi +class Exception extends NativeException { + public var message(get,never):String; + public var stack(get,never):CallStack; + public var previous(get,never):Null; + public var native(get,never):Any; + + @:noCompletion var __exceptionStack:Null; + @:noCompletion var __nativeException:Throwable; + @:noCompletion var __previousException:Null; + + static function caught(value:Any):Exception { + if(Std.isOfType(value, Exception)) { + return value; + } else if(Std.isOfType(value, Throwable)) { + return new Exception((value:Throwable).getMessage(), null, value); + } else { + return new ValueException(value, null, value); + } + } + + static function thrown(value:Any):Any { + if(Std.isOfType(value, Exception)) { + var native = (value:Exception).__nativeException; + return Std.isOfType(native, RuntimeException) ? native : value; + } else if(Std.isOfType(value, RuntimeException)) { + return value; + } else if(Std.isOfType(value, Throwable)) { + return new Exception((value:Throwable).getMessage(), null, value); + } else { + var e = new ValueException(value); + var stack = e.getStackTrace(); + if(stack.length > 1) { + e.setStackTrace(java.util.Arrays.copyOfRange(stack, 1, stack.length)); + } + return e; + } + } + + public function new(message:String, ?previous:Exception, ?native:Any) { + super(message, cast previous); + __previousException = previous; + if(native != null && Std.isOfType(native, Throwable)) { + __nativeException = native; + setStackTrace(__nativeException.getStackTrace()); + } else { + __nativeException = cast this; + } + } + + function unwrap():Any { + return __nativeException; + } + + override public function toString():String { + return message; + } + + public function details():String { + return inline CallStack.exceptionToString(this); + } + + function get_message():String { + return this.getMessage(); + } + + function get_previous():Null { + return __previousException; + } + + final function get_native():Any { + return __nativeException; + } + + function get_stack():CallStack { + return switch __exceptionStack { + case null: + __exceptionStack = NativeStackTrace.toHaxe(__nativeException.getStackTrace()); + case s: s; + } + } +} + +@:dox(hide) +@:noCompletion +@:native('java.lang.RuntimeException') +private extern class NativeException { + @:noCompletion private function new(?message:String, ?cause:Throwable):Void; + + @:noCompletion @:skipReflection private function addSuppressed (param1:Throwable):Void; + @:noCompletion @:skipReflection private function fillInStackTrace ():Throwable; + @:noCompletion @:skipReflection private function getCause ():Throwable; + @:noCompletion @:skipReflection private function getLocalizedMessage ():String; + @:noCompletion @:skipReflection private function getMessage ():String; + @:noCompletion @:skipReflection private function getStackTrace ():NativeArray; + @:noCompletion @:skipReflection private function getSuppressed ():NativeArray; + @:noCompletion @:skipReflection private function initCause (param1:Throwable):Throwable; + @:noCompletion @:skipReflection @:overload private function printStackTrace (param1:PrintWriter):Void; + @:noCompletion @:skipReflection @:overload private function printStackTrace ():Void; + @:noCompletion @:skipReflection @:overload private function printStackTrace (param1:PrintStream):Void; + @:noCompletion @:skipReflection private function setStackTrace (param1:NativeArray):Void; + @:noCompletion @:skipReflection private function toString ():String; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/java/_std/haxe/Int64.hx b/build/linux64_569e52e/std/java/_std/haxe/Int64.hx new file mode 100644 index 0000000..9078fc4 --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/haxe/Int64.hx @@ -0,0 +1,247 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +using haxe.Int64; + +import haxe.Int64Helper; + +private typedef __Int64 = java.StdTypes.Int64; + +@:coreApi +@:transitive +abstract Int64(__Int64) from __Int64 to __Int64 { + #if jvm + extern public static function make(high:Int32, low:Int32):Int64; + #else + public static inline function make(high:Int32, low:Int32):Int64 + return new Int64(((cast high : __Int64) << 32) | ((cast low : __Int64) & (untyped __java__('0xffffffffL') : Int64))); + #end + + private inline function new(x:__Int64) + this = x; + + private var val(get, set):__Int64; + + inline function get_val():__Int64 + return this; + + inline function set_val(x:__Int64):__Int64 + return this = x; + + public var high(get, never):Int32; + + inline function get_high():Int32 + return cast(this >> 32); + + public var low(get, never):Int32; + + inline function get_low():Int32 + return cast this; + + public inline function copy():Int64 + return new Int64(this); + + @:from public static inline function ofInt(x:Int):Int64 + return cast x; + + @:deprecated('haxe.Int64.is() is deprecated. Use haxe.Int64.isInt64() instead') + inline public static function is(val:Dynamic):Bool + return Std.isOfType(val, java.lang.Long.LongClass); + + inline public static function isInt64(val:Dynamic):Bool + return Std.isOfType(val, java.lang.Long.LongClass); + + public static inline function toInt(x:Int64):Int { + if (x.val < 0x80000000 || x.val > 0x7FFFFFFF) + throw "Overflow"; + return cast x.val; + } + + public static inline function getHigh(x:Int64):Int32 + return cast(x.val >> 32); + + public static inline function getLow(x:Int64):Int32 + return cast(x.val); + + public static inline function isNeg(x:Int64):Bool + return x.val < 0; + + public static inline function isZero(x:Int64):Bool + return x.val == 0; + + public static inline function compare(a:Int64, b:Int64):Int { + if (a.val < b.val) + return -1; + if (a.val > b.val) + return 1; + return 0; + } + + public static inline function ucompare(a:Int64, b:Int64):Int { + if (a.val < 0) + return (b.val < 0) ? compare(a, b) : 1; + return (b.val < 0) ? -1 : compare(a, b); + } + + public static inline function toStr(x:Int64):String + return '${x.val}'; + + public static inline function divMod(dividend:Int64, divisor:Int64):{quotient:Int64, modulus:Int64} + return {quotient: dividend / divisor, modulus: dividend % divisor}; + + private inline function toString():String + return '$this'; + + public static function parseString(sParam:String):Int64 { + // can this be done?: return new Int64( java.lang.Long.LongClass.parseLong( sParam ) ); + return Int64Helper.parseString(sParam); + } + + public static function fromFloat(f:Float):Int64 { + return Int64Helper.fromFloat(f); + } + + @:op(-A) public static function neg(x:Int64):Int64 + return -x.val; + + @:op(++A) private inline function preIncrement():Int64 + return ++this; + + @:op(A++) private inline function postIncrement():Int64 + return this++; + + @:op(--A) private inline function preDecrement():Int64 + return --this; + + @:op(A--) private inline function postDecrement():Int64 + return this--; + + @:op(A + B) public static inline function add(a:Int64, b:Int64):Int64 + return a.val + b.val; + + @:op(A + B) @:commutative private static inline function addInt(a:Int64, b:Int):Int64 + return a.val + b; + + @:op(A - B) public static inline function sub(a:Int64, b:Int64):Int64 + return a.val - b.val; + + @:op(A - B) private static inline function subInt(a:Int64, b:Int):Int64 + return a.val - b; + + @:op(A - B) private static inline function intSub(a:Int, b:Int64):Int64 + return a - b.val; + + @:op(A * B) public static inline function mul(a:Int64, b:Int64):Int64 + return a.val * b.val; + + @:op(A * B) @:commutative private static inline function mulInt(a:Int64, b:Int):Int64 + return a.val * b; + + @:op(A / B) public static inline function div(a:Int64, b:Int64):Int64 + return a.val / b.val; + + @:op(A / B) private static inline function divInt(a:Int64, b:Int):Int64 + return a.val / b; + + @:op(A / B) private static inline function intDiv(a:Int, b:Int64):Int64 + return a / b.val; + + @:op(A % B) public static inline function mod(a:Int64, b:Int64):Int64 + return a.val % b.val; + + @:op(A % B) private static inline function modInt(a:Int64, b:Int):Int64 + return a.val % b; + + @:op(A % B) private static inline function intMod(a:Int, b:Int64):Int64 + return a % b.val; + + @:op(A == B) public static inline function eq(a:Int64, b:Int64):Bool + return a.val == b.val; + + @:op(A == B) @:commutative private static inline function eqInt(a:Int64, b:Int):Bool + return a.val == b; + + @:op(A != B) public static inline function neq(a:Int64, b:Int64):Bool + return a.val != b.val; + + @:op(A != B) @:commutative private static inline function neqInt(a:Int64, b:Int):Bool + return a.val != b; + + @:op(A < B) private static inline function lt(a:Int64, b:Int64):Bool + return a.val < b.val; + + @:op(A < B) private static inline function ltInt(a:Int64, b:Int):Bool + return a.val < b; + + @:op(A < B) private static inline function intLt(a:Int, b:Int64):Bool + return a < b.val; + + @:op(A <= B) private static inline function lte(a:Int64, b:Int64):Bool + return a.val <= b.val; + + @:op(A <= B) private static inline function lteInt(a:Int64, b:Int):Bool + return a.val <= b; + + @:op(A <= B) private static inline function intLte(a:Int, b:Int64):Bool + return a <= b.val; + + @:op(A > B) private static inline function gt(a:Int64, b:Int64):Bool + return a.val > b.val; + + @:op(A > B) private static inline function gtInt(a:Int64, b:Int):Bool + return a.val > b; + + @:op(A > B) private static inline function intGt(a:Int, b:Int64):Bool + return a > b.val; + + @:op(A >= B) private static inline function gte(a:Int64, b:Int64):Bool + return a.val >= b.val; + + @:op(A >= B) private static inline function gteInt(a:Int64, b:Int):Bool + return a.val >= b; + + @:op(A >= B) private static inline function intGte(a:Int, b:Int64):Bool + return a >= b.val; + + @:op(~A) private static inline function complement(x:Int64):Int64 + return ~x.val; + + @:op(A & B) public static inline function and(a:Int64, b:Int64):Int64 + return a.val & b.val; + + @:op(A | B) public static inline function or(a:Int64, b:Int64):Int64 + return a.val | b.val; + + @:op(A ^ B) public static inline function xor(a:Int64, b:Int64):Int64 + return a.val ^ b.val; + + @:op(A << B) public static inline function shl(a:Int64, b:Int):Int64 + return a.val << b; + + @:op(A >> B) public static inline function shr(a:Int64, b:Int):Int64 + return a.val >> b; + + @:op(A >>> B) public static inline function ushr(a:Int64, b:Int):Int64 + return a.val >>> b; +} diff --git a/build/linux64_569e52e/std/java/_std/haxe/NativeStackTrace.hx b/build/linux64_569e52e/std/java/_std/haxe/NativeStackTrace.hx new file mode 100644 index 0000000..048f25d --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/haxe/NativeStackTrace.hx @@ -0,0 +1,55 @@ +package haxe; + +import java.NativeArray; +import java.lang.ThreadLocal; +import java.lang.Throwable; +import java.lang.Thread; +import java.lang.StackTraceElement; +import haxe.CallStack.StackItem; + +/** + Do not use manually. +**/ +@:dox(hide) +@:noCompletion +class NativeStackTrace { + static var exception = new ThreadLocal(); + + @:ifFeature('haxe.NativeStackTrace.exceptionStack') + static public inline function saveStack(e:Throwable):Void { + exception.set(e); + } + + static public function callStack():NativeArray { + var stack = Thread.currentThread().getStackTrace(); + return stack.length <= 3 ? stack : java.util.Arrays.copyOfRange(stack, 3, stack.length); + } + + static public function exceptionStack():NativeArray { + return switch exception.get() { + case null: new NativeArray(0); + case e: e.getStackTrace(); + } + } + + static public function toHaxe(native:NativeArray, skip:Int = 0):Array { + var stack = []; + for (i in 0...native.length) { + if(skip > i) { + continue; + } + var el = native[i]; + var className = el.getClassName(); + var methodName = el.getMethodName(); + var fileName = el.getFileName(); + var lineNumber = el.getLineNumber(); + var method = Method(className, methodName); + if (fileName != null || lineNumber >= 0) { + stack.push(FilePos(method, fileName, lineNumber)); + } else { + stack.push(method); + } + } + return stack; + } +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/java/_std/haxe/Resource.hx b/build/linux64_569e52e/std/java/_std/haxe/Resource.hx new file mode 100644 index 0000000..525e84a --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/haxe/Resource.hx @@ -0,0 +1,51 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +@:coreApi class Resource { + @:keep static var content:Array; + + public static inline function listNames():Array { + return content.copy(); + } + + @:access(haxe.io.Path.escape) + public static function getString(name:String):String { + name = haxe.io.Path.escape(name, true); + var stream = cast(Resource, java.lang.Class).getResourceAsStream("/" + name); + if (stream == null) + return null; + var stream = new java.io.NativeInput(stream); + return stream.readAll().toString(); + } + + @:access(haxe.io.Path.escape) + public static function getBytes(name:String):haxe.io.Bytes { + name = haxe.io.Path.escape(name, true); + var stream = cast(Resource, java.lang.Class).getResourceAsStream("/" + name); + if (stream == null) + return null; + var stream = new java.io.NativeInput(stream); + return stream.readAll(); + } +} diff --git a/build/linux64_569e52e/std/java/_std/haxe/atomic/AtomicBool.hx b/build/linux64_569e52e/std/java/_std/haxe/atomic/AtomicBool.hx new file mode 100644 index 0000000..2b98caa --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/haxe/atomic/AtomicBool.hx @@ -0,0 +1,34 @@ +package haxe.atomic; + +import java.util.concurrent.atomic.AtomicBoolean; + +abstract AtomicBool(AtomicBoolean) { + public inline function new(value:Bool) { + this = new AtomicBoolean(value); + } + + public inline function compareExchange(expected:Bool, replacement:Bool):Bool { + // Java's compareAndSet returns a boolean, so do a CAS loop to be able to return the original value without a potential race condition + + var original; + var real_replacement; + do { + original = this.get(); + real_replacement = original == expected ? replacement : original; + } while (!this.compareAndSet(original, real_replacement)); + return original; + } + + public inline function exchange(value:Bool):Bool { + return this.getAndSet(value); + } + + public inline function load():Bool { + return this.get(); + } + + public inline function store(value:Bool):Bool { + this.set(value); + return value; + } +} diff --git a/build/linux64_569e52e/std/java/_std/haxe/atomic/AtomicInt.hx b/build/linux64_569e52e/std/java/_std/haxe/atomic/AtomicInt.hx new file mode 100644 index 0000000..64dd6c1 --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/haxe/atomic/AtomicInt.hx @@ -0,0 +1,64 @@ +package haxe.atomic; + +import java.util.concurrent.atomic.AtomicInteger; + +abstract AtomicInt(AtomicInteger) { + public inline function new(value:Int) { + this = new AtomicInteger(value); + } + + private inline function cas_loop(value:Int, op:(a:Int, b:Int) -> Int):Int { + var val; + + do { + val = this.get(); + } while (!this.compareAndSet(val, op(val, value))); + + return val; + } + + public inline function add(b:Int):Int { + return this.getAndAdd(b); + } + + public inline function sub(b:Int):Int { + return this.getAndAdd(-b); + } + + public inline function and(b:Int):Int { + return cas_loop(b, (a:Int, b:Int) -> a & b); + } + + public inline function or(b:Int):Int { + return cas_loop(b, (a:Int, b:Int) -> a | b); + } + + public inline function xor(b:Int):Int { + return cas_loop(b, (a:Int, b:Int) -> a ^ b); + } + + public inline function compareExchange(expected:Int, replacement:Int):Int { + // Java's compareAndSet returns a boolean, so do a CAS loop to be able to return the original value without a potential race condition + + var original; + var real_replacement; + do { + original = this.get(); + real_replacement = original == expected ? replacement : original; + } while (!this.compareAndSet(original, real_replacement)); + return original; + } + + public inline function exchange(value:Int):Int { + return this.getAndSet(value); + } + + public inline function load():Int { + return this.get(); + } + + public inline function store(value:Int):Int { + this.set(value); + return value; + } +} diff --git a/build/linux64_569e52e/std/java/_std/haxe/atomic/AtomicObject.hx b/build/linux64_569e52e/std/java/_std/haxe/atomic/AtomicObject.hx new file mode 100644 index 0000000..2bccf7a --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/haxe/atomic/AtomicObject.hx @@ -0,0 +1,34 @@ +package haxe.atomic; + +import java.util.concurrent.atomic.AtomicReference; + +abstract AtomicObject(AtomicReference) { + public inline function new(value:T) { + this = new AtomicReference(value); + } + + public inline function compareExchange(expected:T, replacement:T):T { + // Java's compareAndSet returns a boolean, so do a CAS loop to be able to return the original value without a potential race condition + + var original; + var real_replacement; + do { + original = this.get(); + real_replacement = original == expected ? replacement : original; + } while (!this.compareAndSet(original, real_replacement)); + return original; + } + + public inline function exchange(value:T):T { + return this.getAndSet(value); + } + + public inline function load():T { + return this.get(); + } + + public inline function store(value:T):T { + this.set(value); + return value; + } +} diff --git a/build/linux64_569e52e/std/java/_std/haxe/crypto/Md5.hx b/build/linux64_569e52e/std/java/_std/haxe/crypto/Md5.hx new file mode 100644 index 0000000..51c4f65 --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/haxe/crypto/Md5.hx @@ -0,0 +1,42 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +package haxe.crypto; + +import haxe.io.Bytes; +import haxe.io.BytesData; +import java.security.MessageDigest; +import java.nio.charset.StandardCharsets; + +@:coreApi +class Md5 { + public static function encode(s:String):String { + return Bytes.ofData(digest((cast s : java.NativeString).getBytes(StandardCharsets.UTF_8))).toHex(); + } + + public static function make(b:haxe.io.Bytes):haxe.io.Bytes { + return Bytes.ofData(digest(b.getData())); + } + + inline static function digest(b:BytesData):BytesData { + return MessageDigest.getInstance("MD5").digest(b); + } +} diff --git a/build/linux64_569e52e/std/java/_std/haxe/crypto/Sha1.hx b/build/linux64_569e52e/std/java/_std/haxe/crypto/Sha1.hx new file mode 100644 index 0000000..075228b --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/haxe/crypto/Sha1.hx @@ -0,0 +1,42 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +package haxe.crypto; + +import haxe.io.Bytes; +import haxe.io.BytesData; +import java.security.MessageDigest; +import java.nio.charset.StandardCharsets; + +@:coreApi +class Sha1 { + public static function encode(s:String):String { + return Bytes.ofData(digest((cast s : java.NativeString).getBytes(StandardCharsets.UTF_8))).toHex(); + } + + public static function make(b:haxe.io.Bytes):haxe.io.Bytes { + return Bytes.ofData(digest(b.getData())); + } + + inline static function digest(b:BytesData):BytesData { + return MessageDigest.getInstance("SHA-1").digest(b); + } +} diff --git a/build/linux64_569e52e/std/java/_std/haxe/crypto/Sha256.hx b/build/linux64_569e52e/std/java/_std/haxe/crypto/Sha256.hx new file mode 100644 index 0000000..0ad4d3c --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/haxe/crypto/Sha256.hx @@ -0,0 +1,42 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +package haxe.crypto; + +import haxe.io.Bytes; +import haxe.io.BytesData; +import java.security.MessageDigest; +import java.nio.charset.StandardCharsets; + +@:coreApi +class Sha256 { + public static function encode(s:String):String { + return Bytes.ofData(digest((cast s : java.NativeString).getBytes(StandardCharsets.UTF_8))).toHex(); + } + + public static function make(b:haxe.io.Bytes):haxe.io.Bytes { + return Bytes.ofData(digest(b.getData())); + } + + inline static function digest(b:BytesData):BytesData { + return MessageDigest.getInstance("SHA-256").digest(b); + } +} diff --git a/build/linux64_569e52e/std/java/_std/haxe/ds/IntMap.hx b/build/linux64_569e52e/std/java/_std/haxe/ds/IntMap.hx new file mode 100644 index 0000000..a5427aa --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/haxe/ds/IntMap.hx @@ -0,0 +1,523 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +import java.NativeArray; + +/* + * This IntMap implementation is based on khash (https://github.com/attractivechaos/klib/blob/master/khash.h) + * Copyright goes to Attractive Chaos and his contributors + * + * Thanks also to Jonas Malaco Filho for his Haxe-written IntMap code inspired by Python tables. + * (https://jonasmalaco.com/fossil/test/jonas-haxe/artifact/887b53126e237d6c68951111d594033403889304) + */ +@:coreApi class IntMap implements haxe.Constraints.IMap { + private static inline var HASH_UPPER = 0.7; + + private var flags:NativeArray; + private var _keys:NativeArray; + private var vals:NativeArray; + + private var nBuckets:Int; + private var size:Int; + private var nOccupied:Int; + private var upperBound:Int; + + #if !no_map_cache + private var cachedKey:Int; + private var cachedIndex:Int; + #end + + public function new():Void { + #if !no_map_cache + cachedIndex = -1; + #end + } + + public function set(key:Int, value:T):Void { + var targetIndex:Int; + if (nOccupied >= upperBound) { + if (nBuckets > (size << 1)) { + resize(nBuckets - 1); // clear "deleted" elements + } else { + resize(nBuckets + 1); + } + } + + var flags = flags, _keys = _keys; + { + var mask = nBuckets - 1, + hashedKey = hash(key), + curIndex = hashedKey & mask; + + var delKey = -1, curFlag = 0; + // to speed things up, don't loop if the first bucket is already free + if (isEmpty(getFlag(flags, curIndex))) { + targetIndex = curIndex; + } else { + var inc = getInc(hashedKey, mask), last = curIndex; + while (!(_keys[curIndex] == key || isEmpty(curFlag = getFlag(flags, curIndex)))) { + if (delKey == -1 && isDel(curFlag)) { + delKey = curIndex; + } + curIndex = (curIndex + inc) & mask; + #if debug + assert(curIndex != last); + #end + } + + if (delKey != -1 && isEmpty(getFlag(flags, curIndex))) { + targetIndex = delKey; + } else { + targetIndex = curIndex; + } + } + } + + var flag = getFlag(flags, targetIndex); + if (isEmpty(flag)) { + _keys[targetIndex] = key; + vals[targetIndex] = value; + setIsBothFalse(flags, targetIndex); + size++; + nOccupied++; + } else if (isDel(flag)) { + _keys[targetIndex] = key; + vals[targetIndex] = value; + setIsBothFalse(flags, targetIndex); + size++; + } else { + #if debug + assert(_keys[targetIndex] == key); + #end + vals[targetIndex] = value; + } + } + + private final function lookup(key:Int):Int { + if (nBuckets != 0) { + var flags = flags, _keys = _keys; + + var mask = nBuckets - 1, + k = hash(key), + index = k & mask, + curFlag = -1, + inc = getInc(k, mask), /* inc == 1 for linear probing */ + last = index; + do { + if (_keys[index] == key) { + if (isEmpty(curFlag = getFlag(flags, index))) { + index = (index + inc) & mask; + continue; + } else if (isDel(curFlag)) { + return -1; + } else { + return index; + } + } else { + index = (index + inc) & mask; + } + } while (index != last); + } + + return -1; + } + + public function get(key:Int):Null { + var idx = -1; + #if !no_map_cache + if (cachedKey == key && ((idx = cachedIndex) != -1)) { + return vals[idx]; + } + #end + + idx = lookup(key); + if (idx != -1) { + #if !no_map_cache + cachedKey = key; + cachedIndex = idx; + #end + return vals[idx]; + } + + return null; + } + + private function getDefault(key:Int, def:T):T { + var idx = -1; + #if !no_map_cache + if (cachedKey == key && ((idx = cachedIndex) != -1)) { + return vals[idx]; + } + #end + + idx = lookup(key); + if (idx != -1) { + #if !no_map_cache + cachedKey = key; + cachedIndex = idx; + #end + return vals[idx]; + } + + return def; + } + + public function exists(key:Int):Bool { + var idx = -1; + #if !no_map_cache + if (cachedKey == key && ((idx = cachedIndex) != -1)) { + return true; + } + #end + + idx = lookup(key); + if (idx != -1) { + #if !no_map_cache + cachedKey = key; + cachedIndex = idx; + #end + + return true; + } + + return false; + } + + public function remove(key:Int):Bool { + var idx = -1; + #if !no_map_cache + if (!(cachedKey == key && ((idx = cachedIndex) != -1))) + #end + { + idx = lookup(key); + } + + if (idx == -1) { + return false; + } else { + #if !no_map_cache + if (cachedKey == key) { + cachedIndex = -1; + } + #end + if (!isEither(getFlag(flags, idx))) { + setIsDelTrue(flags, idx); + --size; + + vals[idx] = null; + // we do NOT reset the keys here, as unlike StringMap, we check for keys equality + // and stop if we find a key that is equal to the one we're looking for + // setting this to 0 will allow the hash to contain duplicate `0` keys + // (see #6457) + // _keys[idx] = 0; + } + + return true; + } + } + + private final function resize(newNBuckets:Int):Void { + // This function uses 0.25*n_bucktes bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. + var newFlags = null; + var j = 1; + { + newNBuckets = roundUp(newNBuckets); + if (newNBuckets < 4) + newNBuckets = 4; + if (size >= (newNBuckets * HASH_UPPER + 0.5)) + /* requested size is too small */ { + j = 0; + } else { /* hash table size to be changed (shrink or expand); rehash */ + var nfSize = flagsSize(newNBuckets); + newFlags = new NativeArray(nfSize); + for (i in 0...nfSize) { + newFlags[i] = 0xaaaaaaaa; // isEmpty = true; isDel = false + } + if (nBuckets < newNBuckets) // expand + { + var k = new NativeArray(newNBuckets); + if (_keys != null) { + arrayCopy(_keys, 0, k, 0, nBuckets); + } + _keys = k; + + var v = new NativeArray(newNBuckets); + if (vals != null) { + arrayCopy(vals, 0, v, 0, nBuckets); + } + vals = v; + } // otherwise shrink + } + } + + if (j != 0) { // rehashing is required + #if !no_map_cache + // resetting cache + cachedKey = 0; + cachedIndex = -1; + #end + + j = -1; + var nBuckets = nBuckets, _keys = _keys, vals = vals, flags = flags; + + var newMask = newNBuckets - 1; + while (++j < nBuckets) { + if (!isEither(getFlag(flags, j))) { + var key = _keys[j]; + var val = vals[j]; + + // do not set keys as 0 - see comment about #6457 + // _keys[j] = 0; + vals[j] = cast null; + setIsDelTrue(flags, j); + while (true) + /* kick-out process; sort of like in Cuckoo hashing */ { + var k = hash(key); + var inc = getInc(k, newMask); + var i = k & newMask; + while (!isEmpty(getFlag(newFlags, i))) { + i = (i + inc) & newMask; + } + setIsEmptyFalse(newFlags, i); + + if (i < nBuckets && !isEither(getFlag(flags, i))) + /* kick out the existing element */ { + { + var tmp = _keys[i]; + _keys[i] = key; + key = tmp; + } { + var tmp = vals[i]; + vals[i] = val; + val = tmp; + } + + setIsDelTrue(flags, i); /* mark it as deleted in the old hash table */ + } else { /* write the element and jump out of the loop */ + _keys[i] = key; + vals[i] = val; + break; + } + } + } + } + + if (nBuckets > newNBuckets) + /* shrink the hash table */ { + { + var k = new NativeArray(newNBuckets); + arrayCopy(_keys, 0, k, 0, newNBuckets); + this._keys = k; + } { + var v = new NativeArray(newNBuckets); + arrayCopy(vals, 0, v, 0, newNBuckets); + this.vals = v; + } + } + + this.flags = newFlags; + this.nBuckets = newNBuckets; + this.nOccupied = size; + this.upperBound = Std.int(newNBuckets * HASH_UPPER + .5); + } + } + + public inline function keys():Iterator { + return new IntMapKeyIterator(this); + } + + public inline function iterator():Iterator { + return new IntMapValueIterator(this); + } + + @:runtime public inline function keyValueIterator():KeyValueIterator { + return new haxe.iterators.MapKeyValueIterator(this); + } + + public function copy():IntMap { + var copied = new IntMap(); + for (key in keys()) + copied.set(key, get(key)); + return copied; + } + + public function toString():String { + var s = new StringBuf(); + s.add("["); + var it = keys(); + for (i in it) { + s.add(i); + s.add(" => "); + s.add(Std.string(get(i))); + if (it.hasNext()) + s.add(", "); + } + s.add("]"); + return s.toString(); + } + + public function clear():Void { + flags = null; + _keys = null; + vals = null; + nBuckets = 0; + size = 0; + nOccupied = 0; + upperBound = 0; + #if !no_map_cache + cachedKey = 0; + cachedIndex = -1; + #end + } + + private static inline function assert(x:Bool):Void { + #if debug + if (!x) + throw "assert failed"; + #end + } + + private static inline function defaultK():Int + return 0; + + private static inline function arrayCopy(sourceArray:Dynamic, sourceIndex:Int, destinationArray:Dynamic, destinationIndex:Int, length:Int):Void + java.lang.System.arraycopy(sourceArray, sourceIndex, destinationArray, destinationIndex, length); + + private static inline function getInc(k:Int, mask:Int):Int + return (((k) >> 3 ^ (k) << 3) | 1) & (mask); + + private static inline function hash(i:Int):Int + return i; + + // flags represents a bit array with 2 significant bits for each index + // one bit for deleted (1), one for empty (2) + // so what this function does is: + // * gets the integer with (flags / 16) + // * shifts those bits to the right ((flags % 16) * 2) places + // * masks it with 0b11 + private static inline function getFlag(flags:NativeArray, i:Int):Int { + return ((flags[i >> 4] >>> ((i & 0xf) << 1)) & 3); + } + + private static inline function isDel(flag:Int):Bool { + return (flag & 1) != 0; + } + + private static inline function isEmpty(flag:Int):Bool { + return (flag & 2) != 0; + } + + private static inline function isEither(flag:Int):Bool { + return flag != 0; + } + + private static inline function setIsDelFalse(flags:NativeArray, i:Int):Void { + flags[i >> 4] &= ~(1 << ((i & 0xf) << 1)); + } + + private static inline function setIsEmptyFalse(flags:NativeArray, i:Int):Void { + flags[i >> 4] &= ~(2 << ((i & 0xf) << 1)); + } + + private static inline function setIsBothFalse(flags:NativeArray, i:Int):Void { + flags[i >> 4] &= ~(3 << ((i & 0xf) << 1)); + } + + private static inline function setIsDelTrue(flags:NativeArray, i:Int):Void { + flags[i >> 4] |= 1 << ((i & 0xf) << 1); + } + + private static inline function roundUp(x:Int):Int { + --x; + x |= (x) >>> 1; + x |= (x) >>> 2; + x |= (x) >>> 4; + x |= (x) >>> 8; + x |= (x) >>> 16; + return ++x; + } + + private static inline function flagsSize(m:Int):Int + return ((m) < 16 ? 1 : (m) >> 4); +} + +@:access(haxe.ds.IntMap) +private final class IntMapKeyIterator { + var m:IntMap; + var i:Int; + var len:Int; + + public function new(m:IntMap) { + this.i = 0; + this.m = m; + this.len = m.nBuckets; + } + + public function hasNext():Bool { + for (j in i...len) { + if (!IntMap.isEither(IntMap.getFlag(m.flags, j))) { + i = j; + return true; + } + } + return false; + } + + public function next():Int { + var ret = m._keys[i]; + #if !no_map_cache + m.cachedIndex = i; + m.cachedKey = ret; + #end + i++; + return ret; + } +} + +@:access(haxe.ds.IntMap) +private final class IntMapValueIterator { + var m:IntMap; + var i:Int; + var len:Int; + + public function new(m:IntMap) { + this.i = 0; + this.m = m; + this.len = m.nBuckets; + } + + public function hasNext():Bool { + for (j in i...len) { + if (!IntMap.isEither(IntMap.getFlag(m.flags, j))) { + i = j; + return true; + } + } + return false; + } + + public inline function next():T { + return m.vals[i++]; + } +} diff --git a/build/linux64_569e52e/std/java/_std/haxe/ds/ObjectMap.hx b/build/linux64_569e52e/std/java/_std/haxe/ds/ObjectMap.hx new file mode 100644 index 0000000..c289ec0 --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/haxe/ds/ObjectMap.hx @@ -0,0 +1,538 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +import java.NativeArray; + +@:coreApi class ObjectMap implements haxe.Constraints.IMap { + extern private static inline var HASH_UPPER = 0.77; + extern private static inline var FLAG_EMPTY = 0; + extern private static inline var FLAG_DEL = 1; + + /** + * This is the most important structure here and the reason why it's so fast. + * It's an array of all the hashes contained in the table. These hashes cannot be 0 nor 1, + * which stand for "empty" and "deleted" states. + * + * The lookup algorithm will keep looking until a 0 or the key wanted is found; + * The insertion algorithm will do the same but will also break when FLAG_DEL is found; + */ + private var hashes:NativeArray; + + private var _keys:NativeArray; + private var vals:NativeArray; + + private var nBuckets:Int; + private var size:Int; + private var nOccupied:Int; + private var upperBound:Int; + + #if !no_map_cache + private var cachedKey:K; + private var cachedIndex:Int; + #end + + #if DEBUG_HASHTBL + private var totalProbes:Int; + private var probeTimes:Int; + private var sameHash:Int; + private var maxProbe:Int; + #end + + public function new():Void { + #if !no_map_cache + cachedIndex = -1; + #end + } + + public function set(key:K, value:V):Void { + var x:Int, k:Int; + if (nOccupied >= upperBound) { + if (nBuckets > (size << 1)) + resize(nBuckets - 1); // clear "deleted" elements + else + resize(nBuckets + 2); + } + + var hashes = hashes, keys = _keys, hashes = hashes; + { + var mask = (nBuckets == 0) ? 0 : nBuckets - 1; + var site = x = nBuckets; + k = hash(key); + var i = k & mask, nProbes = 0; + + var delKey = -1; + // for speed up + if (isEmpty(hashes[i])) { + x = i; + } else { + // var inc = getInc(k, mask); + var last = i, flag; + while (!(isEmpty(flag = hashes[i]) || (flag == k && (cast keys[i] : java.lang.Object).equals(key)))) { + if (isDel(flag) && delKey == -1) + delKey = i; + i = (i + ++nProbes) & mask; + #if DEBUG_HASHTBL + probeTimes++; + if (i == last) + throw "assert"; + #end + } + + if (isEmpty(flag) && delKey != -1) + x = delKey; + else + x = i; + } + + #if DEBUG_HASHTBL + if (nProbes > maxProbe) + maxProbe = nProbes; + totalProbes++; + #end + } + + var flag = hashes[x]; + if (isEmpty(flag)) { + keys[x] = key; + vals[x] = value; + hashes[x] = k; + size++; + nOccupied++; + } else if (isDel(flag)) { + keys[x] = key; + vals[x] = value; + hashes[x] = k; + size++; + } else { + assert(keys[x] == key); + vals[x] = value; + } + + #if !no_map_cache + cachedIndex = x; + cachedKey = key; + #end + } + + private final function lookup(key:K):Int { + if (nBuckets != 0) { + var hashes = hashes, keys = _keys; + + var mask = nBuckets - 1, hash = hash(key), k = hash, nProbes = 0; + var i = k & mask; + var last = i, flag; + // var inc = getInc(k, mask); + while (!isEmpty(flag = hashes[i]) && (isDel(flag) || flag != k || !((cast keys[i] : java.lang.Object).equals(key)))) { + i = (i + ++nProbes) & mask; + #if DEBUG_HASHTBL + probeTimes++; + if (i == last) + throw "assert"; + #end + } + + #if DEBUG_HASHTBL + if (nProbes > maxProbe) + maxProbe = nProbes; + totalProbes++; + #end + return isEither(flag) ? -1 : i; + } + + return -1; + } + + @:private final function resize(newNBuckets:Int):Void { + // This function uses 0.25*n_bucktes bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. + var newHash = null; + var j = 1; + { + newNBuckets = roundUp(newNBuckets); + if (newNBuckets < 4) + newNBuckets = 4; + if (size >= (newNBuckets * HASH_UPPER + 0.5)) + /* requested size is too small */ { + j = 0; + } else { /* hash table size to be changed (shrink or expand); rehash */ + var nfSize = newNBuckets; + newHash = new NativeArray(nfSize); + if (nBuckets < newNBuckets) // expand + { + var k = new NativeArray(newNBuckets); + if (_keys != null) + arrayCopy(_keys, 0, k, 0, nBuckets); + _keys = k; + + var v = new NativeArray(newNBuckets); + if (vals != null) + arrayCopy(vals, 0, v, 0, nBuckets); + vals = v; + } // otherwise shrink + } + } + + if (j != 0) { // rehashing is required + // resetting cache + #if !no_map_cache + cachedKey = null; + cachedIndex = -1; + #end + + j = -1; + var nBuckets = nBuckets, + _keys = _keys, + vals = vals, + hashes = hashes; + + var newMask = newNBuckets - 1; + while (++j < nBuckets) { + var k; + if (!isEither(k = hashes[j])) { + var key = _keys[j]; + var val = vals[j]; + + _keys[j] = null; + vals[j] = cast null; + hashes[j] = FLAG_DEL; + while (true) + /* kick-out process; sort of like in Cuckoo hashing */ { + var nProbes = 0; + // var inc = getInc(k, newMask); + var i = k & newMask; + + while (!isEmpty(newHash[i])) + i = (i + ++nProbes) & newMask; + + newHash[i] = k; + + if (i < nBuckets && !isEither(k = hashes[i])) + /* kick out the existing element */ { + { + var tmp = _keys[i]; + _keys[i] = key; + key = tmp; + } { + var tmp = vals[i]; + vals[i] = val; + val = tmp; + } + + hashes[i] = FLAG_DEL; /* mark it as deleted in the old hash table */ + } else { /* write the element and jump out of the loop */ + _keys[i] = key; + vals[i] = val; + break; + } + } + } + } + + if (nBuckets > newNBuckets) + /* shrink the hash table */ { + { + var k = new NativeArray(newNBuckets); + arrayCopy(_keys, 0, k, 0, newNBuckets); + this._keys = k; + } { + var v = new NativeArray(newNBuckets); + arrayCopy(vals, 0, v, 0, newNBuckets); + this.vals = v; + } + } + + this.hashes = newHash; + this.nBuckets = newNBuckets; + this.nOccupied = size; + this.upperBound = Std.int(newNBuckets * HASH_UPPER + .5); + } + } + + public function get(key:K):Null { + var idx = -1; + #if !no_map_cache + if (cachedKey == key && ((idx = cachedIndex) != -1)) { + return vals[idx]; + } + #end + + idx = lookup(key); + if (idx != -1) { + #if !no_map_cache + cachedKey = key; + cachedIndex = idx; + #end + + return vals[idx]; + } + + return null; + } + + private function getDefault(key:K, def:V):V { + var idx = -1; + #if !no_map_cache + if (cachedKey == key && ((idx = cachedIndex) != -1)) { + return vals[idx]; + } + #end + + idx = lookup(key); + if (idx != -1) { + #if !no_map_cache + cachedKey = key; + cachedIndex = idx; + #end + + return vals[idx]; + } + + return def; + } + + public function exists(key:K):Bool { + var idx = -1; + #if !no_map_cache + if (cachedKey == key && ((idx = cachedIndex) != -1)) { + return true; + } + #end + + idx = lookup(key); + if (idx != -1) { + #if !no_map_cache + cachedKey = key; + cachedIndex = idx; + #end + + return true; + } + + return false; + } + + public function remove(key:K):Bool { + var idx = -1; + #if !no_map_cache + if (!(cachedKey == key && ((idx = cachedIndex) != -1))) + #end + { + idx = lookup(key); + } + + if (idx == -1) { + return false; + } else { + #if !no_map_cache + if (cachedKey == key) + cachedIndex = -1; + #end + + hashes[idx] = FLAG_DEL; + _keys[idx] = null; + vals[idx] = null; + --size; + + return true; + } + } + + public function keys():Iterator { + return new ObjectMapKeyIterator(this); + } + + public function iterator():Iterator { + return new ObjectMapValueIterator(this); + } + + @:runtime public inline function keyValueIterator():KeyValueIterator { + return new haxe.iterators.MapKeyValueIterator(this); + } + + public function copy():ObjectMap { + var copied = new ObjectMap(); + for (key in keys()) + copied.set(key, get(key)); + return copied; + } + + public function toString():String { + var s = new StringBuf(); + s.add("["); + var it = keys(); + for (i in it) { + s.add(Std.string(i)); + s.add(" => "); + s.add(Std.string(get(i))); + if (it.hasNext()) + s.add(", "); + } + s.add("]"); + return s.toString(); + } + + public function clear():Void { + hashes = null; + _keys = null; + vals = null; + nBuckets = 0; + size = 0; + nOccupied = 0; + upperBound = 0; + #if !no_map_cache + cachedKey = null; + cachedIndex = -1; + #end + #if DEBUG_HASHTBL + totalProbes = 0; + probeTimes = 0; + sameHash = 0; + maxProbe = 0; + #end + } + + extern private static inline function roundUp(x:Int):Int { + --x; + x |= (x) >>> 1; + x |= (x) >>> 2; + x |= (x) >>> 4; + x |= (x) >>> 8; + x |= (x) >>> 16; + return ++x; + } + + extern private static inline function getInc(k:Int, mask:Int):Int // return 1 for linear probing + return (((k) >> 3 ^ (k) << 3) | 1) & (mask); + + extern private static inline function isEither(v:HashType):Bool + return (v & 0xFFFFFFFE) == 0; + + extern private static inline function isEmpty(v:HashType):Bool + return v == FLAG_EMPTY; + + extern private static inline function isDel(v:HashType):Bool + return v == FLAG_DEL; + + // guarantee: Whatever this function is, it will never return 0 nor 1 + extern private static inline function hash(s:Dynamic):HashType { + var k:Int = (cast s : java.lang.Object).hashCode(); + // k *= 357913941; + // k ^= k << 24; + // k += ~357913941; + // k ^= k >> 31; + // k ^= k << 31; + + k = (k + 0x7ed55d16) + (k << 12); + k = (k ^ 0xc761c23c) ^ (k >> 19); + k = (k + 0x165667b1) + (k << 5); + k = (k + 0xd3a2646c) ^ (k << 9); + k = (k + 0xfd7046c5) + (k << 3); + k = (k ^ 0xb55a4f09) ^ (k >> 16); + + var ret = k; + if (isEither(ret)) { + if (ret == 0) + ret = 2; + else + ret = 0xFFFFFFFF; + } + + return ret; + } + + extern private static inline function arrayCopy(sourceArray:Dynamic, sourceIndex:Int, destinationArray:Dynamic, destinationIndex:Int, length:Int):Void + java.lang.System.arraycopy(sourceArray, sourceIndex, destinationArray, destinationIndex, length); + + extern private static inline function assert(x:Bool):Void { + #if DEBUG_HASHTBL + if (!x) + throw "assert failed"; + #end + } +} + +@:access(haxe.ds.ObjectMap) +private final class ObjectMapKeyIterator { + var m:ObjectMap; + var i:Int; + var len:Int; + + public function new(m:ObjectMap) { + this.i = 0; + this.m = m; + this.len = m.nBuckets; + } + + public function hasNext():Bool { + for (j in i...len) { + if (!ObjectMap.isEither(m.hashes[j])) { + i = j; + return true; + } + } + return false; + } + + public function next():T { + var ret = m._keys[i]; + + #if !no_map_cache + m.cachedIndex = i; + m.cachedKey = ret; + #end + + i = i + 1; + return ret; + } +} + +@:access(haxe.ds.ObjectMap) +private final class ObjectMapValueIterator { + var m:ObjectMap; + var i:Int; + var len:Int; + + public function new(m:ObjectMap) { + this.i = 0; + this.m = m; + this.len = m.nBuckets; + } + + public function hasNext():Bool { + for (j in i...len) { + if (!ObjectMap.isEither(m.hashes[j])) { + i = j; + return true; + } + } + return false; + } + + public inline function next():T { + var ret = m.vals[i]; + i = i + 1; + return ret; + } +} + +private typedef HashType = Int; diff --git a/build/linux64_569e52e/std/java/_std/haxe/ds/WeakMap.hx b/build/linux64_569e52e/std/java/_std/haxe/ds/WeakMap.hx new file mode 100644 index 0000000..47ba493 --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/haxe/ds/WeakMap.hx @@ -0,0 +1,582 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +import java.NativeArray; +import java.lang.ref.WeakReference; +import java.lang.ref.ReferenceQueue; + +@:coreApi class WeakMap implements haxe.Constraints.IMap { + extern private static inline var HASH_UPPER = 0.77; + extern private static inline var FLAG_EMPTY = 0; + extern private static inline var FLAG_DEL = 1; + + /** + * This is the most important structure here and the reason why it's so fast. + * It's an array of all the hashes contained in the table. These hashes cannot be 0 nor 1, + * which stand for "empty" and "deleted" states. + * + * The lookup algorithm will keep looking until a 0 or the key wanted is found; + * The insertion algorithm will do the same but will also break when FLAG_DEL is found; + */ + private var hashes:NativeArray; + + private var entries:NativeArray>; + + // weak map specific + private var queue:ReferenceQueue; + + private var nBuckets:Int; + private var size:Int; + private var nOccupied:Int; + private var upperBound:Int; + + #if !no_map_cache + private var cachedEntry:Entry; + private var cachedIndex:Int; + #end + + #if DEBUG_HASHTBL + private var totalProbes:Int; + private var probeTimes:Int; + private var sameHash:Int; + private var maxProbe:Int; + #end + + public function new():Void { + #if !no_map_cache + cachedIndex = -1; + #end + queue = new ReferenceQueue(); + } + + @:analyzer(ignore) + private function cleanupRefs():Void { + var x:Dynamic = null, nOccupied = nOccupied; + while ((x = queue.poll()) != null) { + // even if not found on hashtable (already removed), release value + var x:Entry = cast x; + x.value = null; + + // lookup index + if (nOccupied != 0) { + var mask = nBuckets - 1, hash = x.hash, nProbes = 0; + var i = hash & mask; + var last = i, flag; + while (!isEmpty(flag = hashes[i]) && (isDel(flag) || flag != hash || entries[i] != x)) { + i = (i + ++nProbes) & mask; + } + + if (entries[i] == x) { + #if !no_map_cache + if (cachedIndex == i) { + cachedIndex = -1; + cachedEntry = null; + } + #end + entries[i] = null; + hashes[i] = FLAG_DEL; + --size; + } + } + } + } + + public function set(key:K, value:V):Void { + cleanupRefs(); + var x:Int, k:Int; + if (nOccupied >= upperBound) { + if (nBuckets > (size << 1)) + resize(nBuckets - 1); // clear "deleted" elements + else + resize(nBuckets + 2); + } + + k = hash(key); + var hashes = hashes, entries = entries; + { + var mask = (nBuckets == 0) ? 0 : nBuckets - 1; + var site = x = nBuckets; + var i = k & mask, nProbes = 0; + + var delKey = -1; + // for speed up + if (isEmpty(hashes[i])) { + x = i; + } else { + // var inc = getInc(k, mask); + var last = i, flag; + while (!(isEmpty(flag = hashes[i]) || (flag == k && entries[i].keyEquals(key)))) { + if (delKey == -1 && isDel(flag)) + delKey = i; + i = (i + ++nProbes) & mask; + #if DEBUG_HASHTBL + probeTimes++; + if (i == last) + throw "assert"; + #end + } + + if (isEmpty(flag) && delKey != -1) + x = delKey; + else + x = i; + } + + #if DEBUG_HASHTBL + if (nProbes > maxProbe) + maxProbe = nProbes; + totalProbes++; + #end + } + + var flag = hashes[x], entry = new Entry(key, value, k, queue); + if (isEmpty(flag)) { + entries[x] = entry; + hashes[x] = k; + size++; + nOccupied++; + } else if (isDel(flag)) { + entries[x] = entry; + hashes[x] = k; + size++; + } else { + assert(entries[x].keyEquals(key)); + entries[x] = entry; + } + + #if !no_map_cache + cachedIndex = x; + cachedEntry = entry; + #end + } + + private final function lookup(key:K):Int { + if (nBuckets != 0) { + var hashes = hashes, entries = entries; + + var mask = nBuckets - 1, hash = hash(key), k = hash, nProbes = 0; + var i = k & mask; + var last = i, flag; + // var inc = getInc(k, mask); + while (!isEmpty(flag = hashes[i]) && (isDel(flag) || flag != k || !entries[i].keyEquals(key))) { + i = (i + ++nProbes) & mask; + #if DEBUG_HASHTBL + probeTimes++; + if (i == last) + throw "assert"; + #end + } + + #if DEBUG_HASHTBL + if (nProbes > maxProbe) + maxProbe = nProbes; + totalProbes++; + #end + return isEither(flag) ? -1 : i; + } + + return -1; + } + + @:private final function resize(newNBuckets:Int):Void { + // This function uses 0.25*n_bucktes bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. + var newHash = null; + var j = 1; + { + newNBuckets = roundUp(newNBuckets); + if (newNBuckets < 4) + newNBuckets = 4; + if (size >= (newNBuckets * HASH_UPPER + 0.5)) + /* requested size is too small */ { + j = 0; + } else { /* hash table size to be changed (shrink or expand); rehash */ + var nfSize = newNBuckets; + newHash = new NativeArray(nfSize); + if (nBuckets < newNBuckets) // expand + { + var e = new NativeArray(newNBuckets); + if (entries != null) + arrayCopy(entries, 0, e, 0, nBuckets); + entries = e; + } // otherwise shrink + } + } + + if (j != 0) { // rehashing is required + // resetting cache + #if !no_map_cache + cachedEntry = null; + cachedIndex = -1; + #end + + j = -1; + var nBuckets = nBuckets, entries = entries, hashes = hashes; + + var newMask = newNBuckets - 1; + while (++j < nBuckets) { + var k; + if (!isEither(k = hashes[j])) { + var entry = entries[j]; + + entries[j] = null; + hashes[j] = FLAG_DEL; + while (true) + /* kick-out process; sort of like in Cuckoo hashing */ { + var nProbes = 0; + var i = k & newMask; + + while (!isEmpty(newHash[i])) + i = (i + ++nProbes) & newMask; + + newHash[i] = k; + + if (i < nBuckets && !isEither(k = hashes[i])) + /* kick out the existing element */ { + { + var tmp = entries[i]; + entries[i] = entry; + entry = tmp; + } + + hashes[i] = FLAG_DEL; /* mark it as deleted in the old hash table */ + } else { /* write the element and jump out of the loop */ + entries[i] = entry; + break; + } + } + } + } + + if (nBuckets > newNBuckets) + /* shrink the hash table */ { + { + var e = new NativeArray(newNBuckets); + arrayCopy(entries, 0, e, 0, newNBuckets); + this.entries = e; + } + } + + this.hashes = newHash; + this.nBuckets = newNBuckets; + this.nOccupied = size; + this.upperBound = Std.int(newNBuckets * HASH_UPPER + .5); + } + } + + public function get(key:K):Null { + cleanupRefs(); + var idx = -1; + #if !no_map_cache + if (cachedEntry != null && cachedEntry.keyEquals(key) && ((idx = cachedIndex) != -1)) { + return cachedEntry.value; + } + #end + + idx = lookup(key); + if (idx != -1) { + var entry = entries[idx]; + #if !no_map_cache + cachedEntry = entry; + cachedIndex = idx; + #end + + return entry.value; + } + + return null; + } + + private function getDefault(key:K, def:V):V { + cleanupRefs(); + var idx = -1; + #if !no_map_cache + if (cachedEntry != null && cachedEntry.keyEquals(key) && ((idx = cachedIndex) != -1)) { + return cachedEntry.value; + } + #end + + idx = lookup(key); + if (idx != -1) { + var entry = entries[idx]; + #if !no_map_cache + cachedEntry = entry; + cachedIndex = idx; + #end + + return entry.value; + } + + return def; + } + + public function exists(key:K):Bool { + cleanupRefs(); + var idx = -1; + #if !no_map_cache + if (cachedEntry != null && cachedEntry.keyEquals(key) && ((idx = cachedIndex) != -1)) { + return true; + } + #end + + idx = lookup(key); + if (idx != -1) { + var entry = entries[idx]; + #if !no_map_cache + cachedEntry = entry; + cachedIndex = idx; + #end + + return true; + } + + return false; + } + + public function remove(key:K):Bool { + cleanupRefs(); + var idx = -1; + #if !no_map_cache + if (!(cachedEntry != null && cachedEntry.keyEquals(key) && ((idx = cachedIndex) != -1))) + #end + { + idx = lookup(key); + } + + if (idx == -1) { + return false; + } else { + #if !no_map_cache + if (cachedEntry != null && cachedEntry.keyEquals(key)) { + cachedIndex = -1; + cachedEntry = null; + } + #end + + hashes[idx] = FLAG_DEL; + entries[idx] = null; + --size; + + return true; + } + } + + public inline function keys():Iterator { + cleanupRefs(); + return new WeakMapKeyIterator(this); + } + + public inline function iterator():Iterator { + cleanupRefs(); + return new WeakMapValueIterator(this); + } + + public inline function keyValueIterator():KeyValueIterator { + return new haxe.iterators.MapKeyValueIterator(this); + } + + public function copy():WeakMap { + var copied = new WeakMap(); + for (key in keys()) + copied.set(key, get(key)); + return copied; + } + + public function toString():String { + var s = new StringBuf(); + s.add("["); + var it = keys(); + for (i in it) { + s.add(Std.string(i)); + s.add(" => "); + s.add(Std.string(get(i))); + if (it.hasNext()) + s.add(", "); + } + s.add("]"); + return s.toString(); + } + + public function clear():Void { + hashes = null; + entries = null; + queue = new ReferenceQueue(); + nBuckets = 0; + size = 0; + nOccupied = 0; + upperBound = 0; + #if !no_map_cache + cachedEntry = null; + cachedIndex = -1; + #end + #if DEBUG_HASHTBL + totalProbes = 0; + probeTimes = 0; + sameHash = 0; + maxProbe = 0; + #end + } + + extern private static inline function roundUp(x:Int):Int { + --x; + x |= (x) >>> 1; + x |= (x) >>> 2; + x |= (x) >>> 4; + x |= (x) >>> 8; + x |= (x) >>> 16; + return ++x; + } + + extern private static inline function getInc(k:Int, mask:Int):Int // return 1 for linear probing + return (((k) >> 3 ^ (k) << 3) | 1) & (mask); + + extern private static inline function isEither(v:HashType):Bool + return (v & 0xFFFFFFFE) == 0; + + extern private static inline function isEmpty(v:HashType):Bool + return v == FLAG_EMPTY; + + extern private static inline function isDel(v:HashType):Bool + return v == FLAG_DEL; + + // guarantee: Whatever this function is, it will never return 0 nor 1 + extern private static inline function hash(s:Dynamic):HashType { + var k:Int = untyped s.hashCode(); + // k *= 357913941; + // k ^= k << 24; + // k += ~357913941; + // k ^= k >> 31; + // k ^= k << 31; + + k = (k + 0x7ed55d16) + (k << 12); + k = (k ^ 0xc761c23c) ^ (k >> 19); + k = (k + 0x165667b1) + (k << 5); + k = (k + 0xd3a2646c) ^ (k << 9); + k = (k + 0xfd7046c5) + (k << 3); + k = (k ^ 0xb55a4f09) ^ (k >> 16); + + var ret = k; + if (isEither(ret)) { + if (ret == 0) + ret = 2; + else + ret = 0xFFFFFFFF; + } + + return ret; + } + + extern private static inline function arrayCopy(sourceArray:Dynamic, sourceIndex:Int, destinationArray:Dynamic, destinationIndex:Int, length:Int):Void + java.lang.System.arraycopy(sourceArray, sourceIndex, destinationArray, destinationIndex, length); + + extern private static inline function assert(x:Bool):Void { + #if DEBUG_HASHTBL + if (!x) + throw "assert failed"; + #end + } +} + +private class Entry extends WeakReference { + public var value:V; + public var hash(default, null):Int; + + public function new(key:K, value:V, hash:Int, queue:ReferenceQueue) { + super(key, queue); + this.value = value; + this.hash = hash; + } + + final inline public function keyEquals(k:K):Bool { + return k != null && untyped k.equals(get()); + } +} + +@:access(haxe.ds.WeakMap) +private final class WeakMapKeyIterator { + var m:WeakMap; + var i:Int; + var len:Int; + var lastKey:T; + + public function new(m:WeakMap) { + this.i = 0; + this.m = m; + this.len = m.nBuckets; + } + + public function hasNext():Bool { + for (j in i...len) { + if (!WeakMap.isEither(m.hashes[j])) { + var entry = m.entries[j], last = entry.get(); + if (last != null) { + #if !no_map_cache + m.cachedIndex = i; + m.cachedEntry = entry; + #end + lastKey = last; // keep a strong reference to the key while iterating, so it doesn't get collected + i = j; + return true; + } + } + } + lastKey = null; + return false; + } + + public function next():T { + i = i + 1; + return lastKey; + } +} + +@:access(haxe.ds.WeakMap) +private final class WeakMapValueIterator { + var m:WeakMap; + var i:Int; + var len:Int; + + public function new(m:WeakMap) { + this.i = 0; + this.m = m; + this.len = m.nBuckets; + } + + public function hasNext():Bool { + for (j in i...len) { + if (!WeakMap.isEither(m.hashes[j]) && m.entries[j].get() != null) { + i = j; + return true; + } + } + return false; + } + + public inline function next():T { + var ret = m.entries[i]; + i = i + 1; + return ret.value; + } +} + +private typedef HashType = Int; diff --git a/build/linux64_569e52e/std/java/_std/haxe/zip/Compress.hx b/build/linux64_569e52e/std/java/_std/haxe/zip/Compress.hx new file mode 100644 index 0000000..9e4585e --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/haxe/zip/Compress.hx @@ -0,0 +1,82 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.zip; + +import java.util.zip.Deflater; + +class Compress { + var deflater:Deflater; + var mode:Int; + var finish:Bool = false; + + public function new(level:Int) { + throw new haxe.exceptions.NotImplementedException("Not implemented for this platform"); // FIXME: Add unit tests for Compress/Uncompress and check current implementation + this.deflater = new Deflater(level); + this.mode = Deflater.NO_FLUSH; + } + + public function execute(src:haxe.io.Bytes, srcPos:Int, dst:haxe.io.Bytes, dstPos:Int):{done:Bool, read:Int, write:Int} { + deflater.setInput(src.getData(), srcPos, src.length - srcPos); + if (finish) + deflater.finish(); + finish = false; + + var written = deflater.deflate(dst.getData(), dstPos, dst.length - dstPos); + var read = deflater.getTotalIn(); + return {done: deflater.finished(), read: read, write: written}; + } + + public function setFlushMode(f:FlushMode) { + this.mode = switch (f) { + case NO: + Deflater.NO_FLUSH; + case SYNC: + Deflater.SYNC_FLUSH; + case FULL: + Deflater.FULL_FLUSH; + case FINISH: + this.finish = true; + Deflater.FULL_FLUSH; + case BLOCK: + throw new haxe.exceptions.NotImplementedException(); + } + } + + public function close() { + deflater.end(); + } + + public static function run(s:haxe.io.Bytes, level:Int):haxe.io.Bytes { + var deflater = new java.util.zip.Deflater(level); + deflater.setInput(s.getData()); + var outputStream = new java.io.ByteArrayOutputStream(s.length); + deflater.finish(); + var buffer = haxe.io.Bytes.alloc(1024).getData(); + while (!deflater.finished()) { + var count = deflater.deflate(buffer); + outputStream.write(buffer, 0, count); + } + outputStream.close(); + return haxe.io.Bytes.ofData(outputStream.toByteArray()); + } +} diff --git a/build/linux64_569e52e/std/java/_std/haxe/zip/Uncompress.hx b/build/linux64_569e52e/std/java/_std/haxe/zip/Uncompress.hx new file mode 100644 index 0000000..b701200 --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/haxe/zip/Uncompress.hx @@ -0,0 +1,64 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.zip; + +import java.util.zip.Inflater; + +class Uncompress { + final inflater:Inflater; + + public function new(?windowBits:Int) { + inflater = new Inflater(windowBits != null && windowBits < 0); + } + + public function execute(src:haxe.io.Bytes, srcPos:Int, dst:haxe.io.Bytes, dstPos:Int):{done:Bool, read:Int, write:Int} { + inflater.setInput(src.getData(), srcPos, src.length - srcPos); + inflater.inflate(dst.getData(), dstPos, dst.length - dstPos); + return { + done: inflater.finished(), + read: Int64.toInt(inflater.getBytesRead()), + write: Int64.toInt(inflater.getBytesWritten()) + }; + } + + public function setFlushMode(f:FlushMode) {} + + public function close() { + inflater.end(); + } + + public static function run(src:haxe.io.Bytes, ?bufsize:Int):haxe.io.Bytes { + var decompresser = new java.util.zip.Inflater(); + var buf = haxe.io.Bytes.alloc(bufsize == null ? src.length : bufsize).getData(); + + var out = new java.io.ByteArrayOutputStream(src.length); + decompresser.setInput(src.getData(), 0, src.length); + + while (!decompresser.finished()) { + var count = decompresser.inflate(buf); + out.write(buf, 0, count); + } + out.close(); + return haxe.io.Bytes.ofData(out.toByteArray()); + } +} diff --git a/build/linux64_569e52e/std/java/_std/sys/FileSystem.hx b/build/linux64_569e52e/std/java/_std/sys/FileSystem.hx new file mode 100644 index 0000000..2635b44 --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/sys/FileSystem.hx @@ -0,0 +1,124 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys; + +import java.io.File; +import java.Lib; + +@:coreApi +class FileSystem { + public static function exists(path:String):Bool { + return new File(path).exists(); + } + + public static function rename(path:String, newPath:String):Void { + if (!new File(path).renameTo(new File(newPath))) { + throw "Cannot rename " + path + " to " + newPath; + } + } + + public static function stat(path:String):FileStat { + var f = new File(path); + if (!f.exists()) + throw "Path " + path + " doesn't exist"; + + try { + final pathObject = java.nio.file.Paths.get(path); + final attributes = java.nio.file.Files.readAttributes(pathObject, "unix:*"); + + return { + atime: Date.fromTime(cast(attributes.get("lastAccessTime").toMillis(), Float)), + ctime: Date.fromTime(cast(attributes.get("creationTime").toMillis(), Float)), + dev: cast(attributes.get("dev"), Int), + gid: attributes.get("gid"), + ino: cast(attributes.get("ino"), Int), + mode: attributes.get("mode"), + mtime: Date.fromTime(cast(attributes.get("lastModifiedTime").toMillis(), Float)), + nlink: attributes.get("nlink"), + rdev: cast(attributes.get("rdev"), Int), + size: cast(attributes.get("size"), Int), + uid: attributes.get("uid"), + }; + } + + catch (e) { + return { + gid: 0, // java doesn't let you get this info + uid: 0, // same + atime: Date.now(), // same + mtime: Date.fromTime(cast(f.lastModified(), Float)), + ctime: Date.fromTime(cast(f.lastModified(), Float)), // same + size: cast(f.length(), Int), // TODO: maybe change to Int64 for Haxe 3? + dev: 0, // FIXME: not sure what that is + ino: 0, // FIXME: not sure what that is + nlink: 0, // FIXME: not sure what that is + rdev: 0, // FIXME: not sure what that is + mode: 0 // FIXME: not sure what that is + }; + } + } + + public static function fullPath(relPath:String):String { + try { + return new File(relPath).getCanonicalPath(); + } catch (e:java.io.IOException) { + throw new java.lang.RuntimeException(e); + } + } + + public static function absolutePath(relPath:String):String { + if (haxe.io.Path.isAbsolute(relPath)) + return relPath; + return haxe.io.Path.join([Sys.getCwd(), relPath]); + } + + public static function isDirectory(path:String):Bool { + var f = new File(path); + if (!f.exists()) + throw "Path " + path + " doesn't exist"; + return f.isDirectory(); + } + + public static function createDirectory(path:String):Void { + var f = new File(path); + if (!f.isDirectory() && !f.mkdirs()) + throw "Cannot create dir " + path; + } + + public static function deleteFile(path:String):Void { + if (!new File(path).delete()) + throw "Cannot delete file " + path; + } + + public static function deleteDirectory(path:String):Void { + if (!new File(path).delete()) + throw "Cannot delete directory " + path; + } + + public static function readDirectory(path:String):Array { + var f = new File(path); + if (!f.exists()) + throw "Path " + path + " doesn't exist"; + return Lib.array(f.list()); + } +} diff --git a/build/linux64_569e52e/std/java/_std/sys/io/File.hx b/build/linux64_569e52e/std/java/_std/sys/io/File.hx new file mode 100644 index 0000000..3c7b909 --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/sys/io/File.hx @@ -0,0 +1,120 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.io; + +@:coreApi +class File { + public static function getContent(path:String):String { + var f = read(path, false); + var ret = f.readAll().toString(); + f.close(); + return ret; + } + + public static function saveContent(path:String, content:String):Void { + var f = write(path, false); + f.writeString(content); + f.close(); + } + + public static function getBytes(path:String):haxe.io.Bytes { + var f = read(path, true); + var ret = f.readAll(); + f.close(); + return ret; + } + + public static function saveBytes(path:String, bytes:haxe.io.Bytes):Void { + var f = write(path, true); + f.writeBytes(bytes, 0, bytes.length); + f.close(); + } + + public static function read(path:String, binary:Bool = true):FileInput { + try { + return @:privateAccess new FileInput(new java.io.RandomAccessFile(new java.io.File(path), "r")); + } catch (e:Dynamic) { + // swallow checked exceptions + throw e; + } + } + + public static function write(path:String, binary:Bool = true):FileOutput { + var f = new java.io.File(path); + if (f.exists()) { + f.delete(); + } + + try { + return @:privateAccess new FileOutput(new java.io.RandomAccessFile(f, "rw")); + } catch (e:Dynamic) { + // swallow checked exceptions + throw e; + } + } + + public static function append(path:String, binary:Bool = true):FileOutput { + var f = new java.io.File(path); + + try { + var ra = new java.io.RandomAccessFile(f, "rw"); + if (f.exists()) { + ra.seek(f.length()); + } + return @:privateAccess new FileOutput(ra); + } catch (e:Dynamic) { + // swallow checked exceptions + throw e; + } + } + + public static function update(path:String, binary:Bool = true):FileOutput { + var f = new java.io.File(path); + + try { + var ra = new java.io.RandomAccessFile(f, "rw"); + return @:privateAccess new FileOutput(ra); + } catch (e:Dynamic) { + // swallow checked exceptions + throw e; + } + } + + public static function copy(srcPath:String, dstPath:String):Void { + var r:FileInput = null; + var w:FileOutput = null; + try { + r = read(srcPath); + w = write(dstPath); + w.writeInput(r); + r.close(); + w.close(); + } catch (e:Dynamic) { + if (r != null) + r.close(); + if (w != null) + w.close(); + throw e; + } + } +} diff --git a/build/linux64_569e52e/std/java/_std/sys/io/FileInput.hx b/build/linux64_569e52e/std/java/_std/sys/io/FileInput.hx new file mode 100644 index 0000000..6e4a080 --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/sys/io/FileInput.hx @@ -0,0 +1,111 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.io; + +import haxe.Int64; +import haxe.io.Bytes; +import haxe.io.Eof; +import haxe.io.Input; +import java.io.EOFException; +import java.io.IOException; + +class FileInput extends Input { + var f:java.io.RandomAccessFile; + var _eof:Bool; + + function new(f) { + this.f = f; + this._eof = false; + } + + override public function close() { + try + f.close() + catch (e:Dynamic) + throw e; + } + + override public function readByte():Int { + try { + return f.readUnsignedByte(); + } catch (e:EOFException) { + + _eof = true; + throw new Eof(); + } catch (e:IOException) { + throw haxe.io.Error.Custom(e); + } + } + + override public function readBytes(s:Bytes, pos:Int, len:Int):Int { + var ret = 0; + try { + ret = f.read(s.getData(), pos, len); + } catch (e:EOFException) { + + _eof = true; + throw new Eof(); + } catch (e:IOException) { + throw haxe.io.Error.Custom(e); + } + + if (ret == -1) { + _eof = true; + throw new Eof(); + } + + return ret; + } + + public function seek(p:Int, pos:FileSeek):Void { + _eof = false; + try { + switch (pos) { + case SeekBegin: + f.seek(cast p); + case SeekCur: + f.seek(haxe.Int64.add(f.getFilePointer(), cast(p, Int64))); + case SeekEnd: + f.seek(haxe.Int64.add(f.length(), cast p)); + } + } catch (e:EOFException) { + + _eof = true; + throw new Eof(); + } catch (e:IOException) { + throw haxe.io.Error.Custom(e); + } + } + + public function tell():Int { + try { + return cast f.getFilePointer(); + } catch (e:IOException) { + throw haxe.io.Error.Custom(e); + } + } + + public inline function eof():Bool { + return _eof; + } +} diff --git a/build/linux64_569e52e/std/java/_std/sys/io/FileOutput.hx b/build/linux64_569e52e/std/java/_std/sys/io/FileOutput.hx new file mode 100644 index 0000000..193353b --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/sys/io/FileOutput.hx @@ -0,0 +1,94 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.io; + +import haxe.io.Bytes; +import haxe.io.Eof; +import haxe.io.Output; +import java.io.EOFException; +import java.io.IOException; + +class FileOutput extends Output { + var f:java.io.RandomAccessFile; + + function new(f) { + this.f = f; + } + + override public function close() { + try + f.close() + catch (e:Dynamic) + throw e; + } + + override public function writeByte(c:Int):Void { + try { + this.f.write(c); + } catch (e:IOException) { + throw haxe.io.Error.Custom(e); + } + } + + override public function write(s:Bytes):Void { + try { + this.f.write(s.getData()); + } catch (e:IOException) { + throw haxe.io.Error.Custom(e); + } + } + + override public function writeBytes(s:Bytes, pos:Int, len:Int):Int { + try { + this.f.write(s.getData(), pos, len); + return len; + } catch (e:IOException) { + throw haxe.io.Error.Custom(e); + } + } + + public function seek(p:Int, pos:FileSeek):Void { + try { + switch (pos) { + case SeekBegin: + f.seek(cast p); + case SeekCur: + f.seek(haxe.Int64.add(f.getFilePointer(), cast(p, haxe.Int64))); + case SeekEnd: + f.seek(haxe.Int64.add(f.length(), cast p)); + } + } catch (e:EOFException) { + throw new Eof(); + } catch (e:IOException) { + throw haxe.io.Error.Custom(e); + } + } + + public function tell():Int { + try { + return cast f.getFilePointer(); + } catch (e:IOException) { + throw haxe.io.Error.Custom(e); + } + } +} diff --git a/build/linux64_569e52e/std/java/_std/sys/io/Process.hx b/build/linux64_569e52e/std/java/_std/sys/io/Process.hx new file mode 100644 index 0000000..aa25842 --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/sys/io/Process.hx @@ -0,0 +1,176 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.io; + +import haxe.SysTools; +import haxe.io.Bytes; +import haxe.io.BytesInput; +import haxe.io.Eof; +import java.io.IOException; +import java.io.EOFException; +import java.NativeArray; + +@:coreApi +class Process { + public var stdout(default, null):haxe.io.Input; + public var stderr(default, null):haxe.io.Input; + public var stdin(default, null):haxe.io.Output; + + private var proc:java.lang.Process; + + @:allow(Sys) + private static function createProcessBuilder(cmd:String, ?args:Array):java.lang.ProcessBuilder { + var sysName = Sys.systemName(); + var pargs; + if (args == null) { + var cmdStr = cmd; + switch (sysName) { + case "Windows": + pargs = new NativeArray(3); + pargs[0] = cmd = switch (Sys.getEnv("COMSPEC")) { + case null: "cmd.exe"; + case var comspec: comspec; + } + pargs[1] = '/C'; + pargs[2] = '"$cmdStr"'; + case _: + pargs = new NativeArray(3); + pargs[0] = cmd = "/bin/sh"; + pargs[1] = "-c"; + pargs[2] = cmdStr; + } + } else { + pargs = new NativeArray(args.length + 1); + switch (sysName) { + case "Windows": + pargs[0] = SysTools.quoteWinArg(cmd, false); + for (i in 0...args.length) { + pargs[i + 1] = SysTools.quoteWinArg(args[i], false); + } + case _: + pargs[0] = cmd; + for (i in 0...args.length) { + pargs[i + 1] = args[i]; + } + } + } + + return new java.lang.ProcessBuilder(...pargs); + } + + public function new(cmd:String, ?args:Array, ?detached:Bool):Void { + if (detached) + throw "Detached process is not supported on this platform"; + var p = proc = createProcessBuilder(cmd, args).start(); + stderr = new ProcessInput(p.getErrorStream()); + stdout = new ProcessInput(p.getInputStream()); + stdin = new java.io.NativeOutput(p.getOutputStream()); + } + + public function getPid():Int { + if (Reflect.hasField(proc, "pid")) + return Reflect.field(proc, "pid"); + return -1; + } + + public function exitCode(block:Bool = true):Null { + if (block == false) { + try { + return proc.exitValue(); + } catch (e:Dynamic) { + return null; + } + } + + cast(stdout, ProcessInput).bufferContents(); + cast(stderr, ProcessInput).bufferContents(); + try { + proc.waitFor(); + } catch (e:Dynamic) { + throw e; + } + return proc.exitValue(); + } + + public function close():Void { + proc.destroy(); + } + + public function kill():Void { + proc.destroy(); + } +} + +private class ProcessInput extends java.io.NativeInput { + private var chained:BytesInput; + + public function bufferContents():Void { + if (chained != null) + return; + var b = this.readAll(); + chained = new BytesInput(b); + } + + override public function readByte():Int { + if (chained != null) + return chained.readByte(); + var ret = 0; + try { + ret = stream.read(); + } catch (e:IOException) { + throw haxe.io.Error.Custom(e); + } + if (ret == -1) + throw new Eof(); + return ret; + } + + override public function readBytes(s:Bytes, pos:Int, len:Int):Int { + if (chained != null) + return chained.readBytes(s, pos, len); + + var ret = -1; + try { + ret = stream.read(s.getData(), pos, len); + } catch (e:EOFException) { + + throw new Eof(); + } catch (e:IOException) { + throw haxe.io.Error.Custom(e); + } + + if (ret == -1) + throw new Eof(); + return ret; + } + + override public function close():Void { + if (chained != null) + chained.close(); + try { + stream.close(); + } catch (e:IOException) { + throw haxe.io.Error.Custom(e); + } + } +} diff --git a/build/linux64_569e52e/std/java/_std/sys/net/Host.hx b/build/linux64_569e52e/std/java/_std/sys/net/Host.hx new file mode 100644 index 0000000..320b69e --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/sys/net/Host.hx @@ -0,0 +1,58 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.net; + +import java.net.InetAddress; + +class Host { + public var host(default, null):String; + public var ip(default, null):Int; + + @:allow(sys.net) private var wrapped:InetAddress; + + public function new(name:String):Void { + host = name; + try + this.wrapped = InetAddress.getByName(name) + catch (e:Dynamic) + throw e; + var rawIp = wrapped.getAddress(); + // network byte order assumed + this.ip = cast(rawIp[3], Int) | (cast(rawIp[2], Int) << 8) | (cast(rawIp[1], Int) << 16) | (cast(rawIp[0], Int) << 24); + } + + public function toString():String { + return wrapped.getHostAddress(); + } + + public function reverse():String { + return wrapped.getHostName(); + } + + public static function localhost():String { + try { + return InetAddress.getLocalHost().getHostName(); + } catch (e:Dynamic) + throw e; + } +} diff --git a/build/linux64_569e52e/std/java/_std/sys/net/Socket.hx b/build/linux64_569e52e/std/java/_std/sys/net/Socket.hx new file mode 100644 index 0000000..90b9d77 --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/sys/net/Socket.hx @@ -0,0 +1,164 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.net; + +import java.net.InetSocketAddress; + +@:coreApi +class Socket { + public var input(default, null):haxe.io.Input; + public var output(default, null):haxe.io.Output; + + public var custom:Dynamic; + + private var sock:java.net.Socket; + private var server:java.net.ServerSocket; + private var boundAddr:java.net.SocketAddress; + + public function new():Void { + create(); + } + + private function create():Void { + this.sock = new java.net.Socket(); + try { + this.server = new java.net.ServerSocket(); + } catch (e:Dynamic) + throw e; + } + + public function close():Void { + try { + if (sock != null) + this.sock.close(); + if (server != null) + this.server.close(); + } catch (e:Dynamic) + throw e; + } + + public function read():String { + return input.readAll().toString(); + } + + public function write(content:String):Void { + output.writeString(content); + } + + public function connect(host:Host, port:Int):Void { + try { + sock.connect(new InetSocketAddress(host.wrapped, port)); + this.output = new java.io.NativeOutput(sock.getOutputStream()); + this.input = new java.io.NativeInput(sock.getInputStream()); + } catch (e:Dynamic) + throw e; + } + + public function listen(connections:Int):Void { + if (boundAddr == null) + throw "You must bind the Socket to an address!"; + try + server.bind(boundAddr, connections) + catch (e:Dynamic) + throw e; + } + + public function shutdown(read:Bool, write:Bool):Void { + try { + if (read) + sock.shutdownInput(); + if (write) + sock.shutdownOutput(); + } catch (e:Dynamic) + throw e; + } + + public function bind(host:Host, port:Int):Void { + if (boundAddr != null) { + if (server.isBound()) + throw "Already bound"; + } + this.boundAddr = new java.net.InetSocketAddress(host.wrapped, port); + } + + public function accept():Socket { + var ret = try server.accept() catch (e:Dynamic) throw e; + + var s = new Socket(); + s.sock = ret; + s.output = new java.io.NativeOutput(ret.getOutputStream()); + s.input = new java.io.NativeInput(ret.getInputStream()); + + return s; + } + + public function peer():{host:Host, port:Int} { + var rem = sock.getInetAddress(); + if (rem == null) + return null; + + var host = new Host(null); + host.wrapped = rem; + return {host: host, port: sock.getPort()}; + } + + public function host():{host:Host, port:Int} { + var local = sock.getLocalAddress(); + var host = new Host(null); + host.wrapped = local; + + if (boundAddr != null) { + return {host: host, port: server.getLocalPort()}; + } + + return {host: host, port: sock.getLocalPort()}; + } + + public function setTimeout(timeout:Float):Void { + try + sock.setSoTimeout(Std.int(timeout * 1000)) + catch (e:Dynamic) + throw e; + } + + public function waitForRead():Void { + throw new haxe.exceptions.NotImplementedException(); + } + + public function setBlocking(b:Bool):Void { + throw new haxe.exceptions.NotImplementedException(); + } + + public function setFastSend(b:Bool):Void { + try + sock.setTcpNoDelay(b) + catch (e:Dynamic) + throw e; + } + + public static function select(read:Array, write:Array, others:Array, + ?timeout:Float):{read:Array, write:Array, others:Array} { + throw new haxe.exceptions.NotImplementedException(); + return null; + } +} diff --git a/build/linux64_569e52e/std/java/_std/sys/thread/Condition.hx b/build/linux64_569e52e/std/java/_std/sys/thread/Condition.hx new file mode 100644 index 0000000..fb469d0 --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/sys/thread/Condition.hx @@ -0,0 +1,45 @@ +package sys.thread; + +import java.util.concurrent.locks.ReentrantLock; +import java.util.concurrent.locks.Condition as NativeCondition; + +@:access(sys.thread.Mutex) +@:coreApi +@:native('haxe.java.vm.Condition') +class Condition { + final lock:ReentrantLock; + final native:NativeCondition; + + public function new():Void { + this.lock = new ReentrantLock(); + this.native = lock.newCondition(); + } + + public function acquire():Void { + lock.lock(); + } + + public function tryAcquire():Bool { + return this.lock.tryLock(); + } + + public function release():Void { + lock.unlock(); + } + + // without the @:native, you get "java.lang.VerifyError: class sys.thread.Condition overrides final method java.lang.Object.wait()V" on jvm + // and "wait() in Condition cannot override wait() in Object" from javac + + @:native("waitOn") + public function wait():Void { + native.await(); + } + + public function signal():Void { + native.signal(); + } + + public function broadcast():Void { + native.signalAll(); + } +} diff --git a/build/linux64_569e52e/std/java/_std/sys/thread/Deque.hx b/build/linux64_569e52e/std/java/_std/sys/thread/Deque.hx new file mode 100644 index 0000000..dc7b0fd --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/sys/thread/Deque.hx @@ -0,0 +1,51 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.thread; + +import java.Lib; + +@:coreApi +@:native('haxe.java.vm.Deque') +@:nativeGen class Deque { + var lbd:java.util.concurrent.LinkedBlockingDeque; + + public function new() { + lbd = new java.util.concurrent.LinkedBlockingDeque(); + } + + public function add(i:T):Void { + lbd.add(i); + } + + public function push(i:T):Void { + lbd.push(i); + } + + public inline function pop(block:Bool):Null { + return if (block) { + lbd.take(); + } else { + lbd.poll(); + } + } +} diff --git a/build/linux64_569e52e/std/java/_std/sys/thread/Mutex.hx b/build/linux64_569e52e/std/java/_std/sys/thread/Mutex.hx new file mode 100644 index 0000000..8f0a813 --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/sys/thread/Mutex.hx @@ -0,0 +1,46 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.thread; + +import java.util.concurrent.locks.ReentrantLock; + +@:coreApi +@:native('haxe.java.vm.Mutex') class Mutex { + @:private var lock:ReentrantLock; + + public function new() { + this.lock = new ReentrantLock(); + } + + public function tryAcquire():Bool { + return this.lock.tryLock(); + } + + public function acquire():Void { + this.lock.lock(); + } + + public function release():Void { + this.lock.unlock(); + } +} diff --git a/build/linux64_569e52e/std/java/_std/sys/thread/Semaphore.hx b/build/linux64_569e52e/std/java/_std/sys/thread/Semaphore.hx new file mode 100644 index 0000000..329434a --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/sys/thread/Semaphore.hx @@ -0,0 +1,25 @@ +package sys.thread; + +import java.util.concurrent.TimeUnit; + +@:coreApi +@:native('haxe.java.vm.Semaphore') +class Semaphore { + final native:java.util.concurrent.Semaphore; + + public function new(value:Int):Void { + this.native = new java.util.concurrent.Semaphore(value); + } + + public function acquire():Void { + native.acquire(); + } + + public function tryAcquire(?timeout:Float):Bool { + return timeout == null ? native.tryAcquire() : native.tryAcquire(haxe.Int64.fromFloat(timeout * 1000000000),TimeUnit.NANOSECONDS); + } + + public function release():Void { + native.release(); + } +} diff --git a/build/linux64_569e52e/std/java/_std/sys/thread/Thread.hx b/build/linux64_569e52e/std/java/_std/sys/thread/Thread.hx new file mode 100644 index 0000000..e76717b --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/sys/thread/Thread.hx @@ -0,0 +1,190 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.thread; + +import java.Lib; +import java.lang.Runnable; +import java.util.WeakHashMap; +import java.util.Collections; +import java.lang.Thread as JavaThread; +import java.lang.System; +import java.StdTypes.Int64 as Long; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.LinkedBlockingDeque; + +private typedef ThreadImpl = HaxeThread; + +abstract Thread(ThreadImpl) from ThreadImpl { + public var events(get,never):EventLoop; + + inline function new(t:HaxeThread) { + this = t; + } + + public static inline function create(job:()->Void):Thread { + return HaxeThread.create(job, false); + } + + public static inline function current():Thread { + return HaxeThread.get(JavaThread.currentThread()); + } + + public static inline function runWithEventLoop(job:()->Void):Void { + HaxeThread.runWithEventLoop(job); + } + + public static inline function createWithEventLoop(job:()->Void):Thread { + return HaxeThread.create(job, true); + } + + public static inline function readMessage(block:Bool):Dynamic { + return current().getHandle().readMessage(block); + } + + public inline function sendMessage(msg:Dynamic):Void { + this.sendMessage(msg); + } + + inline function getHandle():HaxeThread { + return this; + } + + function get_events():EventLoop { + if(this.events == null) + throw new NoEventLoopException(); + return this.events; + } + + @:keep //TODO: keep only if events are actually used + static function processEvents():Void { + current().getHandle().events.loop(); + } +} + +private class HaxeThread { + static var nativeThreads:java.util.Map; + static var mainJavaThread:JavaThread; + static var mainHaxeThread:HaxeThread; + + static function __init__() { + nativeThreads = Collections.synchronizedMap(new WeakHashMap()); + mainJavaThread = JavaThread.currentThread(); + mainHaxeThread = new HaxeThread(); + mainHaxeThread.events = new EventLoop(); + } + + public final messages = new LinkedBlockingDeque(); + + public var events(default,null):Null; + + public static function create(job:()->Void, withEventLoop:Bool):HaxeThread { + var hx = new HaxeThread(); + if(withEventLoop) + hx.events = new EventLoop(); + var thread = new NativeHaxeThread(hx, job, withEventLoop); + thread.setDaemon(true); + thread.start(); + return hx; + } + + public static function get(javaThread:JavaThread):HaxeThread { + if(javaThread == mainJavaThread) { + return mainHaxeThread; + } else if(javaThread is NativeHaxeThread) { + return (cast javaThread:NativeHaxeThread).haxeThread; + } else { + switch nativeThreads.get(javaThread) { + case null: + var hx = new HaxeThread(); + nativeThreads.put(javaThread, hx); + return hx; + case hx: + return hx; + } + } + } + + public static function runWithEventLoop(job:()->Void):Void { + var thread = get(JavaThread.currentThread()); + if(thread.events == null) { + thread.events = new EventLoop(); + try { + job(); + thread.events.loop(); + thread.events = null; + } catch(e) { + thread.events = null; + throw e; + } + } else { + job(); + } + } + + function new() {} + + public function sendMessage(msg:Dynamic):Void { + messages.add(msg); + } + + public function readMessage(block:Bool):Dynamic { + return block ? messages.take() : messages.poll(); + } +} + +private class NativeHaxeThread extends java.lang.Thread { + public final haxeThread:HaxeThread; + final withEventLoop:Bool; + + public function new(haxeThread:HaxeThread, job:()->Void, withEventLoop:Bool) { + super(new Job(job)); + this.haxeThread = haxeThread; + this.withEventLoop = withEventLoop; + } + + override overload public function run() { + super.run(); + if(withEventLoop) + haxeThread.events.loop(); + } +} + +#if jvm +private abstract Job(Runnable) from Runnable to Runnable { + public inline function new(job:()->Void) { + this = cast job; + } +} +#else +private class Job implements Runnable { + final job:()->Void; + + public function new(job:()->Void) { + this.job = job; + } + + public function run() { + job(); + } +} +#end \ No newline at end of file diff --git a/build/linux64_569e52e/std/java/_std/sys/thread/Tls.hx b/build/linux64_569e52e/std/java/_std/sys/thread/Tls.hx new file mode 100644 index 0000000..54ec7d1 --- /dev/null +++ b/build/linux64_569e52e/std/java/_std/sys/thread/Tls.hx @@ -0,0 +1,43 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package sys.thread; + +// @:coreApi // causes some overload error... +@:native('haxe.java.vm.Tls') class Tls { + var t:java.lang.ThreadLocal; + + public var value(get, set):T; + + public function new() { + this.t = new java.lang.ThreadLocal(); + } + + inline private function get_value():T { + return t.get(); + } + + inline private function set_value(v:T):T { + t.set(v); + return v; + } +} diff --git a/build/linux64_569e52e/std/java/io/NativeInput.hx b/build/linux64_569e52e/std/java/io/NativeInput.hx new file mode 100644 index 0000000..d6f34c3 --- /dev/null +++ b/build/linux64_569e52e/std/java/io/NativeInput.hx @@ -0,0 +1,74 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java.io; + +import haxe.Int64; +import haxe.io.Bytes; +import haxe.io.Eof; +import haxe.io.Input; +import java.io.IOException; +import java.io.EOFException; + +@:native('haxe.java.io.NativeInput') class NativeInput extends Input { + var stream:java.io.InputStream; + + public function new(stream) { + this.stream = stream; + } + + override public function readByte():Int { + var ret = 0; + try { + ret = stream.read(); + } catch (e:IOException) { + throw haxe.io.Error.Custom(e); + } + if (ret == -1) + throw new Eof(); + return ret; + } + + override public function readBytes(s:Bytes, pos:Int, len:Int):Int { + var ret = 0; + try { + ret = stream.read(s.getData(), pos, len); + } catch (e:EOFException) { + + throw new Eof(); + } catch (e:IOException) { + throw haxe.io.Error.Custom(e); + } + + if (ret == -1) + throw new Eof(); + return ret; + } + + override public function close():Void { + try { + stream.close(); + } catch (e:IOException) { + throw haxe.io.Error.Custom(e); + } + } +} diff --git a/build/linux64_569e52e/std/java/io/NativeOutput.hx b/build/linux64_569e52e/std/java/io/NativeOutput.hx new file mode 100644 index 0000000..cdf693c --- /dev/null +++ b/build/linux64_569e52e/std/java/io/NativeOutput.hx @@ -0,0 +1,65 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java.io; + +import haxe.Int64; +import haxe.io.Bytes; +import haxe.io.Eof; +import haxe.io.Output; +import java.io.IOException; +import java.io.EOFException; + +@:native('haxe.java.io.NativeOutput') class NativeOutput extends Output { + var stream:java.io.OutputStream; + + public function new(stream) { + this.stream = stream; + } + + override public function writeByte(c:Int):Void { + try { + stream.write(c); + } catch (e:EOFException) { + + throw new Eof(); + } catch (e:IOException) { + throw haxe.io.Error.Custom(e); + } + } + + override public function close():Void { + try { + stream.close(); + } catch (e:IOException) { + throw haxe.io.Error.Custom(e); + } + } + + override public function flush():Void { + try { + stream.flush(); + } catch (e:IOException) { + throw haxe.io.Error.Custom(e); + } + } +} diff --git a/build/linux64_569e52e/std/java/lang/Boolean.hx b/build/linux64_569e52e/std/java/lang/Boolean.hx new file mode 100644 index 0000000..58d9d7a --- /dev/null +++ b/build/linux64_569e52e/std/java/lang/Boolean.hx @@ -0,0 +1,59 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java.lang; + +@:native("") // make sure the generator won't see this +@:transitive +@:forwardStatics +@:forward abstract Boolean(BooleanClass) from BooleanClass to BooleanClass { + @:to extern inline public function toBool():Bool + return this.booleanValue(); + + @:from extern inline public static function fromBool(b:Bool):Boolean + return BooleanClass.valueOf(b); +} + +@:native("java.lang.Boolean") extern class BooleanClass extends Number implements Comparable { + @:overload function new(bool:Bool):Void; + @:overload function new(string:String):Void; + @:overload function booleanValue():Bool; + @:overload function compareTo(param1:Boolean):Int; + @:overload function compareTo(param1:Dynamic):Int; + @:overload function equals(param1:Dynamic):Bool; + @:overload function hashCode():Int; + @:overload function toString():String; + static final FALSE:Boolean; + static final TRUE:Boolean; + static final TYPE:Class; + @:overload static function compare(param1:Bool, param2:Bool):Int; + @:overload static function getBoolean(param1:String):Bool; + @:overload static function parseBoolean(param1:String):Bool; + @:native("toString") @:overload static function _toString(param1:Bool):String; + @:overload static function valueOf(param1:Bool):Boolean; + @:overload static function valueOf(param1:String):Boolean; + + function doubleValue():Float; + function floatValue():Single; + function intValue():Int; + function longValue():haxe.Int64; +} diff --git a/build/linux64_569e52e/std/java/lang/Byte.hx b/build/linux64_569e52e/std/java/lang/Byte.hx new file mode 100644 index 0000000..cd673ba --- /dev/null +++ b/build/linux64_569e52e/std/java/lang/Byte.hx @@ -0,0 +1,64 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java.lang; + +@:native("") // make sure the generator won't see this +@:transitive +@:forwardStatics +@:forward abstract Byte(ByteClass) from ByteClass to ByteClass { + @:to extern inline public function toByte():java.types.Int8 + return this.byteValue(); + + @:from extern inline public static function fromByte(b:java.types.Int8):Byte + return ByteClass.valueOf(b); +} + +@:native("java.lang.Byte") extern class ByteClass extends Number implements Comparable { + @:overload function new(param1:java.types.Int8):Void; + @:overload @:throws("java.lang.NumberFormatException") function new(param1:String):Void; + @:overload function compareTo(param1:Byte):Int; + @:overload function compareTo(param1:Dynamic):Int; + @:overload function equals(param1:Dynamic):Bool; + @:overload function hashCode():Int; + @:overload function toString():String; + static final MAX_VALUE:java.types.Int8; + static final MIN_VALUE:java.types.Int8; + static final SIZE:Int; + static final TYPE:Class; + @:overload static function compare(param1:java.types.Int8, param2:java.types.Int8):Int; + @:overload @:throws("java.lang.NumberFormatException") static function decode(param1:String):Byte; + @:overload @:throws("java.lang.NumberFormatException") static function parseByte(param1:String, param2:Int):java.types.Int8; + @:overload @:throws("java.lang.NumberFormatException") static function parseByte(param1:String):java.types.Int8; + @:native("toString") @:overload static function _toString(param1:java.types.Int8):String; + @:overload static function valueOf(param1:java.types.Int8):Byte; + @:overload @:throws("java.lang.NumberFormatException") static function valueOf(param1:String):Byte; + @:overload @:throws("java.lang.NumberFormatException") static function valueOf(param1:String, param2:Int):Byte; + + function doubleValue():Float; + function floatValue():Single; + function intValue():Int; + function longValue():haxe.Int64; +} + +@:realPath("java.lang.Byte_ByteCache") @:javaNative @:native("java.lang.Byte$ByteCache") @:javaCanonical("java.lang", + "Byte.ByteCache") extern class Byte_ByteCache {} diff --git a/build/linux64_569e52e/std/java/lang/Character.hx b/build/linux64_569e52e/std/java/lang/Character.hx new file mode 100644 index 0000000..d95ca2f --- /dev/null +++ b/build/linux64_569e52e/std/java/lang/Character.hx @@ -0,0 +1,516 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java.lang; + +@:native("") // make sure the generator won't see this +@:transitive +@:forwardStatics +@:forward abstract Character(CharacterClass) from CharacterClass to CharacterClass { + @:to extern inline public function toCharacter():java.types.Char16 + return this.charValue(); + + @:from extern inline public static function fromCharacter(b:java.types.Char16):Character + return CharacterClass.valueOf(b); +} + +@:native("java.lang.Character") extern class CharacterClass implements Comparable { + @:overload function new(param1:java.types.Char16):Void; + @:overload function charValue():java.types.Char16; + @:overload function compareTo(param1:Character):Int; + @:overload function compareTo(param1:Dynamic):Int; + @:overload function equals(param1:Dynamic):Bool; + @:overload function hashCode():Int; + @:overload function toString():String; + static final COMBINING_SPACING_MARK:java.types.Char16; + static final CONNECTOR_PUNCTUATION:java.types.Char16; + static final CONTROL:java.types.Char16; + static final CURRENCY_SYMBOL:java.types.Char16; + static final DASH_PUNCTUATION:java.types.Char16; + static final DECIMAL_DIGIT_NUMBER:java.types.Char16; + static final DIRECTIONALITY_ARABIC_NUMBER:java.types.Char16; + static final DIRECTIONALITY_BOUNDARY_NEUTRAL:java.types.Char16; + static final DIRECTIONALITY_COMMON_NUMBER_SEPARATOR:java.types.Char16; + static final DIRECTIONALITY_EUROPEAN_NUMBER:java.types.Char16; + static final DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR:java.types.Char16; + static final DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR:java.types.Char16; + static final DIRECTIONALITY_LEFT_TO_RIGHT:java.types.Char16; + static final DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING:java.types.Char16; + static final DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE:java.types.Char16; + static final DIRECTIONALITY_NONSPACING_MARK:java.types.Char16; + static final DIRECTIONALITY_OTHER_NEUTRALS:java.types.Char16; + static final DIRECTIONALITY_PARAGRAPH_SEPARATOR:java.types.Char16; + static final DIRECTIONALITY_POP_DIRECTIONAL_FORMAT:java.types.Char16; + static final DIRECTIONALITY_RIGHT_TO_LEFT:java.types.Char16; + static final DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC:java.types.Char16; + static final DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING:java.types.Char16; + static final DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE:java.types.Char16; + static final DIRECTIONALITY_SEGMENT_SEPARATOR:java.types.Char16; + static final DIRECTIONALITY_UNDEFINED:java.types.Char16; + static final DIRECTIONALITY_WHITESPACE:java.types.Char16; + static final ENCLOSING_MARK:java.types.Char16; + static final END_PUNCTUATION:java.types.Char16; + static final FINAL_QUOTE_PUNCTUATION:java.types.Char16; + static final FORMAT:java.types.Char16; + static final INITIAL_QUOTE_PUNCTUATION:java.types.Char16; + static final LETTER_NUMBER:java.types.Char16; + static final LINE_SEPARATOR:java.types.Char16; + static final LOWERCASE_LETTER:java.types.Char16; + static final MATH_SYMBOL:java.types.Char16; + static final MAX_CODE_POINT:Int; + static final MAX_HIGH_SURROGATE:java.types.Char16; + static final MAX_LOW_SURROGATE:java.types.Char16; + static final MAX_RADIX:Int; + static final MAX_SURROGATE:java.types.Char16; + static final MAX_VALUE:java.types.Char16; + static final MIN_CODE_POINT:Int; + static final MIN_HIGH_SURROGATE:java.types.Char16; + static final MIN_LOW_SURROGATE:java.types.Char16; + static final MIN_RADIX:Int; + static final MIN_SUPPLEMENTARY_CODE_POINT:Int; + static final MIN_SURROGATE:java.types.Char16; + static final MIN_VALUE:java.types.Char16; + static final MODIFIER_LETTER:java.types.Char16; + static final MODIFIER_SYMBOL:java.types.Char16; + static final NON_SPACING_MARK:java.types.Char16; + static final OTHER_LETTER:java.types.Char16; + static final OTHER_NUMBER:java.types.Char16; + static final OTHER_PUNCTUATION:java.types.Char16; + static final OTHER_SYMBOL:java.types.Char16; + static final PARAGRAPH_SEPARATOR:java.types.Char16; + static final PRIVATE_USE:java.types.Char16; + static final SIZE:Int; + static final SPACE_SEPARATOR:java.types.Char16; + static final START_PUNCTUATION:java.types.Char16; + static final SURROGATE:java.types.Char16; + static final TITLECASE_LETTER:java.types.Char16; + static final TYPE:Class; + static final UNASSIGNED:java.types.Char16; + static final UPPERCASE_LETTER:java.types.Char16; + @:overload static function charCount(param1:Int):Int; + @:overload static function codePointAt(param1:CharSequence, param2:Int):Int; + @:overload static function codePointAt(param1:java.NativeArray, param2:Int, param3:Int):Int; + @:overload static function codePointAt(param1:java.NativeArray, param2:Int):Int; + @:overload static function codePointBefore(param1:CharSequence, param2:Int):Int; + @:overload static function codePointBefore(param1:java.NativeArray, param2:Int, param3:Int):Int; + @:overload static function codePointBefore(param1:java.NativeArray, param2:Int):Int; + @:overload static function codePointCount(param1:CharSequence, param2:Int, param3:Int):Int; + @:overload static function codePointCount(param1:java.NativeArray, param2:Int, param3:Int):Int; + @:overload static function compare(param1:java.types.Char16, param2:java.types.Char16):Int; + @:overload static function digit(param1:java.types.Char16, param2:Int):Int; + @:overload static function digit(param1:Int, param2:Int):Int; + @:overload static function forDigit(param1:Int, param2:Int):java.types.Char16; + @:overload static function getDirectionality(param1:java.types.Char16):java.types.Char16; + @:overload static function getDirectionality(param1:Int):java.types.Char16; + @:overload static function getName(param1:Int):String; + @:overload static function getNumericValue(param1:java.types.Char16):Int; + @:overload static function getNumericValue(param1:Int):Int; + @:overload static function getType(param1:java.types.Char16):Int; + @:overload static function getType(param1:Int):Int; + @:overload static function highSurrogate(param1:Int):java.types.Char16; + @:overload static function isAlphabetic(param1:Int):Bool; + @:overload static function isBmpCodePoint(param1:Int):Bool; + @:overload static function isDefined(param1:java.types.Char16):Bool; + @:overload static function isDefined(param1:Int):Bool; + @:overload static function isDigit(param1:java.types.Char16):Bool; + @:overload static function isDigit(param1:Int):Bool; + @:overload static function isHighSurrogate(param1:java.types.Char16):Bool; + @:overload static function isISOControl(param1:java.types.Char16):Bool; + @:overload static function isISOControl(param1:Int):Bool; + @:overload static function isIdentifierIgnorable(param1:java.types.Char16):Bool; + @:overload static function isIdentifierIgnorable(param1:Int):Bool; + @:overload static function isIdeographic(param1:Int):Bool; + @:overload static function isJavaIdentifierPart(param1:java.types.Char16):Bool; + @:overload static function isJavaIdentifierPart(param1:Int):Bool; + @:overload static function isJavaIdentifierStart(param1:java.types.Char16):Bool; + @:overload static function isJavaIdentifierStart(param1:Int):Bool; + @:overload @:deprecated static function isJavaLetter(param1:java.types.Char16):Bool; + @:overload @:deprecated static function isJavaLetterOrDigit(param1:java.types.Char16):Bool; + @:overload static function isLetter(param1:java.types.Char16):Bool; + @:overload static function isLetter(param1:Int):Bool; + @:overload static function isLetterOrDigit(param1:java.types.Char16):Bool; + @:overload static function isLetterOrDigit(param1:Int):Bool; + @:overload static function isLowSurrogate(param1:java.types.Char16):Bool; + @:overload static function isLowerCase(param1:java.types.Char16):Bool; + @:overload static function isLowerCase(param1:Int):Bool; + @:overload static function isMirrored(param1:java.types.Char16):Bool; + @:overload static function isMirrored(param1:Int):Bool; + @:overload @:deprecated static function isSpace(param1:java.types.Char16):Bool; + @:overload static function isSpaceChar(param1:java.types.Char16):Bool; + @:overload static function isSpaceChar(param1:Int):Bool; + @:overload static function isSupplementaryCodePoint(param1:Int):Bool; + @:overload static function isSurrogate(param1:java.types.Char16):Bool; + @:overload static function isSurrogatePair(param1:java.types.Char16, param2:java.types.Char16):Bool; + @:overload static function isTitleCase(param1:java.types.Char16):Bool; + @:overload static function isTitleCase(param1:Int):Bool; + @:overload static function isUnicodeIdentifierPart(param1:java.types.Char16):Bool; + @:overload static function isUnicodeIdentifierPart(param1:Int):Bool; + @:overload static function isUnicodeIdentifierStart(param1:java.types.Char16):Bool; + @:overload static function isUnicodeIdentifierStart(param1:Int):Bool; + @:overload static function isUpperCase(param1:java.types.Char16):Bool; + @:overload static function isUpperCase(param1:Int):Bool; + @:overload static function isValidCodePoint(param1:Int):Bool; + @:overload static function isWhitespace(param1:java.types.Char16):Bool; + @:overload static function isWhitespace(param1:Int):Bool; + @:overload static function lowSurrogate(param1:Int):java.types.Char16; + @:overload static function offsetByCodePoints(param1:CharSequence, param2:Int, param3:Int):Int; + @:overload static function offsetByCodePoints(param1:java.NativeArray, param2:Int, param3:Int, param4:Int, param5:Int):Int; + @:overload static function reverseBytes(param1:java.types.Char16):java.types.Char16; + @:overload static function toChars(param1:Int, param2:java.NativeArray, param3:Int):Int; + @:overload static function toChars(param1:Int):java.NativeArray; + @:overload static function toCodePoint(param1:java.types.Char16, param2:java.types.Char16):Int; + @:overload static function toLowerCase(param1:java.types.Char16):java.types.Char16; + @:overload static function toLowerCase(param1:Int):Int; + @:native("toString") @:overload static function _toString(param1:java.types.Char16):String; + @:overload static function toTitleCase(param1:java.types.Char16):java.types.Char16; + @:overload static function toTitleCase(param1:Int):Int; + @:overload static function toUpperCase(param1:java.types.Char16):java.types.Char16; + @:overload static function toUpperCase(param1:Int):Int; + @:overload static function valueOf(param1:java.types.Char16):Character; +} + +@:realPath("java.lang.Character_CharacterCache") @:javaNative @:native("java.lang.Character$CharacterCache") @:javaCanonical("java.lang", + "Character.CharacterCache") extern class Character_CharacterCache {} + +@:realPath("java.lang.Character_Subset") @:javaNative @:native("java.lang.Character$Subset") @:javaCanonical("java.lang", + "Character.Subset") extern class Character_Subset { + @:overload final function equals(param1:Dynamic):Bool; + @:overload final function hashCode():Int; + @:overload final function toString():String; +} + +@:realPath("java.lang.Character_UnicodeBlock") @:javaNative @:native("java.lang.Character$UnicodeBlock") @:javaCanonical("java.lang", + "Character.UnicodeBlock") extern final class Character_UnicodeBlock extends Character_Subset { + static final AEGEAN_NUMBERS:Character_UnicodeBlock; + static final ALCHEMICAL_SYMBOLS:Character_UnicodeBlock; + static final ALPHABETIC_PRESENTATION_FORMS:Character_UnicodeBlock; + static final ANCIENT_GREEK_MUSICAL_NOTATION:Character_UnicodeBlock; + static final ANCIENT_GREEK_NUMBERS:Character_UnicodeBlock; + static final ANCIENT_SYMBOLS:Character_UnicodeBlock; + static final ARABIC:Character_UnicodeBlock; + static final ARABIC_PRESENTATION_FORMS_A:Character_UnicodeBlock; + static final ARABIC_PRESENTATION_FORMS_B:Character_UnicodeBlock; + static final ARABIC_SUPPLEMENT:Character_UnicodeBlock; + static final ARMENIAN:Character_UnicodeBlock; + static final ARROWS:Character_UnicodeBlock; + static final AVESTAN:Character_UnicodeBlock; + static final BALINESE:Character_UnicodeBlock; + static final BAMUM:Character_UnicodeBlock; + static final BAMUM_SUPPLEMENT:Character_UnicodeBlock; + static final BASIC_LATIN:Character_UnicodeBlock; + static final BATAK:Character_UnicodeBlock; + static final BENGALI:Character_UnicodeBlock; + static final BLOCK_ELEMENTS:Character_UnicodeBlock; + static final BOPOMOFO:Character_UnicodeBlock; + static final BOPOMOFO_EXTENDED:Character_UnicodeBlock; + static final BOX_DRAWING:Character_UnicodeBlock; + static final BRAHMI:Character_UnicodeBlock; + static final BRAILLE_PATTERNS:Character_UnicodeBlock; + static final BUGINESE:Character_UnicodeBlock; + static final BUHID:Character_UnicodeBlock; + static final BYZANTINE_MUSICAL_SYMBOLS:Character_UnicodeBlock; + static final CARIAN:Character_UnicodeBlock; + static final CHAM:Character_UnicodeBlock; + static final CHEROKEE:Character_UnicodeBlock; + static final CJK_COMPATIBILITY:Character_UnicodeBlock; + static final CJK_COMPATIBILITY_FORMS:Character_UnicodeBlock; + static final CJK_COMPATIBILITY_IDEOGRAPHS:Character_UnicodeBlock; + static final CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT:Character_UnicodeBlock; + static final CJK_RADICALS_SUPPLEMENT:Character_UnicodeBlock; + static final CJK_STROKES:Character_UnicodeBlock; + static final CJK_SYMBOLS_AND_PUNCTUATION:Character_UnicodeBlock; + static final CJK_UNIFIED_IDEOGRAPHS:Character_UnicodeBlock; + static final CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A:Character_UnicodeBlock; + static final CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B:Character_UnicodeBlock; + static final CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C:Character_UnicodeBlock; + static final CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D:Character_UnicodeBlock; + static final COMBINING_DIACRITICAL_MARKS:Character_UnicodeBlock; + static final COMBINING_DIACRITICAL_MARKS_SUPPLEMENT:Character_UnicodeBlock; + static final COMBINING_HALF_MARKS:Character_UnicodeBlock; + static final COMBINING_MARKS_FOR_SYMBOLS:Character_UnicodeBlock; + static final COMMON_INDIC_NUMBER_FORMS:Character_UnicodeBlock; + static final CONTROL_PICTURES:Character_UnicodeBlock; + static final COPTIC:Character_UnicodeBlock; + static final COUNTING_ROD_NUMERALS:Character_UnicodeBlock; + static final CUNEIFORM:Character_UnicodeBlock; + static final CUNEIFORM_NUMBERS_AND_PUNCTUATION:Character_UnicodeBlock; + static final CURRENCY_SYMBOLS:Character_UnicodeBlock; + static final CYPRIOT_SYLLABARY:Character_UnicodeBlock; + static final CYRILLIC:Character_UnicodeBlock; + static final CYRILLIC_EXTENDED_A:Character_UnicodeBlock; + static final CYRILLIC_EXTENDED_B:Character_UnicodeBlock; + static final CYRILLIC_SUPPLEMENTARY:Character_UnicodeBlock; + static final DESERET:Character_UnicodeBlock; + static final DEVANAGARI:Character_UnicodeBlock; + static final DEVANAGARI_EXTENDED:Character_UnicodeBlock; + static final DINGBATS:Character_UnicodeBlock; + static final DOMINO_TILES:Character_UnicodeBlock; + static final EGYPTIAN_HIEROGLYPHS:Character_UnicodeBlock; + static final EMOTICONS:Character_UnicodeBlock; + static final ENCLOSED_ALPHANUMERICS:Character_UnicodeBlock; + static final ENCLOSED_ALPHANUMERIC_SUPPLEMENT:Character_UnicodeBlock; + static final ENCLOSED_CJK_LETTERS_AND_MONTHS:Character_UnicodeBlock; + static final ENCLOSED_IDEOGRAPHIC_SUPPLEMENT:Character_UnicodeBlock; + static final ETHIOPIC:Character_UnicodeBlock; + static final ETHIOPIC_EXTENDED:Character_UnicodeBlock; + static final ETHIOPIC_EXTENDED_A:Character_UnicodeBlock; + static final ETHIOPIC_SUPPLEMENT:Character_UnicodeBlock; + static final GENERAL_PUNCTUATION:Character_UnicodeBlock; + static final GEOMETRIC_SHAPES:Character_UnicodeBlock; + static final GEORGIAN:Character_UnicodeBlock; + static final GEORGIAN_SUPPLEMENT:Character_UnicodeBlock; + static final GLAGOLITIC:Character_UnicodeBlock; + static final GOTHIC:Character_UnicodeBlock; + static final GREEK:Character_UnicodeBlock; + static final GREEK_EXTENDED:Character_UnicodeBlock; + static final GUJARATI:Character_UnicodeBlock; + static final GURMUKHI:Character_UnicodeBlock; + static final HALFWIDTH_AND_FULLWIDTH_FORMS:Character_UnicodeBlock; + static final HANGUL_COMPATIBILITY_JAMO:Character_UnicodeBlock; + static final HANGUL_JAMO:Character_UnicodeBlock; + static final HANGUL_JAMO_EXTENDED_A:Character_UnicodeBlock; + static final HANGUL_JAMO_EXTENDED_B:Character_UnicodeBlock; + static final HANGUL_SYLLABLES:Character_UnicodeBlock; + static final HANUNOO:Character_UnicodeBlock; + static final HEBREW:Character_UnicodeBlock; + static final HIGH_PRIVATE_USE_SURROGATES:Character_UnicodeBlock; + static final HIGH_SURROGATES:Character_UnicodeBlock; + static final HIRAGANA:Character_UnicodeBlock; + static final IDEOGRAPHIC_DESCRIPTION_CHARACTERS:Character_UnicodeBlock; + static final IMPERIAL_ARAMAIC:Character_UnicodeBlock; + static final INSCRIPTIONAL_PAHLAVI:Character_UnicodeBlock; + static final INSCRIPTIONAL_PARTHIAN:Character_UnicodeBlock; + static final IPA_EXTENSIONS:Character_UnicodeBlock; + static final JAVANESE:Character_UnicodeBlock; + static final KAITHI:Character_UnicodeBlock; + static final KANA_SUPPLEMENT:Character_UnicodeBlock; + static final KANBUN:Character_UnicodeBlock; + static final KANGXI_RADICALS:Character_UnicodeBlock; + static final KANNADA:Character_UnicodeBlock; + static final KATAKANA:Character_UnicodeBlock; + static final KATAKANA_PHONETIC_EXTENSIONS:Character_UnicodeBlock; + static final KAYAH_LI:Character_UnicodeBlock; + static final KHAROSHTHI:Character_UnicodeBlock; + static final KHMER:Character_UnicodeBlock; + static final KHMER_SYMBOLS:Character_UnicodeBlock; + static final LAO:Character_UnicodeBlock; + static final LATIN_1_SUPPLEMENT:Character_UnicodeBlock; + static final LATIN_EXTENDED_A:Character_UnicodeBlock; + static final LATIN_EXTENDED_ADDITIONAL:Character_UnicodeBlock; + static final LATIN_EXTENDED_B:Character_UnicodeBlock; + static final LATIN_EXTENDED_C:Character_UnicodeBlock; + static final LATIN_EXTENDED_D:Character_UnicodeBlock; + static final LEPCHA:Character_UnicodeBlock; + static final LETTERLIKE_SYMBOLS:Character_UnicodeBlock; + static final LIMBU:Character_UnicodeBlock; + static final LINEAR_B_IDEOGRAMS:Character_UnicodeBlock; + static final LINEAR_B_SYLLABARY:Character_UnicodeBlock; + static final LISU:Character_UnicodeBlock; + static final LOW_SURROGATES:Character_UnicodeBlock; + static final LYCIAN:Character_UnicodeBlock; + static final LYDIAN:Character_UnicodeBlock; + static final MAHJONG_TILES:Character_UnicodeBlock; + static final MALAYALAM:Character_UnicodeBlock; + static final MANDAIC:Character_UnicodeBlock; + static final MATHEMATICAL_ALPHANUMERIC_SYMBOLS:Character_UnicodeBlock; + static final MATHEMATICAL_OPERATORS:Character_UnicodeBlock; + static final MEETEI_MAYEK:Character_UnicodeBlock; + static final MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A:Character_UnicodeBlock; + static final MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B:Character_UnicodeBlock; + static final MISCELLANEOUS_SYMBOLS:Character_UnicodeBlock; + static final MISCELLANEOUS_SYMBOLS_AND_ARROWS:Character_UnicodeBlock; + static final MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS:Character_UnicodeBlock; + static final MISCELLANEOUS_TECHNICAL:Character_UnicodeBlock; + static final MODIFIER_TONE_LETTERS:Character_UnicodeBlock; + static final MONGOLIAN:Character_UnicodeBlock; + static final MUSICAL_SYMBOLS:Character_UnicodeBlock; + static final MYANMAR:Character_UnicodeBlock; + static final MYANMAR_EXTENDED_A:Character_UnicodeBlock; + static final NEW_TAI_LUE:Character_UnicodeBlock; + static final NKO:Character_UnicodeBlock; + static final NUMBER_FORMS:Character_UnicodeBlock; + static final OGHAM:Character_UnicodeBlock; + static final OLD_ITALIC:Character_UnicodeBlock; + static final OLD_PERSIAN:Character_UnicodeBlock; + static final OLD_SOUTH_ARABIAN:Character_UnicodeBlock; + static final OLD_TURKIC:Character_UnicodeBlock; + static final OL_CHIKI:Character_UnicodeBlock; + static final OPTICAL_CHARACTER_RECOGNITION:Character_UnicodeBlock; + static final ORIYA:Character_UnicodeBlock; + static final OSMANYA:Character_UnicodeBlock; + static final PHAGS_PA:Character_UnicodeBlock; + static final PHAISTOS_DISC:Character_UnicodeBlock; + static final PHOENICIAN:Character_UnicodeBlock; + static final PHONETIC_EXTENSIONS:Character_UnicodeBlock; + static final PHONETIC_EXTENSIONS_SUPPLEMENT:Character_UnicodeBlock; + static final PLAYING_CARDS:Character_UnicodeBlock; + static final PRIVATE_USE_AREA:Character_UnicodeBlock; + static final REJANG:Character_UnicodeBlock; + static final RUMI_NUMERAL_SYMBOLS:Character_UnicodeBlock; + static final RUNIC:Character_UnicodeBlock; + static final SAMARITAN:Character_UnicodeBlock; + static final SAURASHTRA:Character_UnicodeBlock; + static final SHAVIAN:Character_UnicodeBlock; + static final SINHALA:Character_UnicodeBlock; + static final SMALL_FORM_VARIANTS:Character_UnicodeBlock; + static final SPACING_MODIFIER_LETTERS:Character_UnicodeBlock; + static final SPECIALS:Character_UnicodeBlock; + static final SUNDANESE:Character_UnicodeBlock; + static final SUPERSCRIPTS_AND_SUBSCRIPTS:Character_UnicodeBlock; + static final SUPPLEMENTAL_ARROWS_A:Character_UnicodeBlock; + static final SUPPLEMENTAL_ARROWS_B:Character_UnicodeBlock; + static final SUPPLEMENTAL_MATHEMATICAL_OPERATORS:Character_UnicodeBlock; + static final SUPPLEMENTAL_PUNCTUATION:Character_UnicodeBlock; + static final SUPPLEMENTARY_PRIVATE_USE_AREA_A:Character_UnicodeBlock; + static final SUPPLEMENTARY_PRIVATE_USE_AREA_B:Character_UnicodeBlock; + @:deprecated static var SURROGATES_AREA:Character_UnicodeBlock; + static final SYLOTI_NAGRI:Character_UnicodeBlock; + static final SYRIAC:Character_UnicodeBlock; + static final TAGALOG:Character_UnicodeBlock; + static final TAGBANWA:Character_UnicodeBlock; + static final TAGS:Character_UnicodeBlock; + static final TAI_LE:Character_UnicodeBlock; + static final TAI_THAM:Character_UnicodeBlock; + static final TAI_VIET:Character_UnicodeBlock; + static final TAI_XUAN_JING_SYMBOLS:Character_UnicodeBlock; + static final TAMIL:Character_UnicodeBlock; + static final TELUGU:Character_UnicodeBlock; + static final THAANA:Character_UnicodeBlock; + static final THAI:Character_UnicodeBlock; + static final TIBETAN:Character_UnicodeBlock; + static final TIFINAGH:Character_UnicodeBlock; + static final TRANSPORT_AND_MAP_SYMBOLS:Character_UnicodeBlock; + static final UGARITIC:Character_UnicodeBlock; + static final UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS:Character_UnicodeBlock; + static final UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED:Character_UnicodeBlock; + static final VAI:Character_UnicodeBlock; + static final VARIATION_SELECTORS:Character_UnicodeBlock; + static final VARIATION_SELECTORS_SUPPLEMENT:Character_UnicodeBlock; + static final VEDIC_EXTENSIONS:Character_UnicodeBlock; + static final VERTICAL_FORMS:Character_UnicodeBlock; + static final YIJING_HEXAGRAM_SYMBOLS:Character_UnicodeBlock; + static final YI_RADICALS:Character_UnicodeBlock; + static final YI_SYLLABLES:Character_UnicodeBlock; + @:overload final static function forName(param1:String):Character_UnicodeBlock; + @:overload static function of(param1:java.types.Char16):Character_UnicodeBlock; + @:overload static function of(param1:Int):Character_UnicodeBlock; +} + +@:realPath("java.lang.Character_UnicodeScript") @:javaCanonical("java.lang", + "Character.UnicodeScript") @:native("java.lang.Character$UnicodeScript") extern enum Character_UnicodeScript { + COMMON; + LATIN; + GREEK; + CYRILLIC; + ARMENIAN; + HEBREW; + ARABIC; + SYRIAC; + THAANA; + DEVANAGARI; + BENGALI; + GURMUKHI; + GUJARATI; + ORIYA; + TAMIL; + TELUGU; + KANNADA; + MALAYALAM; + SINHALA; + THAI; + LAO; + TIBETAN; + MYANMAR; + GEORGIAN; + HANGUL; + ETHIOPIC; + CHEROKEE; + CANADIAN_ABORIGINAL; + OGHAM; + RUNIC; + KHMER; + MONGOLIAN; + HIRAGANA; + KATAKANA; + BOPOMOFO; + HAN; + YI; + OLD_ITALIC; + GOTHIC; + DESERET; + INHERITED; + TAGALOG; + HANUNOO; + BUHID; + TAGBANWA; + LIMBU; + TAI_LE; + LINEAR_B; + UGARITIC; + SHAVIAN; + OSMANYA; + CYPRIOT; + BRAILLE; + BUGINESE; + COPTIC; + NEW_TAI_LUE; + GLAGOLITIC; + TIFINAGH; + SYLOTI_NAGRI; + OLD_PERSIAN; + KHAROSHTHI; + BALINESE; + CUNEIFORM; + PHOENICIAN; + PHAGS_PA; + NKO; + SUNDANESE; + BATAK; + LEPCHA; + OL_CHIKI; + VAI; + SAURASHTRA; + KAYAH_LI; + REJANG; + LYCIAN; + CARIAN; + LYDIAN; + CHAM; + TAI_THAM; + TAI_VIET; + AVESTAN; + EGYPTIAN_HIEROGLYPHS; + SAMARITAN; + MANDAIC; + LISU; + BAMUM; + JAVANESE; + MEETEI_MAYEK; + IMPERIAL_ARAMAIC; + OLD_SOUTH_ARABIAN; + INSCRIPTIONAL_PARTHIAN; + INSCRIPTIONAL_PAHLAVI; + OLD_TURKIC; + BRAHMI; + KAITHI; + UNKNOWN; +} diff --git a/build/linux64_569e52e/std/java/lang/Double.hx b/build/linux64_569e52e/std/java/lang/Double.hx new file mode 100644 index 0000000..140c915 --- /dev/null +++ b/build/linux64_569e52e/std/java/lang/Double.hx @@ -0,0 +1,72 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java.lang; + +@:native("") // make sure the generator won't see this +@:transitive +@:forwardStatics +@:forward abstract Double(DoubleClass) from DoubleClass to DoubleClass { + @:to extern inline public function toFloat():Float + return this.doubleValue(); + + @:from extern inline public static function fromFloat(b:Float):Double + return DoubleClass.valueOf(b); +} + +@:native("java.lang.Double") extern class DoubleClass extends Number implements Comparable { + @:overload function new(param1:Float):Void; + @:overload @:throws("java.lang.NumberFormatException") function new(param1:String):Void; + @:overload function compareTo(param1:Double):Int; + @:overload function compareTo(param1:Dynamic):Int; + @:overload function equals(param1:Dynamic):Bool; + @:overload function hashCode():Int; + @:overload function isInfinite():Bool; + @:overload function isNaN():Bool; + @:overload function toString():String; + static final MAX_EXPONENT:Int; + static final MAX_VALUE:Float; + static final MIN_EXPONENT:Int; + static final MIN_NORMAL:Float; + static final MIN_VALUE:Float; + static final NEGATIVE_INFINITY:Float; + static final NaN:Float; + static final POSITIVE_INFINITY:Float; + static final SIZE:Int; + static final TYPE:Class; + @:overload static function compare(param1:Float, param2:Float):Int; + @:overload static function doubleToLongBits(param1:Float):haxe.Int64; + @:overload static function doubleToRawLongBits(param1:Float):haxe.Int64; + @:native("isInfinite") @:overload static function _isInfinite(param1:Float):Bool; + @:native("isNaN") @:overload static function _isNaN(param1:Float):Bool; + @:overload static function longBitsToDouble(param1:haxe.Int64):Float; + @:overload @:throws("java.lang.NumberFormatException") static function parseDouble(param1:String):Float; + @:overload static function toHexString(param1:Float):String; + @:native("toString") @:overload static function _toString(param1:Float):String; + @:overload static function valueOf(param1:Float):Double; + @:overload @:throws("java.lang.NumberFormatException") static function valueOf(param1:String):Double; + + function doubleValue():Float; + function floatValue():Single; + function intValue():Int; + function longValue():haxe.Int64; +} diff --git a/build/linux64_569e52e/std/java/lang/Float.hx b/build/linux64_569e52e/std/java/lang/Float.hx new file mode 100644 index 0000000..0b50d8d --- /dev/null +++ b/build/linux64_569e52e/std/java/lang/Float.hx @@ -0,0 +1,73 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java.lang; + +@:native("") // make sure the generator won't see this +@:transitive +@:forwardStatics +@:forward abstract Float(FloatClass) from FloatClass to FloatClass { + @:to extern inline public function toFloat():std.StdTypes.Float + return this.floatValue(); + + @:from extern inline public static function fromFloat(b:std.StdTypes.Single):Float + return FloatClass.valueOf(b); +} + +@:native("java.lang.Float") extern class FloatClass extends Number implements Comparable { + @:overload function new(param1:Single):Void; + @:overload @:throws("java.lang.NumberFormatException") function new(param1:String):Void; + @:overload function new(param1:std.StdTypes.Float):Void; + @:overload function compareTo(param1:Float):Int; + @:overload function compareTo(param1:Dynamic):Int; + @:overload function equals(param1:Dynamic):Bool; + @:overload function hashCode():Int; + @:overload function isInfinite():Bool; + @:overload function isNaN():Bool; + @:overload function toString():String; + static final MAX_EXPONENT:Int; + static final MAX_VALUE:Single; + static final MIN_EXPONENT:Int; + static final MIN_NORMAL:Single; + static final MIN_VALUE:Single; + static final NEGATIVE_INFINITY:Single; + static final NaN:Single; + static final POSITIVE_INFINITY:Single; + static final SIZE:Int; + static final TYPE:Class; + @:overload static function compare(param1:Single, param2:Single):Int; + @:overload static function floatToIntBits(param1:Single):Int; + @:overload static function floatToRawIntBits(param1:Single):Int; + @:overload static function intBitsToFloat(param1:Int):Single; + @:native("isInfinite") @:overload static function _isInfinite(param1:Single):Bool; + @:native("isNaN") @:overload static function _isNaN(param1:Single):Bool; + @:overload @:throws("java.lang.NumberFormatException") static function parseFloat(param1:String):Single; + @:overload static function toHexString(param1:Single):String; + @:native("toString") @:overload static function _toString(param1:Single):String; + @:overload static function valueOf(param1:Single):Float; + @:overload @:throws("java.lang.NumberFormatException") static function valueOf(param1:String):Float; + + function doubleValue():Float; + function floatValue():Single; + function intValue():Int; + function longValue():haxe.Int64; +} diff --git a/build/linux64_569e52e/std/java/lang/Integer.hx b/build/linux64_569e52e/std/java/lang/Integer.hx new file mode 100644 index 0000000..c066bf5 --- /dev/null +++ b/build/linux64_569e52e/std/java/lang/Integer.hx @@ -0,0 +1,81 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java.lang; + +@:native("") // make sure the generator won't see this +@:transitive +@:forwardStatics +@:forward abstract Integer(IntegerClass) from IntegerClass to IntegerClass { + @:to extern inline public function toInt():Int + return this.intValue(); + + @:from extern inline public static function fromInt(b:Int):Integer + return IntegerClass.valueOf(b); +} + +@:native("java.lang.Integer") extern class IntegerClass extends Number implements Comparable { + @:overload function new(param1:Int):Void; + @:overload @:throws("java.lang.NumberFormatException") function new(param1:String):Void; + @:overload function compareTo(param1:Integer):Int; + @:overload function compareTo(param1:Dynamic):Int; + @:overload function equals(param1:Dynamic):Bool; + @:overload function hashCode():Int; + @:overload function toString():String; + static final MAX_VALUE:Int; + static final MIN_VALUE:Int; + static final SIZE:Int; + static final TYPE:Class; + @:overload static function bitCount(param1:Int):Int; + @:overload static function compare(param1:Int, param2:Int):Int; + @:overload @:throws("java.lang.NumberFormatException") static function decode(param1:String):Integer; + @:overload static function getInteger(param1:String):Integer; + @:overload static function getInteger(param1:String, param2:Integer):Integer; + @:overload static function getInteger(param1:String, param2:Int):Integer; + @:overload static function highestOneBit(param1:Int):Int; + @:overload static function lowestOneBit(param1:Int):Int; + @:overload static function numberOfLeadingZeros(param1:Int):Int; + @:overload static function numberOfTrailingZeros(param1:Int):Int; + @:overload @:throws("java.lang.NumberFormatException") static function parseInt(param1:String, param2:Int):Int; + @:overload @:throws("java.lang.NumberFormatException") static function parseInt(param1:String):Int; + @:overload static function reverse(param1:Int):Int; + @:overload static function reverseBytes(param1:Int):Int; + @:overload static function rotateLeft(param1:Int, param2:Int):Int; + @:overload static function rotateRight(param1:Int, param2:Int):Int; + @:overload static function signum(param1:Int):Int; + @:overload static function toBinaryString(param1:Int):String; + @:overload static function toHexString(param1:Int):String; + @:overload static function toOctalString(param1:Int):String; + @:native("toString") @:overload static function _toString(param1:Int, param2:Int):String; + @:native("toString") @:overload static function _toString(param1:Int):String; + @:overload static function valueOf(param1:Int):Integer; + @:overload @:throws("java.lang.NumberFormatException") static function valueOf(param1:String, param2:Int):Integer; + @:overload @:throws("java.lang.NumberFormatException") static function valueOf(param1:String):Integer; + + function doubleValue():Float; + function floatValue():Single; + function intValue():Int; + function longValue():haxe.Int64; +} + +@:realPath("java.lang.Integer_IntegerCache") @:javaNative @:native("java.lang.Integer$IntegerCache") @:javaCanonical("java.lang", + "Integer.IntegerCache") extern class Integer_IntegerCache {} diff --git a/build/linux64_569e52e/std/java/lang/Long.hx b/build/linux64_569e52e/std/java/lang/Long.hx new file mode 100644 index 0000000..893b0c2 --- /dev/null +++ b/build/linux64_569e52e/std/java/lang/Long.hx @@ -0,0 +1,81 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java.lang; + +@:native("") // make sure the generator won't see this +@:transitive +@:forwardStatics +@:forward abstract Long(LongClass) from LongClass to LongClass { + @:to extern inline public function toLong():haxe.Int64 + return this.longValue(); + + @:from extern inline public static function fromLong(b:haxe.Int64):Long + return LongClass.valueOf(b); +} + +@:native("java.lang.Long") extern class LongClass extends Number implements Comparable { + @:overload @:throws("java.lang.NumberFormatException") function new(param1:String):Void; + @:overload function new(param1:haxe.Int64):Void; + @:overload function compareTo(param1:Dynamic):Int; + @:overload function compareTo(param1:Long):Int; + @:overload function equals(param1:Dynamic):Bool; + @:overload function hashCode():Int; + @:overload function toString():String; + static final MAX_VALUE:haxe.Int64; + static final MIN_VALUE:haxe.Int64; + static final SIZE:Int; + static final TYPE:Class; + @:overload static function bitCount(param1:haxe.Int64):Int; + @:overload static function compare(param1:haxe.Int64, param2:haxe.Int64):Int; + @:overload @:throws("java.lang.NumberFormatException") static function decode(param1:String):Long; + @:overload static function getLong(param1:String, param2:Long):Long; + @:overload static function getLong(param1:String):Long; + @:overload static function getLong(param1:String, param2:haxe.Int64):Long; + @:overload static function highestOneBit(param1:haxe.Int64):haxe.Int64; + @:overload static function lowestOneBit(param1:haxe.Int64):haxe.Int64; + @:overload static function numberOfLeadingZeros(param1:haxe.Int64):Int; + @:overload static function numberOfTrailingZeros(param1:haxe.Int64):Int; + @:overload @:throws("java.lang.NumberFormatException") static function parseLong(param1:String):haxe.Int64; + @:overload @:throws("java.lang.NumberFormatException") static function parseLong(param1:String, param2:Int):haxe.Int64; + @:overload static function reverse(param1:haxe.Int64):haxe.Int64; + @:overload static function reverseBytes(param1:haxe.Int64):haxe.Int64; + @:overload static function rotateLeft(param1:haxe.Int64, param2:Int):haxe.Int64; + @:overload static function rotateRight(param1:haxe.Int64, param2:Int):haxe.Int64; + @:overload static function signum(param1:haxe.Int64):Int; + @:overload static function toBinaryString(param1:haxe.Int64):String; + @:overload static function toHexString(param1:haxe.Int64):String; + @:overload static function toOctalString(param1:haxe.Int64):String; + @:native("toString") @:overload static function _toString(param1:haxe.Int64):String; + @:native("toString") @:overload static function _toString(param1:haxe.Int64, param2:Int):String; + @:overload static function valueOf(param1:haxe.Int64):Long; + @:overload @:throws("java.lang.NumberFormatException") static function valueOf(param1:String, param2:Int):Long; + @:overload @:throws("java.lang.NumberFormatException") static function valueOf(param1:String):Long; + + function doubleValue():Float; + function floatValue():Single; + function intValue():Int; + function longValue():haxe.Int64; +} + +@:realPath("java.lang.Long_LongCache") @:javaNative @:native("java.lang.Long$LongCache") @:javaCanonical("java.lang", + "Long.LongCache") extern class Long_LongCache {} diff --git a/build/linux64_569e52e/std/java/lang/Short.hx b/build/linux64_569e52e/std/java/lang/Short.hx new file mode 100644 index 0000000..f36bf95 --- /dev/null +++ b/build/linux64_569e52e/std/java/lang/Short.hx @@ -0,0 +1,65 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java.lang; + +@:native("") // make sure the generator won't see this +@:transitive +@:forwardStatics +@:forward abstract Short(ShortClass) from ShortClass to ShortClass { + @:to extern inline public function toShort():java.types.Int16 + return this.shortValue(); + + @:from extern inline public static function fromShort(b:java.types.Int16):Short + return ShortClass.valueOf(b); +} + +@:native("java.lang.Short") extern class ShortClass extends Number implements Comparable { + @:overload function new(param1:java.types.Int16):Void; + @:overload @:throws("java.lang.NumberFormatException") function new(param1:String):Void; + @:overload function compareTo(param1:Short):Int; + @:overload function compareTo(param1:Dynamic):Int; + @:overload function equals(param1:Dynamic):Bool; + @:overload function hashCode():Int; + @:overload function toString():String; + static final MAX_VALUE:java.types.Int16; + static final MIN_VALUE:java.types.Int16; + static final SIZE:Int; + static final TYPE:Class; + @:overload static function compare(param1:java.types.Int16, param2:java.types.Int16):Int; + @:overload @:throws("java.lang.NumberFormatException") static function decode(param1:String):Short; + @:overload @:throws("java.lang.NumberFormatException") static function parseShort(param1:String, param2:Int):java.types.Int16; + @:overload @:throws("java.lang.NumberFormatException") static function parseShort(param1:String):java.types.Int16; + @:overload static function reverseBytes(param1:java.types.Int16):java.types.Int16; + @:native("toString") @:overload static function _toString(param1:java.types.Int16):String; + @:overload static function valueOf(param1:java.types.Int16):Short; + @:overload @:throws("java.lang.NumberFormatException") static function valueOf(param1:String, param2:Int):Short; + @:overload @:throws("java.lang.NumberFormatException") static function valueOf(param1:String):Short; + + function doubleValue():Float; + function floatValue():Single; + function intValue():Int; + function longValue():haxe.Int64; +} + +@:realPath("java.lang.Short_ShortCache") @:javaNative @:native("java.lang.Short$ShortCache") @:javaCanonical("java.lang", + "Short.ShortCache") extern class Short_ShortCache {} diff --git a/build/linux64_569e52e/std/java/net/SslSocket.hx b/build/linux64_569e52e/std/java/net/SslSocket.hx new file mode 100644 index 0000000..f2116af --- /dev/null +++ b/build/linux64_569e52e/std/java/net/SslSocket.hx @@ -0,0 +1,33 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java.net; + +@:native('haxe.java.net.SslSocket') class SslSocket extends sys.net.Socket { + override private function create():Void { + try { + this.sock = java.javax.net.ssl.SSLSocketFactory.getDefault().createSocket(); + this.server = java.javax.net.ssl.SSLServerSocketFactory.getDefault().createServerSocket(); + } catch (e:Dynamic) + throw e; + } +} diff --git a/build/linux64_569e52e/std/java/types/Char16.hx b/build/linux64_569e52e/std/java/types/Char16.hx new file mode 100644 index 0000000..3f0f9eb --- /dev/null +++ b/build/linux64_569e52e/std/java/types/Char16.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java.types; + +typedef Char16 = java.StdTypes.Char16; diff --git a/build/linux64_569e52e/std/java/types/Int16.hx b/build/linux64_569e52e/std/java/types/Int16.hx new file mode 100644 index 0000000..1f264aa --- /dev/null +++ b/build/linux64_569e52e/std/java/types/Int16.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java.types; + +typedef Int16 = java.StdTypes.Int16; diff --git a/build/linux64_569e52e/std/java/types/Int8.hx b/build/linux64_569e52e/std/java/types/Int8.hx new file mode 100644 index 0000000..baccb6c --- /dev/null +++ b/build/linux64_569e52e/std/java/types/Int8.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java.types; + +typedef Int8 = java.StdTypes.Int8; diff --git a/build/linux64_569e52e/std/java/vm/AtomicList.hx b/build/linux64_569e52e/std/java/vm/AtomicList.hx new file mode 100644 index 0000000..f61dc27 --- /dev/null +++ b/build/linux64_569e52e/std/java/vm/AtomicList.hx @@ -0,0 +1,83 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java.vm; + +import java.util.concurrent.atomic.AtomicReference; + +/** + A lock-free queue implementation +**/ +@:native('haxe.java.vm.AtomicList') +@:nativeGen class AtomicList { + @:volatile @:private var head:AtomicNode; + @:volatile @:private var tail:AtomicReference>; + + public function new() { + this.head = new AtomicNode(null); + this.head.set(new AtomicNode(null)); + this.tail = new AtomicReference(head); + } + + public function add(v:T) { + var n = new AtomicNode(v), tail = this.tail; + var p = null; + while (!((p = tail.get()).compareAndSet(null, n))) { + tail.compareAndSet(p, p.get()); + } + tail.compareAndSet(p, n); + } + + public function pop():Null { + var p = null, pget = null, head = head; + do { + p = head.get(); + if ((pget = p.get()) == null) + return null; // empty + } while (!head.compareAndSet(p, pget)); + + var ret = pget.value; + pget.value = null; + return ret; + } + + public function peek() { + var ret = head.get(); + if (ret == null) + return null; // empty + return ret.value; + } + + public function peekLast() { + return tail.get().value; + } +} + +@:native('haxe.java.vm.AtomicNode') +@:nativeGen class AtomicNode extends AtomicReference> { + public var value:T; + + public function new(value) { + super(); + this.value = value; + } +} diff --git a/build/linux64_569e52e/std/java/vm/Deque.hx b/build/linux64_569e52e/std/java/vm/Deque.hx new file mode 100644 index 0000000..004c27e --- /dev/null +++ b/build/linux64_569e52e/std/java/vm/Deque.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java.vm; + +@:deprecated typedef Deque = sys.thread.Deque; diff --git a/build/linux64_569e52e/std/java/vm/Gc.hx b/build/linux64_569e52e/std/java/vm/Gc.hx new file mode 100644 index 0000000..1142366 --- /dev/null +++ b/build/linux64_569e52e/std/java/vm/Gc.hx @@ -0,0 +1,34 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java.vm; + +@:native('haxe.java.vm.Gc') class Gc { + public static function run(major:Bool) { + java.lang.System.gc(); + } + + public static function stats():{heap:Int, free:Int} { + var r = java.lang.Runtime.getRuntime(); + return {heap: cast r.totalMemory(), free: cast r.freeMemory()}; + } +} diff --git a/build/linux64_569e52e/std/java/vm/Lock.hx b/build/linux64_569e52e/std/java/vm/Lock.hx new file mode 100644 index 0000000..65286ff --- /dev/null +++ b/build/linux64_569e52e/std/java/vm/Lock.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java.vm; + +@:deprecated typedef Lock = sys.thread.Lock; diff --git a/build/linux64_569e52e/std/java/vm/Mutex.hx b/build/linux64_569e52e/std/java/vm/Mutex.hx new file mode 100644 index 0000000..ae0900c --- /dev/null +++ b/build/linux64_569e52e/std/java/vm/Mutex.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java.vm; + +@:deprecated typedef Mutex = sys.thread.Mutex; diff --git a/build/linux64_569e52e/std/java/vm/Thread.hx b/build/linux64_569e52e/std/java/vm/Thread.hx new file mode 100644 index 0000000..e1a1dcc --- /dev/null +++ b/build/linux64_569e52e/std/java/vm/Thread.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java.vm; + +@:deprecated typedef Thread = sys.thread.Thread; diff --git a/build/linux64_569e52e/std/java/vm/Tls.hx b/build/linux64_569e52e/std/java/vm/Tls.hx new file mode 100644 index 0000000..2bb6f1b --- /dev/null +++ b/build/linux64_569e52e/std/java/vm/Tls.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package java.vm; + +@:deprecated typedef Tls = sys.thread.Tls; diff --git a/build/linux64_569e52e/std/js/Boot.hx b/build/linux64_569e52e/std/js/Boot.hx new file mode 100644 index 0000000..6b299bc --- /dev/null +++ b/build/linux64_569e52e/std/js/Boot.hx @@ -0,0 +1,249 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package js; + +import js.Syntax; // import it here so it's always available in the compiler + +@:dox(hide) +class Boot { + static inline function isClass(o:Dynamic):Bool { + return untyped __define_feature__("js.Boot.isClass", o.__name__); + } + + static inline function isInterface(o:Class):Bool { + return untyped __define_feature__("js.Boot.isInterface", o.__isInterface__); + } + + static inline function isEnum(e:Dynamic):Bool { + return untyped __define_feature__("js.Boot.isEnum", e.__ename__); + } + + @:pure static function getClass(o:Null):Null { + if (o == null) { + return null; + } else if (Std.isOfType(o, Array)) { + return Array; + } else { + var cl = untyped __define_feature__("js.Boot.getClass", o.__class__); + if (cl != null) + return cl; + var name = __nativeClassName(o); + if (name != null) + return __resolveNativeClass(name); + return null; + } + } + + @:ifFeature("has_enum") + private static function __string_rec(o, s:String) { + untyped { + if (o == null) + return "null"; + if (s.length >= 5) + return "<...>"; // too much deep recursion + var t = js.Syntax.typeof(o); + if (t == "function" && (isClass(o) || isEnum(o))) + t = "object"; + switch (t) { + case "object": + #if !js_enums_as_arrays + __feature__("has_enum", if (o.__enum__) { + var e = $hxEnums[o.__enum__]; + var con = e.__constructs__[o._hx_index]; + var n = con._hx_name; + if (o.__params__) { + s += "\t"; + var params:Array = o.__params__(); + for (i in 0...params.length) + params[i] = __string_rec(params[i], s); + return n + "(" + params.join(",") + ")"; + } else { + return n; + } + }); + #end + if (js.Syntax.instanceof(o, Array)) { + #if js_enums_as_arrays + __feature__("has_enum", if (o.__enum__) { + if (o.length == 2) + return o[0]; + var str = o[0] + "("; + s += "\t"; + for (i in 2...o.length) { + if (i != 2) + str += "," + __string_rec(o[i], s); + else + str += __string_rec(o[i], s); + } + return str + ")"; + }); + #end + var str = "["; + s += "\t"; + for (i in 0...o.length) + str += (if (i > 0) "," else "") + __string_rec(o[i], s); + str += "]"; + return str; + } + var tostr; + try { + tostr = untyped o.toString; + } catch (e:Dynamic) { + // strange error on IE + return "???"; + } + if (tostr != null && tostr != js.Syntax.code("Object.toString") && js.Syntax.typeof(tostr) == "function") { + var s2 = o.toString(); + if (s2 != "[object Object]") + return s2; + } + var str = "{\n"; + s += "\t"; + var hasp = (o.hasOwnProperty != null); + var k:String = null; + js.Syntax.code("for( {0} in {1} ) {", k, o); + if (hasp && !o.hasOwnProperty(k)) + js.Syntax.code("continue"); + if (k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__") + js.Syntax.code("continue"); + if (str.length != 2) + str += ", \n"; + str += s + k + " : " + __string_rec(o[k], s); + js.Syntax.code("}"); + s = s.substring(1); + str += "\n" + s + "}"; + return str; + case "function": + return ""; + case "string": + return o; + default: + return String(o); + } + } + } + + @:pure private static function __interfLoop(cc:Dynamic, cl:Dynamic) { + if (cc == null) + return false; + if (cc == cl) + return true; + var intf:Dynamic = cc.__interfaces__; + if (intf != null + // ES6 classes inherit statics, so we want to avoid accessing inherited `__interfaces__` + #if (js_es >= 6) && (cc.__super__ == null || cc.__super__.__interfaces__ != intf) #end + ) { + for (i in 0...intf.length) { + var i:Dynamic = intf[i]; + if (i == cl || __interfLoop(i, cl)) + return true; + } + } + return __interfLoop(cc.__super__, cl); + } + + @:pure private static function __instanceof(o:Dynamic, cl:Dynamic) { + if (cl == null) + return false; + switch (cl) { + case Int: + return js.Syntax.typeof(o) == "number" && js.Syntax.strictEq(o | 0, o); + case Float: + return js.Syntax.typeof(o) == "number"; + case Bool: + return js.Syntax.typeof(o) == "boolean"; + case String: + return js.Syntax.typeof(o) == "string"; + case Array: + return js.Syntax.instanceof(o, Array) #if js_enums_as_arrays && o.__enum__ == null #end; + case Dynamic: + return o != null; + default: + if (o != null) { + // Check if o is an instance of a Haxe class or a native JS object + if (js.Syntax.typeof(cl) == "function") { + if (__downcastCheck(o, cl)) + return true; + } else if (js.Syntax.typeof(cl) == "object" && __isNativeObj(cl)) { + if (js.Syntax.instanceof(o, cl)) + return true; + } + } else { + return false; + } + // do not use isClass/isEnum here + untyped __feature__("Class.*", if (cl == Class && o.__name__ != null) return true); + untyped __feature__("Enum.*", if (cl == Enum && o.__ename__ != null) return true); + #if js_enums_as_arrays + return o.__enum__ == cl; + #else + return untyped __feature__( + "has_enum", + if (o.__enum__ != null) ($hxEnums[o.__enum__]) == cl else false, + false + ); + #end + } + } + + static function __downcastCheck(o:Dynamic, cl:Class):Bool { + return js.Syntax.instanceof(o, cl) || (isInterface(cl) && inline __implements(o, cl)); + } + + static function __implements(o:Dynamic, iface:Class):Bool { + return __interfLoop(getClass(o), iface); + } + + @:ifFeature("typed_cast") private static function __cast(o:Dynamic, t:Dynamic) { + if (o == null || __instanceof(o, t)) + return o; + else + throw "Cannot cast " + Std.string(o) + " to " + Std.string(t); + } + + static var __toStr:js.lib.Function; + + static function __init__() { + Boot.__toStr = (cast {}).toString; + } + + // get native JS [[Class]] + static function __nativeClassName(o:Dynamic):String { + var name:String = __toStr.call(o).slice(8, -1); + // exclude general Object and Function + // also exclude Math and JSON, because instanceof cannot be called on them + if (name == "Object" || name == "Function" || name == "Math" || name == "JSON") + return null; + return name; + } + + // check for usable native JS object + static function __isNativeObj(o:Dynamic):Bool { + return __nativeClassName(o) != null; + } + + // resolve native JS class in the global scope: + static function __resolveNativeClass(name:String) { + return js.Lib.global[cast name]; + } +} diff --git a/build/linux64_569e52e/std/js/Browser.hx b/build/linux64_569e52e/std/js/Browser.hx new file mode 100644 index 0000000..609876a --- /dev/null +++ b/build/linux64_569e52e/std/js/Browser.hx @@ -0,0 +1,137 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package js; + +import js.html.Storage; +import js.html.XMLHttpRequest; + +class Browser { + /** The global scope typed with fields available only in a worker context. */ + public static var self(get, never):js.html.WorkerGlobalScope; + + static inline function get_self():js.html.WorkerGlobalScope { + return js.Lib.global; + } + + /** The global window object. */ + public static var window(get, never):js.html.Window; + + extern inline static function get_window() + return js.Syntax.code("window"); + + /** Shortcut to Window.document. */ + public static var document(get, never):js.html.HTMLDocument; + + extern inline static function get_document() + return window.document; + + /** Shortcut to Window.location. */ + public static var location(get, never):js.html.Location; + + extern inline static function get_location() + return js.Lib.global.location; + + /** Shortcut to Window.navigator. */ + public static var navigator(get, never):js.html.Navigator; + + extern inline static function get_navigator() + return js.Lib.global.navigator; + + /** Shortcut to Window.console. */ + public static var console(get, never):js.html.ConsoleInstance; + + extern inline static function get_console() + return js.Lib.global.console; + + /** + * True if a window object exists, false otherwise. + * + * This can be used to check if the code is being executed in a non-browser + * environment such as node.js. + */ + public static var supported(get, never):Bool; + + static function get_supported() + return + js.Syntax.typeof(window) != "undefined" && + js.Syntax.typeof(window.location) != "undefined" && + js.Syntax.typeof(window.location.protocol) == "string"; + /** + * Safely gets the browser's local storage, or returns null if localStorage is unsupported or + * disabled. + */ + public static function getLocalStorage():Null { + try { + var s = window.localStorage; + s.getItem(""); + if (s.length == 0) { + var key = "_hx_" + Math.random(); + s.setItem(key, key); + s.removeItem(key); + } + return s; + } catch (e:Dynamic) { + return null; + } + } + + /** + * Safely gets the browser's session storage, or returns null if sessionStorage is unsupported + * or disabled. + */ + public static function getSessionStorage():Storage { + try { + var s = window.sessionStorage; + s.getItem(""); + if (s.length == 0) { + var key = "_hx_" + Math.random(); + s.setItem(key, key); + s.removeItem(key); + } + return s; + } catch (e:Dynamic) { + return null; + } + } + + /** + * Creates an XMLHttpRequest, with a fallback to ActiveXObject for ancient versions of Internet + * Explorer. + */ + public static function createXMLHttpRequest():XMLHttpRequest { + if (js.Syntax.code("typeof XMLHttpRequest") != "undefined") { + return new XMLHttpRequest(); + } + if (js.Syntax.code("typeof ActiveXObject") != "undefined") { + return js.Syntax.construct("ActiveXObject", "Microsoft.XMLHTTP"); + } + throw "Unable to create XMLHttpRequest object."; + } + + /** + Display an alert message box containing the given message. See also `Window.alert()`. + **/ + public static inline function alert(v:Dynamic) { + window.alert(Std.string(v)); + } +} diff --git a/build/linux64_569e52e/std/js/Cookie.hx b/build/linux64_569e52e/std/js/Cookie.hx new file mode 100644 index 0000000..8994cc6 --- /dev/null +++ b/build/linux64_569e52e/std/js/Cookie.hx @@ -0,0 +1,89 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package js; + +import Date; + +class Cookie { + /** + Create or update a cookie. + @param expireDelay In seconds. If null, the cookie expires at end of session. + **/ + public static function set(name:String, value:String, ?expireDelay:Int, ?path:String, ?domain:String, ?secure:Bool, ?sameSite:String) { + var s = name + "=" + StringTools.urlEncode(value); + if (expireDelay != null) { + var d = DateTools.delta(Date.now(), expireDelay * 1000); + s += ";expires=" + untyped d.toGMTString(); + } + if (path != null) { + s += ";path=" + path; + } + if (domain != null) { + s += ";domain=" + domain; + } + if (secure == true) { + s += ";secure"; + } + if (sameSite != null) { + s += ";SameSite=" + sameSite; + } + Browser.document.cookie = s; + } + + /** + Returns all cookies. + **/ + public static function all() { + var h = new haxe.ds.StringMap(); + var a = Browser.document.cookie.split(";"); + for (e in a) { + e = StringTools.ltrim(e); + var t = e.split("="); + if (t.length < 2) + continue; + h.set(t[0], StringTools.urlDecode(t[1])); + } + return h; + } + + /** + Returns value of a cookie. + **/ + public static function get(name:String) { + return all().get(name); + } + + /** + Returns true if a cookie `name` exists. + **/ + public static function exists(name:String) { + return all().exists(name); + } + + /** + Remove a cookie. + **/ + public static function remove(name:String, ?path:String, ?domain:String) { + set(name, "", -10, path, domain); + } +} diff --git a/build/linux64_569e52e/std/js/Error.hx b/build/linux64_569e52e/std/js/Error.hx new file mode 100644 index 0000000..b0241a8 --- /dev/null +++ b/build/linux64_569e52e/std/js/Error.hx @@ -0,0 +1,31 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package js; + +@:deprecated typedef Error = js.lib.Error; +@:deprecated typedef EvalError = js.lib.Error.EvalError; +@:deprecated typedef RangeError = js.lib.Error.RangeError; +@:deprecated typedef ReferenceError = js.lib.Error.ReferenceError; +@:deprecated typedef SyntaxError = js.lib.Error.SyntaxError; +@:deprecated typedef TypeError = js.lib.Error.TypeError; +@:deprecated typedef URIError = js.lib.Error.URIError; diff --git a/build/linux64_569e52e/std/js/Function.hx b/build/linux64_569e52e/std/js/Function.hx new file mode 100644 index 0000000..ef9d035 --- /dev/null +++ b/build/linux64_569e52e/std/js/Function.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package js; + +@:deprecated typedef Function = js.lib.Function; diff --git a/build/linux64_569e52e/std/js/JsIterator.hx b/build/linux64_569e52e/std/js/JsIterator.hx new file mode 100644 index 0000000..c56a241 --- /dev/null +++ b/build/linux64_569e52e/std/js/JsIterator.hx @@ -0,0 +1,26 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package js; + +@:deprecated typedef JsIterator = js.lib.Iterator; +@:deprecated typedef JsIteratorStep = js.lib.Iterator.IteratorStep; diff --git a/build/linux64_569e52e/std/js/Lib.hx b/build/linux64_569e52e/std/js/Lib.hx new file mode 100644 index 0000000..43722b4 --- /dev/null +++ b/build/linux64_569e52e/std/js/Lib.hx @@ -0,0 +1,161 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package js; + +/** + Platform-specific JavaScript Library. Provides some platform-specific functions + for the JavaScript target. +**/ +class Lib { + /** + Inserts a 'debugger' statement that will make a breakpoint if a debugger is available. + **/ + public static inline function debug() { + js.Syntax.code("debugger"); + } + + /** + Inserts an `import` expression that loads JavaScript object from + a module or file specified in the `module` argument. + **/ + public static inline function dynamicImport(module:String):js.lib.Promise { + return js.Syntax.code("import({0})", module); + } + + /** + Display an alert message box containing the given message. + @deprecated Use Browser.alert() instead. + **/ + @:deprecated("Lib.alert() is deprecated, use Browser.alert() instead") + public static function alert(v:Dynamic) { + js.Syntax.code("alert")(@:privateAccess js.Boot.__string_rec(v, "")); + } + + public static inline function eval(code:String):Dynamic { + return js.Syntax.code("eval")(code); + } + + /** + Inserts a `require` expression that loads JavaScript object from + a module or file specified in the `module` argument. + + This is only supported in environments where `require` function + is available, such as Node.js or RequireJS. + **/ + extern public static inline function require(module:String):Dynamic { + return js.Syntax.code("require")(module); + } + + /** + Native JavaScript `parseInt` function. + + Its specification is different from `Std.parseInt`, so one + might want to access the native one. + **/ + public static var parseInt(get, never):(string:String, ?radix:Int) -> Float; + + extern static inline function get_parseInt():(string:String, ?radix:Int) -> Float { + return js.Syntax.code("parseInt"); + } + + /** + Returns JavaScript `undefined` value. + + Note that this is only needed in very rare cases when working with external JavaScript code. + + In Haxe, `null` is used to represent the absence of a value. + **/ + public static var undefined(get, never):Dynamic; + + static inline function get_undefined():Dynamic { + return js.Syntax.code("undefined"); + } + + /** + `nativeThis` is the JavaScript `this`, which is semantically different + from the Haxe `this`. Use `nativeThis` only when working with external + JavaScript code. + + In Haxe, `this` is always bound to a class instance. + In JavaScript, `this` in a function can be bound to an arbitrary + variable when the function is called using `func.call(thisObj, ...)` or + `func.apply(thisObj, [...])`. + + Read more at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this + **/ + public static var nativeThis(get, never):Dynamic; + + extern static inline function get_nativeThis():Dynamic { + return js.Syntax.code("this"); + } + + /** + Call JavaScript `typeof` operator on the `o` value + and return a string representing the JavaScript type of a value. + + Read more at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof + **/ + extern public static inline function typeof(o:Dynamic):String { + return js.Syntax.typeof(o); + } + + /** + An alias of the JS "global" object. + + Concretely, it is set as the first defined value in the list of + `window`, `global`, `self`, and `this` in the top-level of the compiled output. + **/ + public static var global(get, never):Dynamic; + + extern static inline function get_global():Dynamic { + return untyped __define_feature__("js.Lib.global", js.Syntax.code("$global")); // $global is generated by the compiler + } + + /** + Re-throw last caught exception, preserving original stack information. + + Calling this is only possible inside a catch statement. + **/ + @:pure(false) public static function rethrow() { + // function is implemented in the compiler + } + + /** + Get original caught exception object, before unwrapping the `js.Boot.HaxeError`. + + Can be useful if we want to redirect the original error into some external API (e.g. Promise or node.js callbacks). + + Calling this is only possible inside a catch statement. + **/ + public static function getOriginalException():Dynamic { + return null; // function is implemented in the compiler + } + + /** + Generate next unique id + **/ + @:allow(haxe.ds.ObjectMap.assignId) + static inline function getNextHaxeUID():Int { + return js.Syntax.code("{0}.$haxeUID++", untyped __define_feature__("$global.$haxeUID", global)); + } +} diff --git a/build/linux64_569e52e/std/js/Object.hx b/build/linux64_569e52e/std/js/Object.hx new file mode 100644 index 0000000..6b2ecfa --- /dev/null +++ b/build/linux64_569e52e/std/js/Object.hx @@ -0,0 +1,27 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package js; + +@:deprecated typedef Object = js.lib.Object; +@:deprecated typedef ObjectPrototype = js.lib.Object.ObjectPrototype; +@:deprecated typedef ObjectPropertyDescriptor = js.lib.Object.ObjectPropertyDescriptor; diff --git a/build/linux64_569e52e/std/js/Promise.hx b/build/linux64_569e52e/std/js/Promise.hx new file mode 100644 index 0000000..5de240b --- /dev/null +++ b/build/linux64_569e52e/std/js/Promise.hx @@ -0,0 +1,28 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package js; + +@:deprecated typedef Promise = js.lib.Promise; +@:deprecated typedef PromiseHandler = js.lib.Promise.PromiseHandler; +@:deprecated typedef Thenable = js.lib.Promise.Thenable; +@:deprecated typedef ThenableStruct = js.lib.Promise.ThenableStruct; diff --git a/build/linux64_569e52e/std/js/RegExp.hx b/build/linux64_569e52e/std/js/RegExp.hx new file mode 100644 index 0000000..80df24e --- /dev/null +++ b/build/linux64_569e52e/std/js/RegExp.hx @@ -0,0 +1,26 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package js; + +@:deprecated typedef RegExp = js.lib.RegExp; +@:deprecated typedef RegExpMatch = js.lib.RegExp.RegExpMatch; diff --git a/build/linux64_569e52e/std/js/Selection.hx b/build/linux64_569e52e/std/js/Selection.hx new file mode 100644 index 0000000..6731e3d --- /dev/null +++ b/build/linux64_569e52e/std/js/Selection.hx @@ -0,0 +1,101 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package js; + +import js.html.TextAreaElement; + +class Selection { + var doc:Dynamic; + + public function new(doc:TextAreaElement) { + this.doc = doc; + } + + public function get() { + // Mozilla + if (doc.selectionStart != null) + return doc.value.substring(doc.selectionStart, doc.selectionEnd); + // IE + var range = untyped js.Lib.document.selection.createRange(); + if (range.parentElement() != doc) + return ""; + return range.text; + } + + public function select(start:Int, end:Int) { + doc.focus(); + // Mozilla + if (doc.selectionStart != null) { + doc.selectionStart = start; + doc.selectionEnd = end; + return; + } + // FIX : IE count \r\n as one single char for selection + // operations, we must then deal with it + var value:String = doc.value; + var p = 0, delta = 0; + while (true) { + var i = value.indexOf("\r\n", p); + if (i < 0 || i > start) + break; + delta++; + p = i + 2; + } + start -= delta; + while (true) { + var i = value.indexOf("\r\n", p); + if (i < 0 || i > end) + break; + delta++; + p = i + 2; + } + end -= delta; + // IE + var r = doc.createTextRange(); + r.moveEnd('textedit', -1); + r.moveStart('character', start); + r.moveEnd('character', end - start); + r.select(); + } + + public function insert(left:String, text:String, right:String) { + doc.focus(); + // Mozilla + if (doc.selectionStart != null) { + var top = doc.scrollTop; + var start = doc.selectionStart; + var end = doc.selectionEnd; + doc.value = doc.value.substr(0, start) + left + text + right + doc.value.substr(end); + doc.selectionStart = start + left.length; + doc.selectionEnd = start + left.length + text.length; + doc.scrollTop = top; + return; + } + // IE + var range = untyped js.Lib.document.selection.createRange(); + range.text = left + text + right; + range.moveStart('character', -text.length - right.length); + range.moveEnd('character', -right.length); + range.select(); + } +} diff --git a/build/linux64_569e52e/std/js/Set.hx b/build/linux64_569e52e/std/js/Set.hx new file mode 100644 index 0000000..42e1d3e --- /dev/null +++ b/build/linux64_569e52e/std/js/Set.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package js; + +@:deprecated typedef Set = js.lib.Set; diff --git a/build/linux64_569e52e/std/js/Symbol.hx b/build/linux64_569e52e/std/js/Symbol.hx new file mode 100644 index 0000000..4f811ac --- /dev/null +++ b/build/linux64_569e52e/std/js/Symbol.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package js; + +@:deprecated typedef Symbol = js.lib.Symbol; diff --git a/build/linux64_569e52e/std/js/Syntax.hx b/build/linux64_569e52e/std/js/Syntax.hx new file mode 100644 index 0000000..efa6d6c --- /dev/null +++ b/build/linux64_569e52e/std/js/Syntax.hx @@ -0,0 +1,94 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package js; + +import haxe.extern.Rest; + +/** + Generate JavaScript syntax not directly supported by Haxe. + Use only at low-level when specific target-specific code-generation is required. +**/ +@:noClosure +extern class Syntax { + /** + Inject `code` directly into generated source. + + `code` must be a string constant. + + Additional `args` are supported to provide code interpolation, for example: + ```haxe + Syntax.code("console.log({0}, {1})", "hi", 42); + ``` + will generate + ```haxe + console.log("hi", 42); + ``` + + Emits a compilation error if the count of `args` does not match the count of placeholders in `code`. + **/ + static function code(code:String, args:Rest):Dynamic; + + /** + Inject `code` directly into generated source. + The same as `js.Syntax.code` except this one does not provide code interpolation. + **/ + static function plainCode(code:String):Dynamic; + + /** + Generate `new cl(...args)` expression. + **/ + @:overload(function(cl:String, args:Rest):Dynamic {}) + static function construct(cl:Class, args:Rest):T; + + /** + Generate `v instanceof cl` expression. + **/ + @:pure static function instanceof(v:Dynamic, cl:Class):Bool; + + /** + Generate `typeof o` expression. + **/ + @:pure static function typeof(o:Dynamic):String; + + /** + Genearte `a === b` expression. + **/ + @:pure static function strictEq(a:Dynamic, b:Dynamic):Bool; + + /** + Genearte `a !== b` expression. + **/ + @:pure static function strictNeq(a:Dynamic, b:Dynamic):Bool; + + /** + Generate `delete o[f]` expression. + **/ + @:overload(function(o:Dynamic, f:Int):Bool {}) + static function delete(o:Dynamic, f:String):Bool; + + /** + Generate `o.f` expression, if `f` is a constant string, + or `o[f]` if it's any other expression. + **/ + static function field(o:Dynamic, f:String):Dynamic; +} diff --git a/build/linux64_569e52e/std/js/_std/Array.hx b/build/linux64_569e52e/std/js/_std/Array.hx new file mode 100644 index 0000000..7691912 --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/Array.hx @@ -0,0 +1,99 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +import haxe.iterators.ArrayKeyValueIterator; + +@:coreApi +extern class Array { + var length(default, null):Int; + + function new():Void; + function concat(a:Array):Array; + function join(sep:String):String; + function pop():Null; + function push(x:T):Int; + function reverse():Void; + function shift():Null; + function slice(pos:Int, ?end:Int):Array; + function sort(f:T->T->Int):Void; + function splice(pos:Int, len:Int):Array; + function toString():String; + function unshift(x:T):Void; + + inline function insert(pos:Int, x:T):Void { + (cast this).splice(pos, 0, x); + } + + inline function remove(x:T):Bool { + return @:privateAccess HxOverrides.remove(this, x); + } + + inline function contains(x:T):Bool { + #if (js_es >= 6) + return (cast this).includes(x); + #else + return this.indexOf(x) != -1; + #end + } + + #if (js_es >= 5) + @:pure function indexOf(x:T, ?fromIndex:Int):Int; + @:pure function lastIndexOf(x:T, ?fromIndex:Int):Int; + #else + inline function indexOf(x:T, ?fromIndex:Int):Int { + return @:privateAccess HxOverrides.indexOf(this, x, (fromIndex != null) ? fromIndex : 0); + } + + inline function lastIndexOf(x:T, ?fromIndex:Int):Int { + return @:privateAccess HxOverrides.lastIndexOf(this, x, (fromIndex != null) ? fromIndex : length - 1); + } + #end + + @:pure + inline function copy():Array { + return (cast this).slice(); + } + + @:runtime inline function map(f:T->S):Array { + var result:Array = js.Syntax.construct(Array, length); + for(i in 0...length) { + result[i] = f(this[i]); + } + return result; + } + + @:runtime inline function filter(f:T->Bool):Array { + return [for (v in this) if (f(v)) v]; + } + + @:runtime inline function iterator():haxe.iterators.ArrayIterator { + return new haxe.iterators.ArrayIterator(this); + } + + @:runtime inline function keyValueIterator():ArrayKeyValueIterator { + return new ArrayKeyValueIterator(this); + } + + inline function resize(len:Int):Void { + this.length = len; + } +} diff --git a/build/linux64_569e52e/std/js/_std/Date.hx b/build/linux64_569e52e/std/js/_std/Date.hx new file mode 100644 index 0000000..699da1d --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/Date.hx @@ -0,0 +1,57 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +@:coreApi extern class Date { + @:pure function new(year:Int, month:Int, day:Int, hour:Int, min:Int, sec:Int):Void; + @:pure function getTime():Float; + @:pure function getHours():Int; + @:pure function getMinutes():Int; + @:pure function getSeconds():Int; + @:pure function getFullYear():Int; + @:pure function getMonth():Int; + @:pure function getDate():Int; + @:pure function getDay():Int; + + @:pure function getUTCHours():Int; + @:pure function getUTCMinutes():Int; + @:pure function getUTCSeconds():Int; + @:pure function getUTCFullYear():Int; + @:pure function getUTCMonth():Int; + @:pure function getUTCDate():Int; + @:pure function getUTCDay():Int; + @:pure function getTimezoneOffset():Int; + + @:pure inline function toString():String { + return @:privateAccess HxOverrides.dateStr(this); + } + + @:pure static inline function now():Date { + return js.Syntax.construct(Date); + } + + @:pure static inline function fromTime(t:Float):Date { + return js.Syntax.construct(Date, t); + } + + @:pure static inline function fromString(s:String):Date { + return @:privateAccess HxOverrides.strDate(s); + } +} diff --git a/build/linux64_569e52e/std/js/_std/EReg.hx b/build/linux64_569e52e/std/js/_std/EReg.hx new file mode 100644 index 0000000..ae91f2f --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/EReg.hx @@ -0,0 +1,125 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +@:coreApi class EReg { + var r:HaxeRegExp; + + public inline function new(r:String, opt:String):Void { + this.r = new HaxeRegExp(r, opt.split("u").join("")); // 'u' (utf8) depends on page encoding + } + + public function match(s:String):Bool { + if (r.global) + r.lastIndex = 0; + r.m = r.exec(s); + r.s = s; + return (r.m != null); + } + + public function matched(n:Int):String { + return if (r.m != null && n >= 0 && n < r.m.length) r.m[n] else throw "EReg::matched"; + } + + public function matchedLeft():String { + if (r.m == null) + throw "No string matched"; + return r.s.substr(0, r.m.index); + } + + public function matchedRight():String { + if (r.m == null) + throw "No string matched"; + var sz = r.m.index + r.m[0].length; + return r.s.substr(sz, r.s.length - sz); + } + + public function matchedPos():{pos:Int, len:Int} { + if (r.m == null) + throw "No string matched"; + return {pos: r.m.index, len: r.m[0].length}; + } + + public function matchSub(s:String, pos:Int, len:Int = -1):Bool { + return if (r.global) { + r.lastIndex = pos; + r.m = r.exec(len < 0 ? s : s.substr(0, pos + len)); + var b = r.m != null; + if (b) { + r.s = s; + } + b; + } else { + // TODO: check some ^/$ related corner cases + var b = match(len < 0 ? s.substr(pos) : s.substr(pos, len)); + if (b) { + r.s = s; + r.m.index += pos; + } + b; + } + } + + public function split(s:String):Array { + // we can't use directly s.split because it's ignoring the 'g' flag + var d = "#__delim__#"; + return replace(s, d).split(d); + } + + public inline function replace(s:String, by:String):String { + return (cast s).replace(r, by); + } + + public function map(s:String, f:EReg->String):String { + var offset = 0; + var buf = new StringBuf(); + do { + if (offset >= s.length) + break; + else if (!matchSub(s, offset)) { + buf.add(s.substr(offset)); + break; + } + var p = matchedPos(); + buf.add(s.substr(offset, p.pos - offset)); + buf.add(f(this)); + if (p.len == 0) { + buf.add(s.substr(p.pos, 1)); + offset = p.pos + 1; + } else + offset = p.pos + p.len; + } while (r.global); + if (!r.global && offset > 0 && offset < s.length) + buf.add(s.substr(offset)); + return buf.toString(); + } + + public static inline function escape(s:String):String { + return (cast s).replace(escapeRe, "\\$&"); + } + + static var escapeRe = new js.lib.RegExp("[.*+?^${}()|[\\]\\\\]", "g"); +} + +@:native("RegExp") +private extern class HaxeRegExp extends js.lib.RegExp { + var m:js.lib.RegExp.RegExpMatch; + var s:String; +} diff --git a/build/linux64_569e52e/std/js/_std/HxOverrides.hx b/build/linux64_569e52e/std/js/_std/HxOverrides.hx new file mode 100644 index 0000000..8f55624 --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/HxOverrides.hx @@ -0,0 +1,164 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +@:noDoc +class HxOverrides { + static function dateStr(date:Date):String { + var m = date.getMonth() + 1; + var d = date.getDate(); + var h = date.getHours(); + var mi = date.getMinutes(); + var s = date.getSeconds(); + return date.getFullYear() + "-" + (if (m < 10) "0" + m else "" + m) + "-" + (if (d < 10) "0" + d else "" + d) + " " + + (if (h < 10) "0" + h else "" + h) + ":" + (if (mi < 10) "0" + mi else "" + mi) + ":" + (if (s < 10) "0" + s else "" + s); + } + + static function strDate(s:String):Date { + switch (s.length) { + case 8: // hh:mm:ss + var k = s.split(":"); + var d = js.Syntax.construct(Date); + (cast d)[cast "setTime"](0); + (cast d)[cast "setUTCHours"](k[0]); + (cast d)[cast "setUTCMinutes"](k[1]); + (cast d)[cast "setUTCSeconds"](k[2]); + return d; + case 10: // YYYY-MM-DD + var k = s.split("-"); + return new Date(cast k[0], (cast k[1]) - 1, cast k[2], 0, 0, 0); + case 19: // YYYY-MM-DD hh:mm:ss + var k = s.split(" "); + var y = k[0].split("-"); + var t = k[1].split(":"); + return new Date(cast y[0], (cast y[1]) - 1, cast y[2], cast t[0], cast t[1], cast t[2]); + default: + throw "Invalid date format : " + s; + } + } + + @:pure + static function cca(s:String, index:Int):Null { + var x = (cast s).charCodeAt(index); + if (x != x) // fast isNaN + return js.Lib.undefined; // isNaN will still return true + return x; + } + + @:pure + static function substr(s:String, pos:Int, ?len:Int):String { + if (len == null) { + len = s.length; + } else if (len < 0) { + if (pos == 0) + len = s.length + len; + else + return ""; + } + + #if (js_es < 5) + if (pos < 0) { + pos = s.length + pos; + if (pos < 0) + pos = 0; + } + #end + + return (cast s).substr(pos, len); + } + + @:pure + static function indexOf(a:Array, obj:T, i:Int) { + var len = a.length; + if (i < 0) { + i += len; + if (i < 0) + i = 0; + } + while (i < len) { + if (js.Syntax.strictEq(a[i], obj)) + return i; + i++; + } + return -1; + } + + @:pure + static function lastIndexOf(a:Array, obj:T, i:Int) { + var len = a.length; + if (i >= len) + i = len - 1; + else if (i < 0) + i += len; + while (i >= 0) { + if (js.Syntax.strictEq(a[i], obj)) + return i; + i--; + } + return -1; + } + + static function remove(a:Array, obj:T) { + var i = a.indexOf(obj); + if (i == -1) + return false; + a.splice(i, 1); + return true; + } + + @:pure + static function iter(a:Array):Iterator + untyped { + return { + cur: 0, + arr: a, + hasNext: function() { + return __this__.cur < __this__.arr.length; + }, + next: function() { + return __this__.arr[__this__.cur++]; + } + }; + } + + @:ifFeature("anon_read.keyValueIterator", "dynamic_read.keyValueIterator", "closure_read.keyValueIterator") + static function keyValueIter( a : Array ) { + return new haxe.iterators.ArrayKeyValueIterator(a); + } + + @:pure + static function now(): Float return js.lib.Date.now(); + + static function __init__() + untyped { + #if (js_es < 5) + __feature__('HxOverrides.indexOf', + if (Array.prototype.indexOf) js.Syntax.code("HxOverrides").indexOf = function(a, o, i) return Array.prototype.indexOf.call(a, o, i)); + __feature__('HxOverrides.lastIndexOf', + if (Array.prototype.lastIndexOf) js.Syntax.code("HxOverrides").lastIndexOf = function(a, o, i) return Array.prototype.lastIndexOf.call(a, o, i)); + #end + + __feature__('HxOverrides.now', + if (js.Syntax.typeof(performance) != 'undefined' && js.Syntax.typeof(performance.now) == 'function') { + HxOverrides.now = performance.now.bind(performance); + } + ); + } +} diff --git a/build/linux64_569e52e/std/js/_std/Math.hx b/build/linux64_569e52e/std/js/_std/Math.hx new file mode 100644 index 0000000..e673d2e --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/Math.hx @@ -0,0 +1,87 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +import js.Syntax.code; + +// Can't enable @:coreApi because some fields are now inline getters +// @:coreApi +@:keepInit +extern class Math { + static var PI(default, null):Float; + + static var NEGATIVE_INFINITY(get, null):Float; + @:pure private static inline function get_NEGATIVE_INFINITY():Float { + return -code("Infinity"); + } + + static var POSITIVE_INFINITY(get, null):Float; + @:pure private static inline function get_POSITIVE_INFINITY():Float { + return code("Infinity"); + } + + static var NaN(get, null):Float; + @:pure private static inline function get_NaN():Float { + return code("NaN"); + } + + @:pure static function abs(v:Float):Float; + @:pure static function acos(v:Float):Float; + @:pure static function asin(v:Float):Float; + @:pure static function atan(v:Float):Float; + @:pure static function atan2(y:Float, x:Float):Float; + @:pure static function ceil(v:Float):Int; + @:pure static function cos(v:Float):Float; + @:pure static function exp(v:Float):Float; + @:pure static function floor(v:Float):Int; + @:pure static function log(v:Float):Float; + @:pure static function max(a:Float, b:Float):Float; + @:pure static function min(a:Float, b:Float):Float; + @:pure static function pow(v:Float, exp:Float):Float; + static function random():Float; + @:pure static function round(v:Float):Int; + @:pure static function sin(v:Float):Float; + @:pure static function sqrt(v:Float):Float; + @:pure static function tan(v:Float):Float; + + @:pure static inline function ffloor(v:Float):Float { + return floor(v); + } + + @:pure static inline function fceil(v:Float):Float { + return ceil(v); + } + + @:pure static inline function fround(v:Float):Float { + return round(v); + } + + @:pure static inline function isFinite(f:Float):Bool { + return code("isFinite")(f); + } + + @:pure static inline function isNaN(f:Float):Bool { + return code("isNaN")(f); + } + + static function __init__():Void { + untyped __feature__("Type.resolveClass", $hxClasses["Math"] = Math); + } +} diff --git a/build/linux64_569e52e/std/js/_std/Reflect.hx b/build/linux64_569e52e/std/js/_std/Reflect.hx new file mode 100644 index 0000000..9a6d12a --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/Reflect.hx @@ -0,0 +1,122 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +@:coreApi class Reflect { + @:pure + public inline static function hasField(o:Dynamic, field:String):Bool { + return js.lib.Object.prototype.hasOwnProperty.call(o, field); + } + + @:pure + public static function field(o:Dynamic, field:String):Dynamic { + try + return o[cast field] + catch (e:Dynamic) + return null; + } + + public inline static function setField(o:Dynamic, field:String, value:Dynamic):Void { + o[cast field] = value; + } + + public static function getProperty(o:Dynamic, field:String):Dynamic + untyped { + var tmp; + return if (o == null) __define_feature__("Reflect.getProperty", + null) else if (o.__properties__ && (tmp = o.__properties__["get_" + field])) o[tmp]() else o[field]; + } + + public static function setProperty(o:Dynamic, field:String, value:Dynamic):Void + untyped { + var tmp; + if (o.__properties__ && (tmp = o.__properties__["set_" + field])) + o[tmp](value) + else + o[field] = __define_feature__("Reflect.setProperty", value); + } + + public inline static function callMethod(o:Dynamic, func:haxe.Constraints.Function, args:Array):Dynamic { + return (cast func : js.lib.Function).apply(o, args); + } + + public static function fields(o:Dynamic):Array { + var a = []; + if (o != null) + untyped { + var hasOwnProperty = js.lib.Object.prototype.hasOwnProperty; + js.Syntax.code("for( var f in o ) {"); + if (f != "__id__" && f != "hx__closures__" && hasOwnProperty.call(o, f)) + a.push(f); + js.Syntax.code("}"); + } + return a; + } + + @:access(js.Boot) + public static function isFunction(f:Dynamic):Bool { + return js.Syntax.typeof(f) == "function" && !(js.Boot.isClass(f) || js.Boot.isEnum(f)); + } + + public static function compare(a:T, b:T):Int { + return (a == b) ? 0 : (((cast a) > (cast b)) ? 1 : -1); + } + + public static inline function compareMethods(f1:Dynamic, f2:Dynamic):Bool { + return f1 == f2; + } + + @:access(js.Boot) + public static function isObject(v:Dynamic):Bool { + if (v == null) + return false; + var t = js.Syntax.typeof(v); + return (t == "string" || (t == "object" && v.__enum__ == null)) + || (t == "function" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null); + } + + public static function isEnumValue(v:Dynamic):Bool { + return v != null && v.__enum__ != null; + } + + public static function deleteField(o:Dynamic, field:String):Bool { + if (!hasField(o, field)) + return false; + js.Syntax.delete(o, field); + return true; + } + + public static function copy(o:Null):Null { + if (o == null) + return null; + var o2:Dynamic = {}; + for (f in Reflect.fields(o)) + Reflect.setField(o2, f, Reflect.field(o, f)); + return o2; + } + + @:overload(function(f:Array->Void):Dynamic {}) + public static function makeVarArgs(f:Array->Dynamic):Dynamic { + return function() { + var a = untyped Array.prototype.slice.call(js.Syntax.code("arguments")); + return f(a); + }; + } +} diff --git a/build/linux64_569e52e/std/js/_std/Std.hx b/build/linux64_569e52e/std/js/_std/Std.hx new file mode 100644 index 0000000..21d51e3 --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/Std.hx @@ -0,0 +1,122 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +import js.Boot; +import js.Syntax; + +@:keepInit +@:coreApi class Std { + @:deprecated('Std.is is deprecated. Use Std.isOfType instead.') + public static inline function is(v:Dynamic, t:Dynamic):Bool { + return isOfType(v, t); + } + + public static inline function isOfType(v:Dynamic, t:Dynamic):Bool { + return @:privateAccess js.Boot.__instanceof(v, t); + } + + public static inline function downcast(value:T, c:Class):S @:privateAccess { + return if (js.Boot.__downcastCheck(value, c)) cast value else null; + } + + @:deprecated('Std.instance() is deprecated. Use Std.downcast() instead.') + public static inline function instance(value:T, c:Class):S { + return downcast(value, c); + } + + @:pure + public static function string(s:Dynamic):String { + return @:privateAccess js.Boot.__string_rec(s, ""); + } + + public static inline function int(x:Float):Int { + return (cast x) | 0; + } + + @:pure + public static function parseInt(x:String):Null { + #if (js_es >= 5) + final v = js.Lib.parseInt(x); + #else + // before ES5, octal was supported in some implementations, so we need to explicitly use base 10 or 16 + if (x == null) + return null; + var v:Float = Math.NaN; + for (i => c in StringTools.keyValueIterator(x)) { + if ((c <= 8 || c >= 14) && !(c == ' '.code || c == '-'.code || c == '+'.code)) { + final nc = js.Syntax.code("{0}[{1}]", x, i + 1); + v = js.Lib.parseInt(x, c == '0'.code && (nc == "x" || nc == "X") ? 16 : 10); + break; + } + } + #end + if (Math.isNaN(v)) + return null; + return cast v; + } + + public static inline function parseFloat(x:String):Float { + return js.Syntax.code("parseFloat({0})", x); + } + + public static function random(x:Int):Int { + return x <= 0 ? 0 : Math.floor(Math.random() * x); + } + + static function __init__():Void untyped { + __feature__("js.Boot.getClass", + Object.defineProperty(String.prototype, "__class__", + {value: __feature__("Type.resolveClass", $hxClasses["String"] = String, String), enumerable: false, writable: true})); + __feature__("js.Boot.isClass", String.__name__ = "String"); + __feature__("Type.resolveClass", $hxClasses["Array"] = Array); + __feature__("js.Boot.isClass", Array.__name__ = "Array"); + __feature__("Date.*", { + __feature__("js.Boot.getClass", + js.Syntax.code('Date') + .prototype.__class__ = __feature__("Type.resolveClass", $hxClasses["Date"] = js.Syntax.code('Date'), js.Syntax.code('Date'))); + __feature__("js.Boot.isClass", js.Syntax.code('Date').__name__ = "Date"); + }); + __feature__("Int.*", js.Syntax.code('var Int = { };')); + __feature__("Dynamic.*", js.Syntax.code('var Dynamic = { };')); + __feature__("Float.*", js.Syntax.code('var Float = Number')); + __feature__("Bool.*", js.Syntax.code('var Bool = Boolean')); + __feature__("Class.*", js.Syntax.code('var Class = { };')); + __feature__("Enum.*", js.Syntax.code('var Enum = { };')); + #if (js_es < 5) + __feature__("Array.map", if (Array.prototype.map == null) Array.prototype.map = function(f) { + var a = []; + for (i in 0...__this__.length) + a[i] = f(__this__[i]); + return a; + }); + __feature__("Array.filter", if (Array.prototype.filter == null) Array.prototype.filter = function(f) { + var a = []; + for (i in 0...__this__.length) { + var e = __this__[i]; + if (f(e)) + a.push(e); + } + return a; + }); + #end + } +} diff --git a/build/linux64_569e52e/std/js/_std/String.hx b/build/linux64_569e52e/std/js/_std/String.hx new file mode 100644 index 0000000..da89754 --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/String.hx @@ -0,0 +1,51 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +@:coreApi extern class String { + var length(default, null):Int; + + @:pure function new(string:String):Void; + @:pure function toUpperCase():String; + @:pure function toLowerCase():String; + @:pure function charAt(index:Int):String; + @:pure function indexOf(str:String, ?startIndex:Int):Int; + @:pure function lastIndexOf(str:String, ?startIndex:Int):Int; + @:pure function split(delimiter:String):Array; + @:pure function toString():String; + @:pure function substring(startIndex:Int, ?endIndex:Int):String; + + @:pure inline function charCodeAt(index:Int):Null { + return @:privateAccess HxOverrides.cca(this, index); + } + + @:pure inline function substr(pos:Int, ?len:Int):String { + return @:privateAccess HxOverrides.substr(this, pos, len); + } + + @:pure static inline function fromCharCode(code:Int):String { + return untyped __define_feature__('String.fromCharCode', js.Syntax.code("String.fromCodePoint({0})", code)); + } + + static function __init__():Void { + untyped __feature__('String.fromCharCode', + js.Syntax.code("if( String.fromCodePoint == null ) String.fromCodePoint = function(c) { return c < 0x10000 ? String.fromCharCode(c) : String.fromCharCode((c>>10)+0xD7C0)+String.fromCharCode((c&0x3FF)+0xDC00); }")); + } +} diff --git a/build/linux64_569e52e/std/js/_std/Type.hx b/build/linux64_569e52e/std/js/_std/Type.hx new file mode 100644 index 0000000..39b2096 --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/Type.hx @@ -0,0 +1,336 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +enum ValueType { + TNull; + TInt; + TFloat; + TBool; + TObject; + TFunction; + TClass(c:Class); + TEnum(e:Enum); + TUnknown; +} + +@:coreApi class Type { + public static inline function getClass(o:T):Null> { + return @:privateAccess js.Boot.getClass(o); + } + + public static function getEnum(o:EnumValue):Enum + untyped { + if (o == null) + return null; + #if js_enums_as_arrays + return o.__enum__; + #else + return $hxEnums[o.__enum__]; + #end + } + + public static inline function getSuperClass(c:Class):Class { + return untyped __define_feature__("Type.getSuperClass", c.__super__); + } + + public static inline function getClassName(c:Class):String { + return untyped __define_feature__("Type.getClassName", c.__name__); + } + + public static inline function getEnumName(e:Enum):String { + return untyped __define_feature__("Type.getEnumName", e.__ename__); + } + + #if js_enums_as_arrays + public static function resolveClass(name:String):Class + untyped { + var cl:Class = $hxClasses[name]; + // ensure that this is a class + if (cl == null || !js.Boot.isClass(cl)) + return null; + return cl; + } + + public static function resolveEnum(name:String):Enum + untyped { + var e:Dynamic = $hxClasses[name]; + // ensure that this is an enum + if (e == null || !js.Boot.isEnum(e)) + return null; + return e; + } + #else + public static inline function resolveClass(name:String):Class { + return untyped __define_feature__("Type.resolveClass", $hxClasses[name]); + } + + public static inline function resolveEnum(name:String):Enum { + return untyped __define_feature__("Type.resolveEnum", $hxEnums[name]); + } + #end + + #if (js_es < 5) + public static function createInstance(cl:Class, args:Array):T { + switch (args.length) { + case 0: + return js.Syntax.construct(cl); + case 1: + return js.Syntax.construct(cl, args[0]); + case 2: + return js.Syntax.construct(cl, args[0], args[1]); + case 3: + return js.Syntax.construct(cl, args[0], args[1], args[2]); + case 4: + return js.Syntax.construct(cl, args[0], args[1], args[2], args[3]); + case 5: + return js.Syntax.construct(cl, args[0], args[1], args[2], args[3], args[4]); + case 6: + return js.Syntax.construct(cl, args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: + return js.Syntax.construct(cl, args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + case 8: + return js.Syntax.construct(cl, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]); + case 9: + return js.Syntax.construct(cl, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]); + case 10: + return js.Syntax.construct(cl, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]); + case 11: + return js.Syntax.construct(cl, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10]); + case 12: + return js.Syntax.construct(cl, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11]); + case 13: + return js.Syntax.construct(cl, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], + args[12]); + case 14: + return js.Syntax.construct(cl, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], + args[12], args[13]); + default: + throw "Too many arguments"; + } + } + + public static function createEmptyInstance(cl:Class):T + untyped { + js.Syntax.code("function empty() {}; empty.prototype = cl.prototype"); + return js.Syntax.code("new empty()"); + } + #else + public static function createInstance(cl:Class, args:Array):T { + var ctor = ((cast js.lib.Function).prototype.bind : js.lib.Function).apply(cl, [null].concat(args)); + return js.Syntax.code("new ({0})", ctor); // cannot use `js.Syntax.construct` because we need parens if `ctor` is fused in + } + + public static inline function createEmptyInstance(cl:Class):T { + return js.lib.Object.create((cast cl).prototype); + } + #end + + public static function createEnum(e:Enum, constr:String, ?params:Array):T { + var f:Dynamic = Reflect.field(e, constr); + if (f == null) + throw "No such constructor " + constr; + if (Reflect.isFunction(f)) { + if (params == null) + throw "Constructor " + constr + " need parameters"; + return Reflect.callMethod(e, f, params); + } + if (params != null && params.length != 0) + throw "Constructor " + constr + " does not need parameters"; + return f; + } + + public static function createEnumIndex(e:Enum, index:Int, ?params:Array):T { + #if js_enums_as_arrays + var c:String = (untyped e.__constructs__)[index]; + #else + var c:String = switch (untyped e.__constructs__)[index] { + case null: null; + case ctor: ctor._hx_name; + } + #end + if (c == null) + throw index + " is not a valid enum constructor index"; + return createEnum(e, c, params); + } + + #if (js_es >= 6) + public static function getInstanceFields(c:Class):Array { + var result = []; + while (c != null) { + for (name in js.lib.Object.getOwnPropertyNames((cast c).prototype)) { + switch name { + case "constructor" | "__class__" | "__properties__": + // skip special names + case _: + if (result.indexOf(name) == -1) + result.push(name); + } + } + c = getSuperClass(c); + } + return result; + } + + public static function getClassFields(c:Class):Array { + var a = js.lib.Object.getOwnPropertyNames(cast c); + a.remove("__id__"); + a.remove("hx__closures__"); + a.remove("__name__"); + a.remove("__interfaces__"); + a.remove("__isInterface__"); + a.remove("__properties__"); + a.remove("__instanceFields__"); + a.remove("__super__"); + a.remove("__meta__"); + a.remove("prototype"); + a.remove("name"); + a.remove("length"); + return a; + } + #else + public static function getInstanceFields(c:Class):Array { + var a = []; + js.Syntax.code("for(var i in c.prototype) a.push(i)"); + a.remove("__class__"); + a.remove("__properties__"); + return a; + } + + public static function getClassFields(c:Class):Array { + var a = Reflect.fields(c); + a.remove("__name__"); + a.remove("__interfaces__"); + a.remove("__properties__"); + a.remove("__super__"); + a.remove("__meta__"); + a.remove("prototype"); + return a; + } + #end + + public static inline function getEnumConstructs(e:Enum):Array { + #if js_enums_as_arrays + return ((cast e).__constructs__ : Array).copy(); + #else + return ((cast e).__constructs__ : Array<{_hx_name:String}>).map(c -> c._hx_name); + #end + } + + @:access(js.Boot) + public static function typeof(v:Dynamic):ValueType { + switch (js.Syntax.typeof(v)) { + case "boolean": + return TBool; + case "string": + return TClass(String); + case "number": + // this should handle all cases : NaN, +/-Inf and Floats outside range + if (Math.ceil(v) == v % 2147483648.0) + return TInt; + return TFloat; + case "object": + if (v == null) + return TNull; + var e = v.__enum__; + if (e != null) { + #if js_enums_as_arrays + return TEnum(e); + #else + return TEnum(untyped $hxEnums[e]); + #end + } + var c = js.Boot.getClass(v); + if (c != null) + return TClass(c); + return TObject; + case "function": + if (js.Boot.isClass(v) || js.Boot.isEnum(v)) + return TObject; + return TFunction; + case "undefined": + return TNull; + default: + return TUnknown; + } + } + + public static function enumEq(a:T, b:T):Bool + untyped { + if (a == b) + return true; + try { + var e = a.__enum__; + if (e == null || e != b.__enum__) + return false; + #if js_enums_as_arrays + if (a[0] != b[0]) + return false; + for (i in 2...a.length) + if (!enumEq(a[i], b[i])) + return false; + #else + if (a._hx_index != b._hx_index) + return false; + var aparams:Array = a.__params__(); + var bparams:Array = b.__params__(); + for (i in 0...aparams.length) { + if (!enumEq(aparams[i], bparams[i])) { + return false; + } + } + #end + } catch (e:Dynamic) { + return false; + } + return true; + } + + public inline static function enumConstructor(e:EnumValue):String { + #if js_enums_as_arrays + return untyped e[0]; + #else + return untyped $hxEnums[e.__enum__].__constructs__[e._hx_index]._hx_name; + #end + } + + #if js_enums_as_arrays + public inline static function enumParameters(e:EnumValue):Array { + return untyped e.slice(2); + } + #else + public static function enumParameters(e:EnumValue):Array + untyped { + return e.__params__ != null ? e.__params__() : []; + } + #end + + public inline static function enumIndex(e:EnumValue):Int { + #if !js_enums_as_arrays + return untyped e._hx_index; + #else + return untyped e[1]; + #end + } + + public inline static function allEnums(e:Enum):Array { + return untyped __define_feature__("Type.allEnums", e.__empty_constructs__.slice()); + } +} diff --git a/build/linux64_569e52e/std/js/_std/haxe/Exception.hx b/build/linux64_569e52e/std/js/_std/haxe/Exception.hx new file mode 100644 index 0000000..e1ec603 --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/haxe/Exception.hx @@ -0,0 +1,171 @@ +package haxe; + +import js.lib.Error; + +@:coreApi +class Exception extends NativeException { + public var message(get,never):String; + public var stack(get,never):CallStack; + public var previous(get,never):Null; + public var native(get,never):Any; + + @:ifFeature("haxe.Exception.get_stack") + @:noCompletion var __skipStack:Int; + @:noCompletion var __exceptionStack(get,set):Null; + @:noCompletion var __nativeException:Any; + @:noCompletion var __previousException:Null; + + static function caught(value:Any):Exception { + if(Std.isOfType(value, Exception)) { + return value; + } else if(Std.isOfType(value, Error)) { + return new Exception((cast value:Error).message, null, value); + } else { + return new ValueException(value, null, value); + } + } + + static function thrown(value:Any):Any { + if(Std.isOfType(value, Exception)) { + return (value:Exception).native; + } else if(Std.isOfType(value, Error)) { + return value; + } else { + var e = new ValueException(value); + untyped __feature__("haxe.Exception.get_stack", e.__shiftStack()); + return e; + } + } + + public function new(message:String, ?previous:Exception, ?native:Any) { + super(message); + (cast this).message = message; + __previousException = previous; + __nativeException = native != null ? native : this; + untyped __feature__('haxe.Exception.stack', { + __skipStack = 0; + var old = js.Syntax.code('Error.prepareStackTrace'); + js.Syntax.code('Error.prepareStackTrace = function(e) { return e.stack; }'); + if(Std.isOfType(native, Error)) { + (cast this).stack = native.stack; + } else { + var e:Error = null; + if ((cast Error).captureStackTrace) { + (cast Error).captureStackTrace(this, Exception); + e = cast this; + } else { + e = new Error(); + //Internet Explorer provides call stack only if error was thrown + if(js.Syntax.typeof(e.stack) == "undefined") { + js.Syntax.code('try { throw {0}; } catch(_) {}', e); + __skipStack++; + } + } + (cast this).stack = e.stack; + } + js.Syntax.code('Error.prepareStackTrace = {0}', old); + }); + } + + function unwrap():Any { + return __nativeException; + } + + public function toString():String { + return message; + } + + public function details():String { + return inline CallStack.exceptionToString(this); + } + + @:noCompletion + @:ifFeature("haxe.Exception.get_stack") + inline function __shiftStack():Void { + __skipStack++; + } + + function get_message():String { + return (cast this:Error).message; + } + + function get_previous():Null { + return __previousException; + } + + final function get_native():Any { + return __nativeException; + } + + @:ifFeature('haxe.NativeStackTrace.exceptionStack') + function get_stack():CallStack { + return switch __exceptionStack { + case null: + __exceptionStack = NativeStackTrace.toHaxe(NativeStackTrace.normalize((cast this).stack), __skipStack); + case s: s; + } + } + + @:noCompletion + function setProperty(name:String, value:Any):Void { + try { + js.lib.Object.defineProperty(this, name, {value:value}); + } catch(e:Exception) { + js.Syntax.code('{0}[{1}] = {2}', this, name, value); + } + } + + @:noCompletion + inline function get___exceptionStack():CallStack { + return (cast this).__exceptionStack; + } + + @:noCompletion + inline function set___exceptionStack(value:CallStack):CallStack { + setProperty('__exceptionStack', value); + return value; + } + + @:noCompletion + inline function get___skipStack():Int { + return (cast this).__skipStack; + } + + @:noCompletion + inline function set___skipStack(value:Int):Int { + setProperty('__skipStack', value); + return value; + } + + @:noCompletion + inline function get___nativeException():Any { + return (cast this).__nativeException; + } + + @:noCompletion + inline function set___nativeException(value:Any):Any { + setProperty('__nativeException', value); + return value; + } + + @:noCompletion + inline function get___previousException():Null { + return (cast this).__previousException; + } + + @:noCompletion + inline function set___previousException(value:Null):Null { + setProperty('__previousException', value); + return value; + } +} + +@:dox(hide) +@:noCompletion +@:native('Error') +private extern class NativeException { + // private var message:String; //redefined in haxe.Exception + // private var stack(default, null):String; //redefined in haxe.Exception + + function new(?message:String); +} diff --git a/build/linux64_569e52e/std/js/_std/haxe/Json.hx b/build/linux64_569e52e/std/js/_std/haxe/Json.hx new file mode 100644 index 0000000..6e04714 --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/haxe/Json.hx @@ -0,0 +1,46 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe; + +@:coreApi +#if !haxeJSON +@:native("JSON") +extern +#end +class Json { + #if haxeJSON + inline + #end + public static function parse(text:String):Dynamic + #if !haxeJSON; #else { + return haxe.format.JsonParser.parse(text); + } #end + + #if haxeJSON + inline + #end + public static function stringify(value:Dynamic, ?replacer:(key:Dynamic, value:Dynamic) -> Dynamic, ?space:String):String + #if !haxeJSON; #else { + return haxe.format.JsonPrinter.print(value, replacer, space); + } #end +} diff --git a/build/linux64_569e52e/std/js/_std/haxe/NativeStackTrace.hx b/build/linux64_569e52e/std/js/_std/haxe/NativeStackTrace.hx new file mode 100644 index 0000000..05221f9 --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/haxe/NativeStackTrace.hx @@ -0,0 +1,150 @@ +package haxe; + +import js.Syntax; +import js.lib.Error; +import haxe.CallStack.StackItem; + +// https://v8.dev/docs/stack-trace-api +@:native("Error") +private extern class V8Error { + static var prepareStackTrace:(error:Error, structuredStackTrace:Array)->Any; +} + +typedef V8CallSite = { + function getFunctionName():String; + function getFileName():String; + function getLineNumber():Int; + function getColumnNumber():Int; +} + +/** + Do not use manually. +**/ +@:dox(hide) +@:noCompletion +@:allow(haxe.Exception) +class NativeStackTrace { + static var lastError:Error; + + // support for source-map-support module + @:noCompletion + public static var wrapCallSite:V8CallSite->V8CallSite; + + @:ifFeature('haxe.NativeStackTrace.exceptionStack') + static public inline function saveStack(e:Error):Void { + lastError = e; + } + + static public function callStack():Any { + var e:Null = new Error(''); + var stack = tryHaxeStack(e); + //Internet Explorer provides call stack only if error was thrown + if(Syntax.typeof(stack) == "undefined") { + try throw e catch(e:Exception) {} + stack = e.stack; + } + return normalize(stack, 2); + } + + static public function exceptionStack():Any { + return normalize(tryHaxeStack(lastError)); + } + + static public function toHaxe(s:Null, skip:Int = 0):Array { + if (s == null) { + return []; + } else if (Syntax.typeof(s) == "string") { + // Return the raw lines in browsers that don't support prepareStackTrace + var stack:Array = (s:String).split("\n"); + if (stack[0] == "Error") + stack.shift(); + var m = []; + for (i in 0...stack.length) { + if(skip > i) continue; + var line = stack[i]; + var matched:Null> = Syntax.code("{0}.match(/^ at ([$A-Za-z0-9_. ]+) \\(([^)]+):([0-9]+):([0-9]+)\\)$/)", line); + if (matched != null) { + var path = matched[1].split("."); + if(path[0] == "$hxClasses") { + path.shift(); + } + var meth = path.pop(); + var file = matched[2]; + var line = Std.parseInt(matched[3]); + var column = Std.parseInt(matched[4]); + m.push(FilePos(meth == "Anonymous function" ? LocalFunction() : meth == "Global code" ? null : Method(path.join("."), meth), file, line, + column)); + } else { + m.push(Module(StringTools.trim(line))); // A little weird, but better than nothing + } + } + return m; + } else if(skip > 0 && Syntax.code('Array.isArray({0})', s)) { + return (s:Array).slice(skip); + } else { + return cast s; + } + } + + static function tryHaxeStack(e:Null):Any { + if (e == null) { + return []; + } + // https://v8.dev/docs/stack-trace-api + var oldValue = V8Error.prepareStackTrace; + V8Error.prepareStackTrace = prepareHxStackTrace; + var stack = e.stack; + V8Error.prepareStackTrace = oldValue; + return stack; + } + + static function prepareHxStackTrace(e:Error, callsites:Array):Any { + var stack = []; + for (site in callsites) { + if (wrapCallSite != null) + site = wrapCallSite(site); + var method = null; + var fullName = site.getFunctionName(); + if (fullName != null) { + var idx = fullName.lastIndexOf("."); + if (idx >= 0) { + var className = fullName.substring(0, idx); + var methodName = fullName.substring(idx + 1); + method = Method(className, methodName); + } else { + method = Method(null, fullName); + } + } + var fileName = site.getFileName(); + var fileAddr = fileName == null ? -1 : fileName.indexOf("file:"); + if (wrapCallSite != null && fileAddr > 0) + fileName = fileName.substring(fileAddr + 6); + stack.push(FilePos(method, fileName, site.getLineNumber(), site.getColumnNumber())); + } + return stack; + } + + static function normalize(stack:Any, skipItems:Int = 0):Any { + if(Syntax.code('Array.isArray({0})', stack) && skipItems > 0) { + return (stack:Array).slice(skipItems); + } else if(Syntax.typeof(stack) == "string") { + switch (stack:String).substring(0, 6) { + case 'Error:' | 'Error\n': skipItems += 1; + case _: + } + return skipLines(stack, skipItems); + } else { + //nothing we can do + return stack; + } + } + + static function skipLines(stack:String, skip:Int, pos:Int = 0):String { + return if(skip > 0) { + pos = stack.indexOf('\n', pos); + return pos < 0 ? '' : skipLines(stack, --skip, pos + 1); + } else { + return stack.substring(pos); + } + } +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/_std/haxe/atomic/AtomicInt.hx b/build/linux64_569e52e/std/js/_std/haxe/atomic/AtomicInt.hx new file mode 100644 index 0000000..a86b284 --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/haxe/atomic/AtomicInt.hx @@ -0,0 +1,50 @@ +package haxe.atomic; + +import js.lib.Atomics; + +abstract AtomicInt(js.lib.Int32Array) { + public inline function new(value:Int) { + this = new js.lib.Int32Array(new js.lib.SharedArrayBuffer(js.lib.Int32Array.BYTES_PER_ELEMENT)); + this[0] = value; + } + + private function asArray():js.lib.Int32Array { + return this; + } + + public inline function add(b:Int):Int { + return Atomics.add(asArray(), 0, b); + } + + public inline function sub(b:Int):Int { + return Atomics.sub(asArray(), 0, b); + } + + public inline function and(b:Int):Int { + return Atomics.and(asArray(), 0, b); + } + + public inline function or(b:Int):Int { + return Atomics.or(asArray(), 0, b); + } + + public inline function xor(b:Int):Int { + return Atomics.xor(asArray(), 0, b); + } + + public inline function compareExchange(expected:Int, replacement:Int):Int { + return Atomics.compareExchange(asArray(), 0, expected, replacement); + } + + public inline function exchange(value:Int):Int { + return Atomics.exchange(asArray(), 0, value); + } + + public inline function load():Int { + return Atomics.load(asArray(), 0); + } + + public inline function store(value:Int):Int { + return Atomics.store(asArray(), 0, value); + } +} diff --git a/build/linux64_569e52e/std/js/_std/haxe/ds/IntMap.hx b/build/linux64_569e52e/std/js/_std/haxe/ds/IntMap.hx new file mode 100644 index 0000000..64ddded --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/haxe/ds/IntMap.hx @@ -0,0 +1,100 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +@:coreApi class IntMap implements haxe.Constraints.IMap { + private var h:Dynamic; + + public inline function new():Void { + h = {}; + } + + public inline function set(key:Int, value:T):Void { + h[key] = value; + } + + public inline function get(key:Int):Null { + return h[key]; + } + + public inline function exists(key:Int):Bool { + return (cast h).hasOwnProperty(key); + } + + public function remove(key:Int):Bool { + if (!(cast h).hasOwnProperty(key)) + return false; + js.Syntax.delete(h, key); + return true; + } + + public function keys():Iterator { + var a = []; + js.Syntax.code("for( var key in {0} ) if({0}.hasOwnProperty(key)) {1}.push(+key)", h, a); + return a.iterator(); + } + + public function iterator():Iterator { + return untyped { + ref: h, + it: keys(), + hasNext: function() { + return __this__.it.hasNext(); + }, + next: function() { + var i = __this__.it.next(); + return __this__.ref[i]; + } + }; + } + + @:runtime public inline function keyValueIterator():KeyValueIterator { + return new haxe.iterators.MapKeyValueIterator(this); + } + + public function copy():IntMap { + var copied = new IntMap(); + for (key in keys()) + copied.set(key, get(key)); + return copied; + } + + public function toString():String { + var s = new StringBuf(); + s.add("["); + var it = keys(); + for (i in it) { + s.add(i); + s.add(" => "); + s.add(Std.string(get(i))); + if (it.hasNext()) + s.add(", "); + } + s.add("]"); + return s.toString(); + } + + public inline function clear():Void { + h = {}; + } +} diff --git a/build/linux64_569e52e/std/js/_std/haxe/ds/ObjectMap.hx b/build/linux64_569e52e/std/js/_std/haxe/ds/ObjectMap.hx new file mode 100644 index 0000000..c46b2ce --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/haxe/ds/ObjectMap.hx @@ -0,0 +1,125 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of h software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and h permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +import js.Syntax; +import js.Lib; + +@:coreApi +class ObjectMap implements haxe.Constraints.IMap { + + static inline function assignId(obj:{}):Int { + return Syntax.code('({0}.__id__ = {1})', obj, Lib.getNextHaxeUID()); + } + + static inline function getId(obj:{}):Int { + return untyped obj.__id__; + } + + var h:{__keys__:{}}; + + public function new():Void { + h = {__keys__: {}}; + } + + public function set(key:K, value:V):Void { + var id = getId(key); + if(id == null) { + id = assignId(key); + } + Syntax.code('{0}[{1}] = {2}', h, id, value); + Syntax.code('{0}[{1}] = {2}', h.__keys__, id, key); + } + + public inline function get(key:K):Null { + return untyped h[getId(key)]; + } + + public inline function exists(key:K):Bool { + return untyped h.__keys__[getId(key)] != null; + } + + public function remove(key:K):Bool { + var id = getId(key); + if (untyped h.__keys__[id] == null) + return false; + js.Syntax.delete(h, id); + js.Syntax.delete(h.__keys__, id); + return true; + } + + public function keys():Iterator { + var a = []; + untyped { + js.Syntax.code("for( var key in this.h.__keys__ ) {"); + if (h.hasOwnProperty(key)) + a.push(h.__keys__[key]); + js.Syntax.code("}"); + } + return a.iterator(); + } + + public function iterator():Iterator { + return untyped { + ref: h, + it: keys(), + hasNext: function() { + return __this__.it.hasNext(); + }, + next: function() { + var i = __this__.it.next(); + return __this__.ref[getId(i)]; + } + }; + } + + @:runtime public inline function keyValueIterator():KeyValueIterator { + return new haxe.iterators.MapKeyValueIterator(this); + } + + public function copy():ObjectMap { + var copied = new ObjectMap(); + for (key in keys()) + copied.set(key, get(key)); + return copied; + } + + public function toString():String { + var s = new StringBuf(); + s.add("["); + var it = keys(); + for (i in it) { + s.add(Std.string(i)); + s.add(" => "); + s.add(Std.string(get(i))); + if (it.hasNext()) + s.add(", "); + } + s.add("]"); + return s.toString(); + } + + public inline function clear():Void { + h = {__keys__: {}}; + } +} diff --git a/build/linux64_569e52e/std/js/_std/haxe/ds/StringMap.hx b/build/linux64_569e52e/std/js/_std/haxe/ds/StringMap.hx new file mode 100644 index 0000000..3bb72df --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/haxe/ds/StringMap.hx @@ -0,0 +1,312 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.ds; + +import js.lib.Object; +import haxe.Constraints.IMap; +import haxe.DynamicAccess; + +#if (js_es >= 5) +@:coreApi class StringMap implements IMap { + var h:Dynamic; + + public inline function new() { + h = Object.create(null); + } + + public inline function exists(key:String):Bool { + return Object.prototype.hasOwnProperty.call(h, key); + } + + public inline function get(key:String):Null { + return h[cast key]; + } + + public inline function set(key:String, value:T):Void { + h[cast key] = value; + } + + public inline function remove(key:String):Bool { + return if (exists(key)) { + js.Syntax.delete(h, key); true; + } else { + false; + } + } + + public inline function keys():Iterator { + return new StringMapKeyIterator(h); + } + + public inline function iterator():Iterator { + return new StringMapValueIterator(h); + } + + public inline function keyValueIterator():KeyValueIterator { + return new StringMapKeyValueIterator(h); + } + + public inline function copy():StringMap { + return createCopy(h); + } + + public inline function clear():Void { + h = Object.create(null); + } + + public inline function toString():String { + return stringify(h); + } + + // impl + static function createCopy(h:Dynamic):StringMap { + var copy = new StringMap(); + js.Syntax.code("for (var key in {0}) {1}[key] = {0}[key]", h, copy.h); + return copy; + } + + @:analyzer(no_optimize) + static function stringify(h:Dynamic):String { + var s = "[", first = true; + js.Syntax.code("for (var key in {0}) {", h); + js.Syntax.code("\tif ({0}) {0} = false; else {1} += ',';", first, s); + js.Syntax.code("\t{0} += key + ' => ' + {1}({2}[key]);", s, Std.string, h); + js.Syntax.code("}"); + return s + "]"; + } +} + +private class StringMapKeyIterator { + final h:Dynamic; + final keys:Array; + final length:Int; + var current:Int; + + public inline function new(h:Dynamic) { + this.h = h; + keys = Object.keys(h); + length = keys.length; + current = 0; + } + + public inline function hasNext():Bool { + return current < length; + } + + public inline function next():String { + return keys[current++]; + } +} + +private class StringMapValueIterator { + final h:Dynamic; + final keys:Array; + final length:Int; + var current:Int; + + public inline function new(h:Dynamic) { + this.h = h; + keys = Object.keys(h); + length = keys.length; + current = 0; + } + + public inline function hasNext():Bool { + return current < length; + } + + public inline function next():T { + return h[cast keys[current++]]; + } +} + +private class StringMapKeyValueIterator { + final h:Dynamic; + final keys:Array; + final length:Int; + var current:Int; + + public inline function new(h:Dynamic) { + this.h = h; + keys = Object.keys(h); + length = keys.length; + current = 0; + } + + public inline function hasNext():Bool { + return current < length; + } + + public inline function next():{key:String, value:T} { + var key = keys[current++]; + return {key: key, value: h[cast key]}; + } +} +#else +private class StringMapIterator { + var map:StringMap; + var keys:Array; + var index:Int; + var count:Int; + + public inline function new(map:StringMap, keys:Array) { + this.map = map; + this.keys = keys; + this.index = 0; + this.count = keys.length; + } + + public inline function hasNext() { + return index < count; + } + + public inline function next() { + return map.get(keys[index++]); + } +} + +@:coreApi class StringMap implements haxe.Constraints.IMap { + private var h:Dynamic; + private var rh:Dynamic; + + public inline function new():Void { + h = {}; + } + + inline function isReserved(key:String):Bool { + return js.Syntax.code("__map_reserved[{0}]", key) != null; + } + + public inline function set(key:String, value:T):Void { + if (isReserved(key)) + setReserved(key, value); + else + h[cast key] = value; + } + + public inline function get(key:String):Null { + if (isReserved(key)) + return getReserved(key); + return h[cast key]; + } + + public inline function exists(key:String):Bool { + if (isReserved(key)) + return existsReserved(key); + return h.hasOwnProperty(key); + } + + function setReserved(key:String, value:T):Void { + if (rh == null) + rh = {}; + rh[cast "$" + key] = value; + } + + function getReserved(key:String):Null { + return rh == null ? null : rh[cast "$" + key]; + } + + function existsReserved(key:String):Bool { + if (rh == null) + return false; + return (cast rh).hasOwnProperty("$" + key); + } + + public function remove(key:String):Bool { + if (isReserved(key)) { + key = "$" + key; + if (rh == null || !rh.hasOwnProperty(key)) + return false; + js.Syntax.delete(rh, key); + return true; + } else { + if (!h.hasOwnProperty(key)) + return false; + js.Syntax.delete(h, key); + return true; + } + } + + public function keys():Iterator { + return arrayKeys().iterator(); + } + + function arrayKeys():Array { + var out = []; + untyped { + js.Syntax.code("for( var key in this.h ) {"); + if (h.hasOwnProperty(key)) + out.push(key); + js.Syntax.code("}"); + } + if (rh != null) + untyped { + js.Syntax.code("for( var key in this.rh ) {"); + if (key.charCodeAt(0) == "$".code) + out.push(key.substr(1)); + js.Syntax.code("}"); + } + return out; + } + + public inline function iterator():Iterator { + return new StringMapIterator(this, arrayKeys()); + } + + @:runtime public inline function keyValueIterator():KeyValueIterator { + return new haxe.iterators.MapKeyValueIterator(this); + } + + public function copy():StringMap { + var copied = new StringMap(); + for (key in keys()) + copied.set(key, get(key)); + return copied; + } + + public function toString():String { + var s = new StringBuf(); + s.add("["); + var keys = arrayKeys(); + for (i in 0...keys.length) { + var k = keys[i]; + s.add(k); + s.add(" => "); + s.add(Std.string(get(k))); + if (i < keys.length - 1) + s.add(", "); + } + s.add("]"); + return s.toString(); + } + + public inline function clear():Void { + h = {}; + rh = null; + } + + static function __init__():Void { + js.Syntax.code("var __map_reserved = {};"); + } +} +#end diff --git a/build/linux64_569e52e/std/js/_std/haxe/io/ArrayBufferView.hx b/build/linux64_569e52e/std/js/_std/haxe/io/ArrayBufferView.hx new file mode 100644 index 0000000..bb2464b --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/haxe/io/ArrayBufferView.hx @@ -0,0 +1,57 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +typedef ArrayBufferViewData = js.lib.ArrayBufferView; + +abstract ArrayBufferView(ArrayBufferViewData) { + public var buffer(get, never):haxe.io.Bytes; + public var byteOffset(get, never):Int; + public var byteLength(get, never):Int; + + public inline function new(size:Int) { + this = new js.lib.Uint8Array(size); + } + + inline function get_byteOffset() + return this.byteOffset; + + inline function get_byteLength() + return this.byteLength; + + inline function get_buffer():haxe.io.Bytes { + return haxe.io.Bytes.ofData(this.buffer); + } + + public inline function sub(begin:Int, ?length:Int) { + return fromData(new js.lib.Uint8Array(this.buffer, begin, length == null ? this.buffer.byteLength - begin : length)); + } + + public inline function getData():ArrayBufferViewData { + return this; + } + + public static inline function fromData(a:ArrayBufferViewData):ArrayBufferView { + return cast a; + } +} diff --git a/build/linux64_569e52e/std/js/_std/haxe/io/Bytes.hx b/build/linux64_569e52e/std/js/_std/haxe/io/Bytes.hx new file mode 100644 index 0000000..b15e2af --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/haxe/io/Bytes.hx @@ -0,0 +1,272 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +@:coreApi +class Bytes { + public var length(default, null):Int; + + var b:js.lib.Uint8Array; + var data:js.lib.DataView; + + function new(data:BytesData) { + this.length = data.byteLength; + this.b = new js.lib.Uint8Array(data); + untyped { + b.bufferValue = data; // some impl does not return the same instance in .buffer + data.hxBytes = this; + data.bytes = this.b; + } + } + + public inline function get(pos:Int):Int { + return b[pos]; + } + + public inline function set(pos:Int, v:Int):Void { + b[pos] = v; + } + + public function blit(pos:Int, src:Bytes, srcpos:Int, len:Int):Void { + if (pos < 0 || srcpos < 0 || len < 0 || pos + len > length || srcpos + len > src.length) + throw Error.OutsideBounds; + if (srcpos == 0 && len == src.b.byteLength) + b.set(src.b, pos); + else + b.set(src.b.subarray(srcpos, srcpos + len), pos); + } + + public function fill(pos:Int, len:Int, value:Int):Void { + for (i in 0...len) + set(pos++, value); + } + + public function sub(pos:Int, len:Int):Bytes { + if (pos < 0 || len < 0 || pos + len > length) + throw Error.OutsideBounds; + return new Bytes(b.buffer.slice(pos + b.byteOffset, pos + b.byteOffset + len)); + } + + public function compare(other:Bytes):Int { + var b1 = b; + var b2 = other.b; + var len = (length < other.length) ? length : other.length; + for (i in 0...len) + if (b1[i] != b2[i]) + return b1[i] - b2[i]; + return length - other.length; + } + + inline function initData():Void { + if (data == null) + data = new js.lib.DataView(b.buffer, b.byteOffset, b.byteLength); + } + + public function getDouble(pos:Int):Float { + initData(); + return data.getFloat64(pos, true); + } + + public function getFloat(pos:Int):Float { + initData(); + return data.getFloat32(pos, true); + } + + public function setDouble(pos:Int, v:Float):Void { + initData(); + data.setFloat64(pos, v, true); + } + + public function setFloat(pos:Int, v:Float):Void { + initData(); + data.setFloat32(pos, v, true); + } + + public function getUInt16(pos:Int):Int { + initData(); + return data.getUint16(pos, true); + } + + public function setUInt16(pos:Int, v:Int):Void { + initData(); + data.setUint16(pos, v, true); + } + + public function getInt32(pos:Int):Int { + initData(); + return data.getInt32(pos, true); + } + + public function setInt32(pos:Int, v:Int):Void { + initData(); + data.setInt32(pos, v, true); + } + + public function getInt64(pos:Int):haxe.Int64 { + return Int64.make(getInt32(pos + 4), getInt32(pos)); + } + + public function setInt64(pos:Int, v:haxe.Int64):Void { + setInt32(pos, v.low); + setInt32(pos + 4, v.high); + } + + public function getString(pos:Int, len:Int, ?encoding:Encoding):String { + if (pos < 0 || len < 0 || pos + len > length) + throw Error.OutsideBounds; + if (encoding == null) + encoding = UTF8; + var s = ""; + var b = b; + var i = pos; + var max = pos + len; + switch (encoding) { + case UTF8: + var debug = pos > 0; + // utf8-decode and utf16-encode + while (i < max) { + var c = b[i++]; + if (c < 0x80) { + if (c == 0) + break; + s += String.fromCharCode(c); + } else if (c < 0xE0) + s += String.fromCharCode(((c & 0x3F) << 6) | (b[i++] & 0x7F)); + else if (c < 0xF0) { + var c2 = b[i++]; + s += String.fromCharCode(((c & 0x1F) << 12) | ((c2 & 0x7F) << 6) | (b[i++] & 0x7F)); + } else { + var c2 = b[i++]; + var c3 = b[i++]; + var u = ((c & 0x0F) << 18) | ((c2 & 0x7F) << 12) | ((c3 & 0x7F) << 6) | (b[i++] & 0x7F); + s += String.fromCharCode(u); + } + } + case RawNative: + while (i < max) { + var c = b[i++] | (b[i++] << 8); + s += String.fromCharCode(c); + } + } + return s; + } + + @:deprecated("readString is deprecated, use getString instead") + @:noCompletion + public inline function readString(pos:Int, len:Int):String { + return getString(pos, len); + } + + public function toString():String { + return getString(0, length); + } + + public function toHex():String { + var s = new StringBuf(); + var chars = []; + var str = "0123456789abcdef"; + for (i in 0...str.length) + chars.push(str.charCodeAt(i)); + for (i in 0...length) { + var c = get(i); + s.addChar(chars[c >> 4]); + s.addChar(chars[c & 15]); + } + return s.toString(); + } + + public inline function getData():BytesData { + return untyped b.bufferValue; + } + + public static inline function alloc(length:Int):Bytes { + return new Bytes(new BytesData(length)); + } + + public static function ofString(s:String, ?encoding:Encoding):Bytes { + if (encoding == RawNative) { + var buf = new js.lib.Uint8Array(s.length << 1); + for (i in 0...s.length) { + var c:Int = StringTools.fastCodeAt(s, i); + buf[i << 1] = c & 0xFF; + buf[(i << 1) | 1] = c >> 8; + } + return new Bytes(buf.buffer); + } + var a = new Array(); + // utf16-decode and utf8-encode + var i = 0; + while (i < s.length) { + var c:Int = StringTools.fastCodeAt(s, i++); + // surrogate pair + if (0xD800 <= c && c <= 0xDBFF) + c = (c - 0xD7C0 << 10) | (StringTools.fastCodeAt(s, i++) & 0x3FF); + if (c <= 0x7F) + a.push(c); + else if (c <= 0x7FF) { + a.push(0xC0 | (c >> 6)); + a.push(0x80 | (c & 63)); + } else if (c <= 0xFFFF) { + a.push(0xE0 | (c >> 12)); + a.push(0x80 | ((c >> 6) & 63)); + a.push(0x80 | (c & 63)); + } else { + a.push(0xF0 | (c >> 18)); + a.push(0x80 | ((c >> 12) & 63)); + a.push(0x80 | ((c >> 6) & 63)); + a.push(0x80 | (c & 63)); + } + } + return new Bytes(new js.lib.Uint8Array(a).buffer); + } + + public static function ofData(b:BytesData):Bytes { + var hb = untyped b.hxBytes; + if (hb != null) + return hb; + return new Bytes(b); + } + + public static function ofHex(s:String):Bytes { + if ((s.length & 1) != 0) + throw "Not a hex string (odd number of digits)"; + var a = new Array(); + var i = 0; + var len = s.length >> 1; + while (i < len) { + var high = StringTools.fastCodeAt(s, i * 2); + var low = StringTools.fastCodeAt(s, i * 2 + 1); + high = (high & 0xF) + ((high & 0x40) >> 6) * 9; + low = (low & 0xF) + ((low & 0x40) >> 6) * 9; + a.push(((high << 4) | low) & 0xFF); + i++; + } + + return new Bytes(new js.lib.Uint8Array(a).buffer); + } + + public inline static function fastGet(b:BytesData, pos:Int):Int { + // this requires that we have wrapped it with haxe.io.Bytes beforehand + return untyped b.bytes[pos]; + } +} diff --git a/build/linux64_569e52e/std/js/_std/haxe/io/BytesBuffer.hx b/build/linux64_569e52e/std/js/_std/haxe/io/BytesBuffer.hx new file mode 100644 index 0000000..5945943 --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/haxe/io/BytesBuffer.hx @@ -0,0 +1,127 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +@:coreApi +class BytesBuffer { + var buffer:js.lib.ArrayBuffer; + var view:js.lib.DataView; + var u8:js.lib.Uint8Array; + var pos:Int; + var size:Int; + + public var length(get, never):Int; + + public function new() { + pos = 0; + size = 0; + } + + inline function get_length():Int { + return pos; + } + + public function addByte(byte:Int):Void { + if (pos == size) + grow(1); + view.setUint8(pos++, byte); + } + + public function add(src:Bytes):Void { + if (pos + src.length > size) + grow(src.length); + if (size == 0) + return; + var sub = new js.lib.Uint8Array(@:privateAccess src.b.buffer, @:privateAccess src.b.byteOffset, src.length); + u8.set(sub, pos); + pos += src.length; + } + + public function addString(v:String, ?encoding:Encoding):Void { + add(Bytes.ofString(v, encoding)); + } + + public function addInt32(v:Int):Void { + if (pos + 4 > size) + grow(4); + view.setInt32(pos, v, true); + pos += 4; + } + + public function addInt64(v:haxe.Int64):Void { + if (pos + 8 > size) + grow(8); + view.setInt32(pos, v.low, true); + view.setInt32(pos + 4, v.high, true); + pos += 8; + } + + public function addFloat(v:Float):Void { + if (pos + 4 > size) + grow(4); + view.setFloat32(pos, v, true); + pos += 4; + } + + public function addDouble(v:Float):Void { + if (pos + 8 > size) + grow(8); + view.setFloat64(pos, v, true); + pos += 8; + } + + public function addBytes(src:Bytes, pos:Int, len:Int):Void { + if (pos < 0 || len < 0 || pos + len > src.length) + throw Error.OutsideBounds; + if (this.pos + len > size) + grow(len); + if (size == 0) + return; + var sub = new js.lib.Uint8Array(@:privateAccess src.b.buffer, @:privateAccess src.b.byteOffset + pos, len); + u8.set(sub, this.pos); + this.pos += len; + } + + function grow(delta:Int):Void { + var req = pos + delta; + var nsize = size == 0 ? 16 : size; + while (nsize < req) + nsize = (nsize * 3) >> 1; + var nbuf = new js.lib.ArrayBuffer(nsize); + var nu8 = new js.lib.Uint8Array(nbuf); + if (size > 0) + nu8.set(u8); + size = nsize; + buffer = nbuf; + u8 = nu8; + view = new js.lib.DataView(buffer); + } + + public function getBytes():Bytes@:privateAccess { + if (size == 0) + return haxe.io.Bytes.alloc(0); + var b = new Bytes(buffer); + b.length = pos; + return b; + } +} diff --git a/build/linux64_569e52e/std/js/_std/haxe/io/Float32Array.hx b/build/linux64_569e52e/std/js/_std/haxe/io/Float32Array.hx new file mode 100644 index 0000000..96ff040 --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/haxe/io/Float32Array.hx @@ -0,0 +1,88 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +typedef Float32ArrayData = js.lib.Float32Array; + +@:coreApi +abstract Float32Array(Float32ArrayData) { + public static inline var BYTES_PER_ELEMENT = 4; + + public var length(get, never):Int; + public var view(get, never):ArrayBufferView; + + public inline function new(elements:Int):Void { + this = new Float32ArrayData(elements); + } + + inline function get_length():Int { + return this.length; + } + + public inline function get_view():ArrayBufferView { + return ArrayBufferView.fromData(this); + } + + @:arrayAccess public inline function get(index:Int):Float { + return this[index]; + } + + @:arrayAccess public inline function set(index:Int, value:Float):Float { + return this[index] = value; + } + + public inline function sub(begin:Int, ?length:Int):Float32Array { + return fromData(this.subarray(begin, length == null ? this.length : begin + length)); + } + + public inline function subarray(?begin:Int, ?end:Int):Float32Array { + return fromData(this.subarray(begin, end)); + } + + public inline function getData():Float32ArrayData { + return this; + } + + public inline static function fromData(d:Float32ArrayData):Float32Array { + return cast d; + } + + public static function fromArray(a:Array, pos:Int = 0, ?length:Int):Float32Array { + if (length == null) + length = a.length - pos; + if (pos < 0 || length < 0 || pos + length > a.length) + throw Error.OutsideBounds; + if (pos == 0 && length == a.length) + return fromData(new Float32ArrayData(a)); + var i = new Float32Array(a.length); + for (idx in 0...length) + i[idx] = a[idx + pos]; + return i; + } + + public static function fromBytes(bytes:haxe.io.Bytes, bytePos:Int = 0, ?length:Int):Float32Array { + if (length == null) + length = (bytes.length - bytePos) >> 2; + return fromData(new Float32ArrayData(bytes.getData(), bytePos, length)); + } +} diff --git a/build/linux64_569e52e/std/js/_std/haxe/io/Float64Array.hx b/build/linux64_569e52e/std/js/_std/haxe/io/Float64Array.hx new file mode 100644 index 0000000..a363a43 --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/haxe/io/Float64Array.hx @@ -0,0 +1,88 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +typedef Float64ArrayData = js.lib.Float64Array; + +@:coreApi +abstract Float64Array(Float64ArrayData) { + public static inline var BYTES_PER_ELEMENT = 8; + + public var length(get, never):Int; + public var view(get, never):ArrayBufferView; + + public inline function new(elements:Int):Void { + this = new Float64ArrayData(elements); + } + + inline function get_length():Int { + return this.length; + } + + public inline function get_view():ArrayBufferView { + return ArrayBufferView.fromData(this); + } + + @:arrayAccess public inline function get(index:Int):Float { + return this[index]; + } + + @:arrayAccess public inline function set(index:Int, value:Float):Float { + return this[index] = value; + } + + public inline function sub(begin:Int, ?length:Int):Float64Array { + return fromData(this.subarray(begin, length == null ? this.length : begin + length)); + } + + public inline function subarray(?begin:Int, ?end:Int):Float64Array { + return fromData(this.subarray(begin, end)); + } + + public inline function getData():Float64ArrayData { + return this; + } + + public static inline function fromData(d:Float64ArrayData):Float64Array { + return cast d; + } + + public static function fromArray(a:Array, pos:Int = 0, ?length:Int):Float64Array { + if (length == null) + length = a.length - pos; + if (pos < 0 || length < 0 || pos + length > a.length) + throw Error.OutsideBounds; + if (pos == 0 && length == a.length) + return fromData(new Float64ArrayData(a)); + var i = new Float64Array(a.length); + for (idx in 0...length) + i[idx] = a[idx + pos]; + return i; + } + + public static function fromBytes(bytes:haxe.io.Bytes, bytePos:Int = 0, ?length:Int):Float64Array { + if (length == null) + length = (bytes.length - bytePos) >> 3; + return fromData(new Float64ArrayData(bytes.getData(), bytePos, length)); + } +} diff --git a/build/linux64_569e52e/std/js/_std/haxe/io/Int32Array.hx b/build/linux64_569e52e/std/js/_std/haxe/io/Int32Array.hx new file mode 100644 index 0000000..6a982c8 --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/haxe/io/Int32Array.hx @@ -0,0 +1,88 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +typedef Int32ArrayData = js.lib.Int32Array; + +@:coreApi +abstract Int32Array(Int32ArrayData) { + public static inline var BYTES_PER_ELEMENT = 4; + + public var length(get, never):Int; + public var view(get, never):ArrayBufferView; + + public inline function new(elements:Int) { + this = new Int32ArrayData(elements); + } + + inline function get_length():Int { + return this.length; + } + + public inline function get_view():ArrayBufferView { + return ArrayBufferView.fromData(this); + } + + @:arrayAccess public inline function get(index:Int):Int { + return this[index]; + } + + @:arrayAccess public inline function set(index:Int, value:Int):Int { + return this[index] = value; + } + + public inline function sub(begin:Int, ?length:Int):Int32Array { + return fromData(this.subarray(begin, length == null ? this.length : begin + length)); + } + + public inline function subarray(?begin:Int, ?end:Int):Int32Array { + return fromData(this.subarray(begin, end)); + } + + public inline function getData():Int32ArrayData { + return this; + } + + public static inline function fromData(d:Int32ArrayData):Int32Array { + return cast d; + } + + public static function fromArray(a:Array, pos:Int = 0, ?length:Int):Int32Array { + if (length == null) + length = a.length - pos; + if (pos < 0 || length < 0 || pos + length > a.length) + throw Error.OutsideBounds; + if (pos == 0 && length == a.length) + return fromData(new Int32ArrayData(a)); + var i = new Int32Array(a.length); + for (idx in 0...length) + i[idx] = a[idx + pos]; + return i; + } + + public static function fromBytes(bytes:haxe.io.Bytes, bytePos:Int = 0, ?length:Int):Int32Array { + if (length == null) + length = (bytes.length - bytePos) >> 2; + return fromData(new Int32ArrayData(bytes.getData(), bytePos, length)); + } +} diff --git a/build/linux64_569e52e/std/js/_std/haxe/io/UInt16Array.hx b/build/linux64_569e52e/std/js/_std/haxe/io/UInt16Array.hx new file mode 100644 index 0000000..3d14faf --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/haxe/io/UInt16Array.hx @@ -0,0 +1,88 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +typedef UInt16ArrayData = js.lib.Uint16Array; + +@:coreApi +abstract UInt16Array(UInt16ArrayData) { + public static inline var BYTES_PER_ELEMENT = 2; + + public var length(get, never):Int; + public var view(get, never):ArrayBufferView; + + public inline function new(elements:Int) { + this = new UInt16ArrayData(elements); + } + + inline function get_length():Int { + return this.length; + } + + public inline function get_view():ArrayBufferView { + return ArrayBufferView.fromData(this); + } + + @:arrayAccess public inline function get(index:Int):Int { + return this[index]; + } + + @:arrayAccess public inline function set(index:Int, value:Int):Int { + return this[index] = value; + } + + public inline function sub(begin:Int, ?length:Int):UInt16Array { + return fromData(this.subarray(begin, length == null ? this.length : begin + length)); + } + + public inline function subarray(?begin:Int, ?end:Int):UInt16Array { + return fromData(this.subarray(begin, end)); + } + + public inline function getData():UInt16ArrayData { + return this; + } + + public static inline function fromData(d:UInt16ArrayData):UInt16Array { + return cast d; + } + + public static function fromArray(a:Array, pos:Int = 0, ?length:Int):UInt16Array { + if (length == null) + length = a.length - pos; + if (pos < 0 || length < 0 || pos + length > a.length) + throw Error.OutsideBounds; + if (pos == 0 && length == a.length) + return fromData(new UInt16ArrayData(a)); + var i = new UInt16Array(a.length); + for (idx in 0...length) + i[idx] = a[idx + pos]; + return i; + } + + public static function fromBytes(bytes:haxe.io.Bytes, bytePos:Int = 0, ?length:Int):UInt16Array { + if (length == null) + length = (bytes.length - bytePos) >> 1; + return fromData(new UInt16ArrayData(bytes.getData(), bytePos, length)); + } +} diff --git a/build/linux64_569e52e/std/js/_std/haxe/io/UInt32Array.hx b/build/linux64_569e52e/std/js/_std/haxe/io/UInt32Array.hx new file mode 100644 index 0000000..dde9ef1 --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/haxe/io/UInt32Array.hx @@ -0,0 +1,88 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +typedef UInt32ArrayData = js.lib.Uint32Array; + +@:coreApi +abstract UInt32Array(UInt32ArrayData) { + public static inline var BYTES_PER_ELEMENT = 4; + + public var length(get, never):Int; + public var view(get, never):ArrayBufferView; + + public inline function new(elements:Int) { + this = new UInt32ArrayData(elements); + } + + inline function get_length():Int { + return this.length; + } + + public inline function get_view():ArrayBufferView { + return ArrayBufferView.fromData(this); + } + + @:arrayAccess public inline function get(index:Int):UInt { + return this[index]; + } + + @:arrayAccess public inline function set(index:Int, value:UInt):UInt { + return this[index] = value; + } + + public inline function sub(begin:Int, ?length:Int):UInt32Array { + return fromData(this.subarray(begin, length == null ? this.length : begin + length)); + } + + public inline function subarray(?begin:Int, ?end:Int):UInt32Array { + return fromData(this.subarray(begin, end)); + } + + public inline function getData():UInt32ArrayData { + return this; + } + + public static inline function fromData(d:UInt32ArrayData):UInt32Array { + return cast d; + } + + public static function fromArray(a:Array, pos:Int = 0, ?length:Int):UInt32Array { + if (length == null) + length = a.length - pos; + if (pos < 0 || length < 0 || pos + length > a.length) + throw Error.OutsideBounds; + if (pos == 0 && length == a.length) + return fromData(new UInt32ArrayData(a)); + var i = new UInt32Array(a.length); + for (idx in 0...length) + i[idx] = a[idx + pos]; + return i; + } + + public static function fromBytes(bytes:haxe.io.Bytes, bytePos:Int = 0, ?length:Int):UInt32Array { + if (length == null) + length = (bytes.length - bytePos) >> 2; + return fromData(new UInt32ArrayData(bytes.getData(), bytePos, length)); + } +} diff --git a/build/linux64_569e52e/std/js/_std/haxe/io/UInt8Array.hx b/build/linux64_569e52e/std/js/_std/haxe/io/UInt8Array.hx new file mode 100644 index 0000000..1503ff7 --- /dev/null +++ b/build/linux64_569e52e/std/js/_std/haxe/io/UInt8Array.hx @@ -0,0 +1,88 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package haxe.io; + +typedef UInt8ArrayData = js.lib.Uint8Array; + +@:coreApi +abstract UInt8Array(UInt8ArrayData) { + public static inline var BYTES_PER_ELEMENT = 1; + + public var length(get, never):Int; + public var view(get, never):ArrayBufferView; + + public inline function new(elements:Int) { + this = new UInt8ArrayData(elements); + } + + inline function get_length():Int { + return this.length; + } + + public inline function get_view():ArrayBufferView { + return ArrayBufferView.fromData(this); + } + + @:arrayAccess public inline function get(index:Int):Int { + return this[index]; + } + + @:arrayAccess public inline function set(index:Int, value:Int):Int { + return this[index] = value; + } + + public inline function sub(begin:Int, ?length:Int):UInt8Array { + return fromData(this.subarray(begin, length == null ? this.length : begin + length)); + } + + public inline function subarray(?begin:Int, ?end:Int):UInt8Array { + return fromData(this.subarray(begin, end)); + } + + public inline function getData():UInt8ArrayData { + return this; + } + + public static inline function fromData(d:UInt8ArrayData):UInt8Array { + return cast d; + } + + public static function fromArray(a:Array, pos:Int = 0, ?length:Int):UInt8Array { + if (length == null) + length = a.length - pos; + if (pos < 0 || length < 0 || pos + length > a.length) + throw Error.OutsideBounds; + if (pos == 0 && length == a.length) + return fromData(new UInt8ArrayData(a)); + var i = new UInt8Array(a.length); + for (idx in 0...length) + i[idx] = a[idx + pos]; + return i; + } + + public static function fromBytes(bytes:haxe.io.Bytes, bytePos:Int = 0, ?length:Int):UInt8Array { + if (length == null) + length = bytes.length - bytePos; + return fromData(new UInt8ArrayData(bytes.getData(), bytePos, length)); + } +} diff --git a/build/linux64_569e52e/std/js/html/AbortController.hx b/build/linux64_569e52e/std/js/html/AbortController.hx new file mode 100644 index 0000000..86e60a2 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/AbortController.hx @@ -0,0 +1,49 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\AbortController.webidl. Do not edit! + +package js.html; + +/** + The `AbortController` interface represents a controller object that allows you to abort one or more DOM requests as and when desired. + + Documentation [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/AbortController$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("AbortController") +extern class AbortController { + + /** + Returns a `AbortSignal` object instance, which can be used to communicate with/abort a DOM request. + **/ + var signal(default,null) : AbortSignal; + + /** @throws DOMError */ + function new() : Void; + + /** + Aborts a DOM request before it has completed. This is able to abort fetch requests, consumption of any response `Body`, and streams. + **/ + function abort() : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/AbortSignal.hx b/build/linux64_569e52e/std/js/html/AbortSignal.hx new file mode 100644 index 0000000..d7cadb4 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/AbortSignal.hx @@ -0,0 +1,47 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\AbortSignal.webidl. Do not edit! + +package js.html; + +/** + The `AbortSignal` interface represents a signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an `AbortController` object. + + Documentation [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("AbortSignal") +extern class AbortSignal extends EventTarget { + + /** + A `Boolean` that indicates whether the request(s) the signal is communicating with is/are aborted (`true`) or not (`false`). + **/ + var aborted(default,null) : Bool; + + /** + Invoked when an `abort_(dom_abort_api)` event fires, i.e. when the DOM request(s) the signal is communicating with is/are aborted. + **/ + var onabort : haxe.Constraints.Function; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/AddEventListenerOptions.hx b/build/linux64_569e52e/std/js/html/AddEventListenerOptions.hx new file mode 100644 index 0000000..edabb70 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/AddEventListenerOptions.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\EventTarget.webidl. Do not edit! + +package js.html; + +typedef AddEventListenerOptions = EventListenerOptions & { + var ?once : Bool; + var ?passive : Bool; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/AlignSetting.hx b/build/linux64_569e52e/std/js/html/AlignSetting.hx new file mode 100644 index 0000000..b21c8f4 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/AlignSetting.hx @@ -0,0 +1,33 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\VTTCue.webidl. Do not edit! + +package js.html; + +enum abstract AlignSetting(String) { + var START = "start"; + var CENTER = "center"; + var END = "end"; + var LEFT = "left"; + var RIGHT = "right"; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/AnchorElement.hx b/build/linux64_569e52e/std/js/html/AnchorElement.hx new file mode 100644 index 0000000..4903c41 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/AnchorElement.hx @@ -0,0 +1,116 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLAnchorElement.webidl. Do not edit! + +package js.html; + +/** + The `HTMLAnchorElement` interface represents hyperlink elements and provides special properties and methods (beyond those of the regular `HTMLElement` object interface that they inherit from) for manipulating the layout and presentation of such elements. + + Documentation [HTMLAnchorElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("HTMLAnchorElement") +extern class AnchorElement extends Element { + + /** + Is a `DOMString` that reflects the `target` HTML attribute, indicating where to display the linked resource. + **/ + var target : String; + + /** + Is a `DOMString` indicating that the linked resource is intended to be downloaded rather than displayed in the browser. The value represent the proposed name of the file. If the name is not a valid filename of the underlying OS, browser will adapt it. + **/ + var download : String; + var ping : String; + + /** + Is a `DOMString` that reflects the `rel` HTML attribute, specifying the relationship of the target object to the linked object. + **/ + var rel : String; + + /** + Is a `DOMString` that reflects the `referrerpolicy` HTML attribute indicating which referrer to use. + **/ + var referrerPolicy : String; + + /** + Returns a `DOMTokenList` that reflects the `rel` HTML attribute, as a list of tokens. + **/ + var relList(default,null) : DOMTokenList; + + /** + Is a `DOMString` that reflects the `hreflang` HTML attribute, indicating the language of the linked resource. + **/ + var hreflang : String; + + /** + Is a `DOMString` that reflects the `type` HTML attribute, indicating the MIME type of the linked resource. + **/ + var type : String; + + /** + Is a `DOMString` being a synonym for the `Node.textContent` property. + **/ + var text : String; + + /** + Is a `DOMString` representing a comma-separated list of coordinates. + **/ + var coords : String; + + /** + Is a `DOMString` representing the character encoding of the linked resource. + **/ + var charset : String; + + /** + Is a `DOMString` representing the anchor name. + **/ + var name : String; + + /** + Is a `DOMString` representing that the `rev` HTML attribute, specifying the relationship of the link object to the target object. + Note: Currently the W3C HTML 5.2 spec states that `rev` is no longer obsolete, whereas the WHATWG living standard still has it labeled obsolete. Until this discrepancy is resolved, you should still assume it is obsolete. + + **/ + var rev : String; + + /** + Is a `DOMString` representing the shape of the active area. + **/ + var shape : String; + var href : String; + var origin(default,null) : String; + var protocol : String; + var username : String; + var password : String; + var host : String; + var hostname : String; + var port : String; + var pathname : String; + var search : String; + var hash : String; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/Animation.hx b/build/linux64_569e52e/std/js/html/Animation.hx new file mode 100644 index 0000000..fbaab56 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/Animation.hx @@ -0,0 +1,135 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Animation.webidl. Do not edit! + +package js.html; + +import js.lib.Promise; + +/** + The `Animation` interface of the Web Animations API represents a single animation player and provides playback controls and a timeline for an animation node or source. + + Documentation [Animation](https://developer.mozilla.org/en-US/docs/Web/API/Animation) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/Animation$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("Animation") +extern class Animation extends EventTarget { + + /** + Gets and sets the `String` used to identify the animation. + **/ + var id : String; + + /** + Gets and sets the `AnimationEffectReadOnly` associated with this animation. This will usually be a `KeyframeEffect` object. + **/ + var effect : AnimationEffect; + + /** + Gets or sets the `AnimationTimeline` associated with this animation. + **/ + var timeline : AnimationTimeline; + + /** + Gets or sets the scheduled time when an animation's playback should begin. + **/ + var startTime : Float; + + /** + The current time value of the animation in milliseconds, whether running or paused. If the animation lacks a `AnimationTimeline`, is inactive or hasn't been played yet, its value is `null`. + **/ + var currentTime : Float; + + /** + Gets or sets the playback rate of the animation. + **/ + var playbackRate : Float; + + /** + Returns an enumerated value describing the playback state of an animation. + **/ + var playState(default,null) : AnimationPlayState; + + /** + Indicates whether the animation is currently waiting for an asynchronous operation such as initiating playback or pausing a running animation. + **/ + var pending(default,null) : Bool; + + /** + Returns the current ready Promise for this animation. + **/ + var ready(default,null) : Promise; + + /** + Returns the current finished Promise for this animation. + **/ + var finished(default,null) : Promise; + + /** + Gets and sets the event handler for the `finish` event. + **/ + var onfinish : haxe.Constraints.Function; + + /** + Gets and sets the event handler for the `cancel` event. + **/ + var oncancel : haxe.Constraints.Function; + + /** @throws DOMError */ + function new( ?effect : AnimationEffect, ?timeline : AnimationTimeline ) : Void; + + /** + Clears all `KeyframeEffect` caused by this animation and aborts its playback. + **/ + function cancel() : Void; + + /** + Seeks either end of an animation, depending on whether the animation is playing or reversing. + @throws DOMError + **/ + function finish() : Void; + + /** + Starts or resumes playing of an animation, or begins the animation again if it previously finished. + @throws DOMError + **/ + function play() : Void; + + /** + Suspends playing of an animation. + @throws DOMError + **/ + function pause() : Void; + + /** + Sets the speed of an animation after first synchronizing its playback position. + **/ + function updatePlaybackRate( playbackRate : Float ) : Void; + + /** + Reverses playback direction, stopping at the start of the animation. If the animation is finished or unplayed, it will play from end to beginning. + @throws DOMError + **/ + function reverse() : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/AnimationEffect.hx b/build/linux64_569e52e/std/js/html/AnimationEffect.hx new file mode 100644 index 0000000..fb28106 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/AnimationEffect.hx @@ -0,0 +1,40 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\AnimationEffect.webidl. Do not edit! + +package js.html; + +/** + The `AnimationEffect` interface of the Web Animations API defines current and future animation effects like `KeyframeEffect`, which can be passed to `Animation` objects for playing, and `KeyframeEffectReadOnly` (which is used by CSS Animations and Transitions). + + Documentation [AnimationEffect](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEffect) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEffect$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("AnimationEffect") +extern class AnimationEffect { + function getTiming() : EffectTiming; + function getComputedTiming() : ComputedEffectTiming; + /** @throws DOMError */ + function updateTiming( ?timing : OptionalEffectTiming ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/AnimationEvent.hx b/build/linux64_569e52e/std/js/html/AnimationEvent.hx new file mode 100644 index 0000000..7d3e83f --- /dev/null +++ b/build/linux64_569e52e/std/js/html/AnimationEvent.hx @@ -0,0 +1,54 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\AnimationEvent.webidl. Do not edit! + +package js.html; + +/** + The `AnimationEvent` interface represents events providing information related to animations. + + Documentation [AnimationEvent](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("AnimationEvent") +extern class AnimationEvent extends Event { + + /** + Is a `DOMString` containing the value of the `animation-name` CSS property associated with the transition. + **/ + var animationName(default,null) : String; + + /** + Is a `float` giving the amount of time the animation has been running, in seconds, when this event fired, excluding any time the animation was paused. For an `"animationstart"` event, `elapsedTime` is `0.0` unless there was a negative value for `animation-delay`, in which case the event will be fired with `elapsedTime` containing  `(-1 * `delay`)`. + **/ + var elapsedTime(default,null) : Float; + + /** + Is a `DOMString`, starting with `'::'`, containing the name of the pseudo-element the animation runs on. If the animation doesn't run on a pseudo-element but on the element, an empty string: `''``.` + **/ + var pseudoElement(default,null) : String; + + /** @throws DOMError */ + function new( type : String, ?eventInitDict : AnimationEventInit ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/AnimationEventInit.hx b/build/linux64_569e52e/std/js/html/AnimationEventInit.hx new file mode 100644 index 0000000..107ffe5 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/AnimationEventInit.hx @@ -0,0 +1,31 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\AnimationEvent.webidl. Do not edit! + +package js.html; + +typedef AnimationEventInit = EventInit & { + var ?animationName : String; + var ?elapsedTime : Float; + var ?pseudoElement : String; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/AnimationFilter.hx b/build/linux64_569e52e/std/js/html/AnimationFilter.hx new file mode 100644 index 0000000..471cec2 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/AnimationFilter.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Animatable.webidl. Do not edit! + +package js.html; + +typedef AnimationFilter = { + var ?subtree : Bool; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/AnimationPlayState.hx b/build/linux64_569e52e/std/js/html/AnimationPlayState.hx new file mode 100644 index 0000000..46b995c --- /dev/null +++ b/build/linux64_569e52e/std/js/html/AnimationPlayState.hx @@ -0,0 +1,32 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Animation.webidl. Do not edit! + +package js.html; + +enum abstract AnimationPlayState(String) { + var IDLE = "idle"; + var RUNNING = "running"; + var PAUSED = "paused"; + var FINISHED = "finished"; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/AnimationPlaybackEvent.hx b/build/linux64_569e52e/std/js/html/AnimationPlaybackEvent.hx new file mode 100644 index 0000000..0541c21 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/AnimationPlaybackEvent.hx @@ -0,0 +1,41 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\AnimationPlaybackEvent.webidl. Do not edit! + +package js.html; + +/** + The AnimationPlaybackEvent interface of the Web Animations API represents animation events. + + Documentation [AnimationPlaybackEvent](https://developer.mozilla.org/en-US/docs/Web/API/AnimationPlaybackEvent) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/AnimationPlaybackEvent$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("AnimationPlaybackEvent") +extern class AnimationPlaybackEvent extends Event { + var currentTime(default,null) : Float; + var timelineTime(default,null) : Float; + + /** @throws DOMError */ + function new( type : String, ?eventInitDict : AnimationPlaybackEventInit ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/AnimationPlaybackEventInit.hx b/build/linux64_569e52e/std/js/html/AnimationPlaybackEventInit.hx new file mode 100644 index 0000000..91fd2f1 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/AnimationPlaybackEventInit.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\AnimationPlaybackEvent.webidl. Do not edit! + +package js.html; + +typedef AnimationPlaybackEventInit = EventInit & { + var ?currentTime : Float; + var ?timelineTime : Float; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/AnimationTimeline.hx b/build/linux64_569e52e/std/js/html/AnimationTimeline.hx new file mode 100644 index 0000000..c7b7e63 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/AnimationTimeline.hx @@ -0,0 +1,42 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\AnimationTimeline.webidl. Do not edit! + +package js.html; + +/** + The `AnimationTimeline` interface of the Web Animations API represents the timeline of an animation. This interface exists to define timeline features (inherited by `DocumentTimeline` and future timeline types) and is not itself directly used by developers. Anywhere you see `AnimationTimeline`, you should use `DocumentTimeline` or any other timeline type instead. + + Documentation [AnimationTimeline](https://developer.mozilla.org/en-US/docs/Web/API/AnimationTimeline) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/AnimationTimeline$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("AnimationTimeline") +extern class AnimationTimeline { + + /** + Returns the time value in milliseconds for this timeline or `null` if this timeline is inactive. + **/ + var currentTime(default,null) : Float; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/AreaElement.hx b/build/linux64_569e52e/std/js/html/AreaElement.hx new file mode 100644 index 0000000..569cce4 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/AreaElement.hx @@ -0,0 +1,94 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLAreaElement.webidl. Do not edit! + +package js.html; + +/** + The `HTMLAreaElement` interface provides special properties and methods (beyond those of the regular object `HTMLElement` interface it also has available to it by inheritance) for manipulating the layout and presentation of area elements. + + Documentation [HTMLAreaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("HTMLAreaElement") +extern class AreaElement extends Element { + + /** + Is a `DOMString` that reflects the `alt` HTML attribute, containing alternative text for the element. + **/ + var alt : String; + + /** + Is a `DOMString` that reflects the `coords` HTML attribute, containing coordinates to define the hot-spot region. + **/ + var coords : String; + + /** + Is a `DOMString` that reflects the `shape` HTML attribute, indicating the shape of the hot-spot, limited to known values. + **/ + var shape : String; + + /** + Is a `DOMString` that reflects the `target` HTML attribute, indicating the browsing context in which to open the linked resource. + **/ + var target : String; + + /** + Is a `DOMString` indicating that the linked resource is intended to be downloaded rather than displayed in the browser. The value represent the proposed name of the file. If the name is not a valid filename of the underlying OS, browser will adapt it. + **/ + var download : String; + var ping : String; + + /** + Is a `DOMString` that reflects the `rel` HTML attribute, indicating relationships of the current document to the linked resource. + **/ + var rel : String; + + /** + Is a `DOMString` that reflects the `referrerpolicy` HTML attribute indicating which referrer to use when fetching the linked resource. + **/ + var referrerPolicy : String; + + /** + Returns a `DOMTokenList` that reflects the `rel` HTML attribute, indicating relationships of the current document to the linked resource, as a list of tokens. + **/ + var relList(default,null) : DOMTokenList; + + /** + Is a `Boolean` flag indicating if the area is inactive (`true`) or active (`false`). + **/ + var noHref : Bool; + var href : String; + var origin(default,null) : String; + var protocol : String; + var username : String; + var password : String; + var host : String; + var hostname : String; + var port : String; + var pathname : String; + var search : String; + var hash : String; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/ArrayBuffer.hx b/build/linux64_569e52e/std/js/html/ArrayBuffer.hx new file mode 100644 index 0000000..f526251 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ArrayBuffer.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package js.html; + +@:deprecated typedef ArrayBuffer = js.lib.ArrayBuffer; diff --git a/build/linux64_569e52e/std/js/html/ArrayBufferView.hx b/build/linux64_569e52e/std/js/html/ArrayBufferView.hx new file mode 100644 index 0000000..6f7dfb7 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ArrayBufferView.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package js.html; + +@:deprecated typedef ArrayBufferView = js.lib.ArrayBufferView; diff --git a/build/linux64_569e52e/std/js/html/AssignedNodesOptions.hx b/build/linux64_569e52e/std/js/html/AssignedNodesOptions.hx new file mode 100644 index 0000000..076f637 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/AssignedNodesOptions.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLSlotElement.webidl. Do not edit! + +package js.html; + +typedef AssignedNodesOptions = { + var ?flatten : Bool; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/Attr.hx b/build/linux64_569e52e/std/js/html/Attr.hx new file mode 100644 index 0000000..39c4a91 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/Attr.hx @@ -0,0 +1,82 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Attr.webidl. Do not edit! + +package js.html; + +/** + This type represents a DOM element's attribute as an object. In most DOM methods, you will probably directly retrieve the attribute as a string (e.g., `Element.getAttribute()`, but certain functions (e.g., `Element.getAttributeNode()`) or means of iterating give `Attr` types. + + Documentation [Attr](https://developer.mozilla.org/en-US/docs/Web/API/Attr) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/Attr$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("Attr") +extern class Attr extends Node { + + /** + A `DOMString` representing the local part of the qualified name of the attribute. + **/ + var localName(default,null) : String; + + /** + The attribute's value. + **/ + var value : String; + + /** + The attribute's name. + **/ + var name(default,null) : String; + + /** + A `DOMString` representing the namespace URI of the attribute, or `null` if there is no namespace. + **/ + var namespaceURI(default,null) : String; + + /** + A `DOMString` representing the namespace prefix of the attribute, or `null` if no prefix is specified. + **/ + var prefix(default,null) : String; + + /** + This property always returns `true`. Originally, it returned `true `if the attribute was explicitly specified in the source code or by a script, and `false` if its value came from the default one defined in the document's DTD. + **/ + var specified(default,null) : Bool; + + /** + + The element holding the attribute. + + + Note: DOM Level 4 removed this property. The assumption was that since you get an `Attr` object from an `Element`, you should already know the associated element. + + As that doesn't hold true in cases like `Attr` objects being returned by `Document.evaluate`, the DOM Living Standard reintroduced the property. + + Gecko outputs a deprecation note starting from Gecko 7.0 `7.0`. This note was removed again in Gecko 49.0 `49.0`. + + + **/ + var ownerElement(default,null) : Element; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/Audio.hx b/build/linux64_569e52e/std/js/html/Audio.hx new file mode 100644 index 0000000..5c065fd --- /dev/null +++ b/build/linux64_569e52e/std/js/html/Audio.hx @@ -0,0 +1,31 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from namedConstructors.webidl. Do not edit! + +package js.html; + +@:native("Audio") +extern class Audio extends AudioElement { + /** @throws DOMError */ + function new( ?src : String ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/AudioElement.hx b/build/linux64_569e52e/std/js/html/AudioElement.hx new file mode 100644 index 0000000..0c684ff --- /dev/null +++ b/build/linux64_569e52e/std/js/html/AudioElement.hx @@ -0,0 +1,36 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLAudioElement.webidl. Do not edit! + +package js.html; + +/** + The `HTMLAudioElement` interface provides access to the properties of `audio` elements, as well as methods to manipulate them. It derives from the `HTMLMediaElement` interface. + + Documentation [HTMLAudioElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAudioElement) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAudioElement$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("HTMLAudioElement") +extern class AudioElement extends MediaElement { +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/AudioStreamTrack.hx b/build/linux64_569e52e/std/js/html/AudioStreamTrack.hx new file mode 100644 index 0000000..cbd5348 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/AudioStreamTrack.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\AudioStreamTrack.webidl. Do not edit! + +package js.html; + +@:native("AudioStreamTrack") +extern class AudioStreamTrack extends MediaStreamTrack { +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/AudioTrack.hx b/build/linux64_569e52e/std/js/html/AudioTrack.hx new file mode 100644 index 0000000..13dfd60 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/AudioTrack.hx @@ -0,0 +1,62 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\AudioTrack.webidl. Do not edit! + +package js.html; + +/** + The `AudioTrack` interface represents a single audio track from one of the HTML media elements, `audio` or `video`. + + Documentation [AudioTrack](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrack) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrack$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("AudioTrack") +extern class AudioTrack { + + /** + A `DOMString` which uniquely identifies the track within the media. This ID can be used to locate a specific track within an audio track list by calling `AudioTrackList.getTrackById()`. The ID can also be used as the fragment part of the URL if the media supports seeking by media fragment per the Media Fragments URI specification. + **/ + var id(default,null) : String; + + /** + A `DOMString` specifying the category into which the track falls. For example, the main audio track would have a `kind` of `"main"`. + **/ + var kind(default,null) : String; + + /** + A `DOMString` providing a human-readable label for the track. For example, an audio commentary track for a movie might have a `label` of `"Commentary with director John Q. Public and actors John Doe and Jane Eod."` This string is empty if no label is provided. + **/ + var label(default,null) : String; + + /** + A `DOMString` specifying the audio track's primary language, or an empty string if unknown. The language is specified as a BCP 47 ({{RFC(5646)}}) language code, such as `"en-US"` or `"pt-BR"`. + **/ + var language(default,null) : String; + + /** + A Boolean value which controls whether or not the audio track's sound is enabled. Setting this value to `false` mutes the track's audio. + **/ + var enabled : Bool; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/AudioTrackList.hx b/build/linux64_569e52e/std/js/html/AudioTrackList.hx new file mode 100644 index 0000000..b8fc4af --- /dev/null +++ b/build/linux64_569e52e/std/js/html/AudioTrackList.hx @@ -0,0 +1,46 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\AudioTrackList.webidl. Do not edit! + +package js.html; + +/** + The `AudioTrackList` interface is used to represent a list of the audio tracks contained within a given HTML media element, with each track represented by a separate `AudioTrack` object in the list. + + Documentation [AudioTrackList](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrackList) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrackList$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("AudioTrackList") +extern class AudioTrackList extends EventTarget implements ArrayAccess { + + /** + The number of tracks in the list. + **/ + var length(default,null) : Int; + var onchange : haxe.Constraints.Function; + var onaddtrack : haxe.Constraints.Function; + var onremovetrack : haxe.Constraints.Function; + + function getTrackById( id : String ) : AudioTrack; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/AutoKeyword.hx b/build/linux64_569e52e/std/js/html/AutoKeyword.hx new file mode 100644 index 0000000..c9f7135 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/AutoKeyword.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\VTTCue.webidl. Do not edit! + +package js.html; + +enum abstract AutoKeyword(String) { + var AUTO = "auto"; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/BRElement.hx b/build/linux64_569e52e/std/js/html/BRElement.hx new file mode 100644 index 0000000..e987052 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/BRElement.hx @@ -0,0 +1,42 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLBRElement.webidl. Do not edit! + +package js.html; + +/** + The `HTMLBRElement` interface represents a HTML line break element (`br`). It inherits from `HTMLElement`. + + Documentation [HTMLBRElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLBRElement) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/HTMLBRElement$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("HTMLBRElement") +extern class BRElement extends Element { + + /** + Is a `DOMString` indicating the flow of text around floating objects. + **/ + var clear : String; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/BarProp.hx b/build/linux64_569e52e/std/js/html/BarProp.hx new file mode 100644 index 0000000..9ba95a6 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/BarProp.hx @@ -0,0 +1,31 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\BarProp.webidl. Do not edit! + +package js.html; + +@:native("BarProp") +extern class BarProp { + var visible : Bool; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/BaseElement.hx b/build/linux64_569e52e/std/js/html/BaseElement.hx new file mode 100644 index 0000000..bb4118a --- /dev/null +++ b/build/linux64_569e52e/std/js/html/BaseElement.hx @@ -0,0 +1,47 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLBaseElement.webidl. Do not edit! + +package js.html; + +/** + The `HTMLBaseElement` interface contains the base URI for a document. This object inherits all of the properties and methods as described in the `HTMLElement` interface. + + Documentation [HTMLBaseElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLBaseElement) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/HTMLBaseElement$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("HTMLBaseElement") +extern class BaseElement extends Element { + + /** + Is a `DOMString` that reflects the `href` HTML attribute, containing a base URL for relative URLs in the document. + **/ + var href : String; + + /** + Is a `DOMString` that reflects the `target` HTML attribute, containing a default target browsing context or frame for elements that do not have a target reference specified. + **/ + var target : String; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/BatteryManager.hx b/build/linux64_569e52e/std/js/html/BatteryManager.hx new file mode 100644 index 0000000..e554d5d --- /dev/null +++ b/build/linux64_569e52e/std/js/html/BatteryManager.hx @@ -0,0 +1,77 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\BatteryManager.webidl. Do not edit! + +package js.html; + +/** + The `BatteryManager` interface provides ways to get information about the system's battery charge level. + + Documentation [BatteryManager](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("BatteryManager") +extern class BatteryManager extends EventTarget { + + /** + A Boolean value indicating whether or not the battery is currently being charged. + **/ + var charging(default,null) : Bool; + + /** + A number representing the remaining time in seconds until the battery is fully charged, or 0 if the battery is already fully charged. + **/ + var chargingTime(default,null) : Float; + + /** + A number representing the remaining time in seconds until the battery is completely discharged and the system will suspend. + **/ + var dischargingTime(default,null) : Float; + + /** + A number representing the system's battery charge level scaled to a value between 0.0 and 1.0. + **/ + var level(default,null) : Float; + + /** + A handler for the `chargingchange` event; This event is sent when the battery charging state is updated. + **/ + var onchargingchange : haxe.Constraints.Function; + + /** + A handler for the `chargingtimechange` event; This event is sent when the battery charging time is updated + **/ + var onchargingtimechange : haxe.Constraints.Function; + + /** + A handler for the `dischargingtimechange` event; This event is sent when the battery discharging time is updated. + **/ + var ondischargingtimechange : haxe.Constraints.Function; + + /** + A handler for the `levelchange` event; This event is sent when the battery level is updated. + **/ + var onlevelchange : haxe.Constraints.Function; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/BeforeInstallPromptEvent.hx b/build/linux64_569e52e/std/js/html/BeforeInstallPromptEvent.hx new file mode 100644 index 0000000..5e1382a --- /dev/null +++ b/build/linux64_569e52e/std/js/html/BeforeInstallPromptEvent.hx @@ -0,0 +1,34 @@ +package js.html; + +import js.lib.Promise; + +/** + The `BeforeInstallPromptEvent` is fired at the `Window.onbeforeinstallprompt` handler, + before a user is prompted to install a web site to a home screen. + + @see https://developer.mozilla.org/en-US/docs/Web/API/BeforeInstallPromptEvent +**/ +@:native("BeforeInstallPromptEvent") +extern class BeforeInstallPromptEvent extends Event { + + /** The platforms on which this event was dispatched. **/ + final platforms: Array; + + /** The user's choice to the install prompt. **/ + final userChoice: Promise; + + /** Creates a new `BeforeInstallPromptEvent`. **/ + function new(); + + /** Shows the install prompt. **/ + function prompt(): Promise; +} + +typedef BeforeInstallPromptUserChoice = { + final outcome: BeforeInstallPromptUserChoiceOutcome; +} + +enum abstract BeforeInstallPromptUserChoiceOutcome(String) { + var Accepted = "accepted"; + var Dismissed = "dismissed"; +} diff --git a/build/linux64_569e52e/std/js/html/BeforeUnloadEvent.hx b/build/linux64_569e52e/std/js/html/BeforeUnloadEvent.hx new file mode 100644 index 0000000..463dc36 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/BeforeUnloadEvent.hx @@ -0,0 +1,36 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\BeforeUnloadEvent.webidl. Do not edit! + +package js.html; + +/** + The `beforeunload` event is fired when the window, the document and its resources are about to be unloaded. + + Documentation [BeforeUnloadEvent](https://developer.mozilla.org/en-US/docs/Web/API/BeforeUnloadEvent) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/BeforeUnloadEvent$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("BeforeUnloadEvent") +extern class BeforeUnloadEvent extends Event { +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/BinaryType.hx b/build/linux64_569e52e/std/js/html/BinaryType.hx new file mode 100644 index 0000000..fac33af --- /dev/null +++ b/build/linux64_569e52e/std/js/html/BinaryType.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\WebSocket.webidl. Do not edit! + +package js.html; + +enum abstract BinaryType(String) { + var BLOB = "blob"; + var ARRAYBUFFER = "arraybuffer"; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/Blob.hx b/build/linux64_569e52e/std/js/html/Blob.hx new file mode 100644 index 0000000..4d75860 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/Blob.hx @@ -0,0 +1,56 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Blob.webidl. Do not edit! + +package js.html; + +/** + A `Blob` object represents a file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The `File` interface is based on `Blob`, inheriting blob functionality and expanding it to support files on the user's system. + + Documentation [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/Blob$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("Blob") +extern class Blob +{ + + /** + The size, in bytes, of the data contained in the `Blob` object. + **/ + var size(default,null) : Int; + + /** + A string indicating the MIME type of the data contained in the `Blob`. If the type is unknown, this string is empty. + **/ + var type(default,null) : String; + + /** @throws DOMError */ + function new( ?blobParts : Array>>>, ?options : BlobPropertyBag ) : Void; + + /** + Returns a new `Blob` object containing the data in the specified range of bytes of the source `Blob`. + @throws DOMError + **/ + function slice( ?start : Int, ?end : Int, ?contentType : String ) : Blob; +} diff --git a/build/linux64_569e52e/std/js/html/BlobEvent.hx b/build/linux64_569e52e/std/js/html/BlobEvent.hx new file mode 100644 index 0000000..ae0ec58 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/BlobEvent.hx @@ -0,0 +1,44 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\BlobEvent.webidl. Do not edit! + +package js.html; + +/** + The `BlobEvent` interface represents events associated with a `Blob`. These blobs are typically, but not necessarily,  associated with media content. + + Documentation [BlobEvent](https://developer.mozilla.org/en-US/docs/Web/API/BlobEvent) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/BlobEvent$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("BlobEvent") +extern class BlobEvent extends Event { + + /** + A `Blob` representing the data associated with the event. The event was fired on the `EventTarget` because of something happening on that specific `Blob`. + **/ + var data(default,null) : Blob; + + /** @throws DOMError */ + function new( type : String, ?eventInitDict : BlobEventInit ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/BlobEventInit.hx b/build/linux64_569e52e/std/js/html/BlobEventInit.hx new file mode 100644 index 0000000..fea08ce --- /dev/null +++ b/build/linux64_569e52e/std/js/html/BlobEventInit.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\BlobEvent.webidl. Do not edit! + +package js.html; + +typedef BlobEventInit = EventInit & { + var ?data : Blob; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/BlobPropertyBag.hx b/build/linux64_569e52e/std/js/html/BlobPropertyBag.hx new file mode 100644 index 0000000..f9083df --- /dev/null +++ b/build/linux64_569e52e/std/js/html/BlobPropertyBag.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Blob.webidl. Do not edit! + +package js.html; + +typedef BlobPropertyBag = { + var ?endings : EndingTypes; + var ?type : String; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/BodyElement.hx b/build/linux64_569e52e/std/js/html/BodyElement.hx new file mode 100644 index 0000000..6d01e70 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/BodyElement.hx @@ -0,0 +1,81 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLBodyElement.webidl. Do not edit! + +package js.html; + +/** + The `HTMLBodyElement` interface provides special properties (beyond those of the regular `HTMLElement` interface they also inherit) for manipulating body elements. + + Documentation [HTMLBodyElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("HTMLBodyElement") +extern class BodyElement extends Element { + + /** + Is a `DOMString` that represents the foreground color of text. + **/ + var text : String; + + /** + Is a `DOMString` that represents the color of unvisited links. + **/ + var link : String; + + /** + Is a `DOMString` that represents the color of visited links. + **/ + var vLink : String; + + /** + Is a `DOMString` that represents the color of active hyperlinks. + **/ + var aLink : String; + + /** + Is a `DOMString` that represents the background color for the document. + **/ + var bgColor : String; + + /** + Is a `DOMString` that represents the description of the location of the background image resource. Note that this is not an URI, though some older version of some browsers do expect it. + **/ + var background : String; + var onafterprint : haxe.Constraints.Function; + var onbeforeprint : haxe.Constraints.Function; + var onbeforeunload : Event -> Null; + var onhashchange : haxe.Constraints.Function; + var onlanguagechange : haxe.Constraints.Function; + var onmessage : haxe.Constraints.Function; + var onmessageerror : haxe.Constraints.Function; + var onoffline : haxe.Constraints.Function; + var ononline : haxe.Constraints.Function; + var onpagehide : haxe.Constraints.Function; + var onpageshow : haxe.Constraints.Function; + var onpopstate : haxe.Constraints.Function; + var onstorage : haxe.Constraints.Function; + var onunload : haxe.Constraints.Function; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/BroadcastChannel.hx b/build/linux64_569e52e/std/js/html/BroadcastChannel.hx new file mode 100644 index 0000000..fedc0ed --- /dev/null +++ b/build/linux64_569e52e/std/js/html/BroadcastChannel.hx @@ -0,0 +1,65 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\BroadcastChannel.webidl. Do not edit! + +package js.html; + +/** + The `BroadcastChannel` interface represents a named channel that any browsing context of a given origin can subscribe to. It allows communication between different documents (in different windows, tabs, frames or iframes) of the same origin. Messages are broadcasted via a `message` event fired at all `BroadcastChannel` objects listening to the channel. + + Documentation [BroadcastChannel](https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("BroadcastChannel") +extern class BroadcastChannel extends EventTarget { + + /** + Returns a `DOMString`, the name of the channel. + **/ + var name(default,null) : String; + + /** + An `EventHandler` property that specifies the function to execute when a `message` event is fired on this object. + **/ + var onmessage : haxe.Constraints.Function; + + /** + An `EventHandler` called when a `MessageEvent` of type `MessageError` is fired—that is, when it receives a message that cannot be deserialized. + **/ + var onmessageerror : haxe.Constraints.Function; + + /** @throws DOMError */ + function new( channel : String ) : Void; + + /** + Sends the message, of any type of object, to each `BroadcastChannel` object listening to the same channel. + @throws DOMError + **/ + function postMessage( message : Dynamic ) : Void; + + /** + Closes the channel object, indicating it won't get any new messages, and allowing it to be, eventually, garbage collected. + **/ + function close() : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/ButtonElement.hx b/build/linux64_569e52e/std/js/html/ButtonElement.hx new file mode 100644 index 0000000..85859da --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ButtonElement.hx @@ -0,0 +1,124 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLButtonElement.webidl. Do not edit! + +package js.html; + +/** + The `HTMLButtonElement` interface provides properties and methods (beyond the `button` object interface it also has available to them by inheritance) for manipulating the layout and presentation of button elements. + + Documentation [HTMLButtonElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("HTMLButtonElement") +extern class ButtonElement extends Element { + + /** + Is a `Boolean` indicating whether or not the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. Only one form-associated element in a document can have this attribute specified. + **/ + var autofocus : Bool; + + /** + Is a `Boolean` indicating whether or not the control is disabled, meaning that it does not accept any clicks. + **/ + var disabled : Bool; + + /** + Is a `HTMLFormElement` reflecting the form that this button is associated with. If the button is a descendant of a form element, then this attribute is the ID of that form element. + + If the button is not a descendant of a form element, then the attribute can be the ID of any form element in the same document it is related to, or the `null` value if none matches. + **/ + var form(default,null) : FormElement; + + /** + Is a `DOMString` reflecting the URI of a resource that processes information submitted by the button. If specified, this attribute overrides the `action` attribute of the `form` element that owns this element. + **/ + var formAction : String; + + /** + Is a `DOMString` reflecting the type of content that is used to submit the form to the server. If specified, this attribute overrides the `enctype` attribute of the `form` element that owns this element. + **/ + var formEnctype : String; + + /** + Is a `DOMString` reflecting the HTTP method that the browser uses to submit the form. If specified, this attribute overrides the `method` attribute of the `form` element that owns this element. + **/ + var formMethod : String; + + /** + Is a `Boolean` indicating that the form is not to be validated when it is submitted. If specified, this attribute overrides the `novalidate` attribute of the `form` element that owns this element. + **/ + var formNoValidate : Bool; + + /** + Is a `DOMString` reflecting a name or keyword indicating where to display the response that is received after submitting the form. If specified, this attribute overrides the `target` attribute of the `form` element that owns this element. + **/ + var formTarget : String; + + /** + Is a `DOMString` representing the name of the object when submitted with a form. {{HTMLVersionInline(5)}} If specified, it must not be the empty string. + **/ + var name : String; + + /** + Is a `DOMString` indicating the behavior of the button. This is an enumerated attribute with the following possible values: + + `"submit"`: The button submits the form. This is the default value if the attribute is not specified, {{HTMLVersionInline(5)}} or if it is dynamically changed to an empty or invalid value. + `"reset"`: The button resets the form. + `"button"`: The button does nothing. + `"menu"`: The button displays a menu. (experimental) + + + **/ + var type : String; + + /** + Is a `DOMString` representing the current form control value of the button. + **/ + var value : String; + + /** + Is a `Boolean` indicating whether the button is a candidate for constraint validation. It is `false` if any conditions bar it from constraint validation. + **/ + var willValidate(default,null) : Bool; + + /** + Is a `ValidityState` representing the validity states that this button is in. + **/ + var validity(default,null) : ValidityState; + + /** + Is a `DOMString` representing the localized message that describes the validation constraints that the control does not satisfy (if any). This attribute is the empty string if the control is not a candidate for constraint validation (`willValidate` is `false`), or it satisfies its constraints. + **/ + var validationMessage(default,null) : String; + + /** + Is a `NodeList` that represents a list of `label` elements that are labels for this button. + **/ + var labels(default,null) : NodeList; + + function checkValidity() : Bool; + function reportValidity() : Bool; + function setCustomValidity( error : String ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CDATASection.hx b/build/linux64_569e52e/std/js/html/CDATASection.hx new file mode 100644 index 0000000..30ee463 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CDATASection.hx @@ -0,0 +1,36 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CDATASection.webidl. Do not edit! + +package js.html; + +/** + The `CDATASection` interface represents a CDATA section that can be used within XML to include extended portions of unescaped text. The symbols `` and `&` don’t need escaping as they normally do when inside a CDATA section. + + Documentation [CDATASection](https://developer.mozilla.org/en-US/docs/Web/API/CDATASection) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CDATASection$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CDATASection") +extern class CDATASection extends Text { +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CSS.hx b/build/linux64_569e52e/std/js/html/CSS.hx new file mode 100644 index 0000000..ced1466 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CSS.hx @@ -0,0 +1,48 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CSS.webidl. Do not edit! + +package js.html; + +/** + The `CSS` interface holds useful CSS-related methods. No object with this interface are implemented: it contains only static methods and therefore is a utilitarian interface. + + Documentation [CSS](https://developer.mozilla.org/en-US/docs/Web/API/CSS) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CSS$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CSS") +extern class CSS { + + /** + Returns a `Boolean` indicating if the pair property-value, or the condition, given in parameter is supported. + @throws DOMError + **/ + @:overload( function( property : String, value : String ) : Bool {} ) + static function supports( conditionText : String ) : Bool; + + /** + Can be used to escape a string mostly for use as part of a CSS selector. + **/ + static function escape( ident : String ) : String; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CSSAnimation.hx b/build/linux64_569e52e/std/js/html/CSSAnimation.hx new file mode 100644 index 0000000..7a5e9a6 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CSSAnimation.hx @@ -0,0 +1,31 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CSSAnimation.webidl. Do not edit! + +package js.html; + +@:native("CSSAnimation") +extern class CSSAnimation extends Animation { + var animationName(default,null) : String; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CSSBoxType.hx b/build/linux64_569e52e/std/js/html/CSSBoxType.hx new file mode 100644 index 0000000..9fde554 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CSSBoxType.hx @@ -0,0 +1,32 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\GeometryUtils.webidl. Do not edit! + +package js.html; + +enum abstract CSSBoxType(String) { + var MARGIN = "margin"; + var BORDER = "border"; + var PADDING = "padding"; + var CONTENT = "content"; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CSSConditionRule.hx b/build/linux64_569e52e/std/js/html/CSSConditionRule.hx new file mode 100644 index 0000000..cf7622d --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CSSConditionRule.hx @@ -0,0 +1,42 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CSSConditionRule.webidl. Do not edit! + +package js.html; + +/** + An object implementing the `CSSConditionRule` interface represents a single condition CSS at-rule, which consists of a condition and a statement block. It is a child of `CSSGroupingRule`. + + Documentation [CSSConditionRule](https://developer.mozilla.org/en-US/docs/Web/API/CSSConditionRule) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CSSConditionRule$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CSSConditionRule") +extern class CSSConditionRule extends CSSGroupingRule { + + /** + Represents the text of the condition of the rule. + **/ + var conditionText : String; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CSSCounterStyleRule.hx b/build/linux64_569e52e/std/js/html/CSSCounterStyleRule.hx new file mode 100644 index 0000000..c55e320 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CSSCounterStyleRule.hx @@ -0,0 +1,92 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CSSCounterStyleRule.webidl. Do not edit! + +package js.html; + +/** + The `CSSCounterStyleRule` interface represents an `@counter-style` at-rule. + + Documentation [CSSCounterStyleRule](https://developer.mozilla.org/en-US/docs/Web/API/CSSCounterStyleRule) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CSSCounterStyleRule$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CSSCounterStyleRule") +extern class CSSCounterStyleRule extends CSSRule { + + /** + Is a `DOMString` object that contains the serialization of the `counter-style-name` defined for the associated rule. + **/ + var name : String; + + /** + Is a `DOMString` object that contains the serialization of the `@counter-style/system` descriptor defined for the associated rule. If the descriptor was not specified in the associated rule, the attribute returns an empty string. + **/ + var system : String; + + /** + Is a `DOMString` object that contains the serialization of the `@counter-style/symbols` descriptor defined for the associated rule. If the descriptor was not specified in the associated rule, the attribute returns an empty string. + **/ + var symbols : String; + + /** + Is a `DOMString` object that contains the serialization of the `@counter-style/additive-symbols` descriptor defined for the associated rule. If the descriptor was not specified in the associated rule, the attribute returns an empty string. + **/ + var additiveSymbols : String; + + /** + Is a `DOMString` object that contains the serialization of the `@counter-style/negative` descriptor defined for the associated rule. If the descriptor was not specified in the associated rule, the attribute returns an empty string. + **/ + var negative : String; + + /** + Is a `DOMString` object that contains the serialization of the `@counter-style/prefix` descriptor defined for the associated rule. If the descriptor was not specified in the associated rule, the attribute returns an empty string. + **/ + var prefix : String; + + /** + Is a `DOMString` object that contains the serialization of the `@counter-style/suffix` descriptor defined for the associated rule. If the descriptor was not specified in the associated rule, the attribute returns an empty string. + **/ + var suffix : String; + + /** + Is a `DOMString` object that contains the serialization of the `@counter-style/range` descriptor defined for the associated rule. If the descriptor was not specified in the associated rule, the attribute returns an empty string. + **/ + var range : String; + + /** + Is a `DOMString` object that contains the serialization of the `@counter-style/pad` descriptor defined for the associated rule. If the descriptor was not specified in the associated rule, the attribute returns an empty string. + **/ + var pad : String; + + /** + Is a `DOMString` object that contains the serialization of the `@counter-style/speak-as` descriptor defined for the associated rule. If the descriptor was not specified in the associated rule, the attribute returns an empty string. + **/ + var speakAs : String; + + /** + Is a `DOMString` object that contains the serialization of the `@counter-style/fallback` descriptor defined for the associated rule. If the descriptor was not specified in the associated rule, the attribute returns an empty string. + **/ + var fallback : String; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CSSFontFaceRule.hx b/build/linux64_569e52e/std/js/html/CSSFontFaceRule.hx new file mode 100644 index 0000000..489b888 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CSSFontFaceRule.hx @@ -0,0 +1,31 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CSSFontFaceRule.webidl. Do not edit! + +package js.html; + +@:native("CSSFontFaceRule") +extern class CSSFontFaceRule extends CSSRule { + var style(default,null) : CSSStyleDeclaration; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CSSFontFeatureValuesRule.hx b/build/linux64_569e52e/std/js/html/CSSFontFeatureValuesRule.hx new file mode 100644 index 0000000..967e00b --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CSSFontFeatureValuesRule.hx @@ -0,0 +1,32 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CSSFontFeatureValuesRule.webidl. Do not edit! + +package js.html; + +@:native("CSSFontFeatureValuesRule") +extern class CSSFontFeatureValuesRule extends CSSRule { + var fontFamily : String; + var valueText : String; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CSSGroupingRule.hx b/build/linux64_569e52e/std/js/html/CSSGroupingRule.hx new file mode 100644 index 0000000..f1db4da --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CSSGroupingRule.hx @@ -0,0 +1,42 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CSSGroupingRule.webidl. Do not edit! + +package js.html; + +/** + An object implementing the `CSSGroupingRule` interface represents any CSS at-rule that contains other rules nested within it. + + Documentation [CSSGroupingRule](https://developer.mozilla.org/en-US/docs/Web/API/CSSGroupingRule) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CSSGroupingRule$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CSSGroupingRule") +extern class CSSGroupingRule extends CSSRule { + var cssRules(default,null) : CSSRuleList; + + /** @throws DOMError */ + function insertRule( rule : String, index : Int = 0 ) : Int; + /** @throws DOMError */ + function deleteRule( index : Int ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CSSImportRule.hx b/build/linux64_569e52e/std/js/html/CSSImportRule.hx new file mode 100644 index 0000000..ce003b8 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CSSImportRule.hx @@ -0,0 +1,33 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CSSImportRule.webidl. Do not edit! + +package js.html; + +@:native("CSSImportRule") +extern class CSSImportRule extends CSSRule { + var href(default,null) : String; + var media(default,null) : MediaList; + var styleSheet(default,null) : CSSStyleSheet; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CSSKeyframeRule.hx b/build/linux64_569e52e/std/js/html/CSSKeyframeRule.hx new file mode 100644 index 0000000..fa15736 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CSSKeyframeRule.hx @@ -0,0 +1,39 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CSSKeyframeRule.webidl. Do not edit! + +package js.html; + +/** + The `CSSKeyframeRule` interface describes an object representing a set of style for a given keyframe. It corresponds to the contains of a single keyframe of a `@keyframes` at-rule. It implements the `CSSRule` interface with a type value of `8` (`CSSRule.KEYFRAME_RULE`). + + Documentation [CSSKeyframeRule](https://developer.mozilla.org/en-US/docs/Web/API/CSSKeyframeRule) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CSSKeyframeRule$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CSSKeyframeRule") +extern class CSSKeyframeRule extends CSSRule { + var keyText : String; + var style(default,null) : CSSStyleDeclaration; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CSSKeyframesRule.hx b/build/linux64_569e52e/std/js/html/CSSKeyframesRule.hx new file mode 100644 index 0000000..94b02ac --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CSSKeyframesRule.hx @@ -0,0 +1,62 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CSSKeyframesRule.webidl. Do not edit! + +package js.html; + +/** + The `CSSKeyframesRule` interface describes an object representing a complete set of keyframes for a CSS animation. It corresponds to the contains of a whole `@keyframes` at-rule. It implements the `CSSRule` interface with a type value of `7` (`CSSRule.KEYFRAMES_RULE`). + + Documentation [CSSKeyframesRule](https://developer.mozilla.org/en-US/docs/Web/API/CSSKeyframesRule) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CSSKeyframesRule$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CSSKeyframesRule") +extern class CSSKeyframesRule extends CSSRule { + + /** + Represents the name of the animation, used by the `animation-name` property. + **/ + var name : String; + + /** + Returns a `CSSRuleList` of the CSS rules in the media rule. + **/ + var cssRules(default,null) : CSSRuleList; + + + /** + Inserts a new keyframe rule into the current CSSKeyframesRule. The parameter is a `DOMString` containing a keyframe in the same format as an entry of a `@keyframes` at-rule. If it contains more than one keyframe rule, a `DOMException` with a `SYNTAX_ERR` is thrown. + **/ + function appendRule( rule : String ) : Void; + + /** + Deletes a keyframe rule from the current CSSKeyframesRule. The parameter is the index of the keyframe to be deleted, expressed as a `DOMString` resolving as a number between `0%` and `100%`. + **/ + function deleteRule( select : String ) : Void; + + /** + Returns a keyframe rule corresponding to the given key. The key is a `DOMString` containing an index of the keyframe to be returned, resolving to a percentage between `0%` and `100%`. If no such keyframe exists, `findRule` returns `null`. + **/ + function findRule( select : String ) : CSSKeyframeRule; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CSSMediaRule.hx b/build/linux64_569e52e/std/js/html/CSSMediaRule.hx new file mode 100644 index 0000000..3b43e3a --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CSSMediaRule.hx @@ -0,0 +1,42 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CSSMediaRule.webidl. Do not edit! + +package js.html; + +/** + The `CSSMediaRule` is an interface representing a single CSS `@media` rule. It implements the `CSSConditionRule` interface, and therefore the `CSSGroupingRule` and the `CSSRule` interface with a type value of `4` (`CSSRule.MEDIA_RULE`). + + Documentation [CSSMediaRule](https://developer.mozilla.org/en-US/docs/Web/API/CSSMediaRule) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CSSMediaRule$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CSSMediaRule") +extern class CSSMediaRule extends CSSConditionRule { + + /** + Specifies a `MediaList` representing the intended destination medium for style information. + **/ + var media(default,null) : MediaList; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CSSMozDocumentRule.hx b/build/linux64_569e52e/std/js/html/CSSMozDocumentRule.hx new file mode 100644 index 0000000..8d786d5 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CSSMozDocumentRule.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CSSMozDocumentRule.webidl. Do not edit! + +package js.html; + +@:native("CSSMozDocumentRule") +extern class CSSMozDocumentRule extends CSSConditionRule { +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CSSNamespaceRule.hx b/build/linux64_569e52e/std/js/html/CSSNamespaceRule.hx new file mode 100644 index 0000000..4d8c293 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CSSNamespaceRule.hx @@ -0,0 +1,47 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CSSNamespaceRule.webidl. Do not edit! + +package js.html; + +/** + The `CSSNamespaceRule` interface describes an object representing a single CSS `@namespace` at-rule. It implements the `CSSRule` interface, with a type value of `10` (`CSSRule.NAMESPACE_RULE`). + + Documentation [CSSNamespaceRule](https://developer.mozilla.org/en-US/docs/Web/API/CSSNamespaceRule) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CSSNamespaceRule$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CSSNamespaceRule") +extern class CSSNamespaceRule extends CSSRule { + + /** + Returns a `DOMString` containing the text of the URI of the given namespace. + **/ + var namespaceURI(default,null) : String; + + /** + Returns a `DOMString` with the name of the prefix associated to this namespace. If there is no such prefix, returns  `null`. + **/ + var prefix(default,null) : String; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CSSPageRule.hx b/build/linux64_569e52e/std/js/html/CSSPageRule.hx new file mode 100644 index 0000000..1352d8b --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CSSPageRule.hx @@ -0,0 +1,42 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CSSPageRule.webidl. Do not edit! + +package js.html; + +/** + `CSSPageRule` is an interface representing a single CSS `@page` rule. It implements the `CSSRule` interface with a type value of `6` (`CSSRule.PAGE_RULE`). + + Documentation [CSSPageRule](https://developer.mozilla.org/en-US/docs/Web/API/CSSPageRule) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CSSPageRule$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CSSPageRule") +extern class CSSPageRule extends CSSRule { + + /** + Returns the declaration block associated with the at-rule. + **/ + var style(default,null) : CSSStyleDeclaration; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CSSPseudoElement.hx b/build/linux64_569e52e/std/js/html/CSSPseudoElement.hx new file mode 100644 index 0000000..0ac3c8e --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CSSPseudoElement.hx @@ -0,0 +1,36 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CSSPseudoElement.webidl. Do not edit! + +package js.html; + +@:native("CSSPseudoElement") +extern class CSSPseudoElement { + var type(default,null) : String; + var parentElement(default,null) : Element; + + /** @throws DOMError */ + @:overload( function( keyframes : Dynamic, ?options : KeyframeAnimationOptions) : Animation {} ) + function animate( keyframes : Dynamic, ?options : Float ) : Animation; + function getAnimations( ?filter : AnimationFilter ) : Array; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CSSRule.hx b/build/linux64_569e52e/std/js/html/CSSRule.hx new file mode 100644 index 0000000..acd7e88 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CSSRule.hx @@ -0,0 +1,54 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CSSRule.webidl. Do not edit! + +package js.html; + +/** + The `CSSRule` interface represents a single CSS rule. There are several types of rules, listed in the Type constants section below. + + Documentation [CSSRule](https://developer.mozilla.org/en-US/docs/Web/API/CSSRule) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CSSRule$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CSSRule") +extern class CSSRule { + static inline var STYLE_RULE : Int = 1; + static inline var CHARSET_RULE : Int = 2; + static inline var IMPORT_RULE : Int = 3; + static inline var MEDIA_RULE : Int = 4; + static inline var FONT_FACE_RULE : Int = 5; + static inline var PAGE_RULE : Int = 6; + static inline var NAMESPACE_RULE : Int = 10; + static inline var KEYFRAMES_RULE : Int = 7; + static inline var KEYFRAME_RULE : Int = 8; + static inline var COUNTER_STYLE_RULE : Int = 11; + static inline var SUPPORTS_RULE : Int = 12; + static inline var FONT_FEATURE_VALUES_RULE : Int = 14; + + var type(default,null) : Int; + var cssText : String; + var parentRule(default,null) : CSSRule; + var parentStyleSheet(default,null) : CSSStyleSheet; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CSSRuleList.hx b/build/linux64_569e52e/std/js/html/CSSRuleList.hx new file mode 100644 index 0000000..78a6f47 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CSSRuleList.hx @@ -0,0 +1,39 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CSSRuleList.webidl. Do not edit! + +package js.html; + +/** + A `CSSRuleList` is an (indirect-modify only) array-like object containing an ordered collection of `CSSRule` objects. + + Documentation [CSSRuleList](https://developer.mozilla.org/en-US/docs/Web/API/CSSRuleList) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CSSRuleList$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CSSRuleList") +extern class CSSRuleList implements ArrayAccess { + var length(default,null) : Int; + + function item( index : Int ) : CSSRule; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CSSStyleDeclaration.hx b/build/linux64_569e52e/std/js/html/CSSStyleDeclaration.hx new file mode 100644 index 0000000..22a1cc0 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CSSStyleDeclaration.hx @@ -0,0 +1,963 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CSSStyleDeclaration.webidl. Do not edit! + +package js.html; + +/** + `CSSStyleDeclaration` represents a collection of CSS property-value pairs. It is used in a few APIs: + + Documentation [CSSStyleDeclaration](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleDeclaration) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleDeclaration$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CSSStyleDeclaration") +extern class CSSStyleDeclaration implements ArrayAccess { + var cssText : String; + var length(default,null) : Int; + var parentRule(default,null) : CSSRule; + + /** Shorthand for the "align-content" CSS property. */ + var alignContent :String; + /** Shorthand for the "align-items" CSS property. */ + var alignItems :String; + /** Shorthand for the "align-self" CSS property. */ + var alignSelf :String; + /** Shorthand for the "alignment-adjust" CSS property. */ + var alignmentAdjust :String; + /** Shorthand for the "alignment-baseline" CSS property. */ + var alignmentBaseline :String; + /** Shorthand for the "all" CSS property. */ + var all :String; + /** Shorthand for the "anchor-point" CSS property. */ + var anchorPoint :String; + /** Shorthand for the "animation" CSS property. */ + var animation :String; + /** Shorthand for the "animation-delay" CSS property. */ + var animationDelay :String; + /** Shorthand for the "animation-direction" CSS property. */ + var animationDirection :String; + /** Shorthand for the "animation-duration" CSS property. */ + var animationDuration :String; + /** Shorthand for the "animation-fill-mode" CSS property. */ + var animationFillMode :String; + /** Shorthand for the "animation-iteration-count" CSS property. */ + var animationIterationCount :String; + /** Shorthand for the "animation-name" CSS property. */ + var animationName :String; + /** Shorthand for the "animation-play-state" CSS property. */ + var animationPlayState :String; + /** Shorthand for the "animation-timing-function" CSS property. */ + var animationTimingFunction :String; + /** Shorthand for the "azimuth" CSS property. */ + var azimuth :String; + /** Shorthand for the "backface-visibility" CSS property. */ + var backfaceVisibility :String; + /** Shorthand for the "background" CSS property. */ + var background :String; + /** Shorthand for the "background-attachment" CSS property. */ + var backgroundAttachment :String; + /** Shorthand for the "background-blend-mode" CSS property. */ + var backgroundBlendMode :String; + /** Shorthand for the "background-clip" CSS property. */ + var backgroundClip :String; + /** Shorthand for the "background-color" CSS property. */ + var backgroundColor :String; + /** Shorthand for the "background-image" CSS property. */ + var backgroundImage :String; + /** Shorthand for the "background-origin" CSS property. */ + var backgroundOrigin :String; + /** Shorthand for the "background-position" CSS property. */ + var backgroundPosition :String; + /** Shorthand for the "background-position-x" CSS property. */ + var backgroundPositionX :String; + /** Shorthand for the "background-position-y" CSS property. */ + var backgroundPositionY :String; + /** Shorthand for the "background-repeat" CSS property. */ + var backgroundRepeat :String; + /** Shorthand for the "background-repeat-x" CSS property. */ + var backgroundRepeatX :String; + /** Shorthand for the "background-repeat-y" CSS property. */ + var backgroundRepeatY :String; + /** Shorthand for the "background-size" CSS property. */ + var backgroundSize :String; + /** Shorthand for the "baseline-shift" CSS property. */ + var baselineShift :String; + /** Shorthand for the "binding" CSS property. */ + var binding :String; + /** Shorthand for the "bleed" CSS property. */ + var bleed :String; + /** Shorthand for the "block-size" CSS property. */ + var blockSize :String; + /** Shorthand for the "bookmark-label" CSS property. */ + var bookmarkLabel :String; + /** Shorthand for the "bookmark-level" CSS property. */ + var bookmarkLevel :String; + /** Shorthand for the "bookmark-state" CSS property. */ + var bookmarkState :String; + /** Shorthand for the "border" CSS property. */ + var border :String; + /** Shorthand for the "border-block-end" CSS property. */ + var borderBlockEnd :String; + /** Shorthand for the "border-block-end-color" CSS property. */ + var borderBlockEndColor :String; + /** Shorthand for the "border-block-end-style" CSS property. */ + var borderBlockEndStyle :String; + /** Shorthand for the "border-block-end-width" CSS property. */ + var borderBlockEndWidth :String; + /** Shorthand for the "border-block-start" CSS property. */ + var borderBlockStart :String; + /** Shorthand for the "border-block-start-color" CSS property. */ + var borderBlockStartColor :String; + /** Shorthand for the "border-block-start-style" CSS property. */ + var borderBlockStartStyle :String; + /** Shorthand for the "border-block-start-width" CSS property. */ + var borderBlockStartWidth :String; + /** Shorthand for the "border-bottom" CSS property. */ + var borderBottom :String; + /** Shorthand for the "border-bottom-color" CSS property. */ + var borderBottomColor :String; + /** Shorthand for the "border-bottom-left-radius" CSS property. */ + var borderBottomLeftRadius :String; + /** Shorthand for the "border-bottom-right-radius" CSS property. */ + var borderBottomRightRadius :String; + /** Shorthand for the "border-bottom-style" CSS property. */ + var borderBottomStyle :String; + /** Shorthand for the "border-bottom-width" CSS property. */ + var borderBottomWidth :String; + /** Shorthand for the "border-collapse" CSS property. */ + var borderCollapse :String; + /** Shorthand for the "border-color" CSS property. */ + var borderColor :String; + /** Shorthand for the "border-image" CSS property. */ + var borderImage :String; + /** Shorthand for the "border-image-outset" CSS property. */ + var borderImageOutset :String; + /** Shorthand for the "border-image-repeat" CSS property. */ + var borderImageRepeat :String; + /** Shorthand for the "border-image-slice" CSS property. */ + var borderImageSlice :String; + /** Shorthand for the "border-image-source" CSS property. */ + var borderImageSource :String; + /** Shorthand for the "border-image-width" CSS property. */ + var borderImageWidth :String; + /** Shorthand for the "border-inline-end" CSS property. */ + var borderInlineEnd :String; + /** Shorthand for the "border-inline-end-color" CSS property. */ + var borderInlineEndColor :String; + /** Shorthand for the "border-inline-end-style" CSS property. */ + var borderInlineEndStyle :String; + /** Shorthand for the "border-inline-end-width" CSS property. */ + var borderInlineEndWidth :String; + /** Shorthand for the "border-inline-start" CSS property. */ + var borderInlineStart :String; + /** Shorthand for the "border-inline-start-color" CSS property. */ + var borderInlineStartColor :String; + /** Shorthand for the "border-inline-start-style" CSS property. */ + var borderInlineStartStyle :String; + /** Shorthand for the "border-inline-start-width" CSS property. */ + var borderInlineStartWidth :String; + /** Shorthand for the "border-left" CSS property. */ + var borderLeft :String; + /** Shorthand for the "border-left-color" CSS property. */ + var borderLeftColor :String; + /** Shorthand for the "border-left-style" CSS property. */ + var borderLeftStyle :String; + /** Shorthand for the "border-left-width" CSS property. */ + var borderLeftWidth :String; + /** Shorthand for the "border-radius" CSS property. */ + var borderRadius :String; + /** Shorthand for the "border-right" CSS property. */ + var borderRight :String; + /** Shorthand for the "border-right-color" CSS property. */ + var borderRightColor :String; + /** Shorthand for the "border-right-style" CSS property. */ + var borderRightStyle :String; + /** Shorthand for the "border-right-width" CSS property. */ + var borderRightWidth :String; + /** Shorthand for the "border-spacing" CSS property. */ + var borderSpacing :String; + /** Shorthand for the "border-style" CSS property. */ + var borderStyle :String; + /** Shorthand for the "border-top" CSS property. */ + var borderTop :String; + /** Shorthand for the "border-top-color" CSS property. */ + var borderTopColor :String; + /** Shorthand for the "border-top-left-radius" CSS property. */ + var borderTopLeftRadius :String; + /** Shorthand for the "border-top-right-radius" CSS property. */ + var borderTopRightRadius :String; + /** Shorthand for the "border-top-style" CSS property. */ + var borderTopStyle :String; + /** Shorthand for the "border-top-width" CSS property. */ + var borderTopWidth :String; + /** Shorthand for the "border-width" CSS property. */ + var borderWidth :String; + /** Shorthand for the "bottom" CSS property. */ + var bottom :String; + /** Shorthand for the "box-decoration-break" CSS property. */ + var boxDecorationBreak :String; + /** Shorthand for the "box-shadow" CSS property. */ + var boxShadow :String; + /** Shorthand for the "box-sizing" CSS property. */ + var boxSizing :String; + /** Shorthand for the "box-snap" CSS property. */ + var boxSnap :String; + /** Shorthand for the "box-suppress" CSS property. */ + var boxSuppress :String; + /** Shorthand for the "break-after" CSS property. */ + var breakAfter :String; + /** Shorthand for the "break-before" CSS property. */ + var breakBefore :String; + /** Shorthand for the "break-inside" CSS property. */ + var breakInside :String; + /** Shorthand for the "buffered-rendering" CSS property. */ + var bufferedRendering :String; + /** Shorthand for the "caption-side" CSS property. */ + var captionSide :String; + /** Shorthand for the "caret-color" CSS property. */ + var caretColor :String; + /** Shorthand for the "chains" CSS property. */ + var chains :String; + /** Shorthand for the "clear" CSS property. */ + var clear :String; + /** Shorthand for the "clip" CSS property. */ + var clip :String; + /** Shorthand for the "clip-path" CSS property. */ + var clipPath :String; + /** Shorthand for the "clip-rule" CSS property. */ + var clipRule :String; + /** Shorthand for the "color" CSS property. */ + var color :String; + /** Shorthand for the "color-adjust" CSS property. */ + var colorAdjust :String; + /** Shorthand for the "color-interpolation" CSS property. */ + var colorInterpolation :String; + /** Shorthand for the "color-interpolation-filters" CSS property. */ + var colorInterpolationFilters :String; + /** Shorthand for the "color-rendering" CSS property. */ + var colorRendering :String; + /** Shorthand for the "column-count" CSS property. */ + var columnCount :String; + /** Shorthand for the "column-fill" CSS property. */ + var columnFill :String; + /** Shorthand for the "column-gap" CSS property. */ + var columnGap :String; + /** Shorthand for the "column-rule" CSS property. */ + var columnRule :String; + /** Shorthand for the "column-rule-color" CSS property. */ + var columnRuleColor :String; + /** Shorthand for the "column-rule-style" CSS property. */ + var columnRuleStyle :String; + /** Shorthand for the "column-rule-width" CSS property. */ + var columnRuleWidth :String; + /** Shorthand for the "column-span" CSS property. */ + var columnSpan :String; + /** Shorthand for the "column-width" CSS property. */ + var columnWidth :String; + /** Shorthand for the "columns" CSS property. */ + var columns :String; + /** Shorthand for the "contain" CSS property. */ + var contain :String; + /** Shorthand for the "content" CSS property. */ + var content :String; + /** Shorthand for the "counter-increment" CSS property. */ + var counterIncrement :String; + /** Shorthand for the "counter-reset" CSS property. */ + var counterReset :String; + /** Shorthand for the "counter-set" CSS property. */ + var counterSet :String; + /** Shorthand for the "crop" CSS property. */ + var crop :String; + /** Shorthand for the "css-float" CSS property. */ + var cssFloat :String; + /** Shorthand for the "cue" CSS property. */ + var cue :String; + /** Shorthand for the "cue-after" CSS property. */ + var cueAfter :String; + /** Shorthand for the "cue-before" CSS property. */ + var cueBefore :String; + /** Shorthand for the "cursor" CSS property. */ + var cursor :String; + /** Shorthand for the "cx" CSS property. */ + var cx :String; + /** Shorthand for the "cy" CSS property. */ + var cy :String; + /** Shorthand for the "d" CSS property. */ + var d :String; + /** Shorthand for the "direction" CSS property. */ + var direction :String; + /** Shorthand for the "display" CSS property. */ + var display :String; + /** Shorthand for the "display-inside" CSS property. */ + var displayInside :String; + /** Shorthand for the "display-list" CSS property. */ + var displayList :String; + /** Shorthand for the "display-outside" CSS property. */ + var displayOutside :String; + /** Shorthand for the "dominant-baseline" CSS property. */ + var dominantBaseline :String; + /** Shorthand for the "elevation" CSS property. */ + var elevation :String; + /** Shorthand for the "empty-cells" CSS property. */ + var emptyCells :String; + /** Shorthand for the "fill" CSS property. */ + var fill :String; + /** Shorthand for the "fill-opacity" CSS property. */ + var fillOpacity :String; + /** Shorthand for the "fill-rule" CSS property. */ + var fillRule :String; + /** Shorthand for the "filter" CSS property. */ + var filter :String; + /** Shorthand for the "flex" CSS property. */ + var flex :String; + /** Shorthand for the "flex-basis" CSS property. */ + var flexBasis :String; + /** Shorthand for the "flex-direction" CSS property. */ + var flexDirection :String; + /** Shorthand for the "flex-flow" CSS property. */ + var flexFlow :String; + /** Shorthand for the "flex-grow" CSS property. */ + var flexGrow :String; + /** Shorthand for the "flex-shrink" CSS property. */ + var flexShrink :String; + /** Shorthand for the "flex-wrap" CSS property. */ + var flexWrap :String; + /** Shorthand for the "float" CSS property. */ + var float :String; + /** Shorthand for the "float-offset" CSS property. */ + var floatOffset :String; + /** Shorthand for the "flood-color" CSS property. */ + var floodColor :String; + /** Shorthand for the "flood-opacity" CSS property. */ + var floodOpacity :String; + /** Shorthand for the "flow-from" CSS property. */ + var flowFrom :String; + /** Shorthand for the "flow-into" CSS property. */ + var flowInto :String; + /** Shorthand for the "font" CSS property. */ + var font :String; + /** Shorthand for the "font-display" CSS property. */ + var fontDisplay :String; + /** Shorthand for the "font-family" CSS property. */ + var fontFamily :String; + /** Shorthand for the "font-feature-settings" CSS property. */ + var fontFeatureSettings :String; + /** Shorthand for the "font-kerning" CSS property. */ + var fontKerning :String; + /** Shorthand for the "font-language-override" CSS property. */ + var fontLanguageOverride :String; + /** Shorthand for the "font-optical-sizing" CSS property. */ + var fontOpticalSizing :String; + /** Shorthand for the "font-size" CSS property. */ + var fontSize :String; + /** Shorthand for the "font-size-adjust" CSS property. */ + var fontSizeAdjust :String; + /** Shorthand for the "font-stretch" CSS property. */ + var fontStretch :String; + /** Shorthand for the "font-style" CSS property. */ + var fontStyle :String; + /** Shorthand for the "font-synthesis" CSS property. */ + var fontSynthesis :String; + /** Shorthand for the "font-variant" CSS property. */ + var fontVariant :String; + /** Shorthand for the "font-variant-alternates" CSS property. */ + var fontVariantAlternates :String; + /** Shorthand for the "font-variant-caps" CSS property. */ + var fontVariantCaps :String; + /** Shorthand for the "font-variant-east-asian" CSS property. */ + var fontVariantEastAsian :String; + /** Shorthand for the "font-variant-ligatures" CSS property. */ + var fontVariantLigatures :String; + /** Shorthand for the "font-variant-numeric" CSS property. */ + var fontVariantNumeric :String; + /** Shorthand for the "font-variant-position" CSS property. */ + var fontVariantPosition :String; + /** Shorthand for the "font-variation-settings" CSS property. */ + var fontVariationSettings :String; + /** Shorthand for the "font-weight" CSS property. */ + var fontWeight :String; + /** Shorthand for the "gap" CSS property. */ + var gap :String; + /** Shorthand for the "grid" CSS property. */ + var grid :String; + /** Shorthand for the "grid-area" CSS property. */ + var gridArea :String; + /** Shorthand for the "grid-auto-columns" CSS property. */ + var gridAutoColumns :String; + /** Shorthand for the "grid-auto-flow" CSS property. */ + var gridAutoFlow :String; + /** Shorthand for the "grid-auto-rows" CSS property. */ + var gridAutoRows :String; + /** Shorthand for the "grid-column" CSS property. */ + var gridColumn :String; + /** Shorthand for the "grid-column-end" CSS property. */ + var gridColumnEnd :String; + /** Shorthand for the "grid-column-gap" CSS property. */ + var gridColumnGap :String; + /** Shorthand for the "grid-column-start" CSS property. */ + var gridColumnStart :String; + /** Shorthand for the "grid-gap" CSS property. */ + var gridGap :String; + /** Shorthand for the "grid-row" CSS property. */ + var gridRow :String; + /** Shorthand for the "grid-row-end" CSS property. */ + var gridRowEnd :String; + /** Shorthand for the "grid-row-gap" CSS property. */ + var gridRowGap :String; + /** Shorthand for the "grid-row-start" CSS property. */ + var gridRowStart :String; + /** Shorthand for the "grid-template" CSS property. */ + var gridTemplate :String; + /** Shorthand for the "grid-template-areas" CSS property. */ + var gridTemplateAreas :String; + /** Shorthand for the "grid-template-columns" CSS property. */ + var gridTemplateColumns :String; + /** Shorthand for the "grid-template-rows" CSS property. */ + var gridTemplateRows :String; + /** Shorthand for the "hanging-punctuation" CSS property. */ + var hangingPunctuation :String; + /** Shorthand for the "height" CSS property. */ + var height :String; + /** Shorthand for the "hyphens" CSS property. */ + var hyphens :String; + /** Shorthand for the "icon" CSS property. */ + var icon :String; + /** Shorthand for the "image-orientation" CSS property. */ + var imageOrientation :String; + /** Shorthand for the "image-rendering" CSS property. */ + var imageRendering :String; + /** Shorthand for the "image-resolution" CSS property. */ + var imageResolution :String; + /** Shorthand for the "ime-mode" CSS property. */ + var imeMode :String; + /** Shorthand for the "initial-letters" CSS property. */ + var initialLetters :String; + /** Shorthand for the "inline-box-align" CSS property. */ + var inlineBoxAlign :String; + /** Shorthand for the "inline-size" CSS property. */ + var inlineSize :String; + /** Shorthand for the "isolation" CSS property. */ + var isolation :String; + /** Shorthand for the "justify-content" CSS property. */ + var justifyContent :String; + /** Shorthand for the "justify-items" CSS property. */ + var justifyItems :String; + /** Shorthand for the "justify-self" CSS property. */ + var justifySelf :String; + /** Shorthand for the "left" CSS property. */ + var left :String; + /** Shorthand for the "letter-spacing" CSS property. */ + var letterSpacing :String; + /** Shorthand for the "lighting-color" CSS property. */ + var lightingColor :String; + /** Shorthand for the "line-box-contain" CSS property. */ + var lineBoxContain :String; + /** Shorthand for the "line-break" CSS property. */ + var lineBreak :String; + /** Shorthand for the "line-grid" CSS property. */ + var lineGrid :String; + /** Shorthand for the "line-height" CSS property. */ + var lineHeight :String; + /** Shorthand for the "line-snap" CSS property. */ + var lineSnap :String; + /** Shorthand for the "line-stacking" CSS property. */ + var lineStacking :String; + /** Shorthand for the "line-stacking-ruby" CSS property. */ + var lineStackingRuby :String; + /** Shorthand for the "line-stacking-shift" CSS property. */ + var lineStackingShift :String; + /** Shorthand for the "line-stacking-strategy" CSS property. */ + var lineStackingStrategy :String; + /** Shorthand for the "list-style" CSS property. */ + var listStyle :String; + /** Shorthand for the "list-style-image" CSS property. */ + var listStyleImage :String; + /** Shorthand for the "list-style-position" CSS property. */ + var listStylePosition :String; + /** Shorthand for the "list-style-type" CSS property. */ + var listStyleType :String; + /** Shorthand for the "margin" CSS property. */ + var margin :String; + /** Shorthand for the "margin-block-end" CSS property. */ + var marginBlockEnd :String; + /** Shorthand for the "margin-block-start" CSS property. */ + var marginBlockStart :String; + /** Shorthand for the "margin-bottom" CSS property. */ + var marginBottom :String; + /** Shorthand for the "margin-inline-end" CSS property. */ + var marginInlineEnd :String; + /** Shorthand for the "margin-inline-start" CSS property. */ + var marginInlineStart :String; + /** Shorthand for the "margin-left" CSS property. */ + var marginLeft :String; + /** Shorthand for the "margin-right" CSS property. */ + var marginRight :String; + /** Shorthand for the "margin-top" CSS property. */ + var marginTop :String; + /** Shorthand for the "marker" CSS property. */ + var marker :String; + /** Shorthand for the "marker-end" CSS property. */ + var markerEnd :String; + /** Shorthand for the "marker-mid" CSS property. */ + var markerMid :String; + /** Shorthand for the "marker-offset" CSS property. */ + var markerOffset :String; + /** Shorthand for the "marker-side" CSS property. */ + var markerSide :String; + /** Shorthand for the "marker-start" CSS property. */ + var markerStart :String; + /** Shorthand for the "marks" CSS property. */ + var marks :String; + /** Shorthand for the "mask" CSS property. */ + var mask :String; + /** Shorthand for the "mask-box" CSS property. */ + var maskBox :String; + /** Shorthand for the "mask-box-outset" CSS property. */ + var maskBoxOutset :String; + /** Shorthand for the "mask-box-repeat" CSS property. */ + var maskBoxRepeat :String; + /** Shorthand for the "mask-box-slice" CSS property. */ + var maskBoxSlice :String; + /** Shorthand for the "mask-box-source" CSS property. */ + var maskBoxSource :String; + /** Shorthand for the "mask-box-width" CSS property. */ + var maskBoxWidth :String; + /** Shorthand for the "mask-clip" CSS property. */ + var maskClip :String; + /** Shorthand for the "mask-composite" CSS property. */ + var maskComposite :String; + /** Shorthand for the "mask-image" CSS property. */ + var maskImage :String; + /** Shorthand for the "mask-mode" CSS property. */ + var maskMode :String; + /** Shorthand for the "mask-origin" CSS property. */ + var maskOrigin :String; + /** Shorthand for the "mask-position" CSS property. */ + var maskPosition :String; + /** Shorthand for the "mask-position-x" CSS property. */ + var maskPositionX :String; + /** Shorthand for the "mask-position-y" CSS property. */ + var maskPositionY :String; + /** Shorthand for the "mask-repeat" CSS property. */ + var maskRepeat :String; + /** Shorthand for the "mask-size" CSS property. */ + var maskSize :String; + /** Shorthand for the "mask-source-type" CSS property. */ + var maskSourceType :String; + /** Shorthand for the "mask-type" CSS property. */ + var maskType :String; + /** Shorthand for the "max-block-size" CSS property. */ + var maxBlockSize :String; + /** Shorthand for the "max-height" CSS property. */ + var maxHeight :String; + /** Shorthand for the "max-inline-size" CSS property. */ + var maxInlineSize :String; + /** Shorthand for the "max-lines" CSS property. */ + var maxLines :String; + /** Shorthand for the "max-width" CSS property. */ + var maxWidth :String; + /** Shorthand for the "max-zoom" CSS property. */ + var maxZoom :String; + /** Shorthand for the "min-block-size" CSS property. */ + var minBlockSize :String; + /** Shorthand for the "min-height" CSS property. */ + var minHeight :String; + /** Shorthand for the "min-inline-size" CSS property. */ + var minInlineSize :String; + /** Shorthand for the "min-width" CSS property. */ + var minWidth :String; + /** Shorthand for the "min-zoom" CSS property. */ + var minZoom :String; + /** Shorthand for the "mix-blend-mode" CSS property. */ + var mixBlendMode :String; + /** Shorthand for the "move-to" CSS property. */ + var moveTo :String; + /** Shorthand for the "nav-down" CSS property. */ + var navDown :String; + /** Shorthand for the "nav-index" CSS property. */ + var navIndex :String; + /** Shorthand for the "nav-left" CSS property. */ + var navLeft :String; + /** Shorthand for the "nav-right" CSS property. */ + var navRight :String; + /** Shorthand for the "nav-up" CSS property. */ + var navUp :String; + /** Shorthand for the "object-fit" CSS property. */ + var objectFit :String; + /** Shorthand for the "object-position" CSS property. */ + var objectPosition :String; + /** Shorthand for the "offset" CSS property. */ + var offset :String; + /** Shorthand for the "offset-block-end" CSS property. */ + var offsetBlockEnd :String; + /** Shorthand for the "offset-block-start" CSS property. */ + var offsetBlockStart :String; + /** Shorthand for the "offset-distance" CSS property. */ + var offsetDistance :String; + /** Shorthand for the "offset-inline-end" CSS property. */ + var offsetInlineEnd :String; + /** Shorthand for the "offset-inline-start" CSS property. */ + var offsetInlineStart :String; + /** Shorthand for the "offset-path" CSS property. */ + var offsetPath :String; + /** Shorthand for the "offset-rotate" CSS property. */ + var offsetRotate :String; + /** Shorthand for the "opacity" CSS property. */ + var opacity :String; + /** Shorthand for the "order" CSS property. */ + var order :String; + /** Shorthand for the "orientation" CSS property. */ + var orientation :String; + /** Shorthand for the "orphans" CSS property. */ + var orphans :String; + /** Shorthand for the "outline" CSS property. */ + var outline :String; + /** Shorthand for the "outline-color" CSS property. */ + var outlineColor :String; + /** Shorthand for the "outline-offset" CSS property. */ + var outlineOffset :String; + /** Shorthand for the "outline-style" CSS property. */ + var outlineStyle :String; + /** Shorthand for the "outline-width" CSS property. */ + var outlineWidth :String; + /** Shorthand for the "overflow" CSS property. */ + var overflow :String; + /** Shorthand for the "overflow-anchor" CSS property. */ + var overflowAnchor :String; + /** Shorthand for the "overflow-wrap" CSS property. */ + var overflowWrap :String; + /** Shorthand for the "overflow-x" CSS property. */ + var overflowX :String; + /** Shorthand for the "overflow-y" CSS property. */ + var overflowY :String; + /** Shorthand for the "overscroll-behavior" CSS property. */ + var overscrollBehavior :String; + /** Shorthand for the "overscroll-behavior-x" CSS property. */ + var overscrollBehaviorX :String; + /** Shorthand for the "overscroll-behavior-y" CSS property. */ + var overscrollBehaviorY :String; + /** Shorthand for the "padding" CSS property. */ + var padding :String; + /** Shorthand for the "padding-block-end" CSS property. */ + var paddingBlockEnd :String; + /** Shorthand for the "padding-block-start" CSS property. */ + var paddingBlockStart :String; + /** Shorthand for the "padding-bottom" CSS property. */ + var paddingBottom :String; + /** Shorthand for the "padding-inline-end" CSS property. */ + var paddingInlineEnd :String; + /** Shorthand for the "padding-inline-start" CSS property. */ + var paddingInlineStart :String; + /** Shorthand for the "padding-left" CSS property. */ + var paddingLeft :String; + /** Shorthand for the "padding-right" CSS property. */ + var paddingRight :String; + /** Shorthand for the "padding-top" CSS property. */ + var paddingTop :String; + /** Shorthand for the "page" CSS property. */ + var page :String; + /** Shorthand for the "page-break-after" CSS property. */ + var pageBreakAfter :String; + /** Shorthand for the "page-break-before" CSS property. */ + var pageBreakBefore :String; + /** Shorthand for the "page-break-inside" CSS property. */ + var pageBreakInside :String; + /** Shorthand for the "page-policy" CSS property. */ + var pagePolicy :String; + /** Shorthand for the "paint-order" CSS property. */ + var paintOrder :String; + /** Shorthand for the "pause" CSS property. */ + var pause :String; + /** Shorthand for the "pause-after" CSS property. */ + var pauseAfter :String; + /** Shorthand for the "pause-before" CSS property. */ + var pauseBefore :String; + /** Shorthand for the "perspective" CSS property. */ + var perspective :String; + /** Shorthand for the "perspective-origin" CSS property. */ + var perspectiveOrigin :String; + /** Shorthand for the "pitch" CSS property. */ + var pitch :String; + /** Shorthand for the "pitch-range" CSS property. */ + var pitchRange :String; + /** Shorthand for the "place-content" CSS property. */ + var placeContent :String; + /** Shorthand for the "place-items" CSS property. */ + var placeItems :String; + /** Shorthand for the "place-self" CSS property. */ + var placeSelf :String; + /** Shorthand for the "play-during" CSS property. */ + var playDuring :String; + /** Shorthand for the "pointer-events" CSS property. */ + var pointerEvents :String; + /** Shorthand for the "position" CSS property. */ + var position :String; + /** Shorthand for the "presentation-level" CSS property. */ + var presentationLevel :String; + /** Shorthand for the "quotes" CSS property. */ + var quotes :String; + /** Shorthand for the "r" CSS property. */ + var r :String; + /** Shorthand for the "region-fragment" CSS property. */ + var regionFragment :String; + /** Shorthand for the "resize" CSS property. */ + var resize :String; + /** Shorthand for the "rest" CSS property. */ + var rest :String; + /** Shorthand for the "rest-after" CSS property. */ + var restAfter :String; + /** Shorthand for the "rest-before" CSS property. */ + var restBefore :String; + /** Shorthand for the "richness" CSS property. */ + var richness :String; + /** Shorthand for the "right" CSS property. */ + var right :String; + /** Shorthand for the "rotation" CSS property. */ + var rotation :String; + /** Shorthand for the "rotation-point" CSS property. */ + var rotationPoint :String; + /** Shorthand for the "row-gap" CSS property. */ + var rowGap :String; + /** Shorthand for the "ruby-align" CSS property. */ + var rubyAlign :String; + /** Shorthand for the "ruby-merge" CSS property. */ + var rubyMerge :String; + /** Shorthand for the "ruby-position" CSS property. */ + var rubyPosition :String; + /** Shorthand for the "rx" CSS property. */ + var rx :String; + /** Shorthand for the "ry" CSS property. */ + var ry :String; + /** Shorthand for the "scroll-behavior" CSS property. */ + var scrollBehavior :String; + /** Shorthand for the "scroll-snap-coordinate" CSS property. */ + var scrollSnapCoordinate :String; + /** Shorthand for the "scroll-snap-destination" CSS property. */ + var scrollSnapDestination :String; + /** Shorthand for the "scroll-snap-points-x" CSS property. */ + var scrollSnapPointsX :String; + /** Shorthand for the "scroll-snap-points-y" CSS property. */ + var scrollSnapPointsY :String; + /** Shorthand for the "scroll-snap-type" CSS property. */ + var scrollSnapType :String; + /** Shorthand for the "scroll-snap-type-x" CSS property. */ + var scrollSnapTypeX :String; + /** Shorthand for the "scroll-snap-type-y" CSS property. */ + var scrollSnapTypeY :String; + /** Shorthand for the "shape-image-threshold" CSS property. */ + var shapeImageThreshold :String; + /** Shorthand for the "shape-margin" CSS property. */ + var shapeMargin :String; + /** Shorthand for the "shape-outside" CSS property. */ + var shapeOutside :String; + /** Shorthand for the "shape-rendering" CSS property. */ + var shapeRendering :String; + /** Shorthand for the "size" CSS property. */ + var size :String; + /** Shorthand for the "speak" CSS property. */ + var speak :String; + /** Shorthand for the "speak-as" CSS property. */ + var speakAs :String; + /** Shorthand for the "speak-header" CSS property. */ + var speakHeader :String; + /** Shorthand for the "speak-numeral" CSS property. */ + var speakNumeral :String; + /** Shorthand for the "speak-punctuation" CSS property. */ + var speakPunctuation :String; + /** Shorthand for the "speech-rate" CSS property. */ + var speechRate :String; + /** Shorthand for the "src" CSS property. */ + var src :String; + /** Shorthand for the "stop-color" CSS property. */ + var stopColor :String; + /** Shorthand for the "stop-opacity" CSS property. */ + var stopOpacity :String; + /** Shorthand for the "stress" CSS property. */ + var stress :String; + /** Shorthand for the "string-set" CSS property. */ + var stringSet :String; + /** Shorthand for the "stroke" CSS property. */ + var stroke :String; + /** Shorthand for the "stroke-dasharray" CSS property. */ + var strokeDasharray :String; + /** Shorthand for the "stroke-dashoffset" CSS property. */ + var strokeDashoffset :String; + /** Shorthand for the "stroke-linecap" CSS property. */ + var strokeLinecap :String; + /** Shorthand for the "stroke-linejoin" CSS property. */ + var strokeLinejoin :String; + /** Shorthand for the "stroke-miterlimit" CSS property. */ + var strokeMiterlimit :String; + /** Shorthand for the "stroke-opacity" CSS property. */ + var strokeOpacity :String; + /** Shorthand for the "stroke-width" CSS property. */ + var strokeWidth :String; + /** Shorthand for the "tab-size" CSS property. */ + var tabSize :String; + /** Shorthand for the "table-layout" CSS property. */ + var tableLayout :String; + /** Shorthand for the "text-align" CSS property. */ + var textAlign :String; + /** Shorthand for the "text-align-last" CSS property. */ + var textAlignLast :String; + /** Shorthand for the "text-anchor" CSS property. */ + var textAnchor :String; + /** Shorthand for the "text-combine-upright" CSS property. */ + var textCombineUpright :String; + /** Shorthand for the "text-decoration" CSS property. */ + var textDecoration :String; + /** Shorthand for the "text-decoration-color" CSS property. */ + var textDecorationColor :String; + /** Shorthand for the "text-decoration-line" CSS property. */ + var textDecorationLine :String; + /** Shorthand for the "text-decoration-skip" CSS property. */ + var textDecorationSkip :String; + /** Shorthand for the "text-decoration-skip-ink" CSS property. */ + var textDecorationSkipInk :String; + /** Shorthand for the "text-decoration-style" CSS property. */ + var textDecorationStyle :String; + /** Shorthand for the "text-emphasis" CSS property. */ + var textEmphasis :String; + /** Shorthand for the "text-emphasis-color" CSS property. */ + var textEmphasisColor :String; + /** Shorthand for the "text-emphasis-position" CSS property. */ + var textEmphasisPosition :String; + /** Shorthand for the "text-emphasis-style" CSS property. */ + var textEmphasisStyle :String; + /** Shorthand for the "text-height" CSS property. */ + var textHeight :String; + /** Shorthand for the "text-indent" CSS property. */ + var textIndent :String; + /** Shorthand for the "text-justify" CSS property. */ + var textJustify :String; + /** Shorthand for the "text-orientation" CSS property. */ + var textOrientation :String; + /** Shorthand for the "text-overflow" CSS property. */ + var textOverflow :String; + /** Shorthand for the "text-rendering" CSS property. */ + var textRendering :String; + /** Shorthand for the "text-shadow" CSS property. */ + var textShadow :String; + /** Shorthand for the "text-size-adjust" CSS property. */ + var textSizeAdjust :String; + /** Shorthand for the "text-space-collapse" CSS property. */ + var textSpaceCollapse :String; + /** Shorthand for the "text-transform" CSS property. */ + var textTransform :String; + /** Shorthand for the "text-underline-position" CSS property. */ + var textUnderlinePosition :String; + /** Shorthand for the "text-wrap" CSS property. */ + var textWrap :String; + /** Shorthand for the "top" CSS property. */ + var top :String; + /** Shorthand for the "touch-action" CSS property. */ + var touchAction :String; + /** Shorthand for the "transform" CSS property. */ + var transform :String; + /** Shorthand for the "transform-box" CSS property. */ + var transformBox :String; + /** Shorthand for the "transform-origin" CSS property. */ + var transformOrigin :String; + /** Shorthand for the "transform-style" CSS property. */ + var transformStyle :String; + /** Shorthand for the "transition" CSS property. */ + var transition :String; + /** Shorthand for the "transition-delay" CSS property. */ + var transitionDelay :String; + /** Shorthand for the "transition-duration" CSS property. */ + var transitionDuration :String; + /** Shorthand for the "transition-property" CSS property. */ + var transitionProperty :String; + /** Shorthand for the "transition-timing-function" CSS property. */ + var transitionTimingFunction :String; + /** Shorthand for the "unicode-bidi" CSS property. */ + var unicodeBidi :String; + /** Shorthand for the "unicode-range" CSS property. */ + var unicodeRange :String; + /** Shorthand for the "user-select" CSS property. */ + var userSelect :String; + /** Shorthand for the "user-zoom" CSS property. */ + var userZoom :String; + /** Shorthand for the "vector-effect" CSS property. */ + var vectorEffect :String; + /** Shorthand for the "vertical-align" CSS property. */ + var verticalAlign :String; + /** Shorthand for the "visibility" CSS property. */ + var visibility :String; + /** Shorthand for the "voice-balance" CSS property. */ + var voiceBalance :String; + /** Shorthand for the "voice-duration" CSS property. */ + var voiceDuration :String; + /** Shorthand for the "voice-family" CSS property. */ + var voiceFamily :String; + /** Shorthand for the "voice-pitch" CSS property. */ + var voicePitch :String; + /** Shorthand for the "voice-range" CSS property. */ + var voiceRange :String; + /** Shorthand for the "voice-rate" CSS property. */ + var voiceRate :String; + /** Shorthand for the "voice-stress" CSS property. */ + var voiceStress :String; + /** Shorthand for the "voice-volume" CSS property. */ + var voiceVolume :String; + /** Shorthand for the "volume" CSS property. */ + var volume :String; + /** Shorthand for the "white-space" CSS property. */ + var whiteSpace :String; + /** Shorthand for the "widows" CSS property. */ + var widows :String; + /** Shorthand for the "width" CSS property. */ + var width :String; + /** Shorthand for the "will-change" CSS property. */ + var willChange :String; + /** Shorthand for the "word-break" CSS property. */ + var wordBreak :String; + /** Shorthand for the "word-spacing" CSS property. */ + var wordSpacing :String; + /** Shorthand for the "word-wrap" CSS property. */ + var wordWrap :String; + /** Shorthand for the "wrap-flow" CSS property. */ + var wrapFlow :String; + /** Shorthand for the "wrap-through" CSS property. */ + var wrapThrough :String; + /** Shorthand for the "writing-mode" CSS property. */ + var writingMode :String; + /** Shorthand for the "x" CSS property. */ + var x :String; + /** Shorthand for the "y" CSS property. */ + var y :String; + /** Shorthand for the "z-index" CSS property. */ + var zIndex :String; + /** Shorthand for the "zoom" CSS property. */ + var zoom :String; + + function item( index : Int ) : String; + /** @throws DOMError */ + function getPropertyValue( property : String ) : String; + function getPropertyPriority( property : String ) : String; + /** @throws DOMError */ + function setProperty( property : String, value : String, priority : String = "" ) : Void; + /** @throws DOMError */ + function removeProperty( property : String ) : String; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CSSStyleRule.hx b/build/linux64_569e52e/std/js/html/CSSStyleRule.hx new file mode 100644 index 0000000..1fc1d7c --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CSSStyleRule.hx @@ -0,0 +1,47 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CSSStyleRule.webidl. Do not edit! + +package js.html; + +/** + `CSSStyleRule` represents a single CSS style rule. It implements the `CSSRule` interface with a type value of `1` (`CSSRule.STYLE_RULE`). + + Documentation [CSSStyleRule](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleRule) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleRule$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CSSStyleRule") +extern class CSSStyleRule extends CSSRule { + + /** + Gets the textual representation of the selector for this rule, e.g. `"h1,h2"`. + **/ + var selectorText : String; + + /** + Returns the `CSSStyleDeclaration` object for the rule. + **/ + var style(default,null) : CSSStyleDeclaration; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CSSStyleSheet.hx b/build/linux64_569e52e/std/js/html/CSSStyleSheet.hx new file mode 100644 index 0000000..6ed72d4 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CSSStyleSheet.hx @@ -0,0 +1,65 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CSSStyleSheet.webidl. Do not edit! + +package js.html; + +/** + The `CSSStyleSheet` interface represents a single CSS style sheet. It inherits properties and methods from its parent, `StyleSheet`. + + Documentation [CSSStyleSheet](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CSSStyleSheet") +extern class CSSStyleSheet extends StyleSheet { + + /** + If this style sheet is imported into the document using an `@import` rule, the `ownerRule` property will return that `CSSImportRule`, otherwise it returns `null`. + **/ + var ownerRule(default,null) : CSSRule; + + /** + Returns a live `CSSRuleList`, listing the `CSSRule` objects in the style sheet. + + This is normally used to access individual rules like this: + + `   styleSheet.cssRules[i] // where i = 0..cssRules.length-1` + + To add or remove items in `cssRules`, use the `CSSStyleSheet`'s `deleteRule()` and `insertRule()` methods, described below. + **/ + var cssRules(default,null) : CSSRuleList; + + + /** + Inserts a new rule at the specified position in the style sheet, given the textual representation of the rule. + @throws DOMError + **/ + function insertRule( rule : String, index : Int = 0 ) : Int; + + /** + Deletes a rule at the specified position from the style sheet. + @throws DOMError + **/ + function deleteRule( index : Int ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CSSSupportsRule.hx b/build/linux64_569e52e/std/js/html/CSSSupportsRule.hx new file mode 100644 index 0000000..e708dd4 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CSSSupportsRule.hx @@ -0,0 +1,36 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CSSSupportsRule.webidl. Do not edit! + +package js.html; + +/** + The `CSSSupportsRule` interface describes an object representing a single CSS `@supports` at-rule. It implements the `CSSConditionRule` interface, and therefore the `CSSRule` and `CSSGroupingRule` interfaces with a type value of `12` (`CSSRule.SUPPORTS_RULE`). + + Documentation [CSSSupportsRule](https://developer.mozilla.org/en-US/docs/Web/API/CSSSupportsRule) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CSSSupportsRule$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CSSSupportsRule") +extern class CSSSupportsRule extends CSSConditionRule { +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CSSTransition.hx b/build/linux64_569e52e/std/js/html/CSSTransition.hx new file mode 100644 index 0000000..336547a --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CSSTransition.hx @@ -0,0 +1,31 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CSSTransition.webidl. Do not edit! + +package js.html; + +@:native("CSSTransition") +extern class CSSTransition extends Animation { + var transitionProperty(default,null) : String; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/Cache.hx b/build/linux64_569e52e/std/js/html/Cache.hx new file mode 100644 index 0000000..93b9bd6 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/Cache.hx @@ -0,0 +1,51 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Cache.webidl. Do not edit! + +package js.html; + +import js.lib.Promise; + +/** + The `Cache` interface provides a storage mechanism for `Request` / `Response` object pairs that are cached, for example as part of the `ServiceWorker` life cycle. Note that the `Cache` interface is exposed to windowed scopes as well as workers. You don't have to use it in conjunction with service workers, even though it is defined in the service worker spec. + + Documentation [Cache](https://developer.mozilla.org/en-US/docs/Web/API/Cache) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/Cache$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("Cache") +extern class Cache { + @:overload( function( request : String, ?options : CacheQueryOptions) : Promise {} ) + function match( request : Request, ?options : CacheQueryOptions ) : Promise; + @:overload( function( ?request : String, ?options : CacheQueryOptions) : Promise> {} ) + function matchAll( ?request : Request, ?options : CacheQueryOptions ) : Promise>; + @:overload( function( request : String) : Promise {} ) + function add( request : Request ) : Promise; + function addAll( requests : Array> ) : Promise; + @:overload( function( request : String, response : Response) : Promise {} ) + function put( request : Request, response : Response ) : Promise; + @:overload( function( request : String, ?options : CacheQueryOptions) : Promise {} ) + function delete( request : Request, ?options : CacheQueryOptions ) : Promise; + @:overload( function( ?request : String, ?options : CacheQueryOptions) : Promise> {} ) + function keys( ?request : Request, ?options : CacheQueryOptions ) : Promise>; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CacheQueryOptions.hx b/build/linux64_569e52e/std/js/html/CacheQueryOptions.hx new file mode 100644 index 0000000..95ff293 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CacheQueryOptions.hx @@ -0,0 +1,32 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Cache.webidl. Do not edit! + +package js.html; + +typedef CacheQueryOptions = { + var ?cacheName : String; + var ?ignoreMethod : Bool; + var ?ignoreSearch : Bool; + var ?ignoreVary : Bool; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CacheStorage.hx b/build/linux64_569e52e/std/js/html/CacheStorage.hx new file mode 100644 index 0000000..8a7546b --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CacheStorage.hx @@ -0,0 +1,66 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CacheStorage.webidl. Do not edit! + +package js.html; + +import js.lib.Promise; + +/** + The `CacheStorage` interface represents the storage for `Cache` objects. + + Documentation [CacheStorage](https://developer.mozilla.org/en-US/docs/Web/API/CacheStorage) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CacheStorage$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CacheStorage") +extern class CacheStorage { + /** @throws DOMError */ + function new( namespace : CacheStorageNamespace, principal : Dynamic/*MISSING Principal*/ ) : Void; + + /** + Checks if a given `Request` is a key in any of the `Cache` objects that the `CacheStorage` object tracks, and returns a `Promise` that resolves to that match. + **/ + @:overload( function( request : String, ?options : CacheQueryOptions) : Promise {} ) + function match( request : Request, ?options : CacheQueryOptions ) : Promise; + + /** + Returns a `Promise` that resolves to `true` if a `Cache` object matching the `cacheName` exists. + **/ + function has( cacheName : String ) : Promise; + + /** + Returns a `Promise` that resolves to the `Cache` object matching the `cacheName` (a new cache is created if it doesn't already exist.) + **/ + function open( cacheName : String ) : Promise; + + /** + Finds the `Cache` object matching the `cacheName`, and if found, deletes the `Cache` object and returns a `Promise` that resolves to `true`. If no `Cache` object is found, it returns `false`. + **/ + function delete( cacheName : String ) : Promise; + + /** + Returns a `Promise` that will resolve with an array containing strings corresponding to all of the named `Cache` objects tracked by the `CacheStorage`. Use this method to iterate over a list of all the `Cache` objects. + **/ + function keys() : Promise>; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CacheStorageNamespace.hx b/build/linux64_569e52e/std/js/html/CacheStorageNamespace.hx new file mode 100644 index 0000000..4a5ed31 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CacheStorageNamespace.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CacheStorage.webidl. Do not edit! + +package js.html; + +enum abstract CacheStorageNamespace(String) { + var CONTENT = "content"; + var CHROME = "chrome"; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CanvasCaptureMediaStream.hx b/build/linux64_569e52e/std/js/html/CanvasCaptureMediaStream.hx new file mode 100644 index 0000000..935314f --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CanvasCaptureMediaStream.hx @@ -0,0 +1,32 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CanvasCaptureMediaStream.webidl. Do not edit! + +package js.html; + +@:native("CanvasCaptureMediaStream") +extern class CanvasCaptureMediaStream extends MediaStream { + var canvas(default,null) : CanvasElement; + + function requestFrame() : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CanvasElement.hx b/build/linux64_569e52e/std/js/html/CanvasElement.hx new file mode 100644 index 0000000..205485f --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CanvasElement.hx @@ -0,0 +1,94 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLCanvasElement.webidl. Do not edit! + +package js.html; + +/** + The `HTMLCanvasElement` interface provides properties and methods for manipulating the layout and presentation of canvas elements. The `HTMLCanvasElement` interface also inherits the properties and methods of the `HTMLElement` interface. + + Documentation [HTMLCanvasElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("HTMLCanvasElement") +extern class CanvasElement extends Element { + + /** + Is a positive `integer` reflecting the `width` HTML attribute of the `canvas` element interpreted in CSS pixels. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of `300` is used. + **/ + var width : Int; + + /** + Is a positive `integer` reflecting the `height` HTML attribute of the `canvas` element interpreted in CSS pixels. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of `150` is used. + **/ + var height : Int; + + + /** + Returns a drawing context on the canvas, or null if the context ID is not supported. A drawing context lets you draw on the canvas. Calling getContext with `"2d"` returns a `CanvasRenderingContext2D` object, whereas calling it with `"webgl"` (or `"experimental-webgl"`) returns a `WebGLRenderingContext` object. This context is only available on browsers that implement WebGL. + @throws DOMError + **/ + function getContext( contextId : String, ?contextOptions : Dynamic ) : Dynamic; + + /** + Returns a data-URL containing a representation of the image in the format specified by the `type` parameter (defaults to `png`). The returned image is in a resolution of 96dpi. + @throws DOMError + **/ + function toDataURL( type : String = "", ?encoderOptions : Dynamic ) : String; + + /** + Creates a `Blob` object representing the image contained in the canvas; this file may be cached on the disk or stored in memory at the discretion of the user agent. + @throws DOMError + **/ + function toBlob( callback : Blob -> Void, type : String = "", ?encoderOptions : Dynamic ) : Void; + + /** + Returns a `CanvasCaptureMediaStream` that is a real-time video capture of the surface of the canvas. + @throws DOMError + **/ + function captureStream( ?frameRate : Float ) : CanvasCaptureMediaStream; + + /** Shorthand for getting a CanvasRenderingContext2D. */ + inline function getContext2d( ?attribs : {} ) : CanvasRenderingContext2D { + return cast getContext("2d", attribs); + } + /** Shorthand for getting a js.html.webgl.RenderingContext. */ + inline function getContextWebGL( ?attribs : js.html.webgl.ContextAttributes ) : js.html.webgl.RenderingContext { + return CanvasUtil.getContextWebGL(this, attribs); + } + /** Shorthand for getting a js.html.webgl.WebGL2RenderingContext. */ + inline function getContextWebGL2( ?attribs : js.html.webgl.ContextAttributes ) : js.html.webgl.WebGL2RenderingContext { + return this.getContext('webgl2', attribs); + } +} + +private class CanvasUtil { + public static function getContextWebGL( canvas :CanvasElement, attribs :{} ) { + for (name in ["webgl", "experimental-webgl"]) { + var ctx = canvas.getContext(name, attribs); + if (ctx != null) return ctx; + } + return null; + } +} diff --git a/build/linux64_569e52e/std/js/html/CanvasGradient.hx b/build/linux64_569e52e/std/js/html/CanvasGradient.hx new file mode 100644 index 0000000..7934def --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CanvasGradient.hx @@ -0,0 +1,42 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CanvasRenderingContext2D.webidl. Do not edit! + +package js.html; + +/** + The `CanvasGradient` interface represents an opaque object describing a gradient. It is returned by the methods `CanvasRenderingContext2D.createLinearGradient()` or `CanvasRenderingContext2D.createRadialGradient()`. + + Documentation [CanvasGradient](https://developer.mozilla.org/en-US/docs/Web/API/CanvasGradient) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CanvasGradient$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CanvasGradient") +extern class CanvasGradient { + + /** + Adds a new stop, defined by an `offset` and a `color`, to the gradient. If the offset is not between `0` and `1` an `INDEX_SIZE_ERR` is raised, if the color can't be parsed as a CSS `color`, a `SYNTAX_ERR` is raised. + @throws DOMError + **/ + function addColorStop( offset : Float, color : String ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CanvasPattern.hx b/build/linux64_569e52e/std/js/html/CanvasPattern.hx new file mode 100644 index 0000000..560b10d --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CanvasPattern.hx @@ -0,0 +1,41 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CanvasRenderingContext2D.webidl. Do not edit! + +package js.html; + +/** + The `CanvasPattern` interface represents an opaque object describing a pattern, based on an image, a canvas, or a video, created by the `CanvasRenderingContext2D.createPattern()` method. + + Documentation [CanvasPattern](https://developer.mozilla.org/en-US/docs/Web/API/CanvasPattern) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CanvasPattern$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CanvasPattern") +extern class CanvasPattern { + + /** + Applies an `SVGMatrix` representing a linear transform to the pattern. + **/ + function setTransform( matrix : js.html.svg.Matrix ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CanvasRenderingContext2D.hx b/build/linux64_569e52e/std/js/html/CanvasRenderingContext2D.hx new file mode 100644 index 0000000..810444c --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CanvasRenderingContext2D.hx @@ -0,0 +1,145 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CanvasRenderingContext2D.webidl. Do not edit! + +package js.html; + +/** + To get an object of this interface, call `getContext()` on a `canvas element`, supplying "2d" as the argument: + + Documentation [CanvasRenderingContext2D](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CanvasRenderingContext2D") +extern class CanvasRenderingContext2D { + var canvas(default,null) : CanvasElement; + var globalAlpha : Float; + var globalCompositeOperation : String; + var strokeStyle : haxe.extern.EitherType>; + var fillStyle : haxe.extern.EitherType>; + var filter : String; + var imageSmoothingEnabled : Bool; + var lineWidth : Float; + var lineCap : String; + var lineJoin : String; + var miterLimit : Float; + var lineDashOffset : Float; + var shadowOffsetX : Float; + var shadowOffsetY : Float; + var shadowBlur : Float; + var shadowColor : String; + var font : String; + var textAlign : String; + var textBaseline : String; + + /** @throws DOMError */ + @:overload( function( image : js.html.svg.ImageElement, dx : Float, dy : Float) : Void {} ) + @:overload( function( image : CanvasElement, dx : Float, dy : Float) : Void {} ) + @:overload( function( image : VideoElement, dx : Float, dy : Float) : Void {} ) + @:overload( function( image : ImageBitmap, dx : Float, dy : Float) : Void {} ) + @:overload( function( image : js.html.svg.ImageElement, dx : Float, dy : Float, dw : Float, dh : Float) : Void {} ) + @:overload( function( image : CanvasElement, dx : Float, dy : Float, dw : Float, dh : Float) : Void {} ) + @:overload( function( image : VideoElement, dx : Float, dy : Float, dw : Float, dh : Float) : Void {} ) + @:overload( function( image : ImageBitmap, dx : Float, dy : Float, dw : Float, dh : Float) : Void {} ) + @:overload( function( image : js.html.svg.ImageElement, sx : Float, sy : Float, sw : Float, sh : Float, dx : Float, dy : Float, dw : Float, dh : Float) : Void {} ) + @:overload( function( image : CanvasElement, sx : Float, sy : Float, sw : Float, sh : Float, dx : Float, dy : Float, dw : Float, dh : Float) : Void {} ) + @:overload( function( image : VideoElement, sx : Float, sy : Float, sw : Float, sh : Float, dx : Float, dy : Float, dw : Float, dh : Float) : Void {} ) + @:overload( function( image : ImageBitmap, sx : Float, sy : Float, sw : Float, sh : Float, dx : Float, dy : Float, dw : Float, dh : Float) : Void {} ) + @:overload( function( image : ImageElement, dx : Float, dy : Float ) : Void {} ) + @:overload( function( image : ImageElement, dx : Float, dy : Float, dw : Float, dh : Float ) : Void {} ) + function drawImage( image : ImageElement, sx : Float, sy : Float, sw : Float, sh : Float, dx : Float, dy : Float, dw : Float, dh : Float ) : Void; + function beginPath() : Void; + @:overload( function( winding : CanvasWindingRule = NONZERO ) : Void {} ) + function fill( path : Path2D, winding : CanvasWindingRule = NONZERO ) : Void; + @:overload( function() : Void {} ) + function stroke( path : Path2D ) : Void; + @:overload( function( winding : CanvasWindingRule = NONZERO ) : Void {} ) + function clip( path : Path2D, winding : CanvasWindingRule = NONZERO ) : Void; + @:overload( function( x : Float, y : Float, winding : CanvasWindingRule = NONZERO ) : Bool {} ) + function isPointInPath( path : Path2D, x : Float, y : Float, winding : CanvasWindingRule = NONZERO ) : Bool; + @:overload( function( x : Float, y : Float ) : Bool {} ) + function isPointInStroke( path : Path2D, x : Float, y : Float ) : Bool; + function createLinearGradient( x0 : Float, y0 : Float, x1 : Float, y1 : Float ) : CanvasGradient; + /** @throws DOMError */ + function createRadialGradient( x0 : Float, y0 : Float, r0 : Float, x1 : Float, y1 : Float, r1 : Float ) : CanvasGradient; + /** @throws DOMError */ + @:overload( function( image : js.html.svg.ImageElement, repetition : String) : CanvasPattern {} ) + @:overload( function( image : CanvasElement, repetition : String) : CanvasPattern {} ) + @:overload( function( image : VideoElement, repetition : String) : CanvasPattern {} ) + @:overload( function( image : ImageBitmap, repetition : String) : CanvasPattern {} ) + function createPattern( image : ImageElement, repetition : String ) : CanvasPattern; + /** @throws DOMError */ + function addHitRegion( ?options : HitRegionOptions ) : Void; + function removeHitRegion( id : String ) : Void; + function clearHitRegions() : Void; + /** @throws DOMError */ + @:overload( function( sw : Float, sh : Float ) : ImageData {} ) + function createImageData( imagedata : ImageData ) : ImageData; + /** @throws DOMError */ + function getImageData( sx : Float, sy : Float, sw : Float, sh : Float ) : ImageData; + /** @throws DOMError */ + @:overload( function( imagedata : ImageData, dx : Float, dy : Float ) : Void {} ) + function putImageData( imagedata : ImageData, dx : Float, dy : Float, dirtyX : Float, dirtyY : Float, dirtyWidth : Float, dirtyHeight : Float ) : Void; + /** @throws DOMError */ + function setLineDash( segments : Array ) : Void; + function getLineDash() : Array; + function closePath() : Void; + function moveTo( x : Float, y : Float ) : Void; + function lineTo( x : Float, y : Float ) : Void; + function quadraticCurveTo( cpx : Float, cpy : Float, x : Float, y : Float ) : Void; + function bezierCurveTo( cp1x : Float, cp1y : Float, cp2x : Float, cp2y : Float, x : Float, y : Float ) : Void; + /** @throws DOMError */ + function arcTo( x1 : Float, y1 : Float, x2 : Float, y2 : Float, radius : Float ) : Void; + function rect( x : Float, y : Float, w : Float, h : Float ) : Void; + /** @throws DOMError */ + function arc( x : Float, y : Float, radius : Float, startAngle : Float, endAngle : Float, anticlockwise : Bool = false ) : Void; + /** @throws DOMError */ + function ellipse( x : Float, y : Float, radiusX : Float, radiusY : Float, rotation : Float, startAngle : Float, endAngle : Float, anticlockwise : Bool = false ) : Void; + function clearRect( x : Float, y : Float, w : Float, h : Float ) : Void; + function fillRect( x : Float, y : Float, w : Float, h : Float ) : Void; + function strokeRect( x : Float, y : Float, w : Float, h : Float ) : Void; + function save() : Void; + function restore() : Void; + /** @throws DOMError */ + function fillText( text : String, x : Float, y : Float, ?maxWidth : Float ) : Void; + /** @throws DOMError */ + function strokeText( text : String, x : Float, y : Float, ?maxWidth : Float ) : Void; + /** @throws DOMError */ + function measureText( text : String ) : TextMetrics; + /** @throws DOMError */ + function scale( x : Float, y : Float ) : Void; + /** @throws DOMError */ + function rotate( angle : Float ) : Void; + /** @throws DOMError */ + function translate( x : Float, y : Float ) : Void; + /** @throws DOMError */ + function transform( a : Float, b : Float, c : Float, d : Float, e : Float, f : Float ) : Void; + /** @throws DOMError */ + function setTransform( a : Float, b : Float, c : Float, d : Float, e : Float, f : Float ) : Void; + /** @throws DOMError */ + function resetTransform() : Void; + /** @throws DOMError */ + function drawFocusIfNeeded( element : Element ) : Void; + function drawCustomFocusRing( element : Element ) : Bool; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CanvasWindingRule.hx b/build/linux64_569e52e/std/js/html/CanvasWindingRule.hx new file mode 100644 index 0000000..4d7c643 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CanvasWindingRule.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CanvasRenderingContext2D.webidl. Do not edit! + +package js.html; + +enum abstract CanvasWindingRule(String) { + var NONZERO = "nonzero"; + var EVENODD = "evenodd"; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CaretPosition.hx b/build/linux64_569e52e/std/js/html/CaretPosition.hx new file mode 100644 index 0000000..aaa5d77 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CaretPosition.hx @@ -0,0 +1,48 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CaretPosition.webidl. Do not edit! + +package js.html; + +/** + The `CaretPosition` interface represents the caret postion, an indicator for the text insertion point. You can get a `CaretPosition` using the `document.caretPositionFromPoint` method. + + Documentation [CaretPosition](https://developer.mozilla.org/en-US/docs/Web/API/CaretPosition) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CaretPosition$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CaretPosition") +extern class CaretPosition { + + /** + Returns a `Node` containing the found node at the caret's position. + **/ + var offsetNode(default,null) : Node; + + /** + Returns a `long` representing the character offset in the caret position node. + **/ + var offset(default,null) : Int; + + function getClientRect() : DOMRect; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/ChannelPixelLayout.hx b/build/linux64_569e52e/std/js/html/ChannelPixelLayout.hx new file mode 100644 index 0000000..62671b1 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ChannelPixelLayout.hx @@ -0,0 +1,34 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\ImageBitmap.webidl. Do not edit! + +package js.html; + +typedef ChannelPixelLayout = { + var dataType : ChannelPixelLayoutDataType; + var height : Int; + var offset : Int; + var skip : Int; + var stride : Int; + var width : Int; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/ChannelPixelLayoutDataType.hx b/build/linux64_569e52e/std/js/html/ChannelPixelLayoutDataType.hx new file mode 100644 index 0000000..66d6cb7 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ChannelPixelLayoutDataType.hx @@ -0,0 +1,36 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\ImageBitmap.webidl. Do not edit! + +package js.html; + +enum abstract ChannelPixelLayoutDataType(String) { + var UINT8 = "uint8"; + var INT8 = "int8"; + var UINT16 = "uint16"; + var INT16 = "int16"; + var UINT32 = "uint32"; + var INT32 = "int32"; + var FLOAT32 = "float32"; + var FLOAT64 = "float64"; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CharacterData.hx b/build/linux64_569e52e/std/js/html/CharacterData.hx new file mode 100644 index 0000000..a6ba5aa --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CharacterData.hx @@ -0,0 +1,89 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CharacterData.webidl. Do not edit! + +package js.html; + +/** + The `CharacterData` abstract interface represents a `Node` object that contains characters. This is an abstract interface, meaning there aren't any object of type `CharacterData`: it is implemented by other interfaces, like `Text`, '. In XML, the character sequence '--' cannot be used within a comment.">`Comment`, or `ProcessingInstruction` which aren't abstract. + + Documentation [CharacterData](https://developer.mozilla.org/en-US/docs/Web/API/CharacterData) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CharacterData$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CharacterData") +extern class CharacterData extends Node { + + /** + Is a `DOMString` representing the textual data contained in this object. + **/ + var data : String; + + /** + Returns an `unsigned long` representing the size of the string contained in `CharacterData.data`. + **/ + var length(default,null) : Int; + var previousElementSibling(default,null) : Element; + var nextElementSibling(default,null) : Element; + + + /** + Returns a `DOMString` containing the part of `CharacterData.data` of the specified length and starting at the specified offset. + @throws DOMError + **/ + function substringData( offset : Int, count : Int ) : String; + + /** + Appends the given `DOMString` to the `CharacterData.data` string; when this method returns, `data` contains the concatenated `DOMString`. + @throws DOMError + **/ + function appendData( data : String ) : Void; + + /** + Inserts the specified characters, at the specified offset, in the `CharacterData.data` string; when this method returns, `data` contains the modified `DOMString`. + @throws DOMError + **/ + function insertData( offset : Int, data : String ) : Void; + + /** + Removes the specified amount of characters, starting at the specified offset, from the `CharacterData.data` string; when this method returns, `data` contains the shortened `DOMString`. + @throws DOMError + **/ + function deleteData( offset : Int, count : Int ) : Void; + + /** + Replaces the specified amount of characters, starting at the specified offset, with the specified `DOMString`; when this method returns, `data` contains the modified `DOMString`. + @throws DOMError + **/ + function replaceData( offset : Int, count : Int, data : String ) : Void; + /** @throws DOMError */ + @:overload( function( nodes : haxe.extern.Rest) : Void {} ) + function before( nodes : haxe.extern.Rest ) : Void; + /** @throws DOMError */ + @:overload( function( nodes : haxe.extern.Rest) : Void {} ) + function after( nodes : haxe.extern.Rest ) : Void; + /** @throws DOMError */ + @:overload( function( nodes : haxe.extern.Rest) : Void {} ) + function replaceWith( nodes : haxe.extern.Rest ) : Void; + function remove() : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/Client.hx b/build/linux64_569e52e/std/js/html/Client.hx new file mode 100644 index 0000000..7074b7c --- /dev/null +++ b/build/linux64_569e52e/std/js/html/Client.hx @@ -0,0 +1,59 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Client.webidl. Do not edit! + +package js.html; + +/** + The `Client` interface represents an executable context such as a `Worker`, or a `SharedWorker`. `Window` clients are represented by the more-specific `WindowClient`. You can get `Client`/`WindowClient` objects from methods such as `Clients.matchAll()` and `Clients.get()`. + + Documentation [Client](https://developer.mozilla.org/en-US/docs/Web/API/Client) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/Client$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("Client") +extern class Client { + + /** + The URL of the client as a string. + **/ + var url(default,null) : String; + var frameType(default,null) : FrameType; + + /** + The client's type as a string. It can be "`window"`, "`worker"`, or "`sharedworker"`. + **/ + var type(default,null) : ClientType; + + /** + The universally unique identifier of the client as a string. + **/ + var id(default,null) : String; + + + /** + Sends a message to the client. + @throws DOMError + **/ + function postMessage( message : Dynamic, ?transfer : Array ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/ClientQueryOptions.hx b/build/linux64_569e52e/std/js/html/ClientQueryOptions.hx new file mode 100644 index 0000000..9bccf19 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ClientQueryOptions.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Clients.webidl. Do not edit! + +package js.html; + +typedef ClientQueryOptions = { + var ?includeUncontrolled : Bool; + var ?type : ClientType; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/ClientType.hx b/build/linux64_569e52e/std/js/html/ClientType.hx new file mode 100644 index 0000000..444f251 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ClientType.hx @@ -0,0 +1,33 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Clients.webidl. Do not edit! + +package js.html; + +enum abstract ClientType(String) { + var WINDOW = "window"; + var WORKER = "worker"; + var SHAREDWORKER = "sharedworker"; + var SERVICEWORKER = "serviceworker"; + var ALL = "all"; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/Clients.hx b/build/linux64_569e52e/std/js/html/Clients.hx new file mode 100644 index 0000000..2d5d530 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/Clients.hx @@ -0,0 +1,58 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Clients.webidl. Do not edit! + +package js.html; + +import js.lib.Promise; + +/** + The `Clients` interface provides access to `Client` objects. Access it via ``self`.clients` within a service worker. + + Documentation [Clients](https://developer.mozilla.org/en-US/docs/Web/API/Clients) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/Clients$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("Clients") +extern class Clients { + + /** + Returns a `Promise` for a `Client` matching a given `Client.id`. + **/ + function get( id : String ) : Promise; + + /** + Returns a `Promise` for an array of `Client` objects. An options argument allows you to control the types of clients returned.  + **/ + function matchAll( ?options : ClientQueryOptions ) : Promise>; + + /** + Opens a new browser window for a given url and returns a `Promise` for the new `WindowClient`. + **/ + function openWindow( url : String ) : Promise; + + /** + Allows an active service worker to set itself as the `ServiceWorkerContainer.controller` for all clients within its `ServiceWorkerRegistration.scope`.  + **/ + function claim() : Promise; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/Clipboard.hx b/build/linux64_569e52e/std/js/html/Clipboard.hx new file mode 100644 index 0000000..ee00461 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/Clipboard.hx @@ -0,0 +1,62 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Clipboard.webidl. Do not edit! + +package js.html; + +import js.lib.Promise; + +/** + The `Clipboard` interface implements the Clipboard API, providing—if the user grants permission—both read and write access to the contents of the system clipboard. + + Documentation [Clipboard](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("Clipboard") +extern class Clipboard extends EventTarget { + + /** + Requests arbitrary data (such as images) from the clipboard, returning a `Promise`. When the data has been retrieved, the promise is resolved with a `DataTransfer` object that provides the data. + @throws DOMError + **/ + function read() : Promise; + + /** + Requests text from the system clipboard; returns a `Promise` which is resolved with a `DOMString` containing the clipboard's text once it's available. + @throws DOMError + **/ + function readText() : Promise; + + /** + Writes arbitrary data to the system clipboard. This asynchronous operation signals that it's finished by resolving the returned `Promise`. + @throws DOMError + **/ + function write( data : DataTransfer ) : Promise; + + /** + Writes text to the system clipboard, returning a `Promise` which is resolved once the text is fully copied into the clipboard. + @throws DOMError + **/ + function writeText( data : String ) : Promise; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/ClipboardEvent.hx b/build/linux64_569e52e/std/js/html/ClipboardEvent.hx new file mode 100644 index 0000000..6e52531 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ClipboardEvent.hx @@ -0,0 +1,44 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\ClipboardEvent.webidl. Do not edit! + +package js.html; + +/** + The `ClipboardEvent` interface represents events providing information related to modification of the clipboard, that is `cut`, `copy`, and `paste` events. + + Documentation [ClipboardEvent](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("ClipboardEvent") +extern class ClipboardEvent extends Event { + + /** + Is a `DataTransfer` object containing the data affected by the user-initiated `cut`, `copy`, or `paste` operation, along with its MIME type. + **/ + var clipboardData(default,null) : DataTransfer; + + /** @throws DOMError */ + function new( type : String, ?eventInitDict : ClipboardEventInit ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/ClipboardEventInit.hx b/build/linux64_569e52e/std/js/html/ClipboardEventInit.hx new file mode 100644 index 0000000..07cece3 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ClipboardEventInit.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\ClipboardEvent.webidl. Do not edit! + +package js.html; + +typedef ClipboardEventInit = EventInit & { + var ?data : String; + var ?dataType : String; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CloseEvent.hx b/build/linux64_569e52e/std/js/html/CloseEvent.hx new file mode 100644 index 0000000..0ee0a7e --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CloseEvent.hx @@ -0,0 +1,169 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CloseEvent.webidl. Do not edit! + +package js.html; + +/** + A `CloseEvent` is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the `WebSocket` object's `onclose` attribute. + + Documentation [CloseEvent](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CloseEvent") +extern class CloseEvent extends Event { + + /** + Returns a `Boolean` that Indicates whether or not the connection was cleanly closed. + **/ + var wasClean(default,null) : Bool; + + /** + Returns an unsigned short containing the close code send by the server. The following values are permitted status codes. The following definitions are sourced from the IANA website [Ref]. Note that the 1xxx codes are only WebSocket-internal and not for the same meaning by the transported data (like when the application-layer protocol is invalid). The only permitted codes to be specified in Firefox are 1000 and 3000 to 4999 [Source, Bug]. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Status codeNameDescription
0999 Reserved and not used.
1000Normal ClosureNormal closure; the connection successfully completed whatever purpose for which it was created.
1001Going AwayThe endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection.
1002Protocol ErrorThe endpoint is terminating the connection due to a protocol error.
1003Unsupported DataThe connection is being terminated because the endpoint received data of a type it cannot accept (for example, a text-only endpoint received binary data).
1004 Reserved. A meaning might be defined in the future.
1005No Status RecvdReserved.  Indicates that no status code was provided even though one was expected.
1006Abnormal ClosureReserved. Used to indicate that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected.
1007Invalid frame payload dataThe endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message).
1008Policy ViolationThe endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable.
1009Message too bigThe endpoint is terminating the connection because a data frame was received that is too large.
1010Missing ExtensionThe client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't.
1011Internal ErrorThe server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.
1012Service RestartThe server is terminating the connection because it is restarting. [Ref]
1013Try Again LaterThe server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients. [Ref]
1014Bad GatewayThe server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code.
1015TLS HandshakeReserved. Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified).
10161999 Reserved for future use by the WebSocket standard.
20002999 Reserved for use by WebSocket extensions.
30003999 Available for use by libraries and frameworks. May not be used by applications. Available for registration at the IANA via first-come, first-serve.
40004999 Available for use by applications.
+ + **/ + var code(default,null) : Int; + + /** + Returns a `DOMString` indicating the reason the server closed the connection. This is specific to the particular server and sub-protocol. + **/ + var reason(default,null) : String; + + /** @throws DOMError */ + function new( type : String, ?eventInitDict : CloseEventInit ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CloseEventInit.hx b/build/linux64_569e52e/std/js/html/CloseEventInit.hx new file mode 100644 index 0000000..7a33c7e --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CloseEventInit.hx @@ -0,0 +1,31 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CloseEvent.webidl. Do not edit! + +package js.html; + +typedef CloseEventInit = EventInit & { + var ?code : Int; + var ?reason : String; + var ?wasClean : Bool; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/Comment.hx b/build/linux64_569e52e/std/js/html/Comment.hx new file mode 100644 index 0000000..4042b11 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/Comment.hx @@ -0,0 +1,38 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Comment.webidl. Do not edit! + +package js.html; + +/** + The `Comment` interface represents textual notations within markup; although it is generally not visually shown, such comments are available to be read in the source view. Comments are represented in HTML and XML as content between '`!--`' and '`--`'. In XML, the character sequence '`--`' cannot be used within a comment. + + Documentation [Comment](https://developer.mozilla.org/en-US/docs/Web/API/Comment) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/Comment$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("Comment") +extern class Comment extends CharacterData { + /** @throws DOMError */ + function new( data : String = "" ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CompositeOperation.hx b/build/linux64_569e52e/std/js/html/CompositeOperation.hx new file mode 100644 index 0000000..5dcdb0b --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CompositeOperation.hx @@ -0,0 +1,31 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\BaseKeyframeTypes.webidl. Do not edit! + +package js.html; + +enum abstract CompositeOperation(String) { + var REPLACE = "replace"; + var ADD = "add"; + var ACCUMULATE = "accumulate"; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CompositionEvent.hx b/build/linux64_569e52e/std/js/html/CompositionEvent.hx new file mode 100644 index 0000000..77f24ef --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CompositionEvent.hx @@ -0,0 +1,54 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CompositionEvent.webidl. Do not edit! + +package js.html; + +/** + The DOM `CompositionEvent` represents events that occur due to the user indirectly entering text. + + Documentation [CompositionEvent](https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CompositionEvent") +extern class CompositionEvent extends UIEvent { + + /** + Returns the characters generated by the input method that raised the event; its varies depending on the type of event that generated the `CompositionEvent` object. + **/ + var data(default,null) : String; + + /** + Returns the locale of current input method (for example, the keyboard layout locale if the composition is associated with IME). + **/ + var locale(default,null) : String; + + /** @throws DOMError */ + function new( type : String, ?eventInitDict : CompositionEventInit ) : Void; + + /** + Initializes the attributes of a `CompositionEvent` object. + **/ + function initCompositionEvent( typeArg : String, canBubbleArg : Bool = false, cancelableArg : Bool = false, ?viewArg : Window, ?dataArg : String, localeArg : String = "" ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CompositionEventInit.hx b/build/linux64_569e52e/std/js/html/CompositionEventInit.hx new file mode 100644 index 0000000..37134c2 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CompositionEventInit.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CompositionEvent.webidl. Do not edit! + +package js.html; + +typedef CompositionEventInit = UIEventInit & { + var ?data : String; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/ComputedEffectTiming.hx b/build/linux64_569e52e/std/js/html/ComputedEffectTiming.hx new file mode 100644 index 0000000..ba542df --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ComputedEffectTiming.hx @@ -0,0 +1,33 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\AnimationEffect.webidl. Do not edit! + +package js.html; + +typedef ComputedEffectTiming = EffectTiming & { + var ?activeDuration : Float; + var ?currentIteration : Float; + var ?endTime : Float; + var ?localTime : Float; + var ?progress : Float; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/Console.hx b/build/linux64_569e52e/std/js/html/Console.hx new file mode 100644 index 0000000..4f265ad --- /dev/null +++ b/build/linux64_569e52e/std/js/html/Console.hx @@ -0,0 +1,155 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Console.webidl. Do not edit! + +package js.html; + +/** + The `Console` object provides access to the browser's debugging console (e.g. the Web Console in Firefox). The specifics of how it works varies from browser to browser, but there is a de facto set of features that are typically provided. + + Documentation [console](https://developer.mozilla.org/en-US/docs/Web/API/console) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/console$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("console") +extern class Console { + + /** + Log a message and stack trace to console if the first argument is `false`. + **/ + static function assert( condition : Bool = false, data : haxe.extern.Rest ) : Void; + + /** + Clear the console. + **/ + static function clear() : Void; + + /** + Log the number of times this line has been called with the given label. + **/ + static function count( label : String = "default" ) : Void; + + /** + Resets the value of the counter with the given label. + **/ + static function countReset( label : String = "default" ) : Void; + + /** + Outputs a message to the console with the log level `"debug"`. + Note: Starting with Chromium 58 this method only appears in Chromium browser consoles when level "Verbose" is selected. + + **/ + static function debug( data : haxe.extern.Rest ) : Void; + + /** + Outputs an error message. You may use string substitution and additional arguments with this method. + **/ + static function error( data : haxe.extern.Rest ) : Void; + + /** + Informative logging of information. You may use string substitution and additional arguments with this method. + **/ + static function info( data : haxe.extern.Rest ) : Void; + + /** + For general output of logging information. You may use string substitution and additional arguments with this method. + **/ + static function log( data : haxe.extern.Rest ) : Void; + + /** + Displays tabular data as a table. + **/ + static function table( data : haxe.extern.Rest ) : Void; + + /** + Outputs a stack trace. + **/ + static function trace( data : haxe.extern.Rest ) : Void; + + /** + Outputs a warning message. You may use string substitution and additional arguments with this method. + **/ + static function warn( data : haxe.extern.Rest ) : Void; + + /** + Displays an interactive listing of the properties of a specified JavaScript object. This listing lets you use disclosure triangles to examine the contents of child objects. + **/ + static function dir( data : haxe.extern.Rest ) : Void; + + /** + + Displays an XML/HTML Element representation of the specified object if possible or the JavaScript Object view if it is not possible. + + **/ + static function dirxml( data : haxe.extern.Rest ) : Void; + + /** + Creates a new inline group, indenting all following output by another level. To move back out a level, call `groupEnd()`. + **/ + static function group( data : haxe.extern.Rest ) : Void; + + /** + Creates a new inline group, indenting all following output by another level. However, unlike `group()` this starts with the inline group collapsed requiring the use of a disclosure button to expand it. To move back out a level, call `groupEnd()`. + **/ + static function groupCollapsed( data : haxe.extern.Rest ) : Void; + + /** + Exits the current inline group. + **/ + static function groupEnd() : Void; + + /** + Starts a timer with a name specified as an input parameter. Up to 10,000 simultaneous timers can run on a given page. + **/ + static function time( label : String = "default" ) : Void; + + /** + Logs the value of the specified timer to the console. + **/ + static function timeLog( label : String = "default", data : haxe.extern.Rest ) : Void; + + /** + Stops the specified timer and logs the elapsed time in seconds since it started. + **/ + static function timeEnd( label : String = "default" ) : Void; + + /** + An alias for `error()`. + **/ + static function exception( data : haxe.extern.Rest ) : Void; + + /** + Adds a marker to the browser's Timeline or Waterfall tool. + **/ + static function timeStamp( ?data : Dynamic ) : Void; + + /** + Starts the browser's built-in profiler (for example, the Firefox performance tool). You can specify an optional name for the profile. + **/ + static function profile( data : haxe.extern.Rest ) : Void; + + /** + Stops the profiler. You can see the resulting profile in the browser's performance tool (for example, the Firefox performance tool). + **/ + static function profileEnd( data : haxe.extern.Rest ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/ConsoleInstance.hx b/build/linux64_569e52e/std/js/html/ConsoleInstance.hx new file mode 100644 index 0000000..cded8ec --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ConsoleInstance.hx @@ -0,0 +1,154 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Console.webidl. Do not edit! + +package js.html; + +/** + The `Console` object provides access to the browser's debugging console (e.g. the Web Console in Firefox). The specifics of how it works varies from browser to browser, but there is a de facto set of features that are typically provided. + + Documentation [Console](https://developer.mozilla.org/en-US/docs/Web/API/Console) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/Console$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +extern interface ConsoleInstance { + + /** + Log a message and stack trace to console if the first argument is `false`. + **/ + function assert( condition : Bool = false, data : haxe.extern.Rest ) : Void; + + /** + Clear the console. + **/ + function clear() : Void; + + /** + Log the number of times this line has been called with the given label. + **/ + function count( label : String = "default" ) : Void; + + /** + Resets the value of the counter with the given label. + **/ + function countReset( label : String = "default" ) : Void; + + /** + Outputs a message to the console with the log level `"debug"`. + Note: Starting with Chromium 58 this method only appears in Chromium browser consoles when level "Verbose" is selected. + + **/ + function debug( data : haxe.extern.Rest ) : Void; + + /** + Outputs an error message. You may use string substitution and additional arguments with this method. + **/ + function error( data : haxe.extern.Rest ) : Void; + + /** + Informative logging of information. You may use string substitution and additional arguments with this method. + **/ + function info( data : haxe.extern.Rest ) : Void; + + /** + For general output of logging information. You may use string substitution and additional arguments with this method. + **/ + function log( data : haxe.extern.Rest ) : Void; + + /** + Displays tabular data as a table. + **/ + function table( data : haxe.extern.Rest ) : Void; + + /** + Outputs a stack trace. + **/ + function trace( data : haxe.extern.Rest ) : Void; + + /** + Outputs a warning message. You may use string substitution and additional arguments with this method. + **/ + function warn( data : haxe.extern.Rest ) : Void; + + /** + Displays an interactive listing of the properties of a specified JavaScript object. This listing lets you use disclosure triangles to examine the contents of child objects. + **/ + function dir( data : haxe.extern.Rest ) : Void; + + /** + + Displays an XML/HTML Element representation of the specified object if possible or the JavaScript Object view if it is not possible. + + **/ + function dirxml( data : haxe.extern.Rest ) : Void; + + /** + Creates a new inline group, indenting all following output by another level. To move back out a level, call `groupEnd()`. + **/ + function group( data : haxe.extern.Rest ) : Void; + + /** + Creates a new inline group, indenting all following output by another level. However, unlike `group()` this starts with the inline group collapsed requiring the use of a disclosure button to expand it. To move back out a level, call `groupEnd()`. + **/ + function groupCollapsed( data : haxe.extern.Rest ) : Void; + + /** + Exits the current inline group. + **/ + function groupEnd() : Void; + + /** + Starts a timer with a name specified as an input parameter. Up to 10,000 simultaneous timers can run on a given page. + **/ + function time( label : String = "default" ) : Void; + + /** + Logs the value of the specified timer to the console. + **/ + function timeLog( label : String = "default", data : haxe.extern.Rest ) : Void; + + /** + Stops the specified timer and logs the elapsed time in seconds since it started. + **/ + function timeEnd( label : String = "default" ) : Void; + + /** + An alias for `error()`. + **/ + function exception( data : haxe.extern.Rest ) : Void; + + /** + Adds a marker to the browser's Timeline or Waterfall tool. + **/ + function timeStamp( ?data : Dynamic ) : Void; + + /** + Starts the browser's built-in profiler (for example, the Firefox performance tool). You can specify an optional name for the profile. + **/ + function profile( data : haxe.extern.Rest ) : Void; + + /** + Stops the profiler. You can see the resulting profile in the browser's performance tool (for example, the Firefox performance tool). + **/ + function profileEnd( data : haxe.extern.Rest ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/ConstrainBooleanParameters.hx b/build/linux64_569e52e/std/js/html/ConstrainBooleanParameters.hx new file mode 100644 index 0000000..c1c7313 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ConstrainBooleanParameters.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\MediaTrackConstraintSet.webidl. Do not edit! + +package js.html; + +typedef ConstrainBooleanParameters = { + var ?exact : Bool; + var ?ideal : Bool; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/ConstrainDOMStringParameters.hx b/build/linux64_569e52e/std/js/html/ConstrainDOMStringParameters.hx new file mode 100644 index 0000000..9bc81a6 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ConstrainDOMStringParameters.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\MediaTrackConstraintSet.webidl. Do not edit! + +package js.html; + +typedef ConstrainDOMStringParameters = { + var ?exact : haxe.extern.EitherType>; + var ?ideal : haxe.extern.EitherType>; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/ConstrainDoubleRange.hx b/build/linux64_569e52e/std/js/html/ConstrainDoubleRange.hx new file mode 100644 index 0000000..7b96869 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ConstrainDoubleRange.hx @@ -0,0 +1,32 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\MediaTrackConstraintSet.webidl. Do not edit! + +package js.html; + +typedef ConstrainDoubleRange = { + var ?exact : Float; + var ?ideal : Float; + var ?max : Float; + var ?min : Float; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/ConstrainLongRange.hx b/build/linux64_569e52e/std/js/html/ConstrainLongRange.hx new file mode 100644 index 0000000..a83229a --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ConstrainLongRange.hx @@ -0,0 +1,32 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\MediaTrackConstraintSet.webidl. Do not edit! + +package js.html; + +typedef ConstrainLongRange = { + var ?exact : Int; + var ?ideal : Int; + var ?max : Int; + var ?min : Int; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/ConvertCoordinateOptions.hx b/build/linux64_569e52e/std/js/html/ConvertCoordinateOptions.hx new file mode 100644 index 0000000..f620587 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ConvertCoordinateOptions.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\GeometryUtils.webidl. Do not edit! + +package js.html; + +typedef ConvertCoordinateOptions = { + var ?fromBox : CSSBoxType; + var ?toBox : CSSBoxType; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/Coordinates.hx b/build/linux64_569e52e/std/js/html/Coordinates.hx new file mode 100644 index 0000000..e0d3677 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/Coordinates.hx @@ -0,0 +1,71 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Coordinates.webidl. Do not edit! + +package js.html; + +/** + The `Coordinates` interface represents the position and altitude of the device on Earth, as well as the accuracy with which these properties are calculated. + + Documentation [Coordinates](https://developer.mozilla.org/en-US/docs/Web/API/Coordinates) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/Coordinates$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +typedef Coordinates = { + + /** + Returns a `double` representing the position's latitude in decimal degrees. + **/ + var latitude(default,null) : Float; + + /** + Returns a `double` representing the position's longitude in decimal degrees. + **/ + var longitude(default,null) : Float; + + /** + Returns a `double` representing the position's altitude in meters, relative to sea level. This value can be `null` if the implementation cannot provide the data. + **/ + var altitude(default,null) : Float; + + /** + Returns a `double` representing the accuracy of the `latitude` and `longitude` properties, expressed in meters. + **/ + var accuracy(default,null) : Float; + + /** + Returns a `double` representing the accuracy of the `altitude` expressed in meters. This value can be `null`. + **/ + var altitudeAccuracy(default,null) : Float; + + /** + Returns a `double` representing the direction in which the device is traveling. This value, specified in degrees, indicates how far off from heading true north the device is. `0` degrees represents true north, and the direction is determined clockwise (which means that east is `90` degrees and west is `270` degrees). If `speed` is `0`, `heading` is `NaN`. If the device is unable to provide `heading` information, this value is `null`. + **/ + var heading(default,null) : Float; + + /** + Returns a `double` representing the velocity of the device in meters per second. This value can be `null`. + **/ + var speed(default,null) : Float; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/Crypto.hx b/build/linux64_569e52e/std/js/html/Crypto.hx new file mode 100644 index 0000000..ad52941 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/Crypto.hx @@ -0,0 +1,48 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Crypto.webidl. Do not edit! + +package js.html; + +/** + The `Crypto` interface represents basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives. + + Documentation [Crypto](https://developer.mozilla.org/en-US/docs/Web/API/Crypto) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/Crypto$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("Crypto") +extern class Crypto { + + /** + Returns a `SubtleCrypto` object providing access to common cryptographic primitives, like hashing, signing, encryption or decryption. + **/ + var subtle(default,null) : SubtleCrypto; + + + /** + Fills the passed `TypedArray` with cryptographically sound random values. + @throws DOMError + **/ + function getRandomValues( array : js.lib.ArrayBufferView ) : js.lib.ArrayBufferView; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CryptoKey.hx b/build/linux64_569e52e/std/js/html/CryptoKey.hx new file mode 100644 index 0000000..9ad095c --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CryptoKey.hx @@ -0,0 +1,57 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\SubtleCrypto.webidl. Do not edit! + +package js.html; + +/** + The `CryptoKey` interface represents a cryptographic key derived from a specific key algorithm. + + Documentation [CryptoKey](https://developer.mozilla.org/en-US/docs/Web/API/CryptoKey) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CryptoKey$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CryptoKey") +extern class CryptoKey { + + /** + Returns an enumerated value representing the type of the key, a secret key (for symmetric algorithm), a public or a private key (for an asymmetric algorithm) + **/ + var type(default,null) : String; + + /** + Returns a `Boolean` indicating if the raw information may be exported to the application or not. + **/ + var extractable(default,null) : Bool; + + /** + Returns an opaque object representing a particular cipher the key has to be used with. + **/ + var algorithm(default,null) : Dynamic; + + /** + Returns an array of enumerated values indicating what the key can be used for. + **/ + var usages(default,null) : Array; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CustomEvent.hx b/build/linux64_569e52e/std/js/html/CustomEvent.hx new file mode 100644 index 0000000..665a109 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CustomEvent.hx @@ -0,0 +1,51 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CustomEvent.webidl. Do not edit! + +package js.html; + +/** + This interface inherits properties from its parent, `Event`: + + Documentation [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("CustomEvent") +extern class CustomEvent extends Event { + + /** + Any data passed when initializing the event. + **/ + var detail(default,null) : Dynamic; + + /** @throws DOMError */ + function new( type : String, ?eventInitDict : CustomEventInit ) : Void; + + /** + + Initializes a `CustomEvent` object. If the event has already being dispatched, this method does nothing. + + **/ + function initCustomEvent( type : String, canBubble : Bool = false, cancelable : Bool = false, ?detail : Dynamic ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/CustomEventInit.hx b/build/linux64_569e52e/std/js/html/CustomEventInit.hx new file mode 100644 index 0000000..f730059 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/CustomEventInit.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\CustomEvent.webidl. Do not edit! + +package js.html; + +typedef CustomEventInit = EventInit & { + var ?detail : Dynamic; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DListElement.hx b/build/linux64_569e52e/std/js/html/DListElement.hx new file mode 100644 index 0000000..540a641 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DListElement.hx @@ -0,0 +1,42 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLDListElement.webidl. Do not edit! + +package js.html; + +/** + The `HTMLDListElement` interface provides special properties (beyond those of the regular `HTMLElement` interface it also has available to it by inheritance) for manipulating definition list elements. + + Documentation [HTMLDListElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDListElement) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDListElement$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("HTMLDListElement") +extern class DListElement extends Element { + + /** + Is a `Boolean` indicating that spacing between list items should be reduced. + **/ + var compact : Bool; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DOMElement.hx b/build/linux64_569e52e/std/js/html/DOMElement.hx new file mode 100644 index 0000000..844b451 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DOMElement.hx @@ -0,0 +1,552 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Element.webidl. Do not edit! + +package js.html; + +/** + `Element` is the most general base class from which all objects in a `Document` inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from `Element`. + + Documentation [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/Element$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("Element") +extern class DOMElement extends Node { + + /** + The namespace URI of the element, or `null` if it is no namespace. + + Note: In Firefox 3.5 and earlier, HTML elements are in no namespace. In later versions, HTML elements are in the `http://www.w3.org/1999/xhtml` namespace in both HTML and XML trees. `1.9.2` + + + **/ + var namespaceURI(default,null) : String; + + /** + A `DOMString` representing the namespace prefix of the element, or `null` if no prefix is specified. + **/ + var prefix(default,null) : String; + + /** + A `DOMString` representing the local part of the qualified name of the element. + **/ + var localName(default,null) : String; + + /** + Returns a `String` with the name of the tag for the given element. + **/ + var tagName(default,null) : String; + + /** + Is a `DOMString` representing the id of the element. + **/ + var id : String; + + /** + Is a `DOMString` representing the class of the element. + **/ + var className : String; + + /** + Returns a `DOMTokenList` containing the list of class attributes. + **/ + var classList(default,null) : DOMTokenList; + + /** + Returns a `NamedNodeMap` object containing the assigned attributes of the corresponding HTML element. + **/ + var attributes(default,null) : NamedNodeMap; + var title : String; + var lang : String; + var dir : String; + var dataset(default,null) : DOMStringMap; + var innerText : String; + var itemScope : Bool; + var itemType(default,null) : DOMTokenList; + var itemId : String; + var itemRef(default,null) : DOMTokenList; + var itemProp(default,null) : DOMTokenList; + var properties(default,null) : HTMLPropertiesCollection; + var itemValue : Dynamic; + var hidden : Bool; + var tabIndex : Int; + var accessKey : String; + var accessKeyLabel(default,null) : String; + var draggable : Bool; + var contentEditable : String; + var isContentEditable(default,null) : Bool; + var contextMenu(default,null) : MenuElement; + var spellcheck : Bool; + var style(default,null) : CSSStyleDeclaration; + var oncopy : haxe.Constraints.Function; + var oncut : haxe.Constraints.Function; + var onpaste : haxe.Constraints.Function; + var offsetParent(default,null) : Element; + var offsetTop(default,null) : Int; + var offsetLeft(default,null) : Int; + var offsetWidth(default,null) : Int; + var offsetHeight(default,null) : Int; + + /** + A `Number` representing number of pixels the top of the document is scrolled vertically. + **/ + var scrollTop : Int; + + /** + Is a `Number` representing the left scroll offset of the element. + **/ + var scrollLeft : Int; + + /** + Returns a `Number` representing the scroll view width of the element. + **/ + var scrollWidth(default,null) : Int; + + /** + Returns a `Number` representing the scroll view height of an element. + **/ + var scrollHeight(default,null) : Int; + + /** + Returns a `Number` representing the width of the top border of the element. + **/ + var clientTop(default,null) : Int; + + /** + Returns a `Number` representing the width of the left border of the element. + **/ + var clientLeft(default,null) : Int; + + /** + Returns a `Number` representing the inner width of the element. + **/ + var clientWidth(default,null) : Int; + + /** + Returns a `Number` representing the inner height of the element. + **/ + var clientHeight(default,null) : Int; + + /** + Returns a `Number` representing the maximum top scroll offset possible for the element. + **/ + var scrollTopMax(default,null) : Int; + + /** + Returns a `Number` representing the maximum left scroll offset possible for the element. + **/ + var scrollLeftMax(default,null) : Int; + + /** + Is a `DOMString` representing the markup of the element's content. + **/ + var innerHTML : String; + + /** + Is a `DOMString` representing the markup of the element including its content. When used as a setter, replaces the element with nodes parsed from the given string. + **/ + var outerHTML : String; + + /** + Returns the open shadow root that is hosted by the element, or null if no open shadow root is present. + **/ + var shadowRoot(default,null) : ShadowRoot; + var assignedSlot(default,null) : SlotElement; + + /** + Returns the name of the shadow DOM slot the element is inserted in. + **/ + var slot : String; + var onabort : haxe.Constraints.Function; + var onblur : haxe.Constraints.Function; + var onfocus : haxe.Constraints.Function; + var onauxclick : haxe.Constraints.Function; + var oncanplay : haxe.Constraints.Function; + var oncanplaythrough : haxe.Constraints.Function; + var onchange : haxe.Constraints.Function; + var onclick : haxe.Constraints.Function; + var onclose : haxe.Constraints.Function; + var oncontextmenu : haxe.Constraints.Function; + var ondblclick : haxe.Constraints.Function; + var ondrag : haxe.Constraints.Function; + var ondragend : haxe.Constraints.Function; + var ondragenter : haxe.Constraints.Function; + var ondragexit : haxe.Constraints.Function; + var ondragleave : haxe.Constraints.Function; + var ondragover : haxe.Constraints.Function; + var ondragstart : haxe.Constraints.Function; + var ondrop : haxe.Constraints.Function; + var ondurationchange : haxe.Constraints.Function; + var onemptied : haxe.Constraints.Function; + var onended : haxe.Constraints.Function; + var oninput : haxe.Constraints.Function; + var oninvalid : haxe.Constraints.Function; + var onkeydown : haxe.Constraints.Function; + var onkeypress : haxe.Constraints.Function; + var onkeyup : haxe.Constraints.Function; + var onload : haxe.Constraints.Function; + var onloadeddata : haxe.Constraints.Function; + var onloadedmetadata : haxe.Constraints.Function; + var onloadend : haxe.Constraints.Function; + var onloadstart : haxe.Constraints.Function; + var onmousedown : haxe.Constraints.Function; + var onmouseenter : haxe.Constraints.Function; + var onmouseleave : haxe.Constraints.Function; + var onmousemove : haxe.Constraints.Function; + var onmouseout : haxe.Constraints.Function; + var onmouseover : haxe.Constraints.Function; + var onmouseup : haxe.Constraints.Function; + + /** + Returns the event handling code for the `wheel` event. This is now implemented on `GlobalEventHandlers.onwheel`. + **/ + var onwheel : haxe.Constraints.Function; + var onpause : haxe.Constraints.Function; + var onplay : haxe.Constraints.Function; + var onplaying : haxe.Constraints.Function; + var onprogress : haxe.Constraints.Function; + var onratechange : haxe.Constraints.Function; + var onreset : haxe.Constraints.Function; + var onresize : haxe.Constraints.Function; + var onscroll : haxe.Constraints.Function; + var onseeked : haxe.Constraints.Function; + var onseeking : haxe.Constraints.Function; + var onselect : haxe.Constraints.Function; + var onshow : haxe.Constraints.Function; + var onstalled : haxe.Constraints.Function; + var onsubmit : haxe.Constraints.Function; + var onsuspend : haxe.Constraints.Function; + var ontimeupdate : haxe.Constraints.Function; + var onvolumechange : haxe.Constraints.Function; + var onwaiting : haxe.Constraints.Function; + var onselectstart : haxe.Constraints.Function; + var ontoggle : haxe.Constraints.Function; + var onpointercancel : haxe.Constraints.Function; + var onpointerdown : haxe.Constraints.Function; + var onpointerup : haxe.Constraints.Function; + var onpointermove : haxe.Constraints.Function; + var onpointerout : haxe.Constraints.Function; + var onpointerover : haxe.Constraints.Function; + var onpointerenter : haxe.Constraints.Function; + var onpointerleave : haxe.Constraints.Function; + + /** + Returns the event handler for the `gotpointercapture` event type. + **/ + var ongotpointercapture : haxe.Constraints.Function; + + /** + Returns the event handler for the `lostpointercapture` event type. + **/ + var onlostpointercapture : haxe.Constraints.Function; + var onanimationcancel : haxe.Constraints.Function; + var onanimationend : haxe.Constraints.Function; + var onanimationiteration : haxe.Constraints.Function; + var onanimationstart : haxe.Constraints.Function; + var ontransitioncancel : haxe.Constraints.Function; + var ontransitionend : haxe.Constraints.Function; + var ontransitionrun : haxe.Constraints.Function; + var ontransitionstart : haxe.Constraints.Function; + var onwebkitanimationend : haxe.Constraints.Function; + var onwebkitanimationiteration : haxe.Constraints.Function; + var onwebkitanimationstart : haxe.Constraints.Function; + var onwebkittransitionend : haxe.Constraints.Function; + var previousElementSibling(default,null) : Element; + var nextElementSibling(default,null) : Element; + var onerror : haxe.Constraints.Function; + var children(default,null) : HTMLCollection; + var firstElementChild(default,null) : Element; + var lastElementChild(default,null) : Element; + var childElementCount(default,null) : Int; + var ontouchstart : haxe.Constraints.Function; + var ontouchend : haxe.Constraints.Function; + var ontouchmove : haxe.Constraints.Function; + var ontouchcancel : haxe.Constraints.Function; + + + /** + Returns an array of attribute names from the current element. + **/ + @:pure + function getAttributeNames() : Array; + + /** + Retrieves the value of the named attribute from the current node and returns it as an `Object`. + **/ + @:pure + function getAttribute( name : String ) : String; + + /** + Retrieves the value of the attribute with the specified name and namespace, from the current node and returns it as an `Object`. + **/ + @:pure + function getAttributeNS( namespace : String, localName : String ) : String; + + /** + Toggles a boolean attribute, removing it if it is present and adding it if it is not present, on the specified element. + @throws DOMError + **/ + function toggleAttribute( name : String, ?force : Bool ) : Bool; + + /** + Sets the value of a named attribute of the current node. + @throws DOMError + **/ + function setAttribute( name : String, value : String ) : Void; + + /** + Sets the value of the attribute with the specified name and namespace, from the current node. + @throws DOMError + **/ + function setAttributeNS( namespace : String, name : String, value : String ) : Void; + + /** + Removes the named attribute from the current node. + @throws DOMError + **/ + function removeAttribute( name : String ) : Void; + + /** + Removes the attribute with the specified name and namespace, from the current node. + @throws DOMError + **/ + function removeAttributeNS( namespace : String, localName : String ) : Void; + + /** + Returns a `Boolean` indicating if the element has the specified attribute or not. + **/ + @:pure + function hasAttribute( name : String ) : Bool; + + /** + Returns a `Boolean` indicating if the element has the specified attribute, in the specified namespace, or not. + **/ + @:pure + function hasAttributeNS( namespace : String, localName : String ) : Bool; + + /** + Returns a `Boolean` indicating if the element has one or more HTML attributes present. + **/ + @:pure + function hasAttributes() : Bool; + + /** + Returns the `Element` which is the closest ancestor of the current element (or the current element itself) which matches the selectors given in parameter. + @throws DOMError + **/ + @:pure + function closest( selector : String ) : Element; + + /** + Returns a `Boolean` indicating whether or not the element would be selected by the specified selector string. + @throws DOMError + **/ + @:pure + function matches( selector : String ) : Bool; + /** @throws DOMError */ + @:pure + function webkitMatchesSelector( selector : String ) : Bool; + + /** + Returns a live `HTMLCollection` containing all descendant elements, of a particular tag name, from the current element. + **/ + @:pure + function getElementsByTagName( localName : String ) : HTMLCollection; + + /** + Returns a live `HTMLCollection` containing all descendant elements, of a particular tag name and namespace, from the current element. + @throws DOMError + **/ + @:pure + function getElementsByTagNameNS( namespace : String, localName : String ) : HTMLCollection; + + /** + Returns a live `HTMLCollection` that contains all descendants of the current element that possess the list of classes given in the parameter. + **/ + @:pure + function getElementsByClassName( classNames : String ) : HTMLCollection; + + /** + Inserts a given element node at a given position relative to the element it is invoked upon. + @throws DOMError + **/ + function insertAdjacentElement( where : String, element : Element ) : Element; + + /** + Inserts a given text node at a given position relative to the element it is invoked upon. + @throws DOMError + **/ + function insertAdjacentText( where : String, data : String ) : Void; + + /** + Designates a specific element as the capture target of future pointer events. + @throws DOMError + **/ + function setPointerCapture( pointerId : Int ) : Void; + + /** + Releases (stops) pointer capture that was previously set for a specific `PointerEvent`. + @throws DOMError + **/ + function releasePointerCapture( pointerId : Int ) : Void; + function hasPointerCapture( pointerId : Int ) : Bool; + + /** + Sets up mouse event capture, redirecting all mouse events to this element. + **/ + function setCapture( retargetToElement : Bool = false ) : Void; + function releaseCapture() : Void; + + /** + Retrieves the node representation of the named attribute from the current node and returns it as an `Attr`. + **/ + function getAttributeNode( name : String ) : Attr; + + /** + Sets the node representation of the named attribute from the current node. + @throws DOMError + **/ + function setAttributeNode( newAttr : Attr ) : Attr; + + /** + Removes the node representation of the named attribute from the current node. + @throws DOMError + **/ + function removeAttributeNode( oldAttr : Attr ) : Attr; + + /** + Retrieves the node representation of the attribute with the specified name and namespace, from the current node and returns it as an `Attr`. + **/ + function getAttributeNodeNS( namespaceURI : String, localName : String ) : Attr; + + /** + Sets the node representation of the attribute with the specified name and namespace, from the current node. + @throws DOMError + **/ + function setAttributeNodeNS( newAttr : Attr ) : Attr; + function click() : Void; + /** @throws DOMError */ + function focus() : Void; + /** @throws DOMError */ + function blur() : Void; + + /** + Returns a collection of rectangles that indicate the bounding rectangles for each line of text in a client. + **/ + function getClientRects() : DOMRectList; + + /** + Returns the size of an element and its position relative to the viewport. + **/ + function getBoundingClientRect() : DOMRect; + + /** + Scrolls the page until the element gets into the view. + **/ + @:overload( function( ?arg : ScrollIntoViewOptions) : Void {} ) + function scrollIntoView( ?arg : Bool ) : Void; + @:overload( function( x : Float, y : Float ) : Void {} ) + function scroll( ?options : ScrollToOptions ) : Void; + @:overload( function( x : Float, y : Float ) : Void {} ) + function scrollTo( ?options : ScrollToOptions ) : Void; + @:overload( function( x : Float, y : Float ) : Void {} ) + function scrollBy( ?options : ScrollToOptions ) : Void; + + /** + Parses the text as HTML or XML and inserts the resulting nodes into the tree in the position given. + @throws DOMError + **/ + function insertAdjacentHTML( position : String, text : String ) : Void; + + /** + Returns the first `Node` which matches the specified selector string relative to the element. + @throws DOMError + **/ + @:pure + function querySelector( selectors : String ) : Element; + + /** + Returns a `NodeList` of nodes which match the specified selector string relative to the element. + @throws DOMError + **/ + @:pure + function querySelectorAll( selectors : String ) : NodeList; + + /** + Attatches a shadow DOM tree to the specified element and returns a reference to its `ShadowRoot`. + @throws DOMError + **/ + function attachShadow( shadowRootInitDict : ShadowRootInit ) : ShadowRoot; + + /** + Asynchronously asks the browser to make the element full-screen. + @throws DOMError + **/ + function requestFullscreen(?options: FullscreenOptions) : js.lib.Promise; + + /** + Allows to asynchronously ask for the pointer to be locked on the given element. + **/ + function requestPointerLock() : Void; + + /** + A shortcut method to create and run an animation on an element. Returns the created Animation object instance. + @throws DOMError + **/ + @:overload( function( keyframes : Dynamic, ?options : KeyframeAnimationOptions) : Animation {} ) + function animate( keyframes : Dynamic, ?options : Float ) : Animation; + + /** + Returns an array of Animation objects currently active on the element. + **/ + function getAnimations( ?filter : AnimationFilter ) : Array; + /** @throws DOMError */ + @:overload( function( nodes : haxe.extern.Rest) : Void {} ) + function before( nodes : haxe.extern.Rest ) : Void; + /** @throws DOMError */ + @:overload( function( nodes : haxe.extern.Rest) : Void {} ) + function after( nodes : haxe.extern.Rest ) : Void; + /** @throws DOMError */ + @:overload( function( nodes : haxe.extern.Rest) : Void {} ) + function replaceWith( nodes : haxe.extern.Rest ) : Void; + function remove() : Void; + /** @throws DOMError */ + @:overload( function( quad : DOMQuad, from : Element, ?options : ConvertCoordinateOptions) : DOMQuad {} ) + @:overload( function( quad : DOMQuad, from : HTMLDocument, ?options : ConvertCoordinateOptions) : DOMQuad {} ) + function convertQuadFromNode( quad : DOMQuad, from : Text, ?options : ConvertCoordinateOptions ) : DOMQuad; + /** @throws DOMError */ + @:overload( function( rect : DOMRectReadOnly, from : Element, ?options : ConvertCoordinateOptions) : DOMQuad {} ) + @:overload( function( rect : DOMRectReadOnly, from : HTMLDocument, ?options : ConvertCoordinateOptions) : DOMQuad {} ) + function convertRectFromNode( rect : DOMRectReadOnly, from : Text, ?options : ConvertCoordinateOptions ) : DOMQuad; + /** @throws DOMError */ + @:overload( function( point : DOMPointInit, from : Element, ?options : ConvertCoordinateOptions) : DOMPoint {} ) + @:overload( function( point : DOMPointInit, from : HTMLDocument, ?options : ConvertCoordinateOptions) : DOMPoint {} ) + function convertPointFromNode( point : DOMPointInit, from : Text, ?options : ConvertCoordinateOptions ) : DOMPoint; + /** @throws DOMError */ + @:overload( function( nodes : haxe.extern.Rest) : Void {} ) + function prepend( nodes : haxe.extern.Rest ) : Void; + /** @throws DOMError */ + @:overload( function( nodes : haxe.extern.Rest) : Void {} ) + function append( nodes : haxe.extern.Rest ) : Void; +} diff --git a/build/linux64_569e52e/std/js/html/DOMError.hx b/build/linux64_569e52e/std/js/html/DOMError.hx new file mode 100644 index 0000000..d2d100a --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DOMError.hx @@ -0,0 +1,49 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DOMError.webidl. Do not edit! + +package js.html; + +/** + The `DOMError` interface describes an error object that contains an error name. + + Documentation [DOMError](https://developer.mozilla.org/en-US/docs/Web/API/DOMError) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DOMError$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DOMError") +extern class DOMError { + + /** + Returns a `DOMString` representing one of the error type names (see below). + **/ + var name(default,null) : String; + + /** + Returns a `DOMString` representing a message or description associated with the given error type name. + **/ + var message(default,null) : String; + + /** @throws DOMError */ + function new( name : String, message : String = "" ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DOMException.hx b/build/linux64_569e52e/std/js/html/DOMException.hx new file mode 100644 index 0000000..5729e02 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DOMException.hx @@ -0,0 +1,86 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DOMException.webidl. Do not edit! + +package js.html; + +/** + The `DOMException` interface represents an abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API. + + Documentation [DOMException](https://developer.mozilla.org/en-US/docs/Web/API/DOMException) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DOMException$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DOMException") +extern class DOMException { + static inline var INDEX_SIZE_ERR : Int = 1; + static inline var DOMSTRING_SIZE_ERR : Int = 2; + static inline var HIERARCHY_REQUEST_ERR : Int = 3; + static inline var WRONG_DOCUMENT_ERR : Int = 4; + static inline var INVALID_CHARACTER_ERR : Int = 5; + static inline var NO_DATA_ALLOWED_ERR : Int = 6; + static inline var NO_MODIFICATION_ALLOWED_ERR : Int = 7; + static inline var NOT_FOUND_ERR : Int = 8; + static inline var NOT_SUPPORTED_ERR : Int = 9; + static inline var INUSE_ATTRIBUTE_ERR : Int = 10; + static inline var INVALID_STATE_ERR : Int = 11; + static inline var SYNTAX_ERR : Int = 12; + static inline var INVALID_MODIFICATION_ERR : Int = 13; + static inline var NAMESPACE_ERR : Int = 14; + static inline var INVALID_ACCESS_ERR : Int = 15; + static inline var VALIDATION_ERR : Int = 16; + static inline var TYPE_MISMATCH_ERR : Int = 17; + static inline var SECURITY_ERR : Int = 18; + static inline var NETWORK_ERR : Int = 19; + static inline var ABORT_ERR : Int = 20; + static inline var URL_MISMATCH_ERR : Int = 21; + static inline var QUOTA_EXCEEDED_ERR : Int = 22; + static inline var TIMEOUT_ERR : Int = 23; + static inline var INVALID_NODE_TYPE_ERR : Int = 24; + static inline var DATA_CLONE_ERR : Int = 25; + + + /** + Returns a `DOMString` that contains one of the strings associated with an error name. + **/ + var name(default,null) : String; + + /** + Returns a `DOMString` representing a message or description associated with the given error name. + **/ + var message(default,null) : String; + + /** + Returns a `short` that contains one of the `Error codes`, or `0` if none match. This field is used for historical reasons. New DOM exceptions don't use this anymore: they put this info in the `DOMException.name` attribute. + **/ + var code(default,null) : Int; + var result(default,null) : Int; + var filename(default,null) : String; + var lineNumber(default,null) : Int; + var columnNumber(default,null) : Int; + var data(default,null) : Dynamic; + var stack(default,null) : String; + + /** @throws DOMError */ + function new( message : String = "", ?name : String ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DOMImplementation.hx b/build/linux64_569e52e/std/js/html/DOMImplementation.hx new file mode 100644 index 0000000..ae021c8 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DOMImplementation.hx @@ -0,0 +1,59 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DOMImplementation.webidl. Do not edit! + +package js.html; + +/** + The `DOMImplementation` interface represent an object providing methods which are not dependent on any particular document. Such an object is returned by the `Document.implementation` property. + + Documentation [DOMImplementation](https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DOMImplementation") +extern class DOMImplementation { + + /** + Returns a `Boolean` indicating if a given feature is supported or not. This function is unreliable and kept for compatibility purpose alone: except for SVG-related queries, it always returns `true`. Old browsers are very inconsistent in their behavior. + **/ + function hasFeature() : Bool; + + /** + Creates and returns a `DocumentType`. + @throws DOMError + **/ + function createDocumentType( qualifiedName : String, publicId : String, systemId : String ) : DocumentType; + + /** + Creates and returns an `XMLDocument`. + @throws DOMError + **/ + function createDocument( namespace : String, qualifiedName : String, ?doctype : DocumentType ) : HTMLDocument; + + /** + Creates and returns an HTML `Document`. + @throws DOMError + **/ + function createHTMLDocument( ?title : String ) : HTMLDocument; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DOMMatrix.hx b/build/linux64_569e52e/std/js/html/DOMMatrix.hx new file mode 100644 index 0000000..988908c --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DOMMatrix.hx @@ -0,0 +1,101 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DOMMatrix.webidl. Do not edit! + +package js.html; + +/** + The `DOMMatrix` interface represents 4x4 matrices, suitable for 2D and 3D operations. + + Documentation [DOMMatrix](https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrix) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrix$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DOMMatrix") +extern class DOMMatrix extends DOMMatrixReadOnly { + /** @throws DOMError */ + @:overload( function() : Void {} ) + @:overload( function( transformList : String ) : Void {} ) + @:overload( function( other : DOMMatrixReadOnly ) : Void {} ) + @:overload( function( array32 : js.lib.Float32Array ) : Void {} ) + @:overload( function( array64 : js.lib.Float64Array ) : Void {} ) + function new( numberSequence : Array ) : Void; + function multiplySelf( other : DOMMatrix ) : DOMMatrix; + function preMultiplySelf( other : DOMMatrix ) : DOMMatrix; + + /** + Returns itself, a `DOMMatrix`, with its new content being the result of the matrix being translated by the given vector. + **/ + function translateSelf( tx : Float, ty : Float, tz : Float = 0.0 ) : DOMMatrix; + + /** + Returns itself, a `DOMMatrix`, with its new content being the result of the matrix x and y dimensions being scaled by the given factor, centered on the origin given. + **/ + function scaleSelf( scale : Float, originX : Float = 0.0, originY : Float = 0.0 ) : DOMMatrix; + + /** + Returns itself, a `DOMMatrix`, with its new content being the result of the matrix x, y and z dimension being scaled by the given factor, centered on the origin given. + **/ + function scale3dSelf( scale : Float, originX : Float = 0.0, originY : Float = 0.0, originZ : Float = 0.0 ) : DOMMatrix; + + /** + Returns itself, a `DOMMatrix`, with its new content being the result of the matrix x, y and z dimension being scaled by the given factor for each dimension, centered on the origin given. + **/ + function scaleNonUniformSelf( scaleX : Float, scaleY : Float = 1.0, scaleZ : Float = 1.0, originX : Float = 0.0, originY : Float = 0.0, originZ : Float = 0.0 ) : DOMMatrix; + + /** + Returns itself, a `DOMMatrix`, with its new content being the result of the original matrix being rotated by the given angle, with the rotation centered on the origin given. + **/ + function rotateSelf( angle : Float, originX : Float = 0.0, originY : Float = 0.0 ) : DOMMatrix; + + /** + Returns itself, a `DOMMatrix`, with its new content being the result of the original matrix being rotated by the angle between the given vector and (1,0), centered on the origin given. + **/ + function rotateFromVectorSelf( x : Float, y : Float ) : DOMMatrix; + + /** + Returns itself, a `DOMMatrix`, with its new content being the result of the original matrix being rotated by the given angle and the give vector. + **/ + function rotateAxisAngleSelf( x : Float, y : Float, z : Float, angle : Float ) : DOMMatrix; + + /** + Returns itself, a `DOMMatrix`, with its new content being the result of the original matrix being skewed along the x-axis by the given factor. + **/ + function skewXSelf( sx : Float ) : DOMMatrix; + + /** + Returns itself, a `DOMMatrix`, with its new content being the result of the original matrix being skewed along the y-axis by the given factor. + **/ + function skewYSelf( sy : Float ) : DOMMatrix; + + /** + Returns itself,  a `DOMMatrix`, with its new content being the result of the original matrix being inverted. If the matrix cannot be inverted, all its components are set to `NaN` and `is2D()` returns `false`. + **/ + function invertSelf() : DOMMatrix; + + /** + Returns itself, a `DOMMatrix`, with its describing the matrix representing the same transformation as the CSS `transform` functions given in parameter. + @throws DOMError + **/ + function setMatrixValue( transformList : String ) : DOMMatrix; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DOMMatrixReadOnly.hx b/build/linux64_569e52e/std/js/html/DOMMatrixReadOnly.hx new file mode 100644 index 0000000..9d53f65 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DOMMatrixReadOnly.hx @@ -0,0 +1,202 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DOMMatrix.webidl. Do not edit! + +package js.html; + +/** + The `DOMMatrixReadOnly` interface represents 4x4 matrices, suitable for 2D and 3D operations. If this interface defines only read-only matrices, the `DOMMatrix` interface which inherits from it, add all the properties and the methods to allow to have modifiable matrices. + + Documentation [DOMMatrixReadOnly](https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrixReadOnly) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrixReadOnly$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DOMMatrixReadOnly") +extern class DOMMatrixReadOnly { + + /** + Are double representing each component of a 4x4 matrix needed for 2D rotations and translations. They are aliases for some components of the 4x4 matrix: + + + + 2D + 3D equivalent + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
am11
bm12
cm21
dm22
em41
fm42
+ They are read-only, but their counterpart, with the same name, in DOMMatrix aren't. + **/ + var a(default,null) : Float; + var b(default,null) : Float; + var c(default,null) : Float; + var d(default,null) : Float; + var e(default,null) : Float; + var f(default,null) : Float; + + /** + Are `double` representing each component of a 4x4 matrix. They are read-only, but their counterpart, with the same name, in `DOMMatrix` aren't. + **/ + var m11(default,null) : Float; + var m12(default,null) : Float; + var m13(default,null) : Float; + var m14(default,null) : Float; + var m21(default,null) : Float; + var m22(default,null) : Float; + var m23(default,null) : Float; + var m24(default,null) : Float; + var m31(default,null) : Float; + var m32(default,null) : Float; + var m33(default,null) : Float; + var m34(default,null) : Float; + var m41(default,null) : Float; + var m42(default,null) : Float; + var m43(default,null) : Float; + var m44(default,null) : Float; + + /** + Is a `Boolean` indicating if the matrix contains a 2D matrix and only accept 2D transformations. + **/ + var is2D(default,null) : Bool; + + /** + Is a `Boolean` indincating if the matrix identity, that is a matrix with `1` on the components of its diagonal, and `0` elsewhere. + **/ + var isIdentity(default,null) : Bool; + + /** @throws DOMError */ + @:overload( function( ?init : Array) : DOMMatrixReadOnly {} ) + function new( ?init : String ) : Void; + + /** + Returns a `DOMMatrix` containing a new matrix being the result of the matrix being translated by the given vector. The original matrix is not modified. + **/ + function translate( tx : Float, ty : Float, tz : Float = 0.0 ) : DOMMatrix; + + /** + Returns a `DOMMatrix` containing a new matrix being the result of the matrix x and y dimensions being scaled by the given factor, centered on the origin given. The original matrix is not modified. + **/ + function scale( scale : Float, originX : Float = 0.0, originY : Float = 0.0 ) : DOMMatrix; + + /** + Returns a `DOMMatrix` containing a new matrix being the result of the matrix x, y and z dimension being scaled by the given factor, centered on the origin given. The original matrix is not modified. + **/ + function scale3d( scale : Float, originX : Float = 0.0, originY : Float = 0.0, originZ : Float = 0.0 ) : DOMMatrix; + + /** + Returns a `DOMMatrix` containing a new matrix being the result of the matrix x, y and z dimension being scaled by the given factor for each dimension, centered on the origin given. The original matrix is not modified. + **/ + function scaleNonUniform( scaleX : Float, scaleY : Float = 1.0, scaleZ : Float = 1.0, originX : Float = 0.0, originY : Float = 0.0, originZ : Float = 0.0 ) : DOMMatrix; + + /** + Returns a `DOMMatrix` containing a new matrix being the result of the original matrix being rotated by the given angle, with the rotation centered on the origin given. The original matrix is not modified. + **/ + function rotate( angle : Float, originX : Float = 0.0, originY : Float = 0.0 ) : DOMMatrix; + + /** + Returns a `DOMMatrix` containing a new matrix being the result of the original matrix being rotated by the angle between the given vector and (1,0), centered on the origin given. The original matrix is not modified. + **/ + function rotateFromVector( x : Float, y : Float ) : DOMMatrix; + + /** + Returns a `DOMMatrix` containing a new matrix being the result of the original matrix being rotated by the given angle and the given vector. The original matrix is not modified. + **/ + function rotateAxisAngle( x : Float, y : Float, z : Float, angle : Float ) : DOMMatrix; + + /** + Returns a `DOMMatrix` containing a new matrix being the result of the original matrix being skewed along the x-axis by the given factor. The original matrix is not modified. + **/ + function skewX( sx : Float ) : DOMMatrix; + + /** + Returns a `DOMMatrix` containing a new matrix being the result of the original matrix being skewed along the y-axis by the given factor. The original matrix is not modified. + **/ + function skewY( sy : Float ) : DOMMatrix; + + /** + Returns a `DOMMatrix` containing a new matrix being the result of the original matrix being multiplied by the given `DOMMatrix`. The original matrix is not modified. + **/ + function multiply( other : DOMMatrix ) : DOMMatrix; + + /** + Returns a `DOMMatrix` containing a new matrix being the result of the original matrix being flipped around the x-axis, that is multiplied by the `DOMMatrix(-1, 0, 0, 1, 0, 0)`. The original matrix is not modified. + **/ + function flipX() : DOMMatrix; + + /** + Returns a `DOMMatrix` containing a new matrix being the result of the original matrix being flipped around the y-axis, that is multiplied by the `DOMMatrix(1, 0, 0, -1, 0, 0)`. The original matrix is not modified. + **/ + function flipY() : DOMMatrix; + + /** + Returns a `DOMMatrix` containing a new matrix being the result of the original matrix being inverted. The original matrix is not modified. If the matrix cannot be inverted, all its components are set to `NaN` and `is2D()` returns `false`. + **/ + function inverse() : DOMMatrix; + + /** + Returns a `DOMPoint` that is the point given in parameter multiplied by the matrix. But the original point and the matrix aren't modified. + **/ + function transformPoint( ?point : DOMPointInit ) : DOMPoint; + + /** + Returns a `Float32Array` containing the 6 components (`a`, `b`, `c`, `d`, `e`, `f`) in the case of a 2D matrix or the 16 components (`m11`, `m12`, `m13`, `m14`, `m21`, `m22`, `m23`, `m24`, `m31`, `m32`, `m33`, `m34`, `m41`, `m42`, `m43`, `m44`) for a 3D matrix. + @throws DOMError + **/ + function toFloat32Array() : js.lib.Float32Array; + + /** + Returns a `Float64Array` containing the 6 components (`a`, `b`, `c`, `d`, `e`, `f`) in the case of a 2D matrix or the 16 components (`m11`, `m12`, `m13`, `m14`, `m21`, `m22`, `m23`, `m24`, `m31`, `m32`, `m33`, `m34`, `m41`, `m42`, `m43`, `m44`) for a 3D matrix. + @throws DOMError + **/ + function toFloat64Array() : js.lib.Float64Array; + + /** + Returns a JSON representation of the `DOMMatrixReadOnly` object. + **/ + function toJSON() : Dynamic; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DOMParser.hx b/build/linux64_569e52e/std/js/html/DOMParser.hx new file mode 100644 index 0000000..23ac2fa --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DOMParser.hx @@ -0,0 +1,40 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DOMParser.webidl. Do not edit! + +package js.html; + +/** + The `DOMParser` interface provides the ability to parse XML or HTML source code from a string into a DOM `Document`. + + Documentation [DOMParser](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DOMParser") +extern class DOMParser { + /** @throws DOMError */ + function new() : Void; + /** @throws DOMError */ + function parseFromString( str : String, type : SupportedType ) : HTMLDocument; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DOMPoint.hx b/build/linux64_569e52e/std/js/html/DOMPoint.hx new file mode 100644 index 0000000..efc7962 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DOMPoint.hx @@ -0,0 +1,39 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DOMPoint.webidl. Do not edit! + +package js.html; + +/** + A `DOMPoint` object represents a 2D or 3D point in a coordinate system; it includes values for the coordinates in up to three dimensions, as well as an optional perspective value. + + Documentation [DOMPoint](https://developer.mozilla.org/en-US/docs/Web/API/DOMPoint) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DOMPoint$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DOMPoint") +extern class DOMPoint extends DOMPointReadOnly { + static function fromPoint( ?other : DOMPointInit ) : DOMPoint; + /** @throws DOMError */ + function new( x : Float = 0.0, y : Float = 0.0, z : Float = 0.0, w : Float = 1.0 ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DOMPointInit.hx b/build/linux64_569e52e/std/js/html/DOMPointInit.hx new file mode 100644 index 0000000..0c013b6 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DOMPointInit.hx @@ -0,0 +1,55 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DOMPoint.webidl. Do not edit! + +package js.html; + +/** + The `DOMPointInit` dictionary is used to provide the values of the coordinates and perspective when creating and JSONifying a `DOMPoint` or `DOMPointReadOnly` object. + + Documentation [DOMPointInit](https://developer.mozilla.org/en-US/docs/Web/API/DOMPointInit) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DOMPointInit$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +typedef DOMPointInit = { + + /** + The point's w perspective value given as an unrestricted floating-point number. The default is 1. + **/ + var ?w : Float; + + /** + An unrestricted floating-point value indicating the x-coordinate of the point in space. This is generally the horizontal coordinate, with positive values being to the right and negative values to the left. The default value is 0. + **/ + var ?x : Float; + + /** + An unrestricted floating-point number providing the point's y-coordinate. This is the vertical coordinate, and barring any transforms applied to the coordinate system, positive values are downward and negative values upward toward the top of the screen. The default is 0. + **/ + var ?y : Float; + + /** + An unrestricted floating-point value which gives the point's z-coordinate, which is (assuming no transformations that alter the situation) the depth coordinate; positive values are closer to the user and negative values retreat back into the screen. The default value is 0. + **/ + var ?z : Float; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DOMPointReadOnly.hx b/build/linux64_569e52e/std/js/html/DOMPointReadOnly.hx new file mode 100644 index 0000000..ea0d32a --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DOMPointReadOnly.hx @@ -0,0 +1,65 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DOMPoint.webidl. Do not edit! + +package js.html; + +/** + The `DOMPointReadOnly` interface specifies the coordinate and perspective fields used by `DOMPoint` to define a 2D or 3D point in a coordinate system. + + Documentation [DOMPointReadOnly](https://developer.mozilla.org/en-US/docs/Web/API/DOMPointReadOnly) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DOMPointReadOnly$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DOMPointReadOnly") +extern class DOMPointReadOnly { + static function fromPoint( ?other : DOMPointInit ) : DOMPointReadOnly; + + /** + The point's horizontal coordinate, `x`. + **/ + var x(default,null) : Float; + + /** + The point's vertical coordinate, `y`. + **/ + var y(default,null) : Float; + + /** + The point's depth coordinate, `z`. + **/ + var z(default,null) : Float; + + /** + The point's perspective value, `w`. + **/ + var w(default,null) : Float; + + /** @throws DOMError */ + function new( x : Float = 0.0, y : Float = 0.0, z : Float = 0.0, w : Float = 1.0 ) : Void; + + /** + Returns a JSON representation of the `DOMPointReadOnly` object. + **/ + function toJSON() : Dynamic; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DOMQuad.hx b/build/linux64_569e52e/std/js/html/DOMQuad.hx new file mode 100644 index 0000000..003bf1f --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DOMQuad.hx @@ -0,0 +1,59 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DOMQuad.webidl. Do not edit! + +package js.html; + +/** + A `DOMQuad` is a collection of four `DOMPoint`s defining the corners of an arbitrary quadrilateral. Returning `DOMQuad`s lets `getBoxQuads()` return accurate information even when arbitrary 2D or 3D transforms are present. It has a handy `bounds` attribute returning a `DOMRectReadOnly` for those cases where you just want an axis-aligned bounding rectangle. + + Documentation [DOMQuad](https://developer.mozilla.org/en-US/docs/Web/API/DOMQuad) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DOMQuad$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DOMQuad") +extern class DOMQuad { + + /** + are `DOMPoint` objects for each of the `DOMQuad` object's four corners. + **/ + var p1(default,null) : DOMPoint; + var p2(default,null) : DOMPoint; + var p3(default,null) : DOMPoint; + var p4(default,null) : DOMPoint; + var bounds(default,null) : DOMRectReadOnly; + + /** @throws DOMError */ + @:overload( function( ?p1 : DOMPointInit, ?p2 : DOMPointInit, ?p3 : DOMPointInit, ?p4 : DOMPointInit ) : Void {} ) + function new( rect : DOMRectReadOnly ) : Void; + + /** + Returns a `DOMRect` object with the coordinates and dimensions of the `DOMQuad` object. + **/ + function getBounds() : DOMRectReadOnly; + + /** + Returns a JSON representation of the `DOMQuad` object. + **/ + function toJSON() : DOMQuadJSON; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DOMQuadJSON.hx b/build/linux64_569e52e/std/js/html/DOMQuadJSON.hx new file mode 100644 index 0000000..7f934fe --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DOMQuadJSON.hx @@ -0,0 +1,32 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DOMQuad.webidl. Do not edit! + +package js.html; + +typedef DOMQuadJSON = { + var ?p1 : DOMPoint; + var ?p2 : DOMPoint; + var ?p3 : DOMPoint; + var ?p4 : DOMPoint; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DOMRect.hx b/build/linux64_569e52e/std/js/html/DOMRect.hx new file mode 100644 index 0000000..ee6a154 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DOMRect.hx @@ -0,0 +1,38 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DOMRect.webidl. Do not edit! + +package js.html; + +/** + A `DOMRect` represents a rectangle. + + Documentation [DOMRect](https://developer.mozilla.org/en-US/docs/Web/API/DOMRect) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DOMRect$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DOMRect") +extern class DOMRect extends DOMRectReadOnly { + /** @throws DOMError */ + function new( x : Float = 0.0, y : Float = 0.0, width : Float = 0.0, height : Float = 0.0 ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DOMRectList.hx b/build/linux64_569e52e/std/js/html/DOMRectList.hx new file mode 100644 index 0000000..582a849 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DOMRectList.hx @@ -0,0 +1,32 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DOMRectList.webidl. Do not edit! + +package js.html; + +@:native("DOMRectList") +extern class DOMRectList implements ArrayAccess { + var length(default,null) : Int; + + function item( index : Int ) : DOMRect; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DOMRectReadOnly.hx b/build/linux64_569e52e/std/js/html/DOMRectReadOnly.hx new file mode 100644 index 0000000..f12cbe6 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DOMRectReadOnly.hx @@ -0,0 +1,80 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DOMRect.webidl. Do not edit! + +package js.html; + +/** + The `DOMRectReadOnly` interface specifies the standard properties used by `DOMRect` to define a rectangle. + + Documentation [DOMRectReadOnly](https://developer.mozilla.org/en-US/docs/Web/API/DOMRectReadOnly) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DOMRectReadOnly$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DOMRectReadOnly") +extern class DOMRectReadOnly { + + /** + The x coordinate of the `DOMRect`'s origin. + **/ + var x(default,null) : Float; + + /** + The y coordinate of the `DOMRect`'s origin. + **/ + var y(default,null) : Float; + + /** + The width of the `DOMRect`. + **/ + var width(default,null) : Float; + + /** + The height of the `DOMRect`. + **/ + var height(default,null) : Float; + + /** + Returns the top coordinate value of the `DOMRect` (usually the same as `y`.) + **/ + var top(default,null) : Float; + + /** + Returns the right coordinate value of the `DOMRect` (usually the same as `x + width`). + **/ + var right(default,null) : Float; + + /** + Returns the bottom coordinate value of the `DOMRect` (usually the same as y + height). + **/ + var bottom(default,null) : Float; + + /** + Returns the left coordinate value of the `DOMRect` (usually the same as `x`). + **/ + var left(default,null) : Float; + + /** @throws DOMError */ + function new( x : Float = 0.0, y : Float = 0.0, width : Float = 0.0, height : Float = 0.0 ) : Void; + function toJSON() : Dynamic; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DOMRequest.hx b/build/linux64_569e52e/std/js/html/DOMRequest.hx new file mode 100644 index 0000000..630bc86 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DOMRequest.hx @@ -0,0 +1,37 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DOMRequest.webidl. Do not edit! + +package js.html; + +@:native("DOMRequest") +extern class DOMRequest extends EventTarget { + var readyState(default,null) : DOMRequestReadyState; + var result(default,null) : Dynamic; + var error(default,null) : DOMException; + var onsuccess : haxe.Constraints.Function; + var onerror : haxe.Constraints.Function; + + /** @throws DOMError */ + function then( ?fulfillCallback : haxe.Constraints.Function, ?rejectCallback : haxe.Constraints.Function ) : Dynamic; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DOMRequestReadyState.hx b/build/linux64_569e52e/std/js/html/DOMRequestReadyState.hx new file mode 100644 index 0000000..0fbe5cc --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DOMRequestReadyState.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DOMRequest.webidl. Do not edit! + +package js.html; + +enum abstract DOMRequestReadyState(String) { + var PENDING = "pending"; + var DONE = "done"; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DOMStringList.hx b/build/linux64_569e52e/std/js/html/DOMStringList.hx new file mode 100644 index 0000000..199603a --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DOMStringList.hx @@ -0,0 +1,52 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DOMStringList.webidl. Do not edit! + +package js.html; + +/** + A type returned by some APIs which contains a list of DOMString (strings). + + Documentation [DOMStringList](https://developer.mozilla.org/en-US/docs/Web/API/DOMStringList) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DOMStringList$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DOMStringList") +extern class DOMStringList implements ArrayAccess { + + /** + Returns the length of the list, + **/ + var length(default,null) : Int; + + + /** + Returns a `DOMString`. + **/ + function item( index : Int ) : String; + + /** + Returns `Boolean` indicating if the given string is in the list + **/ + function contains( string : String ) : Bool; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DOMStringMap.hx b/build/linux64_569e52e/std/js/html/DOMStringMap.hx new file mode 100644 index 0000000..d80115f --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DOMStringMap.hx @@ -0,0 +1,36 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DOMStringMap.webidl. Do not edit! + +package js.html; + +/** + Used by the `dataset` HTML attribute to represent data for custom attributes added to elements. + + Documentation [DOMStringMap](https://developer.mozilla.org/en-US/docs/Web/API/DOMStringMap) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DOMStringMap$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DOMStringMap") +extern class DOMStringMap implements Dynamic { +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DOMTokenList.hx b/build/linux64_569e52e/std/js/html/DOMTokenList.hx new file mode 100644 index 0000000..4c2423c --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DOMTokenList.hx @@ -0,0 +1,87 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DOMTokenList.webidl. Do not edit! + +package js.html; + +/** + The `DOMTokenList` interface represents a set of space-separated tokens. Such a set is returned by `Element.classList`, `HTMLLinkElement.relList`, `HTMLAnchorElement.relList`, `HTMLAreaElement.relList`, `HTMLIframeElement.sandbox`, or `HTMLOutputElement.htmlFor`. It is indexed beginning with `0` as with JavaScript `Array` objects. `DOMTokenList` is always case-sensitive. + + Documentation [DOMTokenList](https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DOMTokenList") +extern class DOMTokenList implements ArrayAccess { + + /** + Is an `integer` representing the number of objects stored in the object. + **/ + var length(default,null) : Int; + + /** + The value of the list as a `DOMString`. + **/ + var value : String; + + + /** + Returns an item in the list by its index (returns undefined if the number is greater than or equal to the length of the list). + **/ + function item( index : Int ) : String; + + /** + Returns `true` if the list contains the given token, otherwise `false`. + **/ + function contains( token : String ) : Bool; + + /** + Adds the given token to the list. + @throws DOMError + **/ + function add( tokens : haxe.extern.Rest ) : Void; + + /** + Removes the specified token from the list. + @throws DOMError + **/ + function remove( tokens : haxe.extern.Rest ) : Void; + + /** + Replaces an existing token with a new token. + @throws DOMError + **/ + function replace( token : String, newToken : String ) : Bool; + + /** + Removes a given token from the list and returns false. If token doesn't exist it's added and the function returns `true`. + @throws DOMError + **/ + function toggle( token : String, ?force : Bool ) : Bool; + + /** + Returns `true` if a given token is in the associated attribute's supported tokens. + @throws DOMError + **/ + function supports( token : String ) : Bool; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DataElement.hx b/build/linux64_569e52e/std/js/html/DataElement.hx new file mode 100644 index 0000000..ac53859 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DataElement.hx @@ -0,0 +1,42 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLDataElement.webidl. Do not edit! + +package js.html; + +/** + The `HTMLDataElement` interface provides special properties (beyond the regular `HTMLElement` interface it also has available to it by inheritance) for manipulating `data` elements. + + Documentation [HTMLDataElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDataElement) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDataElement$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("HTMLDataElement") +extern class DataElement extends Element { + + /** + Is a `DOMString` reflecting the `value` HTML attribute, containing a machine-readable form of the element's value. + **/ + var value : String; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DataListElement.hx b/build/linux64_569e52e/std/js/html/DataListElement.hx new file mode 100644 index 0000000..f29888d --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DataListElement.hx @@ -0,0 +1,42 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLDataListElement.webidl. Do not edit! + +package js.html; + +/** + The `HTMLDataListElement` interface provides special properties (beyond the `HTMLElement` object interface it also has available to it by inheritance) to manipulate `datalist` elements and their content. + + Documentation [HTMLDataListElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDataListElement) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDataListElement$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("HTMLDataListElement") +extern class DataListElement extends Element { + + /** + Is a `HTMLCollection` representing a collection of the contained option elements. + **/ + var options(default,null) : HTMLCollection; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DataTransfer.hx b/build/linux64_569e52e/std/js/html/DataTransfer.hx new file mode 100644 index 0000000..c296a87 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DataTransfer.hx @@ -0,0 +1,93 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DataTransfer.webidl. Do not edit! + +package js.html; + +/** + The `DataTransfer` object is used to hold the data that is being dragged during a drag and drop operation. It may hold one or more data items, each of one or more data types. For more information about drag and drop, see HTML Drag and Drop API. + + Documentation [DataTransfer](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DataTransfer") +extern class DataTransfer { + + /** + Gets the type of drag-and-drop operation currently selected or sets the operation to a new type. The value must be `none`, `copy`, `link` or `move`. + **/ + var dropEffect : String; + + /** + Provides all of the types of operations that are possible. Must be one of `none`, `copy`, `copyLink`, `copyMove`, `link`, `linkMove`, `move`, `all` or `uninitialized`. + **/ + var effectAllowed : String; + + /** + Gives a `DataTransferItemList` object which is a list of all of the drag data. + **/ + var items(default,null) : DataTransferItemList; + + /** + An array of `DOMString` giving the formats that were set in the `dragstart` event. + **/ + var types(default,null) : Array; + + /** + Contains a list of all the local files available on the data transfer. If the drag operation doesn't involve dragging files, this property is an empty list. + **/ + var files(default,null) : FileList; + + /** @throws DOMError */ + function new() : Void; + + /** + Set the image to be used for dragging if a custom one is desired. + **/ + function setDragImage( image : Element, x : Int, y : Int ) : Void; + + /** + Retrieves the data for a given type, or an empty string if data for that type does not exist or the data transfer contains no data. + @throws DOMError + **/ + function getData( format : String ) : String; + + /** + Set the data for a given type. If data for the type does not exist, it is added at the end, such that the last item in the types list will be the new format. If data for the type already exists, the existing data is replaced in the same position. + @throws DOMError + **/ + function setData( format : String, data : String ) : Void; + + /** + Remove the data associated with a given type. The type argument is optional. If the type is empty or not specified, the data associated with all types is removed. If data for the specified type does not exist, or the data transfer contains no data, this method will have no effect. + @throws DOMError + **/ + function clearData( ?format : String ) : Void; + + /** + Sets the drag source to the given element. + @throws DOMError + **/ + function addElement( element : Element ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DataTransferItem.hx b/build/linux64_569e52e/std/js/html/DataTransferItem.hx new file mode 100644 index 0000000..294fbf0 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DataTransferItem.hx @@ -0,0 +1,59 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DataTransferItem.webidl. Do not edit! + +package js.html; + +/** + The `DataTransferItem` object represents one drag data item. During a drag operation, each `drag event` has a `dataTransfer` property which contains a `list` of drag data items. Each item in the list is a `DataTransferItem` object. + + Documentation [DataTransferItem](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DataTransferItem") +extern class DataTransferItem { + + /** + The kind of drag data item, `string` or `file`. + **/ + var kind(default,null) : String; + + /** + The drag data item's type, typically a MIME type. + **/ + var type(default,null) : String; + + + /** + Invokes the specified callback with the drag data item string as its argument. + @throws DOMError + **/ + function getAsString( callback : String -> Void ) : Void; + + /** + Returns the `File` object associated with the drag data item (or null if the drag item is not a file). + @throws DOMError + **/ + function getAsFile() : File; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DataTransferItemList.hx b/build/linux64_569e52e/std/js/html/DataTransferItemList.hx new file mode 100644 index 0000000..74ca826 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DataTransferItemList.hx @@ -0,0 +1,61 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DataTransferItemList.webidl. Do not edit! + +package js.html; + +/** + The `DataTransferItemList` object is a list of `DataTransferItem` objects representing items being dragged. During a drag operation, each `DragEvent` has a `dataTransfer` property and that property is a `DataTransferItemList`. + + Documentation [DataTransferItemList](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DataTransferItemList") +extern class DataTransferItemList implements ArrayAccess { + + /** + An `unsigned long` that is the number of drag items in the list. + **/ + var length(default,null) : Int; + + + /** + Adds an item (either a `File` object or a `DOMString`) to the drag item list and returns a `DataTransferItem` object for the new item. + @throws DOMError + **/ + @:overload( function( data : String, type : String ) : DataTransferItem {} ) + function add( data : File ) : DataTransferItem; + + /** + Removes the drag item from the list at the given index. + @throws DOMError + **/ + function remove( index : Int ) : Void; + + /** + Removes all of the drag items from the list. + @throws DOMError + **/ + function clear() : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DataView.hx b/build/linux64_569e52e/std/js/html/DataView.hx new file mode 100644 index 0000000..9c7af11 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DataView.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package js.html; + +@:deprecated typedef DataView = js.lib.DataView; diff --git a/build/linux64_569e52e/std/js/html/DedicatedWorkerGlobalScope.hx b/build/linux64_569e52e/std/js/html/DedicatedWorkerGlobalScope.hx new file mode 100644 index 0000000..fc9e709 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DedicatedWorkerGlobalScope.hx @@ -0,0 +1,63 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DedicatedWorkerGlobalScope.webidl. Do not edit! + +package js.html; + +/** + The `DedicatedWorkerGlobalScope` object (the `Worker` global scope) is accessible through the `self` keyword. Some additional global functions, namespaces objects, and constructors, not typically associated with the worker global scope, but available on it, are listed in the JavaScript Reference. See also: Functions available to workers. + + Documentation [DedicatedWorkerGlobalScope](https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DedicatedWorkerGlobalScope") +extern class DedicatedWorkerGlobalScope extends WorkerGlobalScope { + + /** + The name that the `Worker` was (optionally) given when it was created using the `Worker.Worker` constructor. This is mainly useful for debugging purposes. + **/ + var name(default,null) : String; + + /** + Is an `EventHandler` representing the code to be called when the `message` event is raised. These events are of type `MessageEvent` and will be called when the worker receives a message from the document that started it (i.e. from the `Worker.postMessage` method.) + **/ + var onmessage : haxe.Constraints.Function; + + /** + Is an `EventHandler` representing the code to be called when the `messageerror` event is raised. + **/ + var onmessageerror : haxe.Constraints.Function; + + + /** + Sends a message — which can consist of `any` JavaScript object — to the parent document that first spawned the worker. + @throws DOMError + **/ + function postMessage( message : Dynamic, ?transfer : Array ) : Void; + + /** + Discards any tasks queued in the `WorkerGlobalScope`'s event loop, effectively closing this particular scope. + **/ + function close() : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DetailsElement.hx b/build/linux64_569e52e/std/js/html/DetailsElement.hx new file mode 100644 index 0000000..6f24611 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DetailsElement.hx @@ -0,0 +1,42 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLDetailsElement.webidl. Do not edit! + +package js.html; + +/** + The `HTMLDetailsElement` interface provides special properties (beyond the regular `HTMLElement` interface it also has available to it by inheritance) for manipulating `details` elements. + + Documentation [HTMLDetailsElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDetailsElement) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDetailsElement$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("HTMLDetailsElement") +extern class DetailsElement extends Element { + + /** + Is a `boolean` reflecting the `open` HTML attribute, indicating whether or not the element’s contents (not counting the `summary`) is to be shown to the user. + **/ + var open : Bool; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DeviceAcceleration.hx b/build/linux64_569e52e/std/js/html/DeviceAcceleration.hx new file mode 100644 index 0000000..9b82d24 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DeviceAcceleration.hx @@ -0,0 +1,51 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DeviceMotionEvent.webidl. Do not edit! + +package js.html; + +/** + A `DeviceAcceleration` object provides information about the amount of acceleration the device is experiencing along all three axes. + + Documentation [DeviceAcceleration](https://developer.mozilla.org/en-US/docs/Web/API/DeviceAcceleration) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DeviceAcceleration$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +typedef DeviceAcceleration = { + + /** + The amount of acceleration along the X axis. Read only. + **/ + var x(default,null) : Float; + + /** + The amount of acceleration along the Y axis. Read only. + **/ + var y(default,null) : Float; + + /** + The amount of acceleration along the Z axis. Read only. + **/ + var z(default,null) : Float; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DeviceAccelerationInit.hx b/build/linux64_569e52e/std/js/html/DeviceAccelerationInit.hx new file mode 100644 index 0000000..6407388 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DeviceAccelerationInit.hx @@ -0,0 +1,31 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DeviceMotionEvent.webidl. Do not edit! + +package js.html; + +typedef DeviceAccelerationInit = { + var ?x : Float; + var ?y : Float; + var ?z : Float; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DeviceMotionEvent.hx b/build/linux64_569e52e/std/js/html/DeviceMotionEvent.hx new file mode 100644 index 0000000..9b2fd0e --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DeviceMotionEvent.hx @@ -0,0 +1,60 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DeviceMotionEvent.webidl. Do not edit! + +package js.html; + +/** + The `DeviceMotionEvent` provides web developers with information about the speed of changes for the device's position and orientation. + + Documentation [DeviceMotionEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceMotionEvent) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DeviceMotionEvent$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DeviceMotionEvent") +extern class DeviceMotionEvent extends Event { + + /** + An object giving the acceleration of the device on the three axis X, Y and Z. Acceleration is expressed in m/s2. + **/ + var acceleration(default,null) : DeviceAcceleration; + + /** + An object giving the acceleration of the device on the three axis X, Y and Z with the effect of gravity. Acceleration is expressed in m/s2. + **/ + var accelerationIncludingGravity(default,null) : DeviceAcceleration; + + /** + An object giving the rate of change of the device's orientation on the three orientation axis alpha, beta and gamma. Rotation rate is expressed in degrees per seconds. + **/ + var rotationRate(default,null) : DeviceRotationRate; + + /** + A number representing the interval of time, in milliseconds, at which data is obtained from the device. + **/ + var interval(default,null) : Float; + + /** @throws DOMError */ + function new( type : String, ?eventInitDict : DeviceMotionEventInit ) : Void; + function initDeviceMotionEvent( type : String, canBubble : Bool = false, cancelable : Bool = false, ?acceleration : DeviceAccelerationInit, ?accelerationIncludingGravity : DeviceAccelerationInit, ?rotationRate : DeviceRotationRateInit, ?interval : Float ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DeviceMotionEventInit.hx b/build/linux64_569e52e/std/js/html/DeviceMotionEventInit.hx new file mode 100644 index 0000000..a12ba42 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DeviceMotionEventInit.hx @@ -0,0 +1,32 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DeviceMotionEvent.webidl. Do not edit! + +package js.html; + +typedef DeviceMotionEventInit = EventInit & { + var ?acceleration : DeviceAccelerationInit; + var ?accelerationIncludingGravity : DeviceAccelerationInit; + var ?interval : Float; + var ?rotationRate : DeviceRotationRateInit; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DeviceOrientationEvent.hx b/build/linux64_569e52e/std/js/html/DeviceOrientationEvent.hx new file mode 100644 index 0000000..abd1775 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DeviceOrientationEvent.hx @@ -0,0 +1,60 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DeviceOrientationEvent.webidl. Do not edit! + +package js.html; + +/** + The `DeviceOrientationEvent` provides web developers with information from the physical orientation of the device running the web page. + + Documentation [DeviceOrientationEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DeviceOrientationEvent") +extern class DeviceOrientationEvent extends Event { + + /** + A number representing the motion of the device around the z axis, express in degrees with values ranging from 0 to 360. + **/ + var alpha(default,null) : Float; + + /** + A number representing the motion of the device around the x axis, express in degrees with values ranging from -180 to 180. This represents a front to back motion of the device. + **/ + var beta(default,null) : Float; + + /** + A number representing the motion of the device around the y axis, express in degrees with values ranging from -90 to 90. This represents a left to right motion of the device. + **/ + var gamma(default,null) : Float; + + /** + A boolean that indicates whether or not the device is providing orientation data absolutely. + **/ + var absolute(default,null) : Bool; + + /** @throws DOMError */ + function new( type : String, ?eventInitDict : DeviceOrientationEventInit ) : Void; + function initDeviceOrientationEvent( type : String, canBubble : Bool = false, cancelable : Bool = false, ?alpha : Float, ?beta : Float, ?gamma : Float, absolute : Bool = false ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DeviceOrientationEventInit.hx b/build/linux64_569e52e/std/js/html/DeviceOrientationEventInit.hx new file mode 100644 index 0000000..34d7f7b --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DeviceOrientationEventInit.hx @@ -0,0 +1,32 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DeviceOrientationEvent.webidl. Do not edit! + +package js.html; + +typedef DeviceOrientationEventInit = EventInit & { + var ?absolute : Bool; + var ?alpha : Float; + var ?beta : Float; + var ?gamma : Float; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DeviceRotationRate.hx b/build/linux64_569e52e/std/js/html/DeviceRotationRate.hx new file mode 100644 index 0000000..dd6d6f5 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DeviceRotationRate.hx @@ -0,0 +1,51 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DeviceMotionEvent.webidl. Do not edit! + +package js.html; + +/** + A `DeviceRotationRate` object provides information about the rate at which the device is rotating around all three axes. + + Documentation [DeviceRotationRate](https://developer.mozilla.org/en-US/docs/Web/API/DeviceRotationRate) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DeviceRotationRate$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +typedef DeviceRotationRate = { + + /** + The amount of rotation around the Z axis, in degrees per second. + **/ + var alpha(default,null) : Float; + + /** + The amount of rotation around the X axis, in degrees per second. + **/ + var beta(default,null) : Float; + + /** + The amount of rotation around the Y axis, in degrees per second. + **/ + var gamma(default,null) : Float; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DeviceRotationRateInit.hx b/build/linux64_569e52e/std/js/html/DeviceRotationRateInit.hx new file mode 100644 index 0000000..1cc295e --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DeviceRotationRateInit.hx @@ -0,0 +1,31 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DeviceMotionEvent.webidl. Do not edit! + +package js.html; + +typedef DeviceRotationRateInit = { + var ?alpha : Float; + var ?beta : Float; + var ?gamma : Float; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DialogElement.hx b/build/linux64_569e52e/std/js/html/DialogElement.hx new file mode 100644 index 0000000..21e8142 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DialogElement.hx @@ -0,0 +1,60 @@ +/* + * Copyright (C)2005-2022 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package js.html; + +/** + The `HTMLDialogElement` interface provides methods to manipulate `` elements. + It inherits properties and methods from the `HTMLElement` interface. + + @see +**/ +@:native("HTMLDialogElement") +extern class DialogElement extends Element { + + /** + A `Boolean` reflecting the open HTML attribute, indicating whether the dialog is available for interaction. + **/ + var open: Bool; + + /** + A `DOMString` that sets or returns the return value for the dialog. + **/ + var returnValue: String; + + /** + Closes the dialog. + An optional `DOMString` may be passed as an argument, updating the `returnValue` of the the dialog. + **/ + function close(?returnValue: String): Void; + + /** + Displays the dialog modelessly, i.e. still allowing interaction with content outside of the dialog. + **/ + function show(): Void; + + /** + Displays the dialog as a modal, over the top of any other dialogs that might be present. + Interaction outside the dialog is blocked. + **/ + function showModal(): Void; +} diff --git a/build/linux64_569e52e/std/js/html/DirectionSetting.hx b/build/linux64_569e52e/std/js/html/DirectionSetting.hx new file mode 100644 index 0000000..8a4cb3e --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DirectionSetting.hx @@ -0,0 +1,31 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\VTTCue.webidl. Do not edit! + +package js.html; + +enum abstract DirectionSetting(String) { + var NONE = ""; + var RL = "rl"; + var LR = "lr"; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/Directory.hx b/build/linux64_569e52e/std/js/html/Directory.hx new file mode 100644 index 0000000..719d355 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/Directory.hx @@ -0,0 +1,40 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Directory.webidl. Do not edit! + +package js.html; + +import js.lib.Promise; + +@:native("Directory") +extern class Directory { + var name(default,null) : String; + var path(default,null) : String; + + /** @throws DOMError */ + function new( path : String ) : Void; + /** @throws DOMError */ + function getFilesAndDirectories() : Promise>>; + /** @throws DOMError */ + function getFiles( recursiveFlag : Bool = false ) : Promise>; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DirectoryElement.hx b/build/linux64_569e52e/std/js/html/DirectoryElement.hx new file mode 100644 index 0000000..35b993f --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DirectoryElement.hx @@ -0,0 +1,31 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLDirectoryElement.webidl. Do not edit! + +package js.html; + +@:native("HTMLDirectoryElement") +extern class DirectoryElement extends Element { + var compact : Bool; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DisplayNameOptions.hx b/build/linux64_569e52e/std/js/html/DisplayNameOptions.hx new file mode 100644 index 0000000..b91e0e1 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DisplayNameOptions.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\IntlUtils.webidl. Do not edit! + +package js.html; + +typedef DisplayNameOptions = { + var ?keys : Array; + var ?style : String; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DisplayNameResult.hx b/build/linux64_569e52e/std/js/html/DisplayNameResult.hx new file mode 100644 index 0000000..d5e8a60 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DisplayNameResult.hx @@ -0,0 +1,31 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\IntlUtils.webidl. Do not edit! + +package js.html; + +typedef DisplayNameResult = { + var ?locale : String; + var ?style : String; + var ?values : haxe.DynamicAccess; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DivElement.hx b/build/linux64_569e52e/std/js/html/DivElement.hx new file mode 100644 index 0000000..ac1adba --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DivElement.hx @@ -0,0 +1,42 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLDivElement.webidl. Do not edit! + +package js.html; + +/** + The `HTMLDivElement` interface provides special properties (beyond the regular `HTMLElement` interface it also has available to it by inheritance) for manipulating div elements. + + Documentation [HTMLDivElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDivElement) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDivElement$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("HTMLDivElement") +extern class DivElement extends Element { + + /** + Is a `DOMString` representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context. The possible values are `"left"`, `"right"`, `"justify"`, and `"center"`. + **/ + var align : String; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/Document.hx b/build/linux64_569e52e/std/js/html/Document.hx new file mode 100644 index 0000000..b739b3f --- /dev/null +++ b/build/linux64_569e52e/std/js/html/Document.hx @@ -0,0 +1,585 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Document.webidl. Do not edit! + +package js.html; + +/** + The `Document` interface represents any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree.`HTMLElement` + + Documentation [Document](https://developer.mozilla.org/en-US/docs/Web/API/Document) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/Document$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("Document") +extern class Document extends Node { + + /** + Returns the DOM implementation associated with the current document. + **/ + var implementation(default,null) : DOMImplementation; + + /** + Returns the document location as a string. + **/ + var URL(default,null) : String; + + /** + Returns the document location as a string. + **/ + var documentURI(default,null) : String; + + /** + Indicates whether the document is rendered in quirks or strict mode. + **/ + var compatMode(default,null) : String; + + /** + Returns the character set being used by the document. + **/ + var characterSet(default,null) : String; + + /** + Alias of `Document.characterSet`. Use this property instead. + **/ + var charset(default,null) : String; + + /** + Alias of `Document.characterSet`. Use this property instead. + **/ + var inputEncoding(default,null) : String; + + /** + Returns the Content-Type from the MIME Header of the current document. + **/ + var contentType(default,null) : String; + + /** + Returns the Document Type Definition (DTD) of the current document. + **/ + var doctype(default,null) : DocumentType; + + /** + Returns the `Element` that is a direct child of the document. For HTML documents, this is normally the `HTMLElement` element. + **/ + var documentElement(default,null) : Element; + + /** + Returns the URI of the current document. + **/ + var location(default,null) : Location; + + /** + Returns the URI of the page that linked to this page. + **/ + var referrer(default,null) : String; + + /** + Returns the date on which the document was last modified. + **/ + var lastModified(default,null) : String; + + /** + Returns loading status of the document. + **/ + var readyState(default,null) : String; + + /** + Sets or gets the title of the current document. + **/ + var title : String; + + /** + Gets/sets directionality (rtl/ltr) of the document. + **/ + var dir : String; + + /** + Returns the `body` or `frameset` node of the current document. + **/ + var body : Element; + + /** + Returns the `head` element of the current document. + **/ + var head(default,null) : HeadElement; + + /** + Returns a list of the images in the current document. + **/ + var images(default,null) : HTMLCollection; + + /** + Returns a list of the embedded `embed` elements within the current document. + **/ + var embeds(default,null) : HTMLCollection; + + /** + Returns a list of the available plugins. + **/ + var plugins(default,null) : HTMLCollection; + + /** + Returns a list of all the hyperlinks in the document. + **/ + var links(default,null) : HTMLCollection; + + /** + Returns a list of the `form` elements within the current document. + **/ + var forms(default,null) : HTMLCollection; + + /** + Returns all the `script` elements on the document. + **/ + var scripts(default,null) : HTMLCollection; + + /** + Returns a reference to the window object. + **/ + var defaultView(default,null) : Window; + + /** + Represents the event handling code for the `readystatechange` event. + **/ + var onreadystatechange : haxe.Constraints.Function; + + /** + Represents the event handling code for the `beforescriptexecute` event. + **/ + var onbeforescriptexecute : haxe.Constraints.Function; + + /** + Represents the event handling code for the `afterscriptexecute` event. + **/ + var onafterscriptexecute : haxe.Constraints.Function; + + /** + Is an `EventHandler` representing the code to be called when the `selectionchange` event is raised. + **/ + var onselectionchange : haxe.Constraints.Function; + var currentScript(default,null) : Element; + + /** + Returns a list of all of the anchors in the document. + **/ + var anchors(default,null) : HTMLCollection; + + /** + Returns an ordered list of the applets within a document. + **/ + var applets(default,null) : HTMLCollection; + + /** + `true` when the document is in `Using_full-screen_mode`. + **/ + var fullscreen(default,null) : Bool; + var fullscreenEnabled(default,null) : Bool; + + /** + Is an `EventHandler` representing the code to be called when the `fullscreenchange` event is raised. + **/ + var onfullscreenchange : haxe.Constraints.Function; + + /** + Is an `EventHandler` representing the code to be called when the `fullscreenerror` event is raised. + **/ + var onfullscreenerror : haxe.Constraints.Function; + + /** + Represents the event handling code for the `pointerlockchange` event. + **/ + var onpointerlockchange : haxe.Constraints.Function; + + /** + Represents the event handling code for the `pointerlockerror` event. + **/ + var onpointerlockerror : haxe.Constraints.Function; + + /** + … + **/ + var hidden(default,null) : Bool; + + /** + Returns a `string` denoting the visibility state of the document. Possible values are `visible`,  `hidden`,  `prerender`, and `unloaded`. + **/ + var visibilityState(default,null) : VisibilityState; + + /** + Is an `EventHandler` representing the code to be called when the `visibilitychange` event is raised. + **/ + var onvisibilitychange : haxe.Constraints.Function; + + /** + Returns which style sheet set is currently in use. + **/ + var selectedStyleSheetSet : String; + + /** + Returns the name of the style sheet set that was last enabled. Has the value `null` until the style sheet is changed by setting the value of `document.selectedStyleSheetSet`. + **/ + var lastStyleSheetSet(default,null) : String; + + /** + Returns the preferred style sheet set as specified by the page author. + **/ + var preferredStyleSheetSet(default,null) : String; + + /** + Returns a list of the style sheet sets available on the document. + **/ + var styleSheetSets(default,null) : DOMStringList; + + /** + Returns a reference to the `Element` that scrolls the document. + **/ + var scrollingElement(default,null) : Element; + + /** + … + **/ + var timeline(default,null) : DocumentTimeline; + var rootElement(default,null) : js.html.svg.SVGElement; + + /** + Represents the event handling code for the `copy` event. + **/ + var oncopy : haxe.Constraints.Function; + + /** + Represents the event handling code for the `cut` event. + **/ + var oncut : haxe.Constraints.Function; + + /** + Represents the event handling code for the `paste` event. + **/ + var onpaste : haxe.Constraints.Function; + var activeElement(default,null) : Element; + var styleSheets(default,null) : StyleSheetList; + var pointerLockElement(default,null) : Element; + + /** + The element that's currently in full screen mode for this document. + **/ + var fullscreenElement(default,null) : Element; + var fonts(default,null) : FontFaceSet; + var onabort : haxe.Constraints.Function; + var onblur : haxe.Constraints.Function; + var onfocus : haxe.Constraints.Function; + var onauxclick : haxe.Constraints.Function; + var oncanplay : haxe.Constraints.Function; + var oncanplaythrough : haxe.Constraints.Function; + var onchange : haxe.Constraints.Function; + var onclick : haxe.Constraints.Function; + var onclose : haxe.Constraints.Function; + var oncontextmenu : haxe.Constraints.Function; + var ondblclick : haxe.Constraints.Function; + var ondrag : haxe.Constraints.Function; + var ondragend : haxe.Constraints.Function; + var ondragenter : haxe.Constraints.Function; + var ondragexit : haxe.Constraints.Function; + var ondragleave : haxe.Constraints.Function; + var ondragover : haxe.Constraints.Function; + var ondragstart : haxe.Constraints.Function; + var ondrop : haxe.Constraints.Function; + var ondurationchange : haxe.Constraints.Function; + var onemptied : haxe.Constraints.Function; + var onended : haxe.Constraints.Function; + var oninput : haxe.Constraints.Function; + var oninvalid : haxe.Constraints.Function; + var onkeydown : haxe.Constraints.Function; + var onkeypress : haxe.Constraints.Function; + var onkeyup : haxe.Constraints.Function; + var onload : haxe.Constraints.Function; + var onloadeddata : haxe.Constraints.Function; + var onloadedmetadata : haxe.Constraints.Function; + var onloadend : haxe.Constraints.Function; + var onloadstart : haxe.Constraints.Function; + var onmousedown : haxe.Constraints.Function; + var onmouseenter : haxe.Constraints.Function; + var onmouseleave : haxe.Constraints.Function; + var onmousemove : haxe.Constraints.Function; + var onmouseout : haxe.Constraints.Function; + var onmouseover : haxe.Constraints.Function; + var onmouseup : haxe.Constraints.Function; + + /** + Represents the event handling code for the `wheel` event. + **/ + var onwheel : haxe.Constraints.Function; + var onpause : haxe.Constraints.Function; + var onplay : haxe.Constraints.Function; + var onplaying : haxe.Constraints.Function; + var onprogress : haxe.Constraints.Function; + var onratechange : haxe.Constraints.Function; + var onreset : haxe.Constraints.Function; + var onresize : haxe.Constraints.Function; + var onscroll : haxe.Constraints.Function; + var onseeked : haxe.Constraints.Function; + var onseeking : haxe.Constraints.Function; + var onselect : haxe.Constraints.Function; + var onshow : haxe.Constraints.Function; + var onstalled : haxe.Constraints.Function; + var onsubmit : haxe.Constraints.Function; + var onsuspend : haxe.Constraints.Function; + var ontimeupdate : haxe.Constraints.Function; + var onvolumechange : haxe.Constraints.Function; + var onwaiting : haxe.Constraints.Function; + var onselectstart : haxe.Constraints.Function; + var ontoggle : haxe.Constraints.Function; + var onpointercancel : haxe.Constraints.Function; + var onpointerdown : haxe.Constraints.Function; + var onpointerup : haxe.Constraints.Function; + var onpointermove : haxe.Constraints.Function; + var onpointerout : haxe.Constraints.Function; + var onpointerover : haxe.Constraints.Function; + var onpointerenter : haxe.Constraints.Function; + var onpointerleave : haxe.Constraints.Function; + var ongotpointercapture : haxe.Constraints.Function; + var onlostpointercapture : haxe.Constraints.Function; + var onanimationcancel : haxe.Constraints.Function; + var onanimationend : haxe.Constraints.Function; + var onanimationiteration : haxe.Constraints.Function; + var onanimationstart : haxe.Constraints.Function; + var ontransitioncancel : haxe.Constraints.Function; + var ontransitionend : haxe.Constraints.Function; + var ontransitionrun : haxe.Constraints.Function; + var ontransitionstart : haxe.Constraints.Function; + var onwebkitanimationend : haxe.Constraints.Function; + var onwebkitanimationiteration : haxe.Constraints.Function; + var onwebkitanimationstart : haxe.Constraints.Function; + var onwebkittransitionend : haxe.Constraints.Function; + var onerror : haxe.Constraints.Function; + var children(default,null) : HTMLCollection; + var firstElementChild(default,null) : Element; + var lastElementChild(default,null) : Element; + var childElementCount(default,null) : Int; + var ontouchstart : haxe.Constraints.Function; + var ontouchend : haxe.Constraints.Function; + var ontouchmove : haxe.Constraints.Function; + var ontouchcancel : haxe.Constraints.Function; + + /** @throws DOMError */ + function new() : Void; + + /** + Returns a list of elements with the given tag name. + **/ + @:pure + function getElementsByTagName( localName : String ) : HTMLCollection; + + /** + Returns a list of elements with the given tag name and namespace. + @throws DOMError + **/ + @:pure + function getElementsByTagNameNS( namespace : String, localName : String ) : HTMLCollection; + + /** + Returns a list of elements with the given class name. + **/ + @:pure + function getElementsByClassName( classNames : String ) : HTMLCollection; + @:pure + function getElementById( elementId : String ) : Element; + + /** + Creates a new element with the given tag name. + @throws DOMError + **/ + @:overload( function( localName : String, ?options : String) : Element {} ) + function createElement( localName : String, ?options : ElementCreationOptions ) : Element; + + /** + Creates a new element with the given tag name and namespace URI. + @throws DOMError + **/ + @:overload( function( namespace : String, qualifiedName : String, ?options : String) : Element {} ) + function createElementNS( namespace : String, qualifiedName : String, ?options : ElementCreationOptions ) : Element; + + /** + Creates a new document fragment. + **/ + function createDocumentFragment() : DocumentFragment; + + /** + Creates a text node. + **/ + function createTextNode( data : String ) : Text; + + /** + Creates a new comment node and returns it. + **/ + function createComment( data : String ) : Comment; + + /** + Creates a new `ProcessingInstruction` object. + @throws DOMError + **/ + function createProcessingInstruction( target : String, data : String ) : ProcessingInstruction; + + /** + Returns a clone of a node from an external document. + @throws DOMError + **/ + function importNode( node : Node, deep : Bool = false ) : Node; + + /** + Adopt node from an external document. + @throws DOMError + **/ + function adoptNode( node : Node ) : Node; + + /** + Creates an event object. + @throws DOMError + **/ + function createEvent( interface_ : String ) : Event; + + /** + Creates a `Range` object. + @throws DOMError + **/ + function createRange() : Range; + + /** + Creates a `NodeIterator` object. + @throws DOMError + **/ + @:overload( function( root : Node, whatToShow : Int = cast 4294967295, ?filter : haxe.Constraints.Function) : NodeIterator {} ) + @:overload( function( root : Node, whatToShow : Int = cast 4294967295, ?filter : NodeFilter) : NodeIterator {} ) + function createNodeIterator( root : Node, whatToShow : Int = cast 4294967295, ?filter : Node -> Int ) : NodeIterator; + + /** + Creates a `TreeWalker` object. + @throws DOMError + **/ + @:overload( function( root : Node, whatToShow : Int = cast 4294967295, ?filter : haxe.Constraints.Function) : TreeWalker {} ) + @:overload( function( root : Node, whatToShow : Int = cast 4294967295, ?filter : NodeFilter) : TreeWalker {} ) + function createTreeWalker( root : Node, whatToShow : Int = cast 4294967295, ?filter : Node -> Int ) : TreeWalker; + + /** + Creates a new CDATA node and returns it. + @throws DOMError + **/ + function createCDATASection( data : String ) : CDATASection; + + /** + Creates a new `Attr` object and returns it. + @throws DOMError + **/ + function createAttribute( name : String ) : Attr; + + /** + Creates a new attribute node in a given namespace and returns it. + @throws DOMError + **/ + function createAttributeNS( namespace : String, name : String ) : Attr; + @:pure + function getElementsByName( elementName : String ) : NodeList; + + /** + Returns `true` if the focus is currently located anywhere inside the specified document. + @throws DOMError + **/ + function hasFocus() : Bool; + + /** + Releases the current mouse capture if it's on an element in this document. + **/ + function releaseCapture() : Void; + + /** + Requests that the element on this document which is currently being presented in fullscreen mode + be taken out of fullscreen mode, restoring the previous state of the screen. + **/ + function exitFullscreen() : js.lib.Promise; + + /** + Release the pointer lock. + **/ + function exitPointerLock() : Void; + + /** + Enables the style sheets for the specified style sheet set. + **/ + function enableStyleSheetsForSet( name : String ) : Void; + function caretPositionFromPoint( x : Float, y : Float ) : CaretPosition; + /** @throws DOMError */ + @:pure + function querySelector( selectors : String ) : Element; + /** @throws DOMError */ + @:pure + function querySelectorAll( selectors : String ) : NodeList; + + /** + Returns an array of all `Animation` objects currently in effect, whose target elements are descendants of the `document`. + **/ + function getAnimations() : Array; + + /** + Creates a `Touch` object. + **/ + function createTouch( ?view : Window, ?target : EventTarget, identifier : Int = 0, pageX : Int = 0, pageY : Int = 0, screenX : Int = 0, screenY : Int = 0, clientX : Int = 0, clientY : Int = 0, radiusX : Int = 0, radiusY : Int = 0, rotationAngle : Float = 0.0, force : Float = 0.0 ) : Touch; + + /** + Creates a `TouchList` object. + **/ + @:overload( function( touch : Touch, touches : haxe.extern.Rest ) : TouchList {} ) + @:overload( function() : TouchList {} ) + function createTouchList( touches : Array ) : TouchList; + /** @throws DOMError */ + function getSelection() : Selection; + function elementFromPoint( x : Float, y : Float ) : Element; + function elementsFromPoint( x : Float, y : Float ) : Array; + /** @throws DOMError */ + @:overload( function( quad : DOMQuad, from : Element, ?options : ConvertCoordinateOptions) : DOMQuad {} ) + @:overload( function( quad : DOMQuad, from : HTMLDocument, ?options : ConvertCoordinateOptions) : DOMQuad {} ) + function convertQuadFromNode( quad : DOMQuad, from : Text, ?options : ConvertCoordinateOptions ) : DOMQuad; + /** @throws DOMError */ + @:overload( function( rect : DOMRectReadOnly, from : Element, ?options : ConvertCoordinateOptions) : DOMQuad {} ) + @:overload( function( rect : DOMRectReadOnly, from : HTMLDocument, ?options : ConvertCoordinateOptions) : DOMQuad {} ) + function convertRectFromNode( rect : DOMRectReadOnly, from : Text, ?options : ConvertCoordinateOptions ) : DOMQuad; + /** @throws DOMError */ + @:overload( function( point : DOMPointInit, from : Element, ?options : ConvertCoordinateOptions) : DOMPoint {} ) + @:overload( function( point : DOMPointInit, from : HTMLDocument, ?options : ConvertCoordinateOptions) : DOMPoint {} ) + function convertPointFromNode( point : DOMPointInit, from : Text, ?options : ConvertCoordinateOptions ) : DOMPoint; + /** @throws DOMError */ + @:overload( function( nodes : haxe.extern.Rest) : Void {} ) + function prepend( nodes : haxe.extern.Rest ) : Void; + /** @throws DOMError */ + @:overload( function( nodes : haxe.extern.Rest) : Void {} ) + function append( nodes : haxe.extern.Rest ) : Void; + /** @throws DOMError */ + @:overload( function( expression : String, ?resolver : haxe.Constraints.Function) : XPathExpression {} ) + @:overload( function( expression : String, ?resolver : XPathNSResolver) : XPathExpression {} ) + function createExpression( expression : String, ?resolver : String -> Null ) : XPathExpression; + @:pure + function createNSResolver( nodeResolver : Node ) : Node; + /** @throws DOMError */ + @:overload( function( expression : String, contextNode : Node, ?resolver : haxe.Constraints.Function, type : Int = 0, ?result : Dynamic) : XPathResult {} ) + @:overload( function( expression : String, contextNode : Node, ?resolver : XPathNSResolver, type : Int = 0, ?result : Dynamic) : XPathResult {} ) + function evaluate( expression : String, contextNode : Node, ?resolver : String -> Null, type : Int = 0, ?result : Dynamic ) : XPathResult; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DocumentFragment.hx b/build/linux64_569e52e/std/js/html/DocumentFragment.hx new file mode 100644 index 0000000..9919b32 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DocumentFragment.hx @@ -0,0 +1,66 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DocumentFragment.webidl. Do not edit! + +package js.html; + +/** + The `DocumentFragment` interface represents a minimal document object that has no parent. It is used as a lightweight version of `Document` that stores a segment of a document structure comprised of nodes just like a standard document. The key difference is that because the document fragment isn't part of the active document tree structure, changes made to the fragment don't affect the document, cause reflow, or incur any performance impact that can occur when changes are made. + + Documentation [DocumentFragment](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DocumentFragment") +extern class DocumentFragment extends Node { + var children(default,null) : HTMLCollection; + var firstElementChild(default,null) : Element; + var lastElementChild(default,null) : Element; + var childElementCount(default,null) : Int; + + /** @throws DOMError */ + function new() : Void; + + /** + Returns the first `Element` node within the DocumentFragment`, in document order, that matches the specified ID. + **/ + function getElementById( elementId : String ) : Element; + + /** + Returns the first `Element` node within the `DocumentFragment`, in document order, that matches the specified selectors. + @throws DOMError + **/ + function querySelector( selectors : String ) : Element; + + /** + Returns a `NodeList` of all the `Element` nodes within the `DocumentFragment` that match the specified selectors. + @throws DOMError + **/ + function querySelectorAll( selectors : String ) : NodeList; + /** @throws DOMError */ + @:overload( function( nodes : haxe.extern.Rest) : Void {} ) + function prepend( nodes : haxe.extern.Rest ) : Void; + /** @throws DOMError */ + @:overload( function( nodes : haxe.extern.Rest) : Void {} ) + function append( nodes : haxe.extern.Rest ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DocumentTimeline.hx b/build/linux64_569e52e/std/js/html/DocumentTimeline.hx new file mode 100644 index 0000000..d2fdae9 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DocumentTimeline.hx @@ -0,0 +1,38 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DocumentTimeline.webidl. Do not edit! + +package js.html; + +/** + The `DocumentTimeline` interface of the the Web Animations API represents animation timelines, including the default document timeline (accessed via `Document.timeline`). + + Documentation [DocumentTimeline](https://developer.mozilla.org/en-US/docs/Web/API/DocumentTimeline) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DocumentTimeline$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DocumentTimeline") +extern class DocumentTimeline extends AnimationTimeline { + /** @throws DOMError */ + function new( ?options : DocumentTimelineOptions ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DocumentTimelineOptions.hx b/build/linux64_569e52e/std/js/html/DocumentTimelineOptions.hx new file mode 100644 index 0000000..5edd996 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DocumentTimelineOptions.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DocumentTimeline.webidl. Do not edit! + +package js.html; + +typedef DocumentTimelineOptions = { + var ?originTime : Float; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DocumentType.hx b/build/linux64_569e52e/std/js/html/DocumentType.hx new file mode 100644 index 0000000..5c17b21 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DocumentType.hx @@ -0,0 +1,62 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DocumentType.webidl. Do not edit! + +package js.html; + +/** + The `DocumentType` interface represents a `Node` containing a doctype. + + Documentation [DocumentType](https://developer.mozilla.org/en-US/docs/Web/API/DocumentType) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DocumentType$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DocumentType") +extern class DocumentType extends Node { + + /** + A `DOMString`, eg `"html"` for `!DOCTYPE HTML`. + **/ + var name(default,null) : String; + + /** + A `DOMString`, eg `"-//W3C//DTD HTML 4.01//EN"`, empty string for HTML5. + **/ + var publicId(default,null) : String; + + /** + A `DOMString`, eg `"http://www.w3.org/TR/html4/strict.dtd"`, empty string for HTML5. + **/ + var systemId(default,null) : String; + + /** @throws DOMError */ + @:overload( function( nodes : haxe.extern.Rest) : Void {} ) + function before( nodes : haxe.extern.Rest ) : Void; + /** @throws DOMError */ + @:overload( function( nodes : haxe.extern.Rest) : Void {} ) + function after( nodes : haxe.extern.Rest ) : Void; + /** @throws DOMError */ + @:overload( function( nodes : haxe.extern.Rest) : Void {} ) + function replaceWith( nodes : haxe.extern.Rest ) : Void; + function remove() : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DragEvent.hx b/build/linux64_569e52e/std/js/html/DragEvent.hx new file mode 100644 index 0000000..775c60c --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DragEvent.hx @@ -0,0 +1,45 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DragEvent.webidl. Do not edit! + +package js.html; + +/** + The `DragEvent` interface is a `DOM event` that represents a drag and drop interaction. The user initiates a drag by placing a pointer device (such as a mouse) on the touch surface and then dragging the pointer to a new location (such as another DOM element). Applications are free to interpret a drag and drop interaction in an application-specific way. + + Documentation [DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("DragEvent") +extern class DragEvent extends MouseEvent { + + /** + The data that is transferred during a drag and drop interaction. + **/ + var dataTransfer(default,null) : DataTransfer; + + /** @throws DOMError */ + function new( type : String, ?eventInitDict : DragEventInit ) : Void; + function initDragEvent( type : String, canBubble : Bool = false, cancelable : Bool = false, ?aView : Window, aDetail : Int = 0, aScreenX : Int = 0, aScreenY : Int = 0, aClientX : Int = 0, aClientY : Int = 0, aCtrlKey : Bool = false, aAltKey : Bool = false, aShiftKey : Bool = false, aMetaKey : Bool = false, aButton : Int = 0, ?aRelatedTarget : EventTarget, ?aDataTransfer : DataTransfer ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/DragEventInit.hx b/build/linux64_569e52e/std/js/html/DragEventInit.hx new file mode 100644 index 0000000..77c25e4 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/DragEventInit.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DragEvent.webidl. Do not edit! + +package js.html; + +typedef DragEventInit = MouseEventInit & { + var ?dataTransfer : DataTransfer; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/EffectTiming.hx b/build/linux64_569e52e/std/js/html/EffectTiming.hx new file mode 100644 index 0000000..b23e0ff --- /dev/null +++ b/build/linux64_569e52e/std/js/html/EffectTiming.hx @@ -0,0 +1,75 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\AnimationEffect.webidl. Do not edit! + +package js.html; + +/** + The `EffectTiming` dictionary, part of the Web Animations API, is used by `Element.animate()`, `KeyframeEffectReadOnly()`, and `KeyframeEffect()` to describe timing properties for animation effects. These properties are all optional, although without setting a `duration` the animation will not play. + + Documentation [EffectTiming](https://developer.mozilla.org/en-US/docs/Web/API/EffectTiming) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/EffectTiming$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +typedef EffectTiming = { + + /** + The number of milliseconds to delay the start of the animation. Defaults to 0. + **/ + var ?delay : Float; + + /** + Whether the animation runs forwards (`normal`), backwards (`reverse`), switches direction after each iteration (`alternate`), or runs backwards and switches direction after each iteration (`alternate-reverse`). Defaults to `"normal"`. + **/ + var ?direction : PlaybackDirection; + + /** + The number of milliseconds each iteration of the animation takes to complete. Defaults to 0. Although this is technically optional, keep in mind that your animation will not run if this value is 0. + **/ + var ?duration : haxe.extern.EitherType; + + /** + The rate of the animation's change over time. Accepts the pre-defined values `"linear"`, `"ease"`, `"ease-in"`, `"ease-out"`, and `"ease-in-out"`, or a custom `"cubic-bezier"` value like `"cubic-bezier(0.42, 0, 0.58, 1)"`. Defaults to `"linear"`. + **/ + var ?easing : String; + + /** + The number of milliseconds to delay after the end of an animation. This is primarily of use when sequencing animations based on the end time of another animation. Defaults to 0.  + **/ + var ?endDelay : Float; + + /** + Dictates whether the animation's effects should be reflected by the element(s) prior to playing (`"backwards"`), retained after the animation has completed playing (`"forwards"`), or `both`. Defaults to `"none"`. + **/ + var ?fill : FillMode; + + /** + Describes at what point in the iteration the animation should start. 0.5 would indicate starting halfway through the first iteration for example, and with this value set, an animation with 2 iterations would end halfway through a third iteration. Defaults to 0.0. + **/ + var ?iterationStart : Float; + + /** + The number of times the animation should repeat. Defaults to `1`, and can also take a value of `Infinity` to make it repeat for as long as the element exists. + **/ + var ?iterations : Float; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/Element.hx b/build/linux64_569e52e/std/js/html/Element.hx new file mode 100644 index 0000000..e50498b --- /dev/null +++ b/build/linux64_569e52e/std/js/html/Element.hx @@ -0,0 +1,53 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLElement.webidl. Do not edit! + +package js.html; + +/** + The `HTMLElement` interface represents any HTML element. Some elements directly implement this interface, others implement it via an interface that inherits it. + + Documentation [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("HTMLElement") +extern class Element extends DOMElement { + + /** + Sends a mouse click event to the element. + **/ + function click() : Void; + + /** + Makes the element the current keyboard focus. + @throws DOMError + **/ + function focus() : Void; + + /** + Removes keyboard focus from the currently focused element. + @throws DOMError + **/ + function blur() : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/ElementCreationOptions.hx b/build/linux64_569e52e/std/js/html/ElementCreationOptions.hx new file mode 100644 index 0000000..d9ced80 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ElementCreationOptions.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Document.webidl. Do not edit! + +package js.html; + +typedef ElementCreationOptions = { + var ?is : String; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/EmbedElement.hx b/build/linux64_569e52e/std/js/html/EmbedElement.hx new file mode 100644 index 0000000..3512746 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/EmbedElement.hx @@ -0,0 +1,68 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLEmbedElement.webidl. Do not edit! + +package js.html; + +/** + The `HTMLEmbedElement` interface, which provides special properties (beyond the regular `HTMLElement` interface it also has available to it by inheritance) for manipulating `embed` elements. + + Documentation [HTMLEmbedElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLEmbedElement) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/HTMLEmbedElement$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("HTMLEmbedElement") +extern class EmbedElement extends Element { + + /** + Is a `DOMString` that reflects the `src` HTML attribute, containing the address of the resource. + **/ + var src : String; + + /** + Is a `DOMString` that reflects the `type` HTML attribute, containing the type of the resource. + **/ + var type : String; + + /** + Is a `DOMString` that reflects the `width` HTML attribute, containing the displayed width of the resource. + **/ + var width : String; + + /** + Is a `DOMString` reflecting the `height` HTML attribute, containing the displayed height of the resource. + **/ + var height : String; + + /** + Is a `DOMString` representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context. The possible values are `"left"`, `"right"`, `"center"`, and `"justify"`. + **/ + var align : String; + + /** + Is a `DOMString` representing the name of the embedded object. + **/ + var name : String; + + function getSVGDocument() : HTMLDocument; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/EndingTypes.hx b/build/linux64_569e52e/std/js/html/EndingTypes.hx new file mode 100644 index 0000000..ea6f6f1 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/EndingTypes.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Blob.webidl. Do not edit! + +package js.html; + +enum abstract EndingTypes(String) { + var TRANSPARENT = "transparent"; + var NATIVE = "native"; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/ErrorCallback.hx b/build/linux64_569e52e/std/js/html/ErrorCallback.hx new file mode 100644 index 0000000..ca229f8 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ErrorCallback.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FileSystem.webidl. Do not edit! + +package js.html; + +typedef ErrorCallback = { + function handleEvent( err : DOMException ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/ErrorEvent.hx b/build/linux64_569e52e/std/js/html/ErrorEvent.hx new file mode 100644 index 0000000..193aa6a --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ErrorEvent.hx @@ -0,0 +1,64 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\ErrorEvent.webidl. Do not edit! + +package js.html; + +/** + The `ErrorEvent` interface represents events providing information related to errors in scripts or in files. + + Documentation [ErrorEvent](https://developer.mozilla.org/en-US/docs/Web/API/ErrorEvent) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/ErrorEvent$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("ErrorEvent") +extern class ErrorEvent extends Event { + + /** + Is a `DOMString` containing a human-readable error message describing the problem. + **/ + var message(default,null) : String; + + /** + Is a `DOMString` containing the name of the script file in which the error occurred. + **/ + var filename(default,null) : String; + + /** + Is an `integer` containing the line number of the script file on which the error occurred. + **/ + var lineno(default,null) : Int; + + /** + Is an `integer` containing the column number of the script file on which the error occurred. + **/ + var colno(default,null) : Int; + + /** + Is a JavaScript `Object` that is concerned by the event. + **/ + var error(default,null) : Dynamic; + + /** @throws DOMError */ + function new( type : String, ?eventInitDict : ErrorEventInit ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/ErrorEventInit.hx b/build/linux64_569e52e/std/js/html/ErrorEventInit.hx new file mode 100644 index 0000000..adc9889 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ErrorEventInit.hx @@ -0,0 +1,33 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\ErrorEvent.webidl. Do not edit! + +package js.html; + +typedef ErrorEventInit = EventInit & { + var ?colno : Int; + var ?error : Dynamic; + var ?filename : String; + var ?lineno : Int; + var ?message : String; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/Event.hx b/build/linux64_569e52e/std/js/html/Event.hx new file mode 100644 index 0000000..4a3a9ec --- /dev/null +++ b/build/linux64_569e52e/std/js/html/Event.hx @@ -0,0 +1,143 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Event.webidl. Do not edit! + +package js.html; + +/** + The `Event` interface represents any event which takes place in the DOM; some are user-generated (such as mouse or keyboard events), while others are generated by APIs (such as events that indicate an animation has finished running, a video has been paused, and so forth). There are many types of events, some of which use other interfaces based on the main `Event` interface. `Event` itself contains the properties and methods which are common to all events. + + Documentation [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/Event$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("Event") +extern class Event { + static inline var NONE : Int = 0; + static inline var CAPTURING_PHASE : Int = 1; + static inline var AT_TARGET : Int = 2; + static inline var BUBBLING_PHASE : Int = 3; + static inline var ALT_MASK : Int = 1; + static inline var CONTROL_MASK : Int = 2; + static inline var SHIFT_MASK : Int = 4; + static inline var META_MASK : Int = 8; + + + /** + The name of the event (case-insensitive). + **/ + var type(default,null) : String; + + /** + A reference to the target to which the event was originally dispatched. + **/ + var target(default,null) : EventTarget; + + /** + A reference to the currently registered target for the event. This is the object to which the event is currently slated to be sent; it's possible this has been changed along the way through retargeting. + **/ + var currentTarget(default,null) : EventTarget; + + /** + Indicates which phase of the event flow is being processed. + **/ + var eventPhase(default,null) : Int; + + /** + A Boolean indicating whether the event bubbles up through the DOM or not. + **/ + var bubbles(default,null) : Bool; + + /** + A Boolean indicating whether the event is cancelable. + **/ + var cancelable(default,null) : Bool; + + /** + A historical property introduced by Internet Explorer and eventually adopted into the DOM specification in order to ensure existing sites continue to work. Ideally, you should try to use `Event.preventDefault()` and `Event.defaultPrevented` instead, but you can use `returnValue` if you choose to do so. + **/ + var returnValue : Bool; + + /** + Indicates whether or not `event.preventDefault()` has been called on the event. + **/ + var defaultPrevented(default,null) : Bool; + + /** + A Boolean value indicating whether or not the event can bubble across the boundary between the shadow DOM and the regular DOM. + **/ + var composed(default,null) : Bool; + + /** + Indicates whether or not the event was initiated by the browser (after a user click for instance) or by a script (using an event creation method, like event.initEvent). + **/ + var isTrusted(default,null) : Bool; + + /** + The time at which the event was created (in milliseconds). By specification, this value is time since epoch, but in reality browsers' definitions vary; in addition, work is underway to change this to be a `DOMHighResTimeStamp` instead. + **/ + var timeStamp(default,null) : Float; + + /** + A historical alias to `Event.stopPropagation()`. Setting its value to `true` before returning from an event handler prevents propagation of the event. + **/ + var cancelBubble : Bool; + + /** + The original target of the event, before any retargetings (Mozilla-specific). + **/ + var originalTarget(default,null) : EventTarget; + + /** + The explicit original target of the event (Mozilla-specific). + **/ + var explicitOriginalTarget(default,null) : EventTarget; + + /** @throws DOMError */ + function new( type : String, ?eventInitDict : EventInit ) : Void; + + /** + Returns the event’s path (objects on which listeners will be invoked). This does not include nodes in shadow trees if the shadow root was created with its `ShadowRoot.mode` closed. + **/ + function composedPath() : Array; + + /** + Stops the propagation of events further along in the DOM. + **/ + function stopPropagation() : Void; + + /** + For this particular event, no other listener will be called. Neither those attached on the same element, nor those attached on elements which will be traversed later (in capture phase, for instance) + **/ + function stopImmediatePropagation() : Void; + + /** + Cancels the event (if it is cancelable). + **/ + function preventDefault() : Void; + + /** + Initializes the value of an Event created. If the event has already being dispatched, this method does nothing. + **/ + function initEvent( type : String, bubbles : Bool = false, cancelable : Bool = false ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/EventInit.hx b/build/linux64_569e52e/std/js/html/EventInit.hx new file mode 100644 index 0000000..0b8d1f2 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/EventInit.hx @@ -0,0 +1,31 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Event.webidl. Do not edit! + +package js.html; + +typedef EventInit = { + var ?bubbles : Bool; + var ?cancelable : Bool; + var ?composed : Bool; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/EventListener.hx b/build/linux64_569e52e/std/js/html/EventListener.hx new file mode 100644 index 0000000..c8e2e85 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/EventListener.hx @@ -0,0 +1,40 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\EventListener.webidl. Do not edit! + +package js.html; + +/** + The `EventListener` interface represents an object that can handle an event dispatched by an `EventTarget` object. + + Documentation [EventListener](https://developer.mozilla.org/en-US/docs/Web/API/EventListener) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/EventListener$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +typedef EventListener = { + + /** + A function that is called whenever an event of the specified type occurs. + **/ + function handleEvent( event : Event ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/EventListenerOptions.hx b/build/linux64_569e52e/std/js/html/EventListenerOptions.hx new file mode 100644 index 0000000..6cedd9d --- /dev/null +++ b/build/linux64_569e52e/std/js/html/EventListenerOptions.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\EventTarget.webidl. Do not edit! + +package js.html; + +typedef EventListenerOptions = { + var ?capture : Bool; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/EventModifierInit.hx b/build/linux64_569e52e/std/js/html/EventModifierInit.hx new file mode 100644 index 0000000..8cef40a --- /dev/null +++ b/build/linux64_569e52e/std/js/html/EventModifierInit.hx @@ -0,0 +1,41 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\UIEvent.webidl. Do not edit! + +package js.html; + +typedef EventModifierInit = UIEventInit & { + var ?altKey : Bool; + var ?ctrlKey : Bool; + var ?metaKey : Bool; + var ?modifierAltGraph : Bool; + var ?modifierCapsLock : Bool; + var ?modifierFn : Bool; + var ?modifierFnLock : Bool; + var ?modifierNumLock : Bool; + var ?modifierOS : Bool; + var ?modifierScrollLock : Bool; + var ?modifierSymbol : Bool; + var ?modifierSymbolLock : Bool; + var ?shiftKey : Bool; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/EventSource.hx b/build/linux64_569e52e/std/js/html/EventSource.hx new file mode 100644 index 0000000..d688283 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/EventSource.hx @@ -0,0 +1,78 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\EventSource.webidl. Do not edit! + +package js.html; + +/** + The `EventSource` interface is web content's interface to server-sent events. An `EventSource` instance opens a persistent connection to an HTTP server, which sends events in `text/event-stream` format. + + Documentation [EventSource](https://developer.mozilla.org/en-US/docs/Web/API/EventSource) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/EventSource$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("EventSource") +extern class EventSource extends EventTarget { + static inline var CONNECTING : Int = 0; + static inline var OPEN : Int = 1; + static inline var CLOSED : Int = 2; + + + /** + A `DOMString` representing the URL of the source. + **/ + var url(default,null) : String; + + /** + A `Boolean` indicating whether the `EventSource` object was instantiated with cross-origin (CORS) credentials set (`true`), or not (`false`, the default). + **/ + var withCredentials(default,null) : Bool; + + /** + A number representing the state of the connection. Possible values are `CONNECTING` (`0`), `OPEN` (`1`), or `CLOSED` (`2`). + **/ + var readyState(default,null) : Int; + + /** + Is an `EventHandler` called when an `open` event is received, that is when the connection was just opened. + **/ + var onopen : haxe.Constraints.Function; + + /** + Is an `EventHandler` called when a `message` event is received, that is when a message is coming from the source. + **/ + var onmessage : haxe.Constraints.Function; + + /** + Is an `EventHandler` called when an error occurs and the `error` event is dispatched on an `EventSource` object. + **/ + var onerror : haxe.Constraints.Function; + + /** @throws DOMError */ + function new( url : String, ?eventSourceInitDict : EventSourceInit ) : Void; + + /** + Closes the connection, if any, and sets the `readyState` attribute to `CLOSED`. If the connection is already closed, the method does nothing. + **/ + function close() : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/EventSourceInit.hx b/build/linux64_569e52e/std/js/html/EventSourceInit.hx new file mode 100644 index 0000000..1013710 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/EventSourceInit.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\EventSource.webidl. Do not edit! + +package js.html; + +typedef EventSourceInit = { + var ?withCredentials : Bool; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/EventTarget.hx b/build/linux64_569e52e/std/js/html/EventTarget.hx new file mode 100644 index 0000000..8e70448 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/EventTarget.hx @@ -0,0 +1,58 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\EventTarget.webidl. Do not edit! + +package js.html; + +/** + `EventTarget` is an interface implemented by objects that can receive events and may have listeners for them. + + Documentation [EventTarget](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("EventTarget") +extern class EventTarget { + /** @throws DOMError */ + function new() : Void; + + /** + Register an event handler of a specific event type on the `EventTarget`. + @throws DOMError + **/ + @:overload( function( type : String, listener : EventListener, ?options : haxe.extern.EitherType, ?wantsUntrusted : Bool ) : Void {} ) + function addEventListener( type: String, listener: haxe.Constraints.Function, ?options : haxe.extern.EitherType, ?wantsUntrusted : Bool ) : Void; + + /** + Removes an event listener from the `EventTarget`. + @throws DOMError + **/ + @:overload( function( type : String, listener : EventListener, ?options : haxe.extern.EitherType) : Void {} ) + function removeEventListener( type : String, listener : haxe.Constraints.Function, ?options : haxe.extern.EitherType ) : Void; + + /** + Dispatch an event to this `EventTarget`. + @throws DOMError + **/ + function dispatchEvent( event : Event ) : Bool; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/Exception.hx b/build/linux64_569e52e/std/js/html/Exception.hx new file mode 100644 index 0000000..8462ae0 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/Exception.hx @@ -0,0 +1,37 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\DOMException.webidl. Do not edit! + +package js.html; + +typedef Exception = { + var name(default,null) : String; + var message(default,null) : String; + var result(default,null) : Int; + var filename(default,null) : String; + var lineNumber(default,null) : Int; + var columnNumber(default,null) : Int; + var data(default,null) : Dynamic; + var stack(default,null) : String; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/ExtendableEvent.hx b/build/linux64_569e52e/std/js/html/ExtendableEvent.hx new file mode 100644 index 0000000..903e0ea --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ExtendableEvent.hx @@ -0,0 +1,42 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\ExtendableEvent.webidl. Do not edit! + +package js.html; + +import js.lib.Promise; + +/** + The `ExtendableEvent` interface extends the lifetime of the `install` and `activate` events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like `FetchEvent`) are not dispatched until it upgrades database schemas and deletes the outdated cache entries. + + Documentation [ExtendableEvent](https://developer.mozilla.org/en-US/docs/Web/API/ExtendableEvent) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/ExtendableEvent$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("ExtendableEvent") +extern class ExtendableEvent extends Event { + /** @throws DOMError */ + function new( type : String, ?eventInitDict : ExtendableEventInit ) : Void; + /** @throws DOMError */ + function waitUntil( p : Promise ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/ExtendableEventInit.hx b/build/linux64_569e52e/std/js/html/ExtendableEventInit.hx new file mode 100644 index 0000000..825c6ee --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ExtendableEventInit.hx @@ -0,0 +1,28 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\ExtendableEvent.webidl. Do not edit! + +package js.html; + +typedef ExtendableEventInit = EventInit & { +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/ExtendableMessageEvent.hx b/build/linux64_569e52e/std/js/html/ExtendableMessageEvent.hx new file mode 100644 index 0000000..59b1d07 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ExtendableMessageEvent.hx @@ -0,0 +1,64 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\ExtendableMessageEvent.webidl. Do not edit! + +package js.html; + +/** + The `ExtendableMessageEvent` interface of the `ServiceWorker API` represents the event object of a `message` event fired on a service worker (when a channel message is received on the `ServiceWorkerGlobalScope` from another context) — extends the lifetime of such events. + + Documentation [ExtendableMessageEvent](https://developer.mozilla.org/en-US/docs/Web/API/ExtendableMessageEvent) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/ExtendableMessageEvent$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("ExtendableMessageEvent") +extern class ExtendableMessageEvent extends ExtendableEvent { + + /** + Returns the event's data. It can be any data type. + **/ + var data(default,null) : Dynamic; + + /** + Returns the origin of the `ServiceWorkerClient` that sent the message + **/ + var origin(default,null) : String; + + /** + Represents, in server-sent events, the last event ID of the event source. + **/ + var lastEventId(default,null) : String; + + /** + Returns a reference to the service worker that sent the message. + **/ + var source(default,null) : haxe.extern.EitherType>; + + /** + Returns the array containing the `MessagePort` objects representing the ports of the associated message channel. + **/ + var ports(default,null) : Array; + + /** @throws DOMError */ + function new( type : String, ?eventInitDict : ExtendableMessageEventInit ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/ExtendableMessageEventInit.hx b/build/linux64_569e52e/std/js/html/ExtendableMessageEventInit.hx new file mode 100644 index 0000000..3095412 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/ExtendableMessageEventInit.hx @@ -0,0 +1,33 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\ExtendableMessageEvent.webidl. Do not edit! + +package js.html; + +typedef ExtendableMessageEventInit = ExtendableEventInit & { + var ?data : Dynamic; + var ?lastEventId : String; + var ?origin : String; + var ?ports : Array; + var ?source : haxe.extern.EitherType>; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/External.hx b/build/linux64_569e52e/std/js/html/External.hx new file mode 100644 index 0000000..85470c2 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/External.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\External.webidl. Do not edit! + +package js.html; + +typedef External = { + function AddSearchProvider( aDescriptionURL : String ) : Void; + function IsSearchProviderInstalled( aSearchURL : String ) : Int; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FetchEvent.hx b/build/linux64_569e52e/std/js/html/FetchEvent.hx new file mode 100644 index 0000000..7abb7db --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FetchEvent.hx @@ -0,0 +1,58 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FetchEvent.webidl. Do not edit! + +package js.html; + +import js.lib.Promise; + +/** + This is the event type for `fetch` events dispatched on the service worker global scope. It contains information about the fetch, including the request and how the receiver will treat the response. It provides the `event.respondWith()` method, which allows us to provide a response to this fetch. + + Documentation [FetchEvent](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("FetchEvent") +extern class FetchEvent extends ExtendableEvent { + + /** + The `Request` the browser intends to make. + **/ + var request(default,null) : Request; + + /** + The `Client.id` of the same-origin `Client` that initiated the fetch. + **/ + var clientId(default,null) : String; + var isReload(default,null) : Bool; + + /** @throws DOMError */ + function new( type : String, eventInitDict : FetchEventInit ) : Void; + + /** + Prevent the browser's default fetch handling, and provide (a promise for) a response yourself. + @throws DOMError + **/ + function respondWith( r : Promise ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FetchEventInit.hx b/build/linux64_569e52e/std/js/html/FetchEventInit.hx new file mode 100644 index 0000000..1bf3aac --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FetchEventInit.hx @@ -0,0 +1,31 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FetchEvent.webidl. Do not edit! + +package js.html; + +typedef FetchEventInit = EventInit & { + var ?clientId : String; + var ?isReload : Bool; + var request : Request; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FetchObserver.hx b/build/linux64_569e52e/std/js/html/FetchObserver.hx new file mode 100644 index 0000000..e337944 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FetchObserver.hx @@ -0,0 +1,34 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FetchObserver.webidl. Do not edit! + +package js.html; + +@:native("FetchObserver") +extern class FetchObserver extends EventTarget { + var state(default,null) : FetchState; + var onstatechange : haxe.Constraints.Function; + var onrequestprogress : haxe.Constraints.Function; + var onresponseprogress : haxe.Constraints.Function; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FetchState.hx b/build/linux64_569e52e/std/js/html/FetchState.hx new file mode 100644 index 0000000..a8ae5c3 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FetchState.hx @@ -0,0 +1,33 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FetchObserver.webidl. Do not edit! + +package js.html; + +enum abstract FetchState(String) { + var REQUESTING = "requesting"; + var RESPONDING = "responding"; + var ABORTED = "aborted"; + var ERRORED = "errored"; + var COMPLETE = "complete"; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FieldSetElement.hx b/build/linux64_569e52e/std/js/html/FieldSetElement.hx new file mode 100644 index 0000000..75a2d70 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FieldSetElement.hx @@ -0,0 +1,90 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLFieldSetElement.webidl. Do not edit! + +package js.html; + +/** + The `HTMLFieldSetElement` interface has special properties and methods (beyond the regular `HTMLElement` interface it also has available to it by inheritance) for manipulating the layout and presentation of field-set elements. + + Documentation [HTMLFieldSetElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFieldSetElement) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFieldSetElement$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("HTMLFieldSetElement") +extern class FieldSetElement extends Element { + + /** + A `Boolean` reflecting the `disabled` HTML attribute, indicating whether the user can interact with the control. + **/ + var disabled : Bool; + + /** + An `HTMLFormControlsCollection` or `HTMLCollection` referencing the containing form element, if this element is in a form. + + If the field set is not a descendant of a form element, then the attribute can be the ID of any form element in the same document it is related to, or the `null` value if none matches. + **/ + var form(default,null) : FormElement; + + /** + A `DOMString` reflecting the `name` HTML attribute, containing the name of the field set, used for submitting the form. + **/ + var name : String; + + /** + The `DOMString` `"fieldset"`. + **/ + var type(default,null) : String; + + /** + The elements belonging to this field set. The type of this property depends on the version of the spec that is implemented by the browser. + **/ + var elements(default,null) : HTMLCollection; + + /** + A `Boolean` `false`, because `fieldset` objects are never candidates for constraint validation. + **/ + var willValidate(default,null) : Bool; + + /** + A `ValidityState` representing the validity states that this element is in. + **/ + var validity(default,null) : ValidityState; + + /** + A `DOMString` representing a localized message that describes the validation constraints that the element does not satisfy (if any). This is the empty string if the element is not a candidate for constraint validation (`willValidate` is `false`), or it satisfies its constraints. + **/ + var validationMessage(default,null) : String; + + + /** + Always returns `true` because `fieldset` objects are never candidates for constraint validation. + **/ + function checkValidity() : Bool; + function reportValidity() : Bool; + + /** + Sets a custom validity message for the field set. If this message is not the empty string, then the field set is suffering from a custom validity error, and does not validate. + **/ + function setCustomValidity( error : String ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/File.hx b/build/linux64_569e52e/std/js/html/File.hx new file mode 100644 index 0000000..addade8 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/File.hx @@ -0,0 +1,49 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\File.webidl. Do not edit! + +package js.html; + +/** + The `File` interface provides information about files and allows JavaScript in a web page to access their content. + + Documentation [File](https://developer.mozilla.org/en-US/docs/Web/API/File) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/File$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("File") +extern class File extends Blob { + + /** + Returns the name of the file referenced by the `File` object. + **/ + var name(default,null) : String; + + /** + Returns the last modified time of the file, in millisecond since the UNIX epoch (January 1st, 1970 at Midnight). + **/ + var lastModified(default,null) : Int; + + /** @throws DOMError */ + function new( fileBits : Array,haxe.extern.EitherType>>, fileName : String, ?options : FilePropertyBag ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FileCallback.hx b/build/linux64_569e52e/std/js/html/FileCallback.hx new file mode 100644 index 0000000..85e4631 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FileCallback.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FileSystemFileEntry.webidl. Do not edit! + +package js.html; + +typedef FileCallback = { + function handleEvent( file : File ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FileList.hx b/build/linux64_569e52e/std/js/html/FileList.hx new file mode 100644 index 0000000..f30481e --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FileList.hx @@ -0,0 +1,39 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FileList.webidl. Do not edit! + +package js.html; + +/** + An object of this type is returned by the `files` property of the HTML `input` element; this lets you access the list of files selected with the `input type="file"` element. It's also used for a list of files dropped into web content when using the drag and drop API; see the `DataTransfer` object for details on this usage. + + Documentation [FileList](https://developer.mozilla.org/en-US/docs/Web/API/FileList) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/FileList$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("FileList") +extern class FileList implements ArrayAccess { + var length(default,null) : Int; + + function item( index : Int ) : File; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FileMode.hx b/build/linux64_569e52e/std/js/html/FileMode.hx new file mode 100644 index 0000000..61dee01 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FileMode.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FileMode.webidl. Do not edit! + +package js.html; + +enum abstract FileMode(String) { + var READONLY = "readonly"; + var READWRITE = "readwrite"; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FilePropertyBag.hx b/build/linux64_569e52e/std/js/html/FilePropertyBag.hx new file mode 100644 index 0000000..a3994d9 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FilePropertyBag.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\File.webidl. Do not edit! + +package js.html; + +typedef FilePropertyBag = { + var ?lastModified : Int; + var ?type : String; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FileReader.hx b/build/linux64_569e52e/std/js/html/FileReader.hx new file mode 100644 index 0000000..261c3de --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FileReader.hx @@ -0,0 +1,137 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FileReader.webidl. Do not edit! + +package js.html; + +/** + The `FileReader` object lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using `File` or `Blob` objects to specify the file or data to read. + + Documentation [FileReader](https://developer.mozilla.org/en-US/docs/Web/API/FileReader) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/FileReader$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("FileReader") +extern class FileReader extends EventTarget { + static inline var EMPTY : Int = 0; + static inline var LOADING : Int = 1; + static inline var DONE : Int = 2; + + + /** + A number indicating the state of the FileReader. This is one of the following: + + + + + + + + + + + + + + + + + + +
EMPTY0No data has been loaded yet.
LOADING1Data is currently being loaded.
DONE2The entire read request has been completed.
+ + **/ + var readyState(default,null) : Int; + + /** + The file's contents. This property is only valid after the read operation is complete, and the format of the data depends on which of the methods was used to initiate the read operation. + **/ + var result(default,null) : Dynamic; + + /** + A `DOMException` representing the error that occurred while reading the file. + **/ + var error(default,null) : DOMException; + + /** + A handler for the `loadstart` event. This event is triggered each time the reading is starting. + **/ + var onloadstart : haxe.Constraints.Function; + + /** + A handler for the `progress` event. This event is triggered while reading a `Blob` content. + **/ + var onprogress : haxe.Constraints.Function; + + /** + A handler for the `load` event. This event is triggered each time the reading operation is successfully completed. + **/ + var onload : haxe.Constraints.Function; + + /** + A handler for the `abort` event. This event is triggered each time the reading operation is aborted. + **/ + var onabort : haxe.Constraints.Function; + + /** + A handler for the `error` event. This event is triggered each time the reading operation encounter an error. + **/ + var onerror : haxe.Constraints.Function; + + /** + A handler for the `loadend` event. This event is triggered each time the reading operation is completed (either in success or failure). + **/ + var onloadend : haxe.Constraints.Function; + + /** @throws DOMError */ + function new() : Void; + + /** + Starts reading the contents of the specified `Blob`, once finished, the `result` attribute contains an `ArrayBuffer` representing the file's data. + @throws DOMError + **/ + function readAsArrayBuffer( blob : Blob ) : Void; + + /** + Starts reading the contents of the specified `Blob`, once finished, the `result` attribute contains the raw binary data from the file as a string. + @throws DOMError + **/ + function readAsBinaryString( filedata : Blob ) : Void; + + /** + Starts reading the contents of the specified `Blob`, once finished, the `result` attribute contains the contents of the file as a text string. + @throws DOMError + **/ + function readAsText( blob : Blob, ?label : String ) : Void; + + /** + Starts reading the contents of the specified `Blob`, once finished, the `result` attribute contains a `data:` URL representing the file's data. + @throws DOMError + **/ + function readAsDataURL( blob : Blob ) : Void; + + /** + Aborts the read operation. Upon return, the `readyState` will be `DONE`. + **/ + function abort() : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FileReaderSync.hx b/build/linux64_569e52e/std/js/html/FileReaderSync.hx new file mode 100644 index 0000000..a5c0f45 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FileReaderSync.hx @@ -0,0 +1,46 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FileReaderSync.webidl. Do not edit! + +package js.html; + +/** + The `FileReaderSync` interface allows to read `File` or `Blob` objects in a synchronous way. + + Documentation [FileReaderSync](https://developer.mozilla.org/en-US/docs/Web/API/FileReaderSync) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/FileReaderSync$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("FileReaderSync") +extern class FileReaderSync { + /** @throws DOMError */ + function new() : Void; + /** @throws DOMError */ + function readAsArrayBuffer( blob : Blob ) : js.lib.ArrayBuffer; + /** @throws DOMError */ + function readAsBinaryString( blob : Blob ) : String; + /** @throws DOMError */ + function readAsText( blob : Blob, ?encoding : String ) : String; + /** @throws DOMError */ + function readAsDataURL( blob : Blob ) : String; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FileSystem.hx b/build/linux64_569e52e/std/js/html/FileSystem.hx new file mode 100644 index 0000000..c23ee3f --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FileSystem.hx @@ -0,0 +1,47 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FileSystem.webidl. Do not edit! + +package js.html; + +/** + The File and Directory Entries API interface `FileSystem` is used to represent a file system. These objects can be obtained from the `filesystem` property on any file system entry. Some browsers offer additional APIs to create and manage file systems, such as Chrome's `requestFileSystem()` method. + + Documentation [FileSystem](https://developer.mozilla.org/en-US/docs/Web/API/FileSystem) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/FileSystem$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("FileSystem") +extern class FileSystem { + + /** + A `USVString` representing the file system's name. This name is unique among the entire list of exposed file systems. + **/ + var name(default,null) : String; + + /** + A `FileSystemDirectoryEntry` object which represents the file system's root directory. Through this object, you can gain access to all files and directories in the file system. + **/ + var root(default,null) : FileSystemDirectoryEntry; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FileSystemDirectoryEntry.hx b/build/linux64_569e52e/std/js/html/FileSystemDirectoryEntry.hx new file mode 100644 index 0000000..675448b --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FileSystemDirectoryEntry.hx @@ -0,0 +1,43 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FileSystemDirectoryEntry.webidl. Do not edit! + +package js.html; + +/** + The `FileSystemDirectoryEntry` interface of the File and Directory Entries API represents a directory in a file system. It provides methods which make it possible to access and manipulate the files in a directory, as well as to access the entries within the directory. + + Documentation [FileSystemDirectoryEntry](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("FileSystemDirectoryEntry") +extern class FileSystemDirectoryEntry extends FileSystemEntry { + function createReader() : FileSystemDirectoryReader; + @:overload( function( ?path : String, ?options : FileSystemFlags, ?successCallback : haxe.Constraints.Function, ?errorCallback : haxe.Constraints.Function) : Void {} ) + @:overload( function( ?path : String, ?options : FileSystemFlags, ?successCallback : FileSystemEntryCallback, ?errorCallback : ErrorCallback) : Void {} ) + function getFile( ?path : String, ?options : FileSystemFlags, ?successCallback : FileSystemEntry -> Void, ?errorCallback : DOMException -> Void ) : Void; + @:overload( function( ?path : String, ?options : FileSystemFlags, ?successCallback : haxe.Constraints.Function, ?errorCallback : haxe.Constraints.Function) : Void {} ) + @:overload( function( ?path : String, ?options : FileSystemFlags, ?successCallback : FileSystemEntryCallback, ?errorCallback : ErrorCallback) : Void {} ) + function getDirectory( ?path : String, ?options : FileSystemFlags, ?successCallback : FileSystemEntry -> Void, ?errorCallback : DOMException -> Void ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FileSystemDirectoryReader.hx b/build/linux64_569e52e/std/js/html/FileSystemDirectoryReader.hx new file mode 100644 index 0000000..097468b --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FileSystemDirectoryReader.hx @@ -0,0 +1,40 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FileSystemDirectoryReader.webidl. Do not edit! + +package js.html; + +/** + The `FileSystemDirectoryReader` interface of the File and Directory Entries API lets you access the `FileEntry`-based objects (generally `FileSystemFileEntry` or `FileSystemDirectoryEntry`) representing each entry in a directory. + + Documentation [FileSystemDirectoryReader](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryReader) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryReader$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("FileSystemDirectoryReader") +extern class FileSystemDirectoryReader { + /** @throws DOMError */ + @:overload( function( successCallback : haxe.Constraints.Function, ?errorCallback : haxe.Constraints.Function) : Void {} ) + @:overload( function( successCallback : FileSystemEntriesCallback, ?errorCallback : ErrorCallback) : Void {} ) + function readEntries( successCallback : Array -> Void, ?errorCallback : DOMException -> Void ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FileSystemEntriesCallback.hx b/build/linux64_569e52e/std/js/html/FileSystemEntriesCallback.hx new file mode 100644 index 0000000..8ff8dd3 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FileSystemEntriesCallback.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FileSystemDirectoryReader.webidl. Do not edit! + +package js.html; + +typedef FileSystemEntriesCallback = { + function handleEvent( entries : Array ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FileSystemEntry.hx b/build/linux64_569e52e/std/js/html/FileSystemEntry.hx new file mode 100644 index 0000000..1dbfc34 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FileSystemEntry.hx @@ -0,0 +1,65 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FileSystemEntry.webidl. Do not edit! + +package js.html; + +/** + The `FileSystemEntry` interface of the File and Directory Entries API represents a single in a file system. The entry can be a file or a directory (directories are represented by the `DirectoryEntry` interface). It includes methods for working with files—including copying, moving, removing, and reading files—as well as information about a file it points to—including the file name and its path from the root to the entry. + + Documentation [FileSystemEntry](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemEntry) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemEntry$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("FileSystemEntry") +extern class FileSystemEntry { + + /** + A Boolean which is `true` if the entry represents a file. If it's not a file, this value is `false`. + **/ + var isFile(default,null) : Bool; + + /** + A `Boolean` which is `true` if the entry represents a directory; otherwise, it's `false`. + **/ + var isDirectory(default,null) : Bool; + + /** + A `USVString` containing the name of the entry (the final part of the path, after the last "/" character). + **/ + var name(default,null) : String; + + /** + A `USVString` object which provides the full, absolute path from the file system's root to the entry; it can also be thought of as a path which is relative to the root directory, prepended with a "/" character. + **/ + var fullPath(default,null) : String; + + /** + A `FileSystem` object representing the file system in which the entry is located. + **/ + var filesystem(default,null) : FileSystem; + + @:overload( function( ?successCallback : haxe.Constraints.Function, ?errorCallback : haxe.Constraints.Function) : Void {} ) + @:overload( function( ?successCallback : FileSystemEntryCallback, ?errorCallback : ErrorCallback) : Void {} ) + function getParent( ?successCallback : FileSystemEntry -> Void, ?errorCallback : DOMException -> Void ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FileSystemEntryCallback.hx b/build/linux64_569e52e/std/js/html/FileSystemEntryCallback.hx new file mode 100644 index 0000000..ee0e494 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FileSystemEntryCallback.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FileSystem.webidl. Do not edit! + +package js.html; + +typedef FileSystemEntryCallback = { + function handleEvent( entry : FileSystemEntry ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FileSystemFileEntry.hx b/build/linux64_569e52e/std/js/html/FileSystemFileEntry.hx new file mode 100644 index 0000000..8fb5e40 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FileSystemFileEntry.hx @@ -0,0 +1,39 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FileSystemFileEntry.webidl. Do not edit! + +package js.html; + +/** + The `FileSystemFileEntry` interface of the File System API represents a file in a file system. It offers properties describing the file's attributes, as well as the `file()` method, which creates a `File` object that can be used to read the file. + + Documentation [FileSystemFileEntry](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileEntry) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileEntry$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("FileSystemFileEntry") +extern class FileSystemFileEntry extends FileSystemEntry { + @:overload( function( successCallback : haxe.Constraints.Function, ?errorCallback : haxe.Constraints.Function) : Void {} ) + @:overload( function( successCallback : FileCallback, ?errorCallback : ErrorCallback) : Void {} ) + function file( successCallback : File -> Void, ?errorCallback : DOMException -> Void ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FileSystemFlags.hx b/build/linux64_569e52e/std/js/html/FileSystemFlags.hx new file mode 100644 index 0000000..979d824 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FileSystemFlags.hx @@ -0,0 +1,45 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FileSystem.webidl. Do not edit! + +package js.html; + +/** + The `FileSystemFlags` dictionary defines a set of values which are used when specifying option flags when calling certain methods in the File and Directory Entries API. Methods which accept an options parameter of this type may specify zero or more of these flags as fields in an object, like this: + + Documentation [FileSystemFlags](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFlags) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFlags$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +typedef FileSystemFlags = { + + /** + If this property is `true`, and the requested file or directory doesn't exist, the user agent should create it. The default is `false`. The parent directory must already exist. + **/ + var ?create : Bool; + + /** + If `true`, and the `create` option is also `true`, the file must not exist prior to issuing the call. Instead, it must be possible for it to be created newly at call time. The default is `false`. + **/ + var ?exclusive : Bool; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FillMode.hx b/build/linux64_569e52e/std/js/html/FillMode.hx new file mode 100644 index 0000000..57b14a9 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FillMode.hx @@ -0,0 +1,33 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\AnimationEffect.webidl. Do not edit! + +package js.html; + +enum abstract FillMode(String) { + var NONE = "none"; + var FORWARDS = "forwards"; + var BACKWARDS = "backwards"; + var BOTH = "both"; + var AUTO = "auto"; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/Float32Array.hx b/build/linux64_569e52e/std/js/html/Float32Array.hx new file mode 100644 index 0000000..3a9b21c --- /dev/null +++ b/build/linux64_569e52e/std/js/html/Float32Array.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package js.html; + +@:deprecated typedef Float32Array = js.lib.Float32Array; diff --git a/build/linux64_569e52e/std/js/html/Float64Array.hx b/build/linux64_569e52e/std/js/html/Float64Array.hx new file mode 100644 index 0000000..e1249aa --- /dev/null +++ b/build/linux64_569e52e/std/js/html/Float64Array.hx @@ -0,0 +1,25 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package js.html; + +@:deprecated typedef Float64Array = js.lib.Float64Array; diff --git a/build/linux64_569e52e/std/js/html/FocusEvent.hx b/build/linux64_569e52e/std/js/html/FocusEvent.hx new file mode 100644 index 0000000..33bf935 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FocusEvent.hx @@ -0,0 +1,44 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FocusEvent.webidl. Do not edit! + +package js.html; + +/** + The `FocusEvent` interface represents focus-related events like `focus`, `blur`, `focusin`, or `focusout`. + + Documentation [FocusEvent](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("FocusEvent") +extern class FocusEvent extends UIEvent { + + /** + Is an `EventTarget` representing a secondary target for this event. As in some cases (like when tabbing in or out a page), this property may be set to `null` for security reasons. + **/ + var relatedTarget(default,null) : EventTarget; + + /** @throws DOMError */ + function new( typeArg : String, ?focusEventInitDict : FocusEventInit ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FocusEventInit.hx b/build/linux64_569e52e/std/js/html/FocusEventInit.hx new file mode 100644 index 0000000..3e6d60c --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FocusEventInit.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FocusEvent.webidl. Do not edit! + +package js.html; + +typedef FocusEventInit = UIEventInit & { + var ?relatedTarget : EventTarget; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FontElement.hx b/build/linux64_569e52e/std/js/html/FontElement.hx new file mode 100644 index 0000000..15d7ffb --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FontElement.hx @@ -0,0 +1,52 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLFontElement.webidl. Do not edit! + +package js.html; + +/** + Implements the document object model (DOM) representation of the font element. The HTML Font Element `font` defines the font size, font face and color of text. + + Documentation [HTMLFontElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFontElement) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFontElement$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("HTMLFontElement") +extern class FontElement extends Element { + + /** + Is a `DOMString` that reflects the `color` HTML attribute, containing either a named color or a color specified in the hexadecimal #RRGGBB format. + **/ + var color : String; + + /** + Is a `DOMString` that reflects the `face` HTML attribute, containing a comma-separated list of one or more font names. + **/ + var face : String; + + /** + Is a `DOMString` that reflects the `size` HTML attribute, containing either a font size number ranging from 1 to 7 or a relative size to the `size` attribute of the `basefont` element, for example -2 or +1. + **/ + var size : String; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FontFace.hx b/build/linux64_569e52e/std/js/html/FontFace.hx new file mode 100644 index 0000000..7110e6a --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FontFace.hx @@ -0,0 +1,94 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FontFace.webidl. Do not edit! + +package js.html; + +import js.lib.Promise; + +/** + The `FontFace` interface represents a single usable font face. It allows control of the source of the font face, being a URL to an external resource, or a buffer; it also allows control of when the font face is loaded and its current status. + + Documentation [FontFace](https://developer.mozilla.org/en-US/docs/Web/API/FontFace) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/FontFace$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("FontFace") +extern class FontFace { + + /** + Is a `CSSOMString` that contains the family of the font. It is equivalent to the `@font-face/font-family` descriptor. + **/ + var family : String; + + /** + Is a `CSSOMString` that contains the style of the font. It is equivalent to the `@font-face/font-style` descriptor. + **/ + var style : String; + + /** + Is a `CSSOMString` that contains the weight of the font. It is equivalent to the `@font-face/font-weight` descriptor. + **/ + var weight : String; + + /** + Is a `CSSOMString` that contains how the font stretches. It is equivalent to the `@font-face/font-stretch` descriptor. + **/ + var stretch : String; + + /** + Is a `CSSOMString` that contains the range of code encompassed the font. It is equivalent to the `@font-face/unicode-range` descriptor. + **/ + var unicodeRange : String; + + /** + Is a `CSSOMString` that contains the variant of the font. It is equivalent to the `@font-face/font-variant` descriptor. + **/ + var variant : String; + + /** + Is a `CSSOMString` that contains the features of the font. It is equivalent to the `@font-face/font-feature-settings`descriptor. + **/ + var featureSettings : String; + + /** + Returns an enumerated value indicating the status of the font. It can be one of the following: `"unloaded"`, `"loading"`, `"loaded"`, or `"error"`. + **/ + var status(default,null) : FontFaceLoadStatus; + + /** + Returns a `Promise` to a `FontFace` that fulfills when the font is completely loaded and rejects when an error happens. + **/ + var loaded(default,null) : Promise; + + /** @throws DOMError */ + @:overload( function( family : String, source : js.lib.ArrayBuffer, ?descriptors : FontFaceDescriptors) : FontFace {} ) + @:overload( function( family : String, source : js.lib.ArrayBufferView, ?descriptors : FontFaceDescriptors) : FontFace {} ) + function new( family : String, source : String, ?descriptors : FontFaceDescriptors ) : Void; + + /** + Loads the font, returning a `Promise` to a `FontFace` that fulfills when the font is completely loaded and rejects when an error happens. + @throws DOMError + **/ + function load() : Promise; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FontFaceDescriptors.hx b/build/linux64_569e52e/std/js/html/FontFaceDescriptors.hx new file mode 100644 index 0000000..d42f979 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FontFaceDescriptors.hx @@ -0,0 +1,36 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FontFace.webidl. Do not edit! + +package js.html; + +typedef FontFaceDescriptors = { + var ?display : String; + var ?featureSettings : String; + var ?stretch : String; + var ?style : String; + var ?unicodeRange : String; + var ?variant : String; + var ?variationSettings : String; + var ?weight : String; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FontFaceLoadStatus.hx b/build/linux64_569e52e/std/js/html/FontFaceLoadStatus.hx new file mode 100644 index 0000000..5fec36d --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FontFaceLoadStatus.hx @@ -0,0 +1,32 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FontFace.webidl. Do not edit! + +package js.html; + +enum abstract FontFaceLoadStatus(String) { + var UNLOADED = "unloaded"; + var LOADING = "loading"; + var LOADED = "loaded"; + var ERROR = "error"; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FontFaceSet.hx b/build/linux64_569e52e/std/js/html/FontFaceSet.hx new file mode 100644 index 0000000..85f5de5 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FontFaceSet.hx @@ -0,0 +1,73 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FontFaceSet.webidl. Do not edit! + +package js.html; + +import js.lib.Promise; + +/** + The `FontFaceSet` interface of the CSS Font Loading API manages the loading of font-faces and querying of their download status. + + Documentation [FontFaceSet](https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("FontFaceSet") +extern class FontFaceSet extends EventTarget { + var size(default,null) : Int; + + /** + An `EventListener` called whenever an event of type `loading` is fired, indicating a font-face set has started loading. + **/ + var onloading : haxe.Constraints.Function; + + /** + An `EventListener` called whenever an event of type `loadingdone` is fired, indicating that a font face set has finished loading. + **/ + var onloadingdone : haxe.Constraints.Function; + + /** + An `EventListener` called whenever an event of type `loadingerror` is fired, indicating that an error occurred whilst loading a font-face set. + **/ + var onloadingerror : haxe.Constraints.Function; + var ready(default,null) : Promise; + + /** + Indicates the font-face's loading status. It will be one of `'loading'` or `'loaded'`. + **/ + var status(default,null) : FontFaceSetLoadStatus; + + /** @throws DOMError */ + function add( font : FontFace ) : Void; + function has( font : FontFace ) : Bool; + function delete( font : FontFace ) : Bool; + function clear() : Void; + function entries() : FontFaceSetIterator; + function values() : FontFaceSetIterator; + /** @throws DOMError */ + function forEach( cb : FontFace -> FontFace -> FontFaceSet -> Void, ?thisArg : Dynamic ) : Void; + function load( font : String, text : String = " " ) : Promise>; + /** @throws DOMError */ + function check( font : String, text : String = " " ) : Bool; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FontFaceSetIterator.hx b/build/linux64_569e52e/std/js/html/FontFaceSetIterator.hx new file mode 100644 index 0000000..972b78f --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FontFaceSetIterator.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FontFaceSet.webidl. Do not edit! + +package js.html; + +typedef FontFaceSetIterator = { + /** @throws DOMError */ + function next() : FontFaceSetIteratorResult; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FontFaceSetIteratorResult.hx b/build/linux64_569e52e/std/js/html/FontFaceSetIteratorResult.hx new file mode 100644 index 0000000..219b0ff --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FontFaceSetIteratorResult.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FontFaceSet.webidl. Do not edit! + +package js.html; + +typedef FontFaceSetIteratorResult = { + var done : Bool; + var value : Dynamic; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FontFaceSetLoadEvent.hx b/build/linux64_569e52e/std/js/html/FontFaceSetLoadEvent.hx new file mode 100644 index 0000000..c445f1c --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FontFaceSetLoadEvent.hx @@ -0,0 +1,44 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FontFaceSetLoadEvent.webidl. Do not edit! + +package js.html; + +/** + The `FontFaceSetLoadEvent` interface of the the Css Font Loading API is fired whenever a `FontFaceSet` loads. + + Documentation [FontFaceSetLoadEvent](https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSetLoadEvent) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSetLoadEvent$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("FontFaceSetLoadEvent") +extern class FontFaceSetLoadEvent extends Event { + + /** + Returns an array of `FontFace` instances each of which represents a single usable font. + **/ + var fontfaces(default,null) : Array; + + /** @throws DOMError */ + function new( type : String, ?eventInitDict : FontFaceSetLoadEventInit ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FontFaceSetLoadEventInit.hx b/build/linux64_569e52e/std/js/html/FontFaceSetLoadEventInit.hx new file mode 100644 index 0000000..5cfe37a --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FontFaceSetLoadEventInit.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FontFaceSetLoadEvent.webidl. Do not edit! + +package js.html; + +typedef FontFaceSetLoadEventInit = EventInit & { + var ?fontfaces : Array; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FontFaceSetLoadStatus.hx b/build/linux64_569e52e/std/js/html/FontFaceSetLoadStatus.hx new file mode 100644 index 0000000..9180e1f --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FontFaceSetLoadStatus.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FontFaceSet.webidl. Do not edit! + +package js.html; + +enum abstract FontFaceSetLoadStatus(String) { + var LOADING = "loading"; + var LOADED = "loaded"; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FormData.hx b/build/linux64_569e52e/std/js/html/FormData.hx new file mode 100644 index 0000000..0ac334c --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FormData.hx @@ -0,0 +1,92 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FormData.webidl. Do not edit! + +package js.html; + +/** + The `FormData` interface provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the `XMLHttpRequest.send()` method. It uses the same format a form would use if the encoding type were set to `"multipart/form-data"`. + + Documentation [FormData](https://developer.mozilla.org/en-US/docs/Web/API/FormData) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/FormData$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("FormData") +extern class FormData { + /** @throws DOMError */ + function new( ?form : FormElement ) : Void; + + /** + Appends a new value onto an existing key inside a `FormData` object, or adds the key if it does not already exist. + @throws DOMError + **/ + @:overload( function( name : String, value : Blob, ?filename : String ) : Void {} ) + function append( name : String, value : String ) : Void; + + /** + Deletes a key/value pair from a `FormData` object. + **/ + function delete( name : String ) : Void; + + /** + Returns the first value associated with a given key from within a `FormData` object. + **/ + function get( name : String ) : haxe.extern.EitherType>; + + /** + Returns an array of all the values associated with a given key from within a `FormData`. + **/ + function getAll( name : String ) : Array>>; + + /** + Returns a boolean stating whether a `FormData` object contains a certain key/value pair. + **/ + function has( name : String ) : Bool; + + /** + Sets a new value for an existing key inside a `FormData `object, or adds the key/value if it does not already exist. + @throws DOMError + **/ + @:overload( function( name : String, value : Blob, ?filename : String ) : Void {} ) + function set( name : String, value : String ) : Void; + + /** + Returns an `Iteration_protocols` allowing to go through all key/value pairs contained in this object. + @throws DOMError + **/ + function entries() : FormDataIterator; + + /** + Returns an `Iteration_protocols` allowing to go through all keys of the key/value pairs contained in this object. + @throws DOMError + **/ + function keys() : FormDataIterator; + + /** + Returns an `Iteration_protocols` allowing to go through all values of the key/value pairs contained in this object. + @throws DOMError + **/ + function values() : FormDataIterator; + /** @throws DOMError */ + function forEach( callback : Dynamic, ?thisArg : Dynamic ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FormDataIterator.hx b/build/linux64_569e52e/std/js/html/FormDataIterator.hx new file mode 100644 index 0000000..1af8740 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FormDataIterator.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\FormData.webidl. Do not edit! + +package js.html; + +typedef FormDataIterator = { + /** @throws DOMError */ + function next() : Dynamic; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FormElement.hx b/build/linux64_569e52e/std/js/html/FormElement.hx new file mode 100644 index 0000000..bfc9d01 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FormElement.hx @@ -0,0 +1,113 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLFormElement.webidl. Do not edit! + +package js.html; + +/** + The `HTMLFormElement` interface represents a `form` element in the DOM; it allows access to and in some cases modification of aspects of the form, as well as access to its component elements. + + Documentation [HTMLFormElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("HTMLFormElement") +extern class FormElement extends Element implements ArrayAccess { + + /** + A `DOMString` reflecting the value of the form's `accept-charset` HTML attribute, representing the character encoding that the server accepts. + **/ + var acceptCharset : String; + + /** + A `DOMString` reflecting the value of the form's `action` HTML attribute, containing the URI of a program that processes the information submitted by the form. + **/ + var action : String; + + /** + A `DOMString` reflecting the value of the form's `autocomplete` HTML attribute, indicating whether the controls in this form can have their values automatically populated by the browser. + **/ + var autocomplete : String; + + /** + A `DOMString` reflecting the value of the form's `enctype` HTML attribute, indicating the type of content that is used to transmit the form to the server. Only specified values can be set. The two properties are synonyms. + **/ + var enctype : String; + + /** + A `DOMString` reflecting the value of the form's `enctype` HTML attribute, indicating the type of content that is used to transmit the form to the server. Only specified values can be set. The two properties are synonyms. + **/ + var encoding : String; + + /** + A `DOMString` reflecting the value of the form's `method` HTML attribute, indicating the HTTP method used to submit the form. Only specified values can be set. + **/ + var method : String; + + /** + A `DOMString` reflecting the value of the form's `name` HTML attribute, containing the name of the form. + **/ + var name : String; + + /** + A `Boolean` reflecting the value of the form's  `novalidate` HTML attribute, indicating whether the form should not be validated. + **/ + var noValidate : Bool; + + /** + A `DOMString` reflecting the value of the form's `target` HTML attribute, indicating where to display the results received from submitting the form. + **/ + var target : String; + + /** + A `HTMLFormControlsCollection` holding all form controls belonging to this form element. + **/ + var elements(default,null) : HTMLCollection; + + /** + A `long` reflecting  the number of controls in the form. + **/ + var length(default,null) : Int; + + + /** + Submits the form to the server. + @throws DOMError + **/ + function submit() : Void; + + /** + Resets the form to its initial state. + **/ + function reset() : Void; + + /** + Returns `true` if the element's child controls are subject to constraint validation and satisfy those contraints; returns `false` if some controls do not satisfy their constraints. Fires an event named `invalid` at any control that does not satisfy its constraints; such controls are considered invalid if the event is not canceled. It is up to the programmer to decide how to respond to `false`. + **/ + function checkValidity() : Bool; + + /** + Returns `true` if the element's child controls satisfy their validation constraints. When `false` is returned, cancelable `invalid` events are fired for each invalid child and validation problems are reported to the user. + **/ + function reportValidity() : Bool; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FrameElement.hx b/build/linux64_569e52e/std/js/html/FrameElement.hx new file mode 100644 index 0000000..f4844c9 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FrameElement.hx @@ -0,0 +1,40 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLFrameElement.webidl. Do not edit! + +package js.html; + +@:native("HTMLFrameElement") +extern class FrameElement extends Element { + var name : String; + var scrolling : String; + var src : String; + var frameBorder : String; + var longDesc : String; + var noResize : Bool; + var contentDocument(default,null) : HTMLDocument; + var contentWindow(default,null) : Window; + var marginHeight : String; + var marginWidth : String; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FrameSetElement.hx b/build/linux64_569e52e/std/js/html/FrameSetElement.hx new file mode 100644 index 0000000..b973257 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FrameSetElement.hx @@ -0,0 +1,61 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLFrameSetElement.webidl. Do not edit! + +package js.html; + +/** + The `HTMLFrameSetElement` interface provides special properties (beyond those of the regular `HTMLElement` interface they also inherit) for manipulating `frameset` elements. + + Documentation [HTMLFrameSetElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFrameSetElement) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFrameSetElement$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("HTMLFrameSetElement") +extern class FrameSetElement extends Element { + + /** + Is a `DOMString` structured as a comma-seperated list specifing the width of each column inside a frameset. + **/ + var cols : String; + + /** + Is a `DOMString` structured as a comma-seperated list specifing the height of each column inside a frameset. + **/ + var rows : String; + var onafterprint : haxe.Constraints.Function; + var onbeforeprint : haxe.Constraints.Function; + var onbeforeunload : Event -> Null; + var onhashchange : haxe.Constraints.Function; + var onlanguagechange : haxe.Constraints.Function; + var onmessage : haxe.Constraints.Function; + var onmessageerror : haxe.Constraints.Function; + var onoffline : haxe.Constraints.Function; + var ononline : haxe.Constraints.Function; + var onpagehide : haxe.Constraints.Function; + var onpageshow : haxe.Constraints.Function; + var onpopstate : haxe.Constraints.Function; + var onstorage : haxe.Constraints.Function; + var onunload : haxe.Constraints.Function; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FrameType.hx b/build/linux64_569e52e/std/js/html/FrameType.hx new file mode 100644 index 0000000..9d18600 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FrameType.hx @@ -0,0 +1,32 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Client.webidl. Do not edit! + +package js.html; + +enum abstract FrameType(String) { + var AUXILIARY = "auxiliary"; + var TOP_LEVEL = "top-level"; + var NESTED = "nested"; + var NONE = "none"; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/FullscreenOptions.hx b/build/linux64_569e52e/std/js/html/FullscreenOptions.hx new file mode 100644 index 0000000..262dc73 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/FullscreenOptions.hx @@ -0,0 +1,40 @@ +/* + * Copyright (C)2005-2022 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package js.html; + +/** + An object that controls the behavior of the transition to fullscreen mode. +**/ +typedef FullscreenOptions = { + + /** + Controls whether or not to show navigation UI while the element is in fullscreen mode. + **/ + var ?navigationUI: FullscreenOptionsNavigationUI; +} + +enum abstract FullscreenOptionsNavigationUI(String) { + var Auto = "auto"; + var Hide = "hide"; + var Show = "show"; +} diff --git a/build/linux64_569e52e/std/js/html/Gamepad.hx b/build/linux64_569e52e/std/js/html/Gamepad.hx new file mode 100644 index 0000000..47b9cba --- /dev/null +++ b/build/linux64_569e52e/std/js/html/Gamepad.hx @@ -0,0 +1,72 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Gamepad.webidl. Do not edit! + +package js.html; + +/** + The `Gamepad` interface of the Gamepad API defines an individual gamepad or other controller, allowing access to information such as button presses, axis positions, and id. + + Documentation [Gamepad](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("Gamepad") +extern class Gamepad { + + /** + A `DOMString` containing identifying information about the controller. + **/ + var id(default,null) : String; + + /** + An integer that is auto-incremented to be unique for each device currently connected to the system. + **/ + var index(default,null) : Int; + + /** + A string indicating whether the browser has remapped the controls on the device to a known layout. + **/ + var mapping(default,null) : GamepadMappingType; + + /** + A boolean indicating whether the gamepad is still connected to the system. + **/ + var connected(default,null) : Bool; + + /** + An array of `gamepadButton` objects representing the buttons present on the device. + **/ + var buttons(default,null) : Array; + + /** + An array representing the controls with axes present on the device (e.g. analog thumb sticks). + **/ + var axes(default,null) : Array; + + /** + A `DOMHighResTimeStamp` representing the last time the data for this gamepad was updated. + **/ + var timestamp(default,null) : Float; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/GamepadButton.hx b/build/linux64_569e52e/std/js/html/GamepadButton.hx new file mode 100644 index 0000000..2511dd7 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/GamepadButton.hx @@ -0,0 +1,48 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Gamepad.webidl. Do not edit! + +package js.html; + +/** + The `GamepadButton` interface defines an individual button of a gamepad or other controller, allowing access to the current state of different types of buttons available on the control device. + + Documentation [GamepadButton](https://developer.mozilla.org/en-US/docs/Web/API/GamepadButton) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/GamepadButton$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("GamepadButton") +extern class GamepadButton { + + /** + A boolean value indicating whether the button is currently pressed (`true`) or unpressed (`false`). + **/ + var pressed(default,null) : Bool; + var touched(default,null) : Bool; + + /** + A double value used to represent the current state of analog buttons, such as the triggers on many modern gamepads. The values are normalized to the range 0.0 —1.0, with 0.0 representing a button that is not pressed, and 1.0 representing a button that is fully pressed. + **/ + var value(default,null) : Float; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/GamepadEvent.hx b/build/linux64_569e52e/std/js/html/GamepadEvent.hx new file mode 100644 index 0000000..b6d927d --- /dev/null +++ b/build/linux64_569e52e/std/js/html/GamepadEvent.hx @@ -0,0 +1,44 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\GamepadEvent.webidl. Do not edit! + +package js.html; + +/** + The GamepadEvent interface of the Gamepad API contains references to gamepads connected to the system, which is what the gamepad events `Window.gamepadconnected` and `Window.gamepaddisconnected` are fired in response to. + + Documentation [GamepadEvent](https://developer.mozilla.org/en-US/docs/Web/API/GamepadEvent) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/GamepadEvent$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("GamepadEvent") +extern class GamepadEvent extends Event { + + /** + Returns a `Gamepad` object, providing access to the associated gamepad data for the event fired. + **/ + var gamepad(default,null) : Gamepad; + + /** @throws DOMError */ + function new( type : String, ?eventInitDict : GamepadEventInit ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/GamepadEventInit.hx b/build/linux64_569e52e/std/js/html/GamepadEventInit.hx new file mode 100644 index 0000000..2576949 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/GamepadEventInit.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\GamepadEvent.webidl. Do not edit! + +package js.html; + +typedef GamepadEventInit = EventInit & { + var ?gamepad : Gamepad; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/GamepadMappingType.hx b/build/linux64_569e52e/std/js/html/GamepadMappingType.hx new file mode 100644 index 0000000..60fc84f --- /dev/null +++ b/build/linux64_569e52e/std/js/html/GamepadMappingType.hx @@ -0,0 +1,30 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Gamepad.webidl. Do not edit! + +package js.html; + +enum abstract GamepadMappingType(String) { + var NONE = ""; + var STANDARD = "standard"; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/Geolocation.hx b/build/linux64_569e52e/std/js/html/Geolocation.hx new file mode 100644 index 0000000..5697251 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/Geolocation.hx @@ -0,0 +1,52 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Geolocation.webidl. Do not edit! + +package js.html; + +/** + The `Geolocation` interface represents an object able to programmatically obtain the position of the device. It gives Web content access to the location of the device. This allows a Web site or app to offer customized results based on the user's location. + + Documentation [Geolocation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +typedef Geolocation = { + + /** + Determines the device's current location and gives back a `Position` object with the data. + @throws DOMError + **/ + function getCurrentPosition( successCallback : Position -> Void, ?errorCallback : PositionError -> Void, ?options : PositionOptions ) : Void; + + /** + Returns a `long` value representing the newly established callback function to be invoked whenever the device location changes. + @throws DOMError + **/ + function watchPosition( successCallback : Position -> Void, ?errorCallback : PositionError -> Void, ?options : PositionOptions ) : Int; + + /** + Removes the particular handler previously installed using `watchPosition()`. + **/ + function clearWatch( watchId : Int ) : Void; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/GetNotificationOptions.hx b/build/linux64_569e52e/std/js/html/GetNotificationOptions.hx new file mode 100644 index 0000000..313c924 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/GetNotificationOptions.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Notification.webidl. Do not edit! + +package js.html; + +typedef GetNotificationOptions = { + var ?tag : String; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/GetRootNodeOptions.hx b/build/linux64_569e52e/std/js/html/GetRootNodeOptions.hx new file mode 100644 index 0000000..1547721 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/GetRootNodeOptions.hx @@ -0,0 +1,29 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\Node.webidl. Do not edit! + +package js.html; + +typedef GetRootNodeOptions = { + var ?composed : Bool; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/GetUserMediaRequest.hx b/build/linux64_569e52e/std/js/html/GetUserMediaRequest.hx new file mode 100644 index 0000000..34b30f1 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/GetUserMediaRequest.hx @@ -0,0 +1,37 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\GetUserMediaRequest.webidl. Do not edit! + +package js.html; + +typedef GetUserMediaRequest = { + var windowID(default,null) : Int; + var innerWindowID(default,null) : Int; + var callID(default,null) : String; + var rawID(default,null) : String; + var mediaSource(default,null) : String; + var isSecure(default,null) : Bool; + var isHandlingUserInput(default,null) : Bool; + + function getConstraints() : MediaStreamConstraints; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/HRElement.hx b/build/linux64_569e52e/std/js/html/HRElement.hx new file mode 100644 index 0000000..b3ad0f6 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/HRElement.hx @@ -0,0 +1,42 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLHRElement.webidl. Do not edit! + +package js.html; + +/** + The `HTMLHRElement` interface provides special properties (beyond those of the `HTMLElement` interface it also has available to it by inheritance) for manipulating `hr` elements. + + Documentation [HTMLHRElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLHRElement) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/HTMLHRElement$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("HTMLHRElement") +extern class HRElement extends Element { + var align : String; + var color : String; + var noShade : Bool; + var size : String; + var width : String; + +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/HTMLAllCollection.hx b/build/linux64_569e52e/std/js/html/HTMLAllCollection.hx new file mode 100644 index 0000000..93eace7 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/HTMLAllCollection.hx @@ -0,0 +1,34 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLAllCollection.webidl. Do not edit! + +package js.html; + +@:native("HTMLAllCollection") +extern class HTMLAllCollection implements ArrayAccess { + var length(default,null) : Int; + + @:overload( function( index : Int ) : Node {} ) + function item( name : String ) : haxe.extern.EitherType; + function namedItem( name : String ) : haxe.extern.EitherType; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/HTMLCollection.hx b/build/linux64_569e52e/std/js/html/HTMLCollection.hx new file mode 100644 index 0000000..50ad111 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/HTMLCollection.hx @@ -0,0 +1,52 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLCollection.webidl. Do not edit! + +package js.html; + +/** + The `HTMLCollection` interface represents a generic collection (array-like object similar to arguments) of elements (in document order) and offers methods and properties for selecting from the list. + + Documentation [HTMLCollection](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCollection) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCollection$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("HTMLCollection") +extern class HTMLCollection implements ArrayAccess { + + /** + Returns the number of items in the collection. + **/ + var length(default,null) : Int; + + + /** + Returns the specific node at the given zero-based `index` into the list. Returns `null` if the `index` is out of range. + **/ + function item( index : Int ) : Element; + + /** + Returns the specific node whose ID or, as a fallback, name matches the string specified by `name`. Matching by name is only done as a last resort, only in HTML, and only if the referenced element supports the `name` attribute. Returns `null` if no node exists by the given name. + **/ + function namedItem( name : String ) : Element; +} \ No newline at end of file diff --git a/build/linux64_569e52e/std/js/html/HTMLDocument.hx b/build/linux64_569e52e/std/js/html/HTMLDocument.hx new file mode 100644 index 0000000..ccf56a6 --- /dev/null +++ b/build/linux64_569e52e/std/js/html/HTMLDocument.hx @@ -0,0 +1,197 @@ +/* + * Copyright (C)2005-2019 Haxe Foundation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +// This file is generated from mozilla\HTMLDocument.webidl. Do not edit! + +package js.html; + +/** + `HTMLDocument` is an abstract interface which extends the `Document` interface to add HTML-specific features to the document object. It represents the root of the HTML document, within which its entire DOM hierarchy resides. + + Documentation [HTMLDocument](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDocument) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDocument$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/). + + @see +**/ +@:native("HTMLDocument") +extern class HTMLDocument extends Document { + var domain : String; + var cookie : String; + var designMode : String; + var fgColor : String; + var linkColor : String; + var vlinkColor : String; + var alinkColor : String; + var bgColor : String; + var all(default,null) : HTMLAllCollection; + + /** @throws DOMError */ + @:overload( function( ?type : String, replace : String = "" ) : HTMLDocument {} ) + function open( url : String, name : String, features : String, replace : Bool = false ) : Window; + /** @throws DOMError */ + function close() : Void; + /** @throws DOMError */ + function write( text : haxe.extern.Rest ) : Void; + /** @throws DOMError */ + function writeln( text : haxe.extern.Rest ) : Void; + /** @throws DOMError */ + function execCommand( commandId : String, showUI : Bool = false, value : String = "" ) : Bool; + /** @throws DOMError */ + function queryCommandEnabled( commandId : String ) : Bool; + /** @throws DOMError */ + function queryCommandIndeterm( commandId : String ) : Bool; + /** @throws DOMError */ + function queryCommandState( commandId : String ) : Bool; + function queryCommandSupported( commandId : String ) : Bool; + /** @throws DOMError */ + function queryCommandValue( commandId : String ) : String; + function clear() : Void; + function captureEvents() : Void; + function releaseEvents() : Void; + /** Shorthand for creating an HTML `` element. */ + inline function createTableCellElement() : TableCellElement { return cast createElement("td"); } + /** Shorthand for creating an HTML `