diff --git a/externs/air/flash/data/SQLCollationType.hx b/externs/air/flash/data/SQLCollationType.hx index fecbfc8382..cf74fac65c 100644 --- a/externs/air/flash/data/SQLCollationType.hx +++ b/externs/air/flash/data/SQLCollationType.hx @@ -1,7 +1,9 @@ package flash.data; @:native("flash.data.SQLCollationType") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract SQLCollationType(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract SQLCollationType(String) + { var BINARY = "binary"; var NO_CASE = "noCase"; diff --git a/externs/air/flash/data/SQLColumnNameStyle.hx b/externs/air/flash/data/SQLColumnNameStyle.hx index 03cb7a5adf..79fb89ab9a 100644 --- a/externs/air/flash/data/SQLColumnNameStyle.hx +++ b/externs/air/flash/data/SQLColumnNameStyle.hx @@ -1,7 +1,9 @@ package flash.data; @:native("flash.data.SQLColumnNameStyle") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract SQLColumnNameStyle(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract SQLColumnNameStyle(String) + { var DEFAULT = "default"; var LONG = "long"; diff --git a/externs/air/flash/data/SQLMode.hx b/externs/air/flash/data/SQLMode.hx index ebddf4c8c9..08335d0a3e 100644 --- a/externs/air/flash/data/SQLMode.hx +++ b/externs/air/flash/data/SQLMode.hx @@ -1,7 +1,9 @@ package flash.data; @:native("flash.data.SQLMode") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract SQLMode(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract SQLMode(String) + { var CREATE = "create"; var READ = "read"; diff --git a/externs/air/flash/data/SQLTransactionLockType.hx b/externs/air/flash/data/SQLTransactionLockType.hx index 36c24bc1a7..1ffb90f138 100644 --- a/externs/air/flash/data/SQLTransactionLockType.hx +++ b/externs/air/flash/data/SQLTransactionLockType.hx @@ -1,7 +1,9 @@ package flash.data; @:native("flash.data.SQLTransactionLockType") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract SQLTransactionLockType(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract SQLTransactionLockType(String) + { var DEFERRED = "deferred"; var EXCLUSIVE = "exclusive"; diff --git a/externs/air/flash/desktop/InvokeEventReason.hx b/externs/air/flash/desktop/InvokeEventReason.hx index d06e591c1b..f52931f32b 100644 --- a/externs/air/flash/desktop/InvokeEventReason.hx +++ b/externs/air/flash/desktop/InvokeEventReason.hx @@ -1,7 +1,9 @@ package flash.desktop; @:native("flash.desktop.InvokeEventReason") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract InvokeEventReason(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract InvokeEventReason(String) + { var LOGIN = "login"; var NOTIFICATION = "notification"; diff --git a/externs/air/flash/desktop/NativeDragActions.hx b/externs/air/flash/desktop/NativeDragActions.hx index fe67ff9db7..74853e1b1d 100644 --- a/externs/air/flash/desktop/NativeDragActions.hx +++ b/externs/air/flash/desktop/NativeDragActions.hx @@ -1,7 +1,9 @@ package flash.desktop; @:native("flash.desktop.NativeDragActions") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract NativeDragActions(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract NativeDragActions(String) + { var COPY = "copy"; var LINK = "link"; diff --git a/externs/air/flash/desktop/NotificationType.hx b/externs/air/flash/desktop/NotificationType.hx index b2b3dcfb09..d64794db86 100644 --- a/externs/air/flash/desktop/NotificationType.hx +++ b/externs/air/flash/desktop/NotificationType.hx @@ -1,7 +1,9 @@ package flash.desktop; @:native("flash.desktop.NotificationType") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract NotificationType(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract NotificationType(String) + { var CRITICAL = "critical"; var INFORMATIONAL = "informational"; diff --git a/externs/air/flash/desktop/SystemIdleMode.hx b/externs/air/flash/desktop/SystemIdleMode.hx index 7fda8df044..c5cfb68516 100644 --- a/externs/air/flash/desktop/SystemIdleMode.hx +++ b/externs/air/flash/desktop/SystemIdleMode.hx @@ -1,7 +1,9 @@ package flash.desktop; @:native("flash.desktop.SystemIdleMode") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract SystemIdleMode(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract SystemIdleMode(String) + { var KEEP_AWAKE = "keepAwake"; var NORMAL = "normal"; diff --git a/externs/air/flash/display/NativeWindowDisplayState.hx b/externs/air/flash/display/NativeWindowDisplayState.hx index 4fb63f10d7..bbe831d167 100644 --- a/externs/air/flash/display/NativeWindowDisplayState.hx +++ b/externs/air/flash/display/NativeWindowDisplayState.hx @@ -1,7 +1,9 @@ package flash.display; @:native("flash.display.NativeWindowDisplayState") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract NativeWindowDisplayState(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract NativeWindowDisplayState(String) + { var MAXIMIZED = "maximized"; var MINIMIZED = "minimized"; diff --git a/externs/air/flash/display/NativeWindowRenderMode.hx b/externs/air/flash/display/NativeWindowRenderMode.hx index e2d182c5bd..06edb46813 100644 --- a/externs/air/flash/display/NativeWindowRenderMode.hx +++ b/externs/air/flash/display/NativeWindowRenderMode.hx @@ -1,7 +1,9 @@ package flash.display; @:native("flash.display.NativeWindowRenderMode") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract NativeWindowRenderMode(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract NativeWindowRenderMode(String) + { var AUTO = "auto"; var CPU = "cpu"; diff --git a/externs/air/flash/display/NativeWindowResize.hx b/externs/air/flash/display/NativeWindowResize.hx index b3cd1a1f9f..b1063d674a 100644 --- a/externs/air/flash/display/NativeWindowResize.hx +++ b/externs/air/flash/display/NativeWindowResize.hx @@ -1,7 +1,9 @@ package flash.display; @:native("flash.display.NativeWindowResize") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract NativeWindowResize(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract NativeWindowResize(String) + { var BOTTOM = "bottom"; var BOTTOM_LEFT = "bottomLeft"; diff --git a/externs/air/flash/display/NativeWindowSystemChrome.hx b/externs/air/flash/display/NativeWindowSystemChrome.hx index e271969831..3000d5e962 100644 --- a/externs/air/flash/display/NativeWindowSystemChrome.hx +++ b/externs/air/flash/display/NativeWindowSystemChrome.hx @@ -1,7 +1,9 @@ package flash.display; @:native("flash.display.NativeWindowSystemChrome") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract NativeWindowSystemChrome(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract NativeWindowSystemChrome(String) + { var ALTERNATE = "alternate"; var NONE = "none"; diff --git a/externs/air/flash/display/NativeWindowType.hx b/externs/air/flash/display/NativeWindowType.hx index 90ff5bb41f..19684157d1 100644 --- a/externs/air/flash/display/NativeWindowType.hx +++ b/externs/air/flash/display/NativeWindowType.hx @@ -1,7 +1,9 @@ package flash.display; @:native("flash.display.NativeWindowType") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract NativeWindowType(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract NativeWindowType(String) + { var LIGHTWEIGHT = "lightweight"; var NORMAL = "normal"; diff --git a/externs/air/flash/display/StageAspectRatio.hx b/externs/air/flash/display/StageAspectRatio.hx index 70ede16512..e7a44c3dbc 100644 --- a/externs/air/flash/display/StageAspectRatio.hx +++ b/externs/air/flash/display/StageAspectRatio.hx @@ -1,7 +1,9 @@ package flash.display; @:native("flash.display.StageAspectRatio") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract StageAspectRatio(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract StageAspectRatio(String) + { var ANY = "any"; var LANDSCAPE = "landscape"; diff --git a/externs/air/flash/display/StageOrientation.hx b/externs/air/flash/display/StageOrientation.hx index d55da84778..0bc2cfc43e 100644 --- a/externs/air/flash/display/StageOrientation.hx +++ b/externs/air/flash/display/StageOrientation.hx @@ -1,7 +1,9 @@ package flash.display; @:native("flash.display.StageOrientation") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract StageOrientation(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract StageOrientation(String) + { var DEFAULT = "default"; var ROTATED_LEFT = "rotatedLeft"; diff --git a/externs/air/flash/display3D/Context3DProfile.hx b/externs/air/flash/display3D/Context3DProfile.hx index 2c29eea679..65cb436852 100644 --- a/externs/air/flash/display3D/Context3DProfile.hx +++ b/externs/air/flash/display3D/Context3DProfile.hx @@ -1,7 +1,9 @@ package flash.display3D; @:native("flash.display3D.Context3DProfile") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract Context3DProfile(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract Context3DProfile(String) + { var BASELINE = "baseline"; var BASELINE_CONSTRAINED = "baselineConstrained"; diff --git a/externs/air/flash/errors/SQLErrorOperation.hx b/externs/air/flash/errors/SQLErrorOperation.hx index 15e7a651c0..7145f92921 100644 --- a/externs/air/flash/errors/SQLErrorOperation.hx +++ b/externs/air/flash/errors/SQLErrorOperation.hx @@ -1,7 +1,9 @@ package flash.errors; @:native("flash.errors.SQLErrorOperation") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract SQLErrorOperation(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract SQLErrorOperation(String) + { var ANALYZE = "analyze"; var ATTACH = "attach"; diff --git a/externs/air/flash/events/TouchEventIntent.hx b/externs/air/flash/events/TouchEventIntent.hx index 19a3c6a0e6..1bbf582220 100644 --- a/externs/air/flash/events/TouchEventIntent.hx +++ b/externs/air/flash/events/TouchEventIntent.hx @@ -1,7 +1,9 @@ package flash.events; @:native("flash.events.TouchEventIntent") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract TouchEventIntent(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract TouchEventIntent(String) + { var ERASER = "eraser"; var PEN = "pen"; diff --git a/externs/air/flash/filesystem/FileMode.hx b/externs/air/flash/filesystem/FileMode.hx index 3041db9b92..a85406018b 100644 --- a/externs/air/flash/filesystem/FileMode.hx +++ b/externs/air/flash/filesystem/FileMode.hx @@ -1,7 +1,9 @@ package flash.filesystem; @:native("flash.filesystem.FileMode") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract FileMode(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract FileMode(String) + { var APPEND = "append"; var READ = "read"; diff --git a/externs/air/flash/media/AudioPlaybackMode.hx b/externs/air/flash/media/AudioPlaybackMode.hx index fdc31990c4..aefd852c76 100644 --- a/externs/air/flash/media/AudioPlaybackMode.hx +++ b/externs/air/flash/media/AudioPlaybackMode.hx @@ -1,7 +1,9 @@ package flash.media; @:native("flash.media.AudioPlaybackMode") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract AudioPlaybackMode(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract AudioPlaybackMode(String) + { var AMBIENT = "ambient"; var MEDIA = "media"; diff --git a/externs/air/flash/media/CameraPosition.hx b/externs/air/flash/media/CameraPosition.hx index 06184cc9ed..407a7172c7 100644 --- a/externs/air/flash/media/CameraPosition.hx +++ b/externs/air/flash/media/CameraPosition.hx @@ -1,7 +1,9 @@ package flash.media; @:native("flash.media.CameraPosition") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract CameraPosition(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract CameraPosition(String) + { var BACK = "back"; var FRONT = "front"; diff --git a/externs/air/flash/media/MediaType.hx b/externs/air/flash/media/MediaType.hx index 41a10306fb..45c13af9ba 100644 --- a/externs/air/flash/media/MediaType.hx +++ b/externs/air/flash/media/MediaType.hx @@ -1,7 +1,9 @@ package flash.media; @:native("flash.media.MediaType") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract MediaType(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract MediaType(String) + { var IMAGE = "image"; var VIDEO = "video"; diff --git a/externs/air/flash/net/IPVersion.hx b/externs/air/flash/net/IPVersion.hx index ef4a44fcf2..26e845dc44 100644 --- a/externs/air/flash/net/IPVersion.hx +++ b/externs/air/flash/net/IPVersion.hx @@ -1,7 +1,9 @@ package flash.net; @:native("flash.net.IPVersion") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract IPVersion(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract IPVersion(String) + { var IPV4 = "ipv4"; var IPV6 = "ipv6"; diff --git a/externs/air/flash/notifications/NotificationStyle.hx b/externs/air/flash/notifications/NotificationStyle.hx index a2a9f3fdd2..f6b897c763 100644 --- a/externs/air/flash/notifications/NotificationStyle.hx +++ b/externs/air/flash/notifications/NotificationStyle.hx @@ -1,7 +1,9 @@ package flash.notifications; @:native("flash.notifications.NotificationStyle") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract NotificationStyle(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract NotificationStyle(String) + { var ALERT = "alert"; var BADGE = "badge"; diff --git a/externs/air/flash/printing/PaperSize.hx b/externs/air/flash/printing/PaperSize.hx index fe607d1e2a..6163285c77 100644 --- a/externs/air/flash/printing/PaperSize.hx +++ b/externs/air/flash/printing/PaperSize.hx @@ -1,7 +1,9 @@ package flash.printing; @:native("flash.printing.PaperSize") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract PaperSize(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract PaperSize(String) + { var A4 = "a4"; var A5 = "a5"; diff --git a/externs/air/flash/printing/PrintMethod.hx b/externs/air/flash/printing/PrintMethod.hx index 070fcfcf1c..04ebec9e4c 100644 --- a/externs/air/flash/printing/PrintMethod.hx +++ b/externs/air/flash/printing/PrintMethod.hx @@ -1,7 +1,9 @@ package flash.printing; @:native("flash.printing.PrintMethod") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract PrintMethod(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract PrintMethod(String) + { var AUTO = "auto"; var BITMAP = "bitmap"; diff --git a/externs/air/flash/security/ReferencesValidationSetting.hx b/externs/air/flash/security/ReferencesValidationSetting.hx index 08fda5c8ca..3c95b987cf 100644 --- a/externs/air/flash/security/ReferencesValidationSetting.hx +++ b/externs/air/flash/security/ReferencesValidationSetting.hx @@ -1,7 +1,9 @@ package flash.security; @:native("flash.security.ReferencesValidationSetting") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract ReferencesValidationSetting(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract ReferencesValidationSetting(String) + { var NEVER = "never"; var VALID_IDENTITY = "validIdentity"; diff --git a/externs/air/flash/security/RevocationCheckSettings.hx b/externs/air/flash/security/RevocationCheckSettings.hx index 09725cea85..4a6749f251 100644 --- a/externs/air/flash/security/RevocationCheckSettings.hx +++ b/externs/air/flash/security/RevocationCheckSettings.hx @@ -1,7 +1,9 @@ package flash.security; @:native("flash.security.RevocationCheckSettings") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract RevocationCheckSettings(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract RevocationCheckSettings(String) + { var ALWAYS_REQUIRED = "alwaysRequired"; var BEST_EFFORT = "bestEffort"; diff --git a/externs/air/flash/security/SignatureStatus.hx b/externs/air/flash/security/SignatureStatus.hx index f8c632599e..cc2820ce55 100644 --- a/externs/air/flash/security/SignatureStatus.hx +++ b/externs/air/flash/security/SignatureStatus.hx @@ -1,7 +1,9 @@ package flash.security; @:native("flash.security.SignatureStatus") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract SignatureStatus(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract SignatureStatus(String) + { var INVALID = "invalid"; var UNKNOWN = "unknown"; diff --git a/externs/air/flash/security/SignerTrustSettings.hx b/externs/air/flash/security/SignerTrustSettings.hx index 0164a3a253..6b72b8af19 100644 --- a/externs/air/flash/security/SignerTrustSettings.hx +++ b/externs/air/flash/security/SignerTrustSettings.hx @@ -1,7 +1,9 @@ package flash.security; @:native("flash.security.SignerTrustSettings") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract SignerTrustSettings(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract SignerTrustSettings(String) + { var CODE_SIGNING = "codeSigning"; var PLAYLIST_SIGNING = "playlistSigning"; diff --git a/externs/air/flash/text/AutoCapitalize.hx b/externs/air/flash/text/AutoCapitalize.hx index e0bb0169df..d4e0025ce6 100644 --- a/externs/air/flash/text/AutoCapitalize.hx +++ b/externs/air/flash/text/AutoCapitalize.hx @@ -1,7 +1,9 @@ package flash.text; @:native("flash.text.AutoCapitalize") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract AutoCapitalize(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract AutoCapitalize(String) + { var ALL = "all"; var NONE = "none"; diff --git a/externs/air/flash/text/ReturnKeyLabel.hx b/externs/air/flash/text/ReturnKeyLabel.hx index 3936c1722e..77fefdd17b 100644 --- a/externs/air/flash/text/ReturnKeyLabel.hx +++ b/externs/air/flash/text/ReturnKeyLabel.hx @@ -1,7 +1,9 @@ package flash.text; @:native("flash.text.ReturnKeyLabel") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract ReturnKeyLabel(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract ReturnKeyLabel(String) + { var DEFAULT = "default"; var DONE = "done"; diff --git a/externs/air/flash/text/SoftKeyboardType.hx b/externs/air/flash/text/SoftKeyboardType.hx index 3a9f747dc4..6b3e48c5bb 100644 --- a/externs/air/flash/text/SoftKeyboardType.hx +++ b/externs/air/flash/text/SoftKeyboardType.hx @@ -1,7 +1,9 @@ package flash.text; @:native("flash.text.SoftKeyboardType") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract SoftKeyboardType(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract SoftKeyboardType(String) + { var CONTACT = "contact"; var DEFAULT = "default"; diff --git a/externs/air/flash/text/StageTextClearButtonMode.hx b/externs/air/flash/text/StageTextClearButtonMode.hx index 21f09ecb2b..0111829a28 100644 --- a/externs/air/flash/text/StageTextClearButtonMode.hx +++ b/externs/air/flash/text/StageTextClearButtonMode.hx @@ -1,7 +1,9 @@ package flash.text; @:native("flash.text.StageTextClearButtonMode") -#if (haxe_ver >= 4.0) extern enum #else @:extern @:enum #end abstract StageTextClearButtonMode(String) +#if (haxe_ver >= 4.0) extern enum #else @:extern +@:enum #end abstract StageTextClearButtonMode(String) + { var ALWAYS = "always"; var NEVER = "never"; diff --git a/externs/air/sys/io/FileInput.hx b/externs/air/sys/io/FileInput.hx index 93e2f3b19d..7e3558ed28 100644 --- a/externs/air/sys/io/FileInput.hx +++ b/externs/air/sys/io/FileInput.hx @@ -34,9 +34,9 @@ class FileInput extends haxe.io.Input switch (pos) { case SeekBegin: - // this.pos = p; + // this.pos = p; case SeekEnd: - // this.pos = cast Fs.fstatSync(fd).size + p; + // this.pos = cast Fs.fstatSync(fd).size + p; case SeekCur: // this.pos += p; } diff --git a/externs/air/sys/io/FileOutput.hx b/externs/air/sys/io/FileOutput.hx index cdd3ba2414..e0e96e9d57 100644 --- a/externs/air/sys/io/FileOutput.hx +++ b/externs/air/sys/io/FileOutput.hx @@ -31,9 +31,9 @@ class FileOutput extends haxe.io.Output switch (pos) { case SeekBegin: - // this.pos = p; + // this.pos = p; case SeekEnd: - // this.pos = cast Fs.fstatSync(fd).size + p; + // this.pos = cast Fs.fstatSync(fd).size + p; case SeekCur: // this.pos += p; } diff --git a/src/lime/_internal/backend/flash/FlashHTTPRequest.hx b/src/lime/_internal/backend/flash/FlashHTTPRequest.hx index 67861d810a..e44164755f 100644 --- a/src/lime/_internal/backend/flash/FlashHTTPRequest.hx +++ b/src/lime/_internal/backend/flash/FlashHTTPRequest.hx @@ -174,4 +174,4 @@ class FlashHTTPRequest urlLoader.load(urlRequest); return promise.future; } -} \ No newline at end of file +} diff --git a/src/lime/_internal/backend/flash/FlashWindow.hx b/src/lime/_internal/backend/flash/FlashWindow.hx index a1f3dc7b60..6375721404 100644 --- a/src/lime/_internal/backend/flash/FlashWindow.hx +++ b/src/lime/_internal/backend/flash/FlashWindow.hx @@ -225,8 +225,7 @@ class FlashWindow "middleMouseMove", "middleMouseUp" #if ((!openfl && !disable_flash_right_click) - || enable_flash_right_click), "rightMouseDown", "rightMouseMove", "rightMouseUp" - #end + || enable_flash_right_click), "rightMouseDown", "rightMouseMove", "rightMouseUp" #end ]; for (event in events) diff --git a/src/lime/_internal/backend/html5/HTML5AudioSource.hx b/src/lime/_internal/backend/html5/HTML5AudioSource.hx index bde1499be9..7fa6e72f36 100644 --- a/src/lime/_internal/backend/html5/HTML5AudioSource.hx +++ b/src/lime/_internal/backend/html5/HTML5AudioSource.hx @@ -218,10 +218,9 @@ class HTML5AudioSource #if lime_howlerjs parent.buffer.__srcHowl.rate(value); #end - + return getPitch(); } - public function getPosition():Vector4 { @@ -246,7 +245,8 @@ class HTML5AudioSource position.w = value.w; #if lime_howlerjs - if (parent.buffer != null && parent.buffer.__srcHowl != null && parent.buffer.__srcHowl.pos != null) parent.buffer.__srcHowl.pos(position.x, position.y, position.z, id); + if (parent.buffer != null && parent.buffer.__srcHowl != null && parent.buffer.__srcHowl.pos != null) parent.buffer.__srcHowl.pos(position.x, + position.y, position.z, id); // There are more settings to the position of the sound on the "pannerAttr()" function of howler. Maybe somebody who understands sound should look into it? #end diff --git a/src/lime/_internal/backend/html5/HTML5Thread.hx b/src/lime/_internal/backend/html5/HTML5Thread.hx index 845a2924d7..2b9bb3f195 100644 --- a/src/lime/_internal/backend/html5/HTML5Thread.hx +++ b/src/lime/_internal/backend/html5/HTML5Thread.hx @@ -1,7 +1,6 @@ package lime._internal.backend.html5; import lime.app.Event; - #if macro import haxe.macro.Context; import haxe.macro.Expr; @@ -30,7 +29,8 @@ import lime.app.Application; /** Emulates much of the `sys.thread.Thread` API using web workers. **/ -class HTML5Thread { +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 __messages:List = new List(); @@ -80,8 +80,7 @@ class HTML5Thread { #if !macro // Find the URL of the primary JS file. var url:URL = new URL(__current.__href); - url.pathname = url.pathname.substr(0, url.pathname.lastIndexOf("/") + 1) - + Application.current.meta["file"] + ".js"; + url.pathname = url.pathname.substr(0, url.pathname.lastIndexOf("/") + 1) + Application.current.meta["file"] + ".js"; // Use the hash to distinguish workers. if (url.hash.length > 0) url.hash += "_"; @@ -108,9 +107,9 @@ class HTML5Thread { private static inline function zeroDelay():Promise { return new Promise(function(resolve, _):Void - { - js.Lib.global.setTimeout(resolve); - }); + { + js.Lib.global.setTimeout(resolve); + }); } #end @@ -128,8 +127,8 @@ class HTML5Thread { // 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()) - .then(function(_) return lime._internal.backend.html5.HTML5Thread.__messages.pop()); + $jsCode("await {0}", lime._internal.backend.html5.HTML5Thread.zeroDelay()).then(function(_) return + lime._internal.backend.html5.HTML5Thread.__messages.pop()); switch (block.expr) { @@ -138,15 +137,18 @@ 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 + $jsCode("await {0}", new + #if haxe4 + js.lib.Promise + #else + js.Promise + #end (function(resolve, _):Void { @:privateAccess lime._internal.backend.html5.HTML5Thread.__resolveMethods.add(resolve); - } - )); + })); } - else - $zeroDelayExpr; + else $zeroDelayExpr; } } @@ -294,29 +296,31 @@ abstract WorkFunction(WorkFunctionData) from Wor as the `initialExpr`. For instance, `array[i].foo.bar` will result in `chain == ["foo", "bar"]` and `initialExpr == array[i]`. **/ - private static function parseFieldChain(chain:Expr):{ chain:Array, ?initialExpr:Expr } + private static function parseFieldChain(chain:Expr):{chain:Array, ?initialExpr:Expr} { - switch(chain.expr) + switch (chain.expr) { case EConst(CIdent(ident)): - return { chain: [ident] }; + return {chain: [ident]}; case EField(e, field): var out = parseFieldChain(e); out.chain.push(field); return out; default: - return { chain: [], initialExpr: chain }; + return {chain: [], initialExpr: chain}; } } #end // `@:from` would cause errors during the macro phase. - @:noCompletion @:dox(hide) #if !macro @:from #end + @:noCompletion + @:dox(hide) #if !macro @:from #end public static #if !macro macro #end function fromFunction(func:ExprOf) { - var defaultOutput:Expr = macro { - func: $func - }; + var defaultOutput:Expr = macro + { + func: $func + }; if (!Context.defined("lime-threads")) { @@ -343,11 +347,12 @@ abstract WorkFunction(WorkFunctionData) from Wor var classPath:String = matcher.matched(1); var functionName:String = matcher.matched(2); - return macro { - func: $func, - classPath: $v{classPath}, - functionName: $v{functionName} - }; + return macro + { + func: $func, + classPath: $v{classPath}, + functionName: $v{functionName} + }; } } @@ -416,7 +421,7 @@ abstract WorkFunction(WorkFunctionData) from Wor else { #if !macro - this.sourceCode = (cast this.func:Function).toString(); + this.sourceCode = (cast this.func : Function).toString(); if (this.sourceCode.indexOf("[native code]") < 0) { // All set. @@ -456,7 +461,8 @@ abstract WorkFunction(WorkFunctionData) from Wor Stores the class path and function name of a function, so that it can be found again in the background thread. **/ -typedef WorkFunctionData = { +typedef WorkFunctionData = +{ @:optional var classPath:String; @:optional var functionName:String; @:optional var sourceCode:String; @@ -475,17 +481,15 @@ abstract Message(Dynamic) from Dynamic to Dynamic private static inline function skip(object:Dynamic):Bool { // Skip `null` for obvious reasons. - return object == null - // No need to preserve a primitive type. - || !#if (haxe_ver >= 4.2) Std.isOfType #else untyped __js__ #end (object, Object) - // Objects with this field have been deliberately excluded. - || Reflect.field(object, SKIP_FIELD) == true - // A `Uint8Array` (the type used by `haxe.io.Bytes`) can have - // thousands or millions of fields, which can take entire seconds to - // 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); + return object == null // No need to preserve a primitive type. + || !#if (haxe_ver >= 4.2) Std.isOfType #else untyped __js__ #end (object, Object) // Objects with this field have been deliberately excluded. + || Reflect.field(object, SKIP_FIELD) == true // A `Uint8Array` (the type used by `haxe.io.Bytes`) can have + // thousands or millions of fields, which can take entire seconds to + // 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); } #end @@ -556,7 +560,7 @@ abstract Message(Dynamic) from Dynamic to Dynamic // Recurse. for (child in Object.values(this)) { - (child:Message).preserveClasses(); + (child : Message).preserveClasses(); } #end } @@ -600,9 +604,8 @@ 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))); + Object.setPrototypeOf(this, #if haxe4 Syntax.code #else untyped __js__ #end ("$hxClasses[{0}].prototype", Reflect.field(this, + PROTOTYPE_FIELD))); } catch (e:Dynamic) {} } @@ -610,7 +613,7 @@ abstract Message(Dynamic) from Dynamic to Dynamic // Recurse. for (child in Object.values(this)) { - (child:Message).restoreClasses(flag); + (child : Message).restoreClasses(flag); } #end } @@ -620,13 +623,15 @@ abstract Message(Dynamic) from Dynamic to Dynamic typedef Worker = Dynamic; typedef URL = Dynamic; class Object {} + class Browser { public static var window:Dynamic; } + class Lib { - public static var global:Dynamic = { location: {} }; + public static var global:Dynamic = {location: {}}; } #end @@ -641,15 +646,19 @@ class Lib **/ // Mozilla uses "transferable" and "transferrable" interchangeably, but the HTML // specification only uses the former. + @:forward -abstract Transferable(Dynamic) #if macro from Dynamic - #else from lime.utils.ArrayBuffer from js.html.MessagePort from js.html.ImageBitmap #end -{ -} +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 { +extern class Object +{ static function setPrototypeOf(obj:T, prototype:Null<{}>):T; @:pure static function values(obj:{}):Array; static var prototype(default, never):Dynamic; diff --git a/src/lime/_internal/backend/html5/HTML5Window.hx b/src/lime/_internal/backend/html5/HTML5Window.hx index 6d0869eece..744cb2346f 100644 --- a/src/lime/_internal/backend/html5/HTML5Window.hx +++ b/src/lime/_internal/backend/html5/HTML5Window.hx @@ -480,7 +480,8 @@ class HTML5Window private function handleCutOrCopyEvent(event:ClipboardEvent):Void { var text = Clipboard.text; - if (text == null) { + if (text == null) + { text = ""; } event.clipboardData.setData("text/plain", text); @@ -1239,7 +1240,6 @@ class HTML5Window textInput.removeEventListener('paste', handlePasteEvent, true); textInput.removeEventListener('compositionstart', handleCompositionstartEvent, true); textInput.removeEventListener('compositionend', handleCompositionendEvent, true); - } } diff --git a/src/lime/_internal/backend/native/NativeApplication.hx b/src/lime/_internal/backend/native/NativeApplication.hx index 2208624bfb..7315d01a9e 100644 --- a/src/lime/_internal/backend/native/NativeApplication.hx +++ b/src/lime/_internal/backend/native/NativeApplication.hx @@ -430,8 +430,7 @@ class NativeApplication window.onTextInput.dispatch(CFFI.stringValue(textEventInfo.text)); case TEXT_EDIT: - window.onTextEdit.dispatch(CFFI.stringValue(textEventInfo.text), textEventInfo.start, - textEventInfo.length); + window.onTextEdit.dispatch(CFFI.stringValue(textEventInfo.text), textEventInfo.start, textEventInfo.length); default: } @@ -640,7 +639,9 @@ class NativeApplication } } -#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract ApplicationEventType(Int) +#if (haxe_ver >= 4.0) private enum #else @:enum + +private #end abstract ApplicationEventType(Int) { var UPDATE = 0; var EXIT = 1; @@ -661,7 +662,9 @@ class NativeApplication } } -#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract ClipboardEventType(Int) +#if (haxe_ver >= 4.0) private enum #else @:enum + +private #end abstract ClipboardEventType(Int) { var UPDATE = 0; } @@ -683,7 +686,9 @@ class NativeApplication } } -#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract DropEventType(Int) +#if (haxe_ver >= 4.0) private enum #else @:enum + +private #end abstract DropEventType(Int) { var DROP_FILE = 0; } @@ -711,7 +716,9 @@ class NativeApplication } } -#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract GamepadEventType(Int) +#if (haxe_ver >= 4.0) private enum #else @:enum + +private #end abstract GamepadEventType(Int) { var AXIS_MOVE = 0; var BUTTON_DOWN = 1; @@ -745,7 +752,9 @@ class NativeApplication } } -#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract JoystickEventType(Int) +#if (haxe_ver >= 4.0) private enum #else @:enum + +private #end abstract JoystickEventType(Int) { var AXIS_MOVE = 0; var HAT_MOVE = 1; @@ -757,12 +766,12 @@ class NativeApplication @:keep /*private*/ class KeyEventInfo { - public var keyCode: Float; + public var keyCode:Float; public var modifier:Int; public var type:KeyEventType; public var windowID:Int; - public function new(type:KeyEventType = null, windowID:Int = 0, keyCode: Float = 0, modifier:Int = 0) + public function new(type:KeyEventType = null, windowID:Int = 0, keyCode:Float = 0, modifier:Int = 0) { this.type = type; this.windowID = windowID; @@ -776,7 +785,9 @@ class NativeApplication } } -#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract KeyEventType(Int) +#if (haxe_ver >= 4.0) private enum #else @:enum + +private #end abstract KeyEventType(Int) { var KEY_DOWN = 0; var KEY_UP = 1; @@ -793,7 +804,8 @@ class NativeApplication public var y:Float; public var clickCount:Int; - public function new(type:MouseEventType = null, windowID:Int = 0, x:Float = 0, y:Float = 0, button:Int = 0, movementX:Float = 0, movementY:Float = 0, clickCount:Int = 0) + public function new(type:MouseEventType = null, windowID:Int = 0, x:Float = 0, y:Float = 0, button:Int = 0, movementX:Float = 0, movementY:Float = 0, + clickCount:Int = 0) { this.type = type; this.windowID = 0; @@ -811,7 +823,9 @@ class NativeApplication } } -#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract MouseEventType(Int) +#if (haxe_ver >= 4.0) private enum #else @:enum + +private #end abstract MouseEventType(Int) { var MOUSE_DOWN = 0; var MOUSE_UP = 1; @@ -834,7 +848,9 @@ class NativeApplication } } -#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract RenderEventType(Int) +#if (haxe_ver >= 4.0) private enum #else @:enum + +private #end abstract RenderEventType(Int) { var RENDER = 0; var RENDER_CONTEXT_LOST = 1; @@ -864,7 +880,9 @@ class NativeApplication } } -#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract SensorEventType(Int) +#if (haxe_ver >= 4.0) private enum #else @:enum + +private #end abstract SensorEventType(Int) { var ACCELEROMETER = 0; } @@ -893,7 +911,9 @@ class NativeApplication } } -#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract TextEventType(Int) +#if (haxe_ver >= 4.0) private enum #else @:enum + +private #end abstract TextEventType(Int) { var TEXT_INPUT = 0; var TEXT_EDIT = 1; @@ -928,7 +948,9 @@ class NativeApplication } } -#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract TouchEventType(Int) +#if (haxe_ver >= 4.0) private enum #else @:enum + +private #end abstract TouchEventType(Int) { var TOUCH_START = 0; var TOUCH_END = 1; @@ -960,7 +982,9 @@ class NativeApplication } } -#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract WindowEventType(Int) +#if (haxe_ver >= 4.0) private enum #else @:enum + +private #end abstract WindowEventType(Int) { var WINDOW_ACTIVATE = 0; var WINDOW_CLOSE = 1; diff --git a/src/lime/_internal/backend/native/NativeAudioSource.hx b/src/lime/_internal/backend/native/NativeAudioSource.hx index c2d195117c..0032457504 100644 --- a/src/lime/_internal/backend/native/NativeAudioSource.hx +++ b/src/lime/_internal/backend/native/NativeAudioSource.hx @@ -224,11 +224,11 @@ class NativeAudioSource var buffer = new UInt8Array(length); var read = 0, total = 0, readMax; - for (i in 0...STREAM_NUM_BUFFERS-1) + for (i in 0...STREAM_NUM_BUFFERS - 1) { bufferTimeBlocks[i] = bufferTimeBlocks[i + 1]; } - bufferTimeBlocks[STREAM_NUM_BUFFERS-1] = vorbisFile.timeTell(); + bufferTimeBlocks[STREAM_NUM_BUFFERS - 1] = vorbisFile.timeTell(); while (total < length) { @@ -405,9 +405,9 @@ class NativeAudioSource { // `setCurrentTime()` has side effects and is never safe to skip. /* if (value == getCurrentTime()) - { - return value; - } */ + { + return value; + }*/ if (handle != null) { diff --git a/src/lime/_internal/backend/native/NativeCFFI.hx b/src/lime/_internal/backend/native/NativeCFFI.hx index 33ce3df541..38cf2a1967 100644 --- a/src/lime/_internal/backend/native/NativeCFFI.hx +++ b/src/lime/_internal/backend/native/NativeCFFI.hx @@ -411,8 +411,7 @@ class NativeCFFI "lime_file_watcher_add_directory", "oobo", false)); private static var lime_file_watcher_remove_directory = new cpp.Callablecpp.Object->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_file_watcher_remove_directory", "oov", false)); - private static var lime_file_watcher_update = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_file_watcher_update", "ov", - false)); + private static var lime_file_watcher_update = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_file_watcher_update", "ov", false)); private static var lime_font_get_ascender = new cpp.CallableInt>(cpp.Prime._loadPrime("lime", "lime_font_get_ascender", "oi", false)); private static var lime_font_get_descender = new cpp.CallableInt>(cpp.Prime._loadPrime("lime", "lime_font_get_descender", "oi", false)); private static var lime_font_get_family_name = new cpp.Callablecpp.Object>(cpp.Prime._loadPrime("lime", "lime_font_get_family_name", "oo", @@ -549,8 +548,7 @@ class NativeCFFI private static var lime_window_alert = new cpp.CallableString->String->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_window_alert", "ossv", false)); private static var lime_window_close = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_window_close", "ov", false)); - private static var lime_window_context_flip = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_window_context_flip", "ov", - false)); + private static var lime_window_context_flip = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_window_context_flip", "ov", false)); private static var lime_window_context_lock = new cpp.Callablecpp.Object>(cpp.Prime._loadPrime("lime", "lime_window_context_lock", "oo", false)); private static var lime_window_context_make_current = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", @@ -568,8 +566,7 @@ class NativeCFFI "oo", false)); private static var lime_window_get_height = new cpp.CallableInt>(cpp.Prime._loadPrime("lime", "lime_window_get_height", "oi", false)); private static var lime_window_get_id = new cpp.CallableInt>(cpp.Prime._loadPrime("lime", "lime_window_get_id", "oi", false)); - private static var lime_window_get_mouse_lock = new cpp.CallableBool>(cpp.Prime._loadPrime("lime", "lime_window_get_mouse_lock", "ob", - false)); + private static var lime_window_get_mouse_lock = new cpp.CallableBool>(cpp.Prime._loadPrime("lime", "lime_window_get_mouse_lock", "ob", false)); private static var lime_window_get_opacity = new cpp.CallableFloat>(cpp.Prime._loadPrime("lime", "lime_window_get_opacity", "od", false)); private static var lime_window_get_scale = new cpp.CallableFloat>(cpp.Prime._loadPrime("lime", "lime_window_get_scale", "od", false)); private static var lime_window_get_text_input_enabled = new cpp.CallableBool>(cpp.Prime._loadPrime("lime", @@ -580,12 +577,11 @@ class NativeCFFI private static var lime_window_move = new cpp.CallableInt->Int->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_window_move", "oiiv", false)); private static var lime_window_read_pixels = new cpp.Callablecpp.Object->cpp.Object->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_window_read_pixels", "oooo", false)); - private static var lime_window_resize = new cpp.CallableInt->Int->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_window_resize", "oiiv", - false)); - private static var lime_window_set_minimum_size = new cpp.CallableInt->Int->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_window_set_minimum_size", "oiiv", - false)); - private static var lime_window_set_maximum_size = new cpp.CallableInt->Int->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_window_set_maximum_size", "oiiv", - false)); + private static var lime_window_resize = new cpp.CallableInt->Int->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_window_resize", "oiiv", false)); + private static var lime_window_set_minimum_size = new cpp.CallableInt->Int->cpp.Void>(cpp.Prime._loadPrime("lime", + "lime_window_set_minimum_size", "oiiv", false)); + private static var lime_window_set_maximum_size = new cpp.CallableInt->Int->cpp.Void>(cpp.Prime._loadPrime("lime", + "lime_window_set_maximum_size", "oiiv", false)); private static var lime_window_set_borderless = new cpp.CallableBool->Bool>(cpp.Prime._loadPrime("lime", "lime_window_set_borderless", "obb", false)); private static var lime_window_set_cursor = new cpp.CallableInt->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_window_set_cursor", "oiv", @@ -876,8 +872,7 @@ class NativeCFFI return null; } - @:hlNative("lime", "hl_file_dialog_open_file") private static function lime_file_dialog_open_file(title:String, filter:String, - defaultPath:String):hl.Bytes + @:hlNative("lime", "hl_file_dialog_open_file") private static function lime_file_dialog_open_file(title:String, filter:String, defaultPath:String):hl.Bytes { return null; } @@ -888,8 +883,7 @@ class NativeCFFI return null; } - @:hlNative("lime", "hl_file_dialog_save_file") private static function lime_file_dialog_save_file(title:String, filter:String, - defaultPath:String):hl.Bytes + @:hlNative("lime", "hl_file_dialog_save_file") private static function lime_file_dialog_save_file(title:String, filter:String, defaultPath:String):hl.Bytes { return null; } @@ -905,8 +899,7 @@ class NativeCFFI return 0; } - @:hlNative("lime", "hl_file_watcher_remove_directory") private static function lime_file_watcher_remove_directory(handle:CFFIPointer, - watchID:Int):Void {} + @:hlNative("lime", "hl_file_watcher_remove_directory") private static function lime_file_watcher_remove_directory(handle:CFFIPointer, watchID:Int):Void {} @:hlNative("lime", "hl_file_watcher_update") private static function lime_file_watcher_update(handle:CFFIPointer):Void {} @@ -1362,11 +1355,9 @@ class NativeCFFI return false; } - @:hlNative("lime", "hl_window_set_text_input_enabled") private static function lime_window_set_text_input_enabled(handle:CFFIPointer, - enabled:Bool):Void {} + @:hlNative("lime", "hl_window_set_text_input_enabled") private static function lime_window_set_text_input_enabled(handle:CFFIPointer, enabled:Bool):Void {} - @:hlNative("lime", "hl_window_set_text_input_rect") private static function lime_window_set_text_input_rect(handle:CFFIPointer, - rect:Rectangle):Void {} + @:hlNative("lime", "hl_window_set_text_input_rect") private static function lime_window_set_text_input_rect(handle:CFFIPointer, rect:Rectangle):Void {} @:hlNative("lime", "hl_window_set_title") private static function lime_window_set_title(handle:CFFIPointer, title:String):String { @@ -1380,7 +1371,10 @@ class NativeCFFI @:hlNative("lime", "hl_window_warp_mouse") private static function lime_window_warp_mouse(handle:CFFIPointer, x:Int, y:Int):Void {} - @:hlNative("lime", "hl_window_get_opacity") private static function lime_window_get_opacity(handle:CFFIPointer):Float { return 0.0; } + @:hlNative("lime", "hl_window_get_opacity") private static function lime_window_get_opacity(handle:CFFIPointer):Float + { + return 0.0; + } @:hlNative("lime", "hl_window_set_opacity") private static function lime_window_set_opacity(handle:CFFIPointer, value:Float):Void {} @@ -1720,10 +1714,8 @@ class NativeCFFI private static var lime_al_get_booleanv = new cpp.CallableInt->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_al_get_booleanv", "iio", false)); private static var lime_al_gen_buffer = new cpp.Callablecpp.Object>(cpp.Prime._loadPrime("lime", "lime_al_gen_buffer", "o", false)); private static var lime_al_gen_buffers = new cpp.Callablecpp.Object>(cpp.Prime._loadPrime("lime", "lime_al_gen_buffers", "io", false)); - private static var lime_al_get_buffer3f = new cpp.CallableInt->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_al_get_buffer3f", "oio", - false)); - private static var lime_al_get_buffer3i = new cpp.CallableInt->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_al_get_buffer3i", "oio", - false)); + private static var lime_al_get_buffer3f = new cpp.CallableInt->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_al_get_buffer3f", "oio", false)); + private static var lime_al_get_buffer3i = new cpp.CallableInt->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_al_get_buffer3i", "oio", false)); private static var lime_al_get_bufferf = new cpp.CallableInt->cpp.Float32>(cpp.Prime._loadPrime("lime", "lime_al_get_bufferf", "oif", false)); private static var lime_al_get_bufferfv = new cpp.CallableInt->Int->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_al_get_bufferfv", "oiio", false)); @@ -1745,10 +1737,8 @@ class NativeCFFI private static var lime_al_get_listeneri = new cpp.CallableInt>(cpp.Prime._loadPrime("lime", "lime_al_get_listeneri", "ii", false)); private static var lime_al_get_listeneriv = new cpp.CallableInt->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_al_get_listeneriv", "iio", false)); private static var lime_al_get_proc_address = new cpp.CallableFloat>(cpp.Prime._loadPrime("lime", "lime_al_get_proc_address", "sd", false)); - private static var lime_al_get_source3f = new cpp.CallableInt->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_al_get_source3f", "oio", - false)); - private static var lime_al_get_source3i = new cpp.CallableInt->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_al_get_source3i", "oio", - false)); + private static var lime_al_get_source3f = new cpp.CallableInt->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_al_get_source3f", "oio", false)); + private static var lime_al_get_source3i = new cpp.CallableInt->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_al_get_source3i", "oio", false)); private static var lime_al_get_sourcef = new cpp.CallableInt->cpp.Float32>(cpp.Prime._loadPrime("lime", "lime_al_get_sourcef", "oif", false)); private static var lime_al_get_sourcefv = new cpp.CallableInt->Int->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_al_get_sourcefv", "oiio", false)); @@ -1758,8 +1748,7 @@ class NativeCFFI private static var lime_al_get_string = new cpp.Callablecpp.Object>(cpp.Prime._loadPrime("lime", "lime_al_get_string", "io", false)); private static var lime_al_is_buffer = new cpp.CallableBool>(cpp.Prime._loadPrime("lime", "lime_al_is_buffer", "ob", false)); private static var lime_al_is_enabled = new cpp.CallableBool>(cpp.Prime._loadPrime("lime", "lime_al_is_enabled", "ib", false)); - private static var lime_al_is_extension_present = new cpp.CallableBool>(cpp.Prime._loadPrime("lime", "lime_al_is_extension_present", "sb", - false)); + private static var lime_al_is_extension_present = new cpp.CallableBool>(cpp.Prime._loadPrime("lime", "lime_al_is_extension_present", "sb", false)); private static var lime_al_is_source = new cpp.CallableBool>(cpp.Prime._loadPrime("lime", "lime_al_is_source", "ob", false)); private static var lime_al_listener3f = new cpp.Callablecpp.Float32->cpp.Float32->cpp.Float32->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_al_listener3f", "ifffv", false)); @@ -1769,8 +1758,7 @@ class NativeCFFI private static var lime_al_listeneri = new cpp.CallableInt->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_al_listeneri", "iiv", false)); private static var lime_al_listeneriv = new cpp.Callablecpp.Object->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_al_listeneriv", "iov", false)); private static var lime_al_source_pause = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_al_source_pause", "ov", false)); - private static var lime_al_source_pausev = new cpp.Callablecpp.Object->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_al_source_pausev", "iov", - false)); + private static var lime_al_source_pausev = new cpp.Callablecpp.Object->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_al_source_pausev", "iov", false)); private static var lime_al_source_play = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_al_source_play", "ov", false)); private static var lime_al_source_playv = new cpp.Callablecpp.Object->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_al_source_playv", "iov", false)); private static var lime_al_source_queue_buffers = new cpp.CallableInt->cpp.Object->cpp.Void>(cpp.Prime._loadPrime("lime", @@ -1798,8 +1786,7 @@ class NativeCFFI private static var lime_alc_close_device = new cpp.CallableBool>(cpp.Prime._loadPrime("lime", "lime_alc_close_device", "ob", false)); private static var lime_alc_create_context = new cpp.Callablecpp.Object->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_alc_create_context", "ooo", false)); - private static var lime_alc_destroy_context = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_alc_destroy_context", "ov", - false)); + private static var lime_alc_destroy_context = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_alc_destroy_context", "ov", false)); private static var lime_alc_get_contexts_device = new cpp.Callablecpp.Object>(cpp.Prime._loadPrime("lime", "lime_alc_get_contexts_device", "oo", false)); private static var lime_alc_get_current_context = new cpp.Callablecpp.Object>(cpp.Prime._loadPrime("lime", "lime_alc_get_current_context", "o", @@ -1812,11 +1799,9 @@ class NativeCFFI false)); private static var lime_alc_open_device = new cpp.Callablecpp.Object>(cpp.Prime._loadPrime("lime", "lime_alc_open_device", "so", false)); private static var lime_alc_pause_device = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_alc_pause_device", "ov", false)); - private static var lime_alc_process_context = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_alc_process_context", "ov", - false)); + private static var lime_alc_process_context = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_alc_process_context", "ov", false)); private static var lime_alc_resume_device = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_alc_resume_device", "ov", false)); - private static var lime_alc_suspend_context = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_alc_suspend_context", "ov", - false)); + private static var lime_alc_suspend_context = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_alc_suspend_context", "ov", false)); private static var lime_al_gen_filter = new cpp.Callablecpp.Object>(cpp.Prime._loadPrime("lime", "lime_al_gen_filter", "o", false)); private static var lime_al_filteri = new cpp.CallableInt->cpp.Object->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_al_filteri", "oiov", false)); @@ -2225,8 +2210,7 @@ class NativeCFFI @:hlNative("lime", "hl_al_source3f") private static function lime_al_source3f(source:CFFIPointer, param:Int, value1:hl.F32, value2:hl.F32, value3:hl.F32):Void {} - @:hlNative("lime", "hl_al_source3i") private static function lime_al_source3i(source:CFFIPointer, param:Int, value1:Dynamic, value2:Int, - value3:Int):Void {} + @:hlNative("lime", "hl_al_source3i") private static function lime_al_source3i(source:CFFIPointer, param:Int, value1:Dynamic, value2:Int, value3:Int):Void {} @:hlNative("lime", "hl_al_sourcef") private static function lime_al_sourcef(source:CFFIPointer, param:Int, value:hl.F32):Void {} @@ -2595,8 +2579,7 @@ class NativeCFFI private static var lime_cairo_arc_negative = new cpp.CallableFloat->Float->Float->Float->Float->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_cairo_arc_negative", "odddddv", false)); private static var lime_cairo_clip = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_cairo_clip", "ov", false)); - private static var lime_cairo_clip_preserve = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_cairo_clip_preserve", "ov", - false)); + private static var lime_cairo_clip_preserve = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_cairo_clip_preserve", "ov", false)); private static var lime_cairo_clip_extents = new cpp.CallableFloat->Float->Float->Float->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_cairo_clip_extents", "oddddv", false)); private static var lime_cairo_close_path = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_cairo_close_path", "ov", false)); @@ -2607,8 +2590,7 @@ class NativeCFFI private static var lime_cairo_fill = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_cairo_fill", "ov", false)); private static var lime_cairo_fill_extents = new cpp.CallableFloat->Float->Float->Float->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_cairo_fill_extents", "oddddv", false)); - private static var lime_cairo_fill_preserve = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_cairo_fill_preserve", "ov", - false)); + private static var lime_cairo_fill_preserve = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_cairo_fill_preserve", "ov", false)); private static var lime_cairo_get_antialias = new cpp.CallableInt>(cpp.Prime._loadPrime("lime", "lime_cairo_get_antialias", "oi", false)); private static var lime_cairo_get_current_point = new cpp.Callablecpp.Object>(cpp.Prime._loadPrime("lime", "lime_cairo_get_current_point", "oo", false)); @@ -2635,10 +2617,8 @@ class NativeCFFI false)); private static var lime_cairo_identity_matrix = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_cairo_identity_matrix", "ov", false)); - private static var lime_cairo_in_clip = new cpp.CallableFloat->Float->Bool>(cpp.Prime._loadPrime("lime", "lime_cairo_in_clip", "oddb", - false)); - private static var lime_cairo_in_fill = new cpp.CallableFloat->Float->Bool>(cpp.Prime._loadPrime("lime", "lime_cairo_in_fill", "oddb", - false)); + private static var lime_cairo_in_clip = new cpp.CallableFloat->Float->Bool>(cpp.Prime._loadPrime("lime", "lime_cairo_in_clip", "oddb", false)); + private static var lime_cairo_in_fill = new cpp.CallableFloat->Float->Bool>(cpp.Prime._loadPrime("lime", "lime_cairo_in_fill", "oddb", false)); private static var lime_cairo_in_stroke = new cpp.CallableFloat->Float->Bool>(cpp.Prime._loadPrime("lime", "lime_cairo_in_stroke", "oddb", false)); private static var lime_cairo_line_to = new cpp.CallableFloat->Float->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_cairo_line_to", "oddv", @@ -2670,8 +2650,7 @@ class NativeCFFI private static var lime_cairo_restore = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_cairo_restore", "ov", false)); private static var lime_cairo_rotate = new cpp.CallableFloat->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_cairo_rotate", "odv", false)); private static var lime_cairo_save = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_cairo_save", "ov", false)); - private static var lime_cairo_scale = new cpp.CallableFloat->Float->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_cairo_scale", "oddv", - false)); + private static var lime_cairo_scale = new cpp.CallableFloat->Float->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_cairo_scale", "oddv", false)); private static var lime_cairo_set_antialias = new cpp.CallableInt->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_cairo_set_antialias", "oiv", false)); private static var lime_cairo_set_dash = new cpp.Callablecpp.Object->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_cairo_set_dash", "oov", @@ -2789,8 +2768,7 @@ class NativeCFFI "lime_cairo_pattern_set_filter", "oiv", false)); private static var lime_cairo_pattern_set_matrix = new cpp.Callablecpp.Object->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_cairo_pattern_set_matrix", "oov", false)); - private static var lime_cairo_surface_flush = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_cairo_surface_flush", "ov", - false)); + private static var lime_cairo_surface_flush = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_cairo_surface_flush", "ov", false)); #end #end #if (neko || cppia) @@ -2935,8 +2913,8 @@ class NativeCFFI return null; } - @:hlNative("lime", "hl_cairo_curve_to") private static function lime_cairo_curve_to(handle:CFFIPointer, x1:Float, y1:Float, x2:Float, y2:Float, - x3:Float, y3:Float):Void {} + @:hlNative("lime", "hl_cairo_curve_to") private static function lime_cairo_curve_to(handle:CFFIPointer, x1:Float, y1:Float, x2:Float, y2:Float, x3:Float, + y3:Float):Void {} @:hlNative("lime", "hl_cairo_fill") private static function lime_cairo_fill(handle:CFFIPointer):Void {} @@ -3076,8 +3054,7 @@ class NativeCFFI @:hlNative("lime", "hl_cairo_push_group") private static function lime_cairo_push_group(handle:CFFIPointer):Void {} - @:hlNative("lime", "hl_cairo_push_group_with_content") private static function lime_cairo_push_group_with_content(handle:CFFIPointer, - content:Int):Void {} + @:hlNative("lime", "hl_cairo_push_group_with_content") private static function lime_cairo_push_group_with_content(handle:CFFIPointer, content:Int):Void {} @:hlNative("lime", "hl_cairo_rectangle") private static function lime_cairo_rectangle(handle:CFFIPointer, x:Float, y:Float, width:Float, height:Float):Void {} @@ -3130,8 +3107,8 @@ class NativeCFFI @:hlNative("lime", "hl_cairo_set_source_rgba") private static function lime_cairo_set_source_rgba(handle:CFFIPointer, r:Float, g:Float, b:Float, a:Float):Void {} - @:hlNative("lime", "hl_cairo_set_source_surface") private static function lime_cairo_set_source_surface(handle:CFFIPointer, surface:CFFIPointer, - x:Float, y:Float):Void {} + @:hlNative("lime", "hl_cairo_set_source_surface") private static function lime_cairo_set_source_surface(handle:CFFIPointer, surface:CFFIPointer, x:Float, + y:Float):Void {} @:hlNative("lime", "hl_cairo_set_tolerance") private static function lime_cairo_set_tolerance(handle:CFFIPointer, tolerance:Float):Void {} @@ -3199,14 +3176,12 @@ class NativeCFFI return 0; } - @:hlNative("lime", "hl_cairo_font_options_set_antialias") private static function lime_cairo_font_options_set_antialias(handle:CFFIPointer, - v:Int):Void {} + @:hlNative("lime", "hl_cairo_font_options_set_antialias") private static function lime_cairo_font_options_set_antialias(handle:CFFIPointer, v:Int):Void {} @:hlNative("lime", "hl_cairo_font_options_set_hint_metrics") private static function lime_cairo_font_options_set_hint_metrics(handle:CFFIPointer, v:Int):Void {} - @:hlNative("lime", "hl_cairo_font_options_set_hint_style") private static function lime_cairo_font_options_set_hint_style(handle:CFFIPointer, - v:Int):Void {} + @:hlNative("lime", "hl_cairo_font_options_set_hint_style") private static function lime_cairo_font_options_set_hint_style(handle:CFFIPointer, v:Int):Void {} @:hlNative("lime", "hl_cairo_font_options_set_subpixel_order") private static function lime_cairo_font_options_set_subpixel_order(handle:CFFIPointer, v:Int):Void {} @@ -3216,8 +3191,7 @@ class NativeCFFI return null; } - @:hlNative("lime", "hl_cairo_image_surface_create") private static function lime_cairo_image_surface_create(format:Int, width:Int, - height:Int):CFFIPointer + @:hlNative("lime", "hl_cairo_image_surface_create") private static function lime_cairo_image_surface_create(format:Int, width:Int, height:Int):CFFIPointer { return null; } @@ -3253,8 +3227,8 @@ class NativeCFFI return 0; } - @:hlNative("lime", "hl_cairo_pattern_add_color_stop_rgb") private static function lime_cairo_pattern_add_color_stop_rgb(handle:CFFIPointer, - offset:Float, red:Float, green:Float, blue:Float):Void {} + @:hlNative("lime", "hl_cairo_pattern_add_color_stop_rgb") private static function lime_cairo_pattern_add_color_stop_rgb(handle:CFFIPointer, offset:Float, + red:Float, green:Float, blue:Float):Void {} @:hlNative("lime", "hl_cairo_pattern_add_color_stop_rgba") private static function lime_cairo_pattern_add_color_stop_rgba(handle:CFFIPointer, offset:Float, red:Float, green:Float, blue:Float, alpha:Float):Void {} @@ -4374,8 +4348,7 @@ class NativeCFFI private static var lime_gl_get_vertex_attribi = new cpp.CallableInt->Int>(cpp.Prime._loadPrime("lime", "lime_gl_get_vertex_attribi", "iii", false)); private static var lime_gl_get_vertex_attribiv = new cpp.CallableInt->lime.utils.DataPointer->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_gl_get_vertex_attribiv", "iidv", false)); - private static var lime_gl_get_vertex_attribii = new cpp.CallableInt->Int>(cpp.Prime._loadPrime("lime", "lime_gl_get_vertex_attribii", "iii", - false)); + private static var lime_gl_get_vertex_attribii = new cpp.CallableInt->Int>(cpp.Prime._loadPrime("lime", "lime_gl_get_vertex_attribii", "iii", false)); private static var lime_gl_get_vertex_attribiiv = new cpp.CallableInt->lime.utils.DataPointer->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_gl_get_vertex_attribiiv", "iidv", false)); private static var lime_gl_get_vertex_attribiui = new cpp.CallableInt->Int>(cpp.Prime._loadPrime("lime", "lime_gl_get_vertex_attribiui", "iii", @@ -4884,8 +4857,7 @@ class NativeCFFI @:hlNative("lime", "hl_gl_buffer_data") private static function lime_gl_buffer_data(target:Int, size:Int, srcData:DataPointer, usage:Int):Void {} - @:hlNative("lime", "hl_gl_buffer_sub_data") private static function lime_gl_buffer_sub_data(target:Int, offset:Int, size:Int, - srcData:DataPointer):Void {} + @:hlNative("lime", "hl_gl_buffer_sub_data") private static function lime_gl_buffer_sub_data(target:Int, offset:Int, size:Int, srcData:DataPointer):Void {} @:hlNative("lime", "hl_gl_check_framebuffer_status") private static function lime_gl_check_framebuffer_status(target:Int):Int { @@ -4902,8 +4874,7 @@ class NativeCFFI @:hlNative("lime", "hl_gl_clear_bufferuiv") private static function lime_gl_clear_bufferuiv(buffer:Int, drawBuffer:Int, data:DataPointer):Void {} - @:hlNative("lime", "hl_gl_client_wait_sync") private static function lime_gl_client_wait_sync(sync:CFFIPointer, flags:Int, timeoutA:Int, - timeoutB:Int):Int + @:hlNative("lime", "hl_gl_client_wait_sync") private static function lime_gl_client_wait_sync(sync:CFFIPointer, flags:Int, timeoutA:Int, timeoutB:Int):Int { return 0; } @@ -5126,8 +5097,7 @@ class NativeCFFI @:hlNative("lime", "hl_gl_get_buffer_parameteri64v") private static function lime_gl_get_buffer_parameteri64v(target:Int, index:Int, params:DataPointer):Void {} - @:hlNative("lime", "hl_gl_get_buffer_parameteriv") private static function lime_gl_get_buffer_parameteriv(target:Int, pname:Int, - params:DataPointer):Void {} + @:hlNative("lime", "hl_gl_get_buffer_parameteriv") private static function lime_gl_get_buffer_parameteriv(target:Int, pname:Int, params:DataPointer):Void {} @:hlNative("lime", "hl_gl_get_buffer_pointerv") private static function lime_gl_get_buffer_pointerv(target:Int, pname:Int):DataPointer { @@ -5489,8 +5459,8 @@ class NativeCFFI @:hlNative("lime", "hl_gl_scissor") private static function lime_gl_scissor(x:Int, y:Int, width:Int, height:Int):Void {} - @:hlNative("lime", "hl_gl_shader_binary") private static function lime_gl_shader_binary(shaders:hl.NativeArray, binaryformat:Int, - binary:DataPointer, length:Int):Void {} + @:hlNative("lime", "hl_gl_shader_binary") private static function lime_gl_shader_binary(shaders:hl.NativeArray, binaryformat:Int, binary:DataPointer, + length:Int):Void {} @:hlNative("lime", "hl_gl_shader_source") private static function lime_gl_shader_source(shader:Int, source:String):Void {} @@ -5522,8 +5492,8 @@ class NativeCFFI @:hlNative("lime", "hl_gl_tex_storage_3d") private static function lime_gl_tex_storage_3d(target:Int, level:Int, internalformat:Int, width:Int, height:Int, depth:Int):Void {} - @:hlNative("lime", "hl_gl_tex_sub_image_2d") private static function lime_gl_tex_sub_image_2d(target:Int, level:Int, xoffset:Int, yoffset:Int, - width:Int, height:Int, format:Int, type:Int, data:DataPointer):Void {} + @:hlNative("lime", "hl_gl_tex_sub_image_2d") private static function lime_gl_tex_sub_image_2d(target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, + height:Int, format:Int, type:Int, data:DataPointer):Void {} @:hlNative("lime", "hl_gl_tex_sub_image_3d") private static function lime_gl_tex_sub_image_3d(target:Int, level:Int, xoffset:Int, yoffset:Int, zoffset:Int, width:Int, height:Int, depth:Int, format:Int, type:Int, data:DataPointer):Void {} @@ -5890,8 +5860,7 @@ class NativeCFFI private static var lime_hb_blob_is_immutable = new cpp.CallableBool>(cpp.Prime._loadPrime("lime", "lime_hb_blob_is_immutable", "ob", false)); private static var lime_hb_blob_make_immutable = new cpp.Callablecpp.Void>(cpp.Prime._loadPrime("lime", "lime_hb_blob_make_immutable", "ov", false)); - private static var lime_hb_buffer_add = new cpp.CallableInt->Int->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_hb_buffer_add", "oiiv", - false)); + private static var lime_hb_buffer_add = new cpp.CallableInt->Int->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_hb_buffer_add", "oiiv", false)); private static var lime_hb_buffer_add_codepoints = new cpp.Callablelime.utils.DataPointer->Int->Int->Int-> cpp.Void>(cpp.Prime._loadPrime("lime", "lime_hb_buffer_add_codepoints", "odiiiv", false)); private static var lime_hb_buffer_add_utf8 = new cpp.CallableString->Int->Int->cpp.Void>(cpp.Prime._loadPrime("lime", @@ -5976,8 +5945,7 @@ class NativeCFFI "oiv", false)); private static var lime_hb_face_set_index = new cpp.CallableInt->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_hb_face_set_index", "oiv", false)); - private static var lime_hb_face_set_upem = new cpp.CallableInt->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_hb_face_set_upem", "oiv", - false)); + private static var lime_hb_face_set_upem = new cpp.CallableInt->cpp.Void>(cpp.Prime._loadPrime("lime", "lime_hb_face_set_upem", "oiv", false)); private static var lime_hb_feature_from_string = new cpp.Callablecpp.Object>(cpp.Prime._loadPrime("lime", "lime_hb_feature_from_string", "so", false)); private static var lime_hb_feature_to_string = new cpp.Callablecpp.Object>(cpp.Prime._loadPrime("lime", "lime_hb_feature_to_string", "oo", @@ -5995,8 +5963,7 @@ class NativeCFFI "lime_hb_font_get_glyph_kerning_for_direction", "oiiio", false)); private static var lime_hb_font_get_glyph_origin_for_direction = new cpp.CallableInt->Int->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_hb_font_get_glyph_origin_for_direction", "oiio", false)); - private static var lime_hb_font_get_parent = new cpp.Callablecpp.Object>(cpp.Prime._loadPrime("lime", "lime_hb_font_get_parent", "oo", - false)); + private static var lime_hb_font_get_parent = new cpp.Callablecpp.Object>(cpp.Prime._loadPrime("lime", "lime_hb_font_get_parent", "oo", false)); private static var lime_hb_font_get_ppem = new cpp.Callablecpp.Object>(cpp.Prime._loadPrime("lime", "lime_hb_font_get_ppem", "oo", false)); private static var lime_hb_font_get_scale = new cpp.Callablecpp.Object>(cpp.Prime._loadPrime("lime", "lime_hb_font_get_scale", "oo", false)); private static var lime_hb_font_glyph_from_string = new cpp.CallableString->Int>(cpp.Prime._loadPrime("lime", @@ -6334,8 +6301,7 @@ class NativeCFFI return null; } - @:hlNative("lime", "hl_hb_buffer_set_cluster_level") private static function lime_hb_buffer_set_cluster_level(buffer:CFFIPointer, - clusterLevel:Int):Void {} + @:hlNative("lime", "hl_hb_buffer_set_cluster_level") private static function lime_hb_buffer_set_cluster_level(buffer:CFFIPointer, clusterLevel:Int):Void {} @:hlNative("lime", "hl_hb_buffer_set_content_type") private static function lime_hb_buffer_set_content_type(buffer:CFFIPointer, contentType:Int):Void {} @@ -6494,8 +6460,8 @@ class NativeCFFI @:hlNative("lime", "hl_hb_font_set_scale") private static function lime_hb_font_set_scale(font:CFFIPointer, xScale:Int, yScale:Int):Void {} @:hlNative("lime", - "hl_hb_font_subtract_glyph_origin_for_direction") private static function lime_hb_font_subtract_glyph_origin_for_direction(font:CFFIPointer, - glyph:Int, direction:Int, x:Int, y:Int):Void {} + "hl_hb_font_subtract_glyph_origin_for_direction") private static function lime_hb_font_subtract_glyph_origin_for_direction(font:CFFIPointer, glyph:Int, + direction:Int, x:Int, y:Int):Void {} @:hlNative("lime", "hl_hb_ft_font_create") private static function lime_hb_ft_font_create(font:CFFIPointer):CFFIPointer { @@ -6616,8 +6582,7 @@ class NativeCFFI @:hlNative("lime", "hl_hb_set_union") private static function lime_hb_set_union(set:CFFIPointer, other:CFFIPointer):Void {} - @:hlNative("lime", "hl_hb_shape") private static function lime_hb_shape(font:CFFIPointer, buffer:CFFIPointer, - features:hl.NativeArray):Void {} + @:hlNative("lime", "hl_hb_shape") private static function lime_hb_shape(font:CFFIPointer, buffer:CFFIPointer, features:hl.NativeArray):Void {} #end #end #if (lime_cffi && !macro && lime_vorbis) @@ -6814,8 +6779,7 @@ class NativeCFFI return 0; } - @:hlNative("lime", "hl_vorbis_file_pcm_seek_lap") private static function lime_vorbis_file_pcm_seek_lap(vorbisFile:CFFIPointer, posLow:Int, - posHigh:Int):Int + @:hlNative("lime", "hl_vorbis_file_pcm_seek_lap") private static function lime_vorbis_file_pcm_seek_lap(vorbisFile:CFFIPointer, posLow:Int, posHigh:Int):Int { return 0; } @@ -6837,8 +6801,7 @@ class NativeCFFI return 0; } - @:hlNative("lime", "hl_vorbis_file_raw_seek_lap") private static function lime_vorbis_file_raw_seek_lap(vorbisFile:CFFIPointer, posLow:Int, - posHigh:Int):Int + @:hlNative("lime", "hl_vorbis_file_raw_seek_lap") private static function lime_vorbis_file_raw_seek_lap(vorbisFile:CFFIPointer, posLow:Int, posHigh:Int):Int { return 0; } diff --git a/src/lime/_internal/backend/native/NativeHTTPRequest.hx b/src/lime/_internal/backend/native/NativeHTTPRequest.hx index 026d23f963..c09d041288 100644 --- a/src/lime/_internal/backend/native/NativeHTTPRequest.hx +++ b/src/lime/_internal/backend/native/NativeHTTPRequest.hx @@ -361,7 +361,8 @@ class NativeHTTPRequest return promise.future; } - private function buildBuffer() { + private function buildBuffer() + { bytes = buffer.getBytes(); return bytes; } diff --git a/src/lime/_internal/backend/native/NativeWindow.hx b/src/lime/_internal/backend/native/NativeWindow.hx index 7d9ca2ed88..40d4fe49fd 100644 --- a/src/lime/_internal/backend/native/NativeWindow.hx +++ b/src/lime/_internal/backend/native/NativeWindow.hx @@ -723,7 +723,9 @@ class NativeWindow } } -#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract MouseCursorType(Int) from Int to Int +#if (haxe_ver >= 4.0) private enum #else @:enum + +private #end abstract MouseCursorType(Int) from Int to Int { var HIDDEN = 0; var ARROW = 1; @@ -740,7 +742,9 @@ class NativeWindow var WAIT_ARROW = 12; } -#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract WindowFlags(Int) +#if (haxe_ver >= 4.0) private enum #else @:enum + +private #end abstract WindowFlags(Int) { var WINDOW_FLAG_FULLSCREEN = 0x00000001; var WINDOW_FLAG_BORDERLESS = 0x00000002; diff --git a/src/lime/_internal/graphics/ImageDataUtil.hx b/src/lime/_internal/graphics/ImageDataUtil.hx index 1d2b3c3128..7c823416c4 100644 --- a/src/lime/_internal/graphics/ImageDataUtil.hx +++ b/src/lime/_internal/graphics/ImageDataUtil.hx @@ -366,15 +366,12 @@ class ImageDataUtil } else { - destPixel.r = RGBA.__clamp[ - Math.round((sourcePixel.r * sourceAlpha + destPixel.r * destAlpha * oneMinusSourceAlpha) / blendAlpha) - ]; - destPixel.g = RGBA.__clamp[ - Math.round((sourcePixel.g * sourceAlpha + destPixel.g * destAlpha * oneMinusSourceAlpha) / blendAlpha) - ]; - destPixel.b = RGBA.__clamp[ - Math.round((sourcePixel.b * sourceAlpha + destPixel.b * destAlpha * oneMinusSourceAlpha) / blendAlpha) - ]; + destPixel.r = RGBA.__clamp[Math.round((sourcePixel.r * sourceAlpha + + destPixel.r * destAlpha * oneMinusSourceAlpha) / blendAlpha)]; + destPixel.g = RGBA.__clamp[Math.round((sourcePixel.g * sourceAlpha + + destPixel.g * destAlpha * oneMinusSourceAlpha) / blendAlpha)]; + destPixel.b = RGBA.__clamp[Math.round((sourcePixel.b * sourceAlpha + + destPixel.b * destAlpha * oneMinusSourceAlpha) / blendAlpha)]; destPixel.a = RGBA.__clamp[Math.round(blendAlpha * 255.0)]; } @@ -454,15 +451,12 @@ class ImageDataUtil oneMinusSourceAlpha = 1 - sourceAlpha; blendAlpha = sourceAlpha + (destAlpha * oneMinusSourceAlpha); - destPixel.r = RGBA.__clamp[ - Math.round((sourcePixel.r * sourceAlpha + destPixel.r * destAlpha * oneMinusSourceAlpha) / blendAlpha) - ]; - destPixel.g = RGBA.__clamp[ - Math.round((sourcePixel.g * sourceAlpha + destPixel.g * destAlpha * oneMinusSourceAlpha) / blendAlpha) - ]; - destPixel.b = RGBA.__clamp[ - Math.round((sourcePixel.b * sourceAlpha + destPixel.b * destAlpha * oneMinusSourceAlpha) / blendAlpha) - ]; + destPixel.r = RGBA.__clamp[Math.round((sourcePixel.r * sourceAlpha + + destPixel.r * destAlpha * oneMinusSourceAlpha) / blendAlpha)]; + destPixel.g = RGBA.__clamp[Math.round((sourcePixel.g * sourceAlpha + + destPixel.g * destAlpha * oneMinusSourceAlpha) / blendAlpha)]; + destPixel.b = RGBA.__clamp[Math.round((sourcePixel.b * sourceAlpha + + destPixel.b * destAlpha * oneMinusSourceAlpha) / blendAlpha)]; destPixel.a = RGBA.__clamp[Math.round(blendAlpha * 255.0)]; destPixel.writeUInt8(destData, destPosition, destFormat, destPremultiplied); @@ -1749,7 +1743,9 @@ private class ImageDataView } @:noCompletion @:dox(hide) -#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract ThresholdOperation(Int) from Int to Int +#if (haxe_ver >= 4.0) private enum #else @:enum + +private #end abstract ThresholdOperation(Int) from Int to Int { var NOT_EQUALS = 0; var EQUALS = 1; diff --git a/src/lime/_internal/macros/AssetsMacro.hx b/src/lime/_internal/macros/AssetsMacro.hx index 5871daa800..7c04b99cb3 100644 --- a/src/lime/_internal/macros/AssetsMacro.hx +++ b/src/lime/_internal/macros/AssetsMacro.hx @@ -31,18 +31,17 @@ class AssetsMacro var fields = embedData(":file"); if (fields == null) return null; - var superCall = Context.defined("html5") ? macro super(bytes.b.buffer) - : Context.defined("hl") ? macro super(bytes.b, bytes.length) - : macro super(bytes.length, bytes.b); + var superCall = Context.defined("html5") ? macro super(bytes.b.buffer) : Context.defined("hl") ? macro super(bytes.b, + bytes.length) : macro super(bytes.length, bytes.b); var definition = macro class Temp - { - public function new(?length:Int, ?bytesData:haxe.io.BytesData) { - var bytes = haxe.Resource.getBytes(resourceName); - $superCall; - } - }; + public function new(?length:Int, ?bytesData:haxe.io.BytesData) + { + var bytes = haxe.Resource.getBytes(resourceName); + $superCall; + } + }; fields.push(definition.fields[0]); @@ -55,15 +54,15 @@ class AssetsMacro if (fields == null) return null; var definition = macro class Temp - { - public function new(?length:Int = 0) { - super(); + public function new(?length:Int = 0) + { + super(); - var bytes = haxe.Resource.getBytes(resourceName); - __fromBytes(bytes); - } - }; + var bytes = haxe.Resource.getBytes(resourceName); + __fromBytes(bytes); + } + }; fields.push(definition.fields[0]); @@ -102,11 +101,7 @@ class AssetsMacro } var bytes = File.getBytes(path); - var resourceName = "__ASSET__" - + metaName - + "_" - + (classType.pack.length > 0 ? classType.pack.join("_") + "_" : "") - + classType.name; + var resourceName = "__ASSET__" + metaName + "_" + (classType.pack.length > 0 ? classType.pack.join("_") + "_" : "") + classType.name; if (Context.getResources().exists(resourceName)) { @@ -127,9 +122,9 @@ class AssetsMacro } var definition = macro class Temp - { - private static inline var resourceType:String = $v{ resourceType }; - }; + { + private static inline var resourceType:String = $v{resourceType}; + }; fields.push(definition.fields[0]); @@ -142,9 +137,9 @@ class AssetsMacro } var definition = macro class Temp - { - private static inline var resourceName:String = $v{ resourceName }; - }; + { + private static inline var resourceName:String = $v{resourceName}; + }; fields.push(definition.fields[0]); @@ -216,16 +211,16 @@ class AssetsMacro } var definition = macro class Temp - { - private static var resourceName:String = $v{ resourceName }; - - public function new() { - super(); + private static var resourceName:String = $v{resourceName}; - __fromBytes(haxe.Resource.getBytes(resourceName)); - } - }; + public function new() + { + super(); + + __fromBytes(haxe.Resource.getBytes(resourceName)); + } + }; fields.push(definition.fields[0]); fields.push(definition.fields[1]); @@ -245,56 +240,53 @@ class AssetsMacro if (Context.defined("html5")) { definition = macro class Temp - { - public static var preload:js.html.Image; - - public function new(?buffer:lime.graphics.ImageBuffer, - ?offsetX:Int, ?offsetY:Int, ?width:Int, ?height:Int, - ?color:Null, ?type:lime.graphics.ImageType, - ?onload:Dynamic = true) { - super(); + public static var preload:js.html.Image; - if (preload != null) + public function new(?buffer:lime.graphics.ImageBuffer, ?offsetX:Int, ?offsetY:Int, ?width:Int, ?height:Int, ?color:Null, + ?type:lime.graphics.ImageType, ?onload:Dynamic = true) { - var buffer = new lime.graphics.ImageBuffer(); - buffer.__srcImage = preload; - buffer.width = preload.width; - buffer.width = preload.height; + super(); - __fromImageBuffer(buffer); - } - else - { - __fromBase64(haxe.Resource.getString(resourceName), resourceType, function(image) + if (preload != null) { - if (preload == null) - { - preload = image.buffer.__srcImage; - } + var buffer = new lime.graphics.ImageBuffer(); + buffer.__srcImage = preload; + buffer.width = preload.width; + buffer.width = preload.height; - if (onload != null) + __fromImageBuffer(buffer); + } + else + { + __fromBase64(haxe.Resource.getString(resourceName), resourceType, function(image) { - onload(image); - } - }); + if (preload == null) + { + preload = image.buffer.__srcImage; + } + + if (onload != null) + { + onload(image); + } + }); + } } - } - }; + }; } else { definition = macro class Temp - { - public function new(?buffer:lime.graphics.ImageBuffer, - ?offsetX:Int, ?offsetY:Int, ?width:Int, ?height:Int, - ?color:Null, ?type:lime.graphics.ImageType) { - super(); + public function new(?buffer:lime.graphics.ImageBuffer, ?offsetX:Int, ?offsetY:Int, ?width:Int, ?height:Int, ?color:Null, + ?type:lime.graphics.ImageType) + { + super(); - __fromBytes(haxe.Resource.getBytes(resourceName), null); - } - }; + __fromBytes(haxe.Resource.getBytes(resourceName), null); + } + }; } for (field in definition.fields) @@ -309,21 +301,18 @@ class AssetsMacro { var fields = embedData(":sound"); // CFFILoader.h(248) : NOT Implemented:api_buffer_data - if (fields == null || Context.defined("html5") || !Context.defined("openfl")) - return null; + if (fields == null || Context.defined("html5") || !Context.defined("openfl")) return null; var definition = macro class Temp - { - public function new(?stream:openfl.net.URLRequest, - ?context:openfl.media.SoundLoaderContext, - ?forcePlayAsMusic:Bool = false) { - super(); + public function new(?stream:openfl.net.URLRequest, ?context:openfl.media.SoundLoaderContext, ?forcePlayAsMusic:Bool = false) + { + super(); - var byteArray = openfl.utils.ByteArray.fromBytes(haxe.Resource.getBytes(resourceName)); - loadCompressedDataFromByteArray(byteArray, byteArray.length, forcePlayAsMusic); - } - }; + var byteArray = openfl.utils.ByteArray.fromBytes(haxe.Resource.getBytes(resourceName)); + loadCompressedDataFromByteArray(byteArray, byteArray.length, forcePlayAsMusic); + } + }; fields.push(definition.fields[0]); diff --git a/src/lime/_internal/macros/CFFIMacro.hx b/src/lime/_internal/macros/CFFIMacro.hx index 5b65675863..51430f550d 100644 --- a/src/lime/_internal/macros/CFFIMacro.hx +++ b/src/lime/_internal/macros/CFFIMacro.hx @@ -183,7 +183,7 @@ class CFFIMacro case "cpp.Float32": if (useCPPTypes) { - typeArgs.push({name: arg.name, opt: false, t: (macro:cpp.Float32).toType()}); + typeArgs.push({name: arg.name, opt: false, t: (macro :cpp.Float32).toType()}); } else { @@ -207,7 +207,7 @@ class CFFIMacro case "Void", "cpp.Void": if (useCPPTypes) { - typeArgs.push({name: arg.name, opt: false, t: (macro:cpp.Void).toType()}); + typeArgs.push({name: arg.name, opt: false, t: (macro :cpp.Void).toType()}); } else { @@ -219,11 +219,11 @@ class CFFIMacro default: if (useCPPTypes) { - typeArgs.push({name: arg.name, opt: false, t: (macro:cpp.Object).toType()}); + typeArgs.push({name: arg.name, opt: false, t: (macro :cpp.Object).toType()}); } else { - typeArgs.push({name: arg.name, opt: false, t: (macro:Dynamic).toType()}); + typeArgs.push({name: arg.name, opt: false, t: (macro :Dynamic).toType()}); } typeSignature += "o"; @@ -243,7 +243,7 @@ class CFFIMacro case "cpp.Float32": if (useCPPTypes) { - typeResult = (macro:cpp.Float32).toType(); + typeResult = (macro :cpp.Float32).toType(); } else { @@ -267,7 +267,7 @@ class CFFIMacro case "Void", "cpp.Void": if (useCPPTypes) { - typeResult = (macro:cpp.Void).toType(); + typeResult = (macro :cpp.Void).toType(); } else { @@ -279,11 +279,11 @@ class CFFIMacro default: if (useCPPTypes) { - typeResult = (macro:cpp.Object).toType(); + typeResult = (macro :cpp.Object).toType(); } else { - typeResult = (macro:Dynamic).toType(); + typeResult = (macro :Dynamic).toType(); } typeSignature += "o"; diff --git a/src/lime/_internal/macros/EventMacro.hx b/src/lime/_internal/macros/EventMacro.hx index 0a82d2e328..75ec0d979f 100644 --- a/src/lime/_internal/macros/EventMacro.hx +++ b/src/lime/_internal/macros/EventMacro.hx @@ -139,7 +139,7 @@ class EventMacro args: args, expr: dispatch, params: [], - ret: macro:Void + ret: macro :Void }), pos: pos }); diff --git a/src/lime/_internal/macros/HTTPRequestMacro.hx b/src/lime/_internal/macros/HTTPRequestMacro.hx index f862fe6ead..e4532738e7 100644 --- a/src/lime/_internal/macros/HTTPRequestMacro.hx +++ b/src/lime/_internal/macros/HTTPRequestMacro.hx @@ -129,11 +129,11 @@ class HTTPRequestMacro kind: FFun( { args: [ - {name: "uri", type: macro:String, opt: true}], + {name: "uri", type: macro :String, opt: true}], expr: macro {super(uri);}, params: [], - ret: macro:Void + ret: macro :Void }), pos: Context.currentPos() }, @@ -143,7 +143,7 @@ class HTTPRequestMacro kind: FFun( { args: [ - {name: "bytes", type: macro:haxe.io.Bytes}], + {name: "bytes", type: macro :haxe.io.Bytes}], expr: Context.parse("return " + typeString + ".fromBytes (bytes)", pos), params: [], ret: paramType.toComplexType() diff --git a/src/lime/app/Future.hx b/src/lime/app/Future.hx index ba58add979..2d4267e7d4 100644 --- a/src/lime/app/Future.hx +++ b/src/lime/app/Future.hx @@ -320,7 +320,8 @@ import lime.utils.Log; @return A new `Future` instance. @see https://en.wikipedia.org/wiki/Cooperative_multitasking **/ - public static function withEventualValue(work:WorkFunction Null>, state:State, mode:ThreadMode = #if html5 SINGLE_THREADED #else MULTI_THREADED #end):Future + public static function withEventualValue(work:WorkFunctionNull>, state:State, + mode:ThreadMode = #if html5 SINGLE_THREADED #else MULTI_THREADED #end):Future { var future = new Future(); var promise = new Promise(); @@ -334,7 +335,7 @@ import lime.utils.Log; /** (For backwards compatibility.) Dispatches the given zero-argument function. **/ - @:noCompletion private static function dispatchWorkFunction(work:WorkFunction T>):Null + @:noCompletion private static function dispatchWorkFunction(work:WorkFunctionT>):Null { return work.dispatch(); } @@ -356,7 +357,7 @@ import lime.utils.Log; // It isn't safe to pass a promise object to a web worker, but since it's // `@:generic` we can't store it as `Promise`. Instead, we'll store // the two methods we need. - private static var promises:Map Dynamic, error:Dynamic -> Dynamic}> = new Map(); + private static var promises:MapDynamic, error:Dynamic->Dynamic}> = new Map(); #end public static var minThreads(default, set):Int = 0; public static var maxThreads(default, set):Int = 1; @@ -365,8 +366,10 @@ import lime.utils.Log; private static function getPool(mode:ThreadMode):ThreadPool { #if lime_threads - if (mode == MULTI_THREADED) { - if(multiThreadPool == null) { + if (mode == MULTI_THREADED) + { + if (multiThreadPool == null) + { multiThreadPool = new ThreadPool(minThreads, maxThreads, MULTI_THREADED); multiThreadPool.onComplete.add(multiThreadPool_onComplete); multiThreadPool.onError.add(multiThreadPool_onError); @@ -374,7 +377,8 @@ import lime.utils.Log; return multiThreadPool; } #end - if(singleThreadPool == null) { + if (singleThreadPool == null) + { singleThreadPool = new ThreadPool(minThreads, maxThreads, SINGLE_THREADED); singleThreadPool.onComplete.add(singleThreadPool_onComplete); singleThreadPool.onError.add(singleThreadPool_onError); @@ -383,9 +387,16 @@ import lime.utils.Log; } @:allow(lime.app.Future) - private static function run(work:WorkFunctionNull>, state:State, promise:Promise, mode:ThreadMode = MULTI_THREADED, legacyCode:Bool = false):Void + private static function run(work:WorkFunctionNull>, state:State, promise:Promise, mode:ThreadMode = MULTI_THREADED, + legacyCode:Bool = false):Void { - var bundle = {work: work, state: state, promise: promise, legacyCode: legacyCode}; + var bundle = + { + work: work, + state: state, + promise: promise, + legacyCode: legacyCode + }; #if lime_threads if (mode == MULTI_THREADED) diff --git a/src/lime/graphics/OpenGLES3RenderContext.hx b/src/lime/graphics/OpenGLES3RenderContext.hx index 8c0c21ae7d..2ab458e81c 100644 --- a/src/lime/graphics/OpenGLES3RenderContext.hx +++ b/src/lime/graphics/OpenGLES3RenderContext.hx @@ -9,7 +9,6 @@ import lime.graphics.opengl.*; import lime.utils.DataPointer; import lime.utils.Float32Array; import lime.utils.Int32Array; - /** The `OpenGLES3RenderContext` allows access to OpenGL ES 3.0 features when OpenGL or OpenGL ES is the render context type of the `Window`, and the current context supports diff --git a/src/lime/graphics/PixelFormat.hx b/src/lime/graphics/PixelFormat.hx index 5492568988..a7043833ac 100644 --- a/src/lime/graphics/PixelFormat.hx +++ b/src/lime/graphics/PixelFormat.hx @@ -4,6 +4,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 + { /** An image encoded in 32-bit RGBA color order diff --git a/src/lime/graphics/RenderContextType.hx b/src/lime/graphics/RenderContextType.hx index 8dddd1aa48..ba28fa3859 100644 --- a/src/lime/graphics/RenderContextType.hx +++ b/src/lime/graphics/RenderContextType.hx @@ -4,6 +4,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 + { /** Describes a Cairo render context diff --git a/src/lime/graphics/WebGL2RenderContext.hx b/src/lime/graphics/WebGL2RenderContext.hx index 3fdc913647..dd83f9a899 100644 --- a/src/lime/graphics/WebGL2RenderContext.hx +++ b/src/lime/graphics/WebGL2RenderContext.hx @@ -3766,11 +3766,9 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic #end { var size = (srcData != null) ? srcData.byteLength : 0; - __tempPointer.set(srcData, srcOffset); this.bufferData(target, size, __tempPointer, usage); - } - + } #if !lime_webgl public inline function bufferSubData(target:Int, offset:Int, srcData:ArrayBufferView, srcOffset:Int = 0, ?length:Int):Void #else @@ -3782,7 +3780,6 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic __tempPointer.set(srcData, srcOffset); this.bufferSubData(target, offset, size, __tempPointer); } - public inline function checkFramebufferStatus(target:Int):Int { return this.checkFramebufferStatus(target); @@ -3849,21 +3846,19 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic #if !lime_webgl public function compressedTexImage2D(target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, srcData:ArrayBufferView, srcOffset:Int = 0, - ?srcLengthOverride:Int):Void + ?srcLengthOverride:Int):Void #else - public inline function compressedTexImage2D(target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, srcData:Dynamic, - ?srcOffset:Int, - ?srcLengthOverride:Int):Void + public inline function compressedTexImage2D(target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, srcData:Dynamic, ?srcOffset:Int, + ?srcLengthOverride:Int):Void #end + { var imageSize = (srcLengthOverride != null) ? srcLengthOverride : (srcData != null) ? srcData.byteLength : 0; __tempPointer.set(srcData, srcOffset); this.compressedTexImage2D(target, level, internalformat, width, height, border, imageSize, __tempPointer); } - - public function compressedTexImage3D(target:Int, level:Int, internalformat:Int, width:Int, height:Int, depth:Int, border:Int, - srcData:ArrayBufferView, + public function compressedTexImage3D(target:Int, level:Int, internalformat:Int, width:Int, height:Int, depth:Int, border:Int, srcData:ArrayBufferView, srcOffset:Int = 0, ?srcLengthOverride:Int):Void { var imageSize = (srcLengthOverride != null) ? srcLengthOverride : (srcData != null) ? srcData.byteLength : 0; @@ -3872,23 +3867,20 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic } #if !lime_webgl - public inline function compressedTexSubImage2D(target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, height:Int, format:Int, - srcData:ArrayBufferView, - srcOffset:Int = 0, ?srcLengthOverride:Int):Void + public inline function compressedTexSubImage2D(target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, height:Int, format:Int, srcData:ArrayBufferView, + srcOffset:Int = 0, ?srcLengthOverride:Int):Void #else - public inline function compressedTexSubImage2D(target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, height:Int, format:Int, - srcData:Dynamic, - ?srcOffset:Int, ?srcLengthOverride:Int):Void + public inline function compressedTexSubImage2D(target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, height:Int, format:Int, srcData:Dynamic, + ?srcOffset:Int, ?srcLengthOverride:Int):Void #end + { var imageSize = (srcLengthOverride != null) ? srcLengthOverride : (srcData != null) ? srcData.byteLength : 0; __tempPointer.set(srcData, srcOffset); this.compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, __tempPointer); } - - public inline function compressedTexSubImage3D(target:Int, level:Int, xoffset:Int, yoffset:Int, zoffset:Int, width:Int, height:Int, - depth:Int, format:Int, + public inline function compressedTexSubImage3D(target:Int, level:Int, xoffset:Int, yoffset:Int, zoffset:Int, width:Int, height:Int, depth:Int, format:Int, srcData:ArrayBufferView, srcOffset:Int = 0, ?srcLengthOverride:Int):Void { var imageSize = (srcLengthOverride != null) ? srcLengthOverride : (srcData != null) ? srcData.byteLength : 0; @@ -3911,8 +3903,7 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic this.copyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); } - public inline function copyTexSubImage3D(target:Int, level:Int, xoffset:Int, yoffset:Int, zoffset:Int, x:Int, y:Int, width:Int, - height:Int):Void + public inline function copyTexSubImage3D(target:Int, level:Int, xoffset:Int, yoffset:Int, zoffset:Int, x:Int, y:Int, width:Int, height:Int):Void { this.copyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height); } @@ -4199,7 +4190,6 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic this.getBufferSubData(target, srcByteOffset + srcOffset, size, dstData); #end } - public inline function getContextAttributes():GLContextAttributes { return this.getContextAttributes(); @@ -4451,16 +4441,15 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic } #if !lime_webgl - public inline function readPixels(x:Int, y:Int, width:Int, height:Int, format:Int, type:Int, pixels:ArrayBufferView, - dstOffset:Int = 0):Void + public inline function readPixels(x:Int, y:Int, width:Int, height:Int, format:Int, type:Int, pixels:ArrayBufferView, dstOffset:Int = 0):Void #else public inline function readPixels(x:Int, y:Int, width:Int, height:Int, format:Int, type:Int, pixels:Dynamic, ?dstOffset:Int):Void #end + { __tempPointer.set(pixels, dstOffset); this.readPixels(x, y, width, height, format, type, __tempPointer); } - public inline function renderbufferStorage(target:Int, internalformat:Int, width:Int, height:Int):Void { this.renderbufferStorage(target, internalformat, width, height); @@ -4532,23 +4521,22 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic } #if !lime_webgl - public inline function texImage2D(target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, format:Int, - type:Int, srcData:ArrayBufferView, - srcOffset:Int = 0):Void + public inline function texImage2D(target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, format:Int, type:Int, + srcData:ArrayBufferView, + srcOffset:Int = 0):Void #else - public inline function texImage2D(target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Dynamic, ?format:Int, - ?type:Int, ?srcData:Dynamic, - ?srcOffset:Int):Void + public inline function texImage2D(target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Dynamic, ?format:Int, ?type:Int, + ?srcData:Dynamic, + ?srcOffset:Int):Void #end + { #if !lime_webgl __tempPointer.set(srcData, srcOffset); this.texImage2D(target, level, internalformat, width, height, border, format, type, __tempPointer); #end } - - public inline function texImage3D(target:Int, level:Int, internalformat:Int, width:Int, height:Int, depth:Int, border:Int, - format:Int, type:Int, + public inline function texImage3D(target:Int, level:Int, internalformat:Int, width:Int, height:Int, depth:Int, border:Int, format:Int, type:Int, srcData:ArrayBufferView, srcOffset:Int = 0):Void { __tempPointer.set(srcData, srcOffset); @@ -4576,21 +4564,18 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic } #if !lime_webgl - public inline function texSubImage2D(target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, height:Int, format:Int, - type:Int, srcData:ArrayBufferView, - srcOffset:Int = 0):Void + public inline function texSubImage2D(target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, height:Int, format:Int, type:Int, srcData:ArrayBufferView, + srcOffset:Int = 0):Void #else - public inline function texSubImage2D(target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, height:Int, format:Dynamic, - ?type:Int, ?srcData:Dynamic, - ?srcOffset:Int):Void + public inline function texSubImage2D(target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, height:Int, format:Dynamic, ?type:Int, ?srcData:Dynamic, + ?srcOffset:Int):Void #end + { __tempPointer.set(srcData, srcOffset); this.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, __tempPointer); } - - public inline function texSubImage3D(target:Int, level:Int, xoffset:Int, yoffset:Int, zoffset:Int, width:Int, height:Int, - depth:Int, format:Int, type:Int, + public inline function texSubImage3D(target:Int, level:Int, xoffset:Int, yoffset:Int, zoffset:Int, width:Int, height:Int, depth:Int, format:Int, type:Int, srcData:ArrayBufferView, srcOffset:Int = 0):Void { __tempPointer.set(srcData, srcOffset); @@ -4612,10 +4597,10 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic #else public inline function uniform1fv(location:GLUniformLocation, v:Dynamic, ?srcOffset:Int, ?srcLength:Int):Void #end + { this.uniform1fv(location, v != null ? v.length : 0, v); } - public inline function uniform1i(location:GLUniformLocation, v0:Int):Void { this.uniform1i(location, v0); @@ -4626,10 +4611,10 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic #else public inline function uniform1iv(location:GLUniformLocation, v:Dynamic, ?srcOffset:Int, ?srcLength:Int):Void #end + { this.uniform1iv(location, v != null ? v.length : 0, v); } - public inline function uniform1ui(location:GLUniformLocation, v0:Int):Void { this.uniform1ui(location, v0); @@ -4650,10 +4635,10 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic #else public function uniform2fv(location:GLUniformLocation, v:Dynamic, ?srcOffset:Int, ?srcLength:Int):Void #end + { this.uniform2fv(location, v != null ? v.length >> 1 : 0, v); } - public inline function uniform2i(location:GLUniformLocation, v0:Int, v1:Int):Void { this.uniform2i(location, v0, v1); @@ -4664,17 +4649,16 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic #else public inline function uniform2iv(location:GLUniformLocation, v:Dynamic, ?srcOffset:Int, ?srcLength:Int):Void #end + { this.uniform2iv(location, v != null ? v.length >> 1 : 0, v); } - public inline function uniform2ui(location:GLUniformLocation, v0:Int, v1:Int):Void { this.uniform2ui(location, v0, v1); } - public inline function uniform2uiv(location:GLUniformLocation, v:UInt32Array, ?srcOffset:Int, - ?srcLength:Int):Void + public inline function uniform2uiv(location:GLUniformLocation, v:UInt32Array, ?srcOffset:Int, ?srcLength:Int):Void { this.uniform2uiv(location, v != null ? v.length >> 1 : 0, v); } @@ -4685,101 +4669,85 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic } #if !lime_webgl - public inline function uniform3fv(location:GLUniformLocation, v:Float32Array, ?srcOffset:Int, - ?srcLength:Int):Void + public inline function uniform3fv(location:GLUniformLocation, v:Float32Array, ?srcOffset:Int, ?srcLength:Int):Void #else - public inline function uniform3fv(location:GLUniformLocation, v:Dynamic, ?srcOffset:Int, - ?srcLength:Int):Void + public inline function uniform3fv(location:GLUniformLocation, v:Dynamic, ?srcOffset:Int, ?srcLength:Int):Void #end + { this.uniform3fv(location, v != null ? Std.int(v.length / 3) : 0, v); } - public inline function uniform3i(location:GLUniformLocation, v0:Int, v1:Int, v2:Int):Void { this.uniform3i(location, v0, v1, v2); } #if !lime_webgl - public inline function uniform3iv(location:GLUniformLocation, v:Int32Array, ?srcOffset:Int, - ?srcLength:Int):Void + public inline function uniform3iv(location:GLUniformLocation, v:Int32Array, ?srcOffset:Int, ?srcLength:Int):Void #else - public inline function uniform3iv(location:GLUniformLocation, v:Dynamic, ?srcOffset:Int, - ?srcLength:Int):Void + public inline function uniform3iv(location:GLUniformLocation, v:Dynamic, ?srcOffset:Int, ?srcLength:Int):Void #end + { this.uniform3iv(location, v != null ? Std.int(v.length / 3) : 0, v); } - public inline function uniform3ui(location:GLUniformLocation, v0:Int, v1:Int, v2:Int):Void { this.uniform3ui(location, v0, v1, v2); } - public inline function uniform3uiv(location:GLUniformLocation, v:UInt32Array, ?srcOffset:Int, - ?srcLength:Int):Void + public inline function uniform3uiv(location:GLUniformLocation, v:UInt32Array, ?srcOffset:Int, ?srcLength:Int):Void { this.uniform3uiv(location, v != null ? Std.int(v.length / 3) : 0, v); } - public inline function uniform4f(location:GLUniformLocation, v0:Float, v1:Float, v2:Float, - v3:Float):Void + public inline function uniform4f(location:GLUniformLocation, v0:Float, v1:Float, v2:Float, v3:Float):Void { this.uniform4f(location, v0, v1, v2, v3); } #if !lime_webgl - public inline function uniform4fv(location:GLUniformLocation, v:Float32Array, ?srcOffset:Int, - ?srcLength:Int):Void + public inline function uniform4fv(location:GLUniformLocation, v:Float32Array, ?srcOffset:Int, ?srcLength:Int):Void #else - public inline function uniform4fv(location:GLUniformLocation, v:Dynamic, ?srcOffset:Int, - ?srcLength:Int):Void + public inline function uniform4fv(location:GLUniformLocation, v:Dynamic, ?srcOffset:Int, ?srcLength:Int):Void #end + { this.uniform4fv(location, v != null ? v.length >> 2 : 0, v); } - - public inline function uniform4i(location:GLUniformLocation, v0:Int, v1:Int, v2:Int, - v3:Int):Void + public inline function uniform4i(location:GLUniformLocation, v0:Int, v1:Int, v2:Int, v3:Int):Void { this.uniform4i(location, v0, v1, v2, v3); } #if !lime_webgl - public inline function uniform4iv(location:GLUniformLocation, v:Int32Array, ?srcOffset:Int, - ?srcLength:Int):Void + public inline function uniform4iv(location:GLUniformLocation, v:Int32Array, ?srcOffset:Int, ?srcLength:Int):Void #else - public inline function uniform4iv(location:GLUniformLocation, v:Dynamic, ?srcOffset:Int, - ?srcLength:Int):Void + public inline function uniform4iv(location:GLUniformLocation, v:Dynamic, ?srcOffset:Int, ?srcLength:Int):Void #end + { this.uniform4iv(location, v != null ? v.length >> 2 : 0, v); } - - public inline function uniform4ui(location:GLUniformLocation, v0:Int, v1:Int, v2:Int, - v3:Int):Void + public inline function uniform4ui(location:GLUniformLocation, v0:Int, v1:Int, v2:Int, v3:Int):Void { this.uniform4ui(location, v0, v1, v2, v3); } - public inline function uniform4uiv(location:GLUniformLocation, v:UInt32Array, - ?srcOffset:Int, ?srcLength:Int):Void + public inline function uniform4uiv(location:GLUniformLocation, v:UInt32Array, ?srcOffset:Int, ?srcLength:Int):Void { this.uniform4uiv(location, v != null ? v.length >> 2 : 0, v); } - public inline function uniformBlockBinding(program:GLProgram, uniformBlockIndex:Int, - uniformBlockBinding:Int):Void + public inline function uniformBlockBinding(program:GLProgram, uniformBlockIndex:Int, uniformBlockBinding:Int):Void { this.uniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding); } #if !lime_webgl - public function uniformMatrix2fv(location:GLUniformLocation, transpose:Bool, - v:Float32Array, srcOffset:Int = 0, ?srcLength:Int):Void + public function uniformMatrix2fv(location:GLUniformLocation, transpose:Bool, v:Float32Array, srcOffset:Int = 0, ?srcLength:Int):Void #else - public inline function uniformMatrix2fv(location:GLUniformLocation, transpose:Bool, - v:Dynamic, ?srcOffset:Int, ?srcLength:Int):Void + public inline function uniformMatrix2fv(location:GLUniformLocation, transpose:Bool, v:Dynamic, ?srcOffset:Int, ?srcLength:Int):Void #end { var count = 0; @@ -4789,9 +4757,7 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic __tempPointer.set(v, srcOffset); this.uniformMatrix2fv(location, count, transpose, __tempPointer); } - - public function uniformMatrix2x3fv(location:GLUniformLocation, transpose:Bool, - v:Float32Array, srcOffset:Int = 0, ?srcLength:Int):Void + public function uniformMatrix2x3fv(location:GLUniformLocation, transpose:Bool, v:Float32Array, srcOffset:Int = 0, ?srcLength:Int):Void { var count = 0; if (srcLength != null) count = srcLength; @@ -4802,8 +4768,7 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic this.uniformMatrix2x3fv(location, count, transpose, __tempPointer); } - public function uniformMatrix2x4fv(location:GLUniformLocation, transpose:Bool, - v:Float32Array, srcOffset:Int = 0, ?srcLength:Int):Void + public function uniformMatrix2x4fv(location:GLUniformLocation, transpose:Bool, v:Float32Array, srcOffset:Int = 0, ?srcLength:Int):Void { var count = 0; if (srcLength != null) count = srcLength; @@ -4815,11 +4780,9 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic } #if !lime_webgl - public function uniformMatrix3fv(location:GLUniformLocation, transpose:Bool, - v:Float32Array, srcOffset:Int = 0, ?srcLength:Int):Void + public function uniformMatrix3fv(location:GLUniformLocation, transpose:Bool, v:Float32Array, srcOffset:Int = 0, ?srcLength:Int):Void #else - public inline function uniformMatrix3fv(location:GLUniformLocation, transpose:Bool, - v:Dynamic, ?srcOffset:Int, ?srcLength:Int):Void + public inline function uniformMatrix3fv(location:GLUniformLocation, transpose:Bool, v:Dynamic, ?srcOffset:Int, ?srcLength:Int):Void #end { var count = 0; @@ -4829,9 +4792,7 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic __tempPointer.set(v, srcOffset); this.uniformMatrix3fv(location, count, transpose, __tempPointer); } - - public function uniformMatrix3x2fv(location:GLUniformLocation, transpose:Bool, - v:Float32Array, srcOffset:Int = 0, ?srcLength:Int):Void + public function uniformMatrix3x2fv(location:GLUniformLocation, transpose:Bool, v:Float32Array, srcOffset:Int = 0, ?srcLength:Int):Void { var count = 0; if (srcLength != null) count = srcLength; @@ -4842,8 +4803,7 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic this.uniformMatrix3x2fv(location, count, transpose, __tempPointer); } - public function uniformMatrix3x4fv(location:GLUniformLocation, transpose:Bool, - v:Float32Array, srcOffset:Int = 0, ?srcLength:Int):Void + public function uniformMatrix3x4fv(location:GLUniformLocation, transpose:Bool, v:Float32Array, srcOffset:Int = 0, ?srcLength:Int):Void { var count = 0; if (srcLength != null) count = srcLength; @@ -4855,11 +4815,9 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic } #if !lime_webgl - public function uniformMatrix4fv(location:GLUniformLocation, transpose:Bool, - v:Float32Array, srcOffset:Int = 0, ?srcLength:Int):Void + public function uniformMatrix4fv(location:GLUniformLocation, transpose:Bool, v:Float32Array, srcOffset:Int = 0, ?srcLength:Int):Void #else - public inline function uniformMatrix4fv(location:GLUniformLocation, transpose:Bool, - v:Dynamic, ?srcOffset:Int, ?srcLength:Int):Void + public inline function uniformMatrix4fv(location:GLUniformLocation, transpose:Bool, v:Dynamic, ?srcOffset:Int, ?srcLength:Int):Void #end { var count = 0; @@ -4869,9 +4827,7 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic __tempPointer.set(v, srcOffset); this.uniformMatrix4fv(location, count, transpose, __tempPointer); } - - public function uniformMatrix4x2fv(location:GLUniformLocation, - transpose:Bool, v:Float32Array, srcOffset:Int = 0, ?srcLength:Int):Void + public function uniformMatrix4x2fv(location:GLUniformLocation, transpose:Bool, v:Float32Array, srcOffset:Int = 0, ?srcLength:Int):Void { var count = 0; if (srcLength != null) count = srcLength; @@ -4882,8 +4838,7 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic this.uniformMatrix4x2fv(location, count, transpose, __tempPointer); } - public function uniformMatrix4x3fv(location:GLUniformLocation, transpose:Bool, - v:Float32Array, srcOffset:Int = 0, ?srcLength:Int):Void + public function uniformMatrix4x3fv(location:GLUniformLocation, transpose:Bool, v:Float32Array, srcOffset:Int = 0, ?srcLength:Int):Void { var count = 0; if (srcLength != null) count = srcLength; @@ -4909,8 +4864,7 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic this.vertexAttrib1f(indx, x); } - public inline function vertexAttrib1fv(indx:Int, - values:#if (!lime_webgl && !doc_gen) DataPointer #else Float32Array #end):Void + public inline function vertexAttrib1fv(indx:Int, values:#if (!lime_webgl && !doc_gen) DataPointer #else Float32Array #end):Void { this.vertexAttrib1fv(indx, values); } @@ -4920,8 +4874,7 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic this.vertexAttrib2f(indx, x, y); } - public inline function vertexAttrib2fv(indx:Int, - values:#if (!lime_webgl && !doc_gen) DataPointer #else Float32Array #end):Void + public inline function vertexAttrib2fv(indx:Int, values:#if (!lime_webgl && !doc_gen) DataPointer #else Float32Array #end):Void { this.vertexAttrib2fv(indx, values); } @@ -4931,20 +4884,17 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic this.vertexAttrib3f(indx, x, y, z); } - public inline function vertexAttrib3fv(indx:Int, - values:#if (!lime_webgl && !doc_gen) DataPointer #else Float32Array #end):Void + public inline function vertexAttrib3fv(indx:Int, values:#if (!lime_webgl && !doc_gen) DataPointer #else Float32Array #end):Void { this.vertexAttrib3fv(indx, values); } - public inline function vertexAttrib4f(indx:Int, x:Float, y:Float, z:Float, - w:Float):Void + public inline function vertexAttrib4f(indx:Int, x:Float, y:Float, z:Float, w:Float):Void { this.vertexAttrib4f(indx, x, y, z, w); } - public inline function vertexAttrib4fv(indx:Int, - values:#if (!lime_webgl && !doc_gen) DataPointer #else Float32Array #end):Void + public inline function vertexAttrib4fv(indx:Int, values:#if (!lime_webgl && !doc_gen) DataPointer #else Float32Array #end):Void { this.vertexAttrib4fv(indx, values); } @@ -4954,38 +4904,32 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic this.vertexAttribDivisor(index, divisor); } - public inline function vertexAttribI4i(indx:Int, x:Int, y:Int, z:Int, - w:Int):Void + public inline function vertexAttribI4i(indx:Int, x:Int, y:Int, z:Int, w:Int):Void { this.vertexAttribI4i(indx, x, y, z, w); } - public inline function vertexAttribI4iv(indx:Int, - values:#if (!lime_webgl && !doc_gen) DataPointer #else Float32Array #end):Void + public inline function vertexAttribI4iv(indx:Int, values:#if (!lime_webgl && !doc_gen) DataPointer #else Float32Array #end):Void { this.vertexAttribI4iv(indx, values); } - public inline function vertexAttribI4ui(indx:Int, x:Int, y:Int, z:Int, - w:Int):Void + public inline function vertexAttribI4ui(indx:Int, x:Int, y:Int, z:Int, w:Int):Void { this.vertexAttribI4ui(indx, x, y, z, w); } - public inline function vertexAttribI4uiv(indx:Int, - values:#if (!lime_webgl && !doc_gen) DataPointer #else Float32Array #end):Void + public inline function vertexAttribI4uiv(indx:Int, values:#if (!lime_webgl && !doc_gen) DataPointer #else Float32Array #end):Void { this.vertexAttribI4uiv(indx, values); } - public inline function vertexAttribIPointer(index:Int, size:Int, type:Int, - stride:Int, offset:DataPointer):Void + public inline function vertexAttribIPointer(index:Int, size:Int, type:Int, stride:Int, offset:DataPointer):Void { this.vertexAttribIPointer(index, size, type, stride, offset); } - public inline function vertexAttribPointer(indx:Int, size:Int, type:Int, - normalized:Bool, stride:Int, offset:DataPointer):Void + public inline function vertexAttribPointer(indx:Int, size:Int, type:Int, normalized:Bool, stride:Int, offset:DataPointer):Void { this.vertexAttribPointer(indx, size, type, normalized, stride, offset); } @@ -5016,5 +4960,5 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic { return cast GL.context; } -} + } #end diff --git a/src/lime/graphics/cairo/CairoAntialias.hx b/src/lime/graphics/cairo/CairoAntialias.hx index e3fc5f11f7..abf58c876a 100644 --- a/src/lime/graphics/cairo/CairoAntialias.hx +++ b/src/lime/graphics/cairo/CairoAntialias.hx @@ -2,6 +2,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 + { public var DEFAULT = 0; public var NONE = 1; diff --git a/src/lime/graphics/cairo/CairoContent.hx b/src/lime/graphics/cairo/CairoContent.hx index d57ac8e5e2..d0916bd00f 100644 --- a/src/lime/graphics/cairo/CairoContent.hx +++ b/src/lime/graphics/cairo/CairoContent.hx @@ -2,6 +2,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 + { public var COLOR = 0x1000; public var ALPHA = 0x2000; diff --git a/src/lime/graphics/cairo/CairoExtend.hx b/src/lime/graphics/cairo/CairoExtend.hx index 1ed95035f7..b866db45f5 100644 --- a/src/lime/graphics/cairo/CairoExtend.hx +++ b/src/lime/graphics/cairo/CairoExtend.hx @@ -2,6 +2,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 + { public var NONE = 0; public var REPEAT = 1; diff --git a/src/lime/graphics/cairo/CairoFillRule.hx b/src/lime/graphics/cairo/CairoFillRule.hx index 6fc658079e..b50c0db24f 100644 --- a/src/lime/graphics/cairo/CairoFillRule.hx +++ b/src/lime/graphics/cairo/CairoFillRule.hx @@ -2,6 +2,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 + { public var WINDING = 0; public var EVEN_ODD = 1; diff --git a/src/lime/graphics/cairo/CairoFilter.hx b/src/lime/graphics/cairo/CairoFilter.hx index 305f393f00..a868ecbfb7 100644 --- a/src/lime/graphics/cairo/CairoFilter.hx +++ b/src/lime/graphics/cairo/CairoFilter.hx @@ -2,6 +2,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 + { public var FAST = 0; public var GOOD = 1; diff --git a/src/lime/graphics/cairo/CairoFormat.hx b/src/lime/graphics/cairo/CairoFormat.hx index 38b8d66f5c..6d373362cc 100644 --- a/src/lime/graphics/cairo/CairoFormat.hx +++ b/src/lime/graphics/cairo/CairoFormat.hx @@ -2,6 +2,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 + { public var INVALID = -1; public var ARGB32 = 0; diff --git a/src/lime/graphics/cairo/CairoHintMetrics.hx b/src/lime/graphics/cairo/CairoHintMetrics.hx index cd145d25c5..ba4ee2d992 100644 --- a/src/lime/graphics/cairo/CairoHintMetrics.hx +++ b/src/lime/graphics/cairo/CairoHintMetrics.hx @@ -2,6 +2,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 + { public var DEFAULT = 0; public var OFF = 1; diff --git a/src/lime/graphics/cairo/CairoHintStyle.hx b/src/lime/graphics/cairo/CairoHintStyle.hx index e78cdb0af0..bd16042502 100644 --- a/src/lime/graphics/cairo/CairoHintStyle.hx +++ b/src/lime/graphics/cairo/CairoHintStyle.hx @@ -2,6 +2,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 + { public var DEFAULT = 0; public var NONE = 1; diff --git a/src/lime/graphics/cairo/CairoLineCap.hx b/src/lime/graphics/cairo/CairoLineCap.hx index d7eaea90b8..43d886c6bb 100644 --- a/src/lime/graphics/cairo/CairoLineCap.hx +++ b/src/lime/graphics/cairo/CairoLineCap.hx @@ -2,6 +2,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 + { public var BUTT = 0; public var ROUND = 1; diff --git a/src/lime/graphics/cairo/CairoLineJoin.hx b/src/lime/graphics/cairo/CairoLineJoin.hx index a3567b3f94..bb6899fad1 100644 --- a/src/lime/graphics/cairo/CairoLineJoin.hx +++ b/src/lime/graphics/cairo/CairoLineJoin.hx @@ -2,6 +2,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 + { public var MITER = 0; public var ROUND = 1; diff --git a/src/lime/graphics/cairo/CairoOperator.hx b/src/lime/graphics/cairo/CairoOperator.hx index bf89192266..0113f4e4df 100644 --- a/src/lime/graphics/cairo/CairoOperator.hx +++ b/src/lime/graphics/cairo/CairoOperator.hx @@ -2,6 +2,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 + { public var CLEAR = 0; public var SOURCE = 1; diff --git a/src/lime/graphics/cairo/CairoStatus.hx b/src/lime/graphics/cairo/CairoStatus.hx index 669a24329e..296683697f 100644 --- a/src/lime/graphics/cairo/CairoStatus.hx +++ b/src/lime/graphics/cairo/CairoStatus.hx @@ -2,6 +2,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 + { public var SUCCESS = 0; public var NO_MEMORY = 1; diff --git a/src/lime/graphics/cairo/CairoSubpixelOrder.hx b/src/lime/graphics/cairo/CairoSubpixelOrder.hx index 7c8051c278..c3276e6dd4 100644 --- a/src/lime/graphics/cairo/CairoSubpixelOrder.hx +++ b/src/lime/graphics/cairo/CairoSubpixelOrder.hx @@ -2,6 +2,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 + { public var DEFAULT = 0; public var RGB = 1; diff --git a/src/lime/graphics/opengl/GL.hx b/src/lime/graphics/opengl/GL.hx index 57df0cb01d..dc5a404493 100644 --- a/src/lime/graphics/opengl/GL.hx +++ b/src/lime/graphics/opengl/GL.hx @@ -2636,6 +2636,7 @@ class GL } @:dox(hide) @:noCompletion #if (haxe_ver >= 4.0) enum #else @:enum #end abstract GLObjectType(Int) to Int + { var UNKNOWN = 0; var PROGRAM = 1; diff --git a/src/lime/math/Matrix3.hx b/src/lime/math/Matrix3.hx index 330cad97c9..15aedcbdd1 100644 --- a/src/lime/math/Matrix3.hx +++ b/src/lime/math/Matrix3.hx @@ -70,9 +70,15 @@ abstract Matrix3(Float32Array) to Float32Array { // Column-major order means adjacent values form a column, not a row. this = new Float32Array([ - a, b, 0, // column 0 - c, d, 0, // column 1 - tx, ty, 1 // column 2 + a, + b, + 0, // column 0 + c, + d, + 0, // column 1 + tx, + ty, + 1 // column 2 ]); } @@ -561,7 +567,8 @@ abstract Matrix3(Float32Array) to Float32Array { return this[0]; } - inline function set_a(value: Float):Float + + inline function set_a(value:Float):Float { return this[0] = value; } @@ -570,7 +577,8 @@ abstract Matrix3(Float32Array) to Float32Array { return this[1]; } - inline function set_b(value: Float):Float + + inline function set_b(value:Float):Float { return this[1] = value; } @@ -579,7 +587,8 @@ abstract Matrix3(Float32Array) to Float32Array { return this[3]; } - inline function set_c(value: Float):Float + + inline function set_c(value:Float):Float { return this[3] = value; } @@ -588,7 +597,8 @@ abstract Matrix3(Float32Array) to Float32Array { return this[4]; } - inline function set_d(value: Float):Float + + inline function set_d(value:Float):Float { return this[4] = value; } @@ -597,7 +607,8 @@ abstract Matrix3(Float32Array) to Float32Array { return this[6]; } - inline function set_tx(value: Float):Float + + inline function set_tx(value:Float):Float { return this[6] = value; } @@ -606,7 +617,8 @@ abstract Matrix3(Float32Array) to Float32Array { return this[7]; } - inline function set_ty(value: Float):Float + + inline function set_ty(value:Float):Float { return this[7] = value; } diff --git a/src/lime/math/Matrix4.hx b/src/lime/math/Matrix4.hx index 4c70f38066..8770ced459 100644 --- a/src/lime/math/Matrix4.hx +++ b/src/lime/math/Matrix4.hx @@ -378,7 +378,7 @@ abstract Matrix4(Float32Array) from Float32Array to Float32Array this[14] = -(zNear + zFar) * sz; this[15] = 1; } - + /** Initializes this matrix with values for a perspective projection @param fov The field of view diff --git a/src/lime/media/AudioContextType.hx b/src/lime/media/AudioContextType.hx index f192890e55..1bc5ae2abb 100644 --- a/src/lime/media/AudioContextType.hx +++ b/src/lime/media/AudioContextType.hx @@ -1,6 +1,7 @@ package lime.media; #if (haxe_ver >= 4.0) enum #else @:enum #end abstract AudioContextType(String) from String to String + { var FLASH = "flash"; var HTML5 = "html5"; diff --git a/src/lime/media/openal/ALC.hx b/src/lime/media/openal/ALC.hx index 62a3b6e264..e4b45ee5de 100644 --- a/src/lime/media/openal/ALC.hx +++ b/src/lime/media/openal/ALC.hx @@ -76,12 +76,16 @@ class ALC public static function getContextsDevice(context:ALContext):ALDevice { - #if (lime_cffi && lime_openal && !macro) #if !hl var handle:Dynamic = NativeCFFI.lime_alc_get_contexts_device(context); + #if (lime_cffi && lime_openal && !macro) + #if !hl + var handle:Dynamic = NativeCFFI.lime_alc_get_contexts_device(context); if (handle != null) { return new ALDevice(handle); - } #else #end + } + #else + #end #end return null; diff --git a/src/lime/net/HTTPRequest.hx b/src/lime/net/HTTPRequest.hx index 6627103db5..10bbd18f8b 100644 --- a/src/lime/net/HTTPRequest.hx +++ b/src/lime/net/HTTPRequest.hx @@ -160,10 +160,13 @@ public function load(uri:String = null):Future } } -@:noCompletion class _HTTPRequestErrorResponse { +@:noCompletion class _HTTPRequestErrorResponse +{ public var error:Dynamic; public var responseData:T; - public function new(error:Dynamic, responseData:T) { + + public function new(error:Dynamic, responseData:T) + { this.error = error; this.responseData = responseData; } diff --git a/src/lime/net/HTTPRequestMethod.hx b/src/lime/net/HTTPRequestMethod.hx index e5226cefad..51211f29aa 100644 --- a/src/lime/net/HTTPRequestMethod.hx +++ b/src/lime/net/HTTPRequestMethod.hx @@ -1,6 +1,7 @@ package lime.net; #if (haxe_ver >= 4.0) enum #else @:enum #end abstract HTTPRequestMethod(String) from String to String + { public var DELETE = "DELETE"; public var GET = "GET"; diff --git a/src/lime/net/curl/CURLCode.hx b/src/lime/net/curl/CURLCode.hx index 7119de3b61..f07918265e 100644 --- a/src/lime/net/curl/CURLCode.hx +++ b/src/lime/net/curl/CURLCode.hx @@ -2,6 +2,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 + { var OK = 0; var UNSUPPORTED_PROTOCOL = 1; diff --git a/src/lime/net/curl/CURLInfo.hx b/src/lime/net/curl/CURLInfo.hx index d1fc6fe1ac..211f111063 100644 --- a/src/lime/net/curl/CURLInfo.hx +++ b/src/lime/net/curl/CURLInfo.hx @@ -2,6 +2,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 + { var NONE = 0; var EFFECTIVE_URL = 0x100000 + 1; diff --git a/src/lime/net/curl/CURLMultiCode.hx b/src/lime/net/curl/CURLMultiCode.hx index a787651c18..a5979dd93a 100644 --- a/src/lime/net/curl/CURLMultiCode.hx +++ b/src/lime/net/curl/CURLMultiCode.hx @@ -2,6 +2,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*/ + { /* please call curl_multi_perform() or curl_multi_socket*() soon */ var CALL_MULTI_PERFORM = -1; diff --git a/src/lime/net/curl/CURLMultiOption.hx b/src/lime/net/curl/CURLMultiOption.hx index 128e61ad11..87d7ef8f45 100644 --- a/src/lime/net/curl/CURLMultiOption.hx +++ b/src/lime/net/curl/CURLMultiOption.hx @@ -2,6 +2,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 + { /* This is the socket callback function pointer */ var SOCKETFUNCTION = 200001; diff --git a/src/lime/net/curl/CURLOption.hx b/src/lime/net/curl/CURLOption.hx index e7dac57487..3505108597 100644 --- a/src/lime/net/curl/CURLOption.hx +++ b/src/lime/net/curl/CURLOption.hx @@ -2,6 +2,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 + { // var FILE = 10001; // var WRITEDATA = 10001; diff --git a/src/lime/net/curl/CURLVersion.hx b/src/lime/net/curl/CURLVersion.hx index 34aa480631..24d025b346 100644 --- a/src/lime/net/curl/CURLVersion.hx +++ b/src/lime/net/curl/CURLVersion.hx @@ -2,6 +2,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 + { var FIRST = 0; var SECOND = 1; diff --git a/src/lime/net/oauth/OAuthSignatureMethod.hx b/src/lime/net/oauth/OAuthSignatureMethod.hx index 4a163ab188..14dae77bff 100644 --- a/src/lime/net/oauth/OAuthSignatureMethod.hx +++ b/src/lime/net/oauth/OAuthSignatureMethod.hx @@ -1,6 +1,7 @@ package lime.net.oauth; #if (haxe_ver >= 4.0) enum #else @:enum #end abstract OAuthSignatureMethod(String) + { // var PLAINTEXT = "PLAINTEXT"; var HMAC_SHA1 = "HMAC-SHA1"; diff --git a/src/lime/net/oauth/OAuthVersion.hx b/src/lime/net/oauth/OAuthVersion.hx index 02314f05e5..ac468e18f4 100644 --- a/src/lime/net/oauth/OAuthVersion.hx +++ b/src/lime/net/oauth/OAuthVersion.hx @@ -1,6 +1,7 @@ package lime.net.oauth; #if (haxe_ver >= 4.0) enum #else @:enum #end abstract OAuthVersion(String) + { var V1 = "1.0"; var V2 = "2.0"; diff --git a/src/lime/system/CFFI.hx b/src/lime/system/CFFI.hx index 3f512807ec..ae89324542 100644 --- a/src/lime/system/CFFI.hx +++ b/src/lime/system/CFFI.hx @@ -292,9 +292,7 @@ class CFFI { init = load("lime", "neko_init", 5); } - catch (e:Dynamic) - { - } + catch (e:Dynamic) {} if (init != null) { @@ -313,7 +311,10 @@ class CFFI var ndllFolder = __findNDLLFolder() + __sysName(); throw "Could not find lime.ndll. This file is provided with Lime's Haxelib releases, but not via Git. " + "Please copy it from Lime's latest Haxelib release into either " - + ndllFolder + " or " + ndllFolder + "64, as appropriate for your system. " + + ndllFolder + + " or " + + ndllFolder + + "64, as appropriate for your system. " + "Advanced users may run `lime rebuild cpp` instead."; } } diff --git a/src/lime/system/JNI.hx b/src/lime/system/JNI.hx index b1a052022b..4a065561fa 100644 --- a/src/lime/system/JNI.hx +++ b/src/lime/system/JNI.hx @@ -17,7 +17,6 @@ import cpp.vm.Thread; import neko.vm.Thread; #end #end - using StringTools; /** @@ -51,12 +50,10 @@ class JNI private static function transformClassName(className:String):String { var parts:Array = className.split("."); - if (parts.length <= 1) - return className; + if (parts.length <= 1) return className; var nestedClassName:String = ""; - if (~/^[A-Z]/.match(parts[parts.length - 2])) - nestedClassName = "$" + parts.pop(); + if (~/^[A-Z]/.match(parts[parts.length - 2])) nestedClassName = "$" + parts.pop(); return parts.join("/") + nestedClassName; } @@ -430,8 +427,7 @@ class JNISafetyTools } // Don't modify functions lacking `@:runOnMainThread`. - if (field.meta == null || !Lambda.exists(field.meta, - function(meta) return meta.name == ":runOnMainThread")) + if (field.meta == null || !Lambda.exists(field.meta, function(meta) return meta.name == ":runOnMainThread")) { continue; } @@ -445,13 +441,12 @@ class JNISafetyTools // Make sure there's no return value. switch (f.ret) { - case macro:Void: + case macro :Void: // Good to go. case null: - f.ret = macro:Void; + f.ret = macro :Void; default: - Context.error("Expected return type Void, got " - + new haxe.macro.Printer().printComplexType(f.ret) + ".", field.pos); + Context.error("Expected return type Void, got " + new haxe.macro.Printer().printComplexType(f.ret) + ".", field.pos); } var args:Array = []; @@ -460,16 +455,12 @@ class JNISafetyTools args.push(macro $i{arg.name}); // Account for an unlikely edge case. - if (arg.name == field.name) - Context.error('${field.name}() should not take an argument named ${field.name}.', field.pos); + if (arg.name == field.name) Context.error('${field.name}() should not take an argument named ${field.name}.', field.pos); } // Check the thread before running the function. - f.expr = macro - if (!lime.system.JNI.JNISafetyTools.onMainThread()) - haxe.MainLoop.runInMainThread($i{field.name}.bind($a{args})) - else - ${f.expr}; + f.expr = macro if (!lime.system.JNI.JNISafetyTools.onMainThread()) haxe.MainLoop.runInMainThread($i{field.name}.bind($a{args})) else + ${f.expr}; default: } } diff --git a/src/lime/system/System.hx b/src/lime/system/System.hx index 039b58283c..a597af990d 100644 --- a/src/lime/system/System.hx +++ b/src/lime/system/System.hx @@ -858,7 +858,9 @@ class System } } -#if (haxe_ver >= 4.0) private enum #else @:enum private #end abstract SystemDirectory(Int) from Int to Int from UInt to UInt +#if (haxe_ver >= 4.0) private enum #else @:enum + +private #end abstract SystemDirectory(Int) from Int to Int from UInt to UInt { var APPLICATION = 0; var APPLICATION_STORAGE = 1; diff --git a/src/lime/system/ThreadPool.hx b/src/lime/system/ThreadPool.hx index 7fd6561b95..7130dd180b 100644 --- a/src/lime/system/ThreadPool.hx +++ b/src/lime/system/ThreadPool.hx @@ -38,7 +38,7 @@ import lime._internal.backend.html5.HTML5Thread as Thread; trigger an `onComplete` event on the main thread. @see `lime.system.WorkOutput.WorkFunction` for important information about - `doWork`. + `doWork`. @see https://player03.com/openfl/threads-guide/ for a tutorial. **/ #if !lime_debug @@ -69,7 +69,7 @@ class ThreadPool extends WorkOutput frame. See `workIterations` for instructions to improve the accuracy of this estimate. **/ - public static var workLoad:Float = 1/2; + public static var workLoad:Float = 1 / 2; /** __Access this only from the main thread.__ @@ -152,16 +152,19 @@ class ThreadPool extends WorkOutput Dispatched at most once per job. **/ public var onComplete(default, null) = new EventVoid>(); + /** Dispatched on the main thread when `doWork` calls `sendError()`. Dispatched at most once per job. **/ public var onError(default, null) = new EventVoid>(); + /** Dispatched on the main thread when `doWork` calls `sendProgress()`. May be dispatched any number of times per job. **/ public var onProgress(default, null) = new EventVoid>(); + /** Dispatched on the main thread when a new job begins. Dispatched exactly once per job. @@ -180,6 +183,7 @@ class ThreadPool extends WorkOutput @:deprecated("Instead pass the callback to ThreadPool.run().") @:noCompletion @:dox(hide) public var doWork(get, never):PseudoEvent; + private var __doWork:WorkFunctionWorkOutput->Void>; private var __activeJobs:JobList; @@ -382,78 +386,79 @@ class ThreadPool extends WorkOutput **/ private static function __executeThread():Void { - JSAsync.async({ - var output:WorkOutput = #if html5 new WorkOutput(MULTI_THREADED) #else cast(Thread.readMessage(true), WorkOutput) #end; - var event:ThreadEvent = null; - - while (true) + JSAsync.async( { - // Get a job. - if (event == null) + var output:WorkOutput = #if html5 new WorkOutput(MULTI_THREADED) #else cast(Thread.readMessage(true), WorkOutput) #end; + var event:ThreadEvent = null; + + while (true) { - do + // Get a job. + if (event == null) { - event = Thread.readMessage(true); - } - while (!#if (haxe_ver >= 4.2) Std.isOfType #else Std.is #end (event, ThreadEvent)); + do + { + event = Thread.readMessage(true); + } + while (!#if (haxe_ver >= 4.2) Std.isOfType #else Std.is #end (event, ThreadEvent)); - output.resetJobProgress(); - } + output.resetJobProgress(); + } - if (event.event == EXIT) - { - // Quit working. - #if html5 - Thread.current().destroy(); - #end - return; - } + if (event.event == EXIT) + { + // Quit working. + #if html5 + Thread.current().destroy(); + #end + return; + } - if (event.event != WORK || event.job == null) - { - // Go idle. - event = null; - continue; - } + if (event.event != WORK || event.job == null) + { + // Go idle. + event = null; + continue; + } - // Get to work. - output.activeJob = event.job; + // Get to work. + output.activeJob = event.job; - var interruption:Dynamic = null; - try - { - while (!output.__jobComplete.value && (interruption = Thread.readMessage(false)) == null) + var interruption:Dynamic = null; + try { - output.workIterations.value++; - event.job.doWork.dispatch(event.job.state, output); + while (!output.__jobComplete.value && (interruption = Thread.readMessage(false)) == null) + { + output.workIterations.value++; + event.job.doWork.dispatch(event.job.state, output); + } + } + catch (e:#if (haxe_ver >= 4.1) haxe.Exception #else Dynamic #end) + { + output.sendError(e); } - } - catch (e:#if (haxe_ver >= 4.1) haxe.Exception #else Dynamic #end) - { - output.sendError(e); - } - output.activeJob = null; + output.activeJob = null; - if (interruption == null || output.__jobComplete.value) - { - // Work is done; wait for more. - event = null; - } - else if(#if (haxe_ver >= 4.2) Std.isOfType #else Std.is #end (interruption, ThreadEvent)) - { - // Work on the new job. - event = interruption; - output.resetJobProgress(); - } - else - { - // Ignore interruption and keep working. - } + if (interruption == null || output.__jobComplete.value) + { + // Work is done; wait for more. + event = null; + } + else if (#if (haxe_ver >= 4.2) Std.isOfType #else Std.is #end (interruption, ThreadEvent)) + { + // Work on the new job. + event = interruption; + output.resetJobProgress(); + } + else + { + // Ignore interruption and keep working. + } - // Do it all again. - } - }); + // Do it all again. + } + }); } #end @@ -511,8 +516,7 @@ class ThreadPool extends WorkOutput // `workLoad / frameRate` is the total time that pools may use per // frame. `workPriority / __totalWorkPriority` is this pool's // fraction of that total. - var maxTimeElapsed:Float = workPriority * workLoad - / (__totalWorkPriority * Application.current.window.frameRate); + var maxTimeElapsed:Float = workPriority * workLoad / (__totalWorkPriority * Application.current.window.frameRate); var startTime:Float = timestamp(); var timeElapsed:Float = 0; @@ -652,33 +656,56 @@ class ThreadPool extends WorkOutput } @:access(lime.system.ThreadPool) @:forward(canceled) -private abstract PseudoEvent(ThreadPool) from ThreadPool { +private abstract PseudoEvent(ThreadPool) from ThreadPool +{ @:noCompletion @:dox(hide) public var __listeners(get, never):Array; - private inline function get___listeners():Array { return []; }; + + private inline function get___listeners():Array + { + return []; + }; + @:noCompletion @:dox(hide) public var __repeat(get, never):Array; - private inline function get___repeat():Array { return []; }; - public function add(callback:Dynamic -> Void):Void { + private inline function get___repeat():Array + { + return []; + }; + + public function add(callback:Dynamic->Void):Void + { function callCallback(state:State, output:WorkOutput):Void { callback(state); } #if (lime_threads && html5) - if (this.mode == MULTI_THREADED) - throw "Unsupported operation; instead pass the callback to ThreadPool's constructor."; + if (this.mode == MULTI_THREADED) throw "Unsupported operation; instead pass the callback to ThreadPool's constructor."; else - this.__doWork = { func: callCallback }; + this.__doWork = {func: callCallback}; #else this.__doWork = callCallback; #end } public inline function cancel():Void {} + public inline function dispatch():Void {} - public inline function has(callback:Dynamic -> Void):Bool { return this.__doWork != null; } - public inline function remove(callback:Dynamic -> Void):Void { this.__doWork = null; } - public inline function removeAll():Void { this.__doWork = null; } + + public inline function has(callback:Dynamic->Void):Bool + { + return this.__doWork != null; + } + + public inline function remove(callback:Dynamic->Void):Void + { + this.__doWork = null; + } + + public inline function removeAll():Void + { + this.__doWork = null; + } } class JobList @@ -822,7 +849,8 @@ class JobList // Getters & Setters - private inline function set___addingWorkPriority(value:Bool):Bool { + private inline function set___addingWorkPriority(value:Bool):Bool + { if (pool != null && __addingWorkPriority != value && ThreadPool.isMainThread()) { if (value) @@ -857,17 +885,25 @@ class JobList that's in use by multiple jobs, the wrong job may be selected or canceled. **/ @:forward -abstract JobIdentifier(JobIdentifierImpl) from JobIdentifierImpl { - @:from private static inline function fromJob(job:JobData):JobIdentifier { +abstract JobIdentifier(JobIdentifierImpl) from JobIdentifierImpl +{ + @:from private static inline function fromJob(job:JobData):JobIdentifier + { return ID(job.id); } - @:from private static inline function fromID(id:Int):JobIdentifier { + + @:from private static inline function fromID(id:Int):JobIdentifier + { return ID(id); } - @:from private static inline function fromFunction(doWork:WorkFunctionWorkOutput->Void>):JobIdentifier { + + @:from private static inline function fromFunction(doWork:WorkFunctionWorkOutput->Void>):JobIdentifier + { return FUNCTION(doWork); } - @:from private static inline function fromState(state:State):JobIdentifier { + + @:from private static inline function fromState(state:State):JobIdentifier + { return STATE(state); } } diff --git a/src/lime/system/WorkOutput.hx b/src/lime/system/WorkOutput.hx index 433fad10e3..6964b1c77e 100644 --- a/src/lime/system/WorkOutput.hx +++ b/src/lime/system/WorkOutput.hx @@ -13,12 +13,10 @@ import neko.vm.Deque; import neko.vm.Thread; import neko.vm.Tls; #end - #if html5 import lime._internal.backend.html5.HTML5Thread as Thread; import lime._internal.backend.html5.HTML5Thread.Transferable; #end - #if macro import haxe.macro.Expr; @@ -54,6 +52,7 @@ class WorkOutput available on this target, `mode` will always be `SINGLE_THREADED`. **/ public var mode(get, never):ThreadMode; + #if lime_threads /** __Set this only via the constructor.__ @@ -65,6 +64,7 @@ class WorkOutput Messages sent by active jobs, received by the main thread. **/ private var __jobOutput:Deque = new Deque(); + /** Thread-local storage. Tracks whether `sendError()` or `sendComplete()` was called by this job. @@ -77,6 +77,7 @@ class WorkOutput Will be null in all other cases. **/ public var activeJob(get, set):Null; + @:noCompletion private var __activeJob:Tls = new Tls(); private inline function new(mode:Null) @@ -174,7 +175,8 @@ class WorkOutput var thread:Thread = Thread.create(executeThread); #if html5 - thread.onMessage.add(function(event:ThreadEvent) { + thread.onMessage.add(function(event:ThreadEvent) + { __jobOutput.add(event); }); #end @@ -198,6 +200,7 @@ class WorkOutput { return __activeJob.value; } + private inline function set_activeJob(value:JobData):JobData { return __activeJob.value = value; @@ -205,6 +208,7 @@ class WorkOutput } #if haxe4 enum #else @:enum #end abstract ThreadMode(Bool) + { /** All work will be done on the main thread, during `Application.onUpdate`. @@ -264,8 +268,8 @@ abstract WorkFunction(T) from T to T { switch (self.typeof().follow().toComplexType()) { - case TPath({ sub: "WorkFunction", params: [TPType(t)] }): - return macro ($self:$t)($a{args}); + case TPath({sub: "WorkFunction", params: [TPType(t)]}): + return macro($self : $t)($a{args}); default: throw "Underlying function type not found."; } @@ -278,8 +282,8 @@ abstract WorkFunction(T) from T to T only accepts a single argument, you can pass multiple values as part of an anonymous structure. (Or an array, or a class.) - // Does not work: too many arguments. - // threadPool.run(doWork, argument0, argument1, argument2); + // Does not work: too many arguments. + // threadPool.run(doWork, argument0, argument1, argument2); // Works: all arguments are combined into one `State` object. threadPool.run(doWork, { arg0: argument0, arg1: argument1, arg2: argument2 }); @@ -302,6 +306,7 @@ typedef State = Dynamic; class JobData { private static var nextID:Int = 0; + /** `JobData` instances will regularly be copied in HTML5, so checking equality won't work. Instead, compare identifiers. @@ -342,19 +347,23 @@ class JobData } #if haxe4 enum #else @:enum #end abstract ThreadEventType(String) + { /** Sent by the background thread, indicating completion. **/ var COMPLETE = "COMPLETE"; + /** Sent by the background thread, indicating failure. **/ var ERROR = "ERROR"; + /** Sent by the background thread. **/ var PROGRESS = "PROGRESS"; + /** Sent by the main thread, indicating that the provided job should begin in place of any ongoing job. If `state == null`, the existing job will @@ -362,6 +371,7 @@ class JobData `state = {}` instead.) **/ var WORK = "WORK"; + /** Sent by the main thread to shut down a thread. **/ @@ -403,7 +413,6 @@ class JSAsync } // Define platform-specific types - #if target.threaded // Haxe 3 compatibility: "target.threaded" can't go in parentheses. #elseif !(cpp || neko) diff --git a/src/lime/text/Font.hx b/src/lime/text/Font.hx index 19843c2e8a..6fc940a538 100644 --- a/src/lime/text/Font.hx +++ b/src/lime/text/Font.hx @@ -190,7 +190,9 @@ class Font { #if (lime_cffi && !macro) #if hl - return [for (index in NativeCFFI.lime_font_get_glyph_indices(src, characters)) new Glyph(index)]; + return [ + for (index in NativeCFFI.lime_font_get_glyph_indices(src, characters)) new Glyph(index) + ]; #else return NativeCFFI.lime_font_get_glyph_indices(src, characters); #end diff --git a/src/lime/text/harfbuzz/HBBufferClusterLevel.hx b/src/lime/text/harfbuzz/HBBufferClusterLevel.hx index 4030093ba5..a644619fea 100644 --- a/src/lime/text/harfbuzz/HBBufferClusterLevel.hx +++ b/src/lime/text/harfbuzz/HBBufferClusterLevel.hx @@ -2,6 +2,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 + { public var MONOTONE_GRAPHEMES = 0; public var MONOTONE_CHARACTERS = 1; diff --git a/src/lime/text/harfbuzz/HBBufferContentType.hx b/src/lime/text/harfbuzz/HBBufferContentType.hx index 09d96650b2..871f6d5bd1 100644 --- a/src/lime/text/harfbuzz/HBBufferContentType.hx +++ b/src/lime/text/harfbuzz/HBBufferContentType.hx @@ -2,6 +2,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 + { public var INVALID = 0; public var UNICODE = 1; diff --git a/src/lime/text/harfbuzz/HBBufferFlags.hx b/src/lime/text/harfbuzz/HBBufferFlags.hx index 9e560cb5cc..a5d615fff1 100644 --- a/src/lime/text/harfbuzz/HBBufferFlags.hx +++ b/src/lime/text/harfbuzz/HBBufferFlags.hx @@ -2,6 +2,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 + { public var DEFAULT = 0x00000000; public var BOT = 0x00000001; diff --git a/src/lime/text/harfbuzz/HBBufferSerializeFlags.hx b/src/lime/text/harfbuzz/HBBufferSerializeFlags.hx index 519879924e..23572c90c9 100644 --- a/src/lime/text/harfbuzz/HBBufferSerializeFlags.hx +++ b/src/lime/text/harfbuzz/HBBufferSerializeFlags.hx @@ -2,6 +2,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 + { public var DEFAULT = 0x00000000; public var NO_CLUSTERS = 0x00000001; diff --git a/src/lime/text/harfbuzz/HBBufferSerializeFormat.hx b/src/lime/text/harfbuzz/HBBufferSerializeFormat.hx index 92f60090e3..562a876b74 100644 --- a/src/lime/text/harfbuzz/HBBufferSerializeFormat.hx +++ b/src/lime/text/harfbuzz/HBBufferSerializeFormat.hx @@ -2,6 +2,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 + { // public var HB_BUFFER_SERIALIZE_FORMAT_TEXT = HB_TAG('T', 'E', 'X', 'T'); // public var JSON = HB_TAG('J', 'S', 'O', 'N'); @@ -12,6 +13,7 @@ package lime.text.harfbuzz; // // } } + // @:cffi private static function lime_hb_buffer_serialize_format_from_string (str:String, len:Int):Int; // @:cffi private static function lime_hb_buffer_serialize_format_to_string (format:Int):CFFIPointer; // @:cffi private static function lime_hb_buffer_serialize_list_formats ():CFFIPointer; diff --git a/src/lime/text/harfbuzz/HBDirection.hx b/src/lime/text/harfbuzz/HBDirection.hx index dd081850b9..fe2bf0813c 100644 --- a/src/lime/text/harfbuzz/HBDirection.hx +++ b/src/lime/text/harfbuzz/HBDirection.hx @@ -2,6 +2,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 + { public var INVALID = 0; public var LTR = 4; diff --git a/src/lime/text/harfbuzz/HBMemoryMode.hx b/src/lime/text/harfbuzz/HBMemoryMode.hx index 30a9cda91e..68994ac877 100644 --- a/src/lime/text/harfbuzz/HBMemoryMode.hx +++ b/src/lime/text/harfbuzz/HBMemoryMode.hx @@ -2,6 +2,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 + { public var DUPLICATE = 0; public var READONLY = 1; diff --git a/src/lime/text/harfbuzz/HBScript.hx b/src/lime/text/harfbuzz/HBScript.hx index bc3359dd54..6026bff713 100644 --- a/src/lime/text/harfbuzz/HBScript.hx +++ b/src/lime/text/harfbuzz/HBScript.hx @@ -2,6 +2,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 + { 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; diff --git a/src/lime/tools/AIRHelper.hx b/src/lime/tools/AIRHelper.hx index 01045e8d55..c834eac361 100644 --- a/src/lime/tools/AIRHelper.hx +++ b/src/lime/tools/AIRHelper.hx @@ -16,7 +16,6 @@ class AIRHelper switch (targetPlatform) { case MAC: - if (airTarget == "bundle") { extension = ".app"; @@ -49,7 +48,8 @@ class AIRHelper exportMethod = m; } } - if (exportMethod == null && project.targetFlags.exists("final")) { + if (exportMethod == null && project.targetFlags.exists("final")) + { exportMethod = "appstore"; } diff --git a/src/lime/tools/ApplicationData.hx b/src/lime/tools/ApplicationData.hx index 301917209d..a81d4688c2 100644 --- a/src/lime/tools/ApplicationData.hx +++ b/src/lime/tools/ApplicationData.hx @@ -12,13 +12,14 @@ abstract ApplicationData({ }) from Dynamic { @:noCompletion - public static var expectedFields:ApplicationData = { - file: "", - init: "", - main: "", - path: "", - preloader: "", - swfVersion: 0.0, - url: "" - }; + public static var expectedFields:ApplicationData = + { + file: "", + init: "", + main: "", + path: "", + preloader: "", + swfVersion: 0.0, + url: "" + }; } diff --git a/src/lime/tools/ConfigData.hx b/src/lime/tools/ConfigData.hx index d869814206..bea33c5cc9 100644 --- a/src/lime/tools/ConfigData.hx +++ b/src/lime/tools/ConfigData.hx @@ -170,7 +170,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:Dynamic, value:Dynamic}> { var values = {}; if (defaultValues != null) @@ -181,7 +181,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.endsWith(key, ARRAY)) { Reflect.setField(values, key, Reflect.field(data, key)); } @@ -190,7 +190,7 @@ abstract ConfigData(Dynamic) to Dynamic from Dynamic var pairs = []; for (key in Reflect.fields(values)) { - pairs.push({ key: key, value: Reflect.field(values, key) }); + pairs.push({key: key, value: Reflect.field(values, key)}); } return pairs; diff --git a/src/lime/tools/HTML5Helper.hx b/src/lime/tools/HTML5Helper.hx index a028204935..726aac62a2 100644 --- a/src/lime/tools/HTML5Helper.hx +++ b/src/lime/tools/HTML5Helper.hx @@ -166,7 +166,8 @@ class HTML5Helper { var executable = "npx"; var terser = "terser"; - if (!project.targetFlags.exists("npx")) { + if (!project.targetFlags.exists("npx")) + { var suffix = switch (System.hostPlatform) { case WINDOWS: "-windows.exe"; @@ -199,14 +200,7 @@ class HTML5Helper } } - var args = [ - terser, - sourceFile, - "-c", - "-m", - "-o", - tempFile - ]; + var args = [terser, sourceFile, "-c", "-m", "-o", tempFile]; if (FileSystem.exists(sourceFile + ".map")) { @@ -237,9 +231,7 @@ class HTML5Helper if (project.targetFlags.exists("npx")) { executable = "npx"; - args = [ - "google-closure-compiler" - ]; + args = ["google-closure-compiler"]; } else { diff --git a/src/lime/tools/HXProject.hx b/src/lime/tools/HXProject.hx index 26e90bdee3..b2ffb6bf18 100644 --- a/src/lime/tools/HXProject.hx +++ b/src/lime/tools/HXProject.hx @@ -107,7 +107,7 @@ class HXProject extends Script var classRef = Type.resolveClass(inputData.name); if (classRef == null) { - Log.error('Unable to find class ${ inputData.name } in ${ inputData.projectFile }'); + Log.error('Unable to find class ${inputData.name} in ${inputData.projectFile}'); return; } var instance = Type.createInstance(classRef, []); @@ -189,7 +189,9 @@ class HXProject extends Script else { environment = Sys.environment(); - for (conflict in ["air", "android", "cpp", "flash", "hl", "html5", "ios", "linux", "mac", "neko", "webassembly", "windows"]) + for (conflict in [ + "air", "android", "cpp", "flash", "hl", "html5", "ios", "linux", "mac", "neko", "webassembly", "windows" + ]) { environment.remove(conflict); } @@ -398,11 +400,12 @@ class HXProject extends Script var args = [ name, #if lime - "-lib", "lime", - "-lib", "hxp", + "-lib", "lime", "-lib", "hxp", #end - "-cp", tempDirectory, - "-cp", Path.combine(Haxelib.getPath(new Haxelib("hxp")), "src") + "-cp", + tempDirectory, + "-cp", + Path.combine(Haxelib.getPath(new Haxelib("hxp")), "src") ]; var input = File.read(classFile, false); var tag = "@:compiler("; @@ -677,6 +680,7 @@ class HXProject extends Script @:privateAccess projectXML.parseXML(new Access(Xml.parse(xml).firstElement()), ""); merge(projectXML); } + // #end private function initializeDefines():Void @@ -786,8 +790,7 @@ class HXProject extends Script defines.set("native", "1"); defines.set("cpp", "1"); } - else if (targetFlags.exists("cpp") - || ((platformType != PlatformType.WEB) && !targetFlags.exists("html5"))) + else if (targetFlags.exists("cpp") || ((platformType != PlatformType.WEB) && !targetFlags.exists("html5"))) { defines.set("targetType", "cpp"); defines.set("native", "1"); diff --git a/src/lime/tools/HashlinkHelper.hx b/src/lime/tools/HashlinkHelper.hx index 40c48836cb..3b847495a6 100644 --- a/src/lime/tools/HashlinkHelper.hx +++ b/src/lime/tools/HashlinkHelper.hx @@ -24,7 +24,8 @@ class HashlinkHelper Sys.exit(1); ""; }; - if(is64) { + if (is64) + { bindir += "64"; } @@ -37,9 +38,8 @@ class HashlinkHelper if (project.targetFlags.exists("hlc")) { var limeDirectory = Haxelib.getPath(new Haxelib("lime"), true); - var includeDirectory = sys.FileSystem.exists(Path.combine(limeDirectory, "project")) - ? Path.combine(limeDirectory, "project/lib/hashlink/src") - : Path.combine(limeDirectory, "templates/bin/hl/include"); + var includeDirectory = sys.FileSystem.exists(Path.combine(limeDirectory, + "project")) ? Path.combine(limeDirectory, "project/lib/hashlink/src") : Path.combine(limeDirectory, "templates/bin/hl/include"); System.copyFile(Path.combine(includeDirectory, "hlc.h"), Path.combine(targetDirectory, "obj/hlc.h"), null, false); System.copyFile(Path.combine(includeDirectory, "hl.h"), Path.combine(targetDirectory, "obj/hl.h"), null, false); @@ -118,7 +118,8 @@ class HashlinkHelper var appMainCPath = Path.combine(targetDirectory, "obj/ApplicationMain.c"); var appMainCText = System.readText(appMainCPath); var index = appMainCText.indexOf("#ifndef HL_MAKE"); - appMainCText = appMainCText.substr(0, index) + " + appMainCText = appMainCText.substr(0, index) + + " // --------- START LIME HL/C INJECTED CODE --------- // // undefine things to avoid Haxe field name conflicts #undef BIG_ENDIAN @@ -148,7 +149,8 @@ class HashlinkHelper #undef __valid #undef WAIT_FAILED // ---------- END LIME HL/C INJECTED CODE ---------- // -" + appMainCText.substr(index); +" + + appMainCText.substr(index); System.writeText(appMainCText, appMainCPath); } else diff --git a/src/lime/tools/IconHelper.hx b/src/lime/tools/IconHelper.hx index 7db1dfdb12..67d2ee416a 100644 --- a/src/lime/tools/IconHelper.hx +++ b/src/lime/tools/IconHelper.hx @@ -311,7 +311,8 @@ class IconHelper } if (Math.abs(iconDifference) < Math.abs(matchDifference) - || iconDifference == matchDifference && icon.priority >= match.priority) + || iconDifference == matchDifference + && icon.priority >= match.priority) { match = icon; matchDifference = iconDifference; diff --git a/src/lime/tools/MetaData.hx b/src/lime/tools/MetaData.hx index 2e859905ae..325962b870 100644 --- a/src/lime/tools/MetaData.hx +++ b/src/lime/tools/MetaData.hx @@ -13,14 +13,15 @@ abstract MetaData({ }) from Dynamic { @:noCompletion - public static var expectedFields:MetaData = { - buildNumber: "", - company: "", - companyId: "", - companyUrl: "", - description: "", - packageName: "", - title: "", - version: "" - }; + public static var expectedFields:MetaData = + { + buildNumber: "", + company: "", + companyId: "", + companyUrl: "", + description: "", + packageName: "", + title: "", + version: "" + }; } diff --git a/src/lime/tools/Platform.hx b/src/lime/tools/Platform.hx index d799467d1d..2c5f004a68 100644 --- a/src/lime/tools/Platform.hx +++ b/src/lime/tools/Platform.hx @@ -1,6 +1,7 @@ package lime.tools; #if (haxe_ver >= 4.0) enum #else @:enum #end abstract Platform(String) from hxp.HostPlatform + { var AIR = "air"; var ANDROID = "android"; diff --git a/src/lime/tools/PlatformTarget.hx b/src/lime/tools/PlatformTarget.hx index fe4ea957d6..3ae2653cef 100644 --- a/src/lime/tools/PlatformTarget.hx +++ b/src/lime/tools/PlatformTarget.hx @@ -57,8 +57,7 @@ class PlatformTarget // known issue: this may not log in `-eval` mode on Linux inline function logCommand(command:String):Void { - if (!Reflect.hasField(metaFields, command) - || !Reflect.hasField(Reflect.field(metaFields, command), "ignore")) + if (!Reflect.hasField(metaFields, command) || !Reflect.hasField(Reflect.field(metaFields, command), "ignore")) { Log.info("", "\n" + Log.accentColor + "Running command: " + command.toUpperCase() + Log.resetColor); } @@ -137,8 +136,7 @@ class PlatformTarget run(); } - if ((command == "test" || command == "trace" || command == "run" || command == "rerun") - && (traceEnabled || command == "trace")) + if ((command == "test" || command == "trace" || command == "run" || command == "rerun") && (traceEnabled || command == "trace")) { logCommand("trace"); this.trace(); diff --git a/src/lime/tools/ProjectXMLParser.hx b/src/lime/tools/ProjectXMLParser.hx index 835d636933..c9d8bd91fd 100644 --- a/src/lime/tools/ProjectXMLParser.hx +++ b/src/lime/tools/ProjectXMLParser.hx @@ -1410,7 +1410,6 @@ class ProjectXMLParser extends HXProject sources.push(path); case "extension": - // deprecated case "haxedef": @@ -1512,7 +1511,6 @@ class ProjectXMLParser extends HXProject parseModuleElement(element, extensionPath); case "ssl": - // if (wantSslCertificate()) // parseSsl (element); diff --git a/src/lime/tools/WindowData.hx b/src/lime/tools/WindowData.hx index d861cd23b5..8838c65ff0 100644 --- a/src/lime/tools/WindowData.hx +++ b/src/lime/tools/WindowData.hx @@ -34,35 +34,36 @@ abstract WindowData({ }) from Dynamic { @:noCompletion - public static var expectedFields:WindowData = { - width: 0, - height: 0, - x: 0.0, - y: 0.0, - background: 0, - parameters: "", - fps: 0, - hardware: false, - display: 0, - resizable: false, - borderless: false, - vsync: false, - fullscreen: false, - allowHighDPI: false, - alwaysOnTop: false, - antialiasing: 0, - orientation: Orientation.AUTO, - allowShaders: false, - requireShaders: false, - depthBuffer: false, - stencilBuffer: false, - title: "", - #if (js && html5) - element: null, - #end - colorDepth: 0, - minimized: false, - maximized: false, - hidden: false - }; + public static var expectedFields:WindowData = + { + width: 0, + height: 0, + x: 0.0, + y: 0.0, + background: 0, + parameters: "", + fps: 0, + hardware: false, + display: 0, + resizable: false, + borderless: false, + vsync: false, + fullscreen: false, + allowHighDPI: false, + alwaysOnTop: false, + antialiasing: 0, + orientation: Orientation.AUTO, + allowShaders: false, + requireShaders: false, + depthBuffer: false, + stencilBuffer: false, + title: "", + #if (js && html5) + element: null, + #end + colorDepth: 0, + minimized: false, + maximized: false, + hidden: false + }; } diff --git a/src/lime/ui/GamepadAxis.hx b/src/lime/ui/GamepadAxis.hx index e328d1ceb6..e1dbbfa262 100644 --- a/src/lime/ui/GamepadAxis.hx +++ b/src/lime/ui/GamepadAxis.hx @@ -1,6 +1,7 @@ package lime.ui; #if (haxe_ver >= 4.0) enum #else @:enum #end abstract GamepadAxis(Int) from Int to Int from UInt to UInt + { var LEFT_X = 0; var LEFT_Y = 1; diff --git a/src/lime/ui/GamepadButton.hx b/src/lime/ui/GamepadButton.hx index 33573fcd1c..81df94d758 100644 --- a/src/lime/ui/GamepadButton.hx +++ b/src/lime/ui/GamepadButton.hx @@ -1,6 +1,7 @@ package lime.ui; #if (haxe_ver >= 4.0) enum #else @:enum #end abstract GamepadButton(Int) from Int to Int from UInt to UInt + { var A = 0; var B = 1; diff --git a/src/lime/ui/Joystick.hx b/src/lime/ui/Joystick.hx index 3f23c2a9e8..df33121bb2 100644 --- a/src/lime/ui/Joystick.hx +++ b/src/lime/ui/Joystick.hx @@ -55,8 +55,8 @@ class Joystick @:noCompletion private static function __getDeviceData():Array { var res:Dynamic = null; - - try + + try { res = (untyped navigator.getGamepads) ? untyped navigator.getGamepads() : (untyped navigator.webkitGetGamepads) ? untyped navigator.webkitGetGamepads() : null; } @@ -65,7 +65,7 @@ class Joystick // if something went wrong, treat it the same as when navigator.getGamepads doesn't exist // we probably don't have permission to use this feature } - + return res; } #end diff --git a/src/lime/ui/KeyCode.hx b/src/lime/ui/KeyCode.hx index 1843e6d4f5..375fb36d3f 100644 --- a/src/lime/ui/KeyCode.hx +++ b/src/lime/ui/KeyCode.hx @@ -4,6 +4,7 @@ import lime._internal.backend.native.NativeCFFI; @:access(lime._internal.backend.native.NativeCFFI) #if (haxe_ver >= 4.0) enum #else @:enum #end abstract KeyCode(Int) from Int to Int from UInt to UInt + { var UNKNOWN = 0x00; var BACKSPACE = 0x08; diff --git a/src/lime/ui/MouseButton.hx b/src/lime/ui/MouseButton.hx index 831d8c7d25..afcb3dc3d4 100644 --- a/src/lime/ui/MouseButton.hx +++ b/src/lime/ui/MouseButton.hx @@ -1,6 +1,7 @@ package lime.ui; #if (haxe_ver >= 4.0) enum #else @:enum #end abstract MouseButton(Int) from Int to Int + { var LEFT = 0; var MIDDLE = 1; diff --git a/src/lime/ui/ScanCode.hx b/src/lime/ui/ScanCode.hx index 52cca0a5da..a27b76847a 100644 --- a/src/lime/ui/ScanCode.hx +++ b/src/lime/ui/ScanCode.hx @@ -5,6 +5,7 @@ import lime._internal.backend.native.NativeCFFI; @:access(lime._internal.backend.native.NativeCFFI) @:access(lime.ui.KeyCode) #if (haxe_ver >= 4.0) enum #else @:enum #end abstract ScanCode(Int) from Int to Int from UInt to UInt + { var UNKNOWN = 0; var BACKSPACE = 42; diff --git a/src/lime/ui/Window.hx b/src/lime/ui/Window.hx index 64810eba3b..4cf7972d81 100644 --- a/src/lime/ui/Window.hx +++ b/src/lime/ui/Window.hx @@ -439,7 +439,8 @@ class Window __minWidth = width; __minHeight = height; - if (__width < __minWidth || __height < __minHeight) { + if (__width < __minWidth || __height < __minHeight) + { resize(__width, __height); } } @@ -450,7 +451,8 @@ class Window __maxWidth = width; __maxHeight = height; - if (__width > __maxWidth || __height > __maxHeight) { + if (__width > __maxWidth || __height > __maxHeight) + { resize(__width, __height); } } diff --git a/src/lime/utils/ArrayBufferView.hx b/src/lime/utils/ArrayBufferView.hx index 23ece48edb..b643e3d81e 100644 --- a/src/lime/utils/ArrayBufferView.hx +++ b/src/lime/utils/ArrayBufferView.hx @@ -275,7 +275,7 @@ class ArrayBufferView // Non-spec #if !no_typedarray_inline #end - function copyFromArray(array:Array<#if hl Dynamic #else Float #end>, offset:Int = 0) + function copyFromArray(array:Array< #if hl Dynamic #else Float #end>, offset:Int = 0) { // Ideally, native semantics could be used, like cpp.NativeArray.blit var i = 0, len = array.length; @@ -401,6 +401,7 @@ class ArrayBufferView } @:noCompletion @:dox(hide) #if (haxe_ver >= 4.0) enum #else @:enum #end + abstract TypedArrayType(Int) from Int to Int { var None = 0; diff --git a/src/lime/utils/AssetLibrary.hx b/src/lime/utils/AssetLibrary.hx index 782bd4a433..01d2c9c70b 100644 --- a/src/lime/utils/AssetLibrary.hx +++ b/src/lime/utils/AssetLibrary.hx @@ -337,8 +337,11 @@ class AssetLibrary return switch (cast(type, AssetType)) { case null: - cachedBytes.exists(id) || cachedText.exists(id) || cachedImages.exists(id) - || cachedAudioBuffers.exists(id) || cachedFonts.exists(id); + cachedBytes.exists(id) + || cachedText.exists(id) + || cachedImages.exists(id) + || cachedAudioBuffers.exists(id) + || cachedFonts.exists(id); case IMAGE: cachedImages.exists(id); @@ -349,8 +352,7 @@ class AssetLibrary case FONT: cachedFonts.exists(id); - default: - cachedBytes.exists(id) || cachedText.exists(id); + default: cachedBytes.exists(id) || cachedText.exists(id); } #end } diff --git a/src/lime/utils/AssetType.hx b/src/lime/utils/AssetType.hx index 6c713709d5..c228bc6909 100644 --- a/src/lime/utils/AssetType.hx +++ b/src/lime/utils/AssetType.hx @@ -1,6 +1,7 @@ package lime.utils; #if (haxe_ver >= 4.0) enum #else @:enum #end abstract AssetType(String) to String + { var BINARY = "BINARY"; var FONT = "FONT"; diff --git a/src/lime/utils/LogLevel.hx b/src/lime/utils/LogLevel.hx index e0c813ec83..52d50877b2 100644 --- a/src/lime/utils/LogLevel.hx +++ b/src/lime/utils/LogLevel.hx @@ -1,6 +1,7 @@ package lime.utils; #if (haxe_ver >= 4.0) enum #else @:enum #end abstract LogLevel(Int) from Int to Int from UInt to UInt + { var NONE = 0; var ERROR = 1; diff --git a/src/lime/utils/ObjectPool.hx b/src/lime/utils/ObjectPool.hx index a023128f02..0b10868c89 100644 --- a/src/lime/utils/ObjectPool.hx +++ b/src/lime/utils/ObjectPool.hx @@ -2,10 +2,9 @@ package lime.utils; import haxe.ds.ObjectMap; - /** - A generic object pool for reusing objects. - **/ + A generic object pool for reusing objects. +**/ #if !lime_debug @:fileXml('tags="haxe,release"') @:noDebug @@ -13,18 +12,18 @@ import haxe.ds.ObjectMap; #if !js @:generic #end class ObjectPool { /** - The number of active objects in the pool. - **/ + The number of active objects in the pool. + **/ public var activeObjects(default, null):Int; /** - The number of inactive objects in the pool. - **/ + The number of inactive objects in the pool. + **/ public var inactiveObjects(default, null):Int; /** - The total size of the object pool (both active and inactive objects). - **/ + The total size of the object pool (both active and inactive objects). + **/ public var size(get, set):Null; @:noCompletion private var __inactiveObject0:T; @@ -34,12 +33,12 @@ import haxe.ds.ObjectMap; @:noCompletion private var __size:Null; /** - Creates a new ObjectPool instance. - - @param create A function that creates a new instance of type T. - @param clean A function that cleans up an instance of type T before it is reused. - @param size The maximum size of the object pool. - **/ + Creates a new ObjectPool instance. + + @param create A function that creates a new instance of type T. + @param clean A function that cleans up an instance of type T before it is reused. + @param size The maximum size of the object pool. + **/ public function new(create:Void->T = null, clean:T->Void = null, size:Null = null) { __pool = cast new ObjectMap(); @@ -64,11 +63,12 @@ import haxe.ds.ObjectMap; this.size = size; } } + /** - Adds an object to the object pool. - - @param object The object to add to the pool. - **/ + Adds an object to the object pool. + + @param object The object to add to the pool. + **/ public function add(object:T):Void { if (object != null && !__pool.exists(object)) @@ -82,15 +82,15 @@ import haxe.ds.ObjectMap; /** Dynamic function. - Cleans up an object before returning it to the pool. - - @param object The object to clean up. - **/ + Cleans up an object before returning it to the pool. + + @param object The object to clean up. + **/ public dynamic function clean(object:T):Void {} /** - Clears the object pool, removing all objects. - **/ + Clears the object pool, removing all objects. + **/ public function clear():Void { __pool = cast new ObjectMap(); @@ -106,18 +106,18 @@ import haxe.ds.ObjectMap; /** Dynamic function. - Creates a new Object. - **/ + Creates a new Object. + **/ public dynamic function create():T { return null; } /** - Creates a new object and adds it to the pool, or returns an existing inactive object from the pool. - - @return The object retrieved from the pool, or null if the pool is full and no new objects can be created. - **/ + Creates a new object and adds it to the pool, or returns an existing inactive object from the pool. + + @return The object retrieved from the pool, or null if the pool is full and no new objects can be created. + **/ public function get():T { var object = null; @@ -141,10 +141,10 @@ import haxe.ds.ObjectMap; } /** - Releases an active object back into the pool. - - @param object The object to release. - **/ + Releases an active object back into the pool. + + @param object The object to release. + **/ public function release(object:T):Void { #if debug @@ -172,10 +172,10 @@ import haxe.ds.ObjectMap; } /** - Removes an object from the pool. - - @param object The object to remove from the pool. - **/ + Removes an object from the pool. + + @param object The object to remove from the pool. + **/ public function remove(object:T):Void { if (object != null && __pool.exists(object)) diff --git a/src/lime/utils/PackedAssetLibrary.hx b/src/lime/utils/PackedAssetLibrary.hx index 13161282ab..2d62e50fab 100644 --- a/src/lime/utils/PackedAssetLibrary.hx +++ b/src/lime/utils/PackedAssetLibrary.hx @@ -241,7 +241,7 @@ import flash.media.Sound; } else { - var basePath = rootPath == null || rootPath == "" ? "" : Path.addTrailingSlash(rootPath); + var basePath = rootPath == null || rootPath == "" ? "" : Path.addTrailingSlash(rootPath); var libPath = getPath(id); if (libPath == null) libPath = id; diff --git a/src/lime/utils/Preloader.hx b/src/lime/utils/Preloader.hx index d9f309aeff..3e4f120373 100644 --- a/src/lime/utils/Preloader.hx +++ b/src/lime/utils/Preloader.hx @@ -36,12 +36,12 @@ class Preloader #if flash extends Sprite #end public var onProgress = new EventInt->Void>(); @:noCompletion private var bytesLoaded:Int; - @:noCompletion private var bytesLoadedCache = new ObjectMap<#if !disable_preloader_assets AssetLibrary #else Dynamic #end, Int>(); + @:noCompletion private var bytesLoadedCache = new ObjectMap< #if !disable_preloader_assets AssetLibrary #else Dynamic #end, Int>(); @:noCompletion private var bytesLoadedCache2 = new Map(); @:noCompletion private var bytesTotal:Int; @:noCompletion private var bytesTotalCache = new Map(); @:noCompletion private var initLibraryNames:Bool; - @:noCompletion private var libraries:Array<#if !disable_preloader_assets AssetLibrary #else Dynamic #end>; + @:noCompletion private var libraries:Array< #if !disable_preloader_assets AssetLibrary #else Dynamic #end>; @:noCompletion private var libraryNames:Array; @:noCompletion private var loadedLibraries:Int; @:noCompletion private var loadedStage:Bool; @@ -60,7 +60,7 @@ class Preloader #if flash extends Sprite #end bytesLoaded = 0; bytesTotal = 0; - libraries = new Array<#if !disable_preloader_assets AssetLibrary #else Dynamic #end>(); + libraries = new Array< #if !disable_preloader_assets AssetLibrary #else Dynamic #end>(); libraryNames = new Array(); onProgress.add(update); @@ -296,8 +296,7 @@ class Preloader #if flash extends Sprite #end } #end - if (!simulateProgress #if flash && loadedStage #end - && loadedLibraries == (libraries.length + libraryNames.length)) + if (!simulateProgress #if flash && loadedStage #end && loadedLibraries == (libraries.length + libraryNames.length)) { if (!preloadComplete) { diff --git a/tools/CommandLineTools.hx b/tools/CommandLineTools.hx index de09934519..8ba4380b3b 100644 --- a/tools/CommandLineTools.hx +++ b/tools/CommandLineTools.hx @@ -406,8 +406,7 @@ class CommandLineTools publishProject(); case "installer", "copy-if-newer": - - // deprecated? + // deprecated? default: Log.error("'" + command + "' is not a valid command"); @@ -588,19 +587,16 @@ class CommandLineTools platform = new AndroidPlatform(command, project, targetFlags); case BLACKBERRY: - - // platform = new BlackBerryPlatform (command, project, targetFlags); + // platform = new BlackBerryPlatform (command, project, targetFlags); case IOS: platform = new IOSPlatform(command, project, targetFlags); case TIZEN: - - // platform = new TizenPlatform (command, project, targetFlags); + // platform = new TizenPlatform (command, project, targetFlags); case WEBOS: - - // platform = new WebOSPlatform (command, project, targetFlags); + // platform = new WebOSPlatform (command, project, targetFlags); case WINDOWS: platform = new WindowsPlatform(command, project, targetFlags); @@ -776,14 +772,22 @@ class CommandLineTools { var commands = [ - "config" => "Display or set command-line configuration values", "create" => "Create a new project or extension using templates", - "clean" => "Clean the specified project and target", "update" => "Copy assets for the specified project and target", - "build" => "Compile and package for the specified project and target", "run" => "Install and run for the specified project and target", - "test" => "Update, build and run in one command", "help" => "Show this information", - "trace" => "Trace output for the specifed project and target", "deploy" => "Archive and upload builds", - "display" => "Display information for the specified project and target", "rebuild" => "Recompile native binaries for libraries", - "install" => "Install a library from haxelib, plus dependencies", "remove" => "Remove a library from haxelib", - "upgrade" => "Upgrade a library from haxelib", "setup" => "Setup " + defaultLibraryName + " or a specific platform" + "config" => "Display or set command-line configuration values", + "create" => "Create a new project or extension using templates", + "clean" => "Clean the specified project and target", + "update" => "Copy assets for the specified project and target", + "build" => "Compile and package for the specified project and target", + "run" => "Install and run for the specified project and target", + "test" => "Update, build and run in one command", + "help" => "Show this information", + "trace" => "Trace output for the specifed project and target", + "deploy" => "Archive and upload builds", + "display" => "Display information for the specified project and target", + "rebuild" => "Recompile native binaries for libraries", + "install" => "Install a library from haxelib, plus dependencies", + "remove" => "Remove a library from haxelib", + "upgrade" => "Upgrade a library from haxelib", + "setup" => "Setup " + defaultLibraryName + " or a specific platform" ]; diff --git a/tools/RunScript.hx b/tools/RunScript.hx index ec93140187..c99fa87f37 100644 --- a/tools/RunScript.hx +++ b/tools/RunScript.hx @@ -202,17 +202,17 @@ class RunScript if (args.indexOf("-eval") >= 0) { args.remove("-eval"); - Log.info("Experimental: executing `lime " + args.slice(0, args.length - 1).join(" ") - + "` using Eval (https://haxe.org/blog/eval/)"); + Log.info("Experimental: executing `lime " + args.slice(0, args.length - 1).join(" ") + "` using Eval (https://haxe.org/blog/eval/)"); var args = [ - "-D", "lime", - "-cp", "tools", - "-cp", "tools/platforms", - "-cp", "src", - "-lib", "format", - "-lib", "hxp", - "--run", "CommandLineTools"].concat(args); + "-D", "lime", + "-cp", "tools", + "-cp", "tools/platforms", + "-cp", "src", + "-lib", "format", + "-lib", "hxp", + "--run", "CommandLineTools" + ].concat(args); Sys.exit(runCommand("", "haxe", args)); } diff --git a/tools/mpeg/audio/MpegAudioReader.hx b/tools/mpeg/audio/MpegAudioReader.hx index 91ba3f830b..81a0279828 100644 --- a/tools/mpeg/audio/MpegAudioReader.hx +++ b/tools/mpeg/audio/MpegAudioReader.hx @@ -102,14 +102,14 @@ class MpegAudioReader frames.push(frame); case Info(_): - // Discard info tag. + // Discard info tag. case GaplessInfo(giEncoderDelay, giEndPadding): encoderDelay = giEncoderDelay; endPadding = giEndPadding; case Unknown(_): - // Discard unknown bytes + // Discard unknown bytes case End: break; diff --git a/tools/platforms/AndroidPlatform.hx b/tools/platforms/AndroidPlatform.hx index 4d4caaaf12..ac64c0422a 100644 --- a/tools/platforms/AndroidPlatform.hx +++ b/tools/platforms/AndroidPlatform.hx @@ -307,7 +307,8 @@ class AndroidPlatform extends PlatformTarget // modified more recently than the .hxml, then the .hxml cannot be // considered valid anymore. it may cause errors in editors like vscode. if (FileSystem.exists(path) - && (project.projectFilePath == null || !FileSystem.exists(project.projectFilePath) + && (project.projectFilePath == null + || !FileSystem.exists(project.projectFilePath) || (FileSystem.stat(path).mtime.getTime() > FileSystem.stat(project.projectFilePath).mtime.getTime()))) { return File.getContent(path); @@ -363,8 +364,7 @@ class AndroidPlatform extends PlatformTarget public override function rebuild():Void { - var armv5 = (/*command == "rebuild" ||*/ - ArrayTools.containsValue(project.architectures, Architecture.ARMV5) + var armv5 = (/*command == "rebuild" ||*/ ArrayTools.containsValue(project.architectures, Architecture.ARMV5) || ArrayTools.containsValue(project.architectures, Architecture.ARMV6)); var armv7 = (command == "rebuild" || ArrayTools.containsValue(project.architectures, Architecture.ARMV7)); var arm64 = (command == "rebuild" || ArrayTools.containsValue(project.architectures, Architecture.ARM64)); @@ -478,23 +478,27 @@ class AndroidPlatform extends PlatformTarget context.ANDROID_USE_ANDROIDX = project.config.getString("android.useAndroidX", "true"); context.ANDROID_ENABLE_JETIFIER = project.config.getString("android.enableJetifier", "false"); - context.ANDROID_APPLICATION = project.config.getKeyValueArray("android.application", { - "android:label": project.meta.title, - "android:allowBackup": "true", - "android:theme": "@android:style/Theme.NoTitleBar" + (project.window.fullscreen ? ".Fullscreen" : ""), - "android:hardwareAccelerated": "true", - "android:allowNativeHeapPointerTagging": context.ANDROID_TARGET_SDK_VERSION >= 30 ? "false" : null - }); - context.ANDROID_ACTIVITY = project.config.getKeyValueArray("android.activity", { - "android:name": "MainActivity", - "android:exported": "true", - "android:launchMode": "singleTask", - "android:label": project.meta.title, - "android:configChanges": project.config.getArrayString("android.configChanges", - ["layoutDirection", "locale", "orientation", "uiMode", "screenLayout", "screenSize", "smallestScreenSize", "keyboard", "keyboardHidden", "navigation"]) - .join("|"), - "android:screenOrientation": project.window.orientation == PORTRAIT ? "sensorPortrait" : (project.window.orientation == LANDSCAPE ? "sensorLandscape" : null) - }); + context.ANDROID_APPLICATION = project.config.getKeyValueArray("android.application", + { + "android:label": project.meta.title, + "android:allowBackup": "true", + "android:theme": "@android:style/Theme.NoTitleBar" + (project.window.fullscreen ? ".Fullscreen" : ""), + "android:hardwareAccelerated": "true", + "android:allowNativeHeapPointerTagging": context.ANDROID_TARGET_SDK_VERSION >= 30 ? "false" : null + }); + context.ANDROID_ACTIVITY = project.config.getKeyValueArray("android.activity", + { + "android:name": "MainActivity", + "android:exported": "true", + "android:launchMode": "singleTask", + "android:label": project.meta.title, + "android:configChanges": project.config.getArrayString("android.configChanges", + [ + "layoutDirection", "locale", "orientation", "uiMode", "screenLayout", "screenSize", "smallestScreenSize", "keyboard", "keyboardHidden", + "navigation" + ]).join("|"), + "android:screenOrientation": project.window.orientation == PORTRAIT ? "sensorPortrait" : (project.window.orientation == LANDSCAPE ? "sensorLandscape" : null) + }); context.ANDROID_ACCEPT_FILE_INTENT = project.config.getArrayString("android.accept-file-intent", []); if (!project.environment.exists("ANDROID_SDK") || !project.environment.exists("ANDROID_NDK_ROOT")) @@ -581,7 +585,7 @@ class AndroidPlatform extends PlatformTarget && !context.HAS_ICON) { context.HAS_ICON = true; - context.ANDROID_APPLICATION.push({ key: "android:icon", value: "@drawable/icon" }); + context.ANDROID_APPLICATION.push({key: "android:icon", value: "@drawable/icon"}); } } diff --git a/tools/platforms/FlashPlatform.hx b/tools/platforms/FlashPlatform.hx index 21828d2a39..c3a835e59c 100644 --- a/tools/platforms/FlashPlatform.hx +++ b/tools/platforms/FlashPlatform.hx @@ -178,7 +178,8 @@ class FlashPlatform extends PlatformTarget // modified more recently than the .hxml, then the .hxml cannot be // considered valid anymore. it may cause errors in editors like vscode. if (FileSystem.exists(path) - && (project.projectFilePath == null || !FileSystem.exists(project.projectFilePath) + && (project.projectFilePath == null + || !FileSystem.exists(project.projectFilePath) || (FileSystem.stat(path).mtime.getTime() > FileSystem.stat(project.projectFilePath).mtime.getTime()))) { return File.getContent(path); @@ -314,20 +315,20 @@ class FlashPlatform extends PlatformTarget } /*private function getIcon (size:Int, targetPath:String):Void { - - var icon = icons.findIcon (size, size); - - if (icon != "") { - - System.copyIfNewer (icon, targetPath); - - } else { - - icons.updateIcon (size, size, targetPath); - - } - - }*/ + + var icon = icons.findIcon (size, size); + + if (icon != "") { + + System.copyIfNewer (icon, targetPath); + + } else { + + icons.updateIcon (size, size, targetPath); + + } + + }*/ public override function watch():Void { var hxml = getDisplayHXML(); diff --git a/tools/platforms/HTML5Platform.hx b/tools/platforms/HTML5Platform.hx index a5bbaf76b3..c61f512046 100644 --- a/tools/platforms/HTML5Platform.hx +++ b/tools/platforms/HTML5Platform.hx @@ -217,7 +217,8 @@ class HTML5Platform extends PlatformTarget // modified more recently than the .hxml, then the .hxml cannot be // considered valid anymore. it may cause errors in editors like vscode. if (FileSystem.exists(path) - && (project.projectFilePath == null || !FileSystem.exists(project.projectFilePath) + && (project.projectFilePath == null + || !FileSystem.exists(project.projectFilePath) || (FileSystem.stat(path).mtime.getTime() > FileSystem.stat(project.projectFilePath).mtime.getTime()))) { return File.getContent(path); diff --git a/tools/platforms/IOSPlatform.hx b/tools/platforms/IOSPlatform.hx index e13a9cdffd..edf916cc39 100644 --- a/tools/platforms/IOSPlatform.hx +++ b/tools/platforms/IOSPlatform.hx @@ -464,7 +464,8 @@ class IOSPlatform extends PlatformTarget // modified more recently than the .hxml, then the .hxml cannot be // considered valid anymore. it may cause errors in editors like vscode. if (FileSystem.exists(path) - && (project.projectFilePath == null || !FileSystem.exists(project.projectFilePath) + && (project.projectFilePath == null + || !FileSystem.exists(project.projectFilePath) || (FileSystem.stat(path).mtime.getTime() > FileSystem.stat(project.projectFilePath).mtime.getTime()))) { return File.getContent(path); diff --git a/tools/platforms/LinuxPlatform.hx b/tools/platforms/LinuxPlatform.hx index d6af573148..4df86f9f9d 100644 --- a/tools/platforms/LinuxPlatform.hx +++ b/tools/platforms/LinuxPlatform.hx @@ -228,7 +228,19 @@ class LinuxPlatform extends PlatformTarget if (project.targetFlags.exists("hlc")) { var compiler = project.targetFlags.exists("clang") ? "clang" : "gcc"; - var command = [compiler, "-O3", "-o", executablePath, "-std=c11", "-Wl,-rpath,$ORIGIN", "-I", Path.combine(targetDirectory, "obj"), Path.combine(targetDirectory, "obj/ApplicationMain.c"), "-L", applicationDirectory]; + var command = [ + compiler, + "-O3", + "-o", + executablePath, + "-std=c11", + "-Wl,-rpath,$ORIGIN", + "-I", + Path.combine(targetDirectory, "obj"), + Path.combine(targetDirectory, "obj/ApplicationMain.c"), + "-L", + applicationDirectory + ]; for (file in System.readDirectory(applicationDirectory)) { switch Path.extension(file) @@ -437,7 +449,8 @@ class LinuxPlatform extends PlatformTarget // modified more recently than the .hxml, then the .hxml cannot be // considered valid anymore. it may cause errors in editors like vscode. if (FileSystem.exists(path) - && (project.projectFilePath == null || !FileSystem.exists(project.projectFilePath) + && (project.projectFilePath == null + || !FileSystem.exists(project.projectFilePath) || (FileSystem.stat(path).mtime.getTime() > FileSystem.stat(project.projectFilePath).mtime.getTime()))) { return File.getContent(path); diff --git a/tools/platforms/MacPlatform.hx b/tools/platforms/MacPlatform.hx index 14d121ff91..b3ee4492ab 100644 --- a/tools/platforms/MacPlatform.hx +++ b/tools/platforms/MacPlatform.hx @@ -208,7 +208,18 @@ class MacPlatform extends PlatformTarget // compiler command with the `arch -x86_64` command. // if we ever support ARM or Universal binaries, this will // need to be handled differently. - var command = ["arch", "-x86_64", compiler, "-O3", "-o", executablePath, "-std=c11", "-I", Path.combine(targetDirectory, "obj"), Path.combine(targetDirectory, "obj/ApplicationMain.c")]; + var command = [ + "arch", + "-x86_64", + compiler, + "-O3", + "-o", + executablePath, + "-std=c11", + "-I", + Path.combine(targetDirectory, "obj"), + Path.combine(targetDirectory, "obj/ApplicationMain.c") + ]; for (file in System.readDirectory(executableDirectory)) { switch Path.extension(file) @@ -229,7 +240,12 @@ class MacPlatform extends PlatformTarget // when launched inside an .app file, the executable // can't find the library files unless we tell // it to search specifically from @executable_path - System.runCommand("", "install_name_tool", ["-change", Path.withoutDirectory(file), "@executable_path/" + Path.withoutDirectory(file), executablePath]); + System.runCommand("", "install_name_tool", [ + "-change", + Path.withoutDirectory(file), + "@executable_path/" + Path.withoutDirectory(file), + executablePath + ]); default: } } @@ -332,7 +348,10 @@ class MacPlatform extends PlatformTarget } } - if (System.hostPlatform != WINDOWS && targetType != "nodejs" && targetType != "java" && sys.FileSystem.exists(executablePath)) + if (System.hostPlatform != WINDOWS + && targetType != "nodejs" + && targetType != "java" + && sys.FileSystem.exists(executablePath)) { System.runCommand("", "chmod", ["755", executablePath]); } @@ -383,7 +402,8 @@ class MacPlatform extends PlatformTarget // modified more recently than the .hxml, then the .hxml cannot be // considered valid anymore. it may cause errors in editors like vscode. if (FileSystem.exists(path) - && (project.projectFilePath == null || !FileSystem.exists(project.projectFilePath) + && (project.projectFilePath == null + || !FileSystem.exists(project.projectFilePath) || (FileSystem.stat(path).mtime.getTime() > FileSystem.stat(project.projectFilePath).mtime.getTime()))) { return File.getContent(path); @@ -612,10 +632,7 @@ class MacPlatform extends PlatformTarget // these are the known directories where Homebrew installs its dependencies // we may need to add more in the future, but this seems to be enough for now - var homebrewDirs = [ - "/usr/local/opt/", - "/usr/local/Cellar/" - ]; + var homebrewDirs = ["/usr/local/opt/", "/usr/local/Cellar/"]; // first, collect all executables, hdlls, and dylibs that were built // by BuildHashlink.xml diff --git a/tools/platforms/TVOSPlatform.hx b/tools/platforms/TVOSPlatform.hx index 76714971c7..a094e67a66 100644 --- a/tools/platforms/TVOSPlatform.hx +++ b/tools/platforms/TVOSPlatform.hx @@ -375,7 +375,8 @@ class TVOSPlatform extends PlatformTarget // modified more recently than the .hxml, then the .hxml cannot be // considered valid anymore. it may cause errors in editors like vscode. if (FileSystem.exists(path) - && (project.projectFilePath == null || !FileSystem.exists(project.projectFilePath) + && (project.projectFilePath == null + || !FileSystem.exists(project.projectFilePath) || (FileSystem.stat(path).mtime.getTime() > FileSystem.stat(project.projectFilePath).mtime.getTime()))) { return File.getContent(path); diff --git a/tools/platforms/WebAssemblyPlatform.hx b/tools/platforms/WebAssemblyPlatform.hx index 0674c45b11..6446d806f5 100644 --- a/tools/platforms/WebAssemblyPlatform.hx +++ b/tools/platforms/WebAssemblyPlatform.hx @@ -118,7 +118,9 @@ class WebAssemblyPlatform extends PlatformTarget } var hxml = targetDirectory + "/haxe/" + buildType + ".hxml"; - var args = [hxml, "-D", "webassembly", "-D", "wasm", "-D", "emscripten", "-D", "webgl", "-D", "static_link"]; + var args = [ + hxml, "-D", "webassembly", "-D", "wasm", "-D", "emscripten", "-D", "webgl", "-D", "static_link" + ]; if (Log.verbose) { @@ -190,7 +192,9 @@ class WebAssemblyPlatform extends PlatformTarget } } - if (project.targetFlags.exists("final") || project.defines.exists("disable-exception-catching") || project.targetFlags.exists("disable-exception-catching")) + if (project.targetFlags.exists("final") + || project.defines.exists("disable-exception-catching") + || project.targetFlags.exists("disable-exception-catching")) { args.push("-s"); args.push("DISABLE_EXCEPTION_CATCHING=1"); @@ -363,7 +367,8 @@ class WebAssemblyPlatform extends PlatformTarget // modified more recently than the .hxml, then the .hxml cannot be // considered valid anymore. it may cause errors in editors like vscode. if (FileSystem.exists(path) - && (project.projectFilePath == null || !FileSystem.exists(project.projectFilePath) + && (project.projectFilePath == null + || !FileSystem.exists(project.projectFilePath) || (FileSystem.stat(path).mtime.getTime() > FileSystem.stat(project.projectFilePath).mtime.getTime()))) { return File.getContent(path); diff --git a/tools/platforms/WindowsPlatform.hx b/tools/platforms/WindowsPlatform.hx index c33d2519b9..6ff83e36cd 100644 --- a/tools/platforms/WindowsPlatform.hx +++ b/tools/platforms/WindowsPlatform.hx @@ -241,7 +241,15 @@ class WindowsPlatform extends PlatformTarget // start by finding visual studio var programFilesX86 = Sys.getEnv("ProgramFiles(x86)"); var vswhereCommand = programFilesX86 + "\\Microsoft Visual Studio\\Installer\\vswhere.exe"; - var vswhereOutput = System.runProcess("", vswhereCommand, ["-latest", "-products", "*", "-requires", "Microsoft.Component.MSBuild", "-property", "installationPath"]); + var vswhereOutput = System.runProcess("", vswhereCommand, [ + "-latest", + "-products", + "*", + "-requires", + "Microsoft.Component.MSBuild", + "-property", + "installationPath" + ]); var visualStudioPath = StringTools.trim(vswhereOutput); // then, find MSBuild inside visual studio var msBuildPath = visualStudioPath + "\\MSBuild\\Current\\Bin\\MSBuild.exe"; @@ -313,8 +321,7 @@ class WindowsPlatform extends PlatformTarget { ProjectHelper.copyLibrary(project, ndll, "Windows" + (is64 ? "64" : ""), "", ".hdll", applicationDirectory, project.debug, targetSuffix); - ProjectHelper.copyLibrary(project, ndll, "Windows" + (is64 ? "64" : ""), "", ".lib", applicationDirectory, project.debug, - ".lib"); + ProjectHelper.copyLibrary(project, ndll, "Windows" + (is64 ? "64" : ""), "", ".lib", applicationDirectory, project.debug, ".lib"); } else { @@ -356,7 +363,18 @@ class WindowsPlatform extends PlatformTarget var command:Array = null; if (project.targetFlags.exists("gcc")) { - command = ["gcc", "-O3", "-o", executablePath, "-std=c11", "-Wl,-subsystem,windows", "-I", Path.combine(targetDirectory, "obj"), Path.combine(targetDirectory, "obj/ApplicationMain.c"), "C:/Windows/System32/dbghelp.dll"]; + command = [ + "gcc", + "-O3", + "-o", + executablePath, + "-std=c11", + "-Wl,-subsystem,windows", + "-I", + Path.combine(targetDirectory, "obj"), + Path.combine(targetDirectory, "obj/ApplicationMain.c"), + "C:/Windows/System32/dbghelp.dll" + ]; for (file in System.readDirectory(applicationDirectory)) { switch Path.extension(file) @@ -373,13 +391,28 @@ class WindowsPlatform extends PlatformTarget // start by finding visual studio var programFilesX86 = Sys.getEnv("ProgramFiles(x86)"); var vswhereCommand = programFilesX86 + "\\Microsoft Visual Studio\\Installer\\vswhere.exe"; - var vswhereOutput = System.runProcess("", vswhereCommand, ["-latest", "-products", "*", "-requires", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", "-property", "installationPath"]); + var vswhereOutput = System.runProcess("", vswhereCommand, [ + "-latest", + "-products", + "*", + "-requires", + "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", + "-property", + "installationPath" + ]); var visualStudioPath = StringTools.trim(vswhereOutput); var vcvarsallPath = visualStudioPath + "\\VC\\Auxiliary\\Build\\vcvarsall.bat"; // this command sets up the environment variables and things that visual studio requires var vcvarsallCommand = [vcvarsallPath, "x64"].map(arg -> ~/([&|\(\)<>\^ ])/g.replace(arg, "^$1")); // this command runs the cl.exe c compiler from visual studio - var clCommand = ["cl.exe", "/Ox", "/Fe:" + executablePath, "-I", Path.combine(targetDirectory, "obj"), Path.combine(targetDirectory, "obj/ApplicationMain.c")]; + var clCommand = [ + "cl.exe", + "/Ox", + "/Fe:" + executablePath, + "-I", + Path.combine(targetDirectory, "obj"), + Path.combine(targetDirectory, "obj/ApplicationMain.c") + ]; for (file in System.readDirectory(applicationDirectory)) { switch Path.extension(file) @@ -692,7 +725,8 @@ class WindowsPlatform extends PlatformTarget // modified more recently than the .hxml, then the .hxml cannot be // considered valid anymore. it may cause errors in editors like vscode. if (FileSystem.exists(path) - && (project.projectFilePath == null || !FileSystem.exists(project.projectFilePath) + && (project.projectFilePath == null + || !FileSystem.exists(project.projectFilePath) || (FileSystem.stat(path).mtime.getTime() > FileSystem.stat(project.projectFilePath).mtime.getTime()))) { return File.getContent(path); diff --git a/tools/utils/PlatformSetup.hx b/tools/utils/PlatformSetup.hx index a9342e4ccd..2dd1bd5e06 100644 --- a/tools/utils/PlatformSetup.hx +++ b/tools/utils/PlatformSetup.hx @@ -366,8 +366,7 @@ class PlatformSetup setupAndroid(); case "blackberry": - - // setupBlackBerry (); + // setupBlackBerry (); case "html5": Log.println("\x1b[0;3mNo additional configuration is required.\x1b[0m"); @@ -392,15 +391,13 @@ class PlatformSetup } case "tizen": - - // setupTizen (); + // setupTizen (); case "webassembly", "wasm", "emscripten": setupWebAssembly(); case "webos": - - // setupWebOS (); + // setupWebOS (); case "electron": setupElectron();