]> git.webhop.me Git - lcd4linux.git/commitdiff
[lcd4linux @ 2006-02-21 15:55:59 by cmay]
authorcmay <cmay@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Tue, 21 Feb 2006 15:55:59 +0000 (15:55 +0000)
committercmay <cmay@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Tue, 21 Feb 2006 15:55:59 +0000 (15:55 +0000)
removed new update function for keypad, consolidated it with draw

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

drv_generic_keypad.c
drv_generic_keypad.h
widget.h
widget_keypad.c

index cdf2d08bb2fdbf44917c18272494cd6c8f318d46..3a02b1440399ff6fc89c6a5c58630897f459c7fb 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: drv_generic_keypad.c,v 1.1 2006/02/21 05:50:34 reinelt Exp $
+/* $Id: drv_generic_keypad.c,v 1.2 2006/02/21 15:55:59 cmay Exp $
  *
  * generic driver helper for keypads
  *
@@ -23,6 +23,9 @@
  *
  *
  * $Log: drv_generic_keypad.c,v $
+ * Revision 1.2  2006/02/21 15:55:59  cmay
+ * removed new update function for keypad, consolidated it with draw
+ *
  * Revision 1.1  2006/02/21 05:50:34  reinelt
  * keypad support from Cris Maj
  *
@@ -72,8 +75,8 @@ int drv_generic_keypad_press(const int num)
 
     w = widget_find(WIDGET_TYPE_KEYPAD, &val);
 
-    if (w && w->class->update)
-       w->class->update(w);
+    if (w && w->class->draw)
+       w->class->draw(w);
 
     return val;
 }
index 1bc0c0379e2edbb66c63bf37770aadcf9496ab6e..98365c63393f5a82129fe379e53d34af0cb660f7 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: drv_generic_keypad.h,v 1.1 2006/02/21 05:50:34 reinelt Exp $
+/* $Id: drv_generic_keypad.h,v 1.2 2006/02/21 15:55:59 cmay Exp $
  *
  * generic driver helper for keypads
  *
@@ -20,6 +20,9 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  * $Log: drv_generic_keypad.h,v $
+ * Revision 1.2  2006/02/21 15:55:59  cmay
+ * removed new update function for keypad, consolidated it with draw
+ *
  * Revision 1.1  2006/02/21 05:50:34  reinelt
  * keypad support from Cris Maj
  *
@@ -39,7 +42,6 @@ extern int (*drv_generic_keypad_real_press) (const int num);
 /* generic functions and widget callbacks */
 int drv_generic_keypad_init(const char *section, const char *driver);
 int drv_generic_keypad_press(const int num);
-int drv_generic_keypad_draw(WIDGET * W);
 int drv_generic_keypad_quit(void);
 
 #endif
index d5f7abd7bcf1bd03740d876a0c308780fe48ecbf..13fd297d4e1a971063f0837a215d69e6bf821b1d 100644 (file)
--- a/widget.h
+++ b/widget.h
@@ -1,4 +1,4 @@
-/* $Id: widget.h,v 1.18 2006/02/21 05:50:34 reinelt Exp $
+/* $Id: widget.h,v 1.19 2006/02/21 15:55:59 cmay Exp $
  *
  * generic widget handling
  *
@@ -23,6 +23,9 @@
  *
  *
  * $Log: widget.h,v $
+ * Revision 1.19  2006/02/21 15:55:59  cmay
+ * removed new update function for keypad, consolidated it with draw
+ *
  * Revision 1.18  2006/02/21 05:50:34  reinelt
  * keypad support from Cris Maj
  *
@@ -111,7 +114,6 @@ typedef struct WIDGET_CLASS {
     int (*init) (struct WIDGET * Self);
     int (*draw) (struct WIDGET * Self);
     int (*find) (struct WIDGET * Self, void *needle);
-    void (*update) (void *Self);
     int (*quit) (struct WIDGET * Self);
 } WIDGET_CLASS;
 
index 8c278b18b2b9f2bd20ebc2b977b1311a4d653fba..d0de69ff515aef6f06320acfc94e223e253127c4 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: widget_keypad.c,v 1.1 2006/02/21 05:50:34 reinelt Exp $
+/* $Id: widget_keypad.c,v 1.2 2006/02/21 15:55:59 cmay Exp $
  *
  * keypad widget handling
  *
@@ -21,6 +21,9 @@
  *
  *
  * $Log: widget_keypad.c,v $
+ * Revision 1.2  2006/02/21 15:55:59  cmay
+ * removed new update function for keypad, consolidated it with draw
+ *
  * Revision 1.1  2006/02/21 05:50:34  reinelt
  * keypad support from Cris Maj
  *
 #endif
 
 
-void widget_keypad_update(void *Self)
+int widget_keypad_draw(WIDGET * Self)
 {
-    WIDGET *W = (WIDGET *) Self;
-    WIDGET_KEYPAD *keypad = W->data;
+    WIDGET_KEYPAD *keypad = Self->data;
     RESULT result = { 0, 0, 0, NULL };
 
     int val;
@@ -72,10 +74,7 @@ void widget_keypad_update(void *Self)
     }
     keypad->val = val;
 
-    /* finally, draw it! */
-    if (W->class->draw)
-       W->class->draw(W);
-
+    return val;
 }
 
 
@@ -169,8 +168,7 @@ WIDGET_CLASS Widget_Keypad = {
   name:"keypad",
   type:WIDGET_TYPE_KEYPAD,
   init:widget_keypad_init,
-  draw:NULL,
+  draw:widget_keypad_draw,
   find:widget_keypad_find,
-  update:widget_keypad_update,
   quit:widget_keypad_quit,
 };