Skip to content

Commit

Permalink
Some improvements describing supported OpenFL targets for certain APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtynjala committed Feb 12, 2024
1 parent 8aea40d commit c114edd
Show file tree
Hide file tree
Showing 23 changed files with 140 additions and 114 deletions.
2 changes: 1 addition & 1 deletion src/openfl/desktop/Clipboard.hx
Expand Up @@ -457,7 +457,7 @@ class Clipboard
use a handler function to provide the data for a file dragged from an
AIR application to the file system, the operating system calls the
data handler function as soon as the drag gesture leaves the AIR
application?typically resulting in an undesireable pause as the file
applicationtypically resulting in an undesireable pause as the file
data is downloaded or created. You can use a URLFilePromise for this
purpose instead.
Expand Down
22 changes: 19 additions & 3 deletions src/openfl/desktop/NativeApplication.hx
Expand Up @@ -9,7 +9,7 @@ import openfl.events.EventDispatcher;
import openfl.utils._internal.Lib;

/**
The NativeApplication class represents this AIR application.
The NativeApplication class represents this OpenFL application.
The NativeApplication class provides application information,
application-wide functions, and dispatches application-level events.
Expand Down Expand Up @@ -42,6 +42,8 @@ class NativeApplication extends EventDispatcher
`removeAsDefaultApplication()`, and `isSetAsDefaultApplication()` are
supported on the current platform.
_OpenFL target support:_ Not currently supported, except when targeting AIR.
If `true`, then the above methods will work as documented. If `false`,
then `setAsDefaultApplication()` and `removeDefaultApplication()` do
nothing and `isSetAsDefaultApplication()` returns `false`.
Expand All @@ -58,9 +60,11 @@ class NativeApplication extends EventDispatcher
}

/**
Indicates whether AIR supports dock-style application icons on the
Indicates whether OpenFL supports dock-style application icons on the
current operating system.
_OpenFL target support:_ Not currently supported, except when targeting AIR.
If `true`, the `NativeApplication.icon` property is of type `DockIcon`.
The Mac OS X user interface provides an application "dock" containing
Expand All @@ -83,6 +87,8 @@ class NativeApplication extends EventDispatcher
Specifies whether the current operating system supports a global
application menu bar.
_OpenFL target support:_ Not currently supported, except when targeting AIR.
When `true`, the `NativeApplication.menu` property can be used to
define (or access) a native application menu.
Expand All @@ -102,6 +108,8 @@ class NativeApplication extends EventDispatcher
/**
Indicates whether `startAtLogin` is supported on the current platform.
_OpenFL target support:_ Not currently supported, except when targeting AIR.
If `true`, then `startAtLogin` works as documented. If `false`, then
`startAtLogin` has no effect.
Expand All @@ -115,9 +123,11 @@ class NativeApplication extends EventDispatcher
}

/**
Specifies whether AIR supports system tray icons on the current
Specifies whether OpenFL supports system tray icons on the current
operating system.
_OpenFL target support:_ Not currently supported, except when targeting AIR.
If true, the `NativeApplication.icon` property is of type
`SystemTrayIcon`.
Expand Down Expand Up @@ -199,6 +209,8 @@ class NativeApplication extends EventDispatcher
/**
The application icon.
_OpenFL target support:_ Not currently supported, except when targeting AIR.
Use `NativeApplication.supportsDockIcon` and
`NativeApplication.supportsSystemTrayIcon` to determine the icon class.
The type will be one of the subclasses of InteractiveIcon. On macOS,
Expand Down Expand Up @@ -328,6 +340,8 @@ class NativeApplication extends EventDispatcher
Removes this application as the default for opening files with the
specified extension.
_OpenFL target support:_ Not currently supported, except when targeting AIR.
**Note:** This method can only be used with file types listed in the
fileTypes statement in the application descriptor.
**/
Expand All @@ -337,6 +351,8 @@ class NativeApplication extends EventDispatcher
Sets this application as the default application for opening files with
the specified extension.
_OpenFL target support:_ Not currently supported, except when targeting AIR.
**Note:** This method can only be used with file types declared in the
fileTypes statement in the application descriptor.
**/
Expand Down
20 changes: 11 additions & 9 deletions src/openfl/desktop/NativeProcess.hx
Expand Up @@ -35,14 +35,15 @@ import haxe.io.BytesOutput;

