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,26 @@ +\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|20|-|-|1|-|-| + %sThis viewport is diplayed in any case. It has the size of your screen - 12 + %spx in width and - 20 px in height. The lines will scroll, if this text + %sdoes not fit your screen. +\end{example} +\begin{rbtabular}{.75\textwidth}{XX}{Viewport definition & Default value}{}{} + width/height & remaining part of screen \\ + font & user defined \\ + shade & black foreground on white background \\ +\end{rbtabular} 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|70|70|14|1|-|-| + %s%acThere you have it: Album art. + %Vl|b|20|14|50|14|1|ff0000|ffffff| + %t1%acWarning:;%t.1 + %Vl|b|20|30|50|50|1|000000|ffffff| + %sNo album art found + %scheck your filenames. +\end{example} +This example checks for album art. Album art will be displayed in viewport 'a', if +it is found. Otherwise a red flashing warning will be displayed in viewport 'b'. Index: manual/advanced_topics/viewports/colour-uivp-syntax.tex =================================================================== --- manual/advanced_topics/viewports/colour-uivp-syntax.tex (revision 0) +++ manual/advanced_topics/viewports/colour-uivp-syntax.tex (revision 0) @@ -0,0 +1,6 @@ +\begin{example} + \config{ui viewport: 15,15,100,150,-,-,-} +\end{example} +This displays the menu starting at 15px{\textbar}15px, 100px wide and 150px high. +The font and the foreground/background colours are defined in the theme \fname{.cfg} +file or in the theme menu. 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,13 @@ +\begin{example} + %?mh<%Vda|%Vdb> + %Vl|a|10|10|50|50|-| + %sYou could now show a hold icon using the %%xl and %%xd tags. + %Vl|a|0|70|70|14|1| + %s%acYour DAP is locked. + %Vl|b|20|14|50|14|1| + %t1%acWarning:;%t.1 + %Vl|b|20|30|50|50|0| + %sYou've unlocked your player. +\end{example} +This example checks for hold. Viewport 'a' will be displayed if it is on, +otherwise viewport 'b' will display a flashing warning. 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,25 @@ +\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|-|-| + %sThis viewport is diplayed in any case. It has the size of your screen - 12 + %spx in width and - 20 px in height. The lines will scroll, if this text + %sdoes not fit your screen. +\end{example} +\begin{rbtabular}{.75\textwidth}{XX}{Viewport definition & Default value}{}{} + width/height & remaining part of screen \\ + font & user defined \\ + forground/background colour & defined by theme \\ +\end{rbtabular} 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|70|70|14|1|-|-| + %s%acThere you have it: Album art. + %Vl|b|20|14|50|14|1|2|-| + %t1%acWarning:;%t.1 + %Vl|b|20|30|50|50|1|-|-| + %sNo album art found + %scheck your filenames. +\end{example} +This example checks for album art. Album art will be displayed in viewport 'a', if +it is found. Otherwise a flashing warning will be displayed in viewport 'b'. Index: manual/advanced_topics/viewports/mono-uivp-syntax.tex =================================================================== --- manual/advanced_topics/viewports/mono-uivp-syntax.tex (revision 0) +++ manual/advanced_topics/viewports/mono-uivp-syntax.tex (revision 0) @@ -0,0 +1,5 @@ +\begin{example} + \config{ui viewport: 15,15,100,150,-} +\end{example} +This displays the menu starting at 15px{\textbar}15px, 100px wide and 150px high. +The font is defined in the theme \fname{.cfg} file or in the theme menu. Index: manual/advanced_topics/viewports/grayscale-uivp-syntax.tex =================================================================== --- manual/advanced_topics/viewports/grayscale-uivp-syntax.tex (revision 0) +++ manual/advanced_topics/viewports/grayscale-uivp-syntax.tex (revision 0) @@ -0,0 +1,6 @@ +\begin{example} + \config{ui viewport: 15,15,100,150,-,-,-} +\end{example} +This displays the menu starting at 15px{\textbar}15px, 100px wide and 150px high. +The font and the foreground/background shade are defined in the theme \fname{.cfg} +file or in the theme menu. 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,23 @@ +\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|12|20|-|-|1| + %sThis viewport is diplayed in any case. It has the size of your screen - 12 + %spx in width and - 20 px in height. The lines will scroll, if this text + %sdoes not fit your screen. +\end{example} +\begin{rbtabular}{.75\textwidth}{XX}{Viewport definition & Default value}{}{} + width/height & remaining part of screen \\ + font & user defined \\ +\end{rbtabular} Index: manual/advanced_topics/main.tex =================================================================== --- manual/advanced_topics/main.tex (revision 22668) +++ manual/advanced_topics/main.tex (working copy) @@ -132,6 +132,26 @@ the \fname{/.rockbox/backdrops} directory. }% +\nopt{lcd_charcell}{% + \subsection{Defining Dimensions for the Menu} + The dimensions of the Menu are set to occupy the whole screen by default. + This behaviour can be changed by adding the following line to the + \fname{.cfg} file of a theme: + \nopt{lcd_non-mono}{\config{ui viewport: X,Y,[width],[height],[font]}}% + \nopt{lcd_color}{\opt{lcd_non-mono}{\config{ui viewport: X,Y,[width],[height],[font],[fgshade],[bgshade]}}}% + \opt{lcd_color}{\config{ui viewport: X,Y,[width],[height],[font],[fgcolour],[bgcolour]}}% + \opt{HAVE_REMOTE_LCD}{The dimensions of the menu that is displayed on the + remote control of your \dap can be altered in the same way, except for the + descriptor: \config{remote ui viewport:\dots}}% + + Only the first two parameters \emph{have} to be specified, the others can + be omitted using '-' as a placeholder. The syntax is very similar to viewports + (see \reference{ref:Viewports}). + \nopt{lcd_non-mono}{\input{advanced_topics/viewports/mono-uivp-syntax.tex}}% + \nopt{lcd_color}{\opt{lcd_non-mono}{\input{advanced_topics/viewports/grayscale-uivp-syntax.tex}}}% + \opt{lcd_color}{\input{advanced_topics/viewports/colour-uivp-syntax.tex}}% +}% + \section{\label{ref:ConfiguringtheWPS}Configuring the WPS} \subsection{WPS -- General Info} @@ -171,11 +191,6 @@ \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 @@ -184,6 +199,54 @@ \opt{HAVE_REMOTE_LCD}{The resolution of the remote is \opt{h100,h300}{128x64x1}\opt{x5,m5}{128x96x2} pixels.}} +\nopt{lcd_charcell}{% +\subsubsection{\label{ref:Viewports}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.\opt{lcd_bitmap}{ +Loading images (see Appendix \reference{ref:wps_images}) should be done within +the default viewport.} The definition of a viewport either ends with the end of +the file or the next viewport declaration line. 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. + +\nopt{lcd_non-mono}{\input{advanced_topics/viewports/mono-vp-syntax.tex}}% +\nopt{lcd_color}{\opt{lcd_non-mono}{\input{advanced_topics/viewports/grayscale-vp-syntax.tex}}}% +\opt{lcd_color}{\input{advanced_topics/viewports/colour-vp-syntax.tex}}% +\subsubsection{Conditional Viewports} + +Any viewport can be displayed conditionally. +\begin{itemize} +\item {\config{\%Vl{\textbar}'identifier'{\textbar}\dots{\textbar}}} +This tag preloads a viewport for later display. 'identifier' is a single +lowercase letter (a-z) and the '\dots' parameters use the same logic as +the usual \config{\%V} tag explained above. +\item {\config{\%Vd'identifier'}} Display the 'identifier' viewport. +\end{itemize} +The identifiers for different viewports can be used mutliple times. +\nopt{lcd_non-mono}{\input{advanced_topics/viewports/mono-conditional.tex}}% +\nopt{lcd_color}{\opt{lcd_non-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} Index: manual/appendix/wps_tags.tex =================================================================== --- manual/appendix/wps_tags.tex (revision 22668) +++ manual/appendix/wps_tags.tex (working copy) @@ -29,6 +29,28 @@ These tags, when written with a capital ``I'' (e.g. \config{\%Ia} or \config{\%Ic}), produce the information for the next song to be played. +\nopt{lcd_charcell}{% + \section{Viewports} + \begin{table} + \begin{tagmap}{}{} + \nopt{lcd_non-mono}{% + \config{\%V{\textbar}x{\textbar}y{\textbar}[width]{\textbar}[height]{\textbar}[font]{\textbar}\\} % + & (see section \ref{ref:Viewports})\\}% + \nopt{lcd_color}{\opt{lcd_non-mono}{% + \config{\%V{\textbar}x{\textbar}y{\textbar}[width]{\textbar}% + [height]{\textbar}[font]{\textbar}[fgshade]{\textbar}[bgshade]{\textbar}} % + & (see section \ref{ref:Viewports})\\}}% + \opt{lcd_color}{% + \config{\%V{\textbar}x{\textbar}y{\textbar}[width]{\textbar}% + [height]{\textbar}[font]{\textbar}[fgcolor]{\textbar}[bgcolor]{\textbar}} % + & (see section \ref{ref:Viewports})\\}% + \config{\%Vd'identifier'} & Display the 'identifier' viewport. E.g. % + \config{\%?C{\textless}\%C\%Vda{\textbar}\%Vdb{\textgreater}} % + will show viewport 'a' if album art is found, and 'b' if it isn't.\\ + \end{tagmap} + \end{table} +}% + \section{Power Related Information} \begin{table} \begin{tagmap}{}{} @@ -91,9 +113,9 @@ that empties as the time progresses.} \opt{lcd_bitmap}{ & This will replace the entire line with a progress bar. \\ - & You can set the height, position and width of the progressbar % - (in pixels): \config{\%pb{\textbar}height{\textbar}leftpos% - {\textbar}rightpos{\textbar}toppos{\textbar}}} \\ + & You can set the position, width and height of the progressbar % + (in pixels) and load a custom image for it: % + \config{\%pb{\textbar}image.bmp{\textbar}x{\textbar}y{\textbar}width{\textbar}height{\textbar}}} \\ \opt{player}{% \config{\%pf} & Full-line progress bar \& time display\\ }% @@ -175,8 +197,8 @@ \section{Repeat Mode} \begin{table} \begin{tagmap}{}{} - \config{\%mm} & Repeat mode, 0-4, in the order: Off, All, One, Shuffle - \opt{player,recorder,recorderv2fm}{, A-B}\\ + \config{\%mm} & Repeat mode, 0-4, in the order: Off, All, One, Shuffle, + A-B\\ \end{tagmap} \end{table} Example: \config{\%?mm{\textless}Off{\textbar}All{\textbar}One{\textbar}Shuffle% @@ -231,7 +253,7 @@ \opt{lcd_bitmap}{ -\section{Images} +\section{\label{ref:wps_images}Images} \begin{table} \begin{tagmap}{}{} \nopt{archos}{% @@ -239,9 +261,6 @@ & Load and set a backdrop image for the WPS. This image must be exactly the same size as your LCD.\\ }% - \config{\%P{\textbar}filename.bmp{\textbar}} - & Load a Progress Bar image for the WPS. Use \config{\%pb} tag to show the - progress bar\\ \config{\%x{\textbar}n{\textbar}filename{\textbar}x{\textbar}y{\textbar}} & Load and display an image\\ & \config{n}: image ID (a-z and A-Z) for later referencing in \config{\%xd}\\