Difference between revisions of "Unit GraphicsConsole"
Line 99: | Line 99: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <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;">procedure GraphicsConsoleInit;</pre> | <pre style="border: 0; padding-bottom:0px;">procedure GraphicsConsoleInit;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Initialize the GraphicsConsole unit</div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
! '''Note''' | ! '''Note''' | ||
− | | | + | | Called only during system startup |
|- | |- | ||
|} | |} | ||
Line 201: | Line 201: | ||
! '''Return''' | ! '''Return''' | ||
| ERROR_SUCCESS if completed or another error code on failure | | 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 GraphicsWindowActivate(Handle:TWindowHandle):LongWord; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Make an existing console window the active window</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the window to activate | ||
+ | |- | ||
+ | ! '''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 GraphicsWindowDeactivate(Handle:TWindowHandle):LongWord; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Make an existing console window inactive</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the window to deactivate | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | On success there will be no active window set | ||
+ | |- | ||
+ | |} | ||
+ | </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 GraphicsWindowNext(Console:PConsoleDevice; Visible:Boolean):TWindowHandle; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the next console window starting with the active window</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Console''' | ||
+ | | The console device to change the active window on | ||
+ | |- | ||
+ | ! '''Visible''' | ||
+ | | If true only return windows that are visible | ||
+ | |- | ||
+ | ! '''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 GraphicsWindowPrevious(Console:PConsoleDevice; Visible:Boolean):TWindowHandle; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the previous console window starting with the active window</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Console''' | ||
+ | | The console device to change the active window on | ||
+ | |- | ||
+ | ! '''Visible''' | ||
+ | | If true only return windows that are visible | ||
+ | |- | ||
+ | ! '''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 GraphicsWindowAt(Console:PConsoleDevice; X,Y:LongWord; Visible:Boolean):TWindowHandle; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Find the console window that X and Y coordinates are within</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Console''' | ||
+ | | The console device to find the window on | ||
+ | |- | ||
+ | ! '''X''' | ||
+ | | The X coordinate to find the window for | ||
+ | |- | ||
+ | ! '''Y''' | ||
+ | | The Y coordinate to find the window for | ||
+ | |- | ||
+ | ! '''Visible''' | ||
+ | | If true only return windows that are visible | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | None documented | ||
|- | |- | ||
|} | |} | ||
Line 258: | Line 354: | ||
! '''Return''' | ! '''Return''' | ||
| True if the flag is set, False if not set | | True if the flag is set, False if not set | ||
+ | |- | ||
+ | |} | ||
+ | </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 GraphicsWindowUpdateFlag(Handle:TWindowHandle; Flag:LongWord; Clear:Boolean):LongWord; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set or clear a flag on an existing console window</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the window to set or clear the flag on | ||
+ | |- | ||
+ | ! '''Flag''' | ||
+ | | The window flag to set or clear (eg WINDOW_FLAG_LINE_WRAP) | ||
+ | |- | ||
+ | ! '''Clear''' | ||
+ | | If true clear the flag, else set it | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
|} | |} | ||
Line 726: | Line 843: | ||
! '''Font''' | ! '''Font''' | ||
| The font handle of the default font to set | | The font handle of the default font to set | ||
+ | |- | ||
+ | ! '''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 GraphicsWindowGetCursorXY(Handle:TWindowHandle; var X,Y:LongWord):LongWord; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current cursor X and Y positions of an existing console window</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the window to get cursor X and Y for | ||
+ | |- | ||
+ | ! '''X''' | ||
+ | | The returned cursor X value | ||
+ | |- | ||
+ | ! '''Y''' | ||
+ | | The returned cursor Y value | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | For Graphics Console functions, cursor X and Y are based on screen pixels not characters | ||
+ | |- | ||
+ | |} | ||
+ | </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 GraphicsWindowSetCursorXY(Handle:TWindowHandle; X,Y:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the current cursor X and Y positions of an existing console window</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the window to set cursor X and Y for | ||
+ | |- | ||
+ | ! '''X''' | ||
+ | | The new cursor X value | ||
+ | |- | ||
+ | ! '''Y''' | ||
+ | | The new cursor Y value | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | For Graphics Console functions, cursor X and Y are based on screen pixels not characters | ||
+ | |- | ||
+ | |} | ||
+ | </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 GraphicsWindowGetCursorMode(Handle:TWindowHandle):TCursorMode; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current cursor mode of an existing console window</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the window to get the mode for | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | The current cursor mode (eg CURSOR_MODE_INSERT) | ||
+ | |- | ||
+ | |} | ||
+ | </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 GraphicsWindowSetCursorMode(Handle:TWindowHandle; CursorMode:TCursorMode):LongWord; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the current cursor mode of an existing console window</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the window to set the mode for | ||
+ | |- | ||
+ | ! '''CursorMode''' | ||
+ | | The cursor mode to set (eg CURSOR_MODE_INSERT) | ||
+ | |- | ||
+ | ! '''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 GraphicsWindowGetCursorBlink(Handle:TWindowHandle):Boolean; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current cursor blink state of an existing console window</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the window to get blink state for | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | True if blink is enabled, False if not or on error | ||
+ | |- | ||
+ | |} | ||
+ | </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 GraphicsWindowSetCursorBlink(Handle:TWindowHandle; CursorBlink:Boolean):LongWord; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the current cursor blink state of an existing console window</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the window to set the blink state for | ||
+ | |- | ||
+ | ! '''CursorBlink''' | ||
+ | | True to enable blink, False to disable | ||
+ | |- | ||
+ | ! '''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 GraphicsWindowGetCursorState(Handle:TWindowHandle):TCursorState; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current cursor state of an existing console window</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the window to get the state for | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | The current cursor state (eg CURSOR_STATE_ON) | ||
+ | |- | ||
+ | |} | ||
+ | </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 GraphicsWindowSetCursorState(Handle:TWindowHandle; CursorState:TCursorState):LongWord; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the current cursor state of an existing console window</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the window to set the state for | ||
+ | |- | ||
+ | ! '''CursorState''' | ||
+ | | The cursor state to set (eg CURSOR_STATE_ON) | ||
+ | |- | ||
+ | ! '''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 GraphicsWindowGetCursorShape(Handle:TWindowHandle):TCursorShape; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current cursor shape of an existing console window</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the window to get the shape for | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | The current cursor shape (eg CURSORLINE) | ||
+ | |- | ||
+ | |} | ||
+ | </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 GraphicsWindowSetCursorShape(Handle:TWindowHandle; CursorShape:TCursorShape):LongWord; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the current cursor shape of an existing console window</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the window to set the shape for | ||
+ | |- | ||
+ | ! '''CursorShape''' | ||
+ | | The cursor shape to set (eg CURSORLINE) | ||
+ | |- | ||
+ | ! '''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 GraphicsWindowCursorOn(Handle:TWindowHandle):LongWord; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Enable the cursor on an existing console window</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the window to enable the cursor for | ||
+ | |- | ||
+ | ! '''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 GraphicsWindowCursorOff(Handle:TWindowHandle):LongWord; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Disable the cursor on an existing console window</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the window to disable the cursor for | ||
+ | |- | ||
+ | ! '''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 GraphicsWindowCursorLine(Handle:TWindowHandle):LongWord; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Change the cursor to a vertical line on an existing console window</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the window to change the cursor for | ||
+ | |- | ||
+ | ! '''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 GraphicsWindowCursorBar(Handle:TWindowHandle):LongWord; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Change the cursor to a horizontal bar on an existing console window</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the window to change the cursor for | ||
+ | |- | ||
+ | ! '''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 GraphicsWindowCursorBlock(Handle:TWindowHandle):LongWord; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Change the cursor to a solid block on an existing console window</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the window to change the cursor for | ||
+ | |- | ||
+ | ! '''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 GraphicsWindowCursorMove(Handle:TWindowHandle; X,Y:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Move the cursor on an existing console window</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the window to move the cursor for | ||
+ | |- | ||
+ | ! '''X''' | ||
+ | | The column to move the cursor to | ||
+ | |- | ||
+ | ! '''Y''' | ||
+ | | The row to move the cursor to | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | For Graphics Console functions, X and Y are based on screen pixels not characters | ||
+ | |- | ||
+ | |} | ||
+ | </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 GraphicsWindowCursorBlink(Handle:TWindowHandle; Enabled:Boolean):LongWord; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the blink state of the cursor on an existing console window</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the window to set the blink state for | ||
+ | |- | ||
+ | ! '''Enabled''' | ||
+ | | True if the cursor is blinking, False if not | ||
|- | |- | ||
! '''Return''' | ! '''Return''' | ||
Line 830: | Line 1,244: | ||
|- | |- | ||
! '''Y1''' | ! '''Y1''' | ||
− | | The top starting point of the | + | | The top starting point of the line (relative to current viewport) |
|- | |- | ||
! '''X2''' | ! '''X2''' | ||
− | | The right ending point of the | + | | The right ending point of the line (relative to current viewport) |
|- | |- | ||
! '''Y2''' | ! '''Y2''' | ||
− | | The bottom ending point of the | + | | The bottom ending point of the line (relative to current viewport) |
|- | |- | ||
! '''Color''' | ! '''Color''' | ||
Line 876: | Line 1,290: | ||
! '''Color''' | ! '''Color''' | ||
| The color to draw with (eg COLOR_WHITE) | | The color to draw with (eg COLOR_WHITE) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | For Graphics Console functions, Viewport is based on screen pixels not characters | ||
+ | |- | ||
+ | |} | ||
+ | </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 GraphicsWindowDrawCircle(Handle:TWindowHandle; X,Y,Color,Width,Radius:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Draw a circle on an existing console window</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the window to draw on | ||
+ | |- | ||
+ | ! '''X''' | ||
+ | | The left starting point of the circle (relative to current viewport) | ||
+ | |- | ||
+ | ! '''Y''' | ||
+ | | The top starting point of the circle (relative to current viewport) | ||
+ | |- | ||
+ | ! '''Color''' | ||
+ | | The color to draw with (eg COLOR_WHITE) | ||
+ | |- | ||
+ | ! '''Width''' | ||
+ | | The width of the circle outline | ||
+ | |- | ||
+ | ! '''Radius''' | ||
+ | | The radius of the circle | ||
|- | |- | ||
! '''Return''' | ! '''Return''' | ||
Line 1,256: | Line 1,703: | ||
|- | |- | ||
! '''Invert''' | ! '''Invert''' | ||
− | | If True invert the image | + | | If True invert the image so the first row is the bottom and the last row is the top |
|- | |- | ||
! '''Return''' | ! '''Return''' | ||
Line 1,298: | Line 1,745: | ||
|- | |- | ||
! '''Invert''' | ! '''Invert''' | ||
− | | If True invert the image | + | | If True invert the image so the first row is the bottom and the last row is the top |
|- | |- | ||
! '''Return''' | ! '''Return''' | ||
Line 1,322: | Line 1,769: | ||
! '''Return''' | ! '''Return''' | ||
| The current number of console windows on the specified console device | | The current number of console windows on the specified console device | ||
+ | |- | ||
+ | |} | ||
+ | </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 ConsoleWindowGetActive(Console:PConsoleDevice):TWindowHandle; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current console active window</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Console''' | ||
+ | | The console device to get the active window for | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | The window handle of the current active window or INVALID_HANDLE_VALUE on failure | ||
|- | |- | ||
|} | |} |
Revision as of 04:01, 24 March 2018
Return to Unit Reference
Contents
[hide]Description
Ultibo Graphics Console interface unit
The Graphics console unit provides access to the underlying framebuffer device as a pixel interface that allows putting blocks (or rectangles) of pixel data on to the screen or getting rectangles of pixel data from the screen. Functions are also included to copy a rectangle from one part of the screen to another and to put text (with a specified font) on to the screen.
Most image formats either consist of, or can be decoded to, a block of data that is a number of horizontal rows each with a number of pixels (columns) with each pixel containing color information in a certain bit size (8/16/24/32) and format (RGB/BGR/RGBA etc).
If the data exists in memory as a single contiguous block with each row following directly after the previous row then that can be passed directly to the functions in this unit (eg GraphicsWindowDrawImage) to be drawn on the screen.
Many graphics libraries do image manipulation, rendering and compositing to a memory buffer in a form that is compatible with the functions in this unit so a complex image can be constructed in memory and then transferred to the screen in a single operation. This is sometimes referred to as a bit block transfer or BitBlt and is a very standard technique for rendering both text and images to a framebuffer device.
This unit extends the console unit by creating a new type of console window (WINDOW_MODE_GRAPHICS) and therefore allows both text console windows and graphics console windows to co-exist on the screen at once.
The functions in this unit cannot be used to draw on a text console window (WINDOW_MODE_TEXT) and vice versa the functions in the console unit cannot be used to draw on a graphics console window.
Like the console unit, the graphics console supports setting a viewport for a specified window to allow masking the area to be written to. However the graphics console does not support a tracking a cursor X and Y position. Setting a window as the default is also not supported since that functionality is purely intended to support the RTL functions for text output.
Graphics windows can only be created on console devices which have a mode of CONSOLE_MODE_PIXEL.
Notes: Unlike the Console unit, Graphics console coordinates are always based on pixels not characters. Graphics console coordinates begin at 0,0 and extend to Width - 1, Height - 1. Graphics Window coordinates X,Y are always based on pixels, beginning at 0,0 and extending to Cols - 1, Rows - 1.
Constants
None defined
Type definitions
Graphics window enumeration callback
TGraphicsWindowEnumerate = TConsoleWindowEnumerate;
|
Graphics window types
Class definitions
Graphic image
TGraphicImage = class(TObject)
Public variables
None defined
Function declarations
Initialization functions
Graphics console functions
function GraphicsWindowCreate(Console:PConsoleDevice; Position:LongWord):TWindowHandle;
function GraphicsWindowCreateEx(Console:PConsoleDevice; Font:TFontHandle; Size,State,Mode,Position:LongWord):TWindowHandle;
function GraphicsWindowDestroy(Handle:TWindowHandle):LongWord; inline;
function GraphicsWindowShow(Handle:TWindowHandle):LongWord; inline;
function GraphicsWindowHide(Handle:TWindowHandle):LongWord; inline;
function GraphicsWindowActivate(Handle:TWindowHandle):LongWord; inline;
function GraphicsWindowDeactivate(Handle:TWindowHandle):LongWord; inline;
function GraphicsWindowNext(Console:PConsoleDevice; Visible:Boolean):TWindowHandle; inline;
function GraphicsWindowPrevious(Console:PConsoleDevice; Visible:Boolean):TWindowHandle; inline;
function GraphicsWindowAt(Console:PConsoleDevice; X,Y:LongWord; Visible:Boolean):TWindowHandle; inline;
function GraphicsWindowFind(Console:PConsoleDevice; Position:LongWord):TWindowHandle; inline;
function GraphicsWindowEnumerate(Console:PConsoleDevice; Callback:TGraphicsWindowEnumerate; Data:Pointer):LongWord; inline;
function GraphicsWindowCheckFlag(Handle:TWindowHandle; Flag:LongWord):Boolean; inline;
function GraphicsWindowUpdateFlag(Handle:TWindowHandle; Flag:LongWord; Clear:Boolean):LongWord; inline;
function GraphicsWindowGetMode(Handle:TWindowHandle):LongWord; inline;
function GraphicsWindowGetState(Handle:TWindowHandle):LongWord; inline;
function GraphicsWindowGetPosition(Handle:TWindowHandle):LongWord; inline;
function GraphicsWindowSetPosition(Handle:TWindowHandle; Position:LongWord):LongWord;
function GraphicsWindowGetProperties(Handle:TWindowHandle; Properties:PWindowProperties):LongWord; inline;
function GraphicsWindowGetMinX(Handle:TWindowHandle):LongWord;
function GraphicsWindowGetMinY(Handle:TWindowHandle):LongWord;
function GraphicsWindowGetMaxX(Handle:TWindowHandle):LongWord;
function GraphicsWindowGetMaxY(Handle:TWindowHandle):LongWord;
function GraphicsWindowGetRect(Handle:TWindowHandle):TConsoleRect; inline;
function GraphicsWindowSetRect(Handle:TWindowHandle; const ARect:TConsoleRect):LongWord; inline;
function GraphicsWindowResetRect(Handle:TWindowHandle):LongWord; inline;
function GraphicsWindowGetViewport(Handle:TWindowHandle; var X1,Y1,X2,Y2:LongWord):LongWord;
function GraphicsWindowSetViewport(Handle:TWindowHandle; X1,Y1,X2,Y2:LongWord):LongWord;
function GraphicsWindowResetViewport(Handle:TWindowHandle):LongWord;
function GraphicsWindowGetCols(Handle:TWindowHandle):LongWord;
function GraphicsWindowGetRows(Handle:TWindowHandle):LongWord;
function GraphicsWindowGetWidth(Handle:TWindowHandle):LongWord;
function GraphicsWindowGetHeight(Handle:TWindowHandle):LongWord;
function GraphicsWindowGetFormat(Handle:TWindowHandle):LongWord;
function GraphicsWindowGetForecolor(Handle:TWindowHandle):LongWord;
function GraphicsWindowSetForecolor(Handle:TWindowHandle; Color:LongWord):LongWord;
function GraphicsWindowGetBackcolor(Handle:TWindowHandle):LongWord;
function GraphicsWindowSetBackcolor(Handle:TWindowHandle; Color:LongWord):LongWord;
function GraphicsWindowGetFont(Handle:TWindowHandle):TFontHandle;
function GraphicsWindowSetFont(Handle:TWindowHandle; Font:TFontHandle):LongWord;
function GraphicsWindowGetCursorXY(Handle:TWindowHandle; var X,Y:LongWord):LongWord; inline;
function GraphicsWindowSetCursorXY(Handle:TWindowHandle; X,Y:LongWord):LongWord;
function GraphicsWindowGetCursorMode(Handle:TWindowHandle):TCursorMode; inline;
function GraphicsWindowSetCursorMode(Handle:TWindowHandle; CursorMode:TCursorMode):LongWord; inline;
function GraphicsWindowGetCursorBlink(Handle:TWindowHandle):Boolean; inline;
function GraphicsWindowSetCursorBlink(Handle:TWindowHandle; CursorBlink:Boolean):LongWord; inline;
function GraphicsWindowGetCursorState(Handle:TWindowHandle):TCursorState; inline;
function GraphicsWindowSetCursorState(Handle:TWindowHandle; CursorState:TCursorState):LongWord; inline;
function GraphicsWindowGetCursorShape(Handle:TWindowHandle):TCursorShape; inline;
function GraphicsWindowSetCursorShape(Handle:TWindowHandle; CursorShape:TCursorShape):LongWord; inline;
function GraphicsWindowCursorOn(Handle:TWindowHandle):LongWord; inline;
function GraphicsWindowCursorOff(Handle:TWindowHandle):LongWord; inline;
function GraphicsWindowCursorLine(Handle:TWindowHandle):LongWord; inline;
function GraphicsWindowCursorBar(Handle:TWindowHandle):LongWord; inline;
function GraphicsWindowCursorBlock(Handle:TWindowHandle):LongWord; inline;
function GraphicsWindowCursorMove(Handle:TWindowHandle; X,Y:LongWord):LongWord;
function GraphicsWindowCursorBlink(Handle:TWindowHandle; Enabled:Boolean):LongWord; inline;
function GraphicsWindowClear(Handle:TWindowHandle):LongWord;
function GraphicsWindowClearEx(Handle:TWindowHandle; X1,Y1,X2,Y2,Color:LongWord):LongWord;
function GraphicsWindowDrawBox(Handle:TWindowHandle; X1,Y1,X2,Y2,Color,Width:LongWord):LongWord;
function GraphicsWindowDrawLine(Handle:TWindowHandle; X1,Y1,X2,Y2,Color,Width:LongWord):LongWord;
function GraphicsWindowDrawBlock(Handle:TWindowHandle; X1,Y1,X2,Y2,Color:LongWord):LongWord;
function GraphicsWindowDrawCircle(Handle:TWindowHandle; X,Y,Color,Width,Radius:LongWord):LongWord;
function GraphicsWindowDrawChar(Handle:TWindowHandle; Ch:Char; X,Y:LongWord):LongWord;
function GraphicsWindowDrawCharEx(Handle:TWindowHandle; Font:TFontHandle; Ch:Char; X,Y,Forecolor,Backcolor:LongWord):LongWord;
function GraphicsWindowDrawText(Handle:TWindowHandle; const Text:String; X,Y:LongWord):LongWord;
function GraphicsWindowDrawTextEx(Handle:TWindowHandle; Font:TFontHandle; const Text:String; X,Y,Forecolor,Backcolor:LongWord):LongWord;
function GraphicsWindowDrawPixel(Handle:TWindowHandle; X,Y,Color:LongWord):LongWord;
function GraphicsWindowDrawImage(Handle:TWindowHandle; X,Y:LongWord; Image:Pointer; Width,Height,Format:LongWord):LongWord;
function GraphicsWindowGetPixel(Handle:TWindowHandle; X,Y:LongWord):LongWord;
function GraphicsWindowGetImage(Handle:TWindowHandle; X,Y:LongWord; Image:Pointer; Width,Height,Format:LongWord):LongWord;
function GraphicsWindowCopyImage(Handle:TWindowHandle; const Source,Dest:TConsolePoint; Width,Height:LongWord):LongWord; inline;
function GraphicsWindowMoveImage(Handle:TWindowHandle; const Source,Dest:TConsolePoint; Width,Height,Fillcolor:LongWord):LongWord;
function GraphicsWindowImageSize(Handle:TWindowHandle; Width,Height,Format,Stride:LongWord):LongWord;
function GraphicsWindowImageFromStream(Handle:TWindowHandle; X,Y:LongWord; Stream:TStream; Width,Height,Format,Stride:LongWord; Invert:Boolean):LongWord;
function GraphicsWindowImageToStream(Handle:TWindowHandle; X,Y:LongWord; Stream:TStream; Width,Height,Format,Stride:LongWord; Invert:Boolean):LongWord;
Graphics console helper functions
function GraphicsWindowGetCount(Console:PConsoleDevice):LongWord; inline;
function ConsoleWindowGetActive(Console:PConsoleDevice):TWindowHandle; inline;
function GraphicsWindowCheck(Console:PConsoleDevice; Window:PGraphicsWindow):PGraphicsWindow; inline;
Return to Unit Reference