Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

Tagged Text
[Graphic User Interface]


Detailed Description

tagged text aka zml

Introduction
Tagged text is a ZML convertor to graphical object. ZML (Ziggy's Markup Language) is a very simple sgml like text language to format document and gui elements. Like other (X)ML languages ZML is based on tag.

What is a tag ?
A tag is a text sequence between < (inferior) and > (superior). A tag has a name which is the word directly after the opening <. This name defines the type of tag and its function. Tags may have parameters. It consist on other word following the tag name. Optionnaly a parameter can have value (may be it is mandatory, ask ziggy). This value is setted by appending a `="value"' to the parameter name. Note that `"' quotes are mandatory. There is no limit to the number of parameter for a tag (excepted hardware limits). The syntax should be something like :
<TAG[ PAR1[="VAL1"][ PAR1[="VAL1"]]...]>

Conventions
It is better that name for both tag and parameter used only alpha numeric characters , `_' underscore and '-' minus. The '/' slash charactere is generally used as the first character of a tag which meaning is to close a block beginning by the same tag without the '/'.
<BLOCK width="32" type="sample"> This is a sample </BLOCK>

zml for Tagged Text
Here is a list of zml tags defined by tagged text. Note that it is possible to add new tags.

Author:
vincent penne aka ziggy

benjamin gerard


Files

file  taggedtext.lua
 tagged text aka zml


Functions

 tt_text_draw (var block)
 tt_img_draw (var block)
 tt_img_name (var src)
 tt_img_cmd (var mode, var param)
 tt_tocolor (var s)
 Get a color.

 tt_font_cmd (var mode, var param)
 tt_dialog_draw (var block)
 tt_dialog_cmd (var mode, var param)
 tt_end_dialog_cmd (var mode)
 tt_button_draw (var block)
 tt_button_cmd (var mode, var param)
 tt_end_button_cmd (var mode)
 tt_a_name_draw (var block)
 tt_a_cmd (var mode, var param)
 tt_end_a_cmd (var mode, var param)
 tt_getword (var text, var e1)
 tt_getparam (var text, var e1)
 tt_copymode (var mode)
 tt_align_line_up (var mode, var line, var h)
 tt_align_line_down (var mode, var line, var h)
 tt_align_line_vcenter (var mode, var line, var h)
 tt_align_line_left (var mode, var line, var h)
 tt_align_line_right (var mode, var line, var h)
 tt_align_line_center (var mode, var line, var h)
 tt_align_up (var mode)
 tt_align_vcenter (var mode)
 tt_align_down (var mode)
 tt_endline (var mode)
 tt_insert_block (var mode, var block)
 tt_endgroup (var mode, var cur)
 tt_build (var text, var mode)
 process a tagged text.

 tt_draw (var tt)
 draw a tagged text (must be previously build with tt_build).


Variables

function tt_color_table []
 Tagged text color table.


Function Documentation

tt_tocolor var  s  ) 
 

Get a color.

Step by step:

  1. Check if color is a string. If not goto step 5.
  2. If the string does not begin by '$' a dollar goto step 4.
  3. color is substitued by the value of the global variable of the color name (without the dollar). Goto step 5.
  4. If the first char is not # get color is substitued by the value of the value tt_color_table at this name index.
  5. if the type of the color is a function the color is substitued by the return of the function call
  6. if the color is a table, the function returns it as reference.
  7. return the result of color_new() function with the color as parameter. That always creates a new color.

Parameters:
s The color definition. See detailed documentation for further information.
Returns:
color
Return values:
In most case a copy of a color.
Warning:
table substition are not checked for valid color.
Author:
benjamin gerard


dcplaya documentation version 2.0 Generated on November 2004 by doxygen 1.3.6