/**
The NativeProcess class provides command line integration and general
launching capabilities. The NativeProcess class lets an AIR application
execute native processes on the host operating system. The AIR applcation
can monitor the standard input (stdin) and standard output (stdout) stream
of the process as well as the process's standard error (stderr) stream.
launching capabilities. The NativeProcess class lets an OpenFL application
execute native processes on the host operating system. The OpenFL
application can monitor the standard input (stdin) and standard output
(stdout) stream of the process as well as the process's standard error
(stderr) stream.
The NativeProcess class and its capabilities are only available to Haxe
"sys" targets and AIR applications installed with a native installer
(extended desktop profile applications). When debugging an AIR application,
("extendedDesktop" profile applications). When debugging an AIR application,
you can pass the `-profile extendedDesktop` argument to ADL to enable the
NativeProcess functionality. At runtime, you can check the
`NativeProcess.isSupported` property to to determine whether native process
Expand All @@ -56,12 +57,13 @@ import haxe.io.BytesOutput;
class NativeProcess extends EventDispatcher
{
/**
ndicates if running native processes is supported in the current
profile. This property returns `true` only when running on Haxe "sys"
targets or the Adobe AIR extendedDesktop profile. In addition,
Indicates if running native processes is supported in the current
OpenFL target. This property returns `true` only when running on Haxe
"sys" targets or the Adobe AIR "extendedDesktop" profile. In addition,
`NativeProcess.isSupported` is always `false` for applications installed
as an `.air` file. You must package an AIR application using the ADT
`-target native` flag in order to use the NativeProcess class in AIR.
`-target native` flag or the `-target bundle` flag in order to use the
NativeProcess class in AIR.
**/
public static var isSupported(default, never):Bool = true;

Expand Down
6 changes: 3 additions & 3 deletions src/openfl/desktop/NativeProcessStartupInfo.hx
Expand Up @@ -9,9 +9,9 @@ import openfl.filesystem.File;
host operating system. It is constructed and passed to the `start()` method
of a NativeProcess object.
Native process access is only available to AIR applications installed with
native installers (applications in the extended desktop profile) and Haxe
"sys" targets.
Native process access is only available to Haxe "sys" targets and AIR
applications installed with native installers (applications in the
"extendedDesktop" profile).
**/
#if !openfl_debug
@:fileXml('tags="haxe,release"')
Expand Down
2 changes: 1 addition & 1 deletion src/openfl/display/InteractiveObject.hx
Expand Up @@ -43,7 +43,7 @@ import openfl.geom.Rectangle;
`click` event still occurs.
@event contextMenu Dispatched when a user gesture triggers the
context menu associated with this interactive
object in an AIR application.
object in an OpenFL application.
@event copy Dispatched when the user activates the
platform-specific accelerator key combination
for a copy operation or selects 'Copy' from
Expand Down
2 changes: 1 addition & 1 deletion src/openfl/display/NativeWindow.hx
Expand Up @@ -24,7 +24,7 @@ import openfl.geom.Point;
`NativeWindow.isSupported` property.
_OpenFL target support:_ This feature is supported on all desktop operating
systems, but is not support on mobile operating systems, including iOS and
systems, but is not supported on mobile operating systems, including iOS and
Android.
_Adobe AIR profile support:_ This feature is supported on all desktop
Expand Down
14 changes: 6 additions & 8 deletions src/openfl/display/Stage.hx
Expand Up @@ -268,7 +268,6 @@ class Stage extends DisplayObjectContainer #if lime implements IModule #end
**/
// @:noCompletion @:dox(hide) @:require(flash10) public var colorCorrection:openfl.display.ColorCorrection;
#end

