The following modules are included in the standard distribution and can be loaded at run-time with mod.load() in Fluid or LoadModule() in C/C++.
Use the navigation bar on the right to peruse the available functionality of the selected module.
Beginners should start with the Core module, which includes the bulk of Parasol's functionality.
Grants access to memory blocks by identifier.
Parameter | Description |
---|---|
Memory | The ID of the memory block to access. |
Flags | Set to READ , WRITE or READ_WRITE . |
MilliSeconds | The millisecond interval to wait before a timeout occurs. Use at least 40ms for best results. |
Result | Must refer to an APTR for storing the resolved address. |
Call AccessMemory() to resolve a memory ID to its address and acquire a lock so that it is inaccessible to other threads.
Memory blocks should never be locked for extended periods of time. Ensure that all locks are matched with a call to ReleaseMemory() within the same code block.
Okay | Operation successful. |
---|---|
Args | The MilliSeconds value is less or equal to zero. |
TimeOut | Function timed-out before successful completion. |
MemoryDoesNotExist | The supplied Memory ID does not refer to an existing memory block. |
SystemLocked | Part of the system is unreachable due to a persistent lock. |
NullArgs | Function call missing argument value(s) |
Grants exclusive access to objects via unique ID.
Parameter | Description |
---|---|
Object | The unique ID of the target object. |
MilliSeconds | The limit in milliseconds before a timeout occurs. The maximum limit is 60000 , and 100 is recommended. |
Result | A pointer storage variable that will store the resulting object address. |
This function resolves an object ID to its address and acquires a lock on the object so that other threads cannot use it simultaneously.
If the Object
is already locked, the function will wait until it becomes available. This must occur within the amount of time specified in the Milliseconds
parameter. If the time expires, the function will return with an ERR::TimeOut
error code. If successful, ERR::Okay
is returned and a reference to the object's address is stored in the Result
variable.
It is crucial that calls to AccessObject() are followed with a call to ReleaseObject() once the lock is no longer required. Calls to AccessObject() will also nest, so they must be paired with ReleaseObject() correctly.
It is recommended that C++ developers use the ScopedObjectLock
class to acquire object locks rather than making direct calls to AccessObject(). The following example illustrates lock acquisition within a 1 second time limit:
{ pf::ScopedObjectLockobj(my_object_id, 1000); if (lock.granted()) { obj.acDraw(); } }
Okay | Operation successful. |
---|---|
TimeOut | Function timed-out before successful completion. |
SystemLocked | Part of the system is unreachable due to a persistent lock. |
NoMatchingObject | No matching object was found for the given object ID. |
NullArgs | Function call missing argument value(s) |
This function is responsible for executing action routines.
Parameter | Description |
---|---|
Action | An action or method ID must be specified. |
Object | The target object. |
Parameters | Optional parameter structure associated with Action . |
This function is the key entry point for executing actions and method routines. An action is a predefined function call that can be called on any object, while a method is a function call that is specific to a class implementation. You can find a complete list of available actions and their associated details in the Parasol Wiki. The actions and methods supported by any class will be referenced in their auto-generated documentation.
Here are two examples that demonstrate how to make an action call. The first performs an activation, which does not require any additional arguments. The second performs a move operation, which requires three additional arguments to be passed to the Action() function:
1. Action(AC::Activate, Picture, NULL); 2. struct acMove move = { 30, 15, 0 }; Action(AC::Move, Window, &move);
In all cases, action calls in C++ can be simplified by using their corresponding stub functions:
1. acActivate(Picture); 2a. acMove(Window, 30, 15, 0); 2b. Window->move(30, 15, 0);
If the class of an object does not support the Action
ID, an error code of ERR::NoSupport
is returned. To test an object to see if its class supports an action, use the CheckAction() function.
Okay | Operation successful. |
---|---|
NoAction | The Action is not supported by the object's supporting class. |
IllegalActionID | The Action parameter is invalid. |
ObjectCorrupt | The Object state is corrupted. |
NullArgs | Function call missing argument value(s) |
Returns a pointer to the global action table.
Parameter | Description |
---|---|
Actions | A pointer to the Core's action table struct ActionTable * is returned. Please note that the first entry in the ActionTable list has all fields driven to NULL , because valid action ID's start from one, not zero. The final action in the list is also terminated with NULL fields in order to indicate an end to the list. Knowing this is helpful when scanning the list or calculating the total number of actions supported by the Core. |
Size | Total number of elements in the returned list. |
This function returns an array of all actions supported by the Core, including name, arguments and structure size. The ID of each action is indicated by its index within the array.
The Name
field specifies the name of the action. The Args
field refers to the action's argument definition structure, which lists the argument names and their relevant types. This is matched by the Size
field, which indicates the byte-size of the action's related argument structure. If the action does not support arguments, the Args
and Size
fields will be set to NULL
. The following illustrates two argument definition examples:
struct FunctionField argsCopyData[] = { { "Destination", FD_LONG }, { NULL, 0 } }; struct FunctionField argsResize[] = { { "Width", FD_DOUBLE }, { "Height", FD_DOUBLE }, { "Depth", FD_DOUBLE }, { NULL, 0 } };
The argument types that can be used by actions are limited to those listed in the following table:
Name | Description |
---|---|
FD::LONG | A 32-bit integer value ranging from -2,147,483,647 to 2,147,483,648. |
FD::LARGE | A 64-bit integer value. |
FD::PTR | A standard address space pointer. |
FD::STRING | A pointer to a null-terminated string. |
FD::DOUBLE | A 64-bit floating point value. |
FD::OBJECT | This flag is sometimes set in conjunction with the FD_LONG type. It indicates that the argument refers to an object ID. |
FD::PTRSIZE | This argument type can only be used if it follows an FD_PTR type, and if the argument itself is intended to reflect the size of the buffer referred to by the previous FD_PTR argument. |
FD::RESULT | This special flag is set in conjunction with the other data-based argument types. Example: If the developer is required to supply a pointer to a LONG field in which the function will store a result, the correct argument definition will be FD_RESULT|FD_LONG|FD_PTR . To make the definition of these argument types easier, FD_PTRRESULT and FD_LONGRESULT macros are also available for use. |
Adds new tags to FileInfo structures.
Parameter | Description |
---|---|
Info | Pointer to a valid FileInfo structure. |
Name | The name of the tag, which must be declared in camel-case. |
Value | The value to associate with the tag name. If NULL , any existing tag with a matching Name will be removed. |
This function adds file tags to FileInfo structures. It is intended for use by the Core and external drivers only. Tags allow extended attributes to be associated with a file, for example the number of seconds of audio in an MP3 file.
Okay | Operation successful. |
---|---|
NullArgs | Function call missing argument value(s) |
Adds a new message handler for processing incoming messages.
Parameter | Description |
---|---|
Custom | A custom pointer that will be passed to the message handler when messages are received. |
MsgType | The message type that the handler wishes to intercept. If zero, all incoming messages are passed to the handler. |
Routine | Refers to the function that will handle incoming messages. |
Handle | The resulting handle of the new message handler - retain for FreeResource(). |
This function allows handlers to be added for the interception of incoming messages. Message handling works as follows:
During a call to ProcessMessages(), each incoming message will be scanned to determine if a message handler is able to process that message. All handlers that accept the message type will be called with a copy of the message structure and any additional data. The message is then removed from the message queue.
When calling AddMsgHandler(), you can provide an optional Custom
pointer that will have meaning to the handler. The MsgType
acts as a filter so that only messages with the same type identifier will be passed to the handler. The Routine
parameter must point to the function handler, which will follow this definition:
ERR handler(APTR Custom, LONG MsgID, LONG MsgType, APTR Message, LONG MsgSize)
The handler must return ERR::Okay
if the message was handled. This means that the message will not be passed to message handlers that are yet to receive the message. Throw ERR::NothingDone
if the message has been ignored or ERR::Continue
if the message was processed but may be analysed by other handlers. Throw ERR::Terminate
to break the current ProcessMessages() loop. When using Fluid, this is best achieved by writing check(errorcode)
in the handler.
The handler will be identified by a unique pointer returned in the Handle parameter. This handle will be garbage collected or can be passed to FreeResource() once it is no longer required.
Okay | Message handler successfully processed. |
---|---|
AllocMemory | A call to AllocMemory() failed to create a new memory block. |
NullArgs | Function call missing argument value(s) |
Adjusts the base-line of all log messages.
Parameter | Description |
---|---|
Delta | The level of adjustment to make to new log messages. Zero is no change. The maximum level is +/- 6. |
This function adjusts the detail level of all outgoing log messages. To illustrate, setting the Delta
value to 1 would result in level 5 (API) log messages being bumped to level 6. If the user's maximum log level output is 5, no further API messages will be output until the base-line is reduced to normal.
The main purpose of AdjustLogLevel() is to reduce log noise. For instance, creating a new desktop window will result in a large number of new log messages. Raising the base-line by 2 before creating the window would eliminate the noise if the user has the log level set to 5 (API). Re-running the program with a log level of 7 or more would make the messages visible again.
Adjustments to the base-line are accumulative, so small increments of 1 or 2 are encouraged. To revert logging to the previous base-line, call this function again with a negation of the previously passed value.
Returns the absolute base-line value that was active prior to calling this function.
Allocates a new memory block on the heap.
Parameter | Description |
---|---|
Size | The size of the memory block. |
Flags | Optional flags. |
Address | Refer to an APTR to store the address of the allocated memory block. |
ID | Refer to a MEMORYID to store the UID of the allocated memory block. |
The AllocMemory() function will allocate a new block of memory on the program's heap. The client will need to define the minimum byte Size
, optional Flags
and a variable to store the resulting Address
and/or ID
of the memory block. For example:
APTR address; if (!AllocMemory(1000, MEM::DATA, &address, NULL)) { ... FreeResource(address); }
A number of flag definitions are available that affect the memory allocation process. They are:
Name | Description |
---|---|
MEM::AUDIO | The memory space is reserved by an audio device such as a sound card. |
MEM::CALLER | This flag is usable only in routines that are supporting a class method. It forces the memory allocation to be tracked to the object that made the method call. This is particularly important in methods that return memory blocks that do not form a part of the object itself. |
MEM::CODE | Set if the memory will contain executable program code. |
MEM::DATA | The default type, DATA , is used to indicate a standard memory allocation from system RAM. |
MEM::HIDDEN | Hidden blocks are not recorded and are excluded from resource tracking. |
MEM::MANAGED | Enables custom resource management for the memory block. The start of the block will need to be reserved with a pointer to a ResourceManager structure, which is included as part of the block's declared Size. The Free() callback will be called when the block is removed. |
MEM::NO_BLOCK | Permanently turn off all accesses to this memory block. This means that multiple threads can have full read/write access to the memory block at once regardless of other acces flags. |
MEM::NO_BLOCKING | Permanently turn off all accesses to this memory block. This means that multiple threads can have full read/write access to the memory block at once regardless of other acces flags. |
MEM::NO_CLEAR | Do not clear the memory on allocation (saves time). |
MEM::NO_LOCK | For AllocMemory() only, indicates that the (private) memory block should not be locked on return. |
MEM::NO_POOL | Gives a hint to the allocator to allocate the block outside of the memory pool. |
MEM::READ | The memory is explicitly marked as readable. |
MEM::READ_WRITE | Synonym for READ | WRITE |
MEM::STRING | Identifies the memory content as a null terminated string. Useful for debugging and run-time type identification in scripts. |
MEM::TEXTURE | The memory space is reserved by a video driver for hosting texture graphics. |
MEM::TMP_LOCK | Enables temporary locking restrictions. Prevents processes from sleeping while holding a lock on the memory block. |
MEM::UNTRACKED | Allocating an untracked memory block will prevent the memory block from being tracked back to the object holding the current context. |
MEM::VIDEO | The memory space is reserved by a video device such as a graphics card for display purposes, e.g. framebuffer. |
MEM::WRITE | The memory is explicitly marked as writeable. |
Notice that memory allocation can be returned as an address pointer and/or as a unique memory ID. Typically a private address with no ID reference is sufficient.
If the client retrieves both the ID and Address pointer, an internal call will be made to AccessMemory() to lock the memory block. This means that before freeing the memory block the client must call ReleaseMemory() to unlock it. Blocks that are persistently locked will remain in memory until the process is terminated.
Memory that is allocated through AllocMemory() is automatically cleared with zero-byte values. When allocating large blocks it may be wise to turn off this feature, achieved by setting the MEM::NO_CLEAR
flag.
Okay | Operation successful. |
---|---|
Failed | The block could not be allocated due to insufficient memory space. |
Args | Invalid arguments passed to function. |
ArrayFull | Although memory space for the block was available, all available memory records are in use. |
AccessMemory | The block was allocated but access to it was not granted, causing failure. |
Generates unique ID's for general purposes.
Parameter | Description |
---|---|
Type | The type of ID that is required. |
This function generates unique ID's that can be used in other Core functions. A Type
indicator is required and the resulting number will be unique to that Type
only.
ID allocations are permanent, so there is no need to free the allocated ID once it is no longer required.
A unique ID matching the requested type will be returned. This function can return zero if the Type is unrecognised, or if an internal error occurred.
Analyses paths to determine their type (file, folder or volume).
Parameter | Description |
---|---|
Path | The path to analyse. |
Type | The result will be stored in the variable referred to by this parameter. The return types are DIRECTORY , FILE and VOLUME . Set this parameter to NULL if you are only interested in checking if the file exists. |
This function will analyse a path and determine the type of file that the path is referring to. For instance, a path of user:documents/
would indicate a folder reference. A path of system:
would be recognised as a volume. A path of user:documents/copyright.txt
would be recognised as a file.
Ambiguous references are analysed to get the correct type - for example user:documents/helloworld
could refer to a folder or file, so the path is analysed to check the file type. On exceptional occasions where the path could be interpreted as either a folder or a file, preference is given to the folder.
File path approximation is supported if the Path
is prefixed with a ~
character (e.g. ~pictures:photo
could be matched to photo.jpg
in the same folder).
To check if a volume name is valid, call ResolvePath() first and then pass the resulting path to this function.
If the queried path does not exist, a fail code is returned. This behaviour makes the AnalysePath() function a good candidate for testing the validity of a path string.
Okay | The path was analysed and the result is stored in the Type variable. |
---|---|
DoesNotExist | Resource does not exist. |
NullArgs | Function call missing argument value(s) |
Execute an action in parallel, via a separate thread.
Parameter | Description |
---|---|
Action | An action or method ID must be specified here. |
Object | A pointer to the object that is going to perform the action. |
Args | If the action or method is documented as taking parameters, provide the correct parameter structure here. |
Callback | This function will be called after the thread has finished executing the action. |
This function follows the same principles of execution as the Action() function, with the difference of executing the action in parallel via a dynamically allocated thread. Please refer to the Action() function for general information on action execution.
To receive feedback of the action's completion, use the Callback
parameter and supply a function. The prototype for the callback routine is callback(ACTIONID ActionID, OBJECTPTR Object, ERR Error, APTR Meta)
It is crucial that the target object is not destroyed while the thread is executing. Use the Callback
routine to receive notification of the thread's completion and then free the object if desired. The callback will be processed when the main thread makes a call to ProcessMessages(), so as to maintain an orderly execution process within the application.
The 'Error' parameter in the callback reflects the error code returned by the action after it has been called. Note that if AsyncAction() fails, the callback will never be executed because the thread attempt will have been aborted.
Please note that there is some overhead involved when safely initialising and executing a new thread. This function is at its most effective when used to perform lengthy processes such as the loading and parsing of data.
Okay | Operation successful. |
---|---|
Init | Error in Init()ialising an object. |
IllegalMethodID | Illegal method ID (number outside of valid range). |
MissingClass | The class could not be found in the system. |
NewObject | A call to NewObject() failed to produce a new object. |
NullArgs | Function call missing argument value(s) |
Broadcast an event to all event listeners in the system.
Parameter | Description |
---|---|
Event | Pointer to an event structure. |
EventSize | The size of the Event structure, in bytes. |
Use BroadcastEvent() to broadcast an event to all listeners for that event in the system. An event structure is required that must start with a 64-bit EventID
acquired from GetEventID(), followed by any required data that is relevant to that event. Here are some examples:
typedef struct { EVENTID EventID; char Name[1]; } evVolumeCreated; typedef struct { EVENTID EventID; OBJECTID TaskID; } evTaskCreated; typedef struct { EVENTID EventID; OBJECTID TaskID; OBJECTID ProcessID; } evTaskRemoved;
Okay | Operation successful. |
---|---|
NullArgs | Function call missing argument value(s) |
Checks objects to see whether or not they support certain actions.
Parameter | Description |
---|---|
Object | The target object. |
Action | A registered action or method ID. |
This function returns ERR::True
if an object's class supports a given action or method ID. For example:
if (CheckAction(pic, AC::Query) IS ERR::True) { // The Query action is supported. }
True | The object supports the specified action. |
---|---|
False | The action is not supported. |
LostClass | The object has lost its class reference. |
NullArgs | Function call missing argument value(s) |
Checks if a memory block still exists.
Parameter | Description |
---|---|
ID | The ID of the memory block that will be checked. |
Use CheckMemoryExists() to confirm if a specific memory block still exists by referencing its ID
.
Okay | The block exists. |
---|---|
False | The block does not exist. |
Checks if a particular object is still available in the system.
Parameter | Description |
---|---|
Object | The object identity to verify. |
The CheckObjectExists() function verifies the presence of any object created by NewObject().
True | The object exists. |
---|---|
False | The object ID does not exist. |
LockFailed | Failed to lock a required resource. |
Checks if two file paths refer to the same physical file.
Parameter | Description |
---|---|
PathA | File location 1. |
PathB | File location 2. |
This function will test two file paths, checking if they refer to the same file in a storage device. It uses a string comparison on the resolved path names, then attempts a second test based on an in-depth analysis of file attributes if the string comparison fails. In the event of a match, ERR::Okay
is returned. All other error codes indicate a mis-match or internal failure.
The targeted paths do not have to refer to an existing file or folder in order to match (i.e. match on string comparison succeeds).
Okay | The file paths refer to the same file. |
---|---|
False | The file paths refer to different files. |
NullArgs | Function call missing argument value(s) |
Makes copies of folders and files.
Parameter | Description |
---|---|
Source | The source location. |
Dest | The destination location. |
Callback | Optional callback for receiving feedback during the operation. |
This function is used to copy files and folders to new locations. When copying folders it will do so recursively, so as to copy all sub-folders and files within the location.
It is important that you are aware that different types of string formatting can give different results. The following examples illustrate:
Copying parasol:makefile
to parasol:documents
results in a file called parasol:documents
.
Copying parasol:makefile
to parasol:documents/
results in a file called parasol:documents/makefile
.
Copying parasol:pictures/
to parasol:documents/
results in a folder at parasol:documents/pictures
and includes a copy of all folders and files found within the pictures folder.
Copying parasol:pictures/
to parasol:documents
results in a folder at parasol:documents
(if the documents folder already exists, it receives additional content from the pictures folder).
This function will overwrite any destination file(s) that already exist.
The Source parameter should always clarify the type of location that is being copied. For example if copying a folder, a forward slash must terminate the string or it will be assumed that a file is the source.
The Callback parameter can be set with a function that matches this prototype:
LONG Callback(struct FileFeedback *)
For each file that is processed during the copy operation, a &FileFeedback structure is passed that describes the source file and its target. The callback must return a constant value that can potentially affect file processing. Valid values are FFR::Okay
(copy the file), FFR::Skip
(do not copy the file) and FFR::Abort
(abort the process completely and return ERR::Cancelled
as an error code).
Okay | The source was copied to its destination successfully. |
---|---|
Failed | A failure occurred during the copy process. |
Args | Invalid arguments passed to function. |
Makes new folders.
Parameter | Description |
---|---|
Path | The location of the folder. |
Permissions | Security permissions to apply to the created Dir(s). Set to NULL if only the current user should have access. |
This function creates new folders. You are required to specify the full path of the new folder. Standard permission flags can be passed to determine the new permissions to set against the newly created Dir(s). If no permission flags are passed, only the current user will have access to the new folder (assuming that the file system supports security settings on the given media). This function will create multiple folders if the complete path does not exist at the time of the call.
On Unix systems you can define the owner and group ID's for the new folder by calling the SetDefaultPermissions() function prior to CreateFolder().
Okay | Operation successful. |
---|---|
Failed | General failure. |
NoSupport | Virtual file system does not support folder creation. |
FileExists | An identically named file or folder already exists at the Path . |
NullArgs | Function call missing argument value(s) |
Creates symbolic links on Unix file systems.
Parameter | Description |
---|---|
From | The symbolic link will be created at the location specified here. |
To | The file that you are linking to is specified here. |
Use the CreateLink() function to create symbolic links on Unix file systems. The link connects a new file created at From
to an existing file referenced at To
. The To
link is allowed to be relative to the From
location - for instance, you can link documents:myfiles/newlink.txt
to ../readme.txt
or folder/readme.txt
. The ..
path component must be used when making references to parent folders.
The permission flags for the link are inherited from the file that you are linking to. If the file location referenced at From
already exists as a file or folder, the function will fail with an ERR::FileExists
error code.
This function does not automatically create folders in circumstances where new folders are required to complete the From
link. You will need to call CreateFolder() to ensure that the necessary paths exist beforehand. If the file referenced at To does not exist, the link will be created without error, but any attempts to open the link will fail until the target file or folder exists.
Okay | The link was created successfully. |
---|---|
NoSupport | The file system or the host operating system does not support symbolic links. |
Memory | General memory error. |
LowCapacity | There is no room on the device to create the new link. |
NoPermission | The user does not have permission to create the link, or the file system is mounted read-only. |
BufferOverflow | One or both of the provided arguments is too long. |
FileExists | The location referenced at From already exists. |
ResolvePath | A volume could not be resolved. |
NullArgs | Function call missing argument value(s) |
Returns a pointer to the object that has the current context.
This function returns a pointer to the object that has the current context. Context is primarily used to manage resource allocations. Manipulating the context is sometimes necessary to ensure that a resource is tracked to the correct object.
To get the context of the caller (the client), use ParentContext().
Returns an object pointer (of which the process has exclusive access to). Cannot return NULL
except in the initial start-up and late shut-down sequence of the Core.
Returns the active Task object.
This function returns the Task object of the active process.
If there is a legitimate circumstance where there is no current task (e.g. if this function is called during Core initialisation) then the "system task" may be returned, which has ownership of Core resources.
Returns a pointer to the current Task object or NULL if failure.
Deletes files and folders.
Parameter | Description |
---|---|
Path | String referring to the file or folder to be deleted. Folders must be denoted with a trailing slash. |
Callback | Optional callback for receiving feedback during the operation. |
This function will delete a file or folder when given a valid file location. The current user must have delete access to the given file. When deleting folders, all content will be scanned and deleted recursively. Individual deletion failures are ignored, although an error will be returned if the top-level folder still contains content on its deletion.
This function does not allow for the approximation of file names. To approximate a file location, open it as a File object or use ResolvePath() first.
The Callback
parameter can be set with a function that matches the prototype LONG Callback(struct FileFeedback *)
.
Prior to the deletion of any file, a &FileFeedback structure is passed that describes the file's location. The callback must return a constant value that can potentially affect file processing. Valid values are FFR::Okay
(delete the file), FFR::Skip
(do not delete the file) and FFR::Abort
(abort the process completely and return ERR::Cancelled
as an error code).
Okay | The file or folder was deleted successfully. |
---|---|
File | The location could not be opened for deletion. |
FileNotFound | File not found. |
NoSupport | The filesystem driver does not support deletion. |
NullArgs | Function call missing argument value(s) |
Deletes volumes from the system.
Parameter | Description |
---|---|
Name | The name of the volume. |
This function deletes volume names from the system. Once a volume is deleted, any further references to it will result in errors unless the volume is recreated.
Okay | The volume was removed. |
---|---|
LockFailed | Failed to lock a required resource. |
NoPermission | An attempt to delete a system volume was denied. |
NullArgs | Function call missing argument value(s) |
Resolves a field ID to its registered name.
Parameter | Description |
---|---|
FieldID | The unique field hash to resolve. |
Resolves a field identifier to its name. For this to work successfully, the field must have been registered with the internal dictionary. This is handled automatically when a new class is added to the system.
If the FieldID
is not registered, the value is returned back as a hex string. The inclusion of this feature guarantees that an empty string will never be returned.
The name of the field is returned.
Returns all class objects for a given class ID.
Parameter | Description |
---|---|
ClassID | A class ID such as one retrieved from ResolveClassName(). |
This function will find a specific class by ID and return its MetaClass. If the class is not in memory, the internal dictionary is checked to discover a module binary registered with that ID. If this succeeds, the module is loaded into memory and the class will be returned. In any event of failure, NULL
is returned.
If the ID of a named class is not known, call ResolveClassName() first and pass the resulting ID to this function.
Returns a pointer to the MetaClass structure that has been found as a result of the search, or NULL
if no matching class was found.
Finds field descriptors for any class, by ID.
Parameter | Description |
---|---|
Object | The target object. |
FieldID | The 'FID' number to lookup. |
Target | (Optional) The object that represents the field is returned here (in case a field belongs to an integrated child object). |
The FindField() function checks if an object supports a specified field by scanning its class descriptor for a FieldID
. If a matching field is declared, its descriptor is returned. For example:
if (auto field = FindField(Display, FID_Width, NULL)) { log.msg("The field name is \"%s\".", field->Name); }
The resulting Field structure is immutable.
Note: To lookup the field definition of a MetaClass, use the MetaClass.FindField() method.
Returns a pointer to the Field descriptor, otherwise NULL
if not found.
Searches for objects by name.
Parameter | Description |
---|---|
Name | The name of an object to search for. |
ClassID | Optional. Set to a class ID to filter the results down to a specific class type. |
Flags | Optional flags. |
ObjectID | An object id variable for storing the result. |
The FindObject() function searches for all objects that match a given name and can filter by class.
The following example is a typical illustration of this function's use. It finds the most recent object created with a given name:
OBJECTID id; FindObject("SystemPointer", CLASSID::POINTER, 0, &id);
If FindObject() cannot find any matching objects then it will return an error code.
Okay | At least one matching object was found and stored in the ObjectID . |
---|---|
Search | No objects matching the given name could be found. |
Args | Invalid arguments passed to function. |
LockFailed | Failed to lock a required resource. |
EmptyString | A required string value contains no characters. |
DoesNotExist | Resource does not exist. |
Frees resources originating from AllocMemory().
Parameter | Description |
---|---|
ID | The unique ID of the memory block. |
This function will free any resource that originates from AllocMemory(), using its ID
for identification. C++ headers also include a variant of this function that allows a direct memory pointer to be used as the identifier (however we do recommend the use of IDs to improve memory safety).
In some circumstances the termination of the block will not take place immediately. If the block is locked then it will be marked for deletion and not be collected until the lock count reaches zero.
Crash protection measures are built-in. If the memory header or tail is missing from the block, it is assumed that code has over-written the memory boundaries. All caught errors are reported to the application log and warrant priority attention.
Okay | The memory block was freed or marked for deletion. |
---|---|
InvalidData | The bounds of the block are damaged. |
MemoryDoesNotExist | Memory block does not exist. |
NullArgs | Function call missing argument value(s) |
Generates 32-bit CRC checksum values.
Parameter | Description |
---|---|
CRC | If streaming data to this function, this value should reflect the most recently returned CRC integer. Otherwise set to zero. |
Data | The data to generate a CRC value for. |
Length | The length of the Data buffer. |
This function is used internally for the generation of 32-bit CRC checksums. You may use it for your own purposes to generate CRC values over a length of buffer space. This function may be called repeatedly by feeding it previous CRC values, making it ideal for processing streamed data.
Returns the computed 32 bit CRC value for the given data.
Returns a message structure if called from an action that was executed by the message system.
This function is for use by action and method support routines only. It will return a Message structure if the action currently under execution has been called directly from the ProcessMessages() function. In all other cases a NULL
pointer is returned.
The Message structure reflects the contents of a standard GetMessage() call. Of particular interest may be the Time
field, which indicates the time-stamp at which the action message was originally sent to the object.
A Message structure is returned if the function is called in valid circumstances, otherwise NULL
. The Message structure's fields are described in the GetMessage() function.
Returns the class ID of an ID-referenced object.
Parameter | Description |
---|---|
Object | The object to be examined. |
Call this function with any valid object ID to learn the identifier for its base class. This is the quickest way to retrieve the class of an object without having to gain exclusive access to the object first.
Note that if the object's pointer is already known, the quickest way to learn of its class is to call the classID()
C++ method.
Returns the base class ID of the object or zero if failure.
Translates error codes into human readable strings.
Parameter | Description |
---|---|
Error | The error code to lookup. |
The GetErrorMsg() function converts error codes into human readable strings. If the Error
is invalid, a string of "Unknown error code" is returned.
A human readable string for the error code is returned. By default error codes are returned in English, however if a translation table exists for the user's own language, the string will be translated.
Generates unique event ID's suitable for event broadcasting.
Parameter | Description |
---|---|
Group | The group to which the event belongs. |
SubGroup | The sub-group to which the event belongs (case-sensitive). |
Event | The name of the event (case-sensitive). |
Use GetEventID() to generate a 64-bit event identifier. This identifier can be used for broadcasting and subscribing to events. Events are described in three parts - Group
, SubGroup
and the Event
name, or in string format group.subgroup.event
.
The Group
is strictly limited to one of the following definitions:
Name | Description |
---|---|
EVG::ANDROID | Android specific events that do not already fit existing categories. |
EVG::APP | Custom event dispatched from an application |
EVG::AUDIO | Audio system events. |
EVG::CLASS | Custom event dispatched from a class that doesn't fit within the rest of the event framework |
EVG::DISPLAY | Video display events. |
EVG::FILESYSTEM | File system events. |
EVG::GUI | Events generated by the Graphical User Interface. |
EVG::HARDWARE | Hardware device events that are not covered by other types. |
EVG::IO | Input/Output events. |
EVG::NETWORK | Network events. |
EVG::POWER | Power Management - can also include app-specific events relating to resource management. |
EVG::SYSTEM | System-wide events |
EVG::USER | User activity events (such as user login). |
The SubGroup
and Event
parameters are string-based and there are no restrictions on naming. If a SubGroup
or Event
name is NULL
, this will act as a wildcard for subscribing to multiple events. For example, subscribing to the network group with SubGroup
and Event
set to NULL
will allow for a subscription to all network events that are broadcast. A Group
setting of zero is not allowed.
The event ID is returned as a 64-bit integer.
Retrieves single field values from objects.
Parameter | Description |
---|---|
Object | Pointer to an object. |
Field | The ID of the field to read, OR'd with a type indicator. |
Result | Pointer to the variable that will store the result. |
The GetField() function is used to read field values from objects in the safest way possible. As long as the requested field exists, the value can most likely be read. It is only imperative that the requested type is compatible with the field value itself.
The following code segment illustrates how to read values from an object:
GetField(Object, FID_X|TLONG, &x); GetField(Object, FID_Y|TLONG, &y);
As GetField() is based on field ID's that reflect field names (FID
's), you will find that there are occasions where there is no reserved ID for the field that you wish to read. To convert field names into their relevant IDs, call the C++ strihash()
function. Reserved field ID's are listed in the parasol/system/fields.h
include file.
The type of the Result
parameter must be OR'd into the Field
parameter. When reading a field you must give consideration to the type of the source, in order to prevent a type mismatch from occurring. All numeric types are compatible with each other and strings can also be converted to numeric types automatically. String and pointer types are interchangeable.
Available field types are as follows:
Name | Description |
---|---|
TLONG | A 32-bit integer value. |
TDOUBLE | A 64-bit floating point value. |
TLARGE | A 64-bit integer value. |
TPTR | A standard 32-bit address space pointer. |
TSTR | A 32-bit pointer that refers to a string. |
Okay | The Field value was read successfully. |
---|---|
Args | Invalid arguments were specified. |
NoFieldAccess | Permissions for this field indicate that it is not readable. |
UnsupportedField | The Field is not supported by the object's class. |
Retrieves array field values from objects.
Parameter | Description |
---|---|
Object | Pointer to an object. |
Field | The ID of the field that will be read. |
Result | A direct pointer to the array values will be returned in this parameter. |
Elements | The total number of elements in the array will be returned in this parameter. |
Use the GetFieldArray() function to read an array field from an object, including the length of that array. This supplements the GetField() function, which does not support returning the array length.
This function returns the array as-is with no provision for type conversion. If the array is null terminated, it is standard practice not to count the null terminator in the total returned by Elements
.
To achieve a minimum level of type safety, the anticipated type of array values can be specified by OR'ing a field type with the field identifier, e.g. TLONG
or TSTR
. If no type is incorporated then a check will not be performed.
Okay | Operation successful. |
---|---|
NoFieldAccess | Permissions for this field indicate that it is not readable. |
UnsupportedField | The Field is not supported by the object's class. |
Mismatch | A mis-match has been detected that prevents further processing. |
NullArgs | Function call missing argument value(s) |
Retrieves field values by converting them into strings.
Parameter | Description |
---|---|
Object | Pointer to an object. |
Field | The name of the field that is to be retrieved. |
Buffer | Pointer to a buffer space large enough to hold the expected field value. If the buffer is not large enough, the result will be truncated. A buffer of 256 bytes is considered large enough for most occasions. For generic field reading purposes, a buffer as large as 64kb may be desired. |
Size | The size of the Buffer that has been provided, in bytes. |
The GetFieldVariable() function is used to retrieve the value of a field without any advance knowledge of the field's type or details. It also supports some advanced features such as flag name lookups and the retrieval of values from array indexes. Although this function is simple to use, it is the slowest of the field retrieval instructions as it relies on string-based field names and converts all results into a string buffer that you must provide.
This function does not support pointer based fields as they cannot be translated, although an exception is made for string field types.
If the field name refers to a flag or lookup based field type, it is possible to test if a specific flag has been set. This is achieved by specifying a dot immediately after the field name, then the name of the flag or lookup to test. If the test passes, a value of 1
is returned, otherwise 0
.
String conversion for flag and lookup based fields is also supported (by default, integer values are returned for these field types when no other test is applied). This feature is enabled by prefixing the field name with a $
symbol. If multiple fields are set, the resulting flags will be separated with the traditional OR symbol |
.
If the field name refers to an array, it is possible to index specific values within that array by specifying a dot after the field name, then the index number to lookup.
To check if a string is defined (rather than retrieving the entire string content which can be time consuming), prefix the Field
name with a question mark. A value of 1
will be returned in the Buffer
if the string has a minimum length of 1
character, otherwise a value of 0
is returned in the Buffer.
Okay | The field was value retrieved. |
---|---|
Args | Invalid arguments passed to function. |
NoFieldAccess | Permissions for this field state that it is not readable. |
UnsupportedField | The requested field is not supported by the object's class. |
Mismatch | The field value cannot be converted into a string. |
Reads messages from message queues.
Parameter | Description |
---|---|
Type | Filter down to this message type or set to zero to receive the next message on the queue. |
Flags | This argument is reserved for future use. Set it to zero. |
Buffer | Pointer to a buffer that is large enough to hold the incoming message information. If set to NULL then all accompanying message data will be destroyed. |
Size | The byte-size of the buffer that you have supplied. |
The GetMessage() function is used to read messages that have been stored in the local message queue. You can use this function to read the next immediate message stored on the queue, or the first message on the queue that matches a particular Type. It is also possible to call this function in a loop to clear out all messages, until an error code other than ERR::Okay
is returned.
Messages will often (although not always) carry data that is relevant to the message type. To retrieve this data you need to supply a Buffer
, preferably one that is large enough to receive all the data that you expect from your messages. If the Buffer
is too small, the message data will be trimmed to fit.
Message data is written to the supplied buffer with a Message structure, which is immediately followed up with the actual message data.
Okay | Operation successful. |
---|---|
Search | No more messages are left on the queue, or no messages that match the given Type are on the queue. |
Args | Invalid arguments passed to function. |
AccessMemory | Failed to gain access to the message queue. |
Returns a direct pointer for any object ID.
Parameter | Description |
---|---|
Object | The ID of the object to lookup. |
This function translates an object ID to its respective address pointer.
The address of the object is returned, or NULL
if the ID does not relate to an object.
Returns the unique ID of an object's owner.
Parameter | Description |
---|---|
Object | The ID of an object to query. |
This function returns an identifier for the owner of any valid object. This is the fastest way to retrieve the owner of an object if only the ID is known.
If the object address is already known then the fastest means of retrieval is via the ownerID()
C++ class method.
Returns the ID of the object's owner. If the object does not have a owner (i.e. if it is untracked) or if the provided ID is invalid, this function will return NULL.
Retrieves miscellaneous resource identifiers.
Parameter | Description |
---|---|
Resource | The ID of the resource that you want to obtain. |
The GetResource() function is used to retrieve miscellaneous resource information from the system core. Refer to the Resource identifier for the full list of available resource codes and their meaning.
C++ developers should use the GetResourcePtr()
macro if a resource identifier is known to return a pointer.
Returns the value of the resource that you have requested. If the resource ID is not known by the Core, NULL
is returned.
Returns miscellaneous data values from the Core.
The GetSystemState() function is used to retrieve miscellaneous resource and environment values, such as resource paths, the Core's version number and the name of the host platform.
A read-only SystemState structure is returned.
Analyse a file and identify a class that can process it.
Parameter | Description |
---|---|
Path | The location of the object data. |
Filter | Restrict the search to classes in this subset, or use CLASSID::NIL to search all classes. |
Class | Must refer to a CLASSID variable that will store the resulting class ID. |
SubClass | Optional argument that can refer to a variable that will store the resulting sub-class ID (if the result is a base-class, this variable will receive a value of zero). |
This function examines the relationship between file data and Parasol classes. For instance, a JPEG file would be identified as a datatype of the Picture class. An MP3 file would be identified as a datatype of the Sound class.
The method involves analysing the Path
's file extension and comparing it to the supported extensions of all available classes. If a class supports the file extension, the ID of that class will be returned. If the file extension is not listed in the class dictionary or if it is listed more than once, the first 80 bytes of the file's data will be loaded and checked against classes that can match against file header information. If a match is found, the ID of the matching class will be returned.
The ERR::Search
code is returned if a suitable class does not match the targeted file.
Okay | Operation successful. |
---|---|
Search | A suitable class could not be found for the data source. |
FileNotFound | File not found. |
Args | Invalid arguments passed to function. |
Read | Error reading data from file. |
Initialises an object so that it is ready for use.
Parameter | Description |
---|---|
Object | The object to initialise. |
This function initialises objects so that they can be used for their intended purpose. Initialisation is compulsory, and a client may not call any actions or methods on an object until it has been initialised. Exceptions to this rule only apply to the GetKey()
and SetKey()
actions.
If the initialisation of an object fails due to a support problem (for example, if a PNG Picture object attempts to load a JPEG file), the initialiser will search for a sub-class that can handle the data. If a sub-class that can support the object's configuration is available, the object's interface will be shared between both the base-class and the sub-class.
If an object does not support the data or its configuration, an error code of ERR::NoSupport
will be returned. Other appropriate error codes can be returned if initialisation fails.
Okay | The object was initialised. |
---|---|
LostClass | The object has lost its class reference. |
DoubleInit | Warning - Attempt to initialise an object twice. |
ObjectCorrupt | The object structure is corrupt or has not been initialised. |
Returns a list of all children belonging to an object.
Parameter | Description |
---|---|
Object | An object to query. |
List | Must refer to an array of ChildEntry structures. |
The ListChildren() function returns a list of all children belonging to an object. The client must provide an empty vector of ChildEntry structures to host the results, which include unique object ID's and their class identifiers.
Note that any child objects marked with the LOCAL
flag will be excluded because they are private members of the targeted object.
Okay | Zero or more children were found and listed. |
---|---|
Args | Invalid arguments passed to function. |
LockFailed | Failed to lock a required resource. |
NullArgs | Function call missing argument value(s) |
Loads files into a local cache for fast file processing.
Parameter | Description |
---|---|
Path | The location of the file to be cached. |
Flags | Optional flags are specified here. |
Cache | A pointer to a CacheFile structure is returned here if successful. |
The LoadFile() function loads complete files into memory and caches the content for use by other areas of the system or application.
This function will first determine if the requested file has already been cached. If this is true then the CacheFile structure is returned immediately. Note that if the file was previously cached but then modified, this will be treated as a cache miss and the file will be loaded into a new buffer.
File content will be loaded into a readable memory buffer that is referenced by the Data field of the CacheFile structure. A hidden null byte is appended at the end of the buffer to assist the processing of text files. Other pieces of information about the file can be derived from the CacheFile meta data.
Calls to LoadFile() must be matched with a call to UnloadFile() to decrement the cache counter. When the counter returns to zero, the file can be unloaded from the cache during the next resource collection phase.
Okay | The file was cached successfully. |
---|---|
Search | If CHECK_EXISTS is specified, this failure indicates that the file is not cached. |
AllocMemory | A call to AllocMemory() failed to create a new memory block. |
NullArgs | Function call missing argument value(s) |
Lock an object to prevent contention between threads.
Parameter | Description |
---|---|
Object | The address of the object to lock. |
MilliSeconds | The total number of milliseconds to wait before giving up. If -1 , the function will wait indefinitely. |
Use LockObject() to gain exclusive access to an object at thread-level. This function provides identical behaviour to that of AccessObject(), but with a slight speed advantage as the object ID does not need to be resolved to an address. Calls to LockObject() will nest, and must be matched with a call to ReleaseObject() to unlock the object.
Be aware that while this function is faster than AccessObject(), it is unsafe if other threads could terminate the object without a suitable barrier in place.
If it is guaranteed that an object is not being shared between threads, object locking is unnecessary.
Okay | Operation successful. |
---|---|
TimeOut | Function timed-out before successful completion. |
MarkedForDeletion | A resource cannot be accessed as it is marked for deletion. |
SystemLocked | Part of the system is unreachable due to a persistent lock. |
NullArgs | Function call missing argument value(s) |
Returns information on memory ID's.
This function returns the attributes of a memory block, including the start address, parent object, memory ID, size and flags. The following example illustrates correct use of this function:
MemInfo info; if (!MemoryIDInfo(memid, &info)) { log.msg("Memory block #%d is %d bytes large.", info.MemoryID, info.Size); }
If the call fails, the MemInfo structure's fields will be driven to NULL
and an error code is returned.
Okay | Operation successful. |
---|---|
Args | Invalid arguments passed to function. |
MemoryDoesNotExist | Memory block does not exist. |
SystemLocked | Part of the system is unreachable due to a persistent lock. |
NullArgs | Function call missing argument value(s) |
Returns information on memory addresses.
This function can be used to get details on the attributes of a memory block. It will return information on the start address, parent object, memory ID, size and flags of the memory address that you are querying. The following code segment illustrates correct use of this function:
MemInfo info; if (!MemoryPtrInfo(ptr, &info)) { log.msg("Address %p is %d bytes large.", info.Start, info.Size); }
If the call to MemoryPtrInfo() fails then the MemInfo structure's fields will be driven to NULL
and an error code will be returned.
Please note that referencing by a pointer requires a slow reverse-lookup to be employed in this function's search routine. We recommend that calls to this function are avoided unless circumstances absolutely require it.
Okay | Operation successful. |
---|---|
MemoryDoesNotExist | Memory block does not exist. |
NullArgs | Function call missing argument value(s) |
Moves folders and files to new locations.
Parameter | Description |
---|---|
Source | The source path. |
Dest | The destination path. |
Callback | Optional callback for receiving feedback during the operation. |
This function is used to move files and folders to new locations. It can also be used for renaming purposes and is able to move data from one type of media to another. When moving folders, any contents within the folder will also be moved across to the new location.
It is important that you are aware that different types of string formatting can give different results. The following examples illustrate:
Source Destination Result parasol:makefile parasol:documents parasol:documents parasol:makefile parasol:documents/ parasol:documents/makefile parasol:pictures/ parasol:documents/ parasol:documents/pictures parasol:pictures/ parasol:documents parasol:documents (Existing documents folder destroyed)
This function will overwrite the destination location if it already exists.
The Source
argument should always clarify the type of location that is being copied - e.g. if you are copying a folder, you must specify a forward slash at the end of the string or the function will assume that you are moving a file.
The Callback
parameter can be set with a function that matches this prototype:
LONG Callback(struct FileFeedback *)
For each file that is processed during the move operation, a FileFeedback structure is passed that describes the source file and its target. The callback must return a constant value that can potentially affect file processing. Valid values are FFR::Okay
(move the file), FFR::Skip
(do not move the file) and FFR::Abort
(abort the process completely and return ERR::Cancelled
as an error code).
Okay | Operation successful. |
---|---|
Failed | General failure. |
NullArgs | Function call missing argument value(s) |
Creates new objects.
Parameter | Description |
---|---|
ClassID | A class ID from system/register.h or generated by ResolveClassName(). |
Flags | Optional flags. |
Object | Pointer to an address variable that will store a reference to the new object. |
The NewObject() function is used to create new objects and register them for use within the Core. After creating a new object, the client can proceed to set the object's field values and initialise it with Init so that it can be used as intended.
The new object will be modeled according to the class blueprint indicated by ClassID
. Pre-defined class ID's are defined in their documentation and the parasol/system/register.h
include file. ID's for unregistered classes can be computed using the ResolveClassName() function.
A pointer to the new object will be returned in the Object
parameter. By default, object allocations are context sensitive and will be collected when their owner is terminated. It is possible to track an object to a different owner by using the SetOwner() function.
To destroy an object, call FreeResource().
Okay | Operation successful. |
---|---|
MissingClass | The ClassID is invalid or refers to a class that is not installed. |
AllocMemory | A call to AllocMemory() failed to create a new memory block. |
NullArgs | Function call missing argument value(s) |
Used to send notification messages to action subscribers.
Parameter | Description |
---|---|
Object | Pointer to the object that is to receive the notification message. |
Action | The action ID for notification. |
Args | Pointer to an action parameter structure that is relevant to the Action ID. |
Error | The error code that is associated with the action result. |
This function can be used by classes that need total control over notification management. It allows an action to notify its subscribers manually, rather than deferring to the system default of notifying on return.
Another useful feature is that parameter values can be customised for the recipients.
NOTE: Calling NotifySubscribers() does nothing to prevent the core from sending out an action notification as it normally would, thus causing duplication. To prevent this, the client must logical-or the return code of the action function with ERR::Notified
, e.g. ERR::Okay|ERR::Notified
.
Opens a folder for content scanning.
The OpenDir() function is used to open a folder for scanning via the ScanDir() function. If the provided Path can be accessed, a DirInfo structure will be returned in the Info parameter, which will need to be passed to ScanDir(). Once the scanning process is complete, call the FreeResource() function.
When opening a folder, it is necessary to indicate the type of files that are of interest. If no flags are defined, the scanner will return file and folder names only. Only a subset of the available RDF
flags may be used, namely SIZE
, DATE
, PERMISSIONS
, FILE
, FOLDER
, QUALIFY
, TAGS
.
Okay | Operation successful. |
---|---|
DirEmpty | The folder is empty. |
Args | Invalid arguments passed to function. |
AllocMemory | A call to AllocMemory() failed to create a new memory block. |
NullArgs | Function call missing argument value(s) |
Returns the context of the client.
This function is used to return the context of the caller (the client), as opposed to CurrentContext(), which returns the operating context. This feature is commonly used by methods that need to acquire a reference to the client for resource management reasons.
Note that this function can return NULL
if called when running at process-level, although this would never be the case when called from an action or method.
An object reference is returned, or NULL
if there is no parent context.
Returns the current system time, in microseconds.
This function returns the current 'system time' in microseconds (1 millionth of a second). The value is monotonic if the host platform allows it (typically expressed as the amount of time that has elapsed since the system was switched on). The benefit of monotonic time is that it is unaffected by changes to the system clock, such as daylight savings adjustments or manual changes by the user.
Returns the system time in microseconds. Could return zero in the extremely unlikely event of an error.
Processes system messages that are queued in the task's message buffer.
Parameter | Description |
---|---|
Flags | Optional flags are specified here (clients should set a value of zero). |
TimeOut | A TimeOut value, measured in milliseconds. If zero, the function will return as soon as all messages on the queue are processed. If less than zero, the function does not return until a request for termination is received or a user message requires processing. |
The ProcessMessages() function is used to process the task's message queue. Messages are dispatched to message handlers in the order in which they arrived and the queue is emptied so that space is available for more messages.
Responding to incoming messages is a vital process - the queue is the standard means of communication between your task and the rest of the system and other tasks within it. Failing to call the ProcessMessages() function on a regular basis may cause a back-log of messages to be generated, as well as causing problems with areas such as the graphical interface. If an area of your program is likely to loop continuously for a measurable period of time without returning, consider calling ProcessMessages() at a rate of 50 times per second to ensure that incoming messages are processed.
User messages that are on the queue are passed to message handlers. If no message handler exists to interpret the message, then it is removed from the queue without being processed. Message handlers are added with the AddMsgHandler() function. If a message handler returns the error code ERR::Terminate
, then ProcessMessages() will stop processing the queue and returns immediately with ERR::Okay
.
If a message with a MSGID_QUIT
ID is found on the queue, then the function returns immediately with the error code ERR::Terminate
. The program must respond to the terminate request by exiting immediately.
Okay | Operation successful. |
---|---|
Terminate | A MSGID_QUIT message type was found on the message queue. |
TimeOut | Function timed-out before successful completion. |
Delay the execution of an action by adding the call to the message queue.
Parameter | Description |
---|---|
Action | The ID of an action or method to execute. |
Object | The target object. |
Args | The relevant argument structure for the Action , or NULL if not required. |
Use QueueAction() to execute an action by way of the local message queue. This means that the supplied Action
and Args
will be combined into a message for the queue. This function then returns immediately.
The action will be executed on the next cycle of ProcessMessages() in line with the FIFO order of queued messages.
Okay | Operation successful. |
---|---|
Failed | General failure. |
OutOfRange | The Action ID is invalid. |
IllegalMethodID | Illegal method ID (number outside of valid range). |
MissingClass | The class could not be found in the system. |
NoMatchingObject | No matching object was found for the given object ID. |
NullArgs | Function call missing argument value(s) |
Reads a file into a buffer.
Parameter | Description |
---|---|
Path | The path of the file. |
Buffer | Pointer to a buffer that will receive the file content. |
BufferSize | The byte size of the Buffer . |
Result | The total number of bytes read into the Buffer will be returned here (optional). |
This function provides a simple method for reading file content into a Buffer
. In some cases this procedure may be optimised for the host platform, which makes it the fastest way to read file content in simple cases.
File path approximation is supported if the Path
is prefixed with a ~
character (e.g. ~pictures:photo
could be matched to photo.jpg
in the same folder).
Okay | Operation successful. |
---|---|
File | File error, e.g. file not found. |
Args | Invalid arguments passed to function. |
Read | Error reading data from file. |
InvalidPath | Invalid file or folder path detected. |
OpenFile | The file could not be opened. |
NullArgs | Function call missing argument value(s) |
Read a named tag from a FileInfo structure.
Parameter | Description |
---|---|
Info | Pointer to a valid FileInfo structure. |
Name | The name of the tag, which must be declared in camel-case as tags are case-sensitive. |
Value | The discovered string value is returned here if found. |
ReadInfoTag() will read the value of a named tag in a FileInfo structure. The tag must have been added with AddInfoTag() or ERR::NotFound
will be returned.
Okay | Operation successful. |
---|---|
NotFound | A search routine in this function failed. |
NullArgs | Function call missing argument value(s) |
Reallocates memory blocks.
Parameter | Description |
---|---|
Memory | Pointer to a memory block obtained from AllocMemory(). |
Size | The size of the new memory block. |
Address | Point to an APTR variable to store the resulting pointer to the new memory block. |
ID | Point to a MEMORYID variable to store the resulting memory block's unique ID. |
This function is used to reallocate memory blocks to new lengths. You can shrink or expand a memory block as you wish. The data of your original memory block will be copied over to the new block. If the new block is of a larger size, the left-over bytes will be populated with zero-byte values. If the new block is smaller, you will lose some of the original data.
The original block will be destroyed as a result of calling this function unless the reallocation process fails, in which case your existing memory block will remain valid.
Okay | Operation successful. |
---|---|
Args | Invalid arguments passed to function. |
Memory | The memory block to be re-allocated is invalid. |
AllocMemory | A call to AllocMemory() failed to create a new memory block. |
NullArgs | Function call missing argument value(s) |
Registers a file descriptor for monitoring when the task is asleep.
Parameter | Description |
---|---|
FD | The file descriptor that is to be watched. |
Flags | Set to at least one of READ , WRITE , EXCEPT , REMOVE . |
Routine | The routine that will read from the descriptor when data is detected on it. The prototype is void Routine(HOSTHANDLE FD, APTR Data) . |
Data | User specific data pointer that will be passed to the Routine . Separate data pointers apply to the read and write states of operation. |
This function will register a file descriptor that will be monitored for activity when the task is sleeping. When activity occurs on the descriptor, the callback referenced in Routine
will be called. The callback should read all information from the descriptor, as the process will not be able to sleep if data is back-logged.
The file descriptor should be configured as non-blocking before registration. Blocking descriptors may cause the program to hang if not handled carefully.
File descriptors support read and write states simultaneously, and a callback routine can be applied to either state. Set the RFD::READ
flag to apply the Routine
to the read callback and RFD::WRITE
for the write callback. If neither flag is specified, RFD::READ
is assumed. A file descriptor may have up to one subscription per flag, for example a read callback can be registered, followed by a write callback in a second call. Individual callbacks can be removed by combining the read/write flags with RFD::REMOVE
.
The capabilities of this function and FD handling in general is developed to suit the host platform. On POSIX compliant systems, standard file descriptors are used. In Microsoft Windows, object handles are used and blocking restrictions do not apply, except to sockets.
Call the DeregisterFD()
macro to simplify unsubscribing once the file descriptor is no longer needed or is destroyed.
Okay | The FD was successfully registered. |
---|---|
Args | The FD was set to a value of -1 . |
NoSupport | The host platform does not support the provided FD . |
Releases a lock from a memory based resource.
Parameter | Description |
---|---|
MemoryID | A reference to a memory resource for release. |
Successful calls to AccessMemory() must be paired with a call to ReleaseMemory() so that the memory can be made available to other processes. Releasing the resource decreases the access count, and if applicable a thread that is in the queue for access may then be able to acquire a lock.
Okay | Operation successful. |
---|---|
Search | A search routine in this function failed. |
SystemLocked | Part of the system is unreachable due to a persistent lock. |
NullArgs | Function call missing argument value(s) |
Release a locked object.
Parameter | Description |
---|---|
Object | Pointer to the object to be released. |
Release a lock previously obtained from AccessObject() or LockObject(). Locks will nest, so a release is required for every lock that has been granted.
Resolve a valid CLASSID to its name.
Parameter | Description |
---|---|
ID | The ID of the class that needs to be resolved. |
This function will resolve a valid class ID to its equivalent name. The name is resolved by checking the class database, so the class must be registered in the database for this function to return successfully.
Registration is achieved by ensuring that the class is compiled into the build.
Returns the name of the class, or NULL
if the ID is not recognised. Standard naming conventions apply, so it can be expected that the string is capitalised and without spaces, e.g. NetSocket
.
Resolves any class name to a CLASSID UID.
Parameter | Description |
---|---|
Name | The name of the class that requires resolution. |
This function will resolve a class Name
to its CLASSID
UID and verifies that the class is installed. It is case insensitive.
Returns the class ID identified from the class name, or NULL
if the class could not be found.
Converts a group ID to its corresponding name.
Parameter | Description |
---|---|
Group | The group ID. |
This function converts group ID's obtained from the file system into their corresponding names. If the Group
ID is invalid then NULL
will be returned.
The group name is returned, or NULL
if the ID cannot be resolved.
Converts volume-based paths into absolute paths applicable to the host platform.
Parameter | Description |
---|---|
Path | The path to be resolved. |
Flags | Optional flags. |
Result | Must point to a std::string variable so that the resolved path can be stored. If NULL , ResolvePath() will work as normal and return a valid error code without the result string. |
This function will convert a file path to its resolved form, according to the host system. For example, a Linux system might resolve drive1:documents/readme.txt
to /documents/readme.txt
. A Windows system might resolve the path to c:\documents\readme.txt
.
The resulting path is guaranteed to be absolute, meaning the use of sequences such as ..
, //
and ./
will be eliminated.
If the path can be resolved to more than one file, ResolvePath() will attempt to discover the correct path by checking the validity of each possible location. For instance, if resolving a path of user:document.txt
and the user:
volume refers to both system:users/joebloggs/
and system:users/default/
, the routine will check both directories for the existence of the document.txt
file to determine the correct location. This approach can be problematic if the intent is to create a new file, in which case RSF::NO_FILE_CHECK
will circumvent it.
When checking the file location, ResolvePath() requires an exact match to the provided file name. If the file name can be approximated (i.e. the file extension can be ignored) then use the RSF::APPROXIMATE
flag.
To resolve the location of executable programs on Unix systems, use the RSF::PATH
flag. This uses the PATH
environment variable to resolve the file name specified in the Path
parameter.
The resolved path will be copied to the std::string
provided in the Result
parameter. This will overwrite any existing content in the string.
Name | Description |
---|---|
RSF::APPROXIMATE | Ignores file extensions for the purpose of file name matching. |
RSF::CASE_SENSITIVE | For use on host systems that use case-insensitive file systems such as Windows; this option checks that the discovered file is a case-sensitive match to the Path. |
RSF::CHECK_VIRTUAL | If the volume referenced by Path is traced to another volume that is reserved by a virtual file system driver, ERR::VirtualVolume is returned. The volume is still resolved as far as possible and the resulting path will be returned by this function. |
RSF::NO_DEEP_SCAN | Do not perform more than one iteration when resolving the source file path. |
RSF::NO_FILE_CHECK | Do not test for the existence of the targeted file or folder during the resolution process. |
RSF::PATH | Use the PATH environment variable to resolve the file name in the Path parameter. |
If the path resolves to a virtual drive, it may not be possible to confirm whether the target file exists if the virtual driver does not support this check. This is common when working with network drives.
Okay | The Path was resolved. |
---|---|
Search | The given volume does not exist. |
FileNotFound | The path was resolved, but the referenced file or folder does not exist (use NO_FILE_CHECK to avoid this error code). |
LockFailed | Failed to lock a required resource. |
AllocMemory | The result string could not be allocated. |
Loop | The volume refers back to itself. |
NullArgs | Invalid parameters were specified. |
Converts a user ID to its corresponding name.
Parameter | Description |
---|---|
User | The user ID. |
This function converts user ID's obtained from the file system into their corresponding names. If the User
ID is invalid then NULL
will be returned.
The user name is returned, or NULL
if the ID cannot be resolved.
Scans the content of a folder, by item.
Parameter | Description |
---|---|
Info | Pointer to a DirInfo structure for storing scan results. |
The ScanDir() function is used to scan for files and folders in a folder that you have opened using the OpenDir() function. The ScanDir() function is intended to be used in a simple loop, returning a single item for each function call that you make. The following code sample illustrates typical usage:
DirInfo *info; if (!OpenDir(path, RDF::FILE|RDF::FOLDER, &info)) { while (!ScanDir(info)) { log.msg("File: %s", info->Name); } FreeResource(info); }
For each item that you scan, you will be able to read the Info structure for information on that item. The DirInfo structure contains a FileInfo pointer that consists of the following fields:
The RDF
flags that may be returned in the Flags field are VOLUME
, FOLDER
, FILE
, LINK
.
Okay | An item was successfully scanned from the folder. |
---|---|
DirEmpty | There are no more items to scan. |
Args | Invalid arguments passed to function. |
Scans a message queue for multiple occurrences of a message type.
Parameter | Description |
---|---|
Handle | Pointer to a 32-bit value that must initially be set to zero. The ScanMessages() function will automatically update this variable with each call so that it can remember its analysis position. |
Type | The message type to filter for, or zero to scan all messages in the queue. |
Buffer | Optional pointer to a buffer that is large enough to hold any message data. |
Size | The byte-size of the supplied Buffer . |
Use the ScanMessages() function to scan the local message queue for information without affecting the state of the queue. To use this function effectively, make repeated calls to ScanMessages() to analyse the queue until it returns an error code other than ERR::Okay
.
The following example illustrates a scan for MSGID_QUIT
messages:
while (!ScanMessages(&handle, MSGID_QUIT, NULL, NULL)) { ... }
Messages will often (but not always) carry data that is relevant to the message type. To retrieve this data a buffer must be supplied. If the Buffer
is too small as indicated by the Size
, the message data will be trimmed to fit without any further indication.
Okay | Operation successful. |
---|---|
Search | No more messages are left on the queue, or no messages that match the given Type are on the queue. |
NullArgs | Function call missing argument value(s) |
Add a message to the local message queue.
Parameter | Description |
---|---|
Type | The message Type/ID being sent. Unique type ID's can be obtained from AllocateID(). |
Flags | Optional flags. |
Data | Pointer to the data that will be written to the queue. Set to NULL if there is no data to write. |
Size | The byte-size of the Data being written to the message queue. |
The SendMessage() function will add a message to the end of the local message queue. Messages must be associated with a Type
identifier and this can help the receiver process any accompanying Data. Some common message types are pre-defined, such as MSGID_QUIT
. Custom messages should use a unique type ID obtained from AllocateID().
Okay | The message was successfully written to the message queue. |
---|---|
Args | Invalid arguments passed to function. |
Used to set array fields in objects.
Parameter | Description |
---|---|
Object | Pointer to the target object. |
Field | The universal ID of the field you wish to write to, OR'd with a type indicator. |
Array | Pointer to the array values. |
Elements | The number of elements listed in the Array . |
The SetArray() function is used as an alternative to SetField() for the purpose of writing arrays to objects.
The following code segment illustrates how to write an array to an object field:
LONG array[100]; SetArray(Object, FID_Table|TLONG, array, 100);
An indicator of the type of the elements in the Array
must be OR'd into the Field
parameter. Available field types are listed in SetField(). Note that the type that you choose must be a match to the type expected for elements in the array.
Okay | Operation successful. |
---|---|
NoFieldAccess | The field is read-only. |
FieldTypeMismatch | The specified Field is not an array. |
UnsupportedField | The specified Field is not support by the Object class. |
NullArgs | Function call missing argument value(s) |
Sets the nominated owner of new resources.
Parameter | Description |
---|---|
Object | Pointer to the object that will take on the new context. If NULL , no change to the context will be made. |
This function defines the object that has control of the current thread. Once called, all further resource allocations are assigned to that object. This is significant for the automatic collection of memory and object resources. For example:
InitObject(display); auto ctx = SetContext(display); NewObject(CLASSID::BITMAP, &bitmap); AllocMemory(1000, MEM::DATA, &memory, NULL); SetContext(ctx); FreeResource(display->UID);
The above code allocates a Bitmap and a memory block, both of which will be contained by the display. When FreeResource() is called, both the bitmap and memory block will be automatically removed as they have a dependency on the display's existence. Please keep in mind that the following is incorrect:
InitObject(display); auto ctx = SetContext(display); NewObject(CLASSID::BITMAP, &bitmap); AllocMemory(1000, MEM::DATA, &memory, NULL); SetContext(ctx); FreeResource(display->UID); // The bitmap and memory would be auto-collected FreeResource(bitmap->UID); // Reference is no longer valid FreeResource(memory); // Reference is no longer valid
As the bitmap and memory block would have been freed as members of the display, their references are invalid when manually terminated in the following instructions.
SetContext() is intended for use by modules and classes. Do not use it in an application unless conditions necessitate its use. The Core automatically manages the context when calling class actions, methods and interactive fields.
Returns a pointer to the previous context. Because contexts nest, the client must call SetContext() a second time with this pointer in order to keep the process stable.
Forces the user and group permissions to be applied to new files and folders.
Parameter | Description |
---|---|
User | User ID to apply to new files. |
Group | Group ID to apply to new files. |
Permissions | Permission flags to be applied to new files. |
By default, user, group and permission information for new files is inherited either from the system defaults or from the file source in copy operations. Use this function to override this behaviour with new default values. All threads of the process will be affected.
To revert behaviour to the default settings, set the User
and/or Group
values to -1
and the Permissions
value to zero.
Used to set field values of objects.
Parameter | Description |
---|---|
Object | Pointer to the target object. |
Field | The universal ID of the field to update, OR'd with a type indicator. |
Value | The value that will be written to the field. |
The SetField() function is used to write field values to objects.
The following code segment illustrates how to write values to an object:
SetField(Object, FID_X|TLONG, 100); SetField(Object, FID_Statement|TSTR, "string");
Fields are referenced as hashed UID's calculated from the C++ strihash()
function. The majority of field ID's are predefined in the parasol/system/fields.h
include file.
The type of the Value
parameter must be OR'd into the Field
parameter. If the provided type does not match that of the field, a type conversion will occur. All numeric types are compatible with each other and strings can also be converted to a numeric value automatically. String and pointer types are interchangeable.
Available field types are as follows:
Name | Description |
---|---|
TLONG | A 32-bit integer value. |
TDOUBLE | A 64-bit floating point value. |
TSCALE | A 64-bit floating point value that represents a scaled multiplier or percentage (1.0 is equivalent to 100%). |
TLARGE | A 64-bit integer value. |
TPTR | A standard address space pointer. |
TSTR | A pointer that refers to a string. |
TFUNCTION | A pointer to a FUNCTION structure. |
TUNIT | A pointer to a Unit structure. |
There is no requirement for the client to have a working knowledge of the target object's field configuration in order to write information to it.
To set a field with a fixed-size array, use the SetArray() function.
Okay | Operation successful. |
---|---|
Args | Invalid arguments passed to function. |
NoFieldAccess | The field is read-only. |
UnsupportedField | The specified field is not support by the object's class. |
Sets the name of an object.
Parameter | Description |
---|---|
Object | The target object. |
Name | The new name for the object. |
This function sets the name of an Object
. This enhances log messages and allows the object to be found in searches. Please note that the length of the Name
will be limited to the value indicated in the core header file, under the MAX_NAME_LEN
definition. Names exceeding the allowed length are trimmed to fit.
Object names are limited to alpha-numeric characters and the underscore symbol. Invalid characters are replaced with an underscore.
Okay | Operation successful. |
---|---|
Search | The Object is not recognised by the system - the address may be invalid. |
LockFailed | Failed to lock a required resource. |
NullArgs | Function call missing argument value(s) |
Changes object ownership dynamically.
Parameter | Description |
---|---|
Object | The object to modify. |
Owner | The new owner for the Object . |
This function changes the ownership of an existing object. Ownership is an attribute that affects an object's placement within the object hierarchy as well as impacting on the resource tracking of the object in question. Internally, setting a new owner will cause three things to happen:
If the Object
does not support the NewOwner action, or the Owner
does not support the NewChild action, then the process will not fail. It will continue on the assumption that neither party is concerned about ownership management.
Okay | Operation successful. |
---|---|
Args | Invalid arguments passed to function. |
SystemLocked | Part of the system is unreachable due to a persistent lock. |
NullArgs | Function call missing argument value(s) |
Recursion | Detected a recursive function call. |
Sets miscellaneous resource identifiers.
Parameter | Description |
---|---|
Resource | The ID of the resource to be set. |
Value | The new value to set for the resource. |
The SetResource() function is used to manipulate miscellaneous system resources. Currently the following resources are supported:
Name | Description |
---|---|
RES::ALLOC_MEM_LIMIT | Adjusts the memory limit imposed on AllocMemory(). The Value specifies the memory limit in bytes. |
RES::LOG_LEVEL | Adjusts the current debug level. The Value must be between 0 and 9, where 1 is the lowest level of debug output (errors only) and 0 is off. |
RES::PRIVILEGED_USER | If the Value is set to 1, this resource option puts the process in privileged mode (typically this enables full administrator rights). This feature will only work for Unix processes that are granted admin rights when launched. Setting the Value to 0 reverts to the user's permission settings. SetResource() will return an error code indicating the level of success. |
Returns the previous value of the Resource
. If the Resource
value is invalid, NULL
is returned.
Redefines the location of a system resource path.
Parameter | Description |
---|---|
PathType | The ID of the resource path to set. |
Path | The new location to set for the resource path. |
The SetResourcePath() function changes the default locations of the Core's resource paths.
To read a resource path, use the GetSystemState() function.
Okay | Operation successful. |
---|---|
NullArgs | Function call missing argument value(s) |
Create or modify a filesystem volume.
Parameter | Description |
---|---|
Name | Required. The name of the volume. |
Path | Required. The path to be associated with the volume. If setting multiple paths, separate each path with a semi-colon character. Each path must terminate with a forward slash to denote a folder. |
Icon | An icon can be associated with the volume so that it has graphical representation when viewed in the UI. The required icon string format is category/name . |
Label | An optional label or short comment may be applied to the volume. This may be useful if the volume name has little meaning to the user (e.g. drive1 , drive2 ...). |
Device | If the volume references the root of a device, specify a device name of portable , fixed , cd , network or usb . |
Flags | Optional flags. |
SetVolume() is used to create or modify a volume that is associated with one or more paths. If the named volume already exists, it possible to append more paths or replace them entirely. Volume changes that are made with this function will only apply to the current process, and are lost after the program closes.
Flags that may be passed are as follows:
Name | Description |
---|---|
VOLUME::HIDDEN | Hides the volume so that it will not show up when reading volumes from the root path : . |
VOLUME::PRIORITY | If the volume already exists, the path will be inserted at the beginning of the path list so that it has priority over the others. |
VOLUME::REPLACE | If the volume already exists, all paths that are attached to it will be replaced with the new path setting. |
VOLUME::SYSTEM | Identifies the volume as being created by the system (this flag is not for client use). |
Okay | The volume was successfully added. |
---|---|
LockFailed | Failed to lock a required resource. |
NullArgs | A valid name and path string was not provided. |
Monitor action calls made against an object.
Parameter | Description |
---|---|
Object | The target object. |
Action | The ID of the action that will be monitored. Methods are not supported. |
Callback | A C/C++ function to callback when the action is triggered. |
The SubscribeAction() function allows a client to receive a callback each time that an action is executed on an object. This strategy is referred to as "action monitoring" and is often used for responding to UI events and the termination of objects.
Subscriptions are context sensitive, so the Callback
will execute in the space attributed to to the caller.
The following example illustrates how to listen to a Surface object's Redimension action and respond to resize events:
SubscribeAction(surface, AC::Redimension, C_FUNCTION(notify_resize, meta_ptr));
The template below illustrates how the Callback
function should be constructed:
void notify_resize(OBJECTPTR Object, ACTIONID Action, ERR Result, APTR Parameters, APTR CallbackMeta) { auto Self = (objClassType *)CurrentContext(); // Code here... if ((Result == ERR::Okay) and (Parameters)) { auto resize = (struct acRedimension *)Parameters; } }
The Object
is the original subscription target, as-is the Action ID. The Result is the error code that was generated at the end of the action call. If this is not set to ERR::Okay
, assume that the action did not have an effect on state. The Parameters
are the original arguments provided by the client - be aware that these can legitimately be NULL
even if an action specifies a required parameter structure. Notice that because subscriptions are context sensitive, CurrentContext() can be used to get a reference to the object that initiated the subscription.
To terminate an action subscription, use the UnsubscribeAction() function. Subscriptions are not resource tracked, so it is critical to match the original call with an unsubscription.
Okay | Operation successful. |
---|---|
Args | Invalid arguments passed to function. |
OutOfRange | The Action parameter is invalid. |
NullArgs | Function call missing argument value(s) |
Subscribe to a system event.
Parameter | Description |
---|---|
Event | An event identifier. |
Callback | The function that will be subscribed to the event. |
Handle | Pointer to an address that will receive the event handle. |
Use the SubscribeEvent() function to listen for system events. An event ID (obtainable from GetEventID()) must be provided, as well as a reference to a function that will be called each time that the event is broadcast.
An event handle will be returned in the Handle
parameter to identify the subscription. This must be retained to later unsubscribe from the event with the UnsubscribeEvent() function.
The prototype for the Callback
function is Function(APTR Event, LONG Size, APTR CallbackMeta)
, where Event
is the event structure that matches to the subscribed EventID.
Okay | Operation successful. |
---|---|
AllocMemory | A call to AllocMemory() failed to create a new memory block. |
NullArgs | Function call missing argument value(s) |
Subscribes an object or function to the timer service.
Parameter | Description |
---|---|
Interval | The total number of seconds to wait between timer calls. |
Callback | A callback function is required that will be called on each time cycle. |
Subscription | Optional. The subscription will be assigned an identifier that is returned in this parameter. |
This function creates a new timer subscription that will be called at regular intervals for the calling object.
A callback function must be provided that follows this prototype: ERR Function(OBJECTPTR Subscriber, LARGE Elapsed, LARGE CurrentTime)
The Elapsed
parameter is the total number of microseconds that have elapsed since the last call. The CurrentTime
parameter is set to the PreciseTime() value just prior to the Callback
being called. The callback function can return ERR::Terminate
at any time to cancel the subscription. All other error codes are ignored. Fluid callbacks should call check(ERR::Terminate)
to perform the equivalent of this behaviour.
To change the interval, call UpdateTimer() with the new value. To release a timer subscription, call UpdateTimer() with the resulting SubscriptionID and an Interval of zero.
Timer management is provisioned by the ProcessMessages() function. Failure to regularly process incoming messages will lead to unreliable timer cycles. It should be noted that the smaller the Interval that has been used, the more imperative regular message checking becomes. Prolonged processing inside a timer routine can also impact on other timer subscriptions that are waiting to be processed.
Okay | Operation successful. |
---|---|
Args | Invalid arguments passed to function. |
ArrayFull | The task's timer array is at capacity - no more subscriptions can be granted. |
SystemLocked | Part of the system is unreachable due to a persistent lock. |
InvalidState | The subscriber is marked for termination. |
NullArgs | Function call missing argument value(s) |
Unloads files from the file cache.
Parameter | Description |
---|---|
Cache | A pointer to a CacheFile structure returned from LoadFile(). |
This function unloads cached files that have been previously loaded with the LoadFile() function.
Terminates action subscriptions.
Parameter | Description |
---|---|
Object | The object that you are unsubscribing from. |
Action | The ID of the action that will be unsubscribed, or zero for all actions. |
The UnsubscribeAction() function will terminate subscriptions made by SubscribeAction().
To terminate multiple subscriptions in a single call, set the Action
parameter to zero.
Okay | Operation successful. |
---|---|
Args | Invalid arguments passed to function. |
NullArgs | Function call missing argument value(s) |
Removes an event subscription.
Parameter | Description |
---|---|
Handle | An event handle returned from SubscribeEvent() |
Use UnsubscribeEvent() to remove an existing event subscription. A valid handle returned from the SubscribeEvent() function must be provided.
Updates the data of any message that is queued.
Parameter | Description |
---|---|
Message | The ID of the message that will be updated. |
Type | Defines the type of the message. If set to -1 , the message will be deleted. |
Data | Pointer to a buffer that contains the new data for the message. |
Size | The byte-size of the Data that has been supplied. It must not exceed the size of the message that is being updated. |
The UpdateMessage() function provides a facility for updating the content of existing messages on the local queue. The client must provide the ID of the message to update and the new message Type and/or Data to set against the message.
Messages can be deleted from the queue by setting the Type
to -1
. There is no need to provide buffer information when deleting a message.
If Data
is defined, its size should equal that of the data already set against the message. The size will be trimmed if it exceeds that of the existing message, as this function cannot expand the size of the queue.
Okay | The message was successfully updated. |
---|---|
Search | The supplied Message ID does not refer to a message in the queue. |
AccessMemory | Access to a shared memory block was denied. |
NullArgs | Function call missing argument value(s) |
Modify or remove a subscription created by SubscribeTimer().
Parameter | Description |
---|---|
Subscription | The timer subscription to modify. |
Interval | The new interval for the timer (measured in seconds), or zero to remove. |
This function complements SubscribeTimer(). It can change the interval for an existing timer subscription, or remove it if the Interval is set to zero.
Okay | Operation successful. |
---|---|
Search | A search routine in this function failed. |
SystemLocked | Part of the system is unreachable due to a persistent lock. |
NullArgs | Function call missing argument value(s) |
Process incoming messages while waiting on objects to complete their activities.
Parameter | Description |
---|---|
Flags | Optional flags are specified here (clients should set a value of zero). |
TimeOut | A time-out value measured in milliseconds. If this value is negative then no time-out applies and the function will not return until an incoming message or signal breaks it. |
ObjectSignals | A null-terminated array of objects to monitor for signals. |
The WaitForObjects() function acts as a front-end to ProcessMessages(), with the capability of being able to wait for a series of objects that must signal an end to their activities. An object can be signalled via the Signal() action. Termination of a monitored object is also treated as a signal. The function will return once ALL of the objects are signalled or a time-out occurs.
Note that if an object has been signalled prior to entry to this function, its signal flag will be cleared and the object will not be monitored.
Okay | Operation successful. |
---|---|
Failed | General failure. |
NullArgs | Function call missing argument value(s) |
Recursion | Detected a recursive function call. |
OutsideMainThread | An operation has been attempted that is only possible from within the main thread. |
Waits for a specified amount of seconds and/or microseconds.
Parameter | Description |
---|---|
Seconds | The number of seconds to wait for. |
MicroSeconds | The number of microseconds to wait for. Please note that a microsecond is one-millionth of a second - 1/1000000 . The value cannot exceed 999999 . |
This function waits for a period of time as specified by the Seconds
and MicroSeconds
parameters. While waiting, your process will continue to process incoming messages in order to prevent the process' message queue from developing a back-log.
WaitTime() can return earlier than the indicated timeout if a message handler returns ERR::Terminate
, or if a MSGID_QUIT
message is sent to the task's message queue.
Action identifiers.
Name | Description |
---|---|
AC::Activate | |
AC::Clear | |
AC::Clipboard | |
AC::CopyData | |
AC::DataFeed | |
AC::Deactivate | |
AC::Disable | |
AC::DragDrop | |
AC::Draw | |
AC::END | |
AC::Enable | |
AC::Flush | |
AC::Focus | |
AC::Free | |
AC::FreeWarning | |
AC::GetKey | |
AC::Hide | |
AC::Init | |
AC::Lock | |
AC::LostFocus | |
AC::Move | |
AC::MoveToBack | |
AC::MoveToFront | |
AC::MoveToPoint | |
AC::NewChild | |
AC::NewObject | |
AC::NewOwner | |
AC::NewPlacement | |
AC::Next | |
AC::Prev | |
AC::Query | |
AC::Read | |
AC::Redimension | |
AC::Redo | |
AC::Refresh | |
AC::Rename | |
AC::Reset | |
AC::Resize | |
AC::SaveImage | |
AC::SaveSettings | |
AC::SaveToObject | |
AC::Seek | |
AC::SetField | |
AC::SetKey | |
AC::Show | |
AC::Signal | |
AC::Undo | |
AC::Unlock | |
AC::Write |
Universal values for alignment of graphics and text
Name | Description |
---|---|
ALIGN::BOTTOM | Align to bottom |
ALIGN::CENTER | Synonym for HORIZONTAL | VERTICAL |
ALIGN::HORIZONTAL | Align to horizontal center |
ALIGN::LEFT | Align to left |
ALIGN::MIDDLE | Synonym for HORIZONTAL | VERTICAL |
ALIGN::RIGHT | Align to right |
ALIGN::TOP | Align to top |
ALIGN::VERTICAL | Align to vertical center |
Class categories
Name | Description |
---|---|
CCF::AUDIO | Audio classes interface with audio hardware and drivers for audio playback and recording purposes. |
CCF::COMMAND | Command classes perform specific procedures, like copying or moving a file, managing volumes or executing a program. |
CCF::DATA | Data classes parse, query and manipulate data. |
CCF::FILESYSTEM | FileSystem classes are based on file management and interaction with file based data. |
CCF::GRAPHICS | Graphics classes provide graphics management and drawing services. |
CCF::GUI | GUI classes are used in the development of graphical user interfaces. |
CCF::IO | I/O classes manage hardware and software based input and output. |
CCF::MISC | Miscellaneous classes do not fit into any of the other available categories. |
CCF::MULTIMEDIA | Classes that represent more than one media type, e.g. video files. |
CCF::NETWORK | Network classes interface with system drivers to simplify network communications. |
CCF::SYSTEM | System classes are designed to provide low-level services related to system management. |
CCF::TOOL | Tools provide interactive services for the user. |
Compression stream formats
Name | Description |
---|---|
CF::DEFLATE | The 'deflate' format |
CF::GZIP | The 'gzip' format |
CF::ZLIB | The 'zlib' format |
Flags for the MetaClass.
Name | Description |
---|---|
CLF::INHERIT_LOCAL | Inherit the functionality of local objects defined in the class spec. |
CLF::NO_OWNERSHIP | Objects created will not be tracked to the creating process, nor any parent object (SetOwner() will not work either). |
Clipboard modes
Name | Description |
---|---|
CLIPMODE::COPY | Copy from the clipboard. |
CLIPMODE::CUT | Cut from the clipboard. |
CLIPMODE::PASTE | Paste from the clipboard. |
Compression flags
Name | Description |
---|---|
CMF::APPLY_SECURITY | When decompressing, apply individual file permissions if they are available in the compression file. |
CMF::CREATE_FILE | Create a new archive only if the source file does not already exist. |
CMF::NEW | Force the creation of a new file archive. Any existing file data at the target location will be destroyed. |
CMF::NO_LINKS | Treat symbolic links as normal files/folders. |
CMF::PASSWORD | A password has been set on the object. |
CMF::READ_ONLY | Forces read-only access, which is strongly recommended if an existing archive is being opened with no modifications intended. If this flag is not set, initialisation can fail if the user does not have write access to the source file. |
Flags for the Config class.
Name | Description |
---|---|
CNF::AUTO_SAVE | When the configuration object is freed, automatically save the configuration data back to the original file source. |
CNF::NEW | On initialisation, do not load any data from the referenced configuration file. |
CNF::OPTIONAL_FILES | Files are optional (do not fail if a requested file does not exist). |
CNF::STRIP_QUOTES | Removes quotes from key values that are quote-encapsulated. |
Gamepad controller buttons.
Name | Description |
---|---|
CON::DPAD_DOWN | Directional pad down. |
CON::DPAD_LEFT | Directional pad left. |
CON::DPAD_RIGHT | Directional pad right. |
CON::DPAD_UP | Directional pad up. |
CON::GAMEPAD_E | East button (B) |
CON::GAMEPAD_N | North button (Y) |
CON::GAMEPAD_S | South button (A) |
CON::GAMEPAD_W | West button (X) |
CON::LEFT_BUMPER_1 | Gamepad left-hand bumper 1 (top, primary). |
CON::LEFT_BUMPER_2 | Gamepad left-hand bumper 2 (lower). |
CON::LEFT_THUMB | Left thumb stick depressed. |
CON::RIGHT_BUMPER_1 | Gamepad right-hand bumper 1 (top, primary). |
CON::RIGHT_BUMPER_2 | Gamepad right-hand bumper 2 (lower). |
CON::RIGHT_THUMB | Right thumb stick depressed. |
CON::SELECT | Gamepad select or back button. |
CON::START | Gamepad start button. |
Data codes
Name | Description |
---|---|
DATA::AUDIO | Audio file data, recognised by the Sound class |
DATA::CONTENT | Document content (between XML tags) - sent by document objects only |
DATA::DEVICE_INPUT | Device activity |
DATA::FILE | File location (the data will reflect the complete file path) |
DATA::IMAGE | Image file data, recognised by the Image class |
DATA::INPUT_READY | Device input that has been transformed into user input |
DATA::RAW | Raw unprocessed data |
DATA::RECEIPT | Receipt for item data, in response to an earlier request |
DATA::RECORD | Database record |
DATA::REQUEST | Make a request for item data |
DATA::TEXT | Standard ASCII text |
DATA::XML | Markup based text data. NOTE - For clipboard data, the top-level encapsulating tag must declare the type of XML, e.g. 'html', 'ripple'. For plain XML, use 'xml' |
Name | Description |
---|---|
DEVICE::BOOKMARK | This marker indicates that the presented volume is a bookmark and not a device name. |
DEVICE::COMPACT_DISC | Compact disc style device |
DEVICE::FIXED | Catch-all for fixed media devices that are not directly identifiable. |
DEVICE::FLOPPY_DISK | Floppy disk style device |
DEVICE::HARD_DISK | Hard disk style device |
DEVICE::MEMORY | Device is RAM, ROM, WORM, NVRAM, flashdisk or other form of memory. Does not guarantee a fast connection as it could be over a slow USB 1.1 connection for example |
DEVICE::MODEM | Device is a modem. |
DEVICE::NETWORK | Device represents a network link |
DEVICE::PRINTER | Device is a paper-based printer. |
DEVICE::PRINTER_3D | Device is a three dimensional printer. |
DEVICE::READ | Device is readable |
DEVICE::REMOVABLE | Device media is removable from the hardware |
DEVICE::REMOVEABLE | Device media is removable from the hardware |
DEVICE::SCANNER | Device is a two dimensional scanner. |
DEVICE::SCANNER_3D | Device is a three dimensional scanner. |
DEVICE::SOFTWARE | Device is virtual/software defined |
DEVICE::TAPE | Tape/Stream style device |
DEVICE::TEMPORARY | All storage is temporary |
DEVICE::USB | Removable USB storage device. May be further qualified by HARD_DISK , FLOPPY_DISK etc |
DEVICE::WRITE | Device is writeable |
Name | Description |
---|---|
DMF::FIXED_CENTER_X | The CenterX field is a fixed size. |
DMF::FIXED_CENTER_Y | The CenterY field is a fixed size. |
DMF::FIXED_DEPTH | The Depth field is a fixed size. |
DMF::FIXED_HEIGHT | The Height field is a fixed size. |
DMF::FIXED_RADIUS_X | The RadiusX field is a fixed size. |
DMF::FIXED_RADIUS_Y | The RadiusY field is a fixed size. |
DMF::FIXED_WIDTH | The Width field is a fixed suze. |
DMF::FIXED_X | The X field is a fixed coordinate. |
DMF::FIXED_X_OFFSET | The XOffset field is a fixed coordinate. |
DMF::FIXED_Y | The Y field is a fixed coordinate. |
DMF::FIXED_Y_OFFSET | The YOffset field is a fixed coordinate. |
DMF::FIXED_Z | The Z field is a fixed coordinate. |
DMF::SCALED_CENTER_X | The CenterX field is scaled to this object's parent. |
DMF::SCALED_CENTER_Y | The CenterY field is scaled to this object's parent. |
DMF::SCALED_DEPTH | The Depth field is scaled to this object's parent. |
DMF::SCALED_HEIGHT | The Height field is scaled to this object's parent. |
DMF::SCALED_RADIUS_X | The RadiusX field is scaled to this object's parent. |
DMF::SCALED_RADIUS_Y | The RadiusY field is a scaled size to this object's parent. |
DMF::SCALED_WIDTH | The Width field is scaled to this object's parent. |
DMF::SCALED_X | The X field is scaled to this object's parent. |
DMF::SCALED_X_OFFSET | The XOffset field is scaled to this object's parent. |
DMF::SCALED_Y | The Y field is scaled to this object's parent. |
DMF::SCALED_Y_OFFSET | The YOffset field is scaled to this object's parent. |
DMF::SCALED_Z | The Z field is a scaled coordinate to this object's parent. |
DMF::STATUS_CHANGE_H | |
DMF::STATUS_CHANGE_V |
Compass directions.
Name | Description |
---|---|
DRL::EAST | |
DRL::NORTH | |
DRL::NORTH_EAST | |
DRL::NORTH_WEST | |
DRL::SOUTH | |
DRL::SOUTH_EAST | |
DRL::SOUTH_WEST | |
DRL::WEST |
Edge flags
Name | Description |
---|---|
EDGE::ALL | |
EDGE::BOTTOM | |
EDGE::BOTTOM_LEFT | |
EDGE::BOTTOM_RIGHT | |
EDGE::LEFT | |
EDGE::RIGHT | |
EDGE::TOP | |
EDGE::TOP_LEFT | |
EDGE::TOP_RIGHT |
Event categories.
Name | Description |
---|---|
EVG::ANDROID | Android specific events that do not already fit existing categories. |
EVG::APP | Custom event dispatched from an application |
EVG::AUDIO | Audio system events. |
EVG::CLASS | Custom event dispatched from a class that doesn't fit within the rest of the event framework |
EVG::DISPLAY | Video display events. |
EVG::FILESYSTEM | File system events. |
EVG::GUI | Events generated by the Graphical User Interface. |
EVG::HARDWARE | Hardware device events that are not covered by other types. |
EVG::IO | Input/Output events. |
EVG::NETWORK | Network events. |
EVG::POWER | Power Management - can also include app-specific events relating to resource management. |
EVG::SYSTEM | System-wide events |
EVG::USER | User activity events (such as user login). |
Flags for file feedback.
Name | Description |
---|---|
FBK::COPY_FILE | A file is to be, or has been copied. |
FBK::DELETE_FILE | A file is to be, or has been deleted. |
FBK::MOVE_FILE | A file is to be, or has been moved. |
Field descriptors.
Name | Description |
---|---|
FD::ALLOC | CLASSDEF Indicates the returned value is a dynamic allocation that needs to be manually freed (by default is a memory pointer, can be an object if combined with FD_OBJECT ) |
FD::ARRAY | Indicates an array of values. Follow with ARRAYSIZE if used in a function. |
FD::ARRAYSIZE | FUNCDEF Overrides LOOKUP . Pair with ARRAY to indicate total elements in the array. It is preferred that any null terminator is not counted. If ARRAYSIZE not specified, ARRAY must be null-terminated. |
FD::BUFFER | FUNCDEF Overrides WRITE . Indicates a buffer that can be filled with data by the function if paired with RESULT ; must be paired with BUFSIZE in second argument. |
FD::BUFSIZE | FUNCDEF Overrides LOOKUP . Pair with BUFFER to indicate the byte size of the buffer memory. |
FD::BYTE | 8 bit integer. |
FD::CPP | Use the C++ variant of the indicated type, e.g. ARRAY is a std::vector . |
FD::CUSTOM | |
FD::DOUBLE | 64 bit float. |
FD::DOUBLERESULT | For actions and methods |
FD::ERROR | FUNCDEF |
FD::FLAGS | CLASSDEF |
FD::FLOAT | 32 bit float. Not valid for use in class definitions. |
FD::FUNCTION | Intended for callbacks, uses the rkFunction structure. |
FD::FUNCTIONPTR | Synonym for PTR | FUNCTION |
FD::I | Synonym for INIT |
FD::INIT | CLASSDEF |
FD::LARGE | 64 bit integer. |
FD::LARGERESULT | For actions and methods |
FD::LOCAL | CLASSDEF Pointer to an object that is local to the class |
FD::LONG | 32 bit integer. |
FD::LONGRESULT | For actions and methods |
FD::LOOKUP | CLASSDEF |
FD::OBJECT | Supplementary, can be used with longs (for IDs) or pointers |
FD::OBJECTID | Synonym for LONG | OBJECT |
FD::OBJECTPTR | Synonym for PTR | OBJECT |
FD::POINTER | Pointer (32 or 64 bit). |
FD::PRIVATE | Synonym for SYSTEM |
FD::PTR | Synonym for POINTER |
FD::PTRBUFFER | The next argument should be LONG|BUFSIZE |
FD::PTRRESULT | Use for pointer-based value results only |
FD::PTRSIZE | Synonym for BUFSIZE |
FD::PTR_DOUBLERESULT | Use for pointer-based value results only. |
FD::PTR_LARGERESULT | Use for pointer-based value results only. |
FD::PTR_LONGRESULT | Use for pointer-based value results only. |
FD::R | Synonym for READ |
FD::READ | CLASSDEF |
FD::RESOURCE | The referenced struct or pointer is a special resource. Changes some behaviours, e.g. a resourced struct will use direct value references rather than being copied in Fluid. |
FD::RESULT | FUNCDEF Overrides READ |
FD::RGB | Supplementary, if a long type then format is 0xAARRGGBB , if pointer then refers to an RGB structure. |
FD::RI | Synonym for READ | INIT |
FD::RW | Synonym for READ | WRITE |
FD::SCALED | Supplementary, indicates a float value for multiplicative scaling. |
FD::STR | Synonym for STRING |
FD::STRING | Pointer to a string. |
FD::STRRESULT | Synonym for STR | RESULT |
FD::STRUCT | Supplementary, defines the field as a structure reference. MUST be combined with FD_POINTER . If used in a class, it is possible to name the structure definition in field->Arg |
FD::SYNONYM | CLASSDEF Use to declare fields that duplicate the functionality of another field. |
FD::SYSTEM | CLASSDEF System, internal and private fields. |
FD::TAGS | FUNCDEF Overrides INIT |
FD::UNIT | A value that describes a display unit. |
FD::UNSIGNED | Supplementary, integer value is unsigned. |
FD::VARTAGS | FUNCDEF Overrides FLAGS . Use for 64-bit taglists that require value definitions, e.g. TDOUBLE , TLONG etc. |
FD::VIRTUAL | CLASSDEF Ensures that the field has no physical representation in the structure. |
FD::VOID | |
FD::VOLATILE | [Not yet allocated a bit] Used on result pointers, usually strings, to indicate that the consecutive reads will overwrite the content of previous return values. This indicates to scripting languages to make a copy of the data before the next interaction with the object. |
FD::W | Synonym for WRITE |
FD::WORD | 16 bit integer. |
FD::WRITE | CLASSDEF |
Feedback event indicators.
Name | Description |
---|---|
FDB::COMPRESS_FILE | |
FDB::DECOMPRESS_FILE | |
FDB::DECOMPRESS_OBJECT | |
FDB::REMOVE_FILE |
Options for the File Delete() method.
Name | Description |
---|---|
FDL::FEEDBACK | Automatically manage user feedback for deleting files by presenting dialog boxes. |
Flags for the SetDate() file method.
Name | Description |
---|---|
FDT::ACCESSED | The date on which the file was last accessed by a user or application. |
FDT::ARCHIVED | The date on which the file was most recently archived. Not supported by most filesystems. |
FDT::CREATED | The date on which the file was created. On some host platforms this datestamp may be read-only. |
FDT::MODIFIED | The date on which the file was last modified. |
Return codes available to the feedback routine
Name | Description |
---|---|
FFR::ABORT | Abort the entire operation. |
FFR::OKAY | Continue processing uninterrupted. |
FFR::SKIP | Skip processing of this entity. |
File flags
Name | Description |
---|---|
FL::APPROXIMATE | Allows fuzzy matching of the file path when opening an existing file. This means that the file extension will be ignored; for instance attempting to open a file of 'screenshot.png' when only a file name of 'screenshot.jpg' exists in the same folder, the 'screenshot.jpg' file will be opened instead. If multiple files could potentially match to the file name, the file object will select the first match that is encountered. |
FL::BUFFER | Activates a special mode in which the file data is stored in a memory buffer rather than a disk file. Set the Size field to a value of at least 1 so that the initial buffer size is configured. In this mode many of the available file operations are meaningless except for the Read, Write and Seek actions. |
FL::DEVICE | The file is a system device (must set if opening a device for read/write operations) |
FL::DIRECTORY | The file object represents a folder. |
FL::EXCLUDE_FILES | Exclude files when scanning this folder. |
FL::EXCLUDE_FOLDERS | Exclude folders when scanning this folder. |
FL::FILE | Explicitly declares the file object as an entity that stores content (as opposed to a device or folder for example). |
FL::FOLDER | The file object represents a folder. |
FL::LINK | Read-Only. Indicates that the file is a symbolic link or shortcut to another file. |
FL::LOOP | In loop mode, the file object's position marker for read/write operations is allowed to extend past the actual file size. Any read/write operation beyond the file size will loop back to the file at a corrected offset - for example, reading position 330 of a 100 byte file will start the operation from the 30th byte. Loop mode does not affect any other area besides the read, write and seek operations. The loop feature is typically used to create multimedia data streams with minimal effort. |
FL::NEW | Required when creating a new file. If a file with the same name exists, its contents will be destroyed. If however the existing file is locked, the initalisation process will fail. |
FL::READ | Required if the file needs to be opened for read access. |
FL::RESET_DATE | For internal use only |
FL::STREAM | File data is streamed (e.g. PIPE, FIFO, socket) and may be accessed locally or via a network. |
FL::WRITE | Prepares a file for writing data, starting at byte position 0. To start writing from the end of a file, use the Seek action after the file has been initialised. |
Flags that can be passed to FindObject()
Name | Description |
---|---|
FOF::SMART_NAMES | Parse numeric object names as ID references and support use of the 'Owner' reserved keyword. |
Types for AllocateID()
Name | Description |
---|---|
IDTYPE::FUNCTION | Function ID's are used to track FUNCTION types and are assigned to the function ID field. |
IDTYPE::GLOBAL | Global ID's have no specific association with anything. |
IDTYPE::MESSAGE | Message ID's are allocated for the purpose of sending uniquely identifiable messages between tasks. |
JET constants are documented in GetInputEvent()
Name | Description |
---|---|
JET::ABS_XY | The X, Y values are defined as absolute coordinates, relative to the top-left of the display. |
JET::BUTTON_1 | Left mouse button; XBox A button, PS square button. Value is pressure sensitive, ranging between 0 - 1.0 (0 is released, 1.0 is fully depressed). |
JET::BUTTON_10 | Non-specific button assignment. |
JET::BUTTON_2 | Right mouse button; XBox X button, PS cross button. |
JET::BUTTON_3 | Middle mouse button; XBox Y button, PS triangle. |
JET::BUTTON_4 | Alt. mouse button 1; XBox B button, PS circle. |
JET::BUTTON_5 | Alt. mouse button 2. |
JET::BUTTON_6 | Non-specific button assignment. |
JET::BUTTON_7 | Non-specific button assignment. |
JET::BUTTON_8 | Non-specific button assignment. |
JET::BUTTON_9 | Non-specific button assignment. |
JET::CROSSED_IN | This message is sent by the input system when the mouse pointer enters an area for the first time. The message value refers to the object ID of the container being monitored for movement. |
JET::CROSSED_OUT | This message is sent by the input system when the mouse pointer leaves an area. The message value refers to the object ID of the container being monitored for movement. |
JET::DEVICE_TILT_XY | Controller tilted on the X/Y axis. Value indicates angle, -ve = left, +ve = right |
JET::DEVICE_TILT_Z | Controller is rising or falling. Value expressed as 'speed', |
JET::DISPLAY_EDGE | Recently supplied input occurred at the edge of the display. |
JET::PEN_TILT_XY | For pen-based input, this type indicates the vertical tilt of the pen device. A value of 0 indicates that the pen is laid flat with nib at the bottom, 0.5 is 90 degrees, 1.0 is laid flat with nib at the top. |
JET::PRESSURE | Amount of pressure applied, ranges from 0 (none) to 1.0 (normal) and possibly higher if user presses hard enough |
JET::WHEEL | Mouse wheel rotation - the value generally reflects the number of 'clicks' rotated on the wheel. |
JET::WHEEL_TILT | Some mouse wheels can be tilted to the left or right. Ranges from -1.0 to +1.0 |
JTYPE flags are used to categorise input types.
Name | Description |
---|---|
JTYPE::ANALOG | Analog movement (ranging from -1.0 to 1.0) |
JTYPE::ANCHORED | Cursor has been anchored with LockCursor() |
JTYPE::BUTTON | Input is a physical button or switch |
JTYPE::CROSSING | Crossing events manage the entering and leaving of an area. |
JTYPE::DBL_CLICK | Set by the input system if the Type is a button and the button has been clicked in quick succession so as to be classed as a double-click. |
JTYPE::DIGITAL | D-Pad or digital joystick source (restricted to +/- 1) |
JTYPE::DRAGGED | Set if sufficient movement occurred between the original click and its point of release (usually requires a 3 or more pixel difference). |
JTYPE::DRAG_ITEM | This special flag is set by the input system if the pointer is click-dragging an object at the time of the event. |
JTYPE::EXT_MOVEMENT | Extended or indirect movement information. This covers all types of movement that are unconnected to coordinate positioning - mouse wheel movement and pen tilt are two such examples. |
JTYPE::MOVEMENT | X/Y coordinate movement only. Movement such as the wheel mouse spinning is not covered by this type as it does not influence the coordinate system. |
JTYPE::REPEATED | Input is a repeated entry (i.e. user is holding down a button and a repetition timer is being triggered) |
JTYPE::SECONDARY | Indicates to the receiver of this message that it is not the primary/original recipient |
Raw key codes
Name | Description |
---|---|
KEY::A | |
KEY::APOSTROPHE | |
KEY::AT | |
KEY::B | |
KEY::BACK | |
KEY::BACKSPACE | |
KEY::BACK_SLASH | |
KEY::BREAK | |
KEY::C | |
KEY::CALL | |
KEY::CAMERA | |
KEY::CANCEL | |
KEY::CAPS_LOCK | |
KEY::CLEAR | |
KEY::COMMA | |
KEY::D | |
KEY::DELETE | |
KEY::DOT | |
KEY::DOWN | |
KEY::E | |
KEY::EIGHT | |
KEY::END | |
KEY::END_CALL | |
KEY::ENTER | |
KEY::EQUALS | |
KEY::ESCAPE | |
KEY::EXECUTE | |
KEY::F | |
KEY::F1 | |
KEY::F10 | |
KEY::F11 | |
KEY::F12 | |
KEY::F13 | |
KEY::F14 | |
KEY::F15 | |
KEY::F16 | |
KEY::F17 | |
KEY::F18 | |
KEY::F19 | |
KEY::F2 | |
KEY::F20 | |
KEY::F3 | |
KEY::F4 | |
KEY::F5 | |
KEY::F6 | |
KEY::F7 | |
KEY::F8 | |
KEY::F9 | |
KEY::FIND | |
KEY::FIVE | |
KEY::FORWARD | |
KEY::FOUR | |
KEY::G | |
KEY::H | |
KEY::HELP | |
KEY::HOME | |
KEY::I | |
KEY::INSERT | |
KEY::J | |
KEY::K | |
KEY::L | |
KEY::LEFT | |
KEY::LENS_FOCUS | |
KEY::LESS_GREATER | |
KEY::LIST_END | |
KEY::L_ALT | |
KEY::L_COMMAND | |
KEY::L_CONTROL | |
KEY::L_SHIFT | |
KEY::L_SQUARE | |
KEY::M | |
KEY::MACRO | |
KEY::MENU | |
KEY::MINUS | |
KEY::MUTE | |
KEY::N | |
KEY::NEXT | |
KEY::NINE | |
KEY::NP_0 | |
KEY::NP_1 | |
KEY::NP_2 | |
KEY::NP_3 | |
KEY::NP_4 | |
KEY::NP_5 | |
KEY::NP_6 | |
KEY::NP_7 | |
KEY::NP_8 | |
KEY::NP_9 | |
KEY::NP_BAR | |
KEY::NP_DECIMAL | |
KEY::NP_DIVIDE | |
KEY::NP_DOT | |
KEY::NP_ENTER | |
KEY::NP_MINUS | |
KEY::NP_MULTIPLY | |
KEY::NP_PLUS | |
KEY::NP_PLUS_MINUS | |
KEY::NP_SEPARATOR | |
KEY::NUM_LOCK | |
KEY::O | |
KEY::ONE | |
KEY::P | |
KEY::PAGE_DOWN | |
KEY::PAGE_UP | |
KEY::PAUSE | |
KEY::PERIOD | |
KEY::PLAY | |
KEY::PLUS | |
KEY::POUND | |
KEY::POWER | |
KEY::PREVIOUS | |
KEY::PRINT | |
KEY::PRT_SCR | |
KEY::Q | |
KEY::R | |
KEY::REDO | |
KEY::REVERSE_QUOTE | |
KEY::REWIND | |
KEY::RIGHT | |
KEY::R_ALT | |
KEY::R_COMMAND | |
KEY::R_CONTROL | |
KEY::R_SHIFT | |
KEY::R_SQUARE | |
KEY::S | |
KEY::SCR_LOCK | |
KEY::SELECT | |
KEY::SEMI_COLON | |
KEY::SEVEN | |
KEY::SIX | |
KEY::SLASH | |
KEY::SLEEP | |
KEY::SPACE | |
KEY::STAR | |
KEY::STOP | |
KEY::SYSRQ | |
KEY::T | |
KEY::TAB | |
KEY::THREE | |
KEY::TWO | |
KEY::U | |
KEY::UNDO | |
KEY::UP | |
KEY::V | |
KEY::VOLUME_DOWN | |
KEY::VOLUME_UP | |
KEY::W | |
KEY::WAKE | |
KEY::WIN_CONTROL | |
KEY::X | |
KEY::Y | |
KEY::Z | |
KEY::ZERO |
Special qualifier flags
Name | Description |
---|---|
KQ::ALT | Synonym for L_ALT | R_ALT |
KQ::ALTGR | Synonym for R_ALT |
KQ::CAPS_LOCK | Caps-Lock is on |
KQ::COMMAND | Synonym for L_COMMAND | R_COMMAND |
KQ::CONTROL | Synonym for L_CONTROL | R_CONTROL |
KQ::CTRL | Synonym for L_CONTROL | R_CONTROL |
KQ::DEAD_KEY | This key will be affected by a previously pressed dead-key |
KQ::INFO | Synonym for REPEAT | RELEASED | PRESSED | NOT_PRINTABLE | CAPS_LOCK |
KQ::INSTRUCTION_KEYS | Synonym for ALT | CONTROL |
KQ::L_ALT | Left Alt is held |
KQ::L_COMMAND | Left Logo/Special |
KQ::L_CONTROL | Control Key is held |
KQ::L_CTRL | Control Key is held |
KQ::L_SHIFT | Left Shift is held |
KQ::NOT_PRINTABLE | The represented key value is not printable |
KQ::NUM_LOCK | NumLock is on |
KQ::NUM_PAD | Identifies numeric keypad keys |
KQ::PRESSED | Key is being held or tapped |
KQ::QUALIFIERS | Synonym for SHIFT | COMMAND | ALT | CONTROL |
KQ::RELEASED | The key is being released |
KQ::REPEAT | This is a repeated key |
KQ::R_ALT | Right Alt is held |
KQ::R_COMMAND | Right Logo/Special |
KQ::R_CONTROL | Control Key is held |
KQ::R_CTRL | Control Key is held |
KQ::R_SHIFT | Right Shift is held |
KQ::SCR_LOCK | Scroll Lock is on |
KQ::SHIFT | Synonym for L_SHIFT | R_SHIFT |
Universal values for alignment of graphic layouts in documents.
Name | Description |
---|---|
LAYOUT::BACKGROUND | Graphic is placed behind text. The text will not be wrapped around the object |
LAYOUT::EMBEDDED | Graphic is embedded in the text stream (treated as a character). The height of the line can be extended to match the height of the graphic in this mode. |
LAYOUT::FOREGROUND | Graphic is placed in front of the text. The text will not be wrapped around the object |
LAYOUT::IGNORE_CURSOR | The object has a fixed X/Y position, unrelated to the cursor |
LAYOUT::LEFT | The text boundary is extended to the left edge of the page. |
LAYOUT::LOCK | Lock the position of the graphic to the top left of the view and not the scrolling position of the page. |
LAYOUT::RIGHT | The text boundary is extended to the right edge of the page. |
LAYOUT::SQUARE | The default. Text will clip around the image's border |
LAYOUT::TIGHT | Text wraps to the shape of the image (alpha blended/masked images only) |
LAYOUT::TILE | The graphic will be tiled. Tiled graphics also meet the BACKGROUND criteria (no wrapping). |
LAYOUT::WIDE | The text boundary is extended to the left and right edges of the page. |
Flags for LoadFile()
Name | Description |
---|---|
LDF::CHECK_EXISTS | Limits the routine to checking the file cache for the existence of the file. If found, the relevant cache entry is returned. The open count is not incremented by this action (it is therefore unnecessary to follow-up with a call to UnloadFile()). If no up-to-date cache entry is available, ERR::Search is returned. |
AnalysePath() values
Name | Description |
---|---|
LOC::DIRECTORY | The path refers to a folder. |
LOC::FILE | The path refers to a file. |
LOC::VOLUME | The path refers to a volume name. |
Name | Description |
---|---|
MAX::FILENAME | |
MAX::NAME_LEN |
Memory types used by AllocMemory(). The lower 16 bits are stored with allocated blocks, the upper 16 bits are function-relative only.
Name | Description |
---|---|
MEM::AUDIO | The memory space is reserved by an audio device such as a sound card. |
MEM::CALLER | This flag is usable only in routines that are supporting a class method. It forces the memory allocation to be tracked to the object that made the method call. This is particularly important in methods that return memory blocks that do not form a part of the object itself. |
MEM::CODE | Set if the memory will contain executable program code. |
MEM::DATA | The default type, DATA , is used to indicate a standard memory allocation from system RAM. |
MEM::HIDDEN | Hidden blocks are not recorded and are excluded from resource tracking. |
MEM::MANAGED | Enables custom resource management for the memory block. The start of the block will need to be reserved with a pointer to a ResourceManager structure, which is included as part of the block's declared Size. The Free() callback will be called when the block is removed. |
MEM::NO_BLOCK | Permanently turn off all accesses to this memory block. This means that multiple threads can have full read/write access to the memory block at once regardless of other acces flags. |
MEM::NO_BLOCKING | Permanently turn off all accesses to this memory block. This means that multiple threads can have full read/write access to the memory block at once regardless of other acces flags. |
MEM::NO_CLEAR | Do not clear the memory on allocation (saves time). |
MEM::NO_LOCK | For AllocMemory() only, indicates that the (private) memory block should not be locked on return. |
MEM::NO_POOL | Gives a hint to the allocator to allocate the block outside of the memory pool. |
MEM::READ | The memory is explicitly marked as readable. |
MEM::READ_WRITE | Synonym for READ | WRITE |
MEM::STRING | Identifies the memory content as a null terminated string. Useful for debugging and run-time type identification in scripts. |
MEM::TEXTURE | The memory space is reserved by a video driver for hosting texture graphics. |
MEM::TMP_LOCK | Enables temporary locking restrictions. Prevents processes from sleeping while holding a lock on the memory block. |
MEM::UNTRACKED | Allocating an untracked memory block will prevent the memory block from being tracked back to the object holding the current context. |
MEM::VIDEO | The memory space is reserved by a video device such as a graphics card for display purposes, e.g. framebuffer. |
MEM::WRITE | The memory is explicitly marked as writeable. |
Flags for the File Watch() method.
Name | Description |
---|---|
MFF::ATTRIB | File permissions or datestamp changed. |
MFF::CLOSED | An opened file has been closed. |
MFF::CREATE | New file/link created or renamed in folder. |
MFF::DEEP | Receive notifications from sub-folders (Windows only). |
MFF::DELETE | Existing file deleted |
MFF::FILE | File identifier; if passed to File.Watch() then indicates a preference for file events only. |
MFF::FOLDER | Folder identifier; if passed to File.Watch() then indicates a preference for folder events only. |
MFF::MODIFY | File modified via write or truncation. |
MFF::MOVED | Existing file moved or renamed. |
MFF::OPENED | Existing file was opened. |
MFF::READ | File was accessed (read). |
MFF::RENAME | Existing file moved or renamed. |
MFF::SELF | Event applies to the monitored folder and not a contained item |
MFF::UNMOUNT | Host filesystem was unmounted. |
MFF::WRITE | File modified via write or truncation. |
Internal options for requesting function tables from modules.
Name | Description |
---|---|
MHF::DEFAULT | Use structures to group exported functions (Linux, C/C++ standard) |
MHF::STATIC | Keep the module code in memory |
MHF::STRUCTURE | Use structures to group exported functions (Linux, C/C++ standard) |
Module flags
Name | Description |
---|---|
MOF::LINK_LIBRARY | Module refers to a symbolic link library (e.g. libz DLL or SO) |
MOF::STATIC | This flag prevents the loaded module code from being unloaded when the module object is freed. This may be needed in cases where a module is designed with the presumption that it will remain in memory after being loaded by the developer. |
MOF::SYSTEM_PROBE | Indicates that the module is being probed. Do not use outside of the core library. |
Generic flags for controlling movement.
Name | Description |
---|---|
MOVE::ALL | Synonym for DOWN | UP | LEFT | RIGHT |
MOVE::DOWN | |
MOVE::LEFT | |
MOVE::RIGHT | |
MOVE::UP |
Message flags.
Name | Description |
---|---|
MSF::ADD | The default behaviour - this will add the message to the end of the queue. |
MSF::MESSAGE_ID | The Type parameter refers to a unique message ID rather than a message type for this call. |
MSF::NO_DUPLICATE | If the Type parameter matches a message already inside the queue, the new message will not be added and the function will immediately return with ERR::Okay . |
MSF::UPDATE | If the Type parameter matches a message already inside the queue, the data for that message will be deleted, then the new message will be added to the end of the queue. |
MSF::WAIT | Wait before inserting the message if the queue is at maximum capacity. |
Reserved message ID's that are handled internally.
Name | Description |
---|---|
MSGID::ACTION | |
MSGID::BREAK | |
MSGID::COMMAND | |
MSGID::CORE_END | |
MSGID::DEBUG | |
MSGID::EVENT | |
MSGID::FREE | |
MSGID::QUIT | |
MSGID::THREAD_ACTION | |
MSGID::THREAD_CALLBACK | |
MSGID::VALIDATE_PROCESS | |
MSGID::WAIT_FOR_OBJECTS |
MoveToPoint flags
Name | Description |
---|---|
MTF::ANIM | |
MTF::RELATIVE | |
MTF::X | |
MTF::Y | |
MTF::Z |
Name | Description |
---|---|
NETMSG::END | |
NETMSG::START |
Flags that can be passed to NewObject(). If a flag needs to be stored with the object, it must be specified in the lower word.
Name | Description |
---|---|
NF::COLLECT | Marked for garbage collection. |
NF::FREE | Read-only indicator for when the object is being freed. |
NF::FREE_ON_UNLOCK | Read-only indicator for when the object is marked for deletion. |
NF::INITIALISED | Read-only indicator if the object has been initialised. |
NF::LOCAL | Classes can allocate local objects to stop them from being associated with the client. |
NF::MESSAGE | Action has been called against the object through the message system (managed by ProcessMessages()). |
NF::NAME | Use the Name parameter to name the created object. This flag is not required if using UNIQUE . |
NF::PRIVATE | |
NF::RECLASSED | The object switched from the base-class to a sub-class during initialisation. |
NF::SIGNALLED | The object has been signalled and is awaiting processing. |
NF::TIMER_SUB | The object is subscribed to a timer interval. |
NF::UNIQUE | Use to allocate an object that has a guaranteed unique name. This will prevent code from shadowing any object that exists with the same name, which can be imperative when creating shared objects. If it is discovered that an identically named object exists, NewObject() will return ERR::ObjectExists . This flag works in conjunction with the Name parameter. |
NF::UNTRACKED | An object created with this flag will not be tracked back to the object that created it. |
Name | Description |
---|---|
OPF::ARGS | |
OPF::DETAIL | |
OPF::ERROR | |
OPF::MAX_DEPTH | |
OPF::MODULE_PATH | |
OPF::OPTIONS | |
OPF::PRIVILEGED | |
OPF::ROOT_PATH | |
OPF::SCAN_MODULES | |
OPF::SHOW_ERRORS | |
OPF::SHOW_IO | |
OPF::SHOW_MEMORY | |
OPF::SYSTEM_PATH |
Permission flags
Name | Description |
---|---|
PERMIT::ALL_DELETE | Synonym for EVERYONE_DELETE |
PERMIT::ALL_EXEC | Synonym for EVERYONE_EXEC |
PERMIT::ALL_READ | Synonym for EVERYONE_READ |
PERMIT::ALL_WRITE | Synonym for EVERYONE_WRITE |
PERMIT::ARCHIVE | Marks the file for future backup. The flag should be cleared after the backup has succeeded. |
PERMIT::DELETE | Owner can delete. If the file system does not support this, deletion is enabled via the WRITE flag. |
PERMIT::EVERYONE_ACCESS | Synonym for EVERYONE_READ | EVERYONE_WRITE | EVERYONE_EXEC | EVERYONE_DELETE |
PERMIT::EVERYONE_DELETE | Synonym for DELETE | GROUP_DELETE | OTHERS_DELETE |
PERMIT::EVERYONE_EXEC | Synonym for EXEC | GROUP_EXEC | OTHERS_EXEC |
PERMIT::EVERYONE_READ | Synonym for READ | GROUP_READ | OTHERS_READ |
PERMIT::EVERYONE_READWRITE | Synonym for EVERYONE_READ | EVERYONE_WRITE |
PERMIT::EVERYONE_WRITE | Synonym for WRITE | GROUP_WRITE | OTHERS_WRITE |
PERMIT::EXEC | User/Owner can execute. |
PERMIT::GROUP | Synonym for GROUP_READ | GROUP_WRITE | GROUP_EXEC | GROUP_DELETE |
PERMIT::GROUPID | Allows executables to run with a set group id. |
PERMIT::GROUP_DELETE | Group members can delete. |
PERMIT::GROUP_EXEC | Group members can execute. |
PERMIT::GROUP_READ | Group members can read. |
PERMIT::GROUP_WRITE | Group members can write. |
PERMIT::HIDDEN | Recommends that the file is hidden from view by default. |
PERMIT::INHERIT | Inherit permissions from parent folder and logical OR them with preset permission flags. |
PERMIT::NETWORK | File is hosted on another machine. |
PERMIT::OFFLINE | File content for this networked file has not been cached on the local PC. |
PERMIT::OTHERS | Synonym for OTHERS_READ | OTHERS_WRITE | OTHERS_EXEC | OTHERS_DELETE |
PERMIT::OTHERS_DELETE | Others can delete. |
PERMIT::OTHERS_EXEC | Others can execute. |
PERMIT::OTHERS_READ | Others can read. |
PERMIT::OTHERS_WRITE | Others can write. |
PERMIT::PASSWORD | File is password protected. |
PERMIT::READ | User/Owner has read access. This will not allow compiled code to be executed. |
PERMIT::USER | Synonym for READ | WRITE | EXEC | DELETE |
PERMIT::USERID | Allows executables to run with a set user id. |
PERMIT::USER_EXEC | Synonym for EXEC |
PERMIT::USER_READ | Synonym for READ |
PERMIT::USER_WRITE | Synonym for WRITE |
PERMIT::WRITE | User/Owner can write. |
Flags for ProcessMessages
Name | Description |
---|
Predefined cursor styles
Name | Description |
---|---|
PTC::CROSSHAIR | The cross hair is used for targeting specific pixel points (common in paint programs). |
PTC::CUSTOM | Works in conjunction with the SetCustomCursor() function to represent a program defined bitmap. |
PTC::DEFAULT | The default cursor (usually an arrow pointing to the upper left). |
PTC::DRAGGABLE | Used to indicate that a surface or object can be dragged by the user. |
PTC::END | |
PTC::HAND | The hand cursor is often used for indicating click-able content (hyper-links, icons etc). |
PTC::HAND_LEFT | Similar to the standard hand cursor, but points to the left. |
PTC::HAND_RIGHT | Similar to the standard hand cursor, but points to the right. |
PTC::INVISIBLE | The cursor graphic is invisible (but will continue to operate as normal in all other respects). |
PTC::MAGNIFIER | Represents a magnifying glass. |
PTC::NO_CHANGE | |
PTC::PAINTBRUSH | The paintbrush cursor is typically employed by paint programs. |
PTC::SIZE_BOTTOM | Sizing cursor - for resizing the bottom edge of any rectangular area. |
PTC::SIZE_BOTTOM_LEFT | Sizing cursor - for resizing the bottom left corner of any rectangular area. |
PTC::SIZE_BOTTOM_RIGHT | Sizing cursor - for resizing the bottom right corner of any rectangular area. |
PTC::SIZE_LEFT | Sizing cursor - for resizing the left edge of any rectangular area. |
PTC::SIZE_RIGHT | Sizing cursor - for resizing the right edge of any rectangular area. |
PTC::SIZE_TOP | Sizing cursor - for resizing the top edge of any rectangular area. |
PTC::SIZE_TOP_LEFT | Sizing cursor - for resizing the top left corner of any rectangular area. |
PTC::SIZE_TOP_RIGHT | Sizing cursor - for resizing the top right corner of any rectangular area. |
PTC::SIZING | Multi-directional sizing cursor - for resizing in any direction. |
PTC::SLEEP | The sleep cursor is used to inform the user that the computer is busy. |
PTC::SPLIT_HORIZONTAL | The horizontal split cursor is typically used for splitting rectangles in half, or dragging a horizontal split within a large rectangular space. |
PTC::SPLIT_VERTICAL | The vertical split cursor is typically used for splitting rectangles in half, or dragging a vertical split within a large rectangular space. |
PTC::STOP | The stop cursor is used to inform the user that an operation is not possible (e.g. drag and drop to an unsupported object area). |
PTC::TEXT | The text cursor is popular for the precise positioning of text cursors. |
Flags for the OpenDir() function.
Name | Description |
---|---|
RDF::ARCHIVE | Feedback only - archive bit is set. |
RDF::DATE | Retrieve the date stamp of each file. |
RDF::FILE | Read all files in the folder. |
RDF::FILES | Read all files in the folder. |
RDF::FOLDER | Read all folders/volumes in the folder. |
RDF::FOLDERS | Read all folders/volumes in the folder. |
RDF::HIDDEN | Feedback only - file/folder is hidden. |
RDF::LINK | Feedback only - file/folder is actually a link to another location. |
RDF::PERMISSIONS | Get permission/security information. |
RDF::QUALIFIED | Return fully qualified folder names (i.e. trailing slash or colon for each name). |
RDF::QUALIFY | Return fully qualified folder names (i.e. trailing slash or colon for each name). |
RDF::READ_ALL | Synonym for SIZE | DATE | PERMISSIONS | FILES | FOLDERS |
RDF::READ_ONLY | Read-only (not permissions related and might indicate read-only media). |
RDF::SIZE | Retrieve the byte size of each file. |
RDF::STREAM | Path is connected via a stream, e.g. network connection. |
RDF::TAGS | Receive additional information for each file, such as comments, author and copyright. The results are stored in the Tags field of each file. |
RDF::TIME | Retrieve the date stamp of each file. |
RDF::VIRTUAL | Path is to a virtual device. |
RDF::VOLUME | Feedback only - indicates a volume. |
Name | Description |
---|---|
RES::CORE_IDL | Refers to the Core module's compressed IDL string. |
RES::CPU_SPEED | The average top-speed of all CPU cores in Mhz. |
RES::FREE_MEMORY | The total amount of free memory. |
RES::FREE_SWAP | The total amount of free swap memory. |
RES::JNI_ENV | Return the current JNI environment string. |
RES::KEY_STATE | Maintains the state of key qualifiers such as caps-lock and the shift keys. |
RES::LOG_DEPTH | The current depth of log messages. |
RES::LOG_LEVEL | The current level of log detail (larger numbers indicate more detail). |
RES::MAX_PROCESSES | The maximum number of processes that can be supported at any time. |
RES::OPEN_INFO | Pointer to the OpenInfo structure originally used to initialise the system. |
RES::PRIVILEGED | This is set to true if the process has elevated privileges (such as superuser or administrative rights). |
RES::PRIVILEGED_USER | If this value is set to 1, the process will operate in privileged mode (typically this enables full administrator rights). This feature will only work for Unix processes that are granted admin rights when launched. Setting the Value to 0 reverts to the user's permission settings. SetResource() will return an error code indicating the level of success. |
RES::PROCESS_STATE | Life-cycle stage of the running process |
RES::STATIC_BUILD | Returns true if the runtime is a statically linked build. |
RES::THREAD_ID | Return the ID of the current thread. |
RES::TOTAL_MEMORY | The total amount of installed memory. |
RES::TOTAL_SHARED_MEMORY | The total amount of shared memory in use (system wide). |
RES::TOTAL_SWAP | The total amount of available swap space. |
Flags for RegisterFD()
Name | Description |
---|---|
RFD::ALWAYS_CALL | Always call this FD's handler prior to the process going to sleep. |
RFD::EXCEPT | Activate the callback if error conditions are pending. |
RFD::READ | Activate the callback if there is data available to read. |
RFD::RECALL | Set if the subscriber needs to manually check for incoming/outgoing data. This is supported as a one-off check, so the flag will be disabled automatically when the subscriber is called. |
RFD::REMOVE | Stop monitoring this file descriptor. |
RFD::SOCKET | Identifies the file descriptor as a socket (Linux systems only). |
RFD::WRITE | Activate the callback if there is room to write to the FD's buffer. |
Path types for SetResourcePath()
Name | Description |
---|---|
RP::MODULE_PATH | An alternative path leading to the system modules (normally system:modules/ ). Introduced for platforms such as Android, where modules are stored in asset folders. |
RP::ROOT_PATH | Overrides the root path, which defaults to the location at which Parasol is installed. |
RP::SYSTEM_PATH | The path of the system: volume, which otherwise defaults to [root]:system/ . |
Flags for ResolvePath()
Name | Description |
---|---|
RSF::APPROXIMATE | Ignores file extensions for the purpose of file name matching. |
RSF::CASE_SENSITIVE | For use on host systems that use case-insensitive file systems such as Windows; this option checks that the discovered file is a case-sensitive match to the Path. |
RSF::CHECK_VIRTUAL | If the volume referenced by Path is traced to another volume that is reserved by a virtual file system driver, ERR::VirtualVolume is returned. The volume is still resolved as far as possible and the resulting path will be returned by this function. |
RSF::NO_DEEP_SCAN | Do not perform more than one iteration when resolving the source file path. |
RSF::NO_FILE_CHECK | Do not test for the existence of the targeted file or folder during the resolution process. |
RSF::PATH | Use the PATH environment variable to resolve the file name in the Path parameter. |
Script flags
Name | Description |
---|---|
SCF::EXIT_ON_ERROR | The script will automatically terminate its execution process if an error is detected. |
SCF::LOG_ALL | Enables execution debugging. More information will be printed to the console in this mode. |
Seek positions
Name | Description |
---|---|
SEEK::CURRENT | Use an index at the end of the last read/write operation. |
SEEK::END | Use an index at the end of the data buffer. |
SEEK::RELATIVE | The index is between 0 and 1.0 and relative to the data size. |
SEEK::START | Use an index at position zero. |
Name | Description |
---|---|
STR::CASE | Perform a case-sensitive match. |
STR::MATCH_CASE | Perform a case-sensitive match. |
STR::MATCH_LEN | The strings must be of equal length to be matched. |
Types for StrDatatype().
Name | Description |
---|---|
STT::FLOAT | The string represents a floating point number. |
STT::HEX | The string represents a hexadecimal number. |
STT::NUMBER | The string represents a whole number. |
STT::STRING | The string represents plain-text. |
Thread flags
Name | Description |
---|---|
THF::AUTO_FREE | Automatically destroy the Thread object when the user routine has completed. |
Name | Description |
---|---|
TOI::ANDROID_ASSETMGR | |
TOI::ANDROID_CLASS | |
TOI::ANDROID_ENV | |
TOI::LOCAL_CACHE | |
TOI::LOCAL_STORAGE |
Task flags
Name | Description |
---|---|
TSF::ATTACHED | Forces new task to be attached to the parent (child will close when parent closes). |
TSF::DETACHED | Forces new task to be detached from the parent. |
TSF::FOREIGN | Set this flag when using the task object to execute a foreign process - that is an executable that does not use the Parasol API. |
TSF::LOG_ALL | Additional debug messages will be printed during normal usage of the task class when this flag is set. |
TSF::PIPE | Enable the output pipe to the launched process so that it can read data. |
TSF::PRIVILEGED | During a normal execution process, any privileges of the parent process will be dropped so that the child process runs unprivileged. This behaviour can be reversed if he PRIVILEGED flag is set, in which case the child process has the same privileges as the parent. |
TSF::QUIET | Setting this flag will divert all process output to /dev/null or the nearest equivalent for non-Unix systems. |
TSF::RESET_PATH | If set, the executed process will start in its own folder rather than the folder of the parent process. |
TSF::SHELL | Enables shell mode. On Unix systems, this means that a shell (usually BASH) will be used to launch the process. |
TSF::WAIT | This flag will cause the parent process to halt when the task is activated. Control is returned to the parent process once the child process terminates. |
Indicates the state of a process.
Name | Description |
---|---|
TSTATE::PAUSED | The process is asleep. |
TSTATE::RUNNING | The process is currently executing code. |
TSTATE::STOPPING | The process is in its termination phase. |
TSTATE::TERMINATED | The process has closed. |
For use by VirtualVolume()
Name | Description |
---|---|
VAS::CASE_SENSITIVE | Set to true if the volume's paths are case-sensitive. |
VAS::CLOSE_DIR | |
VAS::CREATE_LINK | |
VAS::DELETE | |
VAS::DEREGISTER | Remove the virtual volume from the system. |
VAS::DRIVER_SIZE | |
VAS::GET_DEVICE_INFO | |
VAS::GET_INFO | |
VAS::IDENTIFY_FILE | |
VAS::IGNORE_FILE | |
VAS::MAKE_DIR | |
VAS::OPEN_DIR | |
VAS::READ_LINK | |
VAS::RENAME | |
VAS::SAME_FILE | |
VAS::SCAN_DIR | |
VAS::TEST_PATH | |
VAS::WATCH_PATH |
VlogF flags
Name | Description |
---|---|
VLF::API | |
VLF::BRANCH | |
VLF::CRITICAL | |
VLF::DETAIL | |
VLF::ERROR | |
VLF::FUNCTION | |
VLF::INFO | |
VLF::TRACE | |
VLF::WARNING |
Options for SetVolume()
Name | Description |
---|---|
VOLUME::HIDDEN | Hides the volume so that it will not show up when reading volumes from the root path : . |
VOLUME::PRIORITY | If the volume already exists, the path will be inserted at the beginning of the path list so that it has priority over the others. |
VOLUME::REPLACE | If the volume already exists, all paths that are attached to it will be replaced with the new path setting. |
VOLUME::SYSTEM | Identifies the volume as being created by the system (this flag is not for client use). |
Field | Type | Description |
---|---|---|
Routine | APTR | Pointer to the function entry point |
ActionCode | AC | Action identifier |
Structure for ActionList
Field | Type | Description |
---|---|---|
Hash | ULONG | Hash of the action name. |
Size | LONG | Byte-size of the structure for this action. |
Name | CSTRING | Name of the action. |
Args | const struct FunctionField * | List of fields that are passed to this action. |
Structure for ListChildren() function
Field | Type | Description |
---|---|---|
ObjectID | OBJECTID | Object ID |
ClassID | CLASSID | The class ID of the referenced object. |
Generic structure for rectangular clipping.
Field | Type | Description |
---|---|---|
Left | LONG | Left-most coordinate |
Top | LONG | Top coordinate |
Right | LONG | Right-most coordinate |
Bottom | LONG | Bottom coordinate |
Field | Type | Description |
---|---|---|
RedShift | UBYTE | Right shift value for red (15/16 bit formats only) |
GreenShift | UBYTE | Right shift value for green |
BlueShift | UBYTE | Right shift value for blue |
AlphaShift | UBYTE | Right shift value for alpha |
RedMask | UBYTE | Unshifted mask value for red (ranges from 0x00 to 0xff) |
GreenMask | UBYTE | Unshifted mask value for green |
BlueMask | UBYTE | Unshifted mask value for blue |
AlphaMask | UBYTE | Unshifted mask value for alpha |
RedPos | UBYTE | Left shift/positional value for red |
GreenPos | UBYTE | Left shift/positional value for green |
BluePos | UBYTE | Left shift/positional value for blue |
AlphaPos | UBYTE | Left shift/positional value for alpha |
BitsPerPixel | UBYTE | Number of bits per pixel for this format. |
Field | Type | Description |
---|---|---|
OriginalSize | LARGE | Original size of the file |
CompressedSize | LARGE | Compressed size of the file |
Next | struct CompressedItem * | Used only if this is a linked-list. |
Path | CSTRING | Path to the file (includes folder prefixes). Archived folders will include the trailing slash. |
Permissions | PERMIT | Original permissions - see PERMIT flags. |
UserID | LONG | Original user ID |
GroupID | LONG | Original group ID |
OthersID | LONG | Original others ID |
Flags | FL | FL flags |
Created | struct DateTime | Date and time of the file's creation. |
Modified | struct DateTime | Date and time last modified. |
Field | Type | Description |
---|---|---|
FeedbackID | FDB | Set to one of the FDB event indicators |
Index | LONG | Index of the current file |
Path | CSTRING | Name of the current file/path in the archive |
Dest | CSTRING | Destination file/path during decompression |
Progress | LARGE | Progress indicator (byte position for the file being de/compressed). |
OriginalSize | LARGE | Original size of the file |
CompressedSize | LARGE | Compressed size of the file |
Year | WORD | Year of the original file's datestamp. |
Month | WORD | Month of the original file's datestamp. |
Day | WORD | Day of the original file's datestamp. |
Hour | WORD | Hour of the original file's datestamp. |
Minute | WORD | Minute of the original file's datestamp. |
Second | WORD | Second of the original file's datestamp. |
Generic structure for date-time management.
Field | Type | Description |
---|---|---|
Year | WORD | Year |
Month | BYTE | Month 1 to 12 |
Day | BYTE | Day 1 to 31 |
Hour | BYTE | Hour 0 to 23 |
Minute | BYTE | Minute 0 to 59 |
Second | BYTE | Second 0 to 59 |
TimeZone | BYTE | TimeZone -13 to +13 |
Used by OpenDir() only
Field | Type | Description |
---|---|---|
Info | struct FileInfo * | Pointer to a FileInfo structure |
Generic structure for declaring edge coordinates.
Field | Type | Description |
---|---|---|
Left | LONG | Left-most coordinate |
Top | LONG | Top coordinate |
Right | LONG | Right-most coordinate |
Bottom | LONG | Bottom coordinate |
64-bit floating point RGB colour value.
Field | Type | Description |
---|---|---|
Red | FLOAT | Red component value |
Green | FLOAT | Green component value |
Blue | FLOAT | Blue component value |
Alpha | FLOAT | Alpha component value |
Used to describe the public fields of a class.
Field | Type | Description |
---|---|---|
Arg | MAXINT | An option to complement the field type. Can be a pointer or an integer value |
GetValue | FUNCTION * | A virtual function that will retrieve the value for this field. |
SetValue | APTR | A virtual function that will set the value for this field. |
WriteValue | FUNCTION * | An internal function for writing to this field. |
Name | CSTRING | The English name for the field, e.g. Width |
FieldID | ULONG | Provides a fast way of finding fields, e.g. FID_Width |
Offset | UWORD | Field offset within the object |
Index | UWORD | Field array index |
Flags | ULONG | Special flags that describe the field |
Used to construct class blueprints for the MetaClass.
Field | Type | Description |
---|---|---|
Name | CSTRING | The name of the field, e.g. Width |
GetField | APTR | void GetField(*Object, APTR Result); |
SetField | APTR | ERR SetField(*Object, APTR Value); |
Arg | MAXINT | Can be a pointer or an integer value |
Flags | ULONG | Special flags that describe the field |
Used to define constants for field references.
Field | Type | Description |
---|---|---|
Name | CSTRING | The name of the constant. |
Value | LONG | The value of the constant. |
Field | Type | Description |
---|---|---|
Size | LARGE | Size of the file |
Position | LARGE | Current seek position within the file if moving or copying |
Path | STRING | Path to the file |
Dest | STRING | Destination file/path if moving or copying |
FeedbackID | FBK | Set to one of the FBK values |
Reserved | char | Reserved in case of future expansion |
Metadata for describing a file.
Field | Type | Description |
---|---|---|
Size | LARGE | The size of the file's content. |
TimeStamp | LARGE | 64-bit time stamp - usable only for comparison (e.g. sorting). |
Next | struct FileInfo * | Next structure in the list, or NULL . |
Name | STRING | The name of the file. |
Flags | RDF | Additional flags to describe the file. |
Permissions | PERMIT | Standard permission flags. |
UserID | LONG | User ID (Unix systems only). |
GroupID | LONG | Group ID (Unix systems only). |
Created | struct DateTime | The date/time of the file's creation. |
Modified | struct DateTime | The date/time of the last file modification. |
Function list array structure
Field | Type | Description |
---|---|---|
Address | APTR | Pointer to the function entry point |
Name | CSTRING | Name of the function |
Args | const struct FunctionField * | A list of parameters accepted by the function |
Used by ActionTable and Function structures to declare lists of parameters.
Field | Type | Description |
---|---|---|
Name | CSTRING | Name of the field |
Type | ULONG | Type of the field |
Colour structure for Hue, Saturation and Value/Light components.
Field | Type | Description |
---|---|---|
Hue | DOUBLE | Between 0 and 359.999 |
Saturation | DOUBLE | Between 0 and 1.0 |
Value | DOUBLE | Between 0 and 1.0. Corresponds to Value, Lightness or Brightness |
Alpha | DOUBLE | Alpha blending value from 0 to 1.0. |
Field | Type | Description |
---|---|---|
Next | const struct InputEvent * | Next event in the chain |
Value | DOUBLE | The value associated with the Type |
Timestamp | LARGE | PreciseTime() of the recorded input |
RecipientID | OBJECTID | Surface that the input message is being conveyed to |
OverID | OBJECTID | Surface that is directly under the mouse pointer at the time of the event |
AbsX | DOUBLE | Absolute horizontal position of mouse cursor (relative to the top left of the display) |
AbsY | DOUBLE | Absolute vertical position of mouse cursor (relative to the top left of the display) |
X | DOUBLE | Horizontal position relative to the surface that the pointer is over - unless a mouse button is held or pointer is anchored - then the coordinates are relative to the click-held surface |
Y | DOUBLE | Vertical position relative to the surface that the pointer is over - unless a mouse button is held or pointer is anchored - then the coordinates are relative to the click-held surface |
DeviceID | OBJECTID | The hardware device that this event originated from |
Type | JET | JET constant that describes the event |
Flags | JTYPE | Broad descriptors for the given Type (see JTYPE flags). Automatically defined when delivered to the pointer object |
Mask | JTYPE | Mask to use for checking against subscribers |
Field | Type | Description |
---|---|---|
Start | APTR | The starting address of the memory block (does not apply to shared blocks). |
ObjectID | OBJECTID | The object that owns the memory block. |
Size | ULONG | The size of the memory block. |
Flags | MEM | The type of memory. |
MemoryID | MEMORYID | The unique ID for this block. |
AccessCount | WORD | Total number of active locks on this block. |
Message header.
Field | Type | Description |
---|---|---|
Time | LARGE | A timestamp acquired from PreciseTime() when the message was first passed to SendMessage(). |
UID | LONG | A unique identifier automatically created by SendMessage(). |
Type | LONG | A message type identifier as defined by the client. |
Size | LONG | The byte-size of the message data, or zero if no data is provided. |
Required in calls to WaitForObjects().
Field | Type | Description |
---|---|---|
Object | OBJECTPTR | Reference to an object to monitor. |
16-bit RGB colour value.
Field | Type | Description |
---|---|---|
Red | UWORD | Red component value |
Green | UWORD | Green component value |
Blue | UWORD | Blue component value |
Alpha | UWORD | Alpha component value |
32-bit RGB colour value.
Field | Type | Description |
---|---|---|
Red | ULONG | Red component value |
Green | ULONG | Green component value |
Blue | ULONG | Blue component value |
Alpha | ULONG | Alpha component value |
8-bit RGB colour value.
Field | Type | Description |
---|---|---|
Red | UBYTE | Red component value |
Green | UBYTE | Green component value |
Blue | UBYTE | Blue component value |
Alpha | UBYTE | Alpha component value |
Field | Type | Description |
---|---|---|
AmtColours | LONG | Total colours |
Col | struct RGB8 | RGB Palette |
Returned by the GetSystemState() function.
Field | Type | Description |
---|---|---|
Platform | CSTRING | String-based field indicating the user's platform. Currently returns Native , Windows , OSX or Linux . |
ConsoleFD | HOSTHANDLE | Internal |
Stage | LONG | The current operating stage. -1 = Initialising, 0 indicates normal operating status; 1 means that the program is shutting down; 2 indicates a program restart; 3 is for mode switches. |
Field | Type | Description |
---|---|---|
Value | DOUBLE | The unit value. |
Type | ULONG | Additional type information |
Data feed structure for Audio
Field | Type | Description |
---|---|---|
Size | LONG | Byte size of this structure |
Format | LONG | Format of the audio data |
Field | Type | Description |
---|---|---|
Values | DOUBLE | The value(s) associated with the Type |
Timestamp | LARGE | PreciseTime() of the recorded input |
DeviceID | OBJECTID | The hardware device that this event originated from (note: This ID can be to a private/inaccessible object, the point is that the ID is unique) |
Flags | JTYPE | Broad descriptors for the given Type . Automatically defined when delivered to the pointer object |
Type | JET | JET constant |
Data feed structure for Keypress
Field | Type | Description |
---|---|---|
Flags | LONG | Shift/Control/CapsLock... |
Value | LONG | ASCII value of the key A/B/C/D... |
Timestamp | LARGE | PreciseTime() at which the keypress was recorded |
Unicode | LONG | Unicode value for pre-calculated key translations |
Data feed item request
Field | Type | Description |
---|---|---|
Item | LONG | Identifier for retrieval from the source |
Preference | char | Data preferences for the returned item(s) |