diff -urN microwindows-080127/src/config microwindows-080127.elpa/src/config --- microwindows-080127/src/config 2008-01-07 00:15:02.000000000 +0100 +++ microwindows-080127.elpa/src/config 2008-02-06 16:10:40.000000000 +0100 @@ -310,6 +310,7 @@ # NOMOUSE no mouse driver # # Touchscreen drivers +# EVENTMOUSE Standard event interface (/dev/input/event0) # IPAQMOUSE Compaq iPAQ, Intel Assabet (/dev/h3600_tsraw) # ZAURUSMOUSE Sharp Zaurus (/dev/sharp_ts) # TUXMOUSE TuxScreen (/dev/ucb1x00-ts) @@ -323,9 +324,10 @@ # HARRIERMOUSE NEC Harrier (/dev/tpanel) #################################################################### GPMMOUSE = N -SERMOUSE = Y +SERMOUSE = N SUNMOUSE = N NOMOUSE = N +EVENTMOUSE = Y IPAQMOUSE = N ZAURUSMOUSE = N TUXMOUSE = N diff -urN microwindows-080127/src/demos/mwin/mine.c microwindows-080127.elpa/src/demos/mwin/mine.c --- microwindows-080127/src/demos/mwin/mine.c 2005-06-17 01:42:11.000000000 +0200 +++ microwindows-080127.elpa/src/demos/mwin/mine.c 2008-02-04 14:01:23.000000000 +0100 @@ -16,6 +16,7 @@ #define MWINCLUDECOLORS #include "windows.h" #include "wintools.h" +#include "wintern.h" typedef struct { int flag; @@ -1049,6 +1050,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { + MwSetTextCoding ( MWTF_ASCII ); TestMyWindow (NULL); return 0; } diff -urN microwindows-080127/src/demos/nxroach/Makefile microwindows-080127.elpa/src/demos/nxroach/Makefile --- microwindows-080127/src/demos/nxroach/Makefile 2003-09-25 04:15:01.000000000 +0200 +++ microwindows-080127.elpa/src/demos/nxroach/Makefile 2008-02-04 14:01:23.000000000 +0100 @@ -49,9 +49,9 @@ ifeq ($(SHAREDLIBS), Y) $(MW_DIR_BIN)/nxroach: $(OBJS) $(NANOXCLIENTLIBS) $(CONFIG) @echo "Linking $(patsubst $(MW_DIR_BIN)/%,%,$@) ..." - $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@ $(CCNANOXCLIENTLIBS) + $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $@ $(CCNANOXCLIENTLIBS) else $(MW_DIR_BIN)/nxroach: $(OBJS) $(NANOXCLIENTLIBS) $(CONFIG) @echo "Linking $(patsubst $(MW_DIR_BIN)/%,%,$@) ..." - $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@ $(NANOXCLIENTLIBS) + $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $@ $(NANOXCLIENTLIBS) endif diff -urN microwindows-080127/src/drivers/mou_event.c microwindows-080127.elpa/src/drivers/mou_event.c --- microwindows-080127/src/drivers/mou_event.c 1970-01-01 01:00:00.000000000 +0100 +++ microwindows-080127.elpa/src/drivers/mou_event.c 2008-02-06 16:04:59.000000000 +0100 @@ -0,0 +1,110 @@ +/* + * Generic event touchscreen driver + * + * Copyright (c) 2008, ELPA sas + * Written by Davide Rizzo + */ + +#include +#include +#include +#include +#include +#include "device.h" + +#define TS_DEVICE "/dev/input/event0" + +extern SCREENDEVICE scrdev; +static int pd_fd = -1; + +static int PD_Open(MOUSEDEVICE *pmd) +{ + if((pd_fd = open(TS_DEVICE, O_NONBLOCK)) < 0) + { + EPRINTF("[%s] Error %d opening %s\n", TS_DEVICE, errno, TS_DEVICE); + return -1; + } + GdHideCursor(&scrdev); + return pd_fd; +} + +static void PD_Close(void) +{ + if(pd_fd < 0) + return; + close(pd_fd); + pd_fd = -1; +} + +static int PD_GetButtonInfo(void) +{ + /* get "mouse" buttons supported */ + return MWBUTTON_L; +} + +static void PD_GetDefaultAccel(int *pscale,int *pthresh) +{ + *pscale = 3; + *pthresh = 5; +} + +static int PD_Read(MWCOORD *px, MWCOORD *py, MWCOORD *pz, int *pb) +{ + struct input_event event; + int bytes_read; + static int x,y,z; + /* read a data point */ + while( (bytes_read = read(pd_fd, &event, sizeof(event))) == sizeof(event) ) + { + switch(event.type) + { + case EV_ABS: + switch(event.code) + { + case ABS_X: + x=event.value; + break; + case ABS_Y: + y=event.value; + break; + } + break; + case EV_KEY: + if(event.code==BTN_TOUCH) + z=event.value; + break; + case EV_SYN: + *px=x; + *py=y; + *pb = z ? MWBUTTON_L : 0; + *pz = z; + if(!*pb) + return 3; + return 2; + break; + } + } + if(bytes_read == -1) + { + if(errno == EINTR || errno == EAGAIN) return 0; + EPRINTF("[%s] Error %d reading from touch panel\n", TS_DEVICE, errno); + return -1; + } + if(bytes_read != 0) + { + EPRINTF("[%s] Wrong number of bytes %d read from touch panel " + "(expected %d)\n", TS_DEVICE, bytes_read, sizeof(event)); + return -1; + } + return 0; +} + +MOUSEDEVICE mousedev = { + PD_Open, + PD_Close, + PD_GetButtonInfo, + PD_GetDefaultAccel, + PD_Read, + NULL, + MOUSE_TRANSFORM /* Input filter flags */ +}; diff -urN microwindows-080127/src/drivers/Objects.rules microwindows-080127.elpa/src/drivers/Objects.rules --- microwindows-080127/src/drivers/Objects.rules 2005-06-15 18:38:19.000000000 +0200 +++ microwindows-080127.elpa/src/drivers/Objects.rules 2008-02-04 15:23:09.000000000 +0100 @@ -170,6 +170,11 @@ MW_CORE_OBJS += $(MW_DIR_OBJ)/drivers/mou_touchscreen.o endif +ifeq ($(EVENTMOUSE), Y) +CFLAGS += -DTOUCHSCREEN_EVENT=1 +MW_CORE_OBJS += $(MW_DIR_OBJ)/drivers/mou_event.o +endif + ifeq ($(IPAQMOUSE), Y) CFLAGS += -DTOUCHSCREEN_IPAQ=1 MW_CORE_OBJS += $(MW_DIR_OBJ)/drivers/mou_touchscreen.o diff -urN microwindows-080127/src/engine/devmouse.c microwindows-080127.elpa/src/engine/devmouse.c --- microwindows-080127/src/engine/devmouse.c 2005-06-23 07:00:00.000000000 +0200 +++ microwindows-080127.elpa/src/engine/devmouse.c 2008-02-06 16:40:36.000000000 +0100 @@ -636,7 +636,7 @@ break; case MWPORTRAIT_DOWN: - *xpos = x; + *xpos = scrdev.xres - x - 1; *ypos = scrdev.yres - y - 1; break; diff -urN microwindows-080127/src/mwin/winevent.c microwindows-080127.elpa/src/mwin/winevent.c --- microwindows-080127/src/mwin/winevent.c 2005-06-23 07:00:00.000000000 +0200 +++ microwindows-080127.elpa/src/mwin/winevent.c 2008-02-04 14:01:23.000000000 +0100 @@ -19,7 +19,7 @@ static LPFN_KEYBTRANSLATE mwPtrKeyboardTranslator = NULL; -#if !(DOS_TURBOC | DOS_QUICKC | _MINIX | VXWORKS) +#if !(DOS_TURBOC | DOS_QUICKC | _MINIX | VXWORKS | LINUX) static int abs(int n) {