#if false
/**
Specifies whether the Flash runtime is running on an operating system
Expand Down Expand Up @@ -312,14 +311,13 @@ class Stage extends DisplayObjectContainer #if lime implements IModule #end
A value from the StageDisplayState class that specifies which display
state to use. The following are valid values:
* `StageDisplayState.FULL_SCREEN` Sets AIR application or
Flash runtime to expand the stage over the user's entire screen, with
keyboard input disabled.
* `StageDisplayState.FULL_SCREEN_INTERACTIVE` Sets the AIR
* `StageDisplayState.FULL_SCREEN` Sets the OpenFL application to expand
the stage over the user's entire screen, with keyboard input disabled.
* `StageDisplayState.FULL_SCREEN_INTERACTIVE` Sets the OpenFL
application to expand the stage over the user's entire screen, with
keyboard input allowed.(Not available for content running in Flash
Player.)
* `StageDisplayState.NORMAL` Sets the Flash runtime back to
keyboard input allowed. (Not available for content running in Adobe
Flash Player.)
* `StageDisplayState.NORMAL` Sets the OpenFL application back to
the standard stage display mode.
Expand Down
21 changes: 10 additions & 11 deletions src/openfl/events/EventDispatcher.hx
Expand Up @@ -8,13 +8,12 @@ package openfl.events;
class allows any object on the display list to be an event target and as
such, to use the methods of the IEventDispatcher interface.
Event targets are an important part of the Flash<sup>®</sup> Player and
Adobe<sup>®</sup> AIR<sup>®</sup> event model. The event target serves as
the focal point for how events flow through the display list hierarchy.
When an event such as a mouse click or a keypress occurs, Flash Player or
the AIR application dispatches an event object into the event flow from the
root of the display list. The event object then makes its way through the
display list until it reaches the event target, at which point it begins
Event targets are an important part of the OpenFL event model. The event
target serves as the focal point for how events flow through the display
list hierarchy. When an event such as a mouse click or a keypress occurs,
the OpenFL application dispatches an event object into the event flow fro
the root of the display list. The event object then makes its way through
the display list until it reaches the event target, at which point it begins
its return trip through the display list. This round-trip journey to the
event target is conceptually divided into three phases: the capture phase
comprises the journey from the root to the last node before the event
Expand All @@ -29,14 +28,14 @@ package openfl.events;
EventDispatcher member, and write simple hooks to route calls into the
aggregated EventDispatcher.
@event activate [broadcast event] Dispatched when the Flash Player or AIR
application gains operating system focus and becomes
@event activate [broadcast event] Dispatched when the OpenFL application
gains operating system focus and becomes
active. This event is a broadcast event, which means that
it is dispatched by all EventDispatcher objects with a
listener registered for this event. For more information
about broadcast events, see the DisplayObject class.
@event deactivate [broadcast event] Dispatched when the Flash Player or AIR
application operating loses system focus and is becoming
@event deactivate [broadcast event] Dispatched when the OpenFL application
loses operating system focus and is becoming
inactive. This event is a broadcast event, which means
that it is dispatched by all EventDispatcher objects with
a listener registered for this event. For more
Expand Down
2 changes: 1 addition & 1 deletion src/openfl/filesystem/File.hx
Expand Up @@ -70,7 +70,7 @@ import lime.system.BackgroundWorker;
```
The application storage directory is particularly useful. It gives an application-specific
storage directory for the AIR application. It is defined by the File.applicationStorageDirectory
storage directory for the OpenFL application. It is defined by the File.applicationStorageDirectory
property.
@see [Related: FileStream](https://api.openfl.org/openfl/filesystem/FileStream.html)
Expand Down
3 changes: 2 additions & 1 deletion src/openfl/net/DatagramSocket.hx
Expand Up @@ -24,7 +24,8 @@ import sys.net.UdpSocket;
property.
_OpenFL target support:_ This feature is supported on all desktop operating
systems, on iOS, and on Android.
systems, on iOS, and on Android. This feature is not supported on the html5
target or other non-sys targets.
_Adobe AIR profile support:_ his feature is supported on all desktop
operating systems, on iOS (starting with AIR 3.8), and on Android (starting
Expand Down
2 changes: 1 addition & 1 deletion src/openfl/net/FileFilter.hx
Expand Up @@ -30,7 +30,7 @@ package openfl.net;
myFileReference.browse([imagesFilter, docFilter]);
```
Or in an AIR application:
Or in an OpenFL desktop application:
```haxe
var imagesFilter = new FileFilter("Images", "*.jpg;*.gif;*.png");
Expand Down
24 changes: 11 additions & 13 deletions src/openfl/net/FileReference.hx
Expand Up @@ -287,19 +287,17 @@ import js.Browser;
AIR runtime, the `select` event acts slightly
differently depending on what method invokes it.
When the `select` event is dispatched after a
`browse()` call, Flash Player or the AIR
application can read all the FileReference
object's properties, because the file selected
by the user is on the local file system. When
the `select` event occurs after a `download()`
call, Flash Player or the AIR application can
read only the `name` property, because the file
hasn't yet been downloaded to the local file
system at the moment the `select` event is
dispatched. When the file is downloaded and the
`complete` event dispatched, Flash Player or the
AIR application can read all other properties of
the FileReference object.
`browse()` call, the OpenFL application can read
all the FileReference object's properties, because
the file selected by the user is on the local file
system. When the `select` event occurs after a
`download()` call, the OpenFL application can read
only the `name` property, because the file hasn't
yet been downloaded to the local file system at the
moment the `select` event is dispatched. When the
file is downloaded and the `complete` even
dispatched, the OpenFL application can read all
other properties of the FileReference object.
@event uploadCompleteData Dispatched after data is received from the
server after a successful upload. This event is
not dispatched if data is not returned from the
Expand Down
3 changes: 2 additions & 1 deletion src/openfl/net/SecureSocket.hx
Expand Up @@ -30,7 +30,8 @@ import sys.ssl.Socket as SysSecureSocket;
You can test for support at run time using the `SecureSocket.isSupported`
property.
_OpenFL target support:_ This feature is not supported on all platforms.
_OpenFL target support:_ This feature is supported on all desktop operating
systems, on iOS, and on Android. It is not supported on non-sys targets.
_Adobe AIR profile support:_ This feature is supported on all desktop
operating systems, but is not supported on all AIR for TV devices. On mobile
Expand Down
9 changes: 5 additions & 4 deletions src/openfl/net/ServerSocket.hx
Expand Up @@ -23,7 +23,8 @@ import sys.net.Socket;
property.
_OpenFL target support:_ This feature is supported on all desktop operating
systems, on iOS, and on Android. This feature is not supported on html5.
systems, on iOS, and on Android. This feature is not supported on the html5
target or other non-sys targets.
_Adobe AIR profile support:_ This feature is supported on all desktop
operating systems, on iOS (starting with AIR 3.8), and on Android (starting
Expand All @@ -50,7 +51,7 @@ import sys.net.Socket;
serious network failure occurs). Any data sent over the connection is broken into transmittable
packets and reassembled on the other end. All packets are guaranteed to arrive (within reason) —
any lost packets are retransmitted. In general, the TCP protocol manages the available network
bandwidth better than the UDP protocol. Most AIR applications that require socket communications
bandwidth better than the UDP protocol. Most OpenFL applications that require socket communications
should use the ServerSocket and Socket classes rather than the DatagramSocket class.
The ServerSocket class can only be used in targets that support TCP.
Expand Down Expand Up @@ -96,8 +97,8 @@ class ServerSocket extends EventDispatcher
/**
Creates a ServerSocket object.
@throws SecurityError This error occurs ff the calling content is running outside the AIR
application security sandbox.
@throws SecurityError This error occurs if the calling content is
running outside the AIR application security sandbox.
**/
public function new()
{
Expand Down
4 changes: 4 additions & 0 deletions src/openfl/net/Socket.hx
Expand Up @@ -44,6 +44,10 @@ import sys.net.Socket as SysSocket;
A socket transmits and receives data asynchronously.
_OpenFL target support:_ This feature is supported on all desktop operating
systems, on iOS, and on Android. On the html5 target, it uses web sockets
instead of raw unix-style sockets.
On some operating systems, flush() is called automatically between
execution frames, but on other operating systems, such as Windows, the
data is never sent unless you call `flush()` explicitly. To ensure your
Expand Down
4 changes: 1 addition & 3 deletions src/openfl/net/URLRequest.hx
Expand Up @@ -19,19 +19,17 @@ import haxe.macro.Compiler;
from sources that are also at www.adobe.com. To load data from a different
domain, place a URL policy file on the server hosting the data.
However, in Adobe AIR, content in the application security sandbox
However, in Adobe AIR, content in the application security sandbox
(content installed with the AIR application) is not restricted by these
security limitations. For content running in Adobe AIR, files in the
application security sandbox can access URLs using any of the following URL
schemes:
* `http` and `https`
* `file`
* `app-storage`
* `app`
Content running in Adobe AIR that is not in the application security
sandbox observes the same restrictions as content running in the browser
(in Flash Player), and loading is governed by the content's domain and any
Expand Down
2 changes: 1 addition & 1 deletion src/openfl/net/URLRequestHeader.hx
Expand Up @@ -7,7 +7,7 @@ package openfl.net;
`requestHeaders` property of the URLRequest class.
In Adobe<sup>®</sup> AIR<sup>®</sup>, content in the application
security sandbox(such as content installed with the AIR application) can
security sandbox (such as content installed with the AIR application) can
use any request headers, without error. However, for content running in
Adobe AIR that is in a different security sandbox, or for content running
in Flash<sup>®</sup> Player, using following request headers cause a
Expand Down

0 comments on commit c114edd

Please sign in to comment.