- Switched from from a CTK draw service to a statically linked CTK draw implementation.

- Workarounded the following CTK glitch:

ctk.c calls ctk_arch_keyavail() and ctk_arch_getkey() and needs therefore appropriate declarations (or macros) but it doesn't include a ctk_arch.h or alike to bring those in. So it's necessary to bring those declarations in via contiki-conf.h.

But ctk_arch_getkey() is supposed to return a ctk_arch_key_t - and this typedef'ed in ctk.h which means that ctk.h would need to be included in contiki-conf.h before declaring ctk_arch_getkey().

This IS rather undesirable so the current workaround is to declare ctk_arch_getkey() as returning a char - this is btw done similiar in platform/gtk as well. See ctk/ctk-gtksim.h:

guint ctk_arch_getkey(void);
This commit is contained in:
oliverschmidt 2007-04-15 13:30:16 +00:00
parent 13cdcbe393
commit 33eeb8ccbb
7 changed files with 26 additions and 28 deletions

View file

@ -30,7 +30,7 @@
*
* Author: Oliver Schmidt <ol.sc@web.de>
*
* $Id: ctk-console.c,v 1.8 2007/04/14 14:57:53 oliverschmidt Exp $
* $Id: ctk-console.c,v 1.9 2007/04/15 13:30:16 oliverschmidt Exp $
*/
#define WIN32_LEAN_AND_MEAN
@ -401,7 +401,7 @@ console_read(void)
}
}
/*-----------------------------------------------------------------------------------*/
ctk_arch_key_t
char
ctk_arch_getkey(void)
{
console_read();
@ -424,14 +424,26 @@ unsigned short
ctk_mouse_x(void)
{
console_read();
return xpos * 8;
return xpos;
}
/*-----------------------------------------------------------------------------------*/
unsigned short
ctk_mouse_y(void)
{
console_read();
return ypos * 8;
return ypos;
}
/*-----------------------------------------------------------------------------------*/
unsigned short
ctk_mouse_xtoc(unsigned short x)
{
return x;
}
/*-----------------------------------------------------------------------------------*/
unsigned short
ctk_mouse_ytoc(unsigned short y)
{
return y;
}
/*-----------------------------------------------------------------------------------*/
unsigned char