aboutsummaryrefslogtreecommitdiffstats
path: root/layout.c
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2006-02-07 05:36:14 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2006-02-07 05:36:14 +0000
commit5c71af9339a592ef3759b40614685c83537d3ac3 (patch)
treea6162a3a2e0830014ca1705438fc18c35c98c7c1 /layout.c
parentb67414b92541d3a939ace92a458d27f3a3f91fb1 (diff)
downloadlcd4linux-5c71af9339a592ef3759b40614685c83537d3ac3.tar.gz
[lcd4linux @ 2006-02-07 05:36:13 by reinelt]
Layers added to Layout git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@634 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'layout.c')
-rw-r--r--layout.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/layout.c b/layout.c
index db48344..11fa1fe 100644
--- a/layout.c
+++ b/layout.c
@@ -1,4 +1,4 @@
-/* $Id: layout.c,v 1.19 2006/01/30 05:47:38 reinelt Exp $
+/* $Id: layout.c,v 1.20 2006/02/07 05:36:13 reinelt Exp $
*
* new layouter framework
*
@@ -23,6 +23,9 @@
*
*
* $Log: layout.c,v $
+ * Revision 1.20 2006/02/07 05:36:13 reinelt
+ * Layers added to Layout
+ *
* Revision 1.19 2006/01/30 05:47:38 reinelt
* graphic subsystem changed to full-color RGBA
*
@@ -130,7 +133,7 @@ int layout_init(const char *layout)
char *section;
char *list, *l;
char *widget;
- int row, col, num;
+ int lay, row, col, num;
info("initializing layout '%s'", layout);
@@ -159,12 +162,27 @@ int layout_init(const char *layout)
if ((p = strchr(l, '|')) != NULL)
*p = '\0';
- /* row/col widgets */
+ /* layer/row/col widgets */
+ i = sscanf(l, "layer:%d.row%d.col%d%n", &lay, &row, &col, &n);
+ if (i == 3 && l[n] == '\0') {
+ if (lay < 0 || lay >= LAYERS) {
+ error ("%s: layer %d out of bounds (0..%d)", section, lay, LAYERS-1);
+ } else {
+ widget = cfg_get(section, l, NULL);
+ if (widget != NULL && *widget != '\0') {
+ widget_add(widget, WIDGET_TYPE_RC, lay, row - 1, col - 1);
+ }
+ free(widget);
+ }
+ }
+
+ /* row/col widgets w/o layer*/
i = sscanf(l, "row%d.col%d%n", &row, &col, &n);
if (i == 2 && l[n] == '\0') {
widget = cfg_get(section, l, NULL);
if (widget != NULL && *widget != '\0') {
- widget_add(widget, WIDGET_TYPE_RC, 0, row - 1, col - 1);
+ /* default is layer 1 if outside layer section */
+ widget_add(widget, WIDGET_TYPE_RC, 1, row - 1, col - 1);
}
free(widget);
}