[lcd4linux @ 2006-02-21 15:55:59 by cmay]

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
This commit is contained in:
cmay
2006-02-21 15:55:59 +00:00
parent 441c85697d
commit 6fcef13439
4 changed files with 22 additions and 17 deletions
+6 -3
View 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;
}
+4 -2
View 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
+4 -2
View File
@@ -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;
+8 -10
View 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
*
@@ -55,10 +58,9 @@
#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,
};