Difference between revisions of "Unit Touch"
From Ultibo.org
Line 24: | Line 24: | ||
=== Function declarations === | === Function declarations === | ||
---- | ---- | ||
+ | |||
'''Initialization functions''' | '''Initialization functions''' | ||
Line 35: | Line 36: | ||
! '''Note''' | ! '''Note''' | ||
| Called only during system startup | | Called only during system startup | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Touch functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TouchDeviceStart(Touch:PTouchDevice):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Start the specified Touch device ready for receiving events</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Touch''' | ||
+ | | The Touch device to start | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TouchDeviceStop(Touch:PTouchDevice):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Stop the specified Touch device and terminate receiving events</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Touch''' | ||
+ | | The Touch device to stop | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TouchDevicePeek(Touch:PTouchDevice):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Peek at the buffer of the specified touch device to see if any data packets are ready</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Touch''' | ||
+ | | The Touch device to peek at | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if packets are ready, ERROR_NO_MORE_ITEMS if not or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TouchDeviceRead(Touch:PTouchDevice; Buffer:Pointer; Size,Flags:LongWord; var Count:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Read touch data packets from the buffer of the specified touch device</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Touch''' | ||
+ | | The Touch device to read from | ||
+ | |- | ||
+ | ! '''Buffer''' | ||
+ | | Pointer to a buffer to copy the touch data packets to | ||
+ | |- | ||
+ | ! '''Size''' | ||
+ | | The size of the buffer in bytes (Must be at least TTouchData or greater) | ||
+ | |- | ||
+ | ! '''Flags''' | ||
+ | | The flags for the behaviour of the read (eg TOUCH_FLAG_NON_BLOCK) | ||
+ | |- | ||
+ | ! '''Count''' | ||
+ | | The number of touch data packets copied to the buffer | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TouchDeviceWrite(Touch:PTouchDevice; Buffer:Pointer; Size,Count:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Write touch data packets to the buffer of the specified touch device</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Touch''' | ||
+ | | The Touch device to write to | ||
+ | |- | ||
+ | ! '''Buffer''' | ||
+ | | Pointer to a buffer to copy the touch data packets from | ||
+ | |- | ||
+ | ! '''Size''' | ||
+ | | The size of the buffer in bytes (Must be at least TTouchData or greater) | ||
+ | |- | ||
+ | ! '''Count''' | ||
+ | | The number of touch data packets to copy from the buffer | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TouchDeviceFlush(Touch:PTouchDevice):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Flush the contents of the buffer of the specified touch device</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Touch''' | ||
+ | | The Touch device to flush | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TouchDeviceControl(Touch:PTouchDevice; Request:Integer; Argument1:LongWord; var Argument2:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Perform a control request on the specified touch device</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Touch''' | ||
+ | | The Touch device to control | ||
+ | |- | ||
+ | ! '''Request''' | ||
+ | | The request code for the operation (eg TOUCH_CONTROL_GET_FLAG) | ||
+ | |- | ||
+ | ! '''Argument1''' | ||
+ | | The first argument for the operation (Dependant on request code) | ||
+ | |- | ||
+ | ! '''Argument2''' | ||
+ | | The second argument for the operation (Dependant on request code) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TouchDeviceProperties(Touch:PTouchDevice; Properties:PTouchProperties):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the properties for the specified Touch device</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Touch''' | ||
+ | | The Touch device to get properties from | ||
+ | |- | ||
+ | ! '''Properties''' | ||
+ | | Pointer to a TTouchProperties structure to fill in | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TouchDeviceCreate:PTouchDevice;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create a new Touch device entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | Pointer to new Touch device entry or nil if Touch device could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TouchDeviceCreateEx(Size:LongWord):PTouchDevice;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create a new Touch device entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Size''' | ||
+ | | Size in bytes to allocate for new Touch device (Including the Touch device entry) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | Pointer to new Touch device entry or nil if Touch device could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TouchDeviceDestroy(Touch:PTouchDevice):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy an existing Touch device entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TouchDeviceRegister(Touch:PTouchDevice):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Register a new Touch device in the Touch device table</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TouchDeviceDeregister(Touch:PTouchDevice):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Deregister an Touch device from the Touch device table</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TouchDeviceFind(TouchId:LongWord):PTouchDevice;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TouchDeviceFindByName(const Name:String):PTouchDevice; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TouchDeviceFindByDescription(const Description:String):PTouchDevice; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TouchDeviceEnumerate(Callback:TTouchEnumerate; Data:Pointer):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TouchDeviceNotification(Touch:PTouchDevice; Callback:TTouchNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | None documented | ||
|- | |- | ||
|} | |} |
Revision as of 00:37, 13 October 2016
Return to Unit Reference
Description
To be documented
Constants
To be documented
Type definitions
To be documented
Public variables
To be documented
Function declarations
Initialization functions
procedure TouchInit;
Description: Initialize the Touch unit and Touch device table
Note | Called only during system startup |
---|
Touch functions
function TouchDeviceStart(Touch:PTouchDevice):LongWord;
Description: Start the specified Touch device ready for receiving events
Touch | The Touch device to start |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function TouchDeviceStop(Touch:PTouchDevice):LongWord;
Description: Stop the specified Touch device and terminate receiving events
Touch | The Touch device to stop |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function TouchDevicePeek(Touch:PTouchDevice):LongWord;
Description: Peek at the buffer of the specified touch device to see if any data packets are ready
Touch | The Touch device to peek at |
---|---|
Return | ERROR_SUCCESS if packets are ready, ERROR_NO_MORE_ITEMS if not or another error code on failure |
function TouchDeviceRead(Touch:PTouchDevice; Buffer:Pointer; Size,Flags:LongWord; var Count:LongWord):LongWord;
Description: Read touch data packets from the buffer of the specified touch device
Touch | The Touch device to read from |
---|---|
Buffer | Pointer to a buffer to copy the touch data packets to |
Size | The size of the buffer in bytes (Must be at least TTouchData or greater) |
Flags | The flags for the behaviour of the read (eg TOUCH_FLAG_NON_BLOCK) |
Count | The number of touch data packets copied to the buffer |
Return | ERROR_SUCCESS if completed or another error code on failure |
function TouchDeviceWrite(Touch:PTouchDevice; Buffer:Pointer; Size,Count:LongWord):LongWord;
Description: Write touch data packets to the buffer of the specified touch device
Touch | The Touch device to write to |
---|---|
Buffer | Pointer to a buffer to copy the touch data packets from |
Size | The size of the buffer in bytes (Must be at least TTouchData or greater) |
Count | The number of touch data packets to copy from the buffer |
Return | ERROR_SUCCESS if completed or another error code on failure |
function TouchDeviceFlush(Touch:PTouchDevice):LongWord;
Description: Flush the contents of the buffer of the specified touch device
Touch | The Touch device to flush |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function TouchDeviceControl(Touch:PTouchDevice; Request:Integer; Argument1:LongWord; var Argument2:LongWord):LongWord;
Description: Perform a control request on the specified touch device
Touch | The Touch device to control |
---|---|
Request | The request code for the operation (eg TOUCH_CONTROL_GET_FLAG) |
Argument1 | The first argument for the operation (Dependant on request code) |
Argument2 | The second argument for the operation (Dependant on request code) |
Return | ERROR_SUCCESS if completed or another error code on failure |
function TouchDeviceProperties(Touch:PTouchDevice; Properties:PTouchProperties):LongWord;
Description: Get the properties for the specified Touch device
Touch | The Touch device to get properties from |
---|---|
Properties | Pointer to a TTouchProperties structure to fill in |
Return | ERROR_SUCCESS if completed or another error code on failure |
function TouchDeviceCreate:PTouchDevice;
Description: Create a new Touch device entry
Return | Pointer to new Touch device entry or nil if Touch device could not be created |
---|
function TouchDeviceCreateEx(Size:LongWord):PTouchDevice;
Description: Create a new Touch device entry
Size | Size in bytes to allocate for new Touch device (Including the Touch device entry) |
---|---|
Return | Pointer to new Touch device entry or nil if Touch device could not be created |
function TouchDeviceDestroy(Touch:PTouchDevice):LongWord;
Description: Destroy an existing Touch device entry
Note | None documented |
---|
function TouchDeviceRegister(Touch:PTouchDevice):LongWord;
Description: Register a new Touch device in the Touch device table
Note | None documented |
---|
function TouchDeviceDeregister(Touch:PTouchDevice):LongWord;
Description: Deregister an Touch device from the Touch device table
Note | None documented |
---|
function TouchDeviceFind(TouchId:LongWord):PTouchDevice;
Description: To be documented
Note | None documented |
---|
function TouchDeviceFindByName(const Name:String):PTouchDevice; inline;
Description: To be documented
Note | None documented |
---|
function TouchDeviceFindByDescription(const Description:String):PTouchDevice; inline;
Description: To be documented
Note | None documented |
---|
function TouchDeviceEnumerate(Callback:TTouchEnumerate; Data:Pointer):LongWord;
Description: To be documented
Note | None documented |
---|
function TouchDeviceNotification(Touch:PTouchDevice; Callback:TTouchNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: To be documented
Note | None documented |
---|
Return to Unit Reference