This documentation describes the Prokee module interface.
Static Methods:
main
int aprint::main(int argc,char **argv)
locate
void aprint::locate(int row,int col)
moveUp
void aprint::moveUp(int n)
font
void aprint::font(int n)
reset
void aprint::reset()
faint
void aprint::faint()
blink
void aprint::blink()
color (version 2)
void aprint::color(unsigned char r,unsigned char g,unsigned char b)
loadstat
void aprint::loadstat(float state,int size)
Motivation
Static Methods
main
Runs
aprint as if it would be called from the command-line.
See
Commandline-Interface.
Signature:
int aprint::main(int argc,char **argv)
Parameters:
| int | argc | | The number of command-line parameters. |
| char ** | argv | [IN] | The command-line parameters. |
Return value:Exit status.
cls (version 1)
Clears the screen.
Signature:
void aprint::cls()
Code: toggle
void aprint::cls()
{
cls(2);
}
cls (version 2)
Clears the screen.
Signature:
void aprint::cls(int n)
Parameters:
Code: toggle
void aprint::cls(int n)
{
command(n,'J');
}
cll (version 1)
Clears the screen.
Signature:
void aprint::cll()
Code: toggle
void aprint::cll()
{
cll(2);
}
cll (version 2)
Clears the screen.
Signature:
void aprint::cll(int n)
Parameters:
Code: toggle
void aprint::cll(int n)
{
command(n,'K');
}
locate
Places the cursor at line
row and column
col.
Signature:
void aprint::locate(int row,int col)
Parameters:
| int | row | | Number of the line. |
| int | col | | Number of the column. |
Code: toggle
void aprint::locate(int row,int col)
{
command(row,col,'H');
}
save
Stores the current position of the cursor.
Signature:
void aprint::save()
Code: toggle
void aprint::save()
{
command('s');
}
restore
Restores the position of the cursor to the last stored position.
Signature:
void aprint::restore()
Code: toggle
void aprint::restore()
{
command('u');
}
hide
Hides the cursor.
Signature:
void aprint::hide()
Code: toggle
void aprint::hide()
{
printf("%c[?25l",27);
}
show
Shows the cursor (makes the cursor visible).
Signature:
void aprint::show()
Code: toggle
void aprint::show()
{
printf("%c[?25h",27);
}
moveUp
Moves the cursor.
Signature:
void aprint::moveUp(int n)
Parameters:
Code: toggle
void aprint::moveUp(int n)
{
command(n,'A');
}
moveDown
Moves the cursor.
Signature:
void aprint::moveDown(int n)
Parameters:
Code: toggle
void aprint::moveDown(int n)
{
command(n,'B');
}
moveRight
Moves the cursor.
Signature:
void aprint::moveRight(int n)
Parameters:
Code: toggle
void aprint::moveRight(int n)
{
command(n,'C');
}
moveLeft
Moves the cursor.
Signature:
void aprint::moveLeft(int n)
Parameters:
Code: toggle
void aprint::moveLeft(int n)
{
command(n,'D');
}
font
Selects a font.
Signature:
void aprint::font(int n)
Parameters:
Code: toggle
void aprint::font(int n)
{
command(n,'m');
}
reset
Resets the font.
Signature:
void aprint::reset()
Code: toggle
void aprint::reset()
{
command(0,'m');
}
bold
Bold font.
Signature:
void aprint::bold()
Code: toggle
void aprint::bold()
{
command(1,'m');
}
faint
Faint font.
Signature:
void aprint::faint()
Code: toggle
void aprint::faint()
{
command(2,'m');
}
normal
Normal font.
Signature:
void aprint::normal()
Code: toggle
void aprint::normal()
{
command(22,'m');
}
blink
Blinking font.
Signature:
void aprint::blink()
Code: toggle
void aprint::blink()
{
command(5,'m');
}
inv
Font with inverted colors.
Signature:
void aprint::inv()
Code: toggle
void aprint::inv()
{
command(7,'m');
}
color (version 1)
Sets the foreground color.
Signature:
void aprint::color(int c)
Parameters:
Code: toggle
void aprint::color(int c)
{
command(30+c,'m');
}
color (version 2)
Sets the foreground color.
Signature:
void aprint::color(unsigned char r,unsigned char g,unsigned char b)
Parameters:
| unsigned char | r | | red. |
| unsigned char | g | | green. |
| unsigned char | b | | blue. |
Code: toggle
void aprint::color(unsigned char r,unsigned char g,unsigned char b)
{
printf("%c[%d;2;%d;%d;%dm",27,38,r,g,b);
}
bgcolor (version 1)
Sets the background color.
Signature:
void aprint::bgcolor(int c)
Parameters:
Code: toggle
void aprint::bgcolor(int c)
{
command(40+c,'m');
}
bgcolor (version 2)
Sets the background color.
Signature:
void aprint::bgcolor(unsigned char r,unsigned char g,unsigned char b)
Parameters:
| unsigned char | r | | red. |
| unsigned char | g | | green. |
| unsigned char | b | | blue. |
Code: toggle
void aprint::bgcolor(unsigned char r,unsigned char g,unsigned char b)
{
printf("%c[%d;2;%d;%d;%dm",27,48,r,g,b);
}
colorHigh
Sets the foreground color.
Signature:
void aprint::colorHigh(int c)
Parameters:
Code: toggle
void aprint::colorHigh(int c)
{
command(90+c,'m');
}
bgcolorHigh
Sets the background color.
Signature:
void aprint::bgcolorHigh(int c)
Parameters:
Code: toggle
void aprint::bgcolorHigh(int c)
{
command(100+c,'m');
}
rotate
Prints a simple animation.
Signature:
void aprint::rotate()
Code: toggle
void aprint::rotate()
{
char ch[5]="-/|\\";
static int p=0;
++p%=4;
printf("%c",ch[p]);
command(1,'D');
fflush(stdout);
}
loadstat
Prints a progress bar.
Signature:
void aprint::loadstat(float state,int size)
Parameters:
| float | state | | Progress state, a value between 0.0 and 1.0. |
| int | size | | The size of the progress bar in characters. |
Code: toggle
void aprint::loadstat(float state,int size)
{
int pos=size*state;
for(int i=0;i');
else printf("%c",'-');
}
command(size,'D');
fflush(stdout);
}
command (version 1)
Prints a command.
Signature:
void aprint::command(char c)
Parameters:
Code: toggle
void aprint::command(char c)
{
printf("%c[%c",27,c);
}
command (version 2)
Prints a command.
Signature:
void aprint::command(int n,char c)
Parameters:
| int | n | | Parameter. |
| char | c | | Command. |
Code: toggle
void aprint::command(int n,char c)
{
printf("%c[%d%c",27,n,c);
}
command (version 3)
Prints a command.
Signature:
void aprint::command(int n,int m,char c)
Parameters:
| int | n | | Parameter. |
| int | m | | Parameter. |
| char | c | | Command. |
Code: toggle
void aprint::command(int n,int m,char c)
{
printf("%c[%d;%d%c",27,n,m,c);
}