Index: manual/advanced_topics/viewports/grayscale-vp-syntax.tex =================================================================== --- manual/advanced_topics/viewports/grayscale-vp-syntax.tex (revision 0) +++ manual/advanced_topics/viewports/grayscale-vp-syntax.tex (revision 0) @@ -0,0 +1,15 @@ +\subsubsection{Viewport Declaration Syntax} + +{\config{\%V}}{\textbar}x{\textbar}y{\textbar}[width]{\textbar}[height]{\textbar}[font]{\textbar}[fgshade]{\textbar}[bgshade]{\textbar}% + + \begin{itemize} + \item 'fgshade' and bgshade are numbers in the range 0 (= black) to 3 (= white). + \item 'font' is a number - 0 is the built-in system font, 1 is the user-selected font. + \item Only the coordinates \emph{have} to be specified. Leaving the other definitions blank will make them fall + back to their their default values. + \note{The correct amount of {\textbar}'s with -'s in the blanks fields is still needed in any case.} + \end{itemize} + +\begin{example} + %V|12|0|-|-|-|1|3| +\end{example} Index: manual/advanced_topics/viewports/colour-conditional.tex =================================================================== --- manual/advanced_topics/viewports/colour-conditional.tex (revision 0) +++ manual/advanced_topics/viewports/colour-conditional.tex (revision 0) @@ -0,0 +1,15 @@ +\begin{example} + %?C<%Vda|%Vdb> + %Vl|a|10|10|50|50|-|-|-| + %Cl|0|0|50|50| + %C + %Vl|a|0|60|60|14|1|-|-| + %acThere you have it: Album art. + %Vl|b|35|35|60|14|1|000000|ffffff| + %alNo album art found, check your filenames. + %Vl|b|35|49|60|14|1|000000|ffffff| + %acDon't be disappointed, here's a clock: + %Vl|b|35|63|60|14|1|000000|ffffff| + %ac%?cf< %cH:%cM%cS|%cl%cM %cp> +\end{example} +This example displays a clock if no album art is found. \ No newline at end of file Index: manual/advanced_topics/viewports/mono-conditional.tex =================================================================== --- manual/advanced_topics/viewports/mono-conditional.tex (revision 0) +++ manual/advanced_topics/viewports/mono-conditional.tex (revision 0) @@ -0,0 +1,12 @@ +\begin{example} + %?cf<%Vda|%Vdb> + %Vl|a|0|0|6|-|1| + %s12 hour format: + %Vl|a|0|6|5|-|1| + %cl%cM + %Vl|b|0|0|6|-|1| + %s24 hour format: + %Vl|b|6|0|5|-|1| + %cH:%cM + \end{example} +This example displays a 12/24 hour clock depending on the clock settings. \ No newline at end of file Index: manual/advanced_topics/viewports/colour-vp-syntax.tex =================================================================== --- manual/advanced_topics/viewports/colour-vp-syntax.tex (revision 0) +++ manual/advanced_topics/viewports/colour-vp-syntax.tex (revision 0) @@ -0,0 +1,15 @@ +\subsubsection{Viewport Declaration Syntax} + +{\config{\%V}}{\textbar}x{\textbar}y{\textbar}[width]{\textbar}[height]{\textbar}[font]{\textbar}[fgcolor]{\textbar}[bgcolor]{\textbar}% + + \begin{itemize} + \item 'fgcolor' and bgcolor are 6-digit RGB888 colours - e.g. FF00FF. + \item 'font' is a number - 0 is the built-in system font, 1 is the user-selected font. + \item Only the coordinates \emph{have} to be specified. Leaving the other definitions blank will make them fall + back to their their default values. + \note{The correct amount of {\textbar}'s with -'s in the blanks fields is still needed in any case.} + \end{itemize} + +\begin{example} + %V|12|20|-|-|1|-|-| +\end{example} \ No newline at end of file Index: manual/advanced_topics/viewports/grayscale-conditional.tex =================================================================== --- manual/advanced_topics/viewports/grayscale-conditional.tex (revision 0) +++ manual/advanced_topics/viewports/grayscale-conditional.tex (revision 0) @@ -0,0 +1,15 @@ +\begin{example} + %?C<%Vda|%Vdb> + %Vl|a|10|10|50|50|-|-|-| + %Cl|0|0|50|50| + %C + %Vl|a|0|60|60|14|1|3|0| + %acThere you have it: Album art. + %Vl|b|35|35|60|14|1|3|0| + %alNo album art found, check your filenames. + %Vl|b|35|49|60|14|1|3|0| + %acDon't be disappointed, here's a clock: + %Vl|b|35|63|60|14|1|3|0| + %ac%?cf< %cH:%cM%cS|%cl%cM %cp> +\end{example} +This example displays a clock if no album art is found. \ No newline at end of file Index: manual/advanced_topics/viewports/mono-vp-syntax.tex =================================================================== --- manual/advanced_topics/viewports/mono-vp-syntax.tex (revision 0) +++ manual/advanced_topics/viewports/mono-vp-syntax.tex (revision 0) @@ -0,0 +1,13 @@ +\subsubsection{Viewport Declaration Syntax} + +{\config{\%V}}{\textbar}x{\textbar}y{\textbar}[width]{\textbar}[height]{\textbar}[font]{\textbar} + + \begin{itemize} + \item 'font' is a number - 0 is the built-in system font, 1 is the user-selected font. + \item Only the coordinates \emph{have} to be specified. Leaving the other definitions blank will make them fall + back to their their default values. + \note{The correct amount of {\textbar}'s with -'s in the blanks fields is still needed in any case.} + \end{itemize} +\begin{example} + %V|1|5|-|-|1| +\end{example} Index: manual/advanced_topics/main.tex =================================================================== --- manual/advanced_topics/main.tex (revision 22458) +++ manual/advanced_topics/main.tex (working copy) @@ -166,15 +166,9 @@ encoding. This can be done in most editors, for example Notepad in Windows 2000 or XP (but not in 9x/ME) can do this. See appendix \reference{ref:wps_tags} for all the tags that are available. - \begin{itemize} \item All characters not preceded by \% are displayed as typed. \item Lines beginning with \# are comments and will be ignored. -\item Maximum file size used is - \opt{lcd_bitmap}{1600} - \opt{player}{400} bytes. - If you have a bigger WPS file, only the first part of it will be - loaded and used. \end{itemize} \note{Keep in mind that your \dap{} resolution is \genericimg{} (with @@ -183,6 +177,67 @@ \opt{HAVE_REMOTE_LCD}{The resolution of the remote is \opt{h100,h300}{128x64x1}\opt{x5,m5}{128x96x2} pixels.}} +\subsubsection{Viewports} + +By default, a viewport which fills the whole screen contains all the elements +defined in the \fname(.wps) file. The elements in this viewport are displayed +in the same background/foreground colour and the text is rendered in the same +font as in the main menu. These three definitions are loaded by the theme +\fname(.cfg) file (see \reference{ref:configure_rockbox_themes} and +\reference{ref:cfg_specs}). To change this behaviour a custom viewport has to +be defined. A viewport is a rectangular window on the screen with its own +foreground/background colour. This window also has variable dimensions. To +determine the values assigned to a specific viewport, a defining \config{{\%V{\textbar}\dots}} +line (will be explained later in this section) has to be present in the \fname{.wps} file. +All elements placed before the first line defining a viewport are displayed in the +default viewport. Elements defined after a viewport declaration are drawn within the dimensions specified in and at the coordinates designated by that defining line. Loading images +(see \reference{ref:wps_images}) should be done within the default viewport. +Viewports sharing the same coordinates and dimensions cannot be displayed at +the same time. Viewports cannot be layered \emph{transparently} over one another. +Subsequent viewport definitions will be drawn over any other viewports already +drawn onto that area of the screen. Defining a viewport with the \config{{\%V{\textbar}\dots}} +line will display it constantly. + +\opt{archos}{\input{advanced_topics/viewports/mono-vp-syntax.tex}} +\nopt{player,lcd_color,lcd_mono}{\input{advanced_topics/viewports/grayscale-vp-syntax.tex}} +\opt{lcd_color}{\input{advanced_topics/viewports/colour-vp-syntax.tex}} +\begin{table} +\begin{center} +\begin{tabularx}{.75\textwidth}{XX}\toprule +\textbf{Viewport definition} & \textbf{Default value}\\\midrule% + width/height & remaining part of screen \\ + font & user defined \\ + \nopt{player,lcd_color,lcd_mono}{ + shade & black FG on white BG \\ + } + \opt{lcd_color}{ + forground/background colour & defined by theme \\ + }\bottomrule +\end{tabularx} +\end{center} +\end{table} + +\subsubsection{Conditional Viewports} + +Any viewport can be displayed conditionally. +\begin{itemize} +\item {\config{\%Vl{\textbar}'identifier'{\textbar}\ldots{\textbar}}} +This tag preloads a viewport for later display. 'identifier' is a single lowercase letter (a-z) and the '\ldots' parameters use the same logic as the usual \%V tag explained above. +\item {\config{\%Vd'identifier'}} Display the 'identifier' viewport. +\end{itemize} +\begin{example} + %?C<%C%Vda|%Vdb> +\end{example} +This displays viewport 'a' if album art is found. Viewport 'b' is displayed if album art is not found. + +The identifiers for different viewports can be used mutliple times. +\opt{archos}{\input{advanced_topics/viewports/grayscale-conditional.tex}} +\nopt{player,lcd_color,lcd_mono}{\input{advanced_topics/viewports/grayscale-conditional.tex}} +\opt{lcd_color}{\input{advanced_topics/viewports/colour-conditional.tex}} +Using an individual identifier for each viewport is not necessary. +\note{The tag to display conditional viewports must be coded in the \fname{.wps} file \emph{before} the tag to preload conditional viewports. +} + \subsubsection{Conditional Tags} \begin{description} @@ -254,11 +309,11 @@ as they are separated into different sublines. Example subline definition: \begin{example} - %s%t4%ia;%s%it;%t3%pc %pr : Display id3 artist for 4 seconds, - Display id3 title for 2 seconds, - Display current and remaining track time - for 3 seconds, - repeat... + %s%t4%ia;%s%it;%t3%pc %pr : Display id3 artist for 4 seconds, + Display id3 title for 2 seconds, + Display current and remaining track time + for 3 seconds, + repeat... \end{example} Conditionals can be used with sublines to display a different set and/or number Index: manual/appendix/wps_tags.tex =================================================================== --- manual/appendix/wps_tags.tex (revision 22458) +++ manual/appendix/wps_tags.tex (working copy) @@ -218,7 +218,7 @@ \opt{lcd_bitmap}{ -\section{Images} +\section{{\label{ref:wps_images}}Images} \begin{table} \begin{tagmap}{}{} \nopt{archos}{%