summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Parker <rockbox@aeparker.com>2009-09-20 16:48:45 +0000
committerAlex Parker <rockbox@aeparker.com>2009-09-20 16:48:45 +0000
commitab563da17585992e9b8d54db1d4e36ba50d65d43 (patch)
treee9fdbdcbafe23a04fd9bee7c381b031b1a0f7a1e
parent16cb628eb7d86e64dc7cab739ebb8dfc6e9900c2 (diff)
downloadrockbox-ab563da17585992e9b8d54db1d4e36ba50d65d43.tar.gz
rockbox-ab563da17585992e9b8d54db1d4e36ba50d65d43.zip
Add viewports to the manual. Adapted from FS#9934 by Jonas Häggqvist and FS#10553 by David Kauffmann
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22756 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--docs/CREDITS1
-rw-r--r--manual/advanced_topics/main.tex101
-rw-r--r--manual/advanced_topics/viewports/colour-conditional.tex15
-rw-r--r--manual/advanced_topics/viewports/colour-uivp-syntax.tex13
-rw-r--r--manual/advanced_topics/viewports/colour-vp-syntax.tex26
-rw-r--r--manual/advanced_topics/viewports/grayscale-conditional.tex15
-rw-r--r--manual/advanced_topics/viewports/grayscale-uivp-syntax.tex14
-rw-r--r--manual/advanced_topics/viewports/grayscale-vp-syntax.tex27
-rw-r--r--manual/advanced_topics/viewports/mono-conditional.tex13
-rw-r--r--manual/advanced_topics/viewports/mono-uivp-syntax.tex11
-rw-r--r--manual/advanced_topics/viewports/mono-vp-syntax.tex24
-rw-r--r--manual/appendix/wps_tags.tex39
12 files changed, 286 insertions, 13 deletions
diff --git a/docs/CREDITS b/docs/CREDITS
index 9066778249..c8b61f8ed4 100644
--- a/docs/CREDITS
+++ b/docs/CREDITS
@@ -493,6 +493,7 @@ Jason Yu
493Aaron DeMille 493Aaron DeMille
494Tomasz Kowalczyk 494Tomasz Kowalczyk
495Michael Lechner 495Michael Lechner
496David Kauffmann
496 497
497The libmad team 498The libmad team
498The wavpack team 499The wavpack team
diff --git a/manual/advanced_topics/main.tex b/manual/advanced_topics/main.tex
index f95692267b..53bb984f2e 100644
--- a/manual/advanced_topics/main.tex
+++ b/manual/advanced_topics/main.tex
@@ -132,6 +132,42 @@ file find the instructions on the Rockbox website:
132 the \fname{/.rockbox/backdrops} directory. 132 the \fname{/.rockbox/backdrops} directory.
133}% 133}%
134 134
135\nopt{lcd_charcell}{
136 \subsection{UI Viewport}
137 By default, the UI is drawn on the whole screen. This can be changed so that
138 the UI is confined to a specific area of the screen, by use of a UI
139 viewport. This is done by adding the following line to the
140 \fname{.cfg} file for a theme:\\*
141
142 \nopt{lcd_non-mono}{\config{ui viewport: X,Y,[width],[height],[font]}}
143 \nopt{lcd_color}{\opt{lcd_non-mono}{
144 \config{ui viewport: X,Y,[width],[height],[font],[fgshade],[bgshade]}}}
145 \opt{lcd_color}{
146 \config{ui viewport: X,Y,[width],[height],[font],[fgcolour],[bgcolour]}}
147 \\*
148
149 \opt{HAVE_REMOTE_LCD}{
150 The dimensions of the menu that is displayed on the remote control of your
151 \dap\ can be set in the same way. The line to be added to the theme
152 \fname{.cfg} is the following:\\*
153
154 \nopt{lcd_non-mono}{\config{remote ui viewport: X,Y,[width],[height],[font]}}
155 \nopt{lcd_color}{\opt{lcd_non-mono}{
156 \config{remote ui viewport: X,Y,[width],[height],[font],[fgshade],[bgshade]}}}
157 \opt{lcd_color}{
158 \config{remote ui viewport: X,Y,[width],[height],[font],[fgcolour],[bgcolour]}}
159 \\*
160 }
161
162 Only the first two parameters \emph{have} to be specified, the others can
163 be omitted using '-' as a placeholder. The syntax is very similar to WPS
164 viewports (see \reference{ref:Viewports}). Briefly:
165
166 \nopt{lcd_non-mono}{\input{advanced_topics/viewports/mono-uivp-syntax.tex}}
167 \nopt{lcd_color}{\opt{lcd_non-mono}{\input{advanced_topics/viewports/grayscale-uivp-syntax.tex}}}
168 \opt{lcd_color}{\input{advanced_topics/viewports/colour-uivp-syntax.tex}}
169}
170
135\section{\label{ref:ConfiguringtheWPS}Configuring the WPS} 171\section{\label{ref:ConfiguringtheWPS}Configuring the WPS}
136 172
137\subsection{WPS -- General Info} 173\subsection{WPS -- General Info}
@@ -171,11 +207,6 @@ all the tags that are available.
171\begin{itemize} 207\begin{itemize}
172\item All characters not preceded by \% are displayed as typed. 208\item All characters not preceded by \% are displayed as typed.
173\item Lines beginning with \# are comments and will be ignored. 209\item Lines beginning with \# are comments and will be ignored.
174\item Maximum file size used is
175 \opt{lcd_bitmap}{1600}
176 \opt{player}{400} bytes.
177 If you have a bigger WPS file, only the first part of it will be
178 loaded and used.
179\end{itemize} 210\end{itemize}
180 211
181\note{Keep in mind that your \dap{} resolution is \genericimg{} (with 212\note{Keep in mind that your \dap{} resolution is \genericimg{} (with
@@ -184,6 +215,66 @@ all the tags that are available.
184 \opt{HAVE_REMOTE_LCD}{The resolution of the remote is 215 \opt{HAVE_REMOTE_LCD}{The resolution of the remote is
185 \opt{h100,h300}{128x64x1}\opt{x5,m5}{128x96x2} pixels.}} 216 \opt{h100,h300}{128x64x1}\opt{x5,m5}{128x96x2} pixels.}}
186 217
218\nopt{lcd_charcell}{
219\subsubsection{\label{ref:Viewports}Viewports}
220
221By default, a viewport filling the whole screen contains all the elements
222defined in the \fname(.wps) file. The
223\opt{lcd_non-mono}{elements in this viewport are displayed
224 with the same background/foreground
225 \opt{lcd_color}{colours}\nopt{lcd_color}{shades} and the}
226text is rendered in the
227same font as in the main menu. To change this behaviour a custom viewport can
228be defined. A viewport is a rectangular window on the screen%
229\opt{lcd_non-mono}{ with its own foreground/background
230\opt{lcd_color}{colours}\nopt{lcd_color}{shades}}.
231This window also has variable dimensions. To
232define a viewport a line starting \config{{\%V{\textbar}\dots}} has to be
233present in the \fname{.wps} file. The full syntax will be explained later in
234this section. All elements placed before the
235line defining a viewport are displayed in the default viewport. Elements
236defined after a viewport declaration are drawn within that viewport.
237\opt{lcd_bitmap}{Loading images (see Appendix \reference{ref:wps_images})
238 should be done within the default viewport.}
239A viewport ends either with the end of the file, or with the next viewport
240declaration line. Viewports sharing the same
241coordinates and dimensions cannot be displayed at the same time. Viewports
242cannot be layered \emph{transparently} over one another. Subsequent viewports
243will be drawn over any other viewports already drawn onto that
244area of the screen.
245
246\nopt{lcd_non-mono}{\input{advanced_topics/viewports/mono-vp-syntax.tex}}
247\nopt{lcd_color}{\opt{lcd_non-mono}{\input{advanced_topics/viewports/grayscale-vp-syntax.tex}}}
248\opt{lcd_color}{\input{advanced_topics/viewports/colour-vp-syntax.tex}}
249
250
251\subsubsection{Conditional Viewports}
252
253Any viewport can be displayed either permanently or conditionally.
254Defining a viewport as \config{{\%V{\textbar}\dots}}
255will display it permanently.
256
257\begin{itemize}
258\item {\config{\%Vl{\textbar}'identifier'{\textbar}\dots{\textbar}}}
259This tag preloads a viewport for later display. 'identifier' is a single
260lowercase letter (a-z) and the '\dots' parameters use the same logic as
261the \config{\%V} tag explained above.
262\item {\config{\%Vd'identifier'}} Display the 'identifier' viewport.
263\end{itemize}
264
265Viewports can share identifiers so that you can display multiple viewports
266with one \%Vd line.
267
268\nopt{lcd_non-mono}{\input{advanced_topics/viewports/mono-conditional.tex}}
269\nopt{lcd_color}{%
270 \opt{lcd_non-mono}{\input{advanced_topics/viewports/grayscale-conditional.tex}}}
271\opt{lcd_color}{\input{advanced_topics/viewports/colour-conditional.tex}}
272\\*
273
274\note{The tag to display conditional viewports must come before the tag to
275preload the viewport in the \fname{.wps} file.}
276}
277
187\subsubsection{Conditional Tags} 278\subsubsection{Conditional Tags}
188 279
189\begin{description} 280\begin{description}
diff --git a/manual/advanced_topics/viewports/colour-conditional.tex b/manual/advanced_topics/viewports/colour-conditional.tex
new file mode 100644
index 0000000000..bcef715263
--- /dev/null
+++ b/manual/advanced_topics/viewports/colour-conditional.tex
@@ -0,0 +1,15 @@
1\begin{example}
2 %?C<%Vda|%Vdb>
3 %Vl|a|10|10|50|50|-|-|-|
4 %Cl|0|0|50|50|
5 %C
6 %Vl|a|0|70|70|14|1|-|-|
7 %s%acThere you have it: Album art.
8 %Vl|b|20|14|50|14|1|ff0000|ffffff|
9 %t1%acWarning:;%t.1
10 %Vl|b|20|30|50|50|1|000000|ffffff|
11 %sNo album art found
12 %scheck your filenames.
13\end{example}
14This example checks for album art. Album art will be displayed in viewport 'a', if
15it is found. Otherwise a red flashing warning will be displayed in viewport 'b'.
diff --git a/manual/advanced_topics/viewports/colour-uivp-syntax.tex b/manual/advanced_topics/viewports/colour-uivp-syntax.tex
new file mode 100644
index 0000000000..e681f45fc8
--- /dev/null
+++ b/manual/advanced_topics/viewports/colour-uivp-syntax.tex
@@ -0,0 +1,13 @@
1 \begin{itemize}
2 \item 'fgcolour' and 'bgcolour' are 6-digit RGB888 colours - e.g. FF00FF.
3 \item 'font' is a number - '0' is the built-in system font, '1' is the
4 user-selected font.
5 \end{itemize}
6
7\begin{example}
8 \config{ui viewport: 15,20,100,150,-,-,-}
9\end{example}
10This displays the menu starting at 15px from the left of the screen and 20px
11from the top of the screen. It is 100px wide and 150px high.
12The font and the foreground/background colours are defined in the theme
13\fname{.cfg} file or in the \setting{Theme Settings} menu.
diff --git a/manual/advanced_topics/viewports/colour-vp-syntax.tex b/manual/advanced_topics/viewports/colour-vp-syntax.tex
new file mode 100644
index 0000000000..c88451724c
--- /dev/null
+++ b/manual/advanced_topics/viewports/colour-vp-syntax.tex
@@ -0,0 +1,26 @@
1\subsubsection{Viewport Declaration Syntax}
2
3{\config{\%V}}{\textbar}x{\textbar}y{\textbar}[width]{\textbar}[height]{\textbar}[font]{\textbar}[fgcolour]{\textbar}[bgcolour]{\textbar}%
4
5 \begin{itemize}
6 \item 'fgcolour' and 'bgcolour' are 6-digit RGB888 colours - e.g. FF00FF.
7 \item 'font' is a number - '0' is the built-in system font, '1' is the
8 user-selected font.
9 \item Only the coordinates \emph{have} to be specified. Leaving the other
10 definitions blank will set them to their default values.
11 \note{The correct number of {\textbar}s with hyphens in blank fields
12 are still needed in any case.}
13 \end{itemize}
14
15\begin{example}
16 %V|12|20|-|-|1|-|-|
17 %sThis viewport is displayed permanently. It starts 12px from the left and
18 %s20px from the top of the screen, and fills the rest of the screen from
19 %sthat point. The lines will scroll if this text does not fit in the viewport.
20 %sThe user font is used, as are the default foreground/background colours.
21\end{example}
22\begin{rbtabular}{.75\textwidth}{XX}{Viewport definition & Default value}{}{}
23 width/height & remaining part of screen \\
24 font & user defined \\
25 forground/background colours & defined by theme \\
26\end{rbtabular} \ No newline at end of file
diff --git a/manual/advanced_topics/viewports/grayscale-conditional.tex b/manual/advanced_topics/viewports/grayscale-conditional.tex
new file mode 100644
index 0000000000..390a043f49
--- /dev/null
+++ b/manual/advanced_topics/viewports/grayscale-conditional.tex
@@ -0,0 +1,15 @@
1\begin{example}
2 %?C<%Vda|%Vdb>
3 %Vl|a|10|10|50|50|-|-|-|
4 %Cl|0|0|50|50|
5 %C
6 %Vl|a|0|70|70|14|1|-|-|
7 %s%acThere you have it: Album art.
8 %Vl|b|20|14|50|14|1|2|-|
9 %t1%acWarning:;%t.1
10 %Vl|b|20|30|50|50|1|-|-|
11 %sNo album art found
12 %scheck your filenames.
13\end{example}
14This example checks for album art. Album art will be displayed in viewport 'a', if
15it is found. Otherwise a flashing warning will be displayed in viewport 'b'.
diff --git a/manual/advanced_topics/viewports/grayscale-uivp-syntax.tex b/manual/advanced_topics/viewports/grayscale-uivp-syntax.tex
new file mode 100644
index 0000000000..3b420ce7d5
--- /dev/null
+++ b/manual/advanced_topics/viewports/grayscale-uivp-syntax.tex
@@ -0,0 +1,14 @@
1 \begin{itemize}
2 \item 'fgshade' and bgshade are numbers in the range '0' (= black) to '3'
3 (= white).
4 \item 'font' is a number - '0' is the built-in system font, '1' is the
5 user-selected font.
6 \end{itemize}
7
8\begin{example}
9 \config{ui viewport: 15,20,100,150,-,-,-}
10\end{example}
11his displays the menu starting at 15px from the left of the screen and 20px
12from the top of the screen. It is 100px wide and 150px high.
13The font and the foreground/background shades are defined in the theme
14\fname{.cfg} file or in the \setting{Theme Settings} menu.
diff --git a/manual/advanced_topics/viewports/grayscale-vp-syntax.tex b/manual/advanced_topics/viewports/grayscale-vp-syntax.tex
new file mode 100644
index 0000000000..9f15b514b2
--- /dev/null
+++ b/manual/advanced_topics/viewports/grayscale-vp-syntax.tex
@@ -0,0 +1,27 @@
1\subsubsection{Viewport Declaration Syntax}
2
3{\config{\%V}}{\textbar}x{\textbar}y{\textbar}[width]{\textbar}[height]{\textbar}[font]{\textbar}[fgshade]{\textbar}[bgshade]{\textbar}%
4
5 \begin{itemize}
6 \item 'fgshade' and bgshade are numbers in the range '0' (= black) to '3'
7 (= white).
8 \item 'font' is a number - '0' is the built-in system font, '1' is the
9 user-selected font.
10 \item Only the coordinates \emph{have} to be specified. Leaving the other
11 definitions blank will set them to their default values.
12 \note{The correct number of {\textbar}s with hyphens in blank fields
13 are still needed in any case.}
14 \end{itemize}
15
16\begin{example}
17 %V|12|20|-|-|1|-|-|
18 %sThis viewport is displayed permanently. It starts 12px from the left and
19 %s20px from the top of the screen, and fills the rest of the screen from
20 %sthat point. The lines will scroll if this text does not fit in the viewport.
21 %sThe user font is used, as are the default foreground/background shades.
22\end{example}
23\begin{rbtabular}{.75\textwidth}{XX}{Viewport definition & Default value}{}{}
24 width/height & remaining part of screen \\
25 font & user defined \\
26 shade & black foreground on white background \\
27\end{rbtabular}
diff --git a/manual/advanced_topics/viewports/mono-conditional.tex b/manual/advanced_topics/viewports/mono-conditional.tex
new file mode 100644
index 0000000000..fef1488ba7
--- /dev/null
+++ b/manual/advanced_topics/viewports/mono-conditional.tex
@@ -0,0 +1,13 @@
1\begin{example}
2 %?mh<%Vda|%Vdb>
3 %Vl|a|10|10|50|50|-|
4 %sYou could now show a hold icon using the %%xl and %%xd tags.
5 %Vl|a|0|70|70|14|1|
6 %s%acYour DAP is locked.
7 %Vl|b|20|14|50|14|1|
8 %t1%acWarning:;%t.1
9 %Vl|b|20|30|50|50|0|
10 %sYou've unlocked your player.
11\end{example}
12This example checks for hold. Viewport 'a' will be displayed if it is on,
13otherwise viewport 'b' will display a flashing warning.
diff --git a/manual/advanced_topics/viewports/mono-uivp-syntax.tex b/manual/advanced_topics/viewports/mono-uivp-syntax.tex
new file mode 100644
index 0000000000..bdf0a28eaa
--- /dev/null
+++ b/manual/advanced_topics/viewports/mono-uivp-syntax.tex
@@ -0,0 +1,11 @@
1 \begin{itemize}
2 \item 'font' is a number - '0' is the built-in system font, '1' is the
3 user-selected font.
4 \end{itemize}
5
6\begin{example}
7 \config{ui viewport: 15,20,100,150,-}
8\end{example}
9This displays the menu starting at 15px from the left of the screen and 20px
10from the top of the screen. It is 100px wide and 150px high. The font is
11defined in the theme \fname{.cfg} file or in the \setting{Theme Settings} menu.
diff --git a/manual/advanced_topics/viewports/mono-vp-syntax.tex b/manual/advanced_topics/viewports/mono-vp-syntax.tex
new file mode 100644
index 0000000000..3126d81a10
--- /dev/null
+++ b/manual/advanced_topics/viewports/mono-vp-syntax.tex
@@ -0,0 +1,24 @@
1\subsubsection{Viewport Declaration Syntax}
2
3{\config{\%V}}{\textbar}x{\textbar}y{\textbar}[width]{\textbar}[height]{\textbar}[font]{\textbar}%
4
5 \begin{itemize}
6 \item 'font' is a number - '0' is the built-in system font, '1' is the
7 user-selected font.
8 \item Only the coordinates \emph{have} to be specified. Leaving the other
9 definitions blank will set them to their default values.
10 \note{The correct number of {\textbar}s with hyphens in blank fields
11 are still needed in any case.}
12 \end{itemize}
13
14\begin{example}
15 %V|12|20|-|-|1|
16 %sThis viewport is displayed permanently. It starts 12px from the left and
17 %s20px from the top of the screen, and fills the rest of the screen from
18 %sthat point. The lines will scroll if this text does not fit in the viewport.
19 %sThe user font is used.
20\end{example}
21\begin{rbtabular}{.75\textwidth}{XX}{Viewport definition & Default value}{}{}
22 width/height & remaining part of screen \\
23 font & user defined \\
24\end{rbtabular}
diff --git a/manual/appendix/wps_tags.tex b/manual/appendix/wps_tags.tex
index 9be085d01a..7c4fd5418a 100644
--- a/manual/appendix/wps_tags.tex
+++ b/manual/appendix/wps_tags.tex
@@ -27,7 +27,33 @@ Remember that this information is not always available, so use the
27conditionals to show alternate information in preference to assuming. 27conditionals to show alternate information in preference to assuming.
28 28
29These tags, when written with a capital ``I'' (e.g. \config{\%Ia} or \config{\%Ic}), 29These tags, when written with a capital ``I'' (e.g. \config{\%Ia} or \config{\%Ic}),
30produce the information for the next song to be played. 30show the information for the next song to be played.
31
32\nopt{lcd_charcell}{
33 \section{Viewports}
34 \begin{table}
35 \begin{tagmap}{}{}
36 \nopt{lcd_non-mono}{~%
37 \config{\%V{\textbar}x{\textbar}y{\textbar}[width]{\textbar}%
38 [height]{\textbar}[font]{\textbar}}
39 & (see section \ref{ref:Viewports})\\}
40
41 \nopt{lcd_color}{\opt{lcd_non-mono}{%
42 \config{\%V{\textbar}x{\textbar}y{\textbar}[width]{\textbar}%
43 [height]{\textbar}[font]{\textbar}[fgshade]{\textbar}[bgshade]{\textbar}}
44 & (see section \ref{ref:Viewports})\\}}
45
46 \opt{lcd_color}{%
47 \config{\%V{\textbar}x{\textbar}y{\textbar}[width]{\textbar}%
48 [height]{\textbar}[font]{\textbar}[fgcolour]{\textbar}[bgcolour]{\textbar}}
49 & (see section \ref{ref:Viewports})\\}
50
51 \config{\%Vd'identifier'} & Display the 'identifier' viewport. E.g.
52 \config{\%?C{\textless}\%C\%Vda{\textbar}\%Vdb{\textgreater}}
53 will show viewport 'a' if album art is found, and 'b' if it isn't.\\
54 \end{tagmap}
55 \end{table}
56}
31 57
32\section{Power Related Information} 58\section{Power Related Information}
33\begin{table} 59\begin{table}
@@ -91,9 +117,9 @@ produce the information for the next file to be played.
91 that empties as the time progresses.} 117 that empties as the time progresses.}
92 \opt{lcd_bitmap}{ 118 \opt{lcd_bitmap}{
93 & This will replace the entire line with a progress bar. \\ 119 & This will replace the entire line with a progress bar. \\
94 & You can set the height, position and width of the progressbar % 120 & You can set the position, width and height of the progressbar %
95 (in pixels): \config{\%pb{\textbar}height{\textbar}leftpos% 121 (in pixels) and load a custom image for it: %
96 {\textbar}rightpos{\textbar}toppos{\textbar}}} \\ 122 \config{\%pb{\textbar}image.bmp{\textbar}x{\textbar}y{\textbar}width{\textbar}height{\textbar}}} \\
97 \opt{player}{% 123 \opt{player}{%
98 \config{\%pf} & Full-line progress bar \& time display\\ 124 \config{\%pf} & Full-line progress bar \& time display\\
99 }% 125 }%
@@ -231,7 +257,7 @@ Examples:
231 257
232 258
233\opt{lcd_bitmap}{ 259\opt{lcd_bitmap}{
234\section{Images} 260\section{\label{ref:wps_images}Images}
235\begin{table} 261\begin{table}
236 \begin{tagmap}{}{} 262 \begin{tagmap}{}{}
237 \nopt{archos}{% 263 \nopt{archos}{%
@@ -239,9 +265,6 @@ Examples:
239 & Load and set a backdrop image for the WPS. 265 & Load and set a backdrop image for the WPS.
240 This image must be exactly the same size as your LCD.\\ 266 This image must be exactly the same size as your LCD.\\
241 }% 267 }%
242 \config{\%P{\textbar}filename.bmp{\textbar}}
243 & Load a Progress Bar image for the WPS. Use \config{\%pb} tag to show the
244 progress bar\\
245 \config{\%x{\textbar}n{\textbar}filename{\textbar}x{\textbar}y{\textbar}} 268 \config{\%x{\textbar}n{\textbar}filename{\textbar}x{\textbar}y{\textbar}}
246 & Load and display an image\\ 269 & Load and display an image\\
247 & \config{n}: image ID (a-z and A-Z) for later referencing in \config{\%xd}\\ 270 & \config{n}: image ID (a-z and A-Z) for later referencing in \config{\%xd}\\