Compare commits

...

21 Commits

Author SHA1 Message Date
Josh Tynjala
6acb0cb961 Merge branch '8.3.0-Dev' into 9.0.0-dev 2025-09-18 09:43:31 -07:00
Joseph Cloutier
4b74794c97 Merge branch '8.3.0-Dev' into 9.0.0-dev 2025-09-01 00:46:55 -04:00
player-03
a8407f4f19 Allow adding tags to AndroidManifest.xml from project.xml. (#1814)
* Reduce indentation in `ConfigData`.

* Use more specific return type for `getKeyValueArray()`.

* Reserve "config:" prefix when parsing config data.

* Use new reserved prefix to avoid collisions.

* `ConfigData`: use stored values instead of looking them up repeatedly.

Also, there's no need for `Reflect.hasField()`. We know it has the field, because we're iterating over `Reflect.fields()`.

* Fix extraneous null values in `ConfigData` arrays.

* Simplify control flow.

* Allow adding tags to AndroidManifest.xml from project.xml.

For instance, `<config:android><manifest><uses-permission android:name="xyz" /></manifest></config:android>` will copy the `uses-permission` tag directly into the manifest. This allows you to specify attributes like `android:maxSdkVersion` that aren't normally available.

* Fix `Std.isOfType()` being used in old Haxe versions.
2025-07-13 21:25:33 -04:00
Josh Tynjala
056664da14 Merge branch '8.3.0-Dev' into 9.0.0-dev 2025-06-04 13:51:12 -07:00
Josh Tynjala
d5dfcf0343 BackgroundWorker: fix syntax issue after removing conditional compilation for Haxe 3 2025-03-03 14:51:02 -08:00
Josh Tynjala
7dc7ea3bb5 Remove bundled Node.js executable
Commands that still require Node.js will attempt to use the system version on the PATH instead
2025-03-03 14:00:07 -08:00
Josh Tynjala
c3335e14de remove conditional compilation that existed to support Haxe 3
Haxe 3 will be dropped in Lime 9
2025-03-03 13:54:20 -08:00
Josh Tynjala
6bf8786247 haxelib.json: Lime 9.0.0 2025-03-03 13:29:09 -08:00
Josh Tynjala
94069fa840 actions: no longer supporting Haxe 3.4.7 in Lime 9 2025-03-03 13:28:46 -08:00
Josh Tynjala
1beaa23b38 Remove YUI Compressor
It has not been updated in years and can no longer handle modern JavaScript syntax emitted by the Haxe compiler
2025-03-03 13:27:32 -08:00
Josh Tynjala
31c2f7cdbf Merge branch '8.3.0-Dev' into 9.0.0-dev 2025-03-03 13:23:59 -08:00
player-03
e3dcc36733 Merge pull request #1846 from player-03/generic_Promise
Remove `@:generic` from `Promise`.
2024-12-19 13:53:00 -05:00
Joseph Cloutier
8b117b7d7b Remove @:generic from Promise. 2024-10-01 20:45:19 -04:00
Joseph Cloutier
c1de3bacb6 Merge branch '8.3.0-Dev' into 9.0.0-dev 2024-09-23 17:48:48 -04:00
player-03
ef7eef4bf3 Convert lime.tools.Architecture to enum abstract. (#1754)
* Convert `lime.tools.Architecture` to `enum abstract`.

This improves compatibility with `hxp.HostArchitecture` and provides a more user-friendly API than `try { Type.createEnum() }`.

* Add category functions to `Architecture`.

* Fix errors related to `Architecture`'s new type.

* Standardize formatting.

* Re-implement `Architecture.match()` for backwards compatibility.

* Add `Architecture` constructor for clarity.
2024-06-04 15:39:48 -04:00
Shahar Marcus
ead4402d5f Implement onDropStart, onDropEnd for file dropping (#1583)
* native side

* Theoretically, things should work

* brurh forgot a letter

* another quick cpp fix

* everything works now

* onDropText isnt fully supported

* Fix typo.

* Remove accidental cSpell addition to settings.json

* Dispatch `onDropStart` and `onDropEnd` events in HTML5.

---------

Co-authored-by: player-03 <player3.14@gmail.com>
2024-06-04 13:46:24 -04:00
Joseph Cloutier
e4782cb1b2 Merge branch '8.2.0-Dev' into 9.0.0-dev 2024-05-27 16:08:53 -04:00
Joseph Cloutier
8b67a62b6b Merge branch 'develop' into 9.0.0-dev 2024-02-05 12:58:48 -05:00
player-03
34975e3032 Merge pull request #1461 from loudoweb/consistent_dropfile
make html5 behavior of onDropFile same as native
2023-04-16 15:15:56 -04:00
player-03
3a0c796add Import js.html.URL instead of typing it inline. 2022-12-20 15:01:03 -05:00
loudoweb
bf70cc0bf7 make html5 behavior of onDropFile same as native 2021-05-06 10:59:11 +02:00
136 changed files with 584 additions and 1800 deletions

View File

@@ -770,7 +770,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
haxe-version: [3.4.7, 4.0.5, 4.1.5, 4.2.5, 4.3.6]
haxe-version: [4.0.5, 4.1.5, 4.2.5, 4.3.6]
steps:
- uses: actions/checkout@v4
@@ -804,7 +804,6 @@ jobs:
lime build HelloWorld html5 -release -verbose -nocolor
- name: Build HelloWorld variants
if: ${{ matrix.haxe-version != '3.4.7' }}
run: |
lime build HelloWorld html5 -clean -release -verbose -nocolor --haxelib=genes
lime build HelloWorld html5 -clean -release -verbose -nocolor -minify -terser
@@ -815,7 +814,6 @@ jobs:
lime build SimpleImage html5 -release -verbose -nocolor
- name: Build SimpleImage variants
if: ${{ matrix.haxe-version != '3.4.7' }}
run: |
lime build SimpleImage html5 -clean -release -verbose -nocolor --haxelib=genes
lime build SimpleImage html5 -clean -release -verbose -nocolor -minify -terser
@@ -826,7 +824,6 @@ jobs:
lime build SimpleAudio html5 -release -verbose -nocolor
- name: Build SimpleAudio variants
if: ${{ matrix.haxe-version != '3.4.7' }}
run: |
lime build SimpleAudio html5 -clean -release -verbose -nocolor --haxelib=genes
lime build SimpleAudio html5 -clean -release -verbose -nocolor -minify -terser
@@ -835,7 +832,7 @@ jobs:
needs: package-haxelib
strategy:
matrix:
haxe-version: [3.4.7, 4.2.5]
haxe-version: [4.2.5]
os: [windows-latest, ubuntu-22.04, macos-13]
runs-on: ${{ matrix.os }}
steps:

View File

@@ -136,6 +136,3 @@ This product bundles http-server 0.10.0 and its dependencies, which is available
This product bundles webify 0.1.1.0, which is available under an
"MIT" license. For details, see https://github.com/ananthakumaran/webify.
This product bundles YUI Compressor 2.4.7, which is available under an
"MIT" license. For details, see https://github.com/yui/yuicompressor.

View File

@@ -1,7 +1,7 @@
package flash.data;
@:native("flash.data.SQLCollationType")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract SQLCollationType(String)
extern enum abstract SQLCollationType(String)
{
var BINARY = "binary";
var NO_CASE = "noCase";

View File

@@ -1,7 +1,7 @@
package flash.data;
@:native("flash.data.SQLColumnNameStyle")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract SQLColumnNameStyle(String)
extern enum abstract SQLColumnNameStyle(String)
{
var DEFAULT = "default";
var LONG = "long";

View File

@@ -1,7 +1,7 @@
package flash.data;
@:native("flash.data.SQLMode")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract SQLMode(String)
extern enum abstract SQLMode(String)
{
var CREATE = "create";
var READ = "read";

View File

@@ -1,7 +1,7 @@
package flash.data;
@:native("flash.data.SQLTransactionLockType")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract SQLTransactionLockType(String)
extern enum abstract SQLTransactionLockType(String)
{
var DEFERRED = "deferred";
var EXCLUSIVE = "exclusive";

View File

@@ -1,7 +1,7 @@
package flash.desktop;
@:native("flash.desktop.InvokeEventReason")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract InvokeEventReason(String)
extern enum abstract InvokeEventReason(String)
{
var LOGIN = "login";
var NOTIFICATION = "notification";

View File

@@ -1,7 +1,7 @@
package flash.desktop;
@:native("flash.desktop.NativeDragActions")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract NativeDragActions(String)
extern enum abstract NativeDragActions(String)
{
var COPY = "copy";
var LINK = "link";

View File

@@ -1,7 +1,7 @@
package flash.desktop;
@:native("flash.desktop.NotificationType")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract NotificationType(String)
extern enum abstract NotificationType(String)
{
var CRITICAL = "critical";
var INFORMATIONAL = "informational";

View File

@@ -1,7 +1,7 @@
package flash.desktop;
@:native("flash.desktop.SystemIdleMode")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract SystemIdleMode(String)
extern enum abstract SystemIdleMode(String)
{
var KEEP_AWAKE = "keepAwake";
var NORMAL = "normal";

View File

@@ -1,7 +1,7 @@
package flash.display;
@:native("flash.display.NativeWindowDisplayState")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract NativeWindowDisplayState(String)
extern enum abstract NativeWindowDisplayState(String)
{
var MAXIMIZED = "maximized";
var MINIMIZED = "minimized";

View File

@@ -1,7 +1,7 @@
package flash.display;
@:native("flash.display.NativeWindowRenderMode")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract NativeWindowRenderMode(String)
extern enum abstract NativeWindowRenderMode(String)
{
var AUTO = "auto";
var CPU = "cpu";

View File

@@ -1,7 +1,7 @@
package flash.display;
@:native("flash.display.NativeWindowResize")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract NativeWindowResize(String)
extern enum abstract NativeWindowResize(String)
{
var BOTTOM = "bottom";
var BOTTOM_LEFT = "bottomLeft";

View File

@@ -1,7 +1,7 @@
package flash.display;
@:native("flash.display.NativeWindowSystemChrome")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract NativeWindowSystemChrome(String)
extern enum abstract NativeWindowSystemChrome(String)
{
var ALTERNATE = "alternate";
var NONE = "none";

View File

@@ -1,7 +1,7 @@
package flash.display;
@:native("flash.display.NativeWindowType")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract NativeWindowType(String)
extern enum abstract NativeWindowType(String)
{
var LIGHTWEIGHT = "lightweight";
var NORMAL = "normal";

View File

@@ -1,7 +1,7 @@
package flash.display;
@:native("flash.display.StageAspectRatio")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract StageAspectRatio(String)
extern enum abstract StageAspectRatio(String)
{
var ANY = "any";
var LANDSCAPE = "landscape";

View File

@@ -1,7 +1,7 @@
package flash.display;
@:native("flash.display.StageOrientation")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract StageOrientation(String)
extern enum abstract StageOrientation(String)
{
var DEFAULT = "default";
var ROTATED_LEFT = "rotatedLeft";

View File

@@ -1,7 +1,7 @@
package flash.display3D;
@:native("flash.display3D.Context3DProfile")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract Context3DProfile(String)
extern enum abstract Context3DProfile(String)
{
var BASELINE = "baseline";
var BASELINE_CONSTRAINED = "baselineConstrained";

View File

@@ -1,7 +1,7 @@
package flash.errors;
@:native("flash.errors.SQLErrorOperation")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract SQLErrorOperation(String)
extern enum abstract SQLErrorOperation(String)
{
var ANALYZE = "analyze";
var ATTACH = "attach";

View File

@@ -1,7 +1,7 @@
package flash.events;
@:native("flash.events.TouchEventIntent")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract TouchEventIntent(String)
extern enum abstract TouchEventIntent(String)
{
var ERASER = "eraser";
var PEN = "pen";

View File

@@ -1,7 +1,7 @@
package flash.filesystem;
@:native("flash.filesystem.FileMode")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract FileMode(String)
extern enum abstract FileMode(String)
{
var APPEND = "append";
var READ = "read";

View File

@@ -1,7 +1,7 @@
package flash.media;
@:native("flash.media.AudioPlaybackMode")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract AudioPlaybackMode(String)
extern enum abstract AudioPlaybackMode(String)
{
var AMBIENT = "ambient";
var MEDIA = "media";

View File

@@ -1,7 +1,7 @@
package flash.media;
@:native("flash.media.CameraPosition")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract CameraPosition(String)
extern enum abstract CameraPosition(String)
{
var BACK = "back";
var FRONT = "front";

View File

@@ -1,7 +1,7 @@
package flash.media;
@:native("flash.media.MediaType")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract MediaType(String)
extern enum abstract MediaType(String)
{
var IMAGE = "image";
var VIDEO = "video";

View File

@@ -1,7 +1,7 @@
package flash.net;
@:native("flash.net.IPVersion")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract IPVersion(String)
extern enum abstract IPVersion(String)
{
var IPV4 = "ipv4";
var IPV6 = "ipv6";

View File

@@ -1,7 +1,7 @@
package flash.notifications;
@:native("flash.notifications.NotificationStyle")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract NotificationStyle(String)
extern enum abstract NotificationStyle(String)
{
var ALERT = "alert";
var BADGE = "badge";

View File

@@ -1,7 +1,7 @@
package flash.printing;
@:native("flash.printing.PaperSize")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract PaperSize(String)
extern enum abstract PaperSize(String)
{
var A4 = "a4";
var A5 = "a5";

View File

@@ -1,7 +1,7 @@
package flash.printing;
@:native("flash.printing.PrintMethod")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract PrintMethod(String)
extern enum abstract PrintMethod(String)
{
var AUTO = "auto";
var BITMAP = "bitmap";

View File

@@ -1,7 +1,7 @@
package flash.security;
@:native("flash.security.ReferencesValidationSetting")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract ReferencesValidationSetting(String)
extern enum abstract ReferencesValidationSetting(String)
{
var NEVER = "never";
var VALID_IDENTITY = "validIdentity";

View File

@@ -1,7 +1,7 @@
package flash.security;
@:native("flash.security.RevocationCheckSettings")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract RevocationCheckSettings(String)
extern enum abstract RevocationCheckSettings(String)
{
var ALWAYS_REQUIRED = "alwaysRequired";
var BEST_EFFORT = "bestEffort";

View File

@@ -1,7 +1,7 @@
package flash.security;
@:native("flash.security.SignatureStatus")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract SignatureStatus(String)
extern enum abstract SignatureStatus(String)
{
var INVALID = "invalid";
var UNKNOWN = "unknown";

View File

@@ -1,7 +1,7 @@
package flash.security;
@:native("flash.security.SignerTrustSettings")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract SignerTrustSettings(String)
extern enum abstract SignerTrustSettings(String)
{
var CODE_SIGNING = "codeSigning";
var PLAYLIST_SIGNING = "playlistSigning";

View File

@@ -1,7 +1,7 @@
package flash.text;
@:native("flash.text.AutoCapitalize")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract AutoCapitalize(String)
extern enum abstract AutoCapitalize(String)
{
var ALL = "all";
var NONE = "none";

View File

@@ -1,7 +1,7 @@
package flash.text;
@:native("flash.text.ReturnKeyLabel")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract ReturnKeyLabel(String)
extern enum abstract ReturnKeyLabel(String)
{
var DEFAULT = "default";
var DONE = "done";

View File

@@ -1,7 +1,7 @@
package flash.text;
@:native("flash.text.SoftKeyboardType")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract SoftKeyboardType(String)
extern enum abstract SoftKeyboardType(String)
{
var CONTACT = "contact";
var DEFAULT = "default";

View File

@@ -1,7 +1,7 @@
package flash.text;
@:native("flash.text.StageTextClearButtonMode")
#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract StageTextClearButtonMode(String)
extern enum abstract StageTextClearButtonMode(String)
{
var ALWAYS = "always";
var NEVER = "never";

View File

@@ -4,7 +4,7 @@
"license": "MIT",
"tags": [],
"description": "A foundational Haxe framework for cross-platform development",
"version": "8.3.0",
"version": "9.0.0",
"releasenote": "Various bug fixes",
"contributors": [
"singmajesty",

View File

@@ -11,7 +11,10 @@ namespace lime {
enum DropEventType {
DROP_FILE
DROP_FILE,
DROP_TEXT,
DROP_BEGIN,
DROP_COMPLETE
};

View File

@@ -61,6 +61,9 @@ namespace lime {
WindowEvent windowEvent;
SDL_EventState (SDL_DROPFILE, SDL_ENABLE);
SDL_EventState (SDL_DROPTEXT, SDL_ENABLE);
SDL_EventState (SDL_DROPBEGIN, SDL_ENABLE);
SDL_EventState (SDL_DROPCOMPLETE, SDL_ENABLE);
SDLJoystick::Init ();
#ifdef HX_MACOS
@@ -204,6 +207,9 @@ namespace lime {
break;
case SDL_DROPFILE:
case SDL_DROPTEXT:
case SDL_DROPBEGIN:
case SDL_DROPCOMPLETE:
ProcessDropEvent (event);
break;
@@ -372,8 +378,27 @@ namespace lime {
if (DropEvent::callback) {
dropEvent.type = DROP_FILE;
dropEvent.file = (vbyte*)event->drop.file;
switch (event->type)
{
case SDL_DROPFILE:
dropEvent.type = DROP_FILE;
dropEvent.file = (vbyte*)event->drop.file;
break;
case SDL_DROPTEXT:
dropEvent.type = DROP_TEXT;
dropEvent.file = (vbyte*)event->drop.file;
break;
case SDL_DROPBEGIN:
dropEvent.type = DROP_BEGIN;
dropEvent.file = 0;
break;
case SDL_DROPCOMPLETE:
dropEvent.type = DROP_COMPLETE;
dropEvent.file = 0;
break;
default:
break;
}
DropEvent::Dispatch (&dropEvent);
SDL_free (dropEvent.file);

View File

@@ -44,14 +44,16 @@ namespace lime {
DropEvent* eventObject = (DropEvent*)DropEvent::eventObject->Get ();
int length = strlen ((const char*)event->file);
char* file = (char*)malloc (length + 1);
strcpy (file, (const char*)event->file);
eventObject->file = (vbyte*)file;
if (event->type == DROP_FILE || event->type == DROP_TEXT) {
int length = strlen ((const char*)event->file);
char* file = (char*)malloc (length + 1);
strcpy (file, (const char*)event->file);
eventObject->file = (vbyte*)file;
} else {
eventObject->file = 0;
}
eventObject->type = event->type;
}
DropEvent::callback->Call ();
}

View File

@@ -285,13 +285,13 @@ class HTML5Application
}
#if stats
stats = untyped #if haxe4 js.Syntax.code #else __js__ #end ("new Stats ()");
stats = untyped js.Syntax.code("new Stats ()");
stats.domElement.style.position = "absolute";
stats.domElement.style.top = "0px";
Browser.document.body.appendChild(stats.domElement);
#end
untyped #if haxe4 js.Syntax.code #else __js__ #end ("
untyped js.Syntax.code("
if (!CanvasRenderingContext2D.prototype.isPointInStroke) {
CanvasRenderingContext2D.prototype.isPointInStroke = function (path, x, y) {
return false;

View File

@@ -444,7 +444,7 @@ class HTML5HTTPRequest
private static function __loadImage(uri:String, promise:Promise<Image>, options:Int):Void
{
var image:JSImage = untyped #if haxe4 js.Syntax.code #else __js__ #end ('new window.Image ()');
var image:JSImage = untyped js.Syntax.code('new window.Image ()');
if (!__isSameOrigin(uri))
{
@@ -453,7 +453,7 @@ class HTML5HTTPRequest
if (supportsImageProgress == null)
{
supportsImageProgress = untyped #if haxe4 js.Syntax.code #else __js__ #end ("'onprogress' in image");
supportsImageProgress = untyped js.Syntax.code("'onprogress' in image");
}
if (supportsImageProgress || __isInMemoryURI(uri))

View File

@@ -15,14 +15,9 @@ using haxe.macro.TypedExprTools;
import js.Browser;
import js.html.*;
import js.Lib;
#if haxe4
import js.lib.Function;
import js.lib.Object;
import js.lib.Promise;
import js.Syntax;
#else
import js.Promise;
#end
// Same with classes that import lots of other things.
import lime.app.Application;
#end
@@ -32,7 +27,7 @@ import lime.app.Application;
**/
class HTML5Thread {
private static var __current:HTML5Thread = new HTML5Thread(Lib.global.location.href);
private static var __isWorker:Bool #if !macro = #if !haxe4 untyped __js__ #else Syntax.code #end ('typeof window == "undefined"') #end;
private static var __isWorker:Bool #if !macro = js.Syntax.code('typeof window == "undefined"') #end;
private static var __messages:List<Dynamic> = new List();
private static var __resolveMethods:List<Dynamic->Void> = new List();
private static var __workerCount:Int = 0;
@@ -50,7 +45,7 @@ class HTML5Thread {
private static function __init__():Void
{
#if !macro
if (#if !haxe4 untyped __js__ #else Syntax.code #end ('typeof window == "undefined"'))
if (js.Syntax.code('typeof window == "undefined"'))
{
Lib.global.onmessage = function(event:MessageEvent):Void
{
@@ -96,7 +91,7 @@ class HTML5Thread {
var thread:HTML5Thread = new HTML5Thread(url.href, new Worker(url.href));
// Run `job` on the new thread.
thread.sendMessage(#if !haxe4 cast #end job);
thread.sendMessage(job);
return thread;
#else
@@ -122,13 +117,11 @@ class HTML5Thread {
**/
public static macro function readMessage(block:ExprOf<Bool>):Dynamic
{
var jsCode:Expr = macro #if haxe4 js.Syntax.code #else untyped __js__ #end;
// `onmessage` events are only received when the main function is
// suspended, so we must insert `await` even if `block` is false.
// TODO: find a more efficient way to read messages.
var zeroDelayExpr:Expr = macro @:privateAccess
$jsCode("await {0}", lime._internal.backend.html5.HTML5Thread.zeroDelay())
var zeroDelayExpr:Expr = macro @:privateAccess js.Syntax.code("await {0}",
lime._internal.backend.html5.HTML5Thread.zeroDelay())
.then(function(_) return lime._internal.backend.html5.HTML5Thread.__messages.pop());
switch (block.expr)
@@ -138,8 +131,7 @@ class HTML5Thread {
default:
return macro if ($block && @:privateAccess lime._internal.backend.html5.HTML5Thread.__messages.isEmpty())
{
$jsCode("await {0}", new #if haxe4 js.lib.Promise #else js.Promise #end
(function(resolve, _):Void
js.Syntax.code("await {0}", new js.lib.Promise(function(resolve, _):Void
{
@:privateAccess lime._internal.backend.html5.HTML5Thread.__resolveMethods.add(resolve);
}
@@ -359,7 +351,7 @@ abstract WorkFunction<T:haxe.Constraints.Function>(WorkFunctionData<T>) from Wor
return macro $self.toFunction()($a{args});
}
#if haxe4 @:to #end
@:to
public function toFunction():T
{
if (this.func != null)
@@ -369,16 +361,14 @@ abstract WorkFunction<T:haxe.Constraints.Function>(WorkFunctionData<T>) from Wor
else if (this.classPath != null && this.functionName != null)
{
#if !macro
this.func = #if !haxe4 untyped __js__ #else Syntax.code #end
("$hxClasses[{0}][{1}]", this.classPath, this.functionName);
this.func = js.Syntax.code("$hxClasses[{0}][{1}]", this.classPath, this.functionName);
#end
return this.func;
}
else if (this.sourceCode != null)
{
#if !macro
this.func = #if !haxe4 untyped __js__ #else Syntax.code #end
('new Function("return " + {0})()', this.sourceCode);
this.func = js.Syntax.code('new Function("return " + {0})()', this.sourceCode);
#end
return this.func;
}
@@ -399,8 +389,7 @@ abstract WorkFunction<T:haxe.Constraints.Function>(WorkFunctionData<T>) from Wor
if (this.classPath != null || this.functionName != null)
{
#if !macro
var func = #if !haxe4 untyped __js__ #else Syntax.code #end
("$hxClasses[{0}] && $hxClasses[{0}][{1}]", this.classPath, this.functionName);
var func = js.Syntax.code("$hxClasses[{0}] && $hxClasses[{0}][{1}]", this.classPath, this.functionName);
if (func != this.func)
{
throw 'Could not make ${this.functionName} portable. Either ${this.functionName} isn\'t static, or ${this.classPath} is something other than a class.';
@@ -416,7 +405,7 @@ abstract WorkFunction<T:haxe.Constraints.Function>(WorkFunctionData<T>) from Wor
else
{
#if !macro
this.sourceCode = (cast this.func #if haxe4 :Function #end).toString();
this.sourceCode = (cast this.func : Function).toString();
if (this.sourceCode.indexOf("[native code]") < 0)
{
// All set.
@@ -485,7 +474,7 @@ abstract Message(Dynamic) from Dynamic to Dynamic
// enumerate. This also applies to `Int8Array`, `Float64Array`, etc.
|| object.byteLength != null && object.byteOffset != null
&& object.buffer != null
&& #if (haxe_ver >= 4.2) Std.isOfType #else Std.is #end (object.buffer, #if haxe4 js.lib.ArrayBuffer #else js.html.ArrayBuffer #end);
&& #if (haxe_ver >= 4.2) Std.isOfType #else Std.is #end (object.buffer, js.lib.ArrayBuffer);
}
#end
@@ -527,11 +516,7 @@ abstract Message(Dynamic) from Dynamic to Dynamic
{
if (this.__class__ != null)
{
#if haxe4
Reflect.setField(this, PROTOTYPE_FIELD, this.__class__.__name__);
#else
Reflect.setField(this, PROTOTYPE_FIELD, this.__class__.__name__.join("."));
#end
}
else
{
@@ -547,7 +532,7 @@ abstract Message(Dynamic) from Dynamic to Dynamic
// While usually it's the user's job not to include any functions,
// enums come with a built-in `toString` function that needs to be
// removed, and it isn't fair to ask the user to know that.
if (#if haxe4 Syntax.code #else untyped __js__ #end ('typeof {0}.toString == "function"', this))
if (js.Syntax.code('typeof {0}.toString == "function"', this))
{
Reflect.deleteField(this, "toString");
}
@@ -601,8 +586,7 @@ abstract Message(Dynamic) from Dynamic to Dynamic
try
{
Object.setPrototypeOf(this,
#if haxe4 Syntax.code #else untyped __js__ #end
("$hxClasses[{0}].prototype", Reflect.field(this, PROTOTYPE_FIELD)));
js.Syntax.code("$hxClasses[{0}].prototype", Reflect.field(this, PROTOTYPE_FIELD)));
}
catch (e:Dynamic) {}
}
@@ -646,12 +630,3 @@ abstract Transferable(Dynamic) #if macro from Dynamic
#else from lime.utils.ArrayBuffer from js.html.MessagePort from js.html.ImageBitmap #end
{
}
#if (!haxe4 && !macro)
@:native("Object")
extern class Object {
static function setPrototypeOf<T:{}>(obj:T, prototype:Null<{}>):T;
@:pure static function values(obj:{}):Array<Dynamic>;
static var prototype(default, never):Dynamic;
}
#end

View File

@@ -14,6 +14,7 @@ import js.html.MouseEvent;
import js.html.Node;
import js.html.TextAreaElement;
import js.html.TouchEvent;
import js.html.URL;
import js.html.ClipboardEvent;
import js.Browser;
import lime._internal.graphics.ImageCanvasUtil;
@@ -508,7 +509,12 @@ class HTML5Window
// TODO: Create a formal API that supports HTML5 file objects
if (event.dataTransfer != null && event.dataTransfer.files.length > 0)
{
parent.onDropFile.dispatch(cast event.dataTransfer.files);
parent.onDropStart.dispatch();
for (file in event.dataTransfer.files)
{
parent.onDropFile.dispatch(URL.createObjectURL(file));
}
parent.onDropEnd.dispatch();
event.preventDefault();
return false;
}

View File

@@ -213,7 +213,12 @@ class NativeApplication
{
for (window in parent.windows)
{
window.onDropFile.dispatch(CFFI.stringValue(dropEventInfo.file));
switch dropEventInfo.type {
case DROP_FILE: window.onDropFile.dispatch(CFFI.stringValue(dropEventInfo.file));
case DROP_TEXT: //window.onDropText.dispatch(CFFI.stringValue(dropEventInfo.file));
case DROP_BEGIN: window.onDropStart.dispatch();
case DROP_COMPLETE: window.onDropEnd.dispatch();
}
}
}
@@ -682,7 +687,7 @@ class NativeApplication
}
}
#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract ApplicationEventType(Int)
private enum abstract ApplicationEventType(Int)
{
var UPDATE = 0;
var EXIT = 1;
@@ -703,7 +708,7 @@ class NativeApplication
}
}
#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract ClipboardEventType(Int)
private enum abstract ClipboardEventType(Int)
{
var UPDATE = 0;
}
@@ -725,9 +730,12 @@ class NativeApplication
}
}
#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract DropEventType(Int)
private enum abstract DropEventType(Int)
{
var DROP_FILE = 0;
var DROP_TEXT = 1;
var DROP_BEGIN = 2;
var DROP_COMPLETE = 3;
}
@:keep /*private*/ class GamepadEventInfo
@@ -753,7 +761,7 @@ class NativeApplication
}
}
#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract GamepadEventType(Int)
private enum abstract GamepadEventType(Int)
{
var AXIS_MOVE = 0;
var BUTTON_DOWN = 1;
@@ -787,7 +795,7 @@ class NativeApplication
}
}
#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract JoystickEventType(Int)
private enum abstract JoystickEventType(Int)
{
var AXIS_MOVE = 0;
var HAT_MOVE = 1;
@@ -818,7 +826,7 @@ class NativeApplication
}
}
#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract KeyEventType(Int)
private enum abstract KeyEventType(Int)
{
var KEY_DOWN = 0;
var KEY_UP = 1;
@@ -854,7 +862,7 @@ class NativeApplication
}
}
#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract MouseEventType(Int)
private enum abstract MouseEventType(Int)
{
var MOUSE_DOWN = 0;
var MOUSE_UP = 1;
@@ -877,7 +885,7 @@ class NativeApplication
}
}
#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract RenderEventType(Int)
private enum abstract RenderEventType(Int)
{
var RENDER = 0;
var RENDER_CONTEXT_LOST = 1;
@@ -907,7 +915,7 @@ class NativeApplication
}
}
#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract SensorEventType(Int)
private enum abstract SensorEventType(Int)
{
var ACCELEROMETER = 0;
}
@@ -936,7 +944,7 @@ class NativeApplication
}
}
#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract TextEventType(Int)
private enum abstract TextEventType(Int)
{
var TEXT_INPUT = 0;
var TEXT_EDIT = 1;
@@ -971,7 +979,7 @@ class NativeApplication
}
}
#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract TouchEventType(Int)
private enum abstract TouchEventType(Int)
{
var TOUCH_START = 0;
var TOUCH_END = 1;
@@ -1003,7 +1011,7 @@ class NativeApplication
}
}
#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract WindowEventType(Int)
private enum abstract WindowEventType(Int)
{
var WINDOW_ACTIVATE = 0;
var WINDOW_CLOSE = 1;
@@ -1041,7 +1049,7 @@ class NativeApplication
}
}
#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract OrientationEventType(Int)
private enum abstract OrientationEventType(Int)
{
var DISPLAY_ORIENTATION_CHANGE = 0;
var DEVICE_ORIENTATION_CHANGE = 1;

View File

@@ -16,13 +16,7 @@ import lime.net.HTTPRequestMethod;
import lime.system.ThreadPool;
import lime.system.WorkOutput;
#if sys
#if haxe4
import sys.thread.Deque;
#elseif cpp
import cpp.vm.Deque;
#elseif neko
import neko.vm.Deque;
#end
import sys.FileSystem;
#end

View File

@@ -725,7 +725,7 @@ class NativeWindow
}
}
#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract MouseCursorType(Int) from Int to Int
private enum abstract MouseCursorType(Int) from Int to Int
{
var HIDDEN = 0;
var ARROW = 1;
@@ -742,7 +742,7 @@ class NativeWindow
var WAIT_ARROW = 12;
}
#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract WindowFlags(Int)
private enum abstract WindowFlags(Int)
{
var WINDOW_FLAG_FULLSCREEN = 0x00000001;
var WINDOW_FLAG_BORDERLESS = 0x00000002;

View File

@@ -25,9 +25,9 @@ class Deflate
#end
#elseif js
#if commonjs
var data = untyped #if haxe4 js.Syntax.code #else __js__ #end ("require (\"pako\").deflateRaw")(bytes.getData());
var data = untyped js.Syntax.code("require (\"pako\").deflateRaw")(bytes.getData());
#else
var data = untyped #if haxe4 js.Syntax.code #else __js__ #end ("pako.deflateRaw")(bytes.getData());
var data = untyped js.Syntax.code("pako.deflateRaw")(bytes.getData());
#end
return Bytes.ofData(data);
#elseif flash
@@ -55,9 +55,9 @@ class Deflate
#end
#elseif js
#if commonjs
var data = untyped #if haxe4 js.Syntax.code #else __js__ #end ("require (\"pako\").inflateRaw")(bytes.getData());
var data = untyped js.Syntax.code("require (\"pako\").inflateRaw")(bytes.getData());
#else
var data = untyped #if haxe4 js.Syntax.code #else __js__ #end ("pako.inflateRaw")(bytes.getData());
var data = untyped js.Syntax.code("pako.inflateRaw")(bytes.getData());
#end
return Bytes.ofData(data);
#elseif flash

View File

@@ -22,9 +22,9 @@ class GZip
#end
#elseif js
#if commonjs
var data = untyped #if haxe4 js.Syntax.code #else __js__ #end ("require (\"pako\").gzip")(bytes.getData());
var data = untyped js.Syntax.code("require (\"pako\").gzip")(bytes.getData());
#else
var data = untyped #if haxe4 js.Syntax.code #else __js__ #end ("pako.gzip")(bytes.getData());
var data = untyped js.Syntax.code("pako.gzip")(bytes.getData());
#end
return Bytes.ofData(data);
#else
@@ -44,9 +44,9 @@ class GZip
#end
#elseif js
#if commonjs
var data = untyped #if haxe4 js.Syntax.code #else __js__ #end ("require (\"pako\").ungzip")(bytes.getData());
var data = untyped js.Syntax.code("require (\"pako\").ungzip")(bytes.getData());
#else
var data = untyped #if haxe4 js.Syntax.code #else __js__ #end ("pako.ungzip")(bytes.getData());
var data = untyped js.Syntax.code("pako.ungzip")(bytes.getData());
#end
return Bytes.ofData(data);
#else

View File

@@ -26,7 +26,7 @@ class LZMA
return @:privateAccess new Bytes(data.length, data.b);
#end
#elseif js
var data = untyped #if haxe4 js.Syntax.code #else __js__ #end ("LZMA.compress")(new UInt8Array(bytes.getData()), 5);
var data = untyped js.Syntax.code("LZMA.compress")(new UInt8Array(bytes.getData()), 5);
if ((data is String))
{
return Bytes.ofString(data);
@@ -59,7 +59,7 @@ class LZMA
return @:privateAccess new Bytes(data.length, data.b);
#end
#elseif js
var data = untyped #if haxe4 js.Syntax.code #else __js__ #end ("LZMA.decompress")(new UInt8Array(bytes.getData()));
var data = untyped js.Syntax.code("LZMA.decompress")(new UInt8Array(bytes.getData()));
if ((data is String))
{
return Bytes.ofString(data);

View File

@@ -25,9 +25,9 @@ class Zlib
#end
#elseif js
#if commonjs
var data = untyped #if haxe4 js.Syntax.code #else __js__ #end ("require (\"pako\").deflate")(bytes.getData());
var data = untyped js.Syntax.code("require (\"pako\").deflate")(bytes.getData());
#else
var data = untyped #if haxe4 js.Syntax.code #else __js__ #end ("pako.deflate")(bytes.getData());
var data = untyped js.Syntax.code("pako.deflate")(bytes.getData());
#end
return Bytes.ofData(data);
#elseif flash
@@ -55,9 +55,9 @@ class Zlib
#end
#elseif js
#if commonjs
var data = untyped #if haxe4 js.Syntax.code #else __js__ #end ("require (\"pako\").inflate")(bytes.getData());
var data = untyped js.Syntax.code("require (\"pako\").inflate")(bytes.getData());
#else
var data = untyped #if haxe4 js.Syntax.code #else __js__ #end ("pako.inflate")(bytes.getData());
var data = untyped js.Syntax.code("pako.inflate")(bytes.getData());
#end
return Bytes.ofData(data);
#elseif flash

View File

@@ -1749,7 +1749,7 @@ private class ImageDataView
}
@:noCompletion @:dox(hide)
#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract ThresholdOperation(Int) from Int to Int
private enum abstract ThresholdOperation(Int) from Int to Int
{
var NOT_EQUALS = 0;
var EQUALS = 1;

View File

@@ -40,7 +40,7 @@ import lime.utils.Log;
@:fileXml('tags="haxe,release"')
@:noDebug
#end
@:allow(lime.app.Promise) /*@:generic*/ class Future<T>
@:allow(lime.app.Promise) class Future<T>
{
/**
If the `Future` has finished with an error state, the `error` value

View File

@@ -44,9 +44,6 @@ package lime.app;
@:noDebug
#end
@:allow(lime.app.Future)
#if (!hl && !js && !macro)
@:generic
#end
class Promise<T>
{
/**

View File

@@ -1429,7 +1429,7 @@ class Image
@:noCompletion private function __fromBase64(base64:String, type:String, onload:Image->Void = null):Void
{
#if (js && html5)
var image:JSImage = untyped #if haxe4 js.Syntax.code #else __js__ #end ('new window.Image ()');
var image:JSImage = untyped js.Syntax.code('new window.Image ()');
var image_onLoaded = function(event)
{
@@ -1522,7 +1522,7 @@ class Image
@:noCompletion private function __fromFile(path:String, onload:Image->Void = null, onerror:Void->Void = null):Bool
{
#if (js && html5)
var image:JSImage = untyped #if haxe4 js.Syntax.code #else __js__ #end ('new window.Image ()');
var image:JSImage = untyped js.Syntax.code('new window.Image ()');
#if !display
if (!HTML5HTTPRequest.__isSameOrigin(path))

View File

@@ -10,11 +10,7 @@ import js.html.CanvasRenderingContext2D;
import js.html.Image as HTMLImage;
import js.html.ImageData;
import js.Browser;
#if haxe4
import js.lib.Uint8ClampedArray;
#else
import js.html.Uint8ClampedArray;
#end
#elseif flash
import flash.display.BitmapData;
#end

View File

@@ -3,7 +3,7 @@ package lime.graphics;
/**
An enum containing different pixel encoding formats for image data
**/
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract PixelFormat(Int) from Int to Int from UInt to UInt
enum abstract PixelFormat(Int) from Int to Int from UInt to UInt
{
/**
An image encoded in 32-bit RGBA color order

View File

@@ -3,7 +3,7 @@ package lime.graphics;
/**
An enum for possible render context types
**/
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract RenderContextType(String) from String to String
enum abstract RenderContextType(String) from String to String
{
/**
Describes a Cairo render context

View File

@@ -1,7 +1,7 @@
package lime.graphics.cairo;
#if (!lime_doc_gen || lime_cairo)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract CairoAntialias(Int) from Int to Int from UInt to UInt
enum abstract CairoAntialias(Int) from Int to Int from UInt to UInt
{
public var DEFAULT = 0;
public var NONE = 1;

View File

@@ -1,7 +1,7 @@
package lime.graphics.cairo;
#if (!lime_doc_gen || lime_cairo)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract CairoContent(Int) from Int to Int from UInt to UInt
enum abstract CairoContent(Int) from Int to Int from UInt to UInt
{
public var COLOR = 0x1000;
public var ALPHA = 0x2000;

View File

@@ -1,7 +1,7 @@
package lime.graphics.cairo;
#if (!lime_doc_gen || lime_cairo)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract CairoExtend(Int) from Int to Int from UInt to UInt
enum abstract CairoExtend(Int) from Int to Int from UInt to UInt
{
public var NONE = 0;
public var REPEAT = 1;

View File

@@ -1,7 +1,7 @@
package lime.graphics.cairo;
#if (!lime_doc_gen || lime_cairo)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract CairoFillRule(Int) from Int to Int from UInt to UInt
enum abstract CairoFillRule(Int) from Int to Int from UInt to UInt
{
public var WINDING = 0;
public var EVEN_ODD = 1;

View File

@@ -1,7 +1,7 @@
package lime.graphics.cairo;
#if (!lime_doc_gen || lime_cairo)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract CairoFilter(Int) from Int to Int from UInt to UInt
enum abstract CairoFilter(Int) from Int to Int from UInt to UInt
{
public var FAST = 0;
public var GOOD = 1;

View File

@@ -1,7 +1,7 @@
package lime.graphics.cairo;
#if (!lime_doc_gen || lime_cairo)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract CairoFormat(Int) from Int to Int from UInt to UInt
enum abstract CairoFormat(Int) from Int to Int from UInt to UInt
{
public var INVALID = -1;
public var ARGB32 = 0;

View File

@@ -1,7 +1,7 @@
package lime.graphics.cairo;
#if (!lime_doc_gen || lime_cairo)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract CairoHintMetrics(Int) from Int to Int from UInt to UInt
enum abstract CairoHintMetrics(Int) from Int to Int from UInt to UInt
{
public var DEFAULT = 0;
public var OFF = 1;

View File

@@ -1,7 +1,7 @@
package lime.graphics.cairo;
#if (!lime_doc_gen || lime_cairo)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract CairoHintStyle(Int) from Int to Int from UInt to UInt
enum abstract CairoHintStyle(Int) from Int to Int from UInt to UInt
{
public var DEFAULT = 0;
public var NONE = 1;

View File

@@ -1,7 +1,7 @@
package lime.graphics.cairo;
#if (!lime_doc_gen || lime_cairo)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract CairoLineCap(Int) from Int to Int from UInt to UInt
enum abstract CairoLineCap(Int) from Int to Int from UInt to UInt
{
public var BUTT = 0;
public var ROUND = 1;

View File

@@ -1,7 +1,7 @@
package lime.graphics.cairo;
#if (!lime_doc_gen || lime_cairo)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract CairoLineJoin(Int) from Int to Int from UInt to UInt
enum abstract CairoLineJoin(Int) from Int to Int from UInt to UInt
{
public var MITER = 0;
public var ROUND = 1;

View File

@@ -1,7 +1,7 @@
package lime.graphics.cairo;
#if (!lime_doc_gen || lime_cairo)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract CairoOperator(Int) from Int to Int from UInt to UInt
enum abstract CairoOperator(Int) from Int to Int from UInt to UInt
{
public var CLEAR = 0;
public var SOURCE = 1;

View File

@@ -1,7 +1,7 @@
package lime.graphics.cairo;
#if (!lime_doc_gen || lime_cairo)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract CairoStatus(Int) from Int to Int from UInt to UInt
enum abstract CairoStatus(Int) from Int to Int from UInt to UInt
{
public var SUCCESS = 0;
public var NO_MEMORY = 1;

View File

@@ -1,7 +1,7 @@
package lime.graphics.cairo;
#if (!lime_doc_gen || lime_cairo)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract CairoSubpixelOrder(Int) from Int to Int from UInt to UInt
enum abstract CairoSubpixelOrder(Int) from Int to Int from UInt to UInt
{
public var DEFAULT = 0;
public var RGB = 1;

View File

@@ -2635,7 +2635,7 @@ class GL
}
}
@:dox(hide) @:noCompletion #if (haxe_ver >= 4.0) enum #else @:enum #end abstract GLObjectType(Int) to Int
@:dox(hide) @:noCompletion enum abstract GLObjectType(Int) to Int
{
var UNKNOWN = 0;
var PROGRAM = 1;

View File

@@ -30,8 +30,8 @@ class AudioContext
{
try
{
untyped #if haxe4 js.Syntax.code #else __js__ #end ("window.AudioContext = window.AudioContext || window.webkitAudioContext;");
web = cast untyped #if haxe4 js.Syntax.code #else __js__ #end ("new window.AudioContext ()");
untyped js.Syntax.code("window.AudioContext = window.AudioContext || window.webkitAudioContext;");
web = cast untyped js.Syntax.code("new window.AudioContext ()");
this.type = WEB;
}
catch (e:Dynamic) {}

View File

@@ -1,6 +1,6 @@
package lime.media;
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract AudioContextType(String) from String to String
enum abstract AudioContextType(String) from String to String
{
var FLASH = "flash";
var HTML5 = "html5";

View File

@@ -1,6 +1,6 @@
package lime.net;
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract HTTPRequestMethod(String) from String to String
enum abstract HTTPRequestMethod(String) from String to String
{
public var DELETE = "DELETE";
public var GET = "GET";

View File

@@ -1,7 +1,7 @@
package lime.net.curl;
#if (!lime_doc_gen || lime_curl)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract CURLCode(Int) from Int to Int from UInt to UInt
enum abstract CURLCode(Int) from Int to Int from UInt to UInt
{
var OK = 0;
var UNSUPPORTED_PROTOCOL = 1;

View File

@@ -1,7 +1,7 @@
package lime.net.curl;
#if (!lime_doc_gen || lime_curl)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract CURLInfo(Int) from Int to Int from UInt to UInt
enum abstract CURLInfo(Int) from Int to Int from UInt to UInt
{
var NONE = 0;
var EFFECTIVE_URL = 0x100000 + 1;

View File

@@ -1,7 +1,7 @@
package lime.net.curl;
#if (!lime_doc_gen || lime_curl)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract CURLMultiCode(Int) from Int to Int from UInt /*to UInt*/
enum abstract CURLMultiCode(Int) from Int to Int from UInt /*to UInt*/
{
/* please call curl_multi_perform() or curl_multi_socket*() soon */
var CALL_MULTI_PERFORM = -1;

View File

@@ -1,7 +1,7 @@
package lime.net.curl;
#if (!lime_doc_gen || lime_curl)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract CURLMultiOption(Int) from Int to Int from UInt to UInt
enum abstract CURLMultiOption(Int) from Int to Int from UInt to UInt
{
/* This is the socket callback function pointer */
var SOCKETFUNCTION = 200001;

View File

@@ -1,7 +1,7 @@
package lime.net.curl;
#if (!lime_doc_gen || lime_curl)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract CURLOption(Int) from Int to Int from UInt to UInt
enum abstract CURLOption(Int) from Int to Int from UInt to UInt
{
// var FILE = 10001;
// var WRITEDATA = 10001;

View File

@@ -1,7 +1,7 @@
package lime.net.curl;
#if (!lime_doc_gen || lime_curl)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract CURLVersion(Int) from Int to Int from UInt to UInt
enum abstract CURLVersion(Int) from Int to Int from UInt to UInt
{
var FIRST = 0;
var SECOND = 1;

View File

@@ -1,6 +1,6 @@
package lime.net.oauth;
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract OAuthSignatureMethod(String)
enum abstract OAuthSignatureMethod(String)
{
// var PLAINTEXT = "PLAINTEXT";
var HMAC_SHA1 = "HMAC-SHA1";

View File

@@ -1,6 +1,6 @@
package lime.net.oauth;
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract OAuthVersion(String)
enum abstract OAuthVersion(String)
{
var V1 = "1.0";
var V2 = "2.0";

View File

@@ -3,29 +3,21 @@ package lime.system;
import lime.app.Application;
import lime.app.Event;
#if sys
#if haxe4
import sys.thread.Deque;
import sys.thread.Thread;
#elseif cpp
import cpp.vm.Deque;
import cpp.vm.Thread;
#elseif neko
import neko.vm.Deque;
import neko.vm.Thread;
#end
#end
/**
A `BackgroundWorker` allows the execution of a function on a background thread,
avoiding the blocking of the main thread. This is particularly useful for long-running
A `BackgroundWorker` allows the execution of a function on a background thread,
avoiding the blocking of the main thread. This is particularly useful for long-running
operations like file I/O, network requests, or computationally intensive tasks.
### Notes:
- **Thread Support:** Only system targets (such as C++, Neko) support threading.
- **Events:** The class uses the `Event` class to dispatch completion, error,
- **Thread Support:** Only system targets (such as C++, Neko) support threading.
- **Events:** The class uses the `Event` class to dispatch completion, error,
and progress notifications.
@see `ThreadPool` for more advanced threading capabilities, including thread
@see `ThreadPool` for more advanced threading capabilities, including thread
safety, HTML5 threads, and more robust handling of tasks.
**/
#if !lime_debug
@@ -62,14 +54,14 @@ class BackgroundWorker
Dispatched if an error occurs during the execution of the worker's task.
**/
public var onError = new Event<Dynamic->Void>();
/**
Dispatched periodically during the worker's task to provide progress updates.
**/
public var onProgress = new Event<Dynamic->Void>();
@:noCompletion private var __runMessage:Dynamic;
#if (cpp || neko || (haxe4 && hl))
#if (cpp || neko || hl)
@:noCompletion private var __messageQueue:Deque<Dynamic>;
@:noCompletion private var __workerThread:Thread;
#end
@@ -80,14 +72,14 @@ class BackgroundWorker
public function new() {}
/**
Cancels the worker's task if it is still running. This won't stop the thread
Cancels the worker's task if it is still running. This won't stop the thread
immediately.
**/
public function cancel():Void
{
canceled = true;
#if (cpp || neko || (haxe4 && hl))
#if (cpp || neko || hl)
__workerThread = null;
#end
}
@@ -102,7 +94,7 @@ class BackgroundWorker
completed = false;
__runMessage = message;
#if (cpp || neko || (haxe4 && hl))
#if (cpp || neko || hl)
__messageQueue = new Deque<Dynamic>();
__workerThread = Thread.create(__doWork);
@@ -125,7 +117,7 @@ class BackgroundWorker
{
completed = true;
#if (cpp || neko || (haxe4 && hl))
#if (cpp || neko || hl)
__messageQueue.add(MESSAGE_COMPLETE);
__messageQueue.add(message);
#else
@@ -143,7 +135,7 @@ class BackgroundWorker
**/
public function sendError(message:Dynamic = null):Void
{
#if (cpp || neko || (haxe4 && hl))
#if (cpp || neko || hl)
__messageQueue.add(MESSAGE_ERROR);
__messageQueue.add(message);
#else
@@ -154,14 +146,14 @@ class BackgroundWorker
}
#end
}
/**
Sends a progress update message.
@param message An optional message to pass to the `onProgress` event.
**/
public function sendProgress(message:Dynamic = null):Void
{
#if (cpp || neko || (haxe4 && hl))
#if (cpp || neko || hl)
__messageQueue.add(message);
#else
if (!canceled)
@@ -193,7 +185,7 @@ class BackgroundWorker
@:noCompletion private function __update(deltaTime:Int):Void
{
#if (cpp || neko || (haxe4 && hl))
#if (cpp || neko || hl)
var message = __messageQueue.pop(false);
if (message != null)

View File

@@ -1,6 +1,6 @@
package lime.system;
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract Orientation(Int)
enum abstract Orientation(Int)
{
var UNKNOWN = 0;
var LANDSCAPE = 1;

View File

@@ -924,7 +924,7 @@ class System
}
}
#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract SystemDirectory(Int) from Int to Int from UInt to UInt
private enum abstract SystemDirectory(Int) from Int to Int from UInt to UInt
{
var APPLICATION = 0;
var APPLICATION_STORAGE = 1;

View File

@@ -190,7 +190,7 @@ class WorkOutput
}
}
#if haxe4 enum #else @:enum #end abstract ThreadMode(Bool)
enum abstract ThreadMode(Bool)
{
/**
All work will be done on the main thread, during `Application.onUpdate`.
@@ -373,8 +373,7 @@ class JSAsync
{
if (Context.defined("js"))
{
var jsCode:Expr = #if haxe4 macro js.Syntax.code #else macro untyped __js__ #end;
return macro $jsCode("(async {0})()", function() $code);
return macro js.Syntax.code("(async {0})()", function() $code);
}
else
{

View File

@@ -108,29 +108,29 @@ class Font
if (!__init)
{
#if js if (ascender == untyped #if haxe4 js.Syntax.code #else __js__ #end ("undefined")) #end ascender = 0;
#if js if (ascender == untyped js.Syntax.code("undefined")) #end ascender = 0;
#if js
if (descender == untyped #if haxe4 js.Syntax.code #else __js__ #end ("undefined"))
if (descender == untyped js.Syntax.code("undefined"))
#end
descender = 0;
#if js
if (height == untyped #if haxe4 js.Syntax.code #else __js__ #end ("undefined"))
if (height == untyped js.Syntax.code("undefined"))
#end
height = 0;
#if js
if (numGlyphs == untyped #if haxe4 js.Syntax.code #else __js__ #end ("undefined"))
if (numGlyphs == untyped js.Syntax.code("undefined"))
#end
numGlyphs = 0;
#if js
if (underlinePosition == untyped #if haxe4 js.Syntax.code #else __js__ #end ("undefined"))
if (underlinePosition == untyped js.Syntax.code("undefined"))
#end
underlinePosition = 0;
#if js
if (underlineThickness == untyped #if haxe4 js.Syntax.code #else __js__ #end ("undefined"))
if (underlineThickness == untyped js.Syntax.code("undefined"))
#end
underlineThickness = 0;
#if js
if (unitsPerEM == untyped #if haxe4 js.Syntax.code #else __js__ #end ("undefined"))
if (unitsPerEM == untyped js.Syntax.code("undefined"))
#end
unitsPerEM = 0;

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
package lime.text.harfbuzz;
#if (!lime_doc_gen || lime_harfbuzz)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract HBBufferClusterLevel(Int) from Int to Int
enum abstract HBBufferClusterLevel(Int) from Int to Int
{
public var MONOTONE_GRAPHEMES = 0;
public var MONOTONE_CHARACTERS = 1;

View File

@@ -1,7 +1,7 @@
package lime.text.harfbuzz;
#if (!lime_doc_gen || lime_harfbuzz)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract HBBufferContentType(Int) from Int to Int
enum abstract HBBufferContentType(Int) from Int to Int
{
public var INVALID = 0;
public var UNICODE = 1;

View File

@@ -1,7 +1,7 @@
package lime.text.harfbuzz;
#if (!lime_doc_gen || lime_harfbuzz)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract HBBufferFlags(Int) from Int to Int
enum abstract HBBufferFlags(Int) from Int to Int
{
public var DEFAULT = 0x00000000;
public var BOT = 0x00000001;

View File

@@ -1,7 +1,7 @@
package lime.text.harfbuzz;
#if (!lime_doc_gen || lime_harfbuzz)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract HBBufferSerializeFlags(Int) from Int to Int
enum abstract HBBufferSerializeFlags(Int) from Int to Int
{
public var DEFAULT = 0x00000000;
public var NO_CLUSTERS = 0x00000001;

View File

@@ -1,7 +1,7 @@
package lime.text.harfbuzz;
#if (!lime_doc_gen || lime_harfbuzz)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract HBBufferSerializeFormat(Int) from Int to Int
enum abstract HBBufferSerializeFormat(Int) from Int to Int
{
// public var HB_BUFFER_SERIALIZE_FORMAT_TEXT = HB_TAG('T', 'E', 'X', 'T');
// public var JSON = HB_TAG('J', 'S', 'O', 'N');

View File

@@ -1,7 +1,7 @@
package lime.text.harfbuzz;
#if (!lime_doc_gen || lime_harfbuzz)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract HBDirection(Int) from Int to Int
enum abstract HBDirection(Int) from Int to Int
{
public var INVALID = 0;
public var LTR = 4;

View File

@@ -1,7 +1,7 @@
package lime.text.harfbuzz;
#if (!lime_doc_gen || lime_harfbuzz)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract HBMemoryMode(Int) from Int to Int
enum abstract HBMemoryMode(Int) from Int to Int
{
public var DUPLICATE = 0;
public var READONLY = 1;

View File

@@ -1,7 +1,7 @@
package lime.text.harfbuzz;
#if (!lime_doc_gen || lime_harfbuzz)
#if (haxe_ver >= 4.0) enum #else @:enum #end abstract HBScript(Int) from Int to Int
enum abstract HBScript(Int) from Int to Int
{
public var COMMON = "Z".code << 24 | "y".code << 16 | "y".code << 8 | "y".code;
public var INHERITED = "Z".code << 24 | "i".code << 16 | "n".code << 8 | "h".code;

View File

@@ -1,14 +1,104 @@
package lime.tools;
enum Architecture
import haxe.macro.Expr;
import hxp.HostArchitecture;
enum abstract Architecture(String) to String
{
ARMV5;
ARMV6;
ARMV7;
ARMV7S;
ARM64;
X86;
X64;
MIPS;
MIPSEL;
var ARMV5 = "ARMV5";
var ARMV6 = "ARMV6";
var ARMV7 = "ARMV7";
var ARMV7S = "ARMV7S";
var ARM64 = "ARM64";
var X86 = "X86";
var X64 = "X64";
var MIPS = "MIPS";
var MIPSEL = "MIPSEL";
public static function exists(architecture:String):Bool
{
switch (architecture)
{
case ARMV5, ARMV6, ARMV7, ARMV7S, ARM64, X86, X64, MIPS, MIPSEL:
return true;
default:
return false;
}
}
@:from private static function fromHostArchitecture(hostArchitecture:HostArchitecture):Architecture
{
if (hostArchitecture == HostArchitecture.ARMV6)
{
return ARMV6;
}
else if (hostArchitecture == HostArchitecture.ARMV7)
{
return ARMV7;
}
else if (hostArchitecture == HostArchitecture.ARM64)
{
return ARM64;
}
else if (hostArchitecture == HostArchitecture.X86)
{
return X86;
}
else /* if (hostArchitecture == HostArchitecture.X64) */
{
return X64;
}
}
@:from private static function fromString(string:String):Architecture
{
if (exists(string))
{
return cast string;
}
else
{
return null;
}
}
/**
Returns the given `Architecture` if available, or `null` otherwise.
**/
public inline function new(name:String)
{
this = fromString(name.toUpperCase());
}
public inline function is64():Bool
{
return this == ARM64 || this == X64;
}
public inline function isARM():Bool
{
return this.indexOf("ARM") == 0;
}
public inline function isMIPS():Bool
{
return this == MIPS || this == MIPSEL;
}
public inline function isX():Bool
{
return this == X86 || this == X64;
}
@:noCompletion public macro function match(self:Expr, expr:Expr):Expr
{
return macro switch ($self)
{
case $expr:
true;
default:
false;
};
}
}

View File

@@ -9,7 +9,12 @@ import haxe.xml.Fast as Access;
abstract ConfigData(Dynamic) to Dynamic from Dynamic
{
private static inline var ARRAY:String = "___array";
private static inline var ARRAY:String = "config:array_";
/**
If set, `parse()` will add child nodes to this array instead of parsing them.
**/
@:noCompletion public var xmlChildren(get, set):Array<String>;
public function new()
{
@@ -75,7 +80,7 @@ abstract ConfigData(Dynamic) to Dynamic from Dynamic
if (current != null)
{
array = Reflect.field(current, field + ARRAY);
array = Reflect.field(current, ARRAY + field);
if (array == null && Reflect.hasField(current, field))
{
@@ -170,7 +175,7 @@ abstract ConfigData(Dynamic) to Dynamic from Dynamic
return defaultValue;
}
public function getKeyValueArray(id:String, defaultValues:Dynamic = null):Array<{ key:Dynamic, value:Dynamic }>
public function getKeyValueArray(id:String, defaultValues:Dynamic = null):Array<{ key:String, value:Dynamic }>
{
var values = {};
if (defaultValues != null)
@@ -181,7 +186,7 @@ abstract ConfigData(Dynamic) to Dynamic from Dynamic
var data = get(id);
for (key in Reflect.fields(data))
{
if (!StringTools.endsWith (key, ARRAY))
if (!StringTools.startsWith(key, "config:"))
{
Reflect.setField(values, key, Reflect.field(data, key));
}
@@ -216,72 +221,63 @@ abstract ConfigData(Dynamic) to Dynamic from Dynamic
{
for (field in Reflect.fields(source))
{
if (StringTools.endsWith(field, ARRAY))
if (StringTools.startsWith(field, ARRAY))
{
continue;
}
var doCopy = true;
var exists = Reflect.hasField(destination, field);
var typeDest = null;
var valueSource = Reflect.field(source, field);
var valueDest = Reflect.field(destination, field);
var typeSource = Type.typeof(valueSource).getName();
var typeDest = Type.typeof(valueDest).getName();
if (exists)
// if trying to copy a non object over an object, don't
if (typeSource != "TObject" && typeDest == "TObject")
{
var valueSource = Reflect.field(source, field);
var valueDest = Reflect.field(destination, field);
var typeSource = Type.typeof(valueSource).getName();
typeDest = Type.typeof(valueDest).getName();
// if trying to copy a non object over an object, don't
if (typeSource != "TObject" && typeDest == "TObject")
{
doCopy = false;
// if (Log.verbose) {
//
// Log.println (field + " not merged by preference");
//
// }
}
if (doCopy && Reflect.field(source, field) != Reflect.field(destination, field) && typeSource != "TObject")
{
if (!Reflect.hasField(destination, field + ARRAY))
{
Reflect.setField(destination, field + ARRAY, [ObjectTools.deepCopy(Reflect.field(destination, field))]);
}
var array:Array<Dynamic> = Reflect.field(destination, field + ARRAY);
if (Reflect.hasField(source, field + ARRAY))
{
array = array.concat(Reflect.field(source, field + ARRAY));
Reflect.setField(destination, field + ARRAY, array);
}
else
{
array.push(Reflect.field(source, field));
}
Reflect.setField(destination, field, Reflect.field(source, field));
doCopy = false;
}
continue;
}
if (doCopy)
if (valueSource != valueDest && valueDest != null && typeSource != "TObject" && !#if (haxe_ver >= 4.2) Std.isOfType #else Std.is #end(valueSource, Array))
{
if (typeDest == "TObject")
if (!Reflect.hasField(destination, ARRAY + field))
{
mergeValues(Reflect.field(source, field), Reflect.field(destination, field));
Reflect.setField(destination, ARRAY + field, [ObjectTools.deepCopy(Reflect.field(destination, field))]);
}
var array:Array<Dynamic> = Reflect.field(destination, ARRAY + field);
if (Reflect.hasField(source, ARRAY + field))
{
array = array.concat(Reflect.field(source, ARRAY + field));
Reflect.setField(destination, ARRAY + field, array);
}
else
{
Reflect.setField(destination, field, Reflect.field(source, field));
array.push(Reflect.field(source, field));
}
if (Reflect.hasField(source, field + ARRAY))
{
Reflect.setField(destination, field + ARRAY, Reflect.field(source, field + ARRAY));
}
Reflect.setField(destination, field, Reflect.field(source, field));
continue;
}
if (typeDest == "TObject")
{
mergeValues(valueSource, valueDest);
}
else if (typeDest == "TClass" && #if (haxe_ver >= 4.2) Std.isOfType #else Std.is #end (valueSource, Array) && #if (haxe_ver >= 4.2) Std.isOfType #else Std.is #end(valueDest, Array))
{
for (item in (cast valueSource:Array<Dynamic>))
{
(cast valueDest:Array<Dynamic>).push(item);
}
}
else
{
Reflect.setField(destination, field, Reflect.field(source, field));
if (Reflect.hasField(source, ARRAY + field))
{
Reflect.setField(destination, ARRAY + field, Reflect.field(source, ARRAY + field));
}
}
}
@@ -302,6 +298,10 @@ abstract ConfigData(Dynamic) to Dynamic from Dynamic
{
bucketType = elem.att.type;
}
else if (elem.x.exists("config:type"))
{
bucketType = elem.x.get("config:type");
}
if (bucketType != "")
{
@@ -318,7 +318,7 @@ abstract ConfigData(Dynamic) to Dynamic from Dynamic
{
for (attrName in elem.x.attributes())
{
if (attrName != "type")
if (attrName != "type" && attrName != "config:type")
{
var attrValue = elem.x.get(attrName);
if (substitute != null) attrValue = substitute(attrValue);
@@ -327,64 +327,77 @@ abstract ConfigData(Dynamic) to Dynamic from Dynamic
}
}
private function parseChildren(elem:Access, bucket:Dynamic, depth:Int = 0, substitute:String->String = null):Void
private function parseChildren(elem:Access, bucket:ConfigData, depth:Int = 0, substitute:String->String = null):Void
{
if (bucket.xmlChildren != null)
{
var children:Array<String> = bucket.xmlChildren;
for (child in elem.elements)
{
children.push(child.x.toString());
}
return;
}
for (child in elem.elements)
{
if (child.name != "config")
if (child.name == "config")
{
// log("config data > child : " + child.name);
continue;
}
var d = depth + 1;
// log("config data > child : " + child.name);
var hasChildren = child.x.elements().hasNext();
var hasAttributes = child.x.attributes().hasNext();
var d = depth + 1;
if (Reflect.hasField(bucket, child.name))
var hasChildren = child.x.elements().hasNext();
var hasAttributes = child.x.attributes().hasNext();
if (Reflect.hasField(bucket, child.name))
{
var array:Array<Dynamic> = Reflect.field(bucket, ARRAY + child.name);
if (array == null)
{
var array:Array<Dynamic> = Reflect.field(bucket, child.name + ARRAY);
if (array == null)
{
array = [ObjectTools.deepCopy(Reflect.field(bucket, child.name))];
Reflect.setField(bucket, child.name + ARRAY, array);
}
array = [ObjectTools.deepCopy(Reflect.field(bucket, child.name))];
Reflect.setField(bucket, ARRAY + child.name, array);
}
var arrayBucket = {};
array.push(arrayBucket);
var arrayBucket = {};
array.push(arrayBucket);
if (hasAttributes)
{
parseAttributes(child, arrayBucket, substitute);
}
if (hasAttributes)
{
parseAttributes(child, arrayBucket, substitute);
}
if (hasChildren)
{
parseChildren(child, arrayBucket, d, substitute);
}
if (!hasChildren && !hasAttributes)
{
parseValue(child, arrayBucket, substitute);
}
if (hasChildren)
{
parseChildren(child, arrayBucket, d, substitute);
}
if (!hasChildren && !hasAttributes)
{
parseValue(child, bucket, substitute);
parseValue(child, arrayBucket, substitute);
}
else
}
if (!hasChildren && !hasAttributes)
{
parseValue(child, bucket, substitute);
}
else
{
var childBucket = addBucket(child.name, bucket);
if (hasAttributes)
{
var childBucket = addBucket(child.name, bucket);
parseAttributes(child, childBucket, substitute);
}
if (hasAttributes)
{
parseAttributes(child, childBucket, substitute);
}
if (hasChildren)
{
parseChildren(child, childBucket, d, substitute);
}
if (hasChildren)
{
parseChildren(child, childBucket, d, substitute);
}
}
}
@@ -426,12 +439,12 @@ abstract ConfigData(Dynamic) to Dynamic from Dynamic
if (Reflect.hasField(current, field))
{
var array:Array<Dynamic> = Reflect.field(current, field + ARRAY);
var array:Array<Dynamic> = Reflect.field(current, ARRAY + field);
if (array == null)
{
array = [ObjectTools.deepCopy(Reflect.field(current, field))];
Reflect.setField(current, field + ARRAY, array);
Reflect.setField(current, ARRAY + field, array);
}
if (!unique || array.indexOf(value) == -1)
@@ -495,11 +508,11 @@ abstract ConfigData(Dynamic) to Dynamic from Dynamic
{
if (typeSource != "TObject")
{
var array:Array<Dynamic> = Reflect.field(bucket, node + ARRAY);
var array:Array<Dynamic> = Reflect.field(bucket, ARRAY + node);
if (array == null)
{
array = [ObjectTools.deepCopy(Reflect.field(bucket, node))];
Reflect.setField(bucket, node + ARRAY, array);
Reflect.setField(bucket, ARRAY + node, array);
}
array.push(value);
@@ -513,4 +526,15 @@ abstract ConfigData(Dynamic) to Dynamic from Dynamic
Reflect.setField(bucket, node, value);
}
}
// Getters & Setters
private inline function get_xmlChildren():Array<String> {
return Reflect.field(this, "config:xml_children");
}
private inline function set_xmlChildren(value:Array<String>):Array<String> {
Reflect.setField(this, "config:xml_children", value);
return value;
}
}

View File

@@ -93,45 +93,11 @@ class HTML5Helper
}
else
{
var suffix = switch (System.hostPlatform)
{
case WINDOWS: "-windows.exe";
case MAC: "-mac";
case LINUX: "-linux";
default: return;
}
if (suffix == "-linux")
{
if (System.hostArchitecture == X86)
{
suffix += "32";
}
else if( System.hostArchitecture == ARMV7)
{
suffix += "Arm";
}
else if( System.hostArchitecture == ARM64)
{
suffix += "Arm64";
}
else
{
suffix += "64";
}
}
var templatePaths = [
Path.combine(Haxelib.getPath(new Haxelib(#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end)
].concat(project.templatePaths);
var node = System.findTemplate(templatePaths, "bin/node/node" + suffix);
var server = System.findTemplate(templatePaths, "bin/node/http-server/bin/http-server");
if (System.hostPlatform != WINDOWS)
{
Sys.command("chmod", ["+x", node]);
}
var args = [server, path, "-c-1", "--cors"];
if (project.targetFlags.exists("port"))
@@ -160,7 +126,7 @@ class HTML5Helper
args.push("--silent");
}
System.runCommand("", node, args);
System.runCommand("", "node", args);
}
}
@@ -174,37 +140,12 @@ class HTML5Helper
{
var executable = "npx";
var terser = "terser";
if (!project.targetFlags.exists("npx")) {
var suffix = switch (System.hostPlatform)
{
case WINDOWS: "-windows.exe";
case MAC: "-mac";
case LINUX: "-linux";
default: return false;
}
if (suffix == "-linux")
{
if (System.hostArchitecture == X86)
{
suffix += "32";
}
else
{
suffix += "64";
}
}
if (!project.targetFlags.exists("npx"))
{
var templatePaths = [
Path.combine(Haxelib.getPath(new Haxelib(#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end)
].concat(project.templatePaths);
executable = System.findTemplate(templatePaths, "bin/node/node" + suffix);
terser = System.findTemplate(templatePaths, "bin/node/terser/bin/terser");
if (System.hostPlatform != WINDOWS)
{
Sys.command("chmod", ["+x", executable]);
}
}
var args = [
@@ -222,21 +163,11 @@ class HTML5Helper
args.push('content=\'${sourceFile}.map\'');
}
System.runCommand("", executable, args);
System.runCommand("", "node", args);
}
else if (project.targetFlags.exists("yui"))
{
var templatePaths = [
Path.combine(Haxelib.getPath(new Haxelib(#if lime "lime" #else "hxp" #end)), #if lime "templates" #else "" #end)
].concat(project.templatePaths);
System.runCommand("", "java", [
"-Dapple.awt.UIElement=true",
"-jar",
System.findTemplate(templatePaths, "bin/yuicompressor-2.4.7.jar"),
"-o",
tempFile,
sourceFile
]);
Log.error("YUI Compressor is no longer supported by Lime for JavaScript minification.");
}
else
{

Some files were not shown because too many files have changed in this diff Show More