summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/gui/viewport.c8
-rw-r--r--apps/gui/viewport.h27
2 files changed, 19 insertions, 16 deletions
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c
index d30352a845..ef527d90cc 100644
--- a/apps/gui/viewport.c
+++ b/apps/gui/viewport.c
@@ -200,7 +200,7 @@ const char* viewport_parse_viewport(struct viewport *vp,
200 { 200 {
201 if (!(ptr = parse_list("ddddd", &set, separator, ptr, 201 if (!(ptr = parse_list("ddddd", &set, separator, ptr,
202 &vp->x, &vp->y, &vp->width, &vp->height, &vp->font))) 202 &vp->x, &vp->y, &vp->width, &vp->height, &vp->font)))
203 return VP_ERROR; 203 return NULL;
204 } 204 }
205 else 205 else
206#endif 206#endif
@@ -210,7 +210,7 @@ const char* viewport_parse_viewport(struct viewport *vp,
210 if (!(ptr = parse_list(ARG_STRING(depth), &set, separator, ptr, 210 if (!(ptr = parse_list(ARG_STRING(depth), &set, separator, ptr,
211 &vp->x, &vp->y, &vp->width, &vp->height, &vp->font, 211 &vp->x, &vp->y, &vp->width, &vp->height, &vp->font,
212 &vp->fg_pattern,&vp->bg_pattern))) 212 &vp->fg_pattern,&vp->bg_pattern)))
213 return VP_ERROR; 213 return NULL;
214 } 214 }
215 else 215 else
216#undef ARG_STRING 216#undef ARG_STRING
@@ -219,7 +219,7 @@ const char* viewport_parse_viewport(struct viewport *vp,
219 219
220 /* X and Y *must* be set */ 220 /* X and Y *must* be set */
221 if (!LIST_VALUE_PARSED(set, PL_X) || !LIST_VALUE_PARSED(set, PL_Y)) 221 if (!LIST_VALUE_PARSED(set, PL_X) || !LIST_VALUE_PARSED(set, PL_Y))
222 return VP_ERROR; 222 return NULL;
223 223
224 /* fix defaults */ 224 /* fix defaults */
225 if (!LIST_VALUE_PARSED(set, PL_WIDTH)) 225 if (!LIST_VALUE_PARSED(set, PL_WIDTH))
@@ -244,7 +244,7 @@ const char* viewport_parse_viewport(struct viewport *vp,
244 (vp->y >= screens[screen].lcdheight) || 244 (vp->y >= screens[screen].lcdheight) ||
245 ((vp->y + vp->height) > screens[screen].lcdheight)) 245 ((vp->y + vp->height) > screens[screen].lcdheight))
246 { 246 {
247 return VP_ERROR; 247 return NULL;
248 } 248 }
249 249
250 /* Default to using the user font if the font was an invalid number or '-'*/ 250 /* Default to using the user font if the font was an invalid number or '-'*/
diff --git a/apps/gui/viewport.h b/apps/gui/viewport.h
index f703c97342..16f52eb292 100644
--- a/apps/gui/viewport.h
+++ b/apps/gui/viewport.h
@@ -28,25 +28,28 @@
28/* return the number of text lines in the vp viewport */ 28/* return the number of text lines in the vp viewport */
29int viewport_get_nb_lines(struct viewport *vp); 29int viewport_get_nb_lines(struct viewport *vp);
30 30
31#define VP_ERROR 0
32#define VP_DIMENSIONS 0x1
33#define VP_COLORS 0x2
34#define VP_SELECTIONCOLORS 0x4
35/* load a viewport struct from a config string.
36 returns a combination of the above to say which were loaded ok from the string */
37int viewport_load_config(const char *config, struct viewport *vp);
38
39void viewport_set_defaults(struct viewport *vp, enum screen_type screen); 31void viewport_set_defaults(struct viewport *vp, enum screen_type screen);
40 32
41/* parse a viewport list, which looks like 33/* Parse a viewport definition (vp_def), which looks like:
42 * X|Y|width|height|font|foregorund color|background color 34 *
43 * | is a separator */ 35 * Screens with depth > 1:
36 * X|Y|width|height|font|foregorund color|background color
37 * Screens with depth = 1:
38 * X|Y|width|height|font
39 *
40 * | is a separator and can be specified via the parameter
41 *
42 * Returns the pointer to the char after the last character parsed
43 * if everything went OK or NULL if an error happened (some values
44 * not specified in the definition)
45 */
44#ifdef HAVE_LCD_BITMAP 46#ifdef HAVE_LCD_BITMAP
45const char* viewport_parse_viewport(struct viewport *vp, 47const char* viewport_parse_viewport(struct viewport *vp,
46 enum screen_type screen, 48 enum screen_type screen,
47 const char *bufptr, 49 const char *vp_def,
48 const char separator); 50 const char separator);
49#endif 51#endif
52
50/* Used to specify which screens the statusbar (SB) should be displayed on. 53/* Used to specify which screens the statusbar (SB) should be displayed on.
51 * 54 *
52 * The parameter is a bit OR'ed combination of the following (screen is 55 * The parameter is a bit OR'ed combination of the following (screen is