This documenta- tion describes the current state of development.
Note that interfaces and functionality may still change.

Prokee Modules:
  A
  B
  C
  D
  E
  F
  G
  I
  L
  M
  N
  O
  P
  R
  S
  T
  U
  W

     open all    |    close all

GUI Elements:
  B
  C
  I
  M
  P
  R
  S
  T

     open all    |    close all

GUI Interactions:
  B
  F
  H
  S

     open all    |    close all

GUI Layouts:
  L

     open all    |    close all

Games/Demos:
  M

     open all    |    close all

Third Party Libraries:
  P
  F
  Z

     open all    |    close all

Information about this Website / Informationen zu dieser Webseite:
In case of any questions, or comments, please feel free to contact me via email at apoll500@gmail.com.

Module tio [Version: v01]

This documentation describes the Prokee module interface.


Static Methods:
getLines
int tio::getLines()
getColumns
int tio::getColumns()
startup
bool tio::startup()
cleanup
bool tio::cleanup()
scan_key
int tio::scan_key()
main
int tio::main(int argc,char **argv)
createContext
struct tio_screen *tio::createContext(const char *name,struct tio_color sfgc,struct tio_color sbgc,struct tio_color fgc,struct tio_color bgc)
createScreen
struct tio_screen *tio::createScreen(struct tio_screen *context,const char *screen_title,int x,int y,int xx,int yy)
createWindow
struct tio_screen *tio::createWindow(struct tio_screen *screen,const char *window_title,int x,int y,int xx,int yy)
destroy
void tio::destroy(struct tio_screen *screen)
fitContextToTerminalSize
void tio::fitContextToTerminalSize(struct tio_screen *context)
fitScreenToTerminalSize
void tio::fitScreenToTerminalSize(struct tio_screen *screen,bool reallocBuffer)
fitWindowToParent
void tio::fitWindowToParent(struct tio_screen *window,bool reallocBuffer)
reallocBufferToWindowSize
void tio::reallocBufferToWindowSize(struct tio_screen *window)
draw
void tio::draw(struct tio_screen *screen)
drawContext
void tio::drawContext(struct tio_screen *context)
drawWindow
void tio::drawWindow(struct tio_screen *window)
locate
void tio::locate(struct tio_screen *window,int px,int py)
printString (version 1)
void tio::printString(struct tio_screen *window,const char *str)
printString (version 2)
void tio::printString(struct tio_screen *window,int px,int py,const char *str)
printString (version 3)
void tio::printString(struct tio_screen *window,int px,int py,const char *str,struct tio_color fg,struct tio_color bg)
updateDisplay
void tio::updateDisplay(struct tio_screen *context)
redim_plain
void tio::redim_plain(struct tio_screen *window,int xx,int yy)
reset
void tio::reset()

Motivation

This module provides some convenience functions for interactive terminal applications to print colored unicode characters to the terminal as well as drawing text-based elements like "windows" and "screens" to the terminal. The module also provides some functions to read user input (from standard input) on a character by character basis (which allows waiting for the next character input). The module is intended to be used under Linux. It has been tested with the xfce4-terminal. Even though the module also compiles for Windows, it does not provide Unicode support and ANSI escape sequences (for colored output). There were no intentions from the author to implement equivalent functionality for the standard windows command prompt (Windows Console) due to lack of full Unicode support. According to Wikipedia this has changed: "As of the Windows 10 October 2018 update, the Windows Console has full Unicode support."


Static Methods

   getLines


Returns the number of lines of the console window.

Signature:
int tio::getLines()

Return value:
Number of lines.

   getColumns


Returns the number of columns of the console window.

Signature:
int tio::getColumns()

Return value:
Number of columns.

   startup


Performs initialization for tio functions.

Call this function before calling any other tio functions.

Function tio::cleanup() should be called after using tio.

Signature:
bool tio::startup()

Return value:
Returns true.

   cleanup


Performs cleanup for tio.

The function restores the console to the previous mode.

Signature:
bool tio::cleanup()

Return value:
Returns true.

   scan_key


Returns the next input character or pressed key (or combination of keys).

If the input buffer is empty, the function waits until the user presses a key.

Signature:
int tio::scan_key()

Return value:
The character or key.

   main


Prints a demo screen.

Signature:
int tio::main(int argc,char **argv)

Parameters:
Type Name Direction Description
int argcThe number of command-line parameters.
char **argv[IN]The command-line parameters.

Return value:
Exit status.

   createContext


Constructs a new display context.

...

Signature:
struct tio_screen *tio::createContext(const char *name,struct tio_color sfgc,struct tio_color sbgc,struct tio_color fgc,struct tio_color bgc)

