tinyx-011010.patch 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. diff -Nur --exclude=CVS xc-011010.src/include/extensions/lbxstr.h xc-011010/include/extensions/lbxstr.h
  2. --- xc-011010.src/include/extensions/lbxstr.h Tue Jul 31 20:44:35 2001
  3. +++ xc-011010/include/extensions/lbxstr.h Sun Apr 21 12:35:05 2002
  4. @@ -25,7 +25,7 @@
  5. #ifndef _LBXSTR_H_
  6. #define _LBXSTR_H_
  7. -#include <X11/extensions/XLbx.h>
  8. +#include "XLbx.h"
  9. #define LBXNAME "LBX"
  10. diff -Nur --exclude=CVS xc-011010.src/programs/Xserver/hw/kdrive/fbdev/fbdev.h xc-011010/programs/Xserver/hw/kdrive/fbdev/fbdev.h
  11. --- xc-011010.src/programs/Xserver/hw/kdrive/fbdev/fbdev.h Sun Jun 3 17:52:45 2001
  12. +++ xc-011010/programs/Xserver/hw/kdrive/fbdev/fbdev.h Sun Apr 21 12:36:25 2002
  13. @@ -29,6 +29,7 @@
  14. #include <linux/fb.h>
  15. #include <unistd.h>
  16. #include <sys/mman.h>
  17. +#include <sys/types.h>
  18. #include "kdrive.h"
  19. #include "layer.h"
  20. diff -Nur xc-011010.src2/lib/X11/Xlib.h xc-011010/lib/X11/Xlib.h
  21. --- xc-011010.src/programs/Xserver/hw/kdrive/linux/ts.c Tue Jul 10 22:58:19 2001
  22. +++ xc-011010/programs/Xserver/hw/kdrive/linux/ts.c Tue Apr 23 20:16:23 2002
  23. @@ -33,65 +33,48 @@
  24. #include "kdrive.h"
  25. #include "Xpoll.h"
  26. #include <sys/ioctl.h>
  27. -#include <linux/h3600_ts.h> /* touch screen events */
  28. +
  29. +typedef struct {
  30. + unsigned short pressure;
  31. + unsigned short x;
  32. + unsigned short y;
  33. + unsigned short pad;
  34. + struct timeval stamp;
  35. +} TS_EVENT;
  36. static long lastx = 0, lasty = 0;
  37. int TsScreen;
  38. extern int TsFbdev;
  39. -void
  40. -TsRead (int tsPort, void *closure)
  41. -{
  42. - TS_EVENT event;
  43. - long buf[3];
  44. - int n;
  45. - long pressure;
  46. - long x, y;
  47. - unsigned long flags;
  48. - unsigned long buttons;
  49. -
  50. - n = Ps2ReadBytes (tsPort, (char *) &event,
  51. - sizeof (event), sizeof (event));
  52. - if (n == sizeof (event))
  53. - {
  54. - if (event.pressure)
  55. - {
  56. - /*
  57. - * HACK ATTACK. (static global variables used !)
  58. - * Here we test for the touch screen driver actually being on the
  59. - * touch screen, if it is we send absolute coordinates. If not,
  60. - * then we send delta's so that we can track the entire vga screen.
  61. - */
  62. - if (TsScreen == TsFbdev) {
  63. - flags = KD_BUTTON_1;
  64. - x = event.x;
  65. - y = event.y;
  66. - } else {
  67. - flags = /* KD_BUTTON_1 |*/ KD_MOUSE_DELTA;
  68. - if ((lastx == 0) || (lasty == 0)) {
  69. - x = 0;
  70. - y = 0;
  71. - } else {
  72. - x = event.x - lastx;
  73. - y = event.y - lasty;
  74. - }
  75. - lastx = event.x;
  76. - lasty = event.y;
  77. - }
  78. - } else {
  79. - flags = KD_MOUSE_DELTA;
  80. - x = 0;
  81. - y = 0;
  82. - lastx = 0;
  83. - lasty = 0;
  84. - }
  85. - KdEnqueueMouseEvent (flags, x, y);
  86. +void TsRead (int tsPort, void *closure) {
  87. + TS_EVENT event;
  88. + long buf[3];
  89. + int n;
  90. + long pressure;
  91. + long x, y;
  92. + unsigned long flags;
  93. + unsigned long buttons;
  94. +
  95. + n = Ps2ReadBytes(tsPort, (char *) &event, sizeof (event), sizeof (event));
  96. + if (n >= sizeof (event)) {
  97. + if (event.pressure >= 100) {
  98. + flags = KD_BUTTON_1;
  99. + x = (960 - event.x) * 640 / (920);
  100. + y = (960 - event.y) * 480 / (920);
  101. + //ErrorF("flags %d x %d y %dn",flags,event.x,event.y);
  102. + }
  103. + else {
  104. + flags = KD_MOUSE_DELTA;
  105. + x = lastx;
  106. + y = lasty;
  107. }
  108. + KdEnqueueMouseEvent(flags, x, y);
  109. + }
  110. }
  111. char *TsNames[] = {
  112. - "/dev/ts",
  113. - "/dev/h3600_ts" /* temporary name; note this code can try
  114. + "/dev/ucb1x00-ts",
  115. + "/dev/ts" /* temporary name; note this code can try
  116. to open more than one device */
  117. };
  118. @@ -99,9 +82,7 @@
  119. int TsInputType;
  120. -int
  121. -TsInit (void)
  122. -{
  123. +int TsInit (void) {
  124. int i;
  125. int TsPort;
  126. diff -Nur xc-011010.src/startx xc-011010/startx
  127. --- ../../buildroot-tux.Apr25-1/build/xc-011010.src/startx Thu Apr 25 05:20:35 2002
  128. +++ xc-011010/startx Sun Apr 28 05:35:35 2002
  129. @@ -0,0 +1,11 @@
  130. +#!/bin/sh
  131. +killall Xfbdev
  132. +sleep 1
  133. +export DISPLAY=":0"
  134. +/usr/X11R6/bin/Xfbdev -ac &
  135. +sleep 4
  136. +/usr/X11R6/bin/matchbox &
  137. +sleep 1
  138. +/usr/X11R6/bin/minisys &
  139. +/usr/X11R6/bin/minitime &
  140. +/usr/X11R6/bin/rxvt &
  141. diff -Nur xc-011010.src/lib/Xft/xftgram.y xc-011010/lib/Xft/xftgram.y
  142. --- ../../buildroot-tux.Apr25-1/build/xc-011010/lib/Xft/xftgram.y Thu Apr 25 05:20:35 2002
  143. +++ xc-011010/lib/Xft/xftgram.y Sun Apr 28 05:35:35 2002
  144. @@ -165,6 +165,7 @@
  145. matrix.yx = $4;
  146. matrix.__REALLY_YY__ = $5;
  147. }
  148. + ;
  149. number : INTEGER
  150. { $$ = (double) $1; }
  151. | DOUBLE
  152. diff -Nur xc-011010.src/programs/twm/gram.y xc-011010/programs/twm/gram.y
  153. --- ../../buildroot-tux.Apr25-1/build/xc-011010/programs/twm/gram.y Thu Apr 25 05:20:35 2002
  154. +++ xc-011010/programs/twm/gram.y Sun Apr 28 05:35:35 2002
  155. @@ -650,6 +650,7 @@
  156. RemoveDQuote(ptr);
  157. $$ = ptr;
  158. }
  159. + ;
  160. number : NUMBER { $$ = $1; }
  161. ;