]> git.webhop.me Git - lcd4linux.git/commitdiff
[lcd4linux @ 2004-02-07 13:45:23 by reinelt]
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Sat, 7 Feb 2004 13:45:23 +0000 (13:45 +0000)
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Sat, 7 Feb 2004 13:45:23 +0000 (13:45 +0000)
icon visibility patch #2 from Xavier

git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@358 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

drv_generic_text.c
widget_icon.c

index 8c9fe05dd3232219bd0e1ad588ff8cb8e36caa18..d05f370f106d3946ee3d019032fa7eff21e187ea 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: drv_generic_text.c,v 1.8 2004/01/30 20:57:56 reinelt Exp $
+/* $Id: drv_generic_text.c,v 1.9 2004/02/07 13:45:23 reinelt Exp $
  *
  * generic driver helper for text-based displays
  *
@@ -23,6 +23,9 @@
  *
  *
  * $Log: drv_generic_text.c,v $
+ * Revision 1.9  2004/02/07 13:45:23  reinelt
+ * icon visibility patch #2 from Xavier
+ *
  * Revision 1.8  2004/01/30 20:57:56  reinelt
  * HD44780 patch from Martin Hejl
  * dmalloc integrated
@@ -241,6 +244,7 @@ int drv_generic_text_icon_draw (WIDGET *W)
   static int icon_counter=0;
   WIDGET_ICON *Icon = W->data;
   int row, col;
+  char ascii;
   
   row = W->row;
   col = W->col;
@@ -267,12 +271,15 @@ int drv_generic_text_icon_draw (WIDGET *W)
     drv_generic_text_real_defchar(Icon->ascii, Icon->bitmap+YRES*Icon->curmap);
   }
 
+  // use blank if invisible
+  ascii=Icon->visible?Icon->ascii:' ';
+
   // transfer icon into layout buffer
-  LayoutFB[row*LCOLS+col]=Icon->ascii;
-  
+  LayoutFB[row*LCOLS+col]=ascii;
+
   // maybe send icon to the display
-  if (DisplayFB[row*DCOLS+col]!=Icon->ascii) {
-    DisplayFB[row*DCOLS+col]=Icon->ascii;
+  if (DisplayFB[row*DCOLS+col]!=ascii) {
+    DisplayFB[row*DCOLS+col]=ascii;
     drv_generic_text_real_goto (row, col);
     drv_generic_text_real_write (DisplayFB+row*DCOLS+col, 1);
   }
index 5420f14031efdcf412eababca5f724fd73cda205..3c631d998c75ceee43f1c9834f05b219cb8505ca 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: widget_icon.c,v 1.5 2004/02/04 19:11:44 reinelt Exp $
+/* $Id: widget_icon.c,v 1.6 2004/02/07 13:45:23 reinelt Exp $
  *
  * icon widget handling
  *
@@ -21,6 +21,9 @@
  *
  *
  * $Log: widget_icon.c,v $
+ * Revision 1.6  2004/02/07 13:45:23  reinelt
+ * icon visibility patch #2 from Xavier
+ *
  * Revision 1.5  2004/02/04 19:11:44  reinelt
  * icon visibility patch from Xavier
  *
@@ -128,14 +131,10 @@ void widget_icon_update (void *Self)
     DelResult(&result);
   }  
   
-  if (Icon->visible) {  
   // rotate icon bitmap
   Icon->curmap++;
   if (Icon->curmap >= Icon->maxmap)
     Icon->curmap=0;
-  } else {
-    Icon->curmap=0;     // FIXME : put an emply map here !
-  }
   
   // finally, draw it!
   if (W->class->draw)
@@ -174,10 +173,6 @@ int widget_icon_init (WIDGET *Self)
     error ("Icon %s has no speed, using '100'", Self->name);
     Icon->speed_expr="100";
   }
-  if (Icon->visible_expr==NULL || *Icon->visible_expr=='\0') {
-    error ("Icon %s has no visible atribute, using '1'", Self->name);
-    Icon->visible_expr="1";
-  }  
   
   // read bitmap
   widget_icon_read_bitmap (section, Icon);