summaryrefslogtreecommitdiff
path: root/manual/advanced_topics/main.tex
diff options
context:
space:
mode:
Diffstat (limited to 'manual/advanced_topics/main.tex')
-rw-r--r--manual/advanced_topics/main.tex101
1 files changed, 96 insertions, 5 deletions
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}