Parameters:
Type Name Direction Description
const char *name[IN]The null-terminated name of the context.
struct tio_color sfgcThe standard foreground color of selected elements.
struct tio_color sbgcThe standard background color of selected elements.
struct tio_color fgcThe standard foreground color.
struct tio_color bgcThe standard background color.

Return value:
Pointer to the context.

   createScreen


Constructs a new screen.

...

Signature:
struct tio_screen *tio::createScreen(struct tio_screen *context,const char *screen_title,int x,int y,int xx,int yy)

Parameters:
Type Name Direction Description
struct tio_screen *context[IN/OUT]...
const char *screen_title[IN]The null-terminated title-text of the screen.
int x
int y
int xx
int yy

Return value:
Pointer to the screen.

   createWindow


Constructs a new window.

...

Signature:
struct tio_screen *tio::createWindow(struct tio_screen *screen,const char *window_title,int x,int y,int xx,int yy)

Parameters:
Type Name Direction Description
struct tio_screen *screen[IN/OUT]...
const char *window_title[IN]The null-terminated title-text of the window.
int x
int y
int xx
int yy

Return value:
Pointer to the window.

   destroy


Destructs a context, screen or window (and all its sub-screens and sub-windows).

Call this function on the context (the root window) to free resources of all windows in the window tree.

Signature:
void tio::destroy(struct tio_screen *screen)

Parameters:
Type Name Direction Description
struct tio_screen *screen[IN]a context, screen or window

   fitContextToTerminalSize


...

Signature:
void tio::fitContextToTerminalSize(struct tio_screen *context)

Parameters:
Type Name Direction Description
struct tio_screen *context[IN/OUT]...

   fitScreenToTerminalSize


...

Signature:
void tio::fitScreenToTerminalSize(struct tio_screen *screen,bool reallocBuffer)

Parameters:
Type Name Direction Description
struct tio_screen *screen[IN/OUT]...
bool reallocBuffer...

   fitWindowToParent


...

Signature:
void tio::fitWindowToParent(struct tio_screen *window,bool reallocBuffer)

Parameters:
Type Name Direction Description
struct tio_screen *window[IN/OUT]...
bool reallocBuffer...

   reallocBufferToWindowSize


...

Signature:
void tio::reallocBufferToWindowSize(struct tio_screen *window)

Parameters:
Type Name Direction Description
struct tio_screen *window[IN/OUT]...

   draw


Draws the screen, context or window.

Signature:
void tio::draw(struct tio_screen *screen)

Parameters:
Type Name Direction Description
struct tio_screen *screen[IN/OUT]...

   drawContext


Draws the context.

Signature:
void tio::drawContext(struct tio_screen *context)

Parameters:
Type Name Direction Description
struct tio_screen *context[IN/OUT]...

   drawWindow


Draws the screen or window.

Signature:
void tio::drawWindow(struct tio_screen *window)

Parameters:
Type Name Direction Description
struct tio_screen *window[IN/OUT]...

   locate


Positions the window cursor.

Signature:
void tio::locate(struct tio_screen *window,int px,int py)

Parameters:
Type Name Direction Description
struct tio_screen *window[IN/OUT]...
int pxColumn number.
int pyLine number.

   printString (version 1)


Prints a string within a window at the current cursor location.

Signature:
void tio::printString(struct tio_screen *window,const char *str)

Parameters:
Type Name Direction Description
struct tio_screen *window[IN/OUT]...
const char *strA null-terminated string.

   printString (version 2)


Prints a string within a window at column px and line py.

Signature:
void tio::printString(struct tio_screen *window,int px,int py,const char *str)

Parameters:
Type Name Direction Description
struct tio_screen *window[IN/OUT]...
int pxColumn number.
int pyLine number.
const char *strA null-terminated string.

   printString (version 3)


Prints a string within a window at a given location with given colors.

Signature:
void tio::printString(struct tio_screen *window,int px,int py,const char *str,struct tio_color fg,struct tio_color bg)

Parameters:
Type Name Direction Description
struct tio_screen *window[IN/OUT]...
int pxColumn number.
int pyLine number.
const char *strA null-terminated string.
struct tio_color fgThe foreground color.
struct tio_color bgThe background color.

   updateDisplay


Updates the display.

Signature:
void tio::updateDisplay(struct tio_screen *context)

Parameters:
Type Name Direction Description
struct tio_screen *context[IN/OUT]...

   redim_plain


...

Signature:
void tio::redim_plain(struct tio_screen *window,int xx,int yy)

Parameters:
Type Name Direction Description
struct tio_screen *window[IN/OUT]...
int xx
int yy

   reset


Resets the display.

Signature:
void tio::reset()


Copyright © 2017 - 2019 by Andreas Pollhammer