--- microwin/src/nanox/srvutil.c 2003-05-11 19:14:54.000000000 +0200 +++ ipaq-microwin/src/nanox/srvutil.c 2004-08-25 12:17:00.000000000 +0200 @@ -9,6 +9,7 @@ */ #include #include +#include #ifndef __PACIFIC__ #include @@ -1340,3 +1341,43 @@ GdMoveMouse(scrdev.xvirtres-5, rooty); } } + +/* + * Get calibration data from file provided and store to + * glabal transform struct + */ +int +GsLoadTransformData(char *filename, GR_TRANSFORM * trans) +{ + int ret = 0; + FILE *in = 0; + + if (!trans) + return -1; + memset(trans, '\0', sizeof(GR_TRANSFORM)); + + in = fopen(filename, "r"); + if (!in) + return -1; + + while (!feof(in) && !ferror(in)) { + char buffer[128]; + if (!fgets(buffer, sizeof(buffer) - 1, in)) + continue; + + if (buffer[0] == '#') + continue; + + if (sscanf(buffer, "%d %d %d %d %d %d %d", + &trans->a, &trans->b, &trans->c, + &trans->d, &trans->e, &trans->f, &trans->s) == 7) + goto exit_load; + } + + ret = -1; +exit_load: + + fclose(in); + return ret; +} + --- microwin/src/nanox/srvmain.c 2003-08-11 22:38:38.000000000 +0200 +++ ipaq-microwin/src/nanox/srvmain.c 2004-08-25 13:38:30.000000000 +0200 @@ -93,6 +93,7 @@ int autoportrait = FALSE; /* auto portrait mode switching*/ MWCOORD nxres; /* requested server x resolution*/ MWCOORD nyres; /* requested server y resolution*/ +GR_TRANSFORM trans; /* mouse transform for ts pointer */ #if MW_FEATURE_TIMERS GR_TIMEOUT screensaver_delay; /* time before screensaver activates */ @@ -113,8 +114,21 @@ static void usage(void) { - printf("Usage: %s [-e] [-p] [-A] [-NLRD] [-x#] [-y#] [-c ...]\n", - progname); + printf("Usage: %s [OPTIONS]...\n\n", progname); + + printf("OPTIONS are:\n"); + printf("\t-e\t\t\thitting ESC terminates nano server\n"); + printf("\t-p\t\t\tdo not terminate nano server when last client exits\n"); + printf("\t-A\t\t\tauto portrait mode switching\n"); + printf("\t-N\t\t\tset screen portrait mode to NONE\n"); + printf("\t-L\t\t\tset screen portrait mode to LEFT\n"); + printf("\t-R\t\t\tset screen portrait mode to RIGHT\n"); + printf("\t-D\t\t\tset screen portrait mode to DOWN\n"); + printf("\t-x #\t\t\trequest server x resolution\n"); + printf("\t-y #\t\t\trequest server y resolution\n"); + printf("\t-C \tfont configuration file\n"); + printf("\t-d \ttouchscreen calibration data file\n"); + exit(1); } @@ -180,6 +194,15 @@ ++t; continue; } + if ( !strcmp("-d",argv[t]) ) { + if (++t >= argc) + usage(); + int ret = GsLoadTransformData(argv[t], &trans); + if (!ret) + GrSetTransform(&trans); + ++t; + continue; + } #if FONTMAPPER if ( !strcmp("-c",argv[t]) ) { int read_configfile(char *file); --- test-microwin/src/nanox/serv.h 2003-05-18 07:58:50.000000000 +0200 +++ ipaq-microwin/src/nanox/serv.h 2004-08-25 12:15:59.000000000 +0200 @@ -506,6 +506,7 @@ void GsResetScreenSaver(void); void GsActivateScreenSaver(void *arg); void GrGetNextEventWrapperFinish(int); +int GsLoadTransformData(char *filename, GR_TRANSFORM * trans); /* * External data definitions.