Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

VTQL::AlevtPage Class Reference

Proviedes high level output of videotext pages, as alevt does it. More...

#include <vtql_base.h>

List of all members.

Public Methods

 AlevtPage ()
 Does not init the page.

bool ReadLine (const std::string &line)
 Fill the page with a line of the command output. More...

size_t GetPng (char *image, int comp=0, bool reveal=false)
 Get a png image of the page. More...

std::string GetTxt (bool ansi=true, bool reveal=false)
 Get a color ansi or plain text output of the page. More...


Public Attributes

vt_page pg
 The page as vt_page. More...


Detailed Description

Proviedes high level output of videotext pages, as alevt does it.

You can fill this class with the output if a PAGE ... HEX command. It should create the same output as the alevt programs do it (e.g. alevt-cap), since it uses its source code (thanks to the nice and reusable code of alevt).

Warning:
uses global variables, i.e. it is not thread save.
Todo:
Remove the global variables.


Member Function Documentation

bool VTQL::AlevtPage::ReadLine const std::string &    line
 

Fill the page with a line of the command output.

Indeed, you have to call this method 26 times, i.e. 25 times for the 25 lines of a videotext page, hexadecimal encoded from a VTQLserver and a 26th time for the additional information of a page_info line, encoded as 26th line in PAGE ... HEX mode. At this 26th call you get a true back to indicate, that the page has been read completly.

If you call it more then 26 times, it starts to overwrite the old lines and returns true at the 52th call.

Parameters:
line  A line form the output of a PAGE ... HEX command.
Returns:
true if a full page has been read.

size_t VTQL::AlevtPage::GetPng char *    image,
int    comp = 0,
bool    reveal = false
 

Get a png image of the page.

Parameters:
image  The method writes the image to this memory block without checking for boundaries, so dont make it too small.
comp  compression factor (0: no compression ... 9: maximum compression)
reveal  If true, reveal hidden text.
Returns:
Size of the image in bytes.

std::string VTQL::AlevtPage::GetTxt bool    ansi = true,
bool    reveal = false
 

Get a color ansi or plain text output of the page.

Color ansi means, that this method inserts escape codes into the videotext page. This escape codes will be interpreted as color attributs on a color terminal (e.g. this method is heavily used by console_vt.

Parameters:
ansi  If true, use ansi colors, else output plain text
reveal  If true, reveal hidden text
Returns:
The escaped videotext page. Every line ends with a newline character.


Member Data Documentation

vt_page VTQL::AlevtPage::pg
 

The page as vt_page.

Use this, if you know about the alevt structure vt_page.


The documentation for this class was generated from the following file:
Generated on Sun Apr 14 17:37:04 2002 for libvtql by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002