From 21152104d296939c2babecd8999b03c325de0b2c Mon Sep 17 00:00:00 2001 From: reinelt Date: Wed, 26 May 2004 11:37:36 +0000 Subject: [lcd4linux @ 2004-05-26 11:37:35 by reinelt] Curses driver ported. git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@436 3ae390bd-cb1e-0410-b409-cd5a39f66f1f --- drv_generic_text.c | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) (limited to 'drv_generic_text.c') diff --git a/drv_generic_text.c b/drv_generic_text.c index bb28a89..68d776a 100644 --- a/drv_generic_text.c +++ b/drv_generic_text.c @@ -1,4 +1,4 @@ -/* $Id: drv_generic_text.c,v 1.13 2004/03/19 09:17:46 reinelt Exp $ +/* $Id: drv_generic_text.c,v 1.14 2004/05/26 11:37:36 reinelt Exp $ * * generic driver helper for text-based displays * @@ -23,6 +23,10 @@ * * * $Log: drv_generic_text.c,v $ + * Revision 1.14 2004/05/26 11:37:36 reinelt + * + * Curses driver ported. + * * Revision 1.13 2004/03/19 09:17:46 reinelt * * removed the extra 'goto' function, row and col are additional parameters @@ -142,8 +146,10 @@ int ICONS; // number of user-defineable characters reserved for icons static unsigned char *LayoutFB = NULL; static unsigned char *DisplayFB = NULL; -static int nSegment=0; -static int fSegment=0; +static int Single_Segments = 0; + +static int nSegment = 0; +static int fSegment = 0; static SEGMENT Segment[128]; static BAR *BarFB = NULL; @@ -486,7 +492,7 @@ static void drv_generic_text_bar_pack_segments (void) pack_j=-1; for (i=fSegment; ival1 * (double)(max); val2 = Bar->val2 * (double)(max); - if (val1<1) val1=1; - else if (val1>max) val1=max; + if (val1 < 1) val1 = 1; + else if (val1 > max) val1 = max; - if (val2<1) val2=1; - else if (val2>max) val2=max; + if (val2 < 1) val2 = 1; + else if (val2 > max) val2 = max; + + if (Single_Segments) val2 = val1; // create this bar drv_generic_text_bar_create_bar (row, col, dir, len, val1, val2); @@ -704,7 +716,7 @@ int drv_generic_text_icon_init (void) } -int drv_generic_text_bar_init (void) +int drv_generic_text_bar_init (int single_segments) { if (BarFB) free (BarFB); @@ -713,6 +725,8 @@ int drv_generic_text_bar_init (void) return -1; } + Single_Segments = single_segments; + nSegment=0; fSegment=0; -- cgit v1.2.3