Index: appendix/wps_tags.tex =================================================================== --- appendix/wps_tags.tex (revision 20068) +++ appendix/wps_tags.tex (working copy) @@ -1,5 +1,106 @@ % $Id$ % \chapter{\label{ref:wps_tags}WPS Tags} + +\optv{lcd_bitmap}{ +\section{Viewports} +By default, a WPS fills the whole screen, and is split in as many lines will +fit with the chosen font. Using viewports, you can define rectangular areas of +the screen, in which to display information. All lines before the first +viewport definition will be shown in the default viewport, which covers the +entire screen. All lines following a viewport definition and up to the next +definition or end of file will will be drawn in that viewport. + +\note{ + \begin{itemize} + \item If a viewport has been defined, it is not possible to display text + on the default viewport. Use it for pictures only. + \item Viewports cannot overlap eachother transparently. Viewports will be + drawn on top of earlier viewports. + \item The maximum number of viewports is 24. + \end{itemize} +} + +\begin{table} + \begin{tagmap}{}{} + \config{\%V{\textbar}x{\textbar}y{\textbar}[w]{\textbar}[h]{\textbar}\opt{lcd_non-mono}{[font]{\textbar}[fg]{\textbar}[bg]{\textbar}}} + & Define a viewport\\ + & \config{x}: x coordinate of top-left corner\\ + & \config{y}: y coordinate\\ + & \config{w}: Width of the viewport. Defaults to fill the screen to the right.\\ + & \config{h}: Height. Defaults to fill the screen downards.\\ + & \config{font}: Which font to use. 0 means builtin system font. 1 means the user-selected font.\\ +\opt{lcd_color}{ + & \config{fg}: Foreground colour for the viewport. RGB888 Hex triplet (e.g. FF0000 means red).\\ + & \config{bg}: Background colour.\\ +} +\nopt{lcd_color}{ +\opt{lcd_non-mono}{ + & \config{fg}: Foreground shade for the viewport. A number between 0 (black) and 3 (white).\\ + & \config{bg}: Background shade.\\ +} +\nopt{lcd_non-mono}{ & \fixme{This line should be removed, but that produces +syntax errors.}\\ } +} + \end{tagmap} +\end{table} + +\begin{example} + \%V|20|10|30|15|-|-|-| + \%sExample test string +\end{example} + +\nopt{lcd_non-mono}{ + \fixme{ + The above example uses the syntax for non-mono displays due to issues + with {\textbackslash}opt and the example environment. + } +} + +This example WPS will set up a small viewport 30x15 pixels, at x=20,y=10 +containing the text ``Example test string'' using the user font and default +colours. The text will scroll to stay inside the defined area. + +\subsection{Conditional Viewports} +Just as with regular viewports, conditional viewports define an area of the +screen where drawing happens. However, conditional viewports consist of two +parts: A viewport definition, very similar to the regular one, and a display +tag that switches display of this particular viewport on. + +\begin{table} + \begin{tagmap}{}{} + \config{\%Vl{\textbar}n{\textbar}\ldots{}{\textbar}} + & Preload a viewport for displaying later with the \config{\%Vd} tag.\\ + & \config{n}: A single lower-case identifier (a-z)\\ + & \config{\ldots{}}: The rest of the values are the same as the regular + viewports tag.\\ + \config{\%Vdn} + & Display a preloaded viewport\\ + & \config{n}: The identifier as set in the \config{\%Vl} tag.\\ + \end{tagmap} +\end{table} + +\begin{example} + \%Vl|a|10|15|40|20|-|FF0000|-| + Repeat disabled + \%Vl|b|10|45|40|20|-|00FF00|-| + Repeat enabled + \%?mm<\%Vda|\%Vdb> +\end{example} + +\nopt{lcd_color}{ + \fixme{ + This example uses the syntax for colour screens due to issues with + {\textbackslash}opt and the example environment + } +} + +This example defines two viewports with the size 40x20 pixels. The first one is +at x=10,y=15 and has a red foreground colour, with the text ``Repeat +disabled''. The other is at x=10,y=45 with the text ``Repeat enabled'' in green +text. The last line displays either one or the other, depending on the repeat +setting. +} + \section{Status Bar} \begin{table} \begin{tagmap}{